Changes in uspace/lib/drv/generic/driver.c [79ae36dd:ff65e91] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/driver.c
r79ae36dd rff65e91 139 139 find_interrupt_context_by_id(interrupt_context_list_t *list, int id) 140 140 { 141 interrupt_context_t *ctx; 142 141 143 fibril_mutex_lock(&list->mutex); 142 144 143 link_t *link = list->contexts.next; 144 interrupt_context_t *ctx; 145 146 while (link != &list->contexts) { 145 list_foreach(list->contexts, link) { 147 146 ctx = list_get_instance(link, interrupt_context_t, link); 148 147 if (ctx->id == id) { … … 150 149 return ctx; 151 150 } 152 link = link->next;153 151 } 154 152 … … 160 158 find_interrupt_context(interrupt_context_list_t *list, ddf_dev_t *dev, int irq) 161 159 { 160 interrupt_context_t *ctx; 161 162 162 fibril_mutex_lock(&list->mutex); 163 163 164 link_t *link = list->contexts.next; 165 interrupt_context_t *ctx; 166 167 while (link != &list->contexts) { 164 list_foreach(list->contexts, link) { 168 165 ctx = list_get_instance(link, interrupt_context_t, link); 169 166 if (ctx->irq == irq && ctx->dev == dev) { … … 171 168 return ctx; 172 169 } 173 link = link->next;174 170 } 175 171 … … 231 227 } 232 228 233 static ddf_fun_t *driver_get_function(li nk_t *functions, devman_handle_t handle)229 static ddf_fun_t *driver_get_function(list_t *functions, devman_handle_t handle) 234 230 { 235 231 ddf_fun_t *fun = NULL; 236 232 237 233 fibril_mutex_lock(&functions_mutex); 238 link_t *link = functions->next; 239 240 while (link != functions) { 234 235 list_foreach(*functions, link) { 241 236 fun = list_get_instance(link, ddf_fun_t, link); 242 237 if (fun->handle == handle) { … … 244 239 return fun; 245 240 } 246 247 link = link->next;248 241 } 249 242 … … 324 317 } 325 318 319 if (fun->conn_handler != NULL) { 320 /* Driver has a custom connection handler. */ 321 (*fun->conn_handler)(iid, icall, (void *)fun); 322 return; 323 } 324 326 325 /* 327 326 * TODO - if the client is not a driver, check whether it is allowed to … … 361 360 if (default_handler != NULL) { 362 361 (*default_handler)(fun, callid, &call); 363 break;362 continue; 364 363 } 365 364 … … 372 371 driver->name, iface_idx); 373 372 async_answer_0(callid, ENOTSUP); 374 break;373 continue; 375 374 } 376 375 … … 384 383 "with id %d.\n", handle, iface_idx); 385 384 async_answer_0(callid, ENOTSUP); 386 break;385 continue; 387 386 } 388 387 … … 403 402 "invalid interface method.", driver->name); 404 403 async_answer_0(callid, ENOTSUP); 405 break;404 continue; 406 405 } 407 406 … … 413 412 */ 414 413 (*iface_method_ptr)(fun, ops, callid, &call); 415 break;416 414 } 417 415 } … … 428 426 429 427 /** Function for handling connections to device driver. */ 430 static void driver_connection(ipc_callid_t iid, ipc_call_t *icall )428 static void driver_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg) 431 429 { 432 430 /* Select interface */
Note:
See TracChangeset
for help on using the changeset viewer.