Changes in uspace/drv/uhci-rhd/root_hub.c [dced52a:275bf456] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-rhd/root_hub.c
rdced52a r275bf456 40 40 #include "root_hub.h" 41 41 42 /** Initializes UHCI root hub instance. 43 * 44 * @param[in] instance Driver memory structure to use. 45 * @param[in] addr Address of I/O registers. 46 * @param[in] size Size of available I/O space. 47 * @param[in] rh Pointer to ddf instance fo the root hub driver. 48 * @return Error code. 49 */ 42 50 int uhci_root_hub_init( 43 51 uhci_root_hub_t *instance, void *addr, size_t size, ddf_dev_t *rh) … … 47 55 int ret; 48 56 49 /* allow access to root hubregisters */50 assert(sizeof(port_status_t) * UHCI_ROOT_HUB_PORT_COUNT == size);57 /* Allow access to root hub port registers */ 58 assert(sizeof(port_status_t) * UHCI_ROOT_HUB_PORT_COUNT <= size); 51 59 port_status_t *regs; 52 60 ret = pio_enable(addr, size, (void**)®s); 53 54 61 if (ret < 0) { 55 usb_log_error("Failed to gain access to port registers at %p\n", regs); 62 usb_log_error( 63 "Failed to gain access to port registers at %p\n", regs); 56 64 return ret; 57 65 } … … 60 68 unsigned i = 0; 61 69 for (; i < UHCI_ROOT_HUB_PORT_COUNT; ++i) { 62 /* mind pointer arithmetics*/70 /* NOTE: mind pointer arithmetics here */ 63 71 ret = uhci_port_init( 64 &instance->ports[i], regs + i, i, ROOT_HUB_WAIT_USEC, rh);72 &instance->ports[i], regs + i, i, ROOT_HUB_WAIT_USEC, rh); 65 73 if (ret != EOK) { 66 74 unsigned j = 0; … … 74 82 } 75 83 /*----------------------------------------------------------------------------*/ 76 int uhci_root_hub_fini( uhci_root_hub_t* instance ) 84 /** Finishes UHCI root hub instance. 85 * 86 * @param[in] instance Driver memory structure to use. 87 * @return Error code. 88 */ 89 int uhci_root_hub_fini(uhci_root_hub_t* instance) 77 90 { 78 assert( instance ); 79 // TODO: 80 //destroy fibril here 81 //disable access to registers 91 assert(instance); 92 unsigned i = 0; 93 for (; i < UHCI_ROOT_HUB_PORT_COUNT; ++i) { 94 uhci_port_fini(&instance->ports[i]); 95 } 82 96 return EOK; 83 97 }
Note:
See TracChangeset
for help on using the changeset viewer.