Changeset 4ca778b in mainline for uspace/drv/bus/usb/usbmid/usbmid.c
- Timestamp:
- 2013-01-27T15:39:10Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2745176
- Parents:
- 0eb2a0f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbmid/usbmid.c
r0eb2a0f r4ca778b 39 39 #include <stdlib.h> 40 40 #include <usb_iface.h> 41 #include <usb/ddfiface.h>42 41 #include <usb/dev/pipes.h> 43 42 #include <usb/classes/classes.h> 44 43 #include <usb/dev/recognise.h> 45 44 #include "usbmid.h" 45 /** Get host controller handle by calling the parent usb_device_t. 46 * 47 * @param[in] fun Device function the operation is running on. 48 * @param[out] handle Storage for the host controller handle. 49 * @return Error code. 50 */ 51 static int usb_iface_device_hc_handle(ddf_fun_t *fun, devman_handle_t *handle) 52 { 53 assert(handle); 54 assert(fun); 55 usb_device_t *usb_dev = usb_device_get(ddf_fun_get_dev(fun)); 56 assert(usb_dev); 57 *handle = usb_device_hc_handle(usb_dev); 58 return EOK; 59 } 60 61 /** Get USB device address by calling the parent usb_device_t. 62 * 63 * @param[in] fun Device function the operation is running on. 64 * @param[in] handle Devman handle of USB device we want address of. 65 * @param[out] address Storage for USB address of device with handle @p handle. 66 * @return Error code. 67 */ 68 static int usb_iface_device_address(ddf_fun_t *fun, usb_address_t *address) 69 { 70 assert(address); 71 assert(fun); 72 usb_device_t *usb_dev = usb_device_get(ddf_fun_get_dev(fun)); 73 assert(usb_dev); 74 *address = usb_device_address(usb_dev); 75 return EOK; 76 } 46 77 47 78 /** Callback for DDF USB interface. */ 48 static int usb_iface_ get_interface_impl(ddf_fun_t *fun, int *iface_no)79 static int usb_iface_iface(ddf_fun_t *fun, int *iface_no) 49 80 { 50 81 usbmid_interface_t *iface = ddf_fun_data_get(fun); … … 60 91 /** DDF interface of the child - interface function. */ 61 92 static usb_iface_t child_usb_iface = { 62 .get_hc_handle = usb_iface_ get_hc_handle_device_impl,63 .get_my_address = usb_iface_ get_my_address_forward_impl,64 .get_my_interface = usb_iface_ get_interface_impl,93 .get_hc_handle = usb_iface_device_hc_handle, 94 .get_my_address = usb_iface_device_address, 95 .get_my_interface = usb_iface_iface, 65 96 }; 66 97
Note:
See TracChangeset
for help on using the changeset viewer.