Changes in uspace/srv/devman/devman.c [79ae36dd:3ad7b1c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/devman.c
r79ae36dd r3ad7b1c 39 39 #include <devmap.h> 40 40 #include <str_error.h> 41 #include <stdio.h>42 41 43 42 #include "devman.h" … … 564 563 dev_node_t *dev; 565 564 link_t *link; 565 int phone; 566 566 567 567 log_msg(LVL_DEBUG, "pass_devices_to_driver(driver=\"%s\")", … … 569 569 570 570 fibril_mutex_lock(&driver->driver_mutex); 571 572 async_exch_t *exch = async_exchange_begin(driver->sess); 573 async_sess_t *sess = async_connect_me_to(EXCHANGE_SERIALIZE, exch, 574 DRIVER_DEVMAN, 0, 0); 575 async_exchange_end(exch); 576 577 if (!sess) { 571 572 phone = async_connect_me_to(driver->phone, DRIVER_DEVMAN, 0, 0); 573 574 if (phone < 0) { 578 575 fibril_mutex_unlock(&driver->driver_mutex); 579 576 return; … … 604 601 fibril_mutex_unlock(&driver->driver_mutex); 605 602 606 add_device( sess, driver, dev, tree);603 add_device(phone, driver, dev, tree); 607 604 608 605 /* … … 625 622 } 626 623 627 async_hangup( sess);624 async_hangup(phone); 628 625 629 626 /* … … 675 672 list_initialize(&drv->devices); 676 673 fibril_mutex_initialize(&drv->driver_mutex); 677 drv-> sess = NULL;674 drv->phone = -1; 678 675 } 679 676 … … 739 736 * @param node The device's node in the device tree. 740 737 */ 741 void add_device(async_sess_t *sess, driver_t *drv, dev_node_t *dev, 742 dev_tree_t *tree) 738 void add_device(int phone, driver_t *drv, dev_node_t *dev, dev_tree_t *tree) 743 739 { 744 740 /* … … 749 745 drv->name, dev->pfun->name); 750 746 747 sysarg_t rc; 748 ipc_call_t answer; 749 751 750 /* Send the device to the driver. */ 752 751 devman_handle_t parent_handle; … … 756 755 parent_handle = 0; 757 756 } 758 759 async_exch_t *exch = async_exchange_begin(sess); 760 761 ipc_call_t answer; 762 aid_t req = async_send_2(exch, DRIVER_ADD_DEVICE, dev->handle, 757 758 aid_t req = async_send_2(phone, DRIVER_ADD_DEVICE, dev->handle, 763 759 parent_handle, &answer); 764 760 765 /* Send the device name to the driver. */766 sysarg_t rc = async_data_write_start(exch, dev->pfun->name,761 /* Send the device's name to the driver. */ 762 rc = async_data_write_start(phone, dev->pfun->name, 767 763 str_size(dev->pfun->name) + 1); 768 769 async_exchange_end(exch);770 771 764 if (rc != EOK) { 772 765 /* TODO handle error */ … … 829 822 if (is_running) { 830 823 /* Notify the driver about the new device. */ 831 async_exch_t *exch = async_exchange_begin(drv->sess); 832 async_sess_t *sess = async_connect_me_to(EXCHANGE_SERIALIZE, exch, 833 DRIVER_DEVMAN, 0, 0); 834 async_exchange_end(exch); 835 836 if (sess) { 837 add_device(sess, drv, dev, tree); 838 async_hangup(sess); 824 int phone = async_connect_me_to(drv->phone, DRIVER_DEVMAN, 0, 0); 825 if (phone >= 0) { 826 add_device(phone, drv, dev, tree); 827 async_hangup(phone); 839 828 } 840 829 }
Note:
See TracChangeset
for help on using the changeset viewer.