Changeset 2745176 in mainline
- Timestamp:
- 2013-01-27T15:48:12Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5debe97
- Parents:
- 4ca778b
- Location:
- uspace/lib/usb
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/include/usb/dev.h
r4ca778b r2745176 38 38 #include <usb/usb.h> 39 39 40 int usb_get_info_by_handle(devman_handle_t,41 devman_handle_t *, usb_address_t *, int *);42 43 static inline int usb_get_hc_by_handle(devman_handle_t dev, devman_handle_t *hc)44 {45 return usb_get_info_by_handle(dev, hc, NULL, NULL);46 }47 48 static inline int usb_get_address_by_handle(49 devman_handle_t dev, usb_address_t *address)50 {51 return usb_get_info_by_handle(dev, NULL, address, NULL);52 }53 54 static inline int usb_get_iface_by_handle(devman_handle_t dev, int *iface)55 {56 return usb_get_info_by_handle(dev, NULL, NULL, iface);57 }58 59 40 int usb_resolve_device_handle(const char *, devman_handle_t *, usb_address_t *, 60 41 devman_handle_t *); -
uspace/lib/usb/src/dev.c
r4ca778b r2745176 46 46 * @return Error code. 47 47 */ 48 int usb_get_info_by_handle(devman_handle_t device_handle,48 static int usb_get_info_by_handle(devman_handle_t device_handle, 49 49 devman_handle_t *hc_handle, usb_address_t *address, int *iface) 50 50 { … … 111 111 112 112 return EOK; 113 } 114 115 static inline int usb_get_hc_by_handle(devman_handle_t dev, devman_handle_t *hc) 116 { 117 return usb_get_info_by_handle(dev, hc, NULL, NULL); 118 } 119 120 static inline int usb_get_address_by_handle( 121 devman_handle_t dev, usb_address_t *address) 122 { 123 return usb_get_info_by_handle(dev, NULL, address, NULL); 113 124 } 114 125 -
uspace/lib/usb/src/hc.c
r4ca778b r2745176 108 108 } else (void)0 109 109 110 /** Initialize connection to USB host controller.111 *112 * @param connection Connection to be initialized.113 * @param device Device connecting to the host controller.114 * @return Error code.115 */116 int usb_hc_connection_initialize_from_device(usb_hc_connection_t *connection,117 ddf_dev_t *device)118 {119 if (device == NULL)120 return EBADMEM;121 122 devman_handle_t hc_handle;123 const int rc = usb_get_hc_by_handle(ddf_dev_get_handle(device), &hc_handle);124 if (rc == EOK) {125 usb_hc_connection_initialize(connection, hc_handle);126 }127 128 return rc;129 }130 110 131 111 void usb_hc_connection_deinitialize(usb_hc_connection_t *connection)
Note:
See TracChangeset
for help on using the changeset viewer.