Lines Matching full:us
63 struct us_data *us = host_to_us(host); in host_info() local
64 return us->scsi_name; in host_info()
69 struct us_data *us = host_to_us(sdev->host); in sdev_init() local
79 if (us->protocol == USB_PR_BULK && us->max_lun > 0) in sdev_init()
93 struct us_data *us = host_to_us(sdev->host); in sdev_configure() local
94 struct device *dev = us->pusb_dev->bus->sysdev; in sdev_configure()
101 if (us->fflags & (US_FL_MAX_SECTORS_64 | US_FL_MAX_SECTORS_MIN)) { in sdev_configure()
104 if (us->fflags & US_FL_MAX_SECTORS_MIN) in sdev_configure()
114 } else if (us->pusb_dev->speed >= USB_SPEED_SUPER) { in sdev_configure()
116 * USB3 devices will be limited to 2048 sectors. This gives us in sdev_configure()
144 switch (le16_to_cpu(us->pusb_dev->descriptor.idVendor)) { in sdev_configure()
149 if (!(us->fflags & (US_FL_FIX_CAPACITY | in sdev_configure()
151 us->fflags |= US_FL_CAPACITY_HEURISTICS; in sdev_configure()
160 if (us->subclass != USB_SC_SCSI && us->subclass != USB_SC_CYP_ATACB) in sdev_configure()
185 if (us->fflags & US_FL_NO_WP_DETECT) in sdev_configure()
211 if (us->fflags & US_FL_FIX_CAPACITY) in sdev_configure()
219 if (us->fflags & US_FL_CAPACITY_HEURISTICS) in sdev_configure()
223 if (us->fflags & US_FL_NO_READ_CAPACITY_16) in sdev_configure()
232 if (!(us->fflags & US_FL_NEEDS_CAP16)) in sdev_configure()
240 !(us->fflags & US_FL_BAD_SENSE)) in sdev_configure()
241 us->fflags |= US_FL_SANE_SENSE; in sdev_configure()
271 if (!(us->fflags & (US_FL_FIX_CAPACITY | US_FL_CAPACITY_OK | in sdev_configure()
273 us->protocol == USB_PR_BULK) in sdev_configure()
274 us->use_last_sector_hacks = 1; in sdev_configure()
277 if (us->fflags & US_FL_WRITE_CACHE) in sdev_configure()
281 if (us->fflags & US_FL_BROKEN_FUA) in sdev_configure()
285 if (us->fflags & US_FL_ALWAYS_SYNC) { in sdev_configure()
302 if (us->fflags & US_FL_NO_READ_DISC_INFO) in sdev_configure()
313 if ((us->protocol == USB_PR_CB || us->protocol == USB_PR_CBI) && in sdev_configure()
315 us->max_lun = 0; in sdev_configure()
321 if (us->fflags & US_FL_NOT_LOCKABLE) in sdev_configure()
333 struct us_data *us = host_to_us(dev_to_shost(starget->dev.parent)); in target_alloc() local
352 if (us->subclass == USB_SC_UFI) in target_alloc()
363 struct us_data *us = host_to_us(srb->device->host); in queuecommand_lck() local
366 if (us->srb != NULL) { in queuecommand_lck()
367 dev_err(&us->pusb_intf->dev, in queuecommand_lck()
368 "Error in %s: us->srb = %p\n", __func__, us->srb); in queuecommand_lck()
373 if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags)) { in queuecommand_lck()
374 usb_stor_dbg(us, "Fail command during disconnect\n"); in queuecommand_lck()
380 if ((us->fflags & US_FL_NO_ATA_1X) && in queuecommand_lck()
390 us->srb = srb; in queuecommand_lck()
391 complete(&us->cmnd_ready); in queuecommand_lck()
403 static int command_abort_matching(struct us_data *us, struct scsi_cmnd *srb_match) in DEF_SCSI_QCMD()
406 * us->srb together with the TIMED_OUT, RESETTING, and ABORTING in DEF_SCSI_QCMD()
409 scsi_lock(us_to_host(us)); in DEF_SCSI_QCMD()
412 if (!us->srb) { in DEF_SCSI_QCMD()
413 scsi_unlock(us_to_host(us)); in DEF_SCSI_QCMD()
414 usb_stor_dbg(us, "-- nothing to abort\n"); in DEF_SCSI_QCMD()
419 if (srb_match && us->srb != srb_match) { in DEF_SCSI_QCMD()
420 scsi_unlock(us_to_host(us)); in DEF_SCSI_QCMD()
421 usb_stor_dbg(us, "-- pending command mismatch\n"); in DEF_SCSI_QCMD()
432 set_bit(US_FLIDX_TIMED_OUT, &us->dflags); in DEF_SCSI_QCMD()
433 if (!test_bit(US_FLIDX_RESETTING, &us->dflags)) { in DEF_SCSI_QCMD()
434 set_bit(US_FLIDX_ABORTING, &us->dflags); in DEF_SCSI_QCMD()
435 usb_stor_stop_transport(us); in DEF_SCSI_QCMD()
437 scsi_unlock(us_to_host(us)); in DEF_SCSI_QCMD()
440 wait_for_completion(&us->notify); in DEF_SCSI_QCMD()
446 struct us_data *us = host_to_us(srb->device->host); in command_abort() local
448 usb_stor_dbg(us, "%s called\n", __func__); in command_abort()
449 return command_abort_matching(us, srb); in command_abort()
458 struct us_data *us = host_to_us(srb->device->host); in device_reset() local
461 usb_stor_dbg(us, "%s called\n", __func__); in device_reset()
464 command_abort_matching(us, NULL); in device_reset()
467 mutex_lock(&(us->dev_mutex)); in device_reset()
468 result = us->transport_reset(us); in device_reset()
469 mutex_unlock(&us->dev_mutex); in device_reset()
477 struct us_data *us = host_to_us(srb->device->host); in bus_reset() local
480 usb_stor_dbg(us, "%s called\n", __func__); in bus_reset()
482 result = usb_stor_port_reset(us); in bus_reset()
491 void usb_stor_report_device_reset(struct us_data *us) in usb_stor_report_device_reset() argument
494 struct Scsi_Host *host = us_to_host(us); in usb_stor_report_device_reset()
497 if (us->fflags & US_FL_SCM_MULT_TARG) { in usb_stor_report_device_reset()
508 void usb_stor_report_bus_reset(struct us_data *us) in usb_stor_report_bus_reset() argument
510 struct Scsi_Host *host = us_to_host(us); in usb_stor_report_bus_reset()
523 /* if someone is sending us data, just throw it away */ in write_info()
529 struct us_data *us = host_to_us(host); in show_info() local
536 if (us->pusb_dev->manufacturer) in show_info()
537 string = us->pusb_dev->manufacturer; in show_info()
538 else if (us->unusual_dev->vendorName) in show_info()
539 string = us->unusual_dev->vendorName; in show_info()
543 if (us->pusb_dev->product) in show_info()
544 string = us->pusb_dev->product; in show_info()
545 else if (us->unusual_dev->productName) in show_info()
546 string = us->unusual_dev->productName; in show_info()
550 if (us->pusb_dev->serial) in show_info()
551 string = us->pusb_dev->serial; in show_info()
557 seq_printf(m, " Protocol: %s\n", us->protocol_name); in show_info()
558 seq_printf(m, " Transport: %s\n", us->transport_name); in show_info()
564 if (us->fflags & value) seq_printf(m, " " #name); in show_info()