Lines Matching defs:us

63 	struct us_data *us = host_to_us(host);
64 return us->scsi_name;
69 struct us_data *us = host_to_us(sdev->host);
79 if (us->protocol == USB_PR_BULK && us->max_lun > 0)
87 struct us_data *us = host_to_us(sdev->host);
88 struct device *dev = us->pusb_dev->bus->sysdev;
95 if (us->fflags & (US_FL_MAX_SECTORS_64 | US_FL_MAX_SECTORS_MIN)) {
98 if (us->fflags & US_FL_MAX_SECTORS_MIN)
108 } else if (us->pusb_dev->speed >= USB_SPEED_SUPER) {
110 * USB3 devices will be limited to 2048 sectors. This gives us
138 switch (le16_to_cpu(us->pusb_dev->descriptor.idVendor)) {
143 if (!(us->fflags & (US_FL_FIX_CAPACITY |
145 us->fflags |= US_FL_CAPACITY_HEURISTICS;
154 if (us->subclass != USB_SC_SCSI && us->subclass != USB_SC_CYP_ATACB)
179 if (us->fflags & US_FL_NO_WP_DETECT)
205 if (us->fflags & US_FL_FIX_CAPACITY)
213 if (us->fflags & US_FL_CAPACITY_HEURISTICS)
217 if (us->fflags & US_FL_NO_READ_CAPACITY_16)
226 if (!(us->fflags & US_FL_NEEDS_CAP16))
234 !(us->fflags & US_FL_BAD_SENSE))
235 us->fflags |= US_FL_SANE_SENSE;
265 if (!(us->fflags & (US_FL_FIX_CAPACITY | US_FL_CAPACITY_OK |
267 us->protocol == USB_PR_BULK)
268 us->use_last_sector_hacks = 1;
271 if (us->fflags & US_FL_WRITE_CACHE)
275 if (us->fflags & US_FL_BROKEN_FUA)
279 if (us->fflags & US_FL_ALWAYS_SYNC) {
296 if (us->fflags & US_FL_NO_READ_DISC_INFO)
307 if ((us->protocol == USB_PR_CB || us->protocol == USB_PR_CBI) &&
309 us->max_lun = 0;
315 if (us->fflags & US_FL_NOT_LOCKABLE)
327 struct us_data *us = host_to_us(dev_to_shost(starget->dev.parent));
346 if (us->subclass == USB_SC_UFI)
357 struct us_data *us = host_to_us(srb->device->host);
360 if (us->srb != NULL) {
361 dev_err(&us->pusb_intf->dev,
362 "Error in %s: us->srb = %p\n", __func__, us->srb);
367 if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags)) {
368 usb_stor_dbg(us, "Fail command during disconnect\n");
374 if ((us->fflags & US_FL_NO_ATA_1X) &&
384 us->srb = srb;
385 complete(&us->cmnd_ready);
397 static int command_abort_matching(struct us_data *us, struct scsi_cmnd *srb_match)
400 * us->srb together with the TIMED_OUT, RESETTING, and ABORTING
403 scsi_lock(us_to_host(us));
406 if (!us->srb) {
407 scsi_unlock(us_to_host(us));
408 usb_stor_dbg(us, "-- nothing to abort\n");
413 if (srb_match && us->srb != srb_match) {
414 scsi_unlock(us_to_host(us));
415 usb_stor_dbg(us, "-- pending command mismatch\n");
426 set_bit(US_FLIDX_TIMED_OUT, &us->dflags);
427 if (!test_bit(US_FLIDX_RESETTING, &us->dflags)) {
428 set_bit(US_FLIDX_ABORTING, &us->dflags);
429 usb_stor_stop_transport(us);
431 scsi_unlock(us_to_host(us));
434 wait_for_completion(&us->notify);
440 struct us_data *us = host_to_us(srb->device->host);
442 usb_stor_dbg(us, "%s called\n", __func__);
443 return command_abort_matching(us, srb);
452 struct us_data *us = host_to_us(srb->device->host);
455 usb_stor_dbg(us, "%s called\n", __func__);
458 command_abort_matching(us, NULL);
461 mutex_lock(&(us->dev_mutex));
462 result = us->transport_reset(us);
463 mutex_unlock(&us->dev_mutex);
471 struct us_data *us = host_to_us(srb->device->host);
474 usb_stor_dbg(us, "%s called\n", __func__);
476 result = usb_stor_port_reset(us);
485 void usb_stor_report_device_reset(struct us_data *us)
488 struct Scsi_Host *host = us_to_host(us);
491 if (us->fflags & US_FL_SCM_MULT_TARG) {
502 void usb_stor_report_bus_reset(struct us_data *us)
504 struct Scsi_Host *host = us_to_host(us);
517 /* if someone is sending us data, just throw it away */
523 struct us_data *us = host_to_us(host);
530 if (us->pusb_dev->manufacturer)
531 string = us->pusb_dev->manufacturer;
532 else if (us->unusual_dev->vendorName)
533 string = us->unusual_dev->vendorName;
537 if (us->pusb_dev->product)
538 string = us->pusb_dev->product;
539 else if (us->unusual_dev->productName)
540 string = us->unusual_dev->productName;
544 if (us->pusb_dev->serial)
545 string = us->pusb_dev->serial;
551 seq_printf(m, " Protocol: %s\n", us->protocol_name);
552 seq_printf(m, " Transport: %s\n", us->transport_name);
558 if (us->fflags & value) seq_printf(m, " " #name);