Changeset df6ded8 in mainline for uspace/drv/bus/usb/uhci/hc.h
- Timestamp:
- 2018-02-28T16:37:50Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1b20da0
- Parents:
- f5e5f73 (diff), b2dca8de (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Jakub Jermar <jakub@…> (2018-02-28 16:06:42)
- git-committer:
- Jakub Jermar <jakub@…> (2018-02-28 16:37:50)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/hc.h
rf5e5f73 rdf6ded8 1 1 /* 2 2 * Copyright (c) 2011 Jan Vesely 3 * Copyright (c) 2018 Ondrej Hlavaty 3 4 * All rights reserved. 4 5 * … … 43 44 #include <ddi.h> 44 45 #include <usb/host/hcd.h> 46 #include <usb/host/usb2_bus.h> 45 47 #include <usb/host/usb_transfer_batch.h> 46 48 … … 99 101 /** Main UHCI driver structure */ 100 102 typedef struct hc { 103 /* Common hc_device header */ 104 hc_device_t base; 105 101 106 uhci_rh_t rh; 107 bus_t bus; 108 usb2_bus_helper_t bus_helper; 109 102 110 /** Addresses of I/O registers */ 103 111 uhci_regs_t *registers; … … 117 125 /** Pointer table to the above lists, helps during scheduling */ 118 126 transfer_list_t *transfers[2][4]; 119 /** Indicator of hw interrupts availability */ 120 bool hw_interrupts; 127 128 /** 129 * Guard for the pending list. Can be locked under EP guard, but not 130 * vice versa. 131 */ 132 fibril_mutex_t guard; 133 /** List of endpoints with a transfer scheduled */ 134 list_t pending_endpoints; 121 135 122 136 /** Number of hw failures detected. */ … … 124 138 } hc_t; 125 139 126 extern errno_t hc_init(hc_t *, const hw_res_list_parsed_t *, bool); 127 extern void hc_fini(hc_t *);140 typedef struct uhci_endpoint { 141 endpoint_t base; 128 142 129 extern errno_t uhci_hc_gen_irq_code(irq_code_t *, const hw_res_list_parsed_t *, int *); 143 bool toggle; 144 } uhci_endpoint_t; 130 145 131 extern void uhci_hc_interrupt(hcd_t *, uint32_t); 132 extern errno_t uhci_hc_status(hcd_t *, uint32_t *); 133 extern errno_t uhci_hc_schedule(hcd_t *, usb_transfer_batch_t *); 146 static inline hc_t *hcd_to_hc(hc_device_t *hcd) 147 { 148 assert(hcd); 149 return (hc_t *) hcd; 150 } 151 152 static inline hc_t *bus_to_hc(bus_t *bus) 153 { 154 assert(bus); 155 return member_to_inst(bus, hc_t, bus); 156 } 157 158 int hc_unschedule_batch(usb_transfer_batch_t *); 159 160 extern errno_t hc_add(hc_device_t *, const hw_res_list_parsed_t *); 161 extern errno_t hc_gen_irq_code(irq_code_t *, hc_device_t *, const hw_res_list_parsed_t *, int *); 162 extern errno_t hc_start(hc_device_t *); 163 extern errno_t hc_setup_roothub(hc_device_t *); 164 extern errno_t hc_gone(hc_device_t *); 134 165 135 166 #endif
Note:
See TracChangeset
for help on using the changeset viewer.