Lines Matching refs:us

64 	struct us_data *us = host_to_us(host);
65 return us->scsi_name;
70 struct us_data *us = host_to_us(sdev->host);
86 if (us->protocol == USB_PR_BULK && us->max_lun > 0)
94 struct us_data *us = host_to_us(sdev->host);
95 struct device *dev = us->pusb_dev->bus->sysdev;
102 if (us->fflags & (US_FL_MAX_SECTORS_64 | US_FL_MAX_SECTORS_MIN)) {
105 if (us->fflags & US_FL_MAX_SECTORS_MIN)
117 } else if (us->pusb_dev->speed >= USB_SPEED_SUPER) {
119 * USB3 devices will be limited to 2048 sectors. This gives us
138 if (!hcd_uses_dma(bus_to_hcd(us->pusb_dev->bus)) ||
139 (bus_to_hcd(us->pusb_dev->bus)->localmem_pool != NULL))
157 switch (le16_to_cpu(us->pusb_dev->descriptor.idVendor)) {
162 if (!(us->fflags & (US_FL_FIX_CAPACITY |
164 us->fflags |= US_FL_CAPACITY_HEURISTICS;
173 if (us->subclass != USB_SC_SCSI && us->subclass != USB_SC_CYP_ATACB)
198 if (us->fflags & US_FL_NO_WP_DETECT)
224 if (us->fflags & US_FL_FIX_CAPACITY)
232 if (us->fflags & US_FL_CAPACITY_HEURISTICS)
236 if (us->fflags & US_FL_NO_READ_CAPACITY_16)
245 if (!(us->fflags & US_FL_NEEDS_CAP16))
253 !(us->fflags & US_FL_BAD_SENSE))
254 us->fflags |= US_FL_SANE_SENSE;
284 if (!(us->fflags & (US_FL_FIX_CAPACITY | US_FL_CAPACITY_OK |
286 us->protocol == USB_PR_BULK)
287 us->use_last_sector_hacks = 1;
290 if (us->fflags & US_FL_WRITE_CACHE)
294 if (us->fflags & US_FL_BROKEN_FUA)
298 if (us->fflags & US_FL_ALWAYS_SYNC) {
315 if (us->fflags & US_FL_NO_READ_DISC_INFO)
326 if ((us->protocol == USB_PR_CB || us->protocol == USB_PR_CBI) &&
328 us->max_lun = 0;
334 if (us->fflags & US_FL_NOT_LOCKABLE)
346 struct us_data *us = host_to_us(dev_to_shost(starget->dev.parent));
365 if (us->subclass == USB_SC_UFI)
376 struct us_data *us = host_to_us(srb->device->host);
379 if (us->srb != NULL) {
380 dev_err(&us->pusb_intf->dev,
381 "Error in %s: us->srb = %p\n", __func__, us->srb);
386 if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags)) {
387 usb_stor_dbg(us, "Fail command during disconnect\n");
393 if ((us->fflags & US_FL_NO_ATA_1X) &&
403 us->srb = srb;
404 complete(&us->cmnd_ready);
416 static int command_abort_matching(struct us_data *us, struct scsi_cmnd *srb_match)
419 * us->srb together with the TIMED_OUT, RESETTING, and ABORTING
422 scsi_lock(us_to_host(us));
425 if (!us->srb) {
426 scsi_unlock(us_to_host(us));
427 usb_stor_dbg(us, "-- nothing to abort\n");
432 if (srb_match && us->srb != srb_match) {
433 scsi_unlock(us_to_host(us));
434 usb_stor_dbg(us, "-- pending command mismatch\n");
445 set_bit(US_FLIDX_TIMED_OUT, &us->dflags);
446 if (!test_bit(US_FLIDX_RESETTING, &us->dflags)) {
447 set_bit(US_FLIDX_ABORTING, &us->dflags);
448 usb_stor_stop_transport(us);
450 scsi_unlock(us_to_host(us));
453 wait_for_completion(&us->notify);
459 struct us_data *us = host_to_us(srb->device->host);
461 usb_stor_dbg(us, "%s called\n", __func__);
462 return command_abort_matching(us, srb);
471 struct us_data *us = host_to_us(srb->device->host);
474 usb_stor_dbg(us, "%s called\n", __func__);
477 command_abort_matching(us, NULL);
480 mutex_lock(&(us->dev_mutex));
481 result = us->transport_reset(us);
482 mutex_unlock(&us->dev_mutex);
490 struct us_data *us = host_to_us(srb->device->host);
493 usb_stor_dbg(us, "%s called\n", __func__);
495 result = usb_stor_port_reset(us);
504 void usb_stor_report_device_reset(struct us_data *us)
507 struct Scsi_Host *host = us_to_host(us);
510 if (us->fflags & US_FL_SCM_MULT_TARG) {
521 void usb_stor_report_bus_reset(struct us_data *us)
523 struct Scsi_Host *host = us_to_host(us);
536 /* if someone is sending us data, just throw it away */
542 struct us_data *us = host_to_us(host);
549 if (us->pusb_dev->manufacturer)
550 string = us->pusb_dev->manufacturer;
551 else if (us->unusual_dev->vendorName)
552 string = us->unusual_dev->vendorName;
556 if (us->pusb_dev->product)
557 string = us->pusb_dev->product;
558 else if (us->unusual_dev->productName)
559 string = us->unusual_dev->productName;
563 if (us->pusb_dev->serial)
564 string = us->pusb_dev->serial;
570 seq_printf(m, " Protocol: %s\n", us->protocol_name);
571 seq_printf(m, " Transport: %s\n", us->transport_name);
577 if (us->fflags & value) seq_printf(m, " " #name);