Changeset 9348862 in mainline
- Timestamp:
- 2013-09-21T00:43:24Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4cf5b8e0
- Parents:
- 3f03199
- Location:
- uspace
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/hc.c
r3f03199 r9348862 296 296 { 297 297 assert(hcd); 298 hc_t *instance = hcd-> private_data;298 hc_t *instance = hcd->driver.data; 299 299 assert(instance); 300 300 -
uspace/drv/bus/usb/ohci/ohci.c
r3f03199 r9348862 58 58 assert(dev); 59 59 hcd_t *hcd = dev_to_hcd(dev); 60 if (!hcd || !hcd-> private_data) {60 if (!hcd || !hcd->driver.data) { 61 61 usb_log_warning("Interrupt on device that is not ready.\n"); 62 62 return; … … 64 64 65 65 const uint16_t status = IPC_GET_ARG1(*call); 66 hc_interrupt(hcd-> private_data, status);66 hc_interrupt(hcd->driver.data, status); 67 67 } 68 68 -
uspace/drv/bus/usb/ohci/ohci_endpoint.c
r3f03199 r9348862 90 90 endpoint_set_hc_data( 91 91 ep, ohci_ep, ohci_ep_toggle_get, ohci_ep_toggle_set); 92 hc_enqueue_endpoint(hcd-> private_data, ep);92 hc_enqueue_endpoint(hcd->driver.data, ep); 93 93 return EOK; 94 94 } … … 104 104 assert(ep); 105 105 ohci_endpoint_t *instance = ohci_endpoint_get(ep); 106 hc_dequeue_endpoint(hcd-> private_data, ep);106 hc_dequeue_endpoint(hcd->driver.data, ep); 107 107 if (instance) { 108 108 free32(instance->ed); -
uspace/drv/bus/usb/uhci/hc.c
r3f03199 r9348862 444 444 { 445 445 assert(hcd); 446 hc_t *instance = hcd-> private_data;446 hc_t *instance = hcd->driver.data; 447 447 assert(instance); 448 448 assert(batch); -
uspace/drv/bus/usb/uhci/uhci.c
r3f03199 r9348862 57 57 assert(dev); 58 58 hcd_t *hcd = dev_to_hcd(dev); 59 if (!hcd || !hcd-> private_data) {59 if (!hcd || !hcd->driver.data) { 60 60 usb_log_error("Interrupt on not yet initialized device.\n"); 61 61 return; 62 62 } 63 63 const uint16_t status = IPC_GET_ARG1(*call); 64 hc_interrupt(hcd-> private_data, status);64 hc_interrupt(hcd->driver.data, status); 65 65 } 66 66 -
uspace/drv/bus/usb/vhc/transfer.c
r3f03199 r9348862 167 167 assert(hcd); 168 168 assert(batch); 169 vhc_data_t *vhc = hcd-> private_data;169 vhc_data_t *vhc = hcd->driver.data; 170 170 assert(vhc); 171 171 -
uspace/lib/usbhost/include/usb/host/hcd.h
r3f03199 r9348862 50 50 typedef void (*ep_remove_hook_t)(hcd_t *, endpoint_t *); 51 51 52 /** Generic host controller driver structure. */ 53 struct hcd { 54 /** Endpoint manager. */ 55 usb_endpoint_manager_t ep_manager; 56 52 typedef struct { 57 53 /** Device specific driver data. */ 58 void * private_data;54 void *data; 59 55 /** Transfer scheduling, implement in device driver. */ 60 56 schedule_hook_t schedule; … … 63 59 /** Hook called upon removing of an endpoint. */ 64 60 ep_remove_hook_t ep_remove_hook; 61 } hc_driver_t; 62 63 /** Generic host controller driver structure. */ 64 struct hcd { 65 /** Endpoint manager. */ 66 usb_endpoint_manager_t ep_manager; 67 68 /** Driver implementation */ 69 hc_driver_t driver; 65 70 }; 66 71 … … 72 77 { 73 78 assert(hcd); 74 hcd-> private_data = data;75 hcd-> schedule = schedule;76 hcd-> ep_add_hook = add_hook;77 hcd-> ep_remove_hook = rem_hook;79 hcd->driver.data = data; 80 hcd->driver.schedule = schedule; 81 hcd->driver.ep_add_hook = add_hook; 82 hcd->driver.ep_remove_hook = rem_hook; 78 83 } 79 84 -
uspace/lib/usbhost/src/hcd.c
r3f03199 r9348862 52 52 assert(ep); 53 53 assert(hcd); 54 if (hcd-> ep_add_hook)55 return hcd-> ep_add_hook(hcd, ep);54 if (hcd->driver.ep_add_hook) 55 return hcd->driver.ep_add_hook(hcd, ep); 56 56 return EOK; 57 57 } … … 66 66 assert(ep); 67 67 assert(hcd); 68 if (hcd-> ep_remove_hook)69 hcd-> ep_remove_hook(hcd, ep);68 if (hcd->driver.ep_remove_hook) 69 hcd->driver.ep_remove_hook(hcd, ep); 70 70 } 71 71 … … 97 97 usb_endpoint_manager_init(&hcd->ep_manager, bandwidth, bw_count, max_speed); 98 98 99 hcd-> private_data = NULL;100 hcd-> schedule = NULL;101 hcd-> ep_add_hook = NULL;102 hcd-> ep_remove_hook = NULL;99 hcd->driver.data = NULL; 100 hcd->driver.schedule = NULL; 101 hcd->driver.ep_add_hook = NULL; 102 hcd->driver.ep_remove_hook = NULL; 103 103 } 104 104 … … 207 207 return ENOSPC; 208 208 } 209 if (!hcd-> schedule) {209 if (!hcd->driver.schedule) { 210 210 usb_log_error("HCD does not implement scheduler.\n"); 211 211 return ENOTSUP; … … 239 239 } 240 240 241 const int ret = hcd-> schedule(hcd, batch);241 const int ret = hcd->driver.schedule(hcd, batch); 242 242 if (ret != EOK) 243 243 usb_transfer_batch_destroy(batch);
Note:
See TracChangeset
for help on using the changeset viewer.