Changeset e280857 in mainline for uspace/lib/c/generic/devman.c


Ignore:
Timestamp:
2011-08-18T12:35:59Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
99ac5cf
Parents:
12f9f0d0
Message:

Remove class infrastructure from devman.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/devman.c

    r12f9f0d0 re280857  
    333333                exch = devman_exchange_begin(DEVMAN_CLIENT);
    334334                if (exch == NULL)
    335                         return errno;
     335                        return ENOMEM;
    336336        }
    337337       
     
    364364}
    365365
    366 int devman_device_get_handle_by_class(const char *classname,
    367     const char *devname, devman_handle_t *handle, unsigned int flags)
    368 {
    369         async_exch_t *exch;
    370        
    371         if (flags & IPC_FLAG_BLOCKING)
    372                 exch = devman_exchange_begin_blocking(DEVMAN_CLIENT);
    373         else {
    374                 exch = devman_exchange_begin(DEVMAN_CLIENT);
    375                 if (exch == NULL)
    376                         return errno;
    377         }
    378        
    379         ipc_call_t answer;
    380         aid_t req = async_send_1(exch, DEVMAN_DEVICE_GET_HANDLE_BY_CLASS,
    381             flags, &answer);
    382         sysarg_t retval = async_data_write_start(exch, classname,
    383             str_size(classname));
    384        
    385         if (retval != EOK) {
    386                 devman_exchange_end(exch);
    387                 async_wait_for(req, NULL);
    388                 return retval;
    389         }
    390        
    391         retval = async_data_write_start(exch, devname,
    392             str_size(devname));
    393        
    394         devman_exchange_end(exch);
    395        
    396         if (retval != EOK) {
    397                 async_wait_for(req, NULL);
    398                 return retval;
    399         }
    400        
    401         async_wait_for(req, &retval);
    402        
    403         if (retval != EOK) {
    404                 if (handle != NULL)
    405                         *handle = (devman_handle_t) -1;
    406                
    407                 return retval;
    408         }
    409        
    410         if (handle != NULL)
    411                 *handle = (devman_handle_t) IPC_GET_ARG1(answer);
    412        
    413         return retval;
    414 }
    415 
    416366int devman_get_device_path(devman_handle_t handle, char *path, size_t path_size)
    417367{
    418368        async_exch_t *exch = devman_exchange_begin(DEVMAN_CLIENT);
    419369        if (exch == NULL)
    420                 return errno;
     370                return ENOMEM;
    421371       
    422372        ipc_call_t answer;
     
    463413}
    464414
     415int devman_fun_sid_to_handle(service_id_t sid, devman_handle_t *handle)
     416{
     417        async_exch_t *exch = devman_exchange_begin(DEVMAN_CLIENT);
     418        if (exch == NULL)
     419                return ENOMEM;
     420       
     421        sysarg_t retval = async_req_1_1(exch, DEVMAN_FUN_SID_TO_HANDLE,
     422            sid, handle);
     423       
     424        devman_exchange_end(exch);
     425        return (int) retval;
     426}
     427
    465428/** @}
    466429 */
Note: See TracChangeset for help on using the changeset viewer.