Changeset 3843ecb in mainline for uspace/lib/libdrv/generic/driver.c


Ignore:
Timestamp:
2010-04-09T13:54:06Z (14 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
892e4e1
Parents:
3a5909f
Message:

device classes as interface sets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libdrv/generic/driver.c

    r3a5909f r3843ecb  
    177177                callid = async_get_call(&call);
    178178                ipcarg_t method = IPC_GET_METHOD(call);
     179                int iface_idx;
     180               
    179181                switch  (method) {
    180182                case IPC_M_PHONE_HUNGUP:
     
    184186                        ipc_answer_0(callid, EOK);
    185187                        return;
    186                 default:
    187 
    188                         if (!is_valid_iface_id(method)) {
     188                default:               
     189                        // convert ipc interface id to interface index
     190                       
     191                        iface_idx = DEV_IFACE_IDX(method);
     192                       
     193                        if (!is_valid_iface_idx(iface_idx)) {
    189194                                // this is not device's interface
    190195                                printf("%s: driver_connection_gen error - invalid interface id %x.", driver->name, method);
     
    196201                       
    197202                        // get the device interface structure
    198                         void *iface = device_get_iface(dev, method);
     203                        void *iface = device_get_iface(dev, iface_idx);
    199204                        if (NULL == iface) {
    200205                                printf("%s: driver_connection_gen error - ", driver->name);
     
    205210
    206211                        // get the corresponding interface for remote request handling ("remote interface")
    207                         remote_iface_t* rem_iface = get_remote_iface(method);
     212                        remote_iface_t* rem_iface = get_remote_iface(iface_idx);
    208213                        assert(NULL != rem_iface);
    209214
Note: See TracChangeset for help on using the changeset viewer.