Changes in uspace/lib/drv/generic/driver.c [b72efe8:45059d6b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/driver.c
rb72efe8 r45059d6b 314 314 " %" PRIun " was found.\n", driver->name, handle); 315 315 async_answer_0(iid, ENOENT); 316 return; 317 } 318 319 if (fun->conn_handler != NULL) { 320 /* Driver has a custom connection handler. */ 321 (*fun->conn_handler)(iid, icall, (void *)fun); 316 322 return; 317 323 } … … 422 428 static void driver_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg) 423 429 { 430 sysarg_t conn_type; 431 432 if (iid == 0) { 433 /* Callback connection from devman */ 434 /* XXX Use separate handler for this type of connection */ 435 conn_type = DRIVER_DEVMAN; 436 } else { 437 conn_type = IPC_GET_ARG1(*icall); 438 } 439 424 440 /* Select interface */ 425 switch ( (sysarg_t) (IPC_GET_ARG1(*icall))) {441 switch (conn_type) { 426 442 case DRIVER_DEVMAN: 427 443 /* Handle request from device manager */ … … 576 592 int ddf_fun_bind(ddf_fun_t *fun) 577 593 { 594 assert(fun->bound == false); 578 595 assert(fun->name != NULL); 579 596 … … 592 609 } 593 610 611 /** Unbind a function node. 612 * 613 * Unbind the specified function from the system. This effectively makes 614 * the function invisible to the system. 615 * 616 * @param fun Function to bind 617 * @return EOK on success or negative error code 618 */ 619 int ddf_fun_unbind(ddf_fun_t *fun) 620 { 621 int res; 622 623 assert(fun->bound == true); 624 625 add_to_functions_list(fun); 626 res = devman_remove_function(fun->handle); 627 if (res != EOK) 628 return res; 629 630 remove_from_functions_list(fun); 631 632 fun->bound = false; 633 return EOK; 634 } 635 594 636 /** Add single match ID to inner function. 595 637 * … … 614 656 return ENOMEM; 615 657 616 match_id->id = match_id_str;658 match_id->id = str_dup(match_id_str); 617 659 match_id->score = 90; 618 660 … … 629 671 } 630 672 631 /** Add exposed function to c lass.673 /** Add exposed function to category. 632 674 * 633 675 * Must only be called when the function is bound. 634 676 */ 635 int ddf_fun_add_to_c lass(ddf_fun_t *fun, const char *class_name)677 int ddf_fun_add_to_category(ddf_fun_t *fun, const char *cat_name) 636 678 { 637 679 assert(fun->bound == true); 638 680 assert(fun->ftype == fun_exposed); 639 681 640 return devman_add_device_to_c lass(fun->handle, class_name);682 return devman_add_device_to_category(fun->handle, cat_name); 641 683 } 642 684
Note:
See TracChangeset
for help on using the changeset viewer.