Changes in uspace/lib/usbhost/include/usb/host/hcd.h [8d2dd7f2:479e32d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/hcd.h
r8d2dd7f2 r479e32d 38 38 39 39 #include <usb/host/endpoint.h> 40 #include <usb/host/ usb_bus.h>40 #include <usb/host/bus.h> 41 41 #include <usb/host/usb_transfer_batch.h> 42 42 #include <usb/usb.h> 43 43 44 44 #include <assert.h> 45 #include < usbhc_iface.h>45 #include <mem.h> 46 46 #include <stddef.h> 47 47 #include <stdint.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 *);54 52 typedef void (*interrupt_hook_t)(hcd_t *, uint32_t); 55 53 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 *); 56 55 57 56 typedef struct { 58 57 /** Transfer scheduling, implement in device driver. */ 59 58 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;64 59 /** Hook to be called on device interrupt, passes ARG1 */ 65 60 interrupt_hook_t irq_hook; 66 61 /** Periodic polling hook */ 67 62 status_hook_t status_hook; 63 /** Hook to setup device address */ 64 address_device_hook_t address_device; 68 65 } hcd_ops_t; 69 66 … … 71 68 struct hcd { 72 69 /** Endpoint manager. */ 73 usb_bus_tbus;70 bus_t *bus; 74 71 75 72 /** Interrupt replacement fibril */ … … 78 75 /** Driver implementation */ 79 76 hcd_ops_t ops; 77 80 78 /** Device specific driver data. */ 81 79 void * driver_data; 82 80 }; 83 81 84 extern void hcd_init(hcd_t * , usb_speed_t, size_t, bw_count_func_t);82 extern void hcd_init(hcd_t *); 85 83 86 84 static inline void hcd_set_implementation(hcd_t *hcd, void *data, 87 const hcd_ops_t *ops )85 const hcd_ops_t *ops, bus_t *bus) 88 86 { 89 87 assert(hcd); … … 91 89 hcd->driver_data = data; 92 90 hcd->ops = *ops; 91 hcd->bus = bus; 93 92 } else { 94 93 memset(&hcd->ops, 0, sizeof(hcd->ops)); … … 104 103 extern usb_address_t hcd_request_address(hcd_t *, usb_speed_t); 105 104 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 115 105 extern int hcd_add_ep(hcd_t *, usb_target_t, usb_direction_t, 116 usb_transfer_type_t, size_t, unsigned int, size_t, usb_address_t, 117 unsigned int); 106 usb_transfer_type_t, size_t, unsigned int, size_t, usb_tt_address_t); 118 107 119 108 extern int hcd_remove_ep(hcd_t *, usb_target_t, usb_direction_t); 120 109 121 extern int hcd_send_batch(hcd_t *, usb_target_t, usb_direction_t, void *,122 size_t, uint64_t, usbhc_iface_transfer_in_callback_t,123 usb hc_iface_transfer_out_callback_t, void *, const char *);110 extern int hcd_send_batch(hcd_t *, device_t *, usb_target_t, 111 usb_direction_t direction, char *, size_t, uint64_t, 112 usb_transfer_batch_callback_t, void *, const char *); 124 113 125 extern ssize_t hcd_send_batch_sync(hcd_t *, usb_target_t, usb_direction_t, 126 void *, size_t, uint64_t, const char *); 114 extern ssize_t hcd_send_batch_sync(hcd_t *, device_t *, usb_target_t, 115 usb_direction_t direction, char *, size_t, uint64_t, 116 const char *); 127 117 128 118 #endif
Note:
See TracChangeset
for help on using the changeset viewer.