Changes in uspace/drv/uhci-hcd/uhci_hc.c [17ceb72:a9f91cd] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/uhci_hc.c
r17ceb72 ra9f91cd 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup drvusbuhcihc28 /** @addtogroup usb 29 29 * @{ 30 30 */ 31 31 /** @file 32 * @brief UHCI Host controller driver routines32 * @brief UHCI driver 33 33 */ 34 34 #include <errno.h> … … 59 59 } 60 60 }; 61 62 /** Gets USB address of the calling device. 63 * 64 * @param[in] fun UHCI hc function. 65 * @param[in] handle Handle of the device seeking address. 66 * @param[out] address Place to store found address. 67 * @return Error code. 68 */ 61 69 /*----------------------------------------------------------------------------*/ 62 70 static int uhci_hc_init_transfer_lists(uhci_hc_t *instance); … … 70 78 bool low_speed, usb_transfer_type_t transfer, size_t size); 71 79 /*----------------------------------------------------------------------------*/ 72 /** Initialize UHCI hcd driver structure80 /** Initializes UHCI hcd driver structure 73 81 * 74 82 * @param[in] instance Memory place to initialize. … … 78 86 * @return Error code. 79 87 * @note Should be called only once on any structure. 80 *81 * Initializes memory structures, starts up hw, and launches debugger and82 * interrupt fibrils.83 88 */ 84 89 int uhci_hc_init(uhci_hc_t *instance, ddf_fun_t *fun, void *regs, size_t reg_size) … … 125 130 } 126 131 /*----------------------------------------------------------------------------*/ 127 /** Initialize UHCI hchw resources.132 /** Initializes UHCI hcd hw resources. 128 133 * 129 134 * @param[in] instance UHCI structure to use. 130 * For magic values see UHCI Design Guide131 135 */ 132 136 void uhci_hc_init_hw(uhci_hc_t *instance) … … 150 154 151 155 /* Enable all interrupts, but resume interrupt */ 152 pio_write_16(&instance->registers->usbintr,153 UHCI_INTR_CRC | UHCI_INTR_COMPLETE | UHCI_INTR_SHORT_PACKET);156 // pio_write_16(&instance->registers->usbintr, 157 // UHCI_INTR_CRC | UHCI_INTR_COMPLETE | UHCI_INTR_SHORT_PACKET); 154 158 155 159 uint16_t status = pio_read_16(®isters->usbcmd); … … 162 166 } 163 167 /*----------------------------------------------------------------------------*/ 164 /** Initialize UHCI hcmemory structures.168 /** Initializes UHCI hcd memory structures. 165 169 * 166 170 * @param[in] instance UHCI structure to use. 167 171 * @return Error code 168 172 * @note Should be called only once on any structure. 169 *170 * Structures:171 * - interrupt code (I/O addressses are customized per instance)172 * - transfer lists (queue heads need to be accessible by the hw)173 * - frame list page (needs to be one UHCI hw accessible 4K page)174 173 */ 175 174 int uhci_hc_init_mem_structures(uhci_hc_t *instance) … … 230 229 } 231 230 /*----------------------------------------------------------------------------*/ 232 /** Initialize UHCI hctransfer lists.231 /** Initializes UHCI hcd transfer lists. 233 232 * 234 233 * @param[in] instance UHCI structure to use. 235 234 * @return Error code 236 235 * @note Should be called only once on any structure. 237 *238 * Initializes transfer lists and sets them in one chain to support proper239 * USB scheduling. Sets pointer table for quick access.240 236 */ 241 237 int uhci_hc_init_transfer_lists(uhci_hc_t *instance) … … 297 293 } 298 294 /*----------------------------------------------------------------------------*/ 299 /** Schedule batch for execution.295 /** Schedules batch for execution. 300 296 * 301 297 * @param[in] instance UHCI structure to use. 302 298 * @param[in] batch Transfer batch to schedule. 303 299 * @return Error code 304 *305 * Checks for bandwidth availability and appends the batch to the proper queue.306 300 */ 307 301 int uhci_hc_schedule(uhci_hc_t *instance, batch_t *batch) … … 318 312 return ENOTSUP; 319 313 } 320 /* TODO: check available bandwi dth here */314 /* TODO: check available bandwith here */ 321 315 322 316 transfer_list_t *list = … … 328 322 } 329 323 /*----------------------------------------------------------------------------*/ 330 /** Take action based on the interrupt cause.324 /** Takes action based on the interrupt cause. 331 325 * 332 326 * @param[in] instance UHCI structure to use. 333 * @param[in] status Value of the status register at the time of interrupt. 334 * 335 * Interrupt might indicate: 336 * - transaction completed, either by triggering IOC, SPD, or an error 337 * - some kind of device error 338 * - resume from suspend state (not implemented) 327 * @param[in] status Value of the stsatus regiser at the time of interrupt. 339 328 */ 340 329 void uhci_hc_interrupt(uhci_hc_t *instance, uint16_t status) … … 353 342 /** Polling function, emulates interrupts. 354 343 * 355 * @param[in] arg UHCI hcstructure to use.356 * @return EOK (should never return)344 * @param[in] arg UHCI structure to use. 345 * @return EOK 357 346 */ 358 347 int uhci_hc_interrupt_emulator(void* arg) … … 377 366 * 378 367 * @param[in] arg UHCI structure to use. 379 * @return EOK (should never return)368 * @return EOK 380 369 */ 381 370 int uhci_hc_debug_checker(void *arg) … … 441 430 } 442 431 /*----------------------------------------------------------------------------*/ 443 /** Check transfer packets, for USB validity432 /** Checks transfer packets, for USB validity 444 433 * 445 434 * @param[in] low_speed Transfer speed. 446 435 * @param[in] transfer Transer type 447 436 * @param[in] size Maximum size of used packets 448 * @return True if transaction is allowed by USB specs, false otherwise437 * @return EOK 449 438 */ 450 439 bool allowed_usb_packet(
Note:
See TracChangeset
for help on using the changeset viewer.