Changeset 540abef in mainline
- Timestamp:
- 2011-04-14T07:51:13Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c0cea918
- Parents:
- 27205841
- Location:
- uspace/drv/uhci-rhd
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-rhd/port.c
r27205841 r540abef 68 68 * @return Error code. (Always EOK) 69 69 */ 70 static inline void uhci_port_write_status( 71 uhci_port_t *port, port_status_t value) 72 { 73 assert(port); 74 pio_write_16(port->address, value); 70 static inline void uhci_port_write_status(uhci_port_t *port, port_status_t val) 71 { 72 assert(port); 73 pio_write_16(port->address, val); 75 74 } 76 75 /*----------------------------------------------------------------------------*/ … … 101 100 port->rh = rh; 102 101 103 int r c = usb_hc_connection_initialize_from_device(104 &port->hc_connection, rh);105 if (r c!= EOK) {102 int ret = 103 usb_hc_connection_initialize_from_device(&port->hc_connection, rh); 104 if (ret != EOK) { 106 105 usb_log_error("Failed to initialize connection to HC."); 107 return r c;106 return ret; 108 107 } 109 108 … … 238 237 /* Enable the port. */ 239 238 uhci_port_set_enabled(port, true); 240 241 239 return EOK; 242 240 } … … 271 269 usb_log_info("New device at port %u, address %d (handle %llu).\n", 272 270 port->number, dev_addr, port->attached_device); 273 274 271 return EOK; 275 272 } -
uspace/drv/uhci-rhd/port.h
r27205841 r540abef 54 54 #define STATUS_SUSPEND (1 << 12) 55 55 56 /** UHCI port structure */ 56 57 typedef struct uhci_port 57 58 { -
uspace/drv/uhci-rhd/root_hub.c
r27205841 r540abef 33 33 */ 34 34 #include <errno.h> 35 #include <str_error.h> 35 36 #include <ddi.h> 36 37 #include <usb/debug.h> … … 43 44 * @param[in] addr Address of I/O registers. 44 45 * @param[in] size Size of available I/O space. 45 * @param[in] rh Pointer to ddfinstance of the root hub driver.46 * @param[in] rh Pointer to DDF instance of the root hub driver. 46 47 * @return Error code. 47 48 */ … … 58 59 if (ret < 0) { 59 60 usb_log_error( 60 "Failed(%d) to gain access to port registers at %p \n",61 ret, regs );61 "Failed(%d) to gain access to port registers at %p: %s.\n", 62 ret, regs, str_error(ret)); 62 63 return ret; 63 64 } … … 66 67 unsigned i = 0; 67 68 for (; i < UHCI_ROOT_HUB_PORT_COUNT; ++i) { 68 /* NOTE: mind pointer arithmetics here */69 69 ret = uhci_port_init( 70 &instance->ports[i], regs + i, i, ROOT_HUB_WAIT_USEC, rh);70 &instance->ports[i], ®s[i], i, ROOT_HUB_WAIT_USEC, rh); 71 71 if (ret != EOK) { 72 72 unsigned j = 0; -
uspace/drv/uhci-rhd/root_hub.h
r27205841 r540abef 42 42 #define ROOT_HUB_WAIT_USEC 250000 /* 250 miliseconds */ 43 43 44 /** UHCI root hub drvier structure */ 44 45 typedef struct root_hub { 46 /** Ports provided by the hub */ 45 47 uhci_port_t ports[UHCI_ROOT_HUB_PORT_COUNT]; 46 devman_handle_t hc_handle;47 48 } uhci_root_hub_t; 48 49 49 50 int uhci_root_hub_init( 50 uhci_root_hub_t *instance, void *addr, size_t size, ddf_dev_t *rh);51 uhci_root_hub_t *instance, void *addr, size_t size, ddf_dev_t *rh); 51 52 52 53 void uhci_root_hub_fini(uhci_root_hub_t *instance);
Note:
See TracChangeset
for help on using the changeset viewer.