Changeset 084ff99 in mainline for uspace/lib/libdrv/generic/driver.c
- Timestamp:
- 2010-03-14T09:14:50Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7707954
- Parents:
- 67ba309
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libdrv/generic/driver.c
r67ba309 r084ff99 50 50 #include <devman.h> 51 51 #include <ipc/devman.h> 52 #include <ipc/driver.h> 52 53 53 54 #include "driver.h" 54 55 55 56 static driver_t *driver; 57 LIST_INITIALIZE(devices); 58 59 static device_t* driver_create_device() 60 { 61 device_t *dev = (device_t *)malloc(sizeof(device_t)); 62 if (NULL != dev) { 63 memset(dev, 0, sizeof(device_t)); 64 } 65 return dev; 66 } 67 68 static void driver_add_device(ipc_callid_t iid, ipc_call_t *icall) 69 { 70 printf("%s: driver_add_device\n", driver->name); 71 72 // result of the operation - device was added, device is not present etc. 73 ipcarg_t ret = 0; 74 ipcarg_t dev_handle = IPC_GET_ARG1(*icall); 75 76 printf("%s: adding device with handle = %x \n", driver->name, dev_handle); 77 78 device_t *dev = driver_create_device(); 79 dev->handle = dev_handle; 80 if (driver->driver_ops->add_device(dev)) { 81 list_append(&dev->link, &devices); 82 // TODO set return value 83 } 84 85 ipc_answer_1(iid, EOK, ret); 86 } 56 87 57 88 static void driver_connection_devman(ipc_callid_t iid, ipc_call_t *icall) 58 89 { 90 printf("%s: driver_connection_devman \n", driver->name); 91 59 92 /* Accept connection */ 60 93 ipc_answer_0(iid, EOK); … … 70 103 continue; 71 104 case DRIVER_ADD_DEVICE: 72 // TODO105 driver_add_device(callid, &call); 73 106 break; 74 107 default:
Note:
See TracChangeset
for help on using the changeset viewer.