Changeset 5a6cc679 in mainline for uspace/drv/block/usbmast/scsi_ms.c
- Timestamp:
- 2018-01-31T02:21:24Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a0a9cc2
- Parents:
- 132ab5d1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/block/usbmast/scsi_ms.c
r132ab5d1 r5a6cc679 72 72 } 73 73 74 static int usb_massstor_unit_ready(usbmast_fun_t *mfun)74 static errno_t usb_massstor_unit_ready(usbmast_fun_t *mfun) 75 75 { 76 76 scsi_cmd_t cmd; 77 77 scsi_cdb_test_unit_ready_t cdb; 78 int rc;78 errno_t rc; 79 79 80 80 memset(&cdb, 0, sizeof(cdb)); … … 107 107 * XXX This is too simplified. 108 108 */ 109 static int usbmast_run_cmd(usbmast_fun_t *mfun, scsi_cmd_t *cmd)109 static errno_t usbmast_run_cmd(usbmast_fun_t *mfun, scsi_cmd_t *cmd) 110 110 { 111 111 uint8_t sense_key; 112 112 scsi_sense_data_t sense_buf; 113 int rc;113 errno_t rc; 114 114 115 115 do { … … 162 162 * @return Error code 163 163 */ 164 int usbmast_inquiry(usbmast_fun_t *mfun, usbmast_inquiry_data_t *inq_res)164 errno_t usbmast_inquiry(usbmast_fun_t *mfun, usbmast_inquiry_data_t *inq_res) 165 165 { 166 166 scsi_std_inquiry_data_t inq_data; 167 167 scsi_cmd_t cmd; 168 168 scsi_cdb_inquiry_t cdb; 169 int rc;169 errno_t rc; 170 170 171 171 memset(&cdb, 0, sizeof(cdb)); … … 231 231 * @return Error code. 232 232 */ 233 int usbmast_request_sense(usbmast_fun_t *mfun, void *buf, size_t size)233 errno_t usbmast_request_sense(usbmast_fun_t *mfun, void *buf, size_t size) 234 234 { 235 235 scsi_cmd_t cmd; 236 236 scsi_cdb_request_sense_t cdb; 237 int rc;237 errno_t rc; 238 238 239 239 memset(&cdb, 0, sizeof(cdb)); … … 272 272 * @return Error code. 273 273 */ 274 int usbmast_read_capacity(usbmast_fun_t *mfun, uint32_t *nblocks,274 errno_t usbmast_read_capacity(usbmast_fun_t *mfun, uint32_t *nblocks, 275 275 uint32_t *block_size) 276 276 { … … 278 278 scsi_cdb_read_capacity_10_t cdb; 279 279 scsi_read_capacity_10_data_t data; 280 int rc;280 errno_t rc; 281 281 282 282 memset(&cdb, 0, sizeof(cdb)); … … 323 323 * @return Error code 324 324 */ 325 int usbmast_read(usbmast_fun_t *mfun, uint64_t ba, size_t nblocks, void *buf)325 errno_t usbmast_read(usbmast_fun_t *mfun, uint64_t ba, size_t nblocks, void *buf) 326 326 { 327 327 scsi_cmd_t cmd; 328 328 scsi_cdb_read_10_t cdb; 329 int rc;329 errno_t rc; 330 330 331 331 if (ba > UINT32_MAX) … … 378 378 * @return Error code 379 379 */ 380 int usbmast_write(usbmast_fun_t *mfun, uint64_t ba, size_t nblocks,380 errno_t usbmast_write(usbmast_fun_t *mfun, uint64_t ba, size_t nblocks, 381 381 const void *data) 382 382 { 383 383 scsi_cmd_t cmd; 384 384 scsi_cdb_write_10_t cdb; 385 int rc;385 errno_t rc; 386 386 387 387 if (ba > UINT32_MAX) … … 428 428 * @return Error code 429 429 */ 430 int usbmast_sync_cache(usbmast_fun_t *mfun, uint64_t ba, size_t nblocks)430 errno_t usbmast_sync_cache(usbmast_fun_t *mfun, uint64_t ba, size_t nblocks) 431 431 { 432 432 if (ba > UINT32_MAX) … … 447 447 }; 448 448 449 const int rc = usbmast_run_cmd(mfun, &cmd);449 const errno_t rc = usbmast_run_cmd(mfun, &cmd); 450 450 451 451 if (rc != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.