Changeset 3562cd18 in mainline for uspace/lib/usb
- Timestamp:
 - 2011-10-31T10:07:51Z (14 years ago)
 - Branches:
 - lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
 - Children:
 - ae754e5f
 - Parents:
 - eea3e39
 - Location:
 - uspace/lib/usb
 - Files:
 - 
      
- 2 edited
 
- 
          
  include/usb/ddfiface.h (modified) (1 diff)
 - 
          
  src/ddfiface.c (modified) (3 diffs)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
uspace/lib/usb/include/usb/ddfiface.h
reea3e39 r3562cd18 39 39 #include <usb_iface.h> 40 40 41 int usb_iface_get_hc_handle_ hub_impl(ddf_fun_t *, devman_handle_t *);41 int usb_iface_get_hc_handle_device_impl(ddf_fun_t *, devman_handle_t *); 42 42 int usb_iface_get_address_forward_impl(ddf_fun_t *, devman_handle_t, 43 43 usb_address_t *); 44 44 extern usb_iface_t usb_iface_hub_impl; 45 45 46 int usb_iface_get_hc_handle_hub_child_impl(ddf_fun_t *, devman_handle_t *);47 46 int usb_iface_get_address_set_my_handle_impl(ddf_fun_t *, devman_handle_t, 48 47 usb_address_t *);  - 
      
uspace/lib/usb/src/ddfiface.c
reea3e39 r3562cd18 44 44 /** DDF interface for USB device, implementation for typical hub. */ 45 45 usb_iface_t usb_iface_hub_impl = { 46 .get_hc_handle = usb_iface_get_hc_handle_ hub_impl,46 .get_hc_handle = usb_iface_get_hc_handle_device_impl, 47 47 .get_address = usb_iface_get_address_forward_impl, 48 48 }; … … 50 50 /** DDF interface for USB device, implementation for child of a typical hub. */ 51 51 usb_iface_t usb_iface_hub_child_impl = { 52 .get_hc_handle = usb_iface_get_hc_handle_ hub_child_impl,52 .get_hc_handle = usb_iface_get_hc_handle_device_impl, 53 53 .get_address = usb_iface_get_address_set_my_handle_impl 54 54 }; … … 61 61 * @return Error code. 62 62 */ 63 int usb_iface_get_hc_handle_ hub_impl(ddf_fun_t *fun, devman_handle_t *handle)63 int usb_iface_get_hc_handle_device_impl(ddf_fun_t *fun, devman_handle_t *handle) 64 64 { 65 65 assert(fun); 66 66 return usb_hc_find(fun->handle, handle); 67 }68 69 /** Get host controller handle, interface implementation for child of70 * a hub driver.71 *72 * @param[in] fun Device function the operation is running on.73 * @param[out] handle Storage for the host controller handle.74 * @return Error code.75 */76 int usb_iface_get_hc_handle_hub_child_impl(ddf_fun_t *fun,77 devman_handle_t *handle)78 {79 assert(fun != NULL);80 81 async_sess_t *parent_sess =82 devman_parent_device_connect(EXCHANGE_SERIALIZE, fun->handle,83 IPC_FLAG_BLOCKING);84 if (!parent_sess)85 return ENOMEM;86 87 async_exch_t *exch = async_exchange_begin(parent_sess);88 89 sysarg_t hc_handle;90 int rc = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),91 IPC_M_USB_GET_HOST_CONTROLLER_HANDLE, &hc_handle);92 93 async_exchange_end(exch);94 async_hangup(parent_sess);95 96 if (rc != EOK)97 return rc;98 99 *handle = hc_handle;100 return EOK;101 67 } 102 68  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  