Changeset a9f91cd in mainline
- Timestamp:
- 2011-03-13T18:09:16Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 335382d, f123909
- Parents:
- 9351353
- Location:
- uspace/drv/uhci-hcd
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/batch.c
r9351353 ra9f91cd 450 450 { 451 451 assert(instance); 452 uhci_hc_t *hc = fun_to_uhci (instance->fun);452 uhci_hc_t *hc = fun_to_uhci_hc(instance->fun); 453 453 assert(hc); 454 return uhci_ schedule(hc, instance);454 return uhci_hc_schedule(hc, instance); 455 455 } 456 456 /** -
uspace/drv/uhci-hcd/iface.c
r9351353 ra9f91cd 53 53 { 54 54 assert(fun); 55 uhci_hc_t *hc = fun_to_uhci (fun);55 uhci_hc_t *hc = fun_to_uhci_hc(fun); 56 56 assert(hc); 57 57 usb_log_debug("Default address request with speed %d.\n", speed); … … 68 68 { 69 69 assert(fun); 70 uhci_hc_t *hc = fun_to_uhci (fun);70 uhci_hc_t *hc = fun_to_uhci_hc(fun); 71 71 assert(hc); 72 72 usb_log_debug("Default address release.\n"); … … 86 86 { 87 87 assert(fun); 88 uhci_hc_t *hc = fun_to_uhci (fun);88 uhci_hc_t *hc = fun_to_uhci_hc(fun); 89 89 assert(hc); 90 90 assert(address); … … 109 109 { 110 110 assert(fun); 111 uhci_hc_t *hc = fun_to_uhci (fun);111 uhci_hc_t *hc = fun_to_uhci_hc(fun); 112 112 assert(hc); 113 113 usb_log_debug("Address bind %d-%d.\n", address, handle); … … 125 125 { 126 126 assert(fun); 127 uhci_hc_t *hc = fun_to_uhci (fun);127 uhci_hc_t *hc = fun_to_uhci_hc(fun); 128 128 assert(hc); 129 129 usb_log_debug("Address release %d.\n", address); … … 148 148 { 149 149 assert(fun); 150 uhci_hc_t *hc = fun_to_uhci (fun);150 uhci_hc_t *hc = fun_to_uhci_hc(fun); 151 151 assert(hc); 152 152 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); … … 180 180 { 181 181 assert(fun); 182 uhci_hc_t *hc = fun_to_uhci (fun);182 uhci_hc_t *hc = fun_to_uhci_hc(fun); 183 183 assert(hc); 184 184 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); … … 211 211 { 212 212 assert(fun); 213 uhci_hc_t *hc = fun_to_uhci (fun);213 uhci_hc_t *hc = fun_to_uhci_hc(fun); 214 214 assert(hc); 215 215 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); … … 243 243 { 244 244 assert(fun); 245 uhci_hc_t *hc = fun_to_uhci (fun);245 uhci_hc_t *hc = fun_to_uhci_hc(fun); 246 246 assert(hc); 247 247 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); … … 277 277 { 278 278 assert(fun); 279 uhci_hc_t *hc = fun_to_uhci (fun);279 uhci_hc_t *hc = fun_to_uhci_hc(fun); 280 280 assert(hc); 281 281 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); … … 315 315 { 316 316 assert(fun); 317 uhci_hc_t *hc = fun_to_uhci (fun);317 uhci_hc_t *hc = fun_to_uhci_hc(fun); 318 318 assert(hc); 319 319 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); -
uspace/drv/uhci-hcd/uhci.c
r9351353 ra9f91cd 54 54 { 55 55 assert(dev); 56 uhci_hc_t *hc = dev_to_uhci(dev);56 uhci_hc_t *hc = &((uhci_t*)dev->driver_data)->hc; 57 57 uint16_t status = IPC_GET_ARG1(*call); 58 58 assert(hc); 59 uhci_ interrupt(hc, status);59 uhci_hc_interrupt(hc, status); 60 60 } 61 61 /*----------------------------------------------------------------------------*/ … … 188 188 if (instance->rh_fun) \ 189 189 ddf_fun_destroy(instance->rh_fun); \ 190 uhci_ fini(&instance->hc); \190 uhci_hc_fini(&instance->hc); \ 191 191 return ret; \ 192 192 } -
uspace/drv/uhci-hcd/uhci_hc.c
r9351353 ra9f91cd 68 68 */ 69 69 /*----------------------------------------------------------------------------*/ 70 static int uhci_ init_transfer_lists(uhci_hc_t *instance);71 static int uhci_ init_mem_structures(uhci_hc_t *instance);72 static void uhci_ init_hw(uhci_hc_t *instance);73 74 static int uhci_ interrupt_emulator(void *arg);75 static int uhci_ debug_checker(void *arg);70 static int uhci_hc_init_transfer_lists(uhci_hc_t *instance); 71 static int uhci_hc_init_mem_structures(uhci_hc_t *instance); 72 static void uhci_hc_init_hw(uhci_hc_t *instance); 73 74 static int uhci_hc_interrupt_emulator(void *arg); 75 static int uhci_hc_debug_checker(void *arg); 76 76 77 77 static bool allowed_usb_packet( … … 113 113 io, reg_size); 114 114 115 ret = uhci_ init_mem_structures(instance);115 ret = uhci_hc_init_mem_structures(instance); 116 116 CHECK_RET_DEST_FUN_RETURN(ret, 117 117 "Failed to initialize UHCI memory structures.\n"); 118 118 119 uhci_ init_hw(instance);119 uhci_hc_init_hw(instance); 120 120 instance->cleaner = 121 fibril_create(uhci_ interrupt_emulator, instance);121 fibril_create(uhci_hc_interrupt_emulator, instance); 122 122 fibril_add_ready(instance->cleaner); 123 123 124 instance->debug_checker = fibril_create(uhci_ debug_checker, instance);124 instance->debug_checker = fibril_create(uhci_hc_debug_checker, instance); 125 125 fibril_add_ready(instance->debug_checker); 126 126 … … 134 134 * @param[in] instance UHCI structure to use. 135 135 */ 136 void uhci_ init_hw(uhci_hc_t *instance)136 void uhci_hc_init_hw(uhci_hc_t *instance) 137 137 { 138 138 assert(instance); … … 172 172 * @note Should be called only once on any structure. 173 173 */ 174 int uhci_ init_mem_structures(uhci_hc_t *instance)174 int uhci_hc_init_mem_structures(uhci_hc_t *instance) 175 175 { 176 176 assert(instance); … … 201 201 202 202 /* Init transfer lists */ 203 ret = uhci_ init_transfer_lists(instance);203 ret = uhci_hc_init_transfer_lists(instance); 204 204 CHECK_RET_DEST_CMDS_RETURN(ret, "Failed to init transfer lists.\n"); 205 205 usb_log_debug("Initialized transfer lists.\n"); … … 235 235 * @note Should be called only once on any structure. 236 236 */ 237 int uhci_ init_transfer_lists(uhci_hc_t *instance)237 int uhci_hc_init_transfer_lists(uhci_hc_t *instance) 238 238 { 239 239 assert(instance); … … 299 299 * @return Error code 300 300 */ 301 int uhci_ schedule(uhci_hc_t *instance, batch_t *batch)301 int uhci_hc_schedule(uhci_hc_t *instance, batch_t *batch) 302 302 { 303 303 assert(instance); … … 327 327 * @param[in] status Value of the stsatus regiser at the time of interrupt. 328 328 */ 329 void uhci_ interrupt(uhci_hc_t *instance, uint16_t status)329 void uhci_hc_interrupt(uhci_hc_t *instance, uint16_t status) 330 330 { 331 331 assert(instance); … … 345 345 * @return EOK 346 346 */ 347 int uhci_ interrupt_emulator(void* arg)347 int uhci_hc_interrupt_emulator(void* arg) 348 348 { 349 349 usb_log_debug("Started interrupt emulator.\n"); … … 357 357 if (status != 0) 358 358 usb_log_debug2("UHCI status: %x.\n", status); 359 uhci_ interrupt(instance, status);359 uhci_hc_interrupt(instance, status); 360 360 async_usleep(UHCI_CLEANER_TIMEOUT); 361 361 } … … 368 368 * @return EOK 369 369 */ 370 int uhci_ debug_checker(void *arg)370 int uhci_hc_debug_checker(void *arg) 371 371 { 372 372 uhci_hc_t *instance = (uhci_hc_t*)arg; -
uspace/drv/uhci-hcd/uhci_hc.h
r9351353 ra9f91cd 1 1 /* 2 * Copyright (c) 201 0Jan Vesely2 * Copyright (c) 2011 Jan Vesely 3 3 * All rights reserved. 4 4 * … … 106 106 int uhci_hc_init(uhci_hc_t *instance, ddf_fun_t *fun, void *regs, size_t reg_size); 107 107 108 static inline void uhci_ fini(uhci_hc_t *instance) {};108 static inline void uhci_hc_fini(uhci_hc_t *instance) { /* TODO: implement*/ }; 109 109 110 int uhci_ schedule(uhci_hc_t *instance, batch_t *batch);110 int uhci_hc_schedule(uhci_hc_t *instance, batch_t *batch); 111 111 112 void uhci_ interrupt(uhci_hc_t *instance, uint16_t status);112 void uhci_hc_interrupt(uhci_hc_t *instance, uint16_t status); 113 113 114 static inline uhci_hc_t * dev_to_uhci(ddf_dev_t *dev) 115 { return (uhci_hc_t*)dev->driver_data; } 116 117 static inline uhci_hc_t * fun_to_uhci(ddf_fun_t *fun) 114 static inline uhci_hc_t * fun_to_uhci_hc(ddf_fun_t *fun) 118 115 { return (uhci_hc_t*)fun->driver_data; } 119 120 121 116 #endif 122 117 /**
Note:
See TracChangeset
for help on using the changeset viewer.