Lines Matching +full:0 +full:us
52 #define VENDOR_ID_NOKIA 0x0421
53 #define VENDOR_ID_NIKON 0x04b0
54 #define VENDOR_ID_PENTAX 0x0a17
55 #define VENDOR_ID_MOTOROLA 0x22b8
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 slave_alloc() local
79 if (us->protocol == USB_PR_BULK && us->max_lun > 0) in slave_alloc()
88 return 0; in slave_alloc()
93 struct us_data *us = host_to_us(sdev->host); in device_configure() local
94 struct device *dev = us->pusb_dev->bus->sysdev; in device_configure()
101 if (us->fflags & (US_FL_MAX_SECTORS_64 | US_FL_MAX_SECTORS_MIN)) { in device_configure()
104 if (us->fflags & US_FL_MAX_SECTORS_MIN) in device_configure()
113 lim->max_hw_sectors = 0x7FFFFF; in device_configure()
114 } else if (us->pusb_dev->speed >= USB_SPEED_SUPER) { in device_configure()
116 * USB3 devices will be limited to 2048 sectors. This gives us in device_configure()
144 switch (le16_to_cpu(us->pusb_dev->descriptor.idVendor)) { in device_configure()
149 if (!(us->fflags & (US_FL_FIX_CAPACITY | in device_configure()
151 us->fflags |= US_FL_CAPACITY_HEURISTICS; in device_configure()
160 if (us->subclass != USB_SC_SCSI && us->subclass != USB_SC_CYP_ATACB) in device_configure()
177 * Some devices don't like MODE SENSE with page=0x3f, in device_configure()
185 if (us->fflags & US_FL_NO_WP_DETECT) in device_configure()
211 if (us->fflags & US_FL_FIX_CAPACITY) in device_configure()
219 if (us->fflags & US_FL_CAPACITY_HEURISTICS) in device_configure()
223 if (us->fflags & US_FL_NO_READ_CAPACITY_16) in device_configure()
232 if (!(us->fflags & US_FL_NEEDS_CAP16)) in device_configure()
240 !(us->fflags & US_FL_BAD_SENSE)) in device_configure()
241 us->fflags |= US_FL_SANE_SENSE; in device_configure()
244 * USB-IDE bridges tend to report SK = 0x04 (Non-recoverable in device_configure()
271 if (!(us->fflags & (US_FL_FIX_CAPACITY | US_FL_CAPACITY_OK | in device_configure()
273 us->protocol == USB_PR_BULK) in device_configure()
274 us->use_last_sector_hacks = 1; in device_configure()
277 if (us->fflags & US_FL_WRITE_CACHE) in device_configure()
281 if (us->fflags & US_FL_BROKEN_FUA) in device_configure()
285 if (us->fflags & US_FL_ALWAYS_SYNC) { in device_configure()
302 if (us->fflags & US_FL_NO_READ_DISC_INFO) in device_configure()
310 * scsi_level == 0 (UNKNOWN). Hence such devices must necessarily in device_configure()
313 if ((us->protocol == USB_PR_CB || us->protocol == USB_PR_CBI) && in device_configure()
315 us->max_lun = 0; in device_configure()
321 if (us->fflags & US_FL_NOT_LOCKABLE) in device_configure()
322 sdev->lockable = 0; in device_configure()
328 return 0; in device_configure()
333 struct us_data *us = host_to_us(dev_to_shost(starget->dev.parent)); in target_alloc() local
346 * to 0. However the SCSI spec requires these bits to be set in target_alloc()
350 * Peripheral Device Type to 0x1f to indicate no LUN. in target_alloc()
352 if (us->subclass == USB_SC_UFI) in target_alloc()
355 return 0; 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()
377 return 0; in queuecommand_lck()
380 if ((us->fflags & US_FL_NO_ATA_1X) && in queuecommand_lck()
381 (srb->cmnd[0] == ATA_12 || srb->cmnd[0] == ATA_16)) { in queuecommand_lck()
386 return 0; in queuecommand_lck()
390 us->srb = srb; in queuecommand_lck()
391 complete(&us->cmnd_ready); in queuecommand_lck()
393 return 0; 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()
471 return result < 0 ? FAILED : SUCCESS; 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()
483 return result < 0 ? FAILED : SUCCESS; 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()
496 scsi_report_device_reset(host, 0, 0); in usb_stor_report_device_reset()
497 if (us->fflags & US_FL_SCM_MULT_TARG) { in usb_stor_report_device_reset()
499 scsi_report_device_reset(host, 0, i); 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()
513 scsi_report_bus_reset(host, 0); 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()
568 return 0; in show_info()
592 if (sscanf(buf, "%hu", &ms) <= 0) in max_sectors_store()
697 [0] = 0x70, /* current error */
698 [2] = ILLEGAL_REQUEST, /* Illegal Request = 0x05 */
699 [7] = 0x0a, /* additional length */
700 [12] = 0x24 /* Invalid Field in CDB */