Changeset cf002dbf in mainline
- Timestamp:
- 2011-05-11T19:31:16Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5f0fe4e9
- Parents:
- 70c12d6
- Location:
- uspace/drv/usbmast
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbmast/inquiry.c
r70c12d6 rcf002dbf 55 55 56 56 #define STR_UNKNOWN "<unknown>" 57 58 /** String constants for SCSI peripheral device types. */ 57 59 static const char *str_peripheral_device_types[] = { 58 60 "direct-access device", … … 92 94 (sizeof(str_peripheral_device_types)/sizeof(str_peripheral_device_types[0])) 93 95 96 /** Get string representation for SCSI peripheral device type. 97 * 98 * See for example here for a list 99 * http://en.wikipedia.org/wiki/SCSI_Peripheral_Device_Type. 100 * 101 * @param type SCSI peripheral device type code. 102 * @return String representation. 103 */ 94 104 const char *usb_str_masstor_scsi_peripheral_device_type(int type) 95 105 { … … 101 111 } 102 112 113 /** Trim trailing spaces from a string (rewrite with string terminator). 114 * 115 * @param name String to be trimmed (in-out parameter). 116 */ 103 117 static void trim_trailing_spaces(char *name) 104 118 { … … 110 124 } 111 125 126 /** Perform SCSI INQUIRY command on USB mass storage device. 127 * 128 * @param dev USB device. 129 * @param bulk_in_idx Index (in dev->pipes) of bulk in pipe. 130 * @param bulk_out_idx Index of bulk out pipe. 131 * @param inquiry_result Where to store parsed inquiry result. 132 * @return Error code. 133 */ 112 134 int usb_massstor_inquiry(usb_device_t *dev, 113 135 size_t bulk_in_idx, size_t bulk_out_idx, -
uspace/drv/usbmast/mast.c
r70c12d6 rcf002dbf 139 139 } 140 140 141 /** Perform bulk-only mass storage reset. 142 * 143 * @param dev Device to be reseted. 144 * @return Error code. 145 */ 141 146 int usb_massstor_reset(usb_device_t *dev) 142 147 { … … 146 151 } 147 152 153 /** Perform complete reset recovery of bulk-only mass storage. 154 * 155 * Notice that no error is reported because if this fails, the error 156 * would reappear on next transaction somehow. 157 * 158 * @param dev Device to be reseted. 159 * @param bulk_in_idx Index of bulk in pipe. 160 * @param bulk_out_idx Index of bulk out pipe. 161 */ 148 162 void usb_massstor_reset_recovery(usb_device_t *dev, 149 163 size_t bulk_in_idx, size_t bulk_out_idx) … … 157 171 } 158 172 173 /** Get max LUN of a mass storage device. 174 * 175 * @warning Error from this command does not necessarily indicate malfunction 176 * of the device. Device does not need to support this request. 177 * 178 * @param dev Mass storage device. 179 * @return Error code of maximum LUN (index, not count). 180 */ 159 181 int usb_massstor_get_max_lun(usb_device_t *dev) 160 182 { -
uspace/drv/usbmast/mast.h
r70c12d6 rcf002dbf 42 42 #include <usb/devdrv.h> 43 43 44 /** Result of SCSI INQUIRY command. 45 * This is already parsed structure, not the original buffer returned by 46 * the device. 47 */ 44 48 typedef struct { 49 /** SCSI peripheral device type. */ 45 50 int peripheral_device_type; 51 /** Whether the device is removable. */ 46 52 bool removable; 53 /** Vendor ID string. */ 47 54 char vendor_id[9]; 55 /** Product ID and product revision string. */ 48 56 char product_and_revision[12]; 49 57 } usb_massstor_inquiry_result_t;
Note:
See TracChangeset
for help on using the changeset viewer.