Changeset 5b89d43b in mainline
- Timestamp:
- 2013-12-14T11:54:29Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f5ceb18
- Parents:
- 3558ba93
- Location:
- uspace/drv/bus/usb
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/res.c
r3558ba93 r5b89d43b 62 62 hw_res_list_parsed_t hw_res; 63 63 hw_res_list_parsed_init(&hw_res); 64 const int ret = 64 const int ret = hw_res_get_list_parsed(parent_sess, &hw_res, 0); 65 65 async_hangup(parent_sess); 66 66 if (ret != EOK) { -
uspace/drv/bus/usb/uhci/root_hub.c
r3558ba93 r5b89d43b 36 36 #include <str_error.h> 37 37 #include <stdio.h> 38 #include <device/hw_res_parsed.h> 38 39 39 40 #include <usb/debug.h> … … 48 49 * @return Error code. 49 50 */ 50 int rh_init(rh_t *instance, ddf_fun_t *fun, uintptr_t reg_addr, size_t reg_size) 51 int 52 rh_init(rh_t *instance, ddf_fun_t *fun, addr_range_t *regs, uintptr_t reg_addr, 53 size_t reg_size) 51 54 { 52 55 assert(instance); 53 56 assert(fun); 57 58 /* Crop the PIO window to the absolute address range of UHCI I/O. */ 59 instance->pio_window.mem.base = 0; 60 instance->pio_window.mem.size = 0; 61 instance->pio_window.io.base = RNGABS(*regs); 62 instance->pio_window.io.size = RNGSZ(*regs); 54 63 55 64 /* Initialize resource structure */ … … 60 69 instance->io_regs.res.io_range.address = reg_addr; 61 70 instance->io_regs.res.io_range.size = reg_size; 71 instance->io_regs.res.io_range.relative = true; 62 72 instance->io_regs.res.io_range.endianness = LITTLE_ENDIAN; 63 73 -
uspace/drv/bus/usb/uhci/root_hub.h
r3558ba93 r5b89d43b 38 38 #include <ddf/driver.h> 39 39 #include <ops/hw_res.h> 40 #include <ops/pio_window.h> 40 41 41 42 /** DDF support structure for uhci_rhd driver, provides I/O resources */ … … 45 46 /** The only resource in the RH resource list */ 46 47 hw_resource_t io_regs; 48 /** PIO window in which the RH will operate. */ 49 pio_window_t pio_window; 47 50 } rh_t; 48 51 49 int rh_init( 50 rh_t *instance, ddf_fun_t *fun, uintptr_t reg_addr, size_t reg_size); 52 extern int rh_init(rh_t *, ddf_fun_t *, addr_range_t *, uintptr_t, size_t); 51 53 52 54 #endif -
uspace/drv/bus/usb/uhci/uhci.c
r3558ba93 r5b89d43b 132 132 }; 133 133 134 static pio_window_t *get_pio_window(ddf_fun_t *fun) 135 { 136 rh_t *rh = ddf_fun_data_get(fun); 137 138 if (rh == NULL) 139 return NULL; 140 return &rh->pio_window; 141 } 142 143 static pio_window_ops_t pio_window_iface = { 144 .get_pio_window = get_pio_window 145 }; 146 134 147 /** RH function support for uhci_rhd */ 135 148 static ddf_dev_ops_t rh_ops = { 136 149 .interfaces[USB_DEV_IFACE] = &usb_iface, 137 .interfaces[HW_RES_DEV_IFACE] = &hw_res_iface 150 .interfaces[HW_RES_DEV_IFACE] = &hw_res_iface, 151 .interfaces[PIO_WINDOW_DEV_IFACE] = &pio_window_iface 138 152 }; 139 153 … … 246 260 } 247 261 248 rc = rh_init(&instance->rh, instance->rh_fun, 249 (uintptr_t)instance->hc.registers + 0x10, 4); 262 rc = rh_init(&instance->rh, instance->rh_fun, ®s, 0x10, 4); 250 263 if (rc != EOK) { 251 264 usb_log_error("Failed to setup UHCI root hub: %s.\n", -
uspace/drv/bus/usb/uhcirh/main.c
r3558ba93 r5b89d43b 138 138 hw_res_list_parsed_t hw_res; 139 139 hw_res_list_parsed_init(&hw_res); 140 const int ret = 140 const int ret = hw_res_get_list_parsed(parent_sess, &hw_res, 0); 141 141 async_hangup(parent_sess); 142 142 if (ret != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.