Changeset 4ca778b in mainline
- 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
- Location:
- uspace
- Files:
-
- 2 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/hc.c
r0eb2a0f r4ca778b 41 41 #include <usb/debug.h> 42 42 #include <usb/usb.h> 43 #include <usb/ddfiface.h>44 43 45 44 #include "hc.h" -
uspace/drv/bus/usb/ohci/ohci.c
r0eb2a0f r4ca778b 38 38 #include <ddf/interrupt.h> 39 39 #include <usb/usb.h> 40 #include <usb/ddfiface.h>41 40 #include <usb/debug.h> 42 41 -
uspace/drv/bus/usb/uhci/main.c
r0eb2a0f r4ca778b 36 36 #include <str_error.h> 37 37 38 #include <usb/ddfiface.h>39 38 #include <usb/debug.h> 40 39 -
uspace/drv/bus/usb/uhci/uhci.c
r0eb2a0f r4ca778b 40 40 #include <str_error.h> 41 41 #include <ddf/interrupt.h> 42 #include <usb/ddfiface.h>43 42 #include <usb/debug.h> 44 43 #include <usb/host/hcd.h> -
uspace/drv/bus/usb/usbhub/usbhub.c
r0eb2a0f r4ca778b 45 45 #include <usb/dev/pipes.h> 46 46 #include <usb/classes/classes.h> 47 #include <usb/ddfiface.h>48 47 #include <usb/descriptor.h> 49 48 #include <usb/dev/recognise.h> -
uspace/drv/bus/usb/usbmid/explore.c
r0eb2a0f r4ca778b 40 40 #include <usb/dev/request.h> 41 41 #include <usb/dev/dp.h> 42 #include <usb/ddfiface.h>43 42 #include "usbmid.h" 44 45 /** Operations of the device itself. */46 static ddf_dev_ops_t mid_device_ops = {47 .interfaces[USB_DEV_IFACE] = &usb_iface_hub_impl48 };49 43 50 44 /** Tell whether given interface is already in the list. … … 93 87 /* Walk all descriptors nested in the current configuration decriptor; 94 88 * i.e. all interface descriptors. */ 95 for (; interface_ptr != NULL;89 for (; interface_ptr != NULL; 96 90 interface_ptr = usb_dp_get_sibling_descriptor( 97 91 &parser, &data, config_descriptor, interface_ptr)) … … 170 164 return rc; 171 165 } 172 173 166 174 175 167 /* Create driver soft-state. */ 176 168 usb_mid_t *usb_mid = usb_device_data_alloc(dev, sizeof(usb_mid_t)); … … 186 178 return ENOMEM; 187 179 } 188 ddf_fun_set_ops(usb_mid->ctl_fun, &mid_device_ops);189 180 190 181 /* Bind control function. */ … … 197 188 } 198 189 199 200 190 /* Create interface children. */ 201 191 list_initialize(&usb_mid->interface_list); -
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 -
uspace/drv/bus/usb/vhc/main.c
r0eb2a0f r4ca778b 41 41 #include <usb/host/ddf_helpers.h> 42 42 43 #include <usb/ddfiface.h>44 43 #include <usb/debug.h> 45 44 #include "vhcd.h" -
uspace/lib/usb/Makefile
r0eb2a0f r4ca778b 36 36 SOURCES = \ 37 37 src/class.c \ 38 src/ddfiface.c \39 38 src/dev.c \ 40 39 src/debug.c \ -
uspace/lib/usbdev/include/usb/dev/device.h
r0eb2a0f r4ca778b 52 52 typedef struct usb_device usb_device_t; 53 53 54 /* DDF parts */ 54 55 int usb_device_create_ddf(ddf_dev_t *, const usb_endpoint_description_t **, const char **); 55 56 void usb_device_destroy_ddf(ddf_dev_t *); 57 58 static inline usb_device_t *usb_device_get(ddf_dev_t *dev) 59 { 60 assert(dev); 61 return ddf_dev_data_get(dev); 62 } 63 56 64 57 65 usb_device_t * usb_device_create(devman_handle_t); … … 87 95 void * usb_device_data_get(usb_device_t *); 88 96 97 /* Legacy support */ 98 usb_address_t usb_device_address(usb_device_t *); 99 devman_handle_t usb_device_hc_handle(usb_device_t*); 100 89 101 #endif 90 102 /** -
uspace/lib/usbdev/src/devdrv.c
r0eb2a0f r4ca778b 592 592 return usb_dev->driver_data; 593 593 } 594 595 usb_address_t usb_device_address(usb_device_t *usb_dev) 596 { 597 assert(usb_dev); 598 return usb_dev->wire.address; 599 } 600 601 devman_handle_t usb_device_hc_handle(usb_device_t *usb_dev) 602 { 603 assert(usb_dev); 604 return usb_dev->hc_conn.hc_handle; 605 } 594 606 /** 595 607 * @} -
uspace/lib/usbdev/src/recognise.c
r0eb2a0f r4ca778b 39 39 #include <usb/dev/pipes.h> 40 40 #include <usb/dev/recognise.h> 41 #include <usb/ddfiface.h>42 41 #include <usb/dev/request.h> 43 42 #include <usb/classes/classes.h>
Note:
See TracChangeset
for help on using the changeset viewer.