Changeset a46e56b in mainline for uspace/lib/drv/generic/remote_pci.c


Ignore:
Timestamp:
2018-03-22T06:49:35Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
77f0a1d
Parents:
3e242d2
git-author:
Jakub Jermar <jakub@…> (2018-03-21 23:29:06)
git-committer:
Jakub Jermar <jakub@…> (2018-03-22 06:49:35)
Message:

Prefer handle over ID in naming handle variables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/remote_pci.c

    r3e242d2 ra46e56b  
    150150};
    151151
    152 void remote_config_space_read_8(ddf_fun_t *fun, void *iface, cap_call_handle_t callid, ipc_call_t *call)
     152void remote_config_space_read_8(ddf_fun_t *fun, void *iface, cap_call_handle_t chandle, ipc_call_t *call)
    153153{
    154154        assert(iface);
    155155        pci_dev_iface_t *pci_iface = (pci_dev_iface_t *)iface;
    156156        if (pci_iface->config_space_read_8 == NULL) {
    157                 async_answer_0(callid, ENOTSUP);
     157                async_answer_0(chandle, ENOTSUP);
    158158                return;
    159159        }
     
    162162        errno_t ret = pci_iface->config_space_read_8(fun, address, &value);
    163163        if (ret != EOK) {
    164                 async_answer_0(callid, ret);
    165         } else {
    166                 async_answer_1(callid, EOK, value);
    167         }
    168 }
    169 
    170 void remote_config_space_read_16(ddf_fun_t *fun, void *iface, cap_call_handle_t callid, ipc_call_t *call)
     164                async_answer_0(chandle, ret);
     165        } else {
     166                async_answer_1(chandle, EOK, value);
     167        }
     168}
     169
     170void remote_config_space_read_16(ddf_fun_t *fun, void *iface, cap_call_handle_t chandle, ipc_call_t *call)
    171171{
    172172        assert(iface);
    173173        pci_dev_iface_t *pci_iface = (pci_dev_iface_t *)iface;
    174174        if (pci_iface->config_space_read_16 == NULL) {
    175                 async_answer_0(callid, ENOTSUP);
     175                async_answer_0(chandle, ENOTSUP);
    176176                return;
    177177        }
     
    180180        errno_t ret = pci_iface->config_space_read_16(fun, address, &value);
    181181        if (ret != EOK) {
    182                 async_answer_0(callid, ret);
    183         } else {
    184                 async_answer_1(callid, EOK, value);
    185         }
    186 }
    187 void remote_config_space_read_32(ddf_fun_t *fun, void *iface, cap_call_handle_t callid, ipc_call_t *call)
     182                async_answer_0(chandle, ret);
     183        } else {
     184                async_answer_1(chandle, EOK, value);
     185        }
     186}
     187void remote_config_space_read_32(ddf_fun_t *fun, void *iface, cap_call_handle_t chandle, ipc_call_t *call)
    188188{
    189189        assert(iface);
    190190        pci_dev_iface_t *pci_iface = (pci_dev_iface_t *)iface;
    191191        if (pci_iface->config_space_read_32 == NULL) {
    192                 async_answer_0(callid, ENOTSUP);
     192                async_answer_0(chandle, ENOTSUP);
    193193                return;
    194194        }
     
    197197        errno_t ret = pci_iface->config_space_read_32(fun, address, &value);
    198198        if (ret != EOK) {
    199                 async_answer_0(callid, ret);
    200         } else {
    201                 async_answer_1(callid, EOK, value);
    202         }
    203 }
    204 
    205 void remote_config_space_write_8(ddf_fun_t *fun, void *iface, cap_call_handle_t callid, ipc_call_t *call)
     199                async_answer_0(chandle, ret);
     200        } else {
     201                async_answer_1(chandle, EOK, value);
     202        }
     203}
     204
     205void remote_config_space_write_8(ddf_fun_t *fun, void *iface, cap_call_handle_t chandle, ipc_call_t *call)
    206206{
    207207        assert(iface);
    208208        pci_dev_iface_t *pci_iface = (pci_dev_iface_t *)iface;
    209209        if (pci_iface->config_space_write_8 == NULL) {
    210                 async_answer_0(callid, ENOTSUP);
     210                async_answer_0(chandle, ENOTSUP);
    211211                return;
    212212        }
     
    215215        errno_t ret = pci_iface->config_space_write_8(fun, address, value);
    216216        if (ret != EOK) {
    217                 async_answer_0(callid, ret);
    218         } else {
    219                 async_answer_0(callid, EOK);
    220         }
    221 }
    222 
    223 void remote_config_space_write_16(ddf_fun_t *fun, void *iface, cap_call_handle_t callid, ipc_call_t *call)
     217                async_answer_0(chandle, ret);
     218        } else {
     219                async_answer_0(chandle, EOK);
     220        }
     221}
     222
     223void remote_config_space_write_16(ddf_fun_t *fun, void *iface, cap_call_handle_t chandle, ipc_call_t *call)
    224224{
    225225        assert(iface);
    226226        pci_dev_iface_t *pci_iface = (pci_dev_iface_t *)iface;
    227227        if (pci_iface->config_space_write_16 == NULL) {
    228                 async_answer_0(callid, ENOTSUP);
     228                async_answer_0(chandle, ENOTSUP);
    229229                return;
    230230        }
     
    233233        errno_t ret = pci_iface->config_space_write_16(fun, address, value);
    234234        if (ret != EOK) {
    235                 async_answer_0(callid, ret);
    236         } else {
    237                 async_answer_0(callid, EOK);
    238         }
    239 }
    240 
    241 void remote_config_space_write_32(ddf_fun_t *fun, void *iface, cap_call_handle_t callid, ipc_call_t *call)
     235                async_answer_0(chandle, ret);
     236        } else {
     237                async_answer_0(chandle, EOK);
     238        }
     239}
     240
     241void remote_config_space_write_32(ddf_fun_t *fun, void *iface, cap_call_handle_t chandle, ipc_call_t *call)
    242242{
    243243        assert(iface);
    244244        pci_dev_iface_t *pci_iface = (pci_dev_iface_t *)iface;
    245245        if (pci_iface->config_space_write_32 == NULL) {
    246                 async_answer_0(callid, ENOTSUP);
     246                async_answer_0(chandle, ENOTSUP);
    247247                return;
    248248        }
     
    251251        errno_t ret = pci_iface->config_space_write_32(fun, address, value);
    252252        if (ret != EOK) {
    253                 async_answer_0(callid, ret);
    254         } else {
    255                 async_answer_0(callid, EOK);
     253                async_answer_0(chandle, ret);
     254        } else {
     255                async_answer_0(chandle, EOK);
    256256        }
    257257}
Note: See TracChangeset for help on using the changeset viewer.