Changeset 6832245 in mainline for uspace/drv/bus/usb/uhci/hc.c
- Timestamp:
- 2017-12-14T23:01:57Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 837d53d
- Parents:
- bd05140
- git-author:
- Ondřej Hlavatý <aearsis@…> (2017-12-14 23:01:54)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2017-12-14 23:01:57)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/hc.c
rbd05140 r6832245 95 95 96 96 static void hc_init_hw(const hc_t *instance); 97 static int hc_init_mem_structures(hc_t *instance );97 static int hc_init_mem_structures(hc_t *instance, hcd_t *); 98 98 static int hc_init_transfer_lists(hc_t *instance); 99 99 … … 215 215 * interrupt fibrils. 216 216 */ 217 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res)217 int hc_init(hc_t *instance, hcd_t *hcd, const hw_res_list_parsed_t *hw_res) 218 218 { 219 219 assert(instance); … … 238 238 hw_res->io_ranges.ranges[0].size); 239 239 240 ret = hc_init_mem_structures(instance );240 ret = hc_init_mem_structures(instance, hcd); 241 241 if (ret != EOK) { 242 242 usb_log_error("Failed to init UHCI memory structures: %s.\n", … … 309 309 } 310 310 311 static usb_transfer_batch_t *create_transfer_batch( bus_t *bus,endpoint_t *ep)311 static usb_transfer_batch_t *create_transfer_batch(endpoint_t *ep) 312 312 { 313 313 uhci_transfer_batch_t *batch = uhci_transfer_batch_create(ep); … … 319 319 uhci_transfer_batch_destroy(uhci_transfer_batch_get(batch)); 320 320 } 321 322 static const bus_ops_t uhci_bus_ops = { 323 .parent = &usb2_bus_ops, 324 325 .endpoint_count_bw = bandwidth_count_usb11, 326 .batch_create = create_transfer_batch, 327 .batch_destroy = destroy_transfer_batch, 328 }; 321 329 322 330 /** Initialize UHCI hc memory structures. … … 330 338 * - frame list page (needs to be one UHCI hw accessible 4K page) 331 339 */ 332 int hc_init_mem_structures(hc_t *instance )340 int hc_init_mem_structures(hc_t *instance, hcd_t *hcd) 333 341 { 334 342 int err; 335 343 assert(instance); 336 344 337 if ((err = usb2_bus_init(&instance->bus, BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11)))345 if ((err = usb2_bus_init(&instance->bus, hcd, BANDWIDTH_AVAILABLE_USB11))) 338 346 return err; 339 347 340 instance->bus.base.ops.create_batch = create_transfer_batch;341 instance->bus.base.ops.destroy_batch = destroy_transfer_batch;348 bus_t *bus = (bus_t *) &instance->bus; 349 bus->ops = &uhci_bus_ops; 342 350 343 351 /* Init USB frame list page */
Note:
See TracChangeset
for help on using the changeset viewer.