Changeset 57c8fc9 in mainline
- Timestamp:
- 2013-09-21T02:17:14Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c898236
- Parents:
- ce33c10
- Location:
- uspace
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/res.c
rce33c10 r57c8fc9 105 105 hw_res_list_parsed_clean(&hw_res); 106 106 return EOK; 107 }108 109 /** Calls the PCI driver with a request to enable interrupts110 *111 * @param[in] device Device asking for interrupts112 * @return Error code.113 */114 int enable_interrupts(ddf_dev_t *device)115 {116 async_sess_t *parent_sess = devman_parent_device_connect(117 EXCHANGE_SERIALIZE, ddf_dev_get_handle(device), IPC_FLAG_BLOCKING);118 if (!parent_sess)119 return ENOMEM;120 121 const bool enabled = hw_res_enable_interrupt(parent_sess);122 async_hangup(parent_sess);123 124 return enabled ? EOK : EIO;125 107 } 126 108 -
uspace/drv/bus/usb/ohci/ohci.c
rce33c10 r57c8fc9 114 114 /* Try to enable interrupts */ 115 115 bool interrupts = false; 116 ret = enable_interrupts(device);116 ret = hcd_ddf_enable_interrupts(device); 117 117 if (ret != EOK) { 118 118 usb_log_warning("Failed to enable interrupts: %s." -
uspace/drv/bus/usb/ohci/res.c
rce33c10 r57c8fc9 85 85 } 86 86 87 /** Call the PCI driver with a request to enable interrupts88 *89 * @param[in] device Device asking for interrupts90 * @return Error code.91 */92 int enable_interrupts(ddf_dev_t *device)93 {94 async_sess_t *parent_sess =95 devman_parent_device_connect(EXCHANGE_SERIALIZE,96 ddf_dev_get_handle(device), IPC_FLAG_BLOCKING);97 if (!parent_sess)98 return ENOMEM;99 100 const bool enabled = hw_res_enable_interrupt(parent_sess);101 async_hangup(parent_sess);102 103 return enabled ? EOK : EIO;104 }105 87 106 88 /** -
uspace/drv/bus/usb/uhci/res.c
rce33c10 r57c8fc9 83 83 } 84 84 85 /** Call the PCI driver with a request to enable interrupts86 *87 * @param[in] device Device asking for interrupts88 * @return Error code.89 */90 int enable_interrupts(ddf_dev_t *device)91 {92 async_sess_t *parent_sess =93 devman_parent_device_connect(EXCHANGE_SERIALIZE,94 ddf_dev_get_handle(device), IPC_FLAG_BLOCKING);95 if (!parent_sess)96 return ENOMEM;97 98 const bool enabled = hw_res_enable_interrupt(parent_sess);99 async_hangup(parent_sess);100 101 return enabled ? EOK : EIO;102 }103 104 85 /** Call the PCI driver with a request to clear legacy support register 105 86 * -
uspace/drv/bus/usb/uhci/uhci.c
rce33c10 r57c8fc9 115 115 116 116 bool interrupts = false; 117 ret = enable_interrupts(device);117 ret = hcd_ddf_enable_interrupts(device); 118 118 if (ret != EOK) { 119 119 usb_log_warning("Failed to enable interrupts: %s." -
uspace/lib/usbhost/include/usb/host/ddf_helpers.h
rce33c10 r57c8fc9 37 37 #define LIBUSBHOST_HOST_DDF_HELPERS_H 38 38 39 #include <device/hw_res_parsed.h> 39 40 #include <usb/host/hcd.h> 40 41 #include <usbhc_iface.h> … … 47 48 hcd_t *dev_to_hcd(ddf_dev_t *dev); 48 49 50 int hcd_ddf_enable_interrupts(ddf_dev_t *device); 51 int hcd_ddf_get_registers(ddf_dev_t *device, hw_res_list_parsed_t *hw_res); 52 49 53 #endif 50 54 -
uspace/lib/usbhost/src/ddf_helpers.c
rce33c10 r57c8fc9 39 39 #include <usb/descriptor.h> 40 40 #include <usb/request.h> 41 #include <devman.h> 41 42 #include <errno.h> 42 43 #include <str_error.h> … … 640 641 ddf_fun_destroy(hc->ctl_fun); 641 642 } 643 644 645 //TODO: Move this to generic ddf? 646 /** Call the parent driver with a request to enable interrupts 647 * 648 * @param[in] device Device asking for interrupts 649 * @return Error code. 650 */ 651 int hcd_ddf_enable_interrupts(ddf_dev_t *device) 652 { 653 assert(device); 654 async_sess_t *parent_sess = 655 devman_parent_device_connect(EXCHANGE_SERIALIZE, 656 ddf_dev_get_handle(device), IPC_FLAG_BLOCKING); 657 const bool enabled = hw_res_enable_interrupt(parent_sess); 658 async_hangup(parent_sess); 659 660 return enabled ? EOK : EIO; 661 } 662 663 int hcd_ddf_get_registers(ddf_dev_t *device, hw_res_list_parsed_t *hw_res) 664 { 665 assert(device); 666 assert(hw_res); 667 668 async_sess_t *parent_sess = 669 devman_parent_device_connect(EXCHANGE_SERIALIZE, 670 ddf_dev_get_handle(device), IPC_FLAG_BLOCKING); 671 hw_res_list_parsed_init(hw_res); 672 const int ret = hw_res_get_list_parsed(parent_sess, hw_res, 0); 673 async_hangup(parent_sess); 674 return ret; 675 } 642 676 /** 643 677 * @}
Note:
See TracChangeset
for help on using the changeset viewer.