Changeset 0feaae4 in mainline for uspace/drv/bus/usb/usbmast/inquiry.c
- Timestamp:
- 2011-07-02T17:21:50Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 239e7e10
- Parents:
- 2429e4a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbmast/inquiry.c
r2429e4a r0feaae4 42 42 #include <str.h> 43 43 #include <ctype.h> 44 #include <scsi/spc.h> 44 45 #include "cmds.h" 45 #include "scsi.h"46 46 #include "mast.h" 47 47 … … 54 54 #define INQUIRY_RESPONSE_LENGTH 36 55 55 56 #define STR_UNKNOWN "<unknown>"57 58 /** String constants for SCSI peripheral device types. */59 static const char *str_peripheral_device_types[] = {60 "direct-access device",61 "sequential-access device",62 "printer device",63 "processor device",64 "write-once device",65 "CDROM device",66 "scanner device",67 "optical memory device",68 "medium changer",69 "communications device",70 "graphic arts pre-press device",71 "graphic arts pre-press device",72 "storage array controller device",73 "enclosure services device",74 "simplified direct-access device",75 "optical card reader/writer device",76 "bridging expander",77 "object-based storage device",78 "automation driver interface",79 STR_UNKNOWN, // 0x1380 STR_UNKNOWN, // 0x1481 STR_UNKNOWN, // 0x1582 STR_UNKNOWN, // 0x1683 STR_UNKNOWN, // 0x1784 STR_UNKNOWN, // 0x1885 STR_UNKNOWN, // 0x1986 STR_UNKNOWN, // 0x1A87 STR_UNKNOWN, // 0x1B88 STR_UNKNOWN, // 0x1C89 STR_UNKNOWN, // 0x1D90 "well-known logical unit",91 "uknown or no device state"92 };93 #define str_peripheral_device_types_count \94 (sizeof(str_peripheral_device_types)/sizeof(str_peripheral_device_types[0]))95 96 56 /** Get string representation for SCSI peripheral device type. 97 *98 * See for example here for a list99 * http://en.wikipedia.org/wiki/SCSI_Peripheral_Device_Type.100 57 * 101 58 * @param type SCSI peripheral device type code. 102 59 * @return String representation. 103 60 */ 104 const char *usb_str_masstor_scsi_peripheral_device_type( inttype)61 const char *usb_str_masstor_scsi_peripheral_device_type(unsigned type) 105 62 { 106 if ((type < 0) 107 || ((size_t)type >= str_peripheral_device_types_count)) { 108 return STR_UNKNOWN; 109 } 110 return str_peripheral_device_types[type]; 63 return scsi_get_dev_type_str(type); 111 64 } 112 65 … … 136 89 usb_massstor_inquiry_result_t *inquiry_result) 137 90 { 138 scsi_c md_inquiry_t inquiry = {139 .op_code = 0x12,140 . lun_evpd = 0,91 scsi_cdb_inquiry_t inquiry = { 92 .op_code = SCSI_CMD_INQUIRY, 93 .evpd = 0, 141 94 .page_code = 0, 142 .alloc_len gth= host2uint16_t_be(INQUIRY_RESPONSE_LENGTH),143 .c trl = 095 .alloc_len = host2uint16_t_be(INQUIRY_RESPONSE_LENGTH), 96 .control = 0 144 97 }; 145 98 size_t response_len;
Note:
See TracChangeset
for help on using the changeset viewer.