Changes in uspace/lib/usbhost/include/usb/host/hcd.h [20eaa82:8d2dd7f2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/hcd.h
r20eaa82 r8d2dd7f2 38 38 39 39 #include <usb/host/endpoint.h> 40 #include <usb/host/ bus.h>40 #include <usb/host/usb_bus.h> 41 41 #include <usb/host/usb_transfer_batch.h> 42 42 #include <usb/usb.h> … … 50 50 51 51 typedef int (*schedule_hook_t)(hcd_t *, usb_transfer_batch_t *); 52 typedef int (*ep_add_hook_t)(hcd_t *, endpoint_t *); 53 typedef void (*ep_remove_hook_t)(hcd_t *, endpoint_t *); 52 54 typedef void (*interrupt_hook_t)(hcd_t *, uint32_t); 53 55 typedef int (*status_hook_t)(hcd_t *, uint32_t *); 54 typedef int (*address_device_hook_t)(hcd_t *, usb_speed_t, usb_tt_address_t, usb_address_t *);55 56 56 57 typedef struct { 57 58 /** Transfer scheduling, implement in device driver. */ 58 59 schedule_hook_t schedule; 60 /** Hook called upon registering new endpoint. */ 61 ep_add_hook_t ep_add_hook; 62 /** Hook called upon removing of an endpoint. */ 63 ep_remove_hook_t ep_remove_hook; 59 64 /** Hook to be called on device interrupt, passes ARG1 */ 60 65 interrupt_hook_t irq_hook; 61 66 /** Periodic polling hook */ 62 67 status_hook_t status_hook; 63 /** Hook to setup device address */64 address_device_hook_t address_device;65 68 } hcd_ops_t; 66 69 … … 68 71 struct hcd { 69 72 /** Endpoint manager. */ 70 bus_t *bus;73 usb_bus_t bus; 71 74 72 75 /** Interrupt replacement fibril */ … … 75 78 /** Driver implementation */ 76 79 hcd_ops_t ops; 77 78 80 /** Device specific driver data. */ 79 81 void * driver_data; 80 82 }; 81 83 82 extern void hcd_init(hcd_t * );84 extern void hcd_init(hcd_t *, usb_speed_t, size_t, bw_count_func_t); 83 85 84 86 static inline void hcd_set_implementation(hcd_t *hcd, void *data, 85 const hcd_ops_t *ops , bus_t *bus)87 const hcd_ops_t *ops) 86 88 { 87 89 assert(hcd); … … 89 91 hcd->driver_data = data; 90 92 hcd->ops = *ops; 91 hcd->bus = bus;92 93 } else { 93 94 memset(&hcd->ops, 0, sizeof(hcd->ops)); … … 103 104 extern usb_address_t hcd_request_address(hcd_t *, usb_speed_t); 104 105 106 extern int hcd_release_address(hcd_t *, usb_address_t); 107 108 extern int hcd_reserve_default_address(hcd_t *, usb_speed_t); 109 110 static inline int hcd_release_default_address(hcd_t *hcd) 111 { 112 return hcd_release_address(hcd, USB_ADDRESS_DEFAULT); 113 } 114 105 115 extern int hcd_add_ep(hcd_t *, usb_target_t, usb_direction_t, 106 usb_transfer_type_t, size_t, unsigned int, size_t, usb_tt_address_t); 116 usb_transfer_type_t, size_t, unsigned int, size_t, usb_address_t, 117 unsigned int); 107 118 108 119 extern int hcd_remove_ep(hcd_t *, usb_target_t, usb_direction_t);
Note:
See TracChangeset
for help on using the changeset viewer.