Changes in uspace/drv/block/usbmast/main.c [b7fd2a0:cde999a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/block/usbmast/main.c
rb7fd2a0 rcde999a 77 77 }; 78 78 79 static errno_t usbmast_fun_create(usbmast_dev_t *mdev, unsigned lun);79 static int usbmast_fun_create(usbmast_dev_t *mdev, unsigned lun); 80 80 static void usbmast_bd_connection(ipc_callid_t iid, ipc_call_t *icall, 81 81 void *arg); 82 82 83 static errno_t usbmast_bd_open(bd_srvs_t *, bd_srv_t *);84 static errno_t usbmast_bd_close(bd_srv_t *);85 static errno_t usbmast_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t);86 static errno_t usbmast_bd_sync_cache(bd_srv_t *, aoff64_t, size_t);87 static errno_t usbmast_bd_write_blocks(bd_srv_t *, aoff64_t, size_t, const void *, size_t);88 static errno_t usbmast_bd_get_block_size(bd_srv_t *, size_t *);89 static errno_t usbmast_bd_get_num_blocks(bd_srv_t *, aoff64_t *);83 static int usbmast_bd_open(bd_srvs_t *, bd_srv_t *); 84 static int usbmast_bd_close(bd_srv_t *); 85 static int usbmast_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t); 86 static int usbmast_bd_sync_cache(bd_srv_t *, aoff64_t, size_t); 87 static int usbmast_bd_write_blocks(bd_srv_t *, aoff64_t, size_t, const void *, size_t); 88 static int usbmast_bd_get_block_size(bd_srv_t *, size_t *); 89 static int usbmast_bd_get_num_blocks(bd_srv_t *, aoff64_t *); 90 90 91 91 static bd_ops_t usbmast_bd_ops = { … … 109 109 * @return Error code. 110 110 */ 111 static errno_t usbmast_device_gone(usb_device_t *dev)111 static int usbmast_device_gone(usb_device_t *dev) 112 112 { 113 113 usbmast_dev_t *mdev = usb_device_data_get(dev); … … 115 115 116 116 for (size_t i = 0; i < mdev->lun_count; ++i) { 117 const errno_t rc = ddf_fun_unbind(mdev->luns[i]);117 const int rc = ddf_fun_unbind(mdev->luns[i]); 118 118 if (rc != EOK) { 119 119 usb_log_error("Failed to unbind LUN function %zu: " … … 133 133 * @return Error code. 134 134 */ 135 static errno_t usbmast_device_remove(usb_device_t *dev)135 static int usbmast_device_remove(usb_device_t *dev) 136 136 { 137 137 //TODO: flush buffers, or whatever. … … 145 145 * @return Error code. 146 146 */ 147 static errno_t usbmast_device_add(usb_device_t *dev)148 { 149 errno_t rc;147 static int usbmast_device_add(usb_device_t *dev) 148 { 149 int rc; 150 150 usbmast_dev_t *mdev = NULL; 151 151 unsigned i; … … 199 199 if (mdev->luns[i] == NULL) 200 200 continue; 201 const errno_t rc = ddf_fun_unbind(mdev->luns[i]);201 const int rc = ddf_fun_unbind(mdev->luns[i]); 202 202 if (rc != EOK) { 203 203 usb_log_warning("Failed to unbind LUN function %zu: " … … 218 218 * @return EOK on success or an error code. 219 219 */ 220 static errno_t usbmast_fun_create(usbmast_dev_t *mdev, unsigned lun)221 { 222 errno_t rc;220 static int usbmast_fun_create(usbmast_dev_t *mdev, unsigned lun) 221 { 222 int rc; 223 223 char *fun_name = NULL; 224 224 ddf_fun_t *fun = NULL; … … 327 327 328 328 /** Open device. */ 329 static errno_t usbmast_bd_open(bd_srvs_t *bds, bd_srv_t *bd)329 static int usbmast_bd_open(bd_srvs_t *bds, bd_srv_t *bd) 330 330 { 331 331 return EOK; … … 333 333 334 334 /** Close device. */ 335 static errno_t usbmast_bd_close(bd_srv_t *bd)335 static int usbmast_bd_close(bd_srv_t *bd) 336 336 { 337 337 return EOK; … … 339 339 340 340 /** Read blocks from the device. */ 341 static errno_t usbmast_bd_read_blocks(bd_srv_t *bd, uint64_t ba, size_t cnt, void *buf,341 static int usbmast_bd_read_blocks(bd_srv_t *bd, uint64_t ba, size_t cnt, void *buf, 342 342 size_t size) 343 343 { … … 351 351 352 352 /** Synchronize blocks to nonvolatile storage. */ 353 static errno_t usbmast_bd_sync_cache(bd_srv_t *bd, uint64_t ba, size_t cnt)353 static int usbmast_bd_sync_cache(bd_srv_t *bd, uint64_t ba, size_t cnt) 354 354 { 355 355 usbmast_fun_t *mfun = bd_srv_usbmast(bd); … … 359 359 360 360 /** Write blocks to the device. */ 361 static errno_t usbmast_bd_write_blocks(bd_srv_t *bd, uint64_t ba, size_t cnt,361 static int usbmast_bd_write_blocks(bd_srv_t *bd, uint64_t ba, size_t cnt, 362 362 const void *buf, size_t size) 363 363 { … … 371 371 372 372 /** Get device block size. */ 373 static errno_t usbmast_bd_get_block_size(bd_srv_t *bd, size_t *rsize)373 static int usbmast_bd_get_block_size(bd_srv_t *bd, size_t *rsize) 374 374 { 375 375 usbmast_fun_t *mfun = bd_srv_usbmast(bd); … … 379 379 380 380 /** Get number of blocks on device. */ 381 static errno_t usbmast_bd_get_num_blocks(bd_srv_t *bd, aoff64_t *rnb)381 static int usbmast_bd_get_num_blocks(bd_srv_t *bd, aoff64_t *rnb) 382 382 { 383 383 usbmast_fun_t *mfun = bd_srv_usbmast(bd);
Note:
See TracChangeset
for help on using the changeset viewer.