Changeset 5a6cc679 in mainline for uspace/drv/block/usbmast/main.c


Ignore:
Timestamp:
2018-01-31T02:21:24Z (7 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a0a9cc2
Parents:
132ab5d1
Message:

Merge commit '50f19b7ee8e94570b5c63896736c4eb49cfa18db' into forwardport

Not all ints are converted to errno_t in xhci tree yet, however it compiles and works :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/block/usbmast/main.c

    r132ab5d1 r5a6cc679  
    7777};
    7878
    79 static int usbmast_fun_create(usbmast_dev_t *mdev, unsigned lun);
     79static errno_t usbmast_fun_create(usbmast_dev_t *mdev, unsigned lun);
    8080static void usbmast_bd_connection(ipc_callid_t iid, ipc_call_t *icall,
    8181    void *arg);
    8282
    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 *);
     83static errno_t usbmast_bd_open(bd_srvs_t *, bd_srv_t *);
     84static errno_t usbmast_bd_close(bd_srv_t *);
     85static errno_t usbmast_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t);
     86static errno_t usbmast_bd_sync_cache(bd_srv_t *, aoff64_t, size_t);
     87static errno_t usbmast_bd_write_blocks(bd_srv_t *, aoff64_t, size_t, const void *, size_t);
     88static errno_t usbmast_bd_get_block_size(bd_srv_t *, size_t *);
     89static errno_t usbmast_bd_get_num_blocks(bd_srv_t *, aoff64_t *);
    9090
    9191static bd_ops_t usbmast_bd_ops = {
     
    109109 * @return Error code.
    110110 */
    111 static int usbmast_device_gone(usb_device_t *dev)
     111static errno_t usbmast_device_gone(usb_device_t *dev)
    112112{
    113113        usbmast_dev_t *mdev = usb_device_data_get(dev);
     
    115115
    116116        for (size_t i = 0; i < mdev->lun_count; ++i) {
    117                 const int rc = ddf_fun_unbind(mdev->luns[i]);
     117                const errno_t rc = ddf_fun_unbind(mdev->luns[i]);
    118118                if (rc != EOK) {
    119119                        usb_log_error("Failed to unbind LUN function %zu: "
     
    133133 * @return Error code.
    134134 */
    135 static int usbmast_device_remove(usb_device_t *dev)
     135static errno_t usbmast_device_remove(usb_device_t *dev)
    136136{
    137137        //TODO: flush buffers, or whatever.
     
    145145 * @return Error code.
    146146 */
    147 static int usbmast_device_add(usb_device_t *dev)
    148 {
    149         int rc;
     147static errno_t usbmast_device_add(usb_device_t *dev)
     148{
     149        errno_t rc;
    150150        usbmast_dev_t *mdev = NULL;
    151151        unsigned i;
     
    198198                if (mdev->luns[i] == NULL)
    199199                        continue;
    200                 const int rc = ddf_fun_unbind(mdev->luns[i]);
     200                const errno_t rc = ddf_fun_unbind(mdev->luns[i]);
    201201                if (rc != EOK) {
    202202                        usb_log_warning("Failed to unbind LUN function %zu: "
     
    217217 * @return              EOK on success or an error code.
    218218 */
    219 static int usbmast_fun_create(usbmast_dev_t *mdev, unsigned lun)
    220 {
    221         int rc;
     219static errno_t usbmast_fun_create(usbmast_dev_t *mdev, unsigned lun)
     220{
     221        errno_t rc;
    222222        char *fun_name = NULL;
    223223        ddf_fun_t *fun = NULL;
     
    326326
    327327/** Open device. */
    328 static int usbmast_bd_open(bd_srvs_t *bds, bd_srv_t *bd)
     328static errno_t usbmast_bd_open(bd_srvs_t *bds, bd_srv_t *bd)
    329329{
    330330        return EOK;
     
    332332
    333333/** Close device. */
    334 static int usbmast_bd_close(bd_srv_t *bd)
     334static errno_t usbmast_bd_close(bd_srv_t *bd)
    335335{
    336336        return EOK;
     
    338338
    339339/** Read blocks from the device. */
    340 static int usbmast_bd_read_blocks(bd_srv_t *bd, uint64_t ba, size_t cnt, void *buf,
     340static errno_t usbmast_bd_read_blocks(bd_srv_t *bd, uint64_t ba, size_t cnt, void *buf,
    341341    size_t size)
    342342{
     
    350350
    351351/** Synchronize blocks to nonvolatile storage. */
    352 static int usbmast_bd_sync_cache(bd_srv_t *bd, uint64_t ba, size_t cnt)
     352static errno_t usbmast_bd_sync_cache(bd_srv_t *bd, uint64_t ba, size_t cnt)
    353353{
    354354        usbmast_fun_t *mfun = bd_srv_usbmast(bd);
     
    358358
    359359/** Write blocks to the device. */
    360 static int usbmast_bd_write_blocks(bd_srv_t *bd, uint64_t ba, size_t cnt,
     360static errno_t usbmast_bd_write_blocks(bd_srv_t *bd, uint64_t ba, size_t cnt,
    361361    const void *buf, size_t size)
    362362{
     
    370370
    371371/** Get device block size. */
    372 static int usbmast_bd_get_block_size(bd_srv_t *bd, size_t *rsize)
     372static errno_t usbmast_bd_get_block_size(bd_srv_t *bd, size_t *rsize)
    373373{
    374374        usbmast_fun_t *mfun = bd_srv_usbmast(bd);
     
    378378
    379379/** Get number of blocks on device. */
    380 static int usbmast_bd_get_num_blocks(bd_srv_t *bd, aoff64_t *rnb)
     380static errno_t usbmast_bd_get_num_blocks(bd_srv_t *bd, aoff64_t *rnb)
    381381{
    382382        usbmast_fun_t *mfun = bd_srv_usbmast(bd);
Note: See TracChangeset for help on using the changeset viewer.