Changeset a78fa2a in mainline for uspace/srv/devman/devman.c


Ignore:
Timestamp:
2010-04-23T08:35:36Z (14 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
df747b9c
Parents:
1f8657b
Message:

Send device's name to a driver when the device is passed to it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/devman.c

    r1f8657b ra78fa2a  
    503503{
    504504        printf(NAME ": add_device\n");
    505 
    506         ipcarg_t ret;
    507         ipcarg_t rc = async_req_1_1(phone, DRIVER_ADD_DEVICE, node->handle, &ret);
    508         if (rc != EOK) {
     505       
     506        ipcarg_t rc;
     507        ipc_call_t answer;
     508       
     509        // send the device to the driver
     510        aid_t req = async_send_1(phone, DRIVER_ADD_DEVICE, node->handle, &answer);
     511       
     512        // send the device's name to the driver
     513        rc = async_data_write_start(phone, node->name, str_size(node->name) + 1);
     514    if (rc != EOK) {
    509515                // TODO handle error
    510                 return;
    511         }
    512        
    513         // TODO inspect return value (ret) to find out whether the device was successfully probed and added
     516    }
     517       
     518        // wait for answer from the driver
     519        async_wait_for(req, &rc);
     520        switch(rc) {
     521                // TODO inspect return value to find out whether the device was successfully probed and added
     522        case EOK:
     523        case ENOENT:
     524               
     525                break;
     526               
     527        }
    514528       
    515529        return;
Note: See TracChangeset for help on using the changeset viewer.