Changeset 66babbd in mainline for uspace/lib/libc/generic/devman.c
- Timestamp:
- 2010-03-25T09:55:09Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a087f2e
- Parents:
- d347b53
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/devman.c
rd347b53 r66babbd 39 39 #include <malloc.h> 40 40 #include <bool.h> 41 #include <adt/list.h> 41 42 42 43 static int devman_phone_driver = -1; … … 106 107 } 107 108 109 static int devman_send_match_id(int phone, match_id_t *match_id) \ 110 { 111 ipc_call_t answer; 112 async_send_1(phone, DEVMAN_ADD_MATCH_ID, match_id->score, &answer); 113 int retval = async_data_write_start(phone, match_id->id, str_size(match_id->id)); 114 return retval; 115 } 116 117 118 static int devman_send_match_ids(int phone, match_id_list_t *match_ids) 119 { 120 link_t *link = match_ids->ids.next; 121 match_id_t *match_id = NULL; 122 int ret = EOK; 123 124 while (link != &match_ids->ids) { 125 match_id = list_get_instance(link, match_id_t, link); 126 if (EOK != (ret = devman_send_match_id(phone, match_id))) 127 { 128 printf("Driver failed to send match id, error number = %d\n", ret); 129 return ret; 130 } 131 link = link->next; 132 } 133 return ret; 134 } 135 108 136 int devman_child_device_register( 109 137 const char *name, match_id_list_t *match_ids, device_handle_t parent_handle, device_handle_t *handle) … … 116 144 async_serialize_start(); 117 145 146 int match_count = list_count(&match_ids->ids); 118 147 ipc_call_t answer; 119 aid_t req = async_send_ 1(phone, DEVMAN_ADD_CHILD_DEVICE, parent_handle, &answer);148 aid_t req = async_send_2(phone, DEVMAN_ADD_CHILD_DEVICE, parent_handle, match_count, &answer); 120 149 121 150 ipcarg_t retval = async_data_write_start(phone, name, str_size(name)); … … 126 155 } 127 156 128 // TODO match ids157 devman_send_match_ids(phone, match_ids); 129 158 130 159 async_wait_for(req, &retval); … … 141 170 if (handle != NULL) 142 171 *handle = (int) IPC_GET_ARG1(answer); 172 173 return retval; 143 174 } 144 175
Note:
See TracChangeset
for help on using the changeset viewer.