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)
191 if (us->fflags & US_FL_NO_WP_DETECT)
217 if (us->fflags & US_FL_FIX_CAPACITY)
225 if (us->fflags & US_FL_CAPACITY_HEURISTICS)
229 if (us->fflags & US_FL_NO_READ_CAPACITY_16)
238 if (!(us->fflags & US_FL_NEEDS_CAP16))
246 !(us->fflags & US_FL_BAD_SENSE))
247 us->fflags |= US_FL_SANE_SENSE;
277 if (!(us->fflags & (US_FL_FIX_CAPACITY | US_FL_CAPACITY_OK |
279 us->protocol == USB_PR_BULK)
280 us->use_last_sector_hacks = 1;
283 if (us->fflags & US_FL_WRITE_CACHE)
287 if (us->fflags & US_FL_BROKEN_FUA)
291 if (us->fflags & US_FL_ALWAYS_SYNC) {
308 if (us->fflags & US_FL_NO_READ_DISC_INFO)
319 if ((us->protocol == USB_PR_CB || us->protocol == USB_PR_CBI) &&
321 us->max_lun = 0;
327 if (us->fflags & US_FL_NOT_LOCKABLE)
339 struct us_data *us = host_to_us(dev_to_shost(starget->dev.parent));
358 if (us->subclass == USB_SC_UFI)
369 struct us_data *us = host_to_us(srb->device->host);
372 if (us->srb != NULL) {
373 dev_err(&us->pusb_intf->dev,
374 "Error in %s: us->srb = %p\n", __func__, us->srb);
379 if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags)) {
380 usb_stor_dbg(us, "Fail command during disconnect\n");
386 if ((us->fflags & US_FL_NO_ATA_1X) &&
397 us->srb = srb;
398 complete(&us->cmnd_ready);
410 static int command_abort_matching(struct us_data *us, struct scsi_cmnd *srb_match)
413 * us->srb together with the TIMED_OUT, RESETTING, and ABORTING
416 scsi_lock(us_to_host(us));
419 if (!us->srb) {
420 scsi_unlock(us_to_host(us));
421 usb_stor_dbg(us, "-- nothing to abort\n");
426 if (srb_match && us->srb != srb_match) {
427 scsi_unlock(us_to_host(us));
428 usb_stor_dbg(us, "-- pending command mismatch\n");
439 set_bit(US_FLIDX_TIMED_OUT, &us->dflags);
440 if (!test_bit(US_FLIDX_RESETTING, &us->dflags)) {
441 set_bit(US_FLIDX_ABORTING, &us->dflags);
442 usb_stor_stop_transport(us);
444 scsi_unlock(us_to_host(us));
447 wait_for_completion(&us->notify);
453 struct us_data *us = host_to_us(srb->device->host);
455 usb_stor_dbg(us, "%s called\n", __func__);
456 return command_abort_matching(us, srb);
465 struct us_data *us = host_to_us(srb->device->host);
468 usb_stor_dbg(us, "%s called\n", __func__);
471 command_abort_matching(us, NULL);
474 mutex_lock(&(us->dev_mutex));
475 result = us->transport_reset(us);
476 mutex_unlock(&us->dev_mutex);
484 struct us_data *us = host_to_us(srb->device->host);
487 usb_stor_dbg(us, "%s called\n", __func__);
489 result = usb_stor_port_reset(us);
498 void usb_stor_report_device_reset(struct us_data *us)
501 struct Scsi_Host *host = us_to_host(us);
504 if (us->fflags & US_FL_SCM_MULT_TARG) {
515 void usb_stor_report_bus_reset(struct us_data *us)
517 struct Scsi_Host *host = us_to_host(us);
530 /* if someone is sending us data, just throw it away */
536 struct us_data *us = host_to_us(host);
543 if (us->pusb_dev->manufacturer)
544 string = us->pusb_dev->manufacturer;
545 else if (us->unusual_dev->vendorName)
546 string = us->unusual_dev->vendorName;
550 if (us->pusb_dev->product)
551 string = us->pusb_dev->product;
552 else if (us->unusual_dev->productName)
553 string = us->unusual_dev->productName;
557 if (us->pusb_dev->serial)
558 string = us->pusb_dev->serial;
564 seq_printf(m, " Protocol: %s\n", us->protocol_name);
565 seq_printf(m, " Transport: %s\n", us->transport_name);
571 if (us->fflags & value) seq_printf(m, " " #name);