Changeset 6430ac6 in mainline for uspace/drv/bus/usb/usbmast/scsi_ms.c
- Timestamp:
- 2011-07-03T10:53:17Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 71fa44c
- Parents:
- 3f08fd2b
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbmast/scsi_ms.c
r3f08fd2b r6430ac6 32 32 /** 33 33 * @file 34 * Main routines ofUSB mass storage driver.34 * SCSI functions for USB mass storage driver. 35 35 */ 36 36 #include <bitops.h> … … 46 46 #include "cmds.h" 47 47 #include "mast.h" 48 #include "scsi_ms.h" 48 49 49 50 /** Get string representation for SCSI peripheral device type. 50 51 * 51 * @param type 52 * @return 52 * @param type SCSI peripheral device type code. 53 * @return String representation. 53 54 */ 54 const char *usb _str_masstor_scsi_peripheral_device_type(unsigned type)55 const char *usbmast_scsi_dev_type_str(unsigned type) 55 56 { 56 57 return scsi_get_dev_type_str(type); … … 59 60 /** Perform SCSI INQUIRY command on USB mass storage device. 60 61 * 61 * @param dev USB device. 62 * @param bulk_in_idx Index (in dev->pipes) of bulk in pipe. 63 * @param bulk_out_idx Index of bulk out pipe. 62 * @param dev USB device. 64 63 * @param inquiry_result Where to store parsed inquiry result. 65 * @return 64 * @return Error code. 66 65 */ 67 int usb_massstor_inquiry(usb_device_t *dev, 68 usb_massstor_inquiry_result_t *inquiry_result) 66 int usbmast_inquiry(usb_device_t *dev, usbmast_inquiry_data_t *inq_res) 69 67 { 70 68 scsi_std_inquiry_data_t inq_data; … … 98 96 */ 99 97 100 bzero(inq uiry_result, sizeof(*inquiry_result));98 bzero(inq_res, sizeof(*inq_res)); 101 99 102 inq uiry_result->device_type = BIT_RANGE_EXTRACT(uint8_t,100 inq_res->device_type = BIT_RANGE_EXTRACT(uint8_t, 103 101 inq_data.pqual_devtype, SCSI_PQDT_DEV_TYPE_h, SCSI_PQDT_DEV_TYPE_l); 104 102 105 inq uiry_result->removable = BIT_RANGE_EXTRACT(uint8_t,103 inq_res->removable = BIT_RANGE_EXTRACT(uint8_t, 106 104 inq_data.rmb, SCSI_RMB_RMB, SCSI_RMB_RMB); 107 105 108 spascii_to_str(inq uiry_result->vendor, SCSI_INQ_VENDOR_STR_BUFSIZE,106 spascii_to_str(inq_res->vendor, SCSI_INQ_VENDOR_STR_BUFSIZE, 109 107 inq_data.vendor, sizeof(inq_data.vendor)); 110 108 111 spascii_to_str(inq uiry_result->product, SCSI_INQ_PRODUCT_STR_BUFSIZE,109 spascii_to_str(inq_res->product, SCSI_INQ_PRODUCT_STR_BUFSIZE, 112 110 inq_data.product, sizeof(inq_data.product)); 113 111 114 spascii_to_str(inq uiry_result->revision, SCSI_INQ_REVISION_STR_BUFSIZE,112 spascii_to_str(inq_res->revision, SCSI_INQ_REVISION_STR_BUFSIZE, 115 113 inq_data.revision, sizeof(inq_data.revision)); 116 114
Note:
See TracChangeset
for help on using the changeset viewer.