Changeset e4d7363 in mainline for uspace/drv/bus/usb/uhci
- Timestamp:
- 2017-06-22T21:34:39Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 91ca111
- Parents:
- cb89430
- Location:
- uspace/drv/bus/usb/uhci
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/hc.c
rcb89430 re4d7363 106 106 * @return Error code. 107 107 */ 108 int uhci_hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res)108 int uhci_hc_gen_irq_code(irq_code_t *code, hcd_t *hcd, const hw_res_list_parsed_t *hw_res) 109 109 { 110 110 assert(code); … … 214 214 * interrupt fibrils. 215 215 */ 216 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res , bool interrupts)216 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res) 217 217 { 218 218 assert(instance); … … 222 222 return EINVAL; 223 223 224 instance->hw_interrupts = interrupts;225 224 instance->hw_failures = 0; 226 225 … … 246 245 } 247 246 247 return EOK; 248 } 249 250 void hc_start(hc_t *instance) 251 { 248 252 hc_init_hw(instance); 249 253 (void)hc_debug_checker; 250 254 251 255 uhci_rh_init(&instance->rh, instance->registers->ports, "uhci"); 252 253 return EOK;254 256 } 255 257 -
uspace/drv/bus/usb/uhci/hc.h
rcb89430 re4d7363 124 124 } hc_t; 125 125 126 extern int hc_init(hc_t *, const hw_res_list_parsed_t *, bool); 126 extern int hc_init(hc_t *, const hw_res_list_parsed_t *); 127 extern void hc_start(hc_t *); 127 128 extern void hc_fini(hc_t *); 128 129 129 extern int uhci_hc_gen_irq_code(irq_code_t *, const hw_res_list_parsed_t *);130 extern int uhci_hc_gen_irq_code(irq_code_t *, hcd_t *,const hw_res_list_parsed_t *); 130 131 131 132 extern void uhci_hc_interrupt(hcd_t *, uint32_t); -
uspace/drv/bus/usb/uhci/main.c
rcb89430 re4d7363 50 50 #define NAME "uhci" 51 51 52 static int uhci_driver_init(hcd_t *, const hw_res_list_parsed_t *, bool); 52 static int uhci_driver_init(hcd_t *, const hw_res_list_parsed_t *); 53 static int uhci_driver_start(hcd_t *, bool); 53 54 static void uhci_driver_fini(hcd_t *); 54 static int disable_legacy( ddf_dev_t *);55 static int disable_legacy(hcd_t *, ddf_dev_t *); 55 56 56 57 static const ddf_hc_driver_t uhci_hc_driver = { … … 59 60 .irq_code_gen = uhci_hc_gen_irq_code, 60 61 .init = uhci_driver_init, 62 .start = uhci_driver_start, 61 63 .fini = uhci_driver_fini, 62 64 .name = "UHCI", … … 68 70 }; 69 71 70 static int uhci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res , bool irq)72 static int uhci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res) 71 73 { 72 74 assert(hcd); … … 77 79 return ENOMEM; 78 80 79 const int ret = hc_init(instance, res , irq);81 const int ret = hc_init(instance, res); 80 82 if (ret == EOK) { 81 83 hcd_set_implementation(hcd, instance, &uhci_hc_driver.ops); … … 84 86 } 85 87 return ret; 88 } 89 90 static int uhci_driver_start(hcd_t *hcd, bool interrupts) 91 { 92 assert(hcd); 93 hc_t *hc = hcd_get_driver_data(hcd); 94 95 hc->hw_interrupts = interrupts; 96 hc_start(hc); 97 return EOK; 86 98 } 87 99 … … 102 114 * @return Error code. 103 115 */ 104 static int disable_legacy( ddf_dev_t *device)116 static int disable_legacy(hcd_t *hcd, ddf_dev_t *device) 105 117 { 106 118 assert(device);
Note:
See TracChangeset
for help on using the changeset viewer.
