Changeset 56fd7cf in mainline for uspace/drv/bus/usb/ohci
- Timestamp:
- 2012-08-17T11:37:03Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1d5a540
- Parents:
- be2a38ad
- Location:
- uspace/drv/bus/usb/ohci
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/hc.c
rbe2a38ad r56fd7cf 187 187 188 188 ret = usb_device_manager_bind_address(&instance->generic.dev_manager, 189 instance->rh.address, hub_fun->handle);189 instance->rh.address, ddf_fun_get_handle(hub_fun)); 190 190 if (ret != EOK) 191 191 usb_log_warning("Failed to bind root hub address: %s.\n", -
uspace/drv/bus/usb/ohci/main.c
rbe2a38ad r56fd7cf 59 59 return ret; 60 60 } 61 usb_log_info("Controlling new OHCI device '%s'.\n", d evice->name);61 usb_log_info("Controlling new OHCI device '%s'.\n", ddf_dev_get_name(device)); 62 62 63 63 return EOK; -
uspace/drv/bus/usb/ohci/ohci.c
rbe2a38ad r56fd7cf 33 33 * @brief OHCI driver 34 34 */ 35 36 /* XXX Fix this */ 37 #define _DDF_DATA_IMPLANT 38 35 39 #include <errno.h> 36 40 #include <str_error.h> … … 52 56 } ohci_t; 53 57 54 static inline ohci_t * dev_to_ohci(ddf_dev_t *dev) 55 { 56 assert(dev); 57 return dev->driver_data; 58 static inline ohci_t *dev_to_ohci(ddf_dev_t *dev) 59 { 60 return ddf_dev_data_get(dev); 58 61 } 59 62 /** IRQ handling callback, identifies device … … 87 90 88 91 if (address != NULL) { 89 *address = dev_to_ohci( fun->dev)->hc.rh.address;92 *address = dev_to_ohci(ddf_fun_get_dev(fun))->hc.rh.address; 90 93 } 91 94 … … 103 106 { 104 107 assert(fun); 105 ddf_fun_t *hc_fun = dev_to_ohci( fun->dev)->hc_fun;108 ddf_fun_t *hc_fun = dev_to_ohci(ddf_fun_get_dev(fun))->hc_fun; 106 109 assert(hc_fun); 107 110 108 111 if (handle != NULL) 109 *handle = hc_fun->handle;112 *handle = ddf_fun_get_handle(hc_fun); 110 113 return EOK; 111 114 } … … 152 155 if (ret != EOK) { \ 153 156 if (instance->hc_fun) { \ 154 instance->hc_fun->driver_data = NULL; \155 157 ddf_fun_destroy(instance->hc_fun); \ 156 158 } \ 157 159 if (instance->rh_fun) { \ 158 instance->rh_fun->driver_data = NULL; \159 160 ddf_fun_destroy(instance->rh_fun); \ 160 161 } \ … … 167 168 CHECK_RET_DEST_FREE_RETURN(ret, 168 169 "Failed to create OHCI HC function: %s.\n", str_error(ret)); 169 instance->hc_fun->ops = &hc_ops;170 instance->hc_fun->driver_data = &instance->hc;170 ddf_fun_set_ops(instance->hc_fun, &hc_ops); 171 ddf_fun_data_implant(instance->hc_fun, &instance->hc); 171 172 172 173 instance->rh_fun = ddf_fun_create(device, fun_inner, "ohci_rh"); … … 174 175 CHECK_RET_DEST_FREE_RETURN(ret, 175 176 "Failed to create OHCI RH function: %s.\n", str_error(ret)); 176 instance->rh_fun->ops = &rh_ops;177 ddf_fun_set_ops(instance->rh_fun, &rh_ops); 177 178 178 179 uintptr_t reg_base = 0; … … 183 184 CHECK_RET_DEST_FREE_RETURN(ret, 184 185 "Failed to get register memory addresses for %" PRIun ": %s.\n", 185 d evice->handle, str_error(ret));186 ddf_dev_get_handle(device), str_error(ret)); 186 187 usb_log_debug("Memory mapped regs at %p (size %zu), IRQ %d.\n", 187 188 (void *) reg_base, reg_size, irq); -
uspace/drv/bus/usb/ohci/res.c
rbe2a38ad r56fd7cf 53 53 * @return Error code. 54 54 */ 55 int get_my_registers( constddf_dev_t *dev,55 int get_my_registers(ddf_dev_t *dev, 56 56 uintptr_t *mem_reg_address, size_t *mem_reg_size, int *irq_no) 57 57 { … … 59 59 60 60 async_sess_t *parent_sess = 61 devman_parent_device_connect(EXCHANGE_SERIALIZE, dev->handle,62 IPC_FLAG_BLOCKING);61 devman_parent_device_connect(EXCHANGE_SERIALIZE, 62 ddf_dev_get_handle(dev), IPC_FLAG_BLOCKING); 63 63 if (!parent_sess) 64 64 return ENOMEM; … … 94 94 * @return Error code. 95 95 */ 96 int enable_interrupts( constddf_dev_t *device)96 int enable_interrupts(ddf_dev_t *device) 97 97 { 98 98 async_sess_t *parent_sess = 99 devman_parent_device_connect(EXCHANGE_SERIALIZE, device->handle,100 IPC_FLAG_BLOCKING);99 devman_parent_device_connect(EXCHANGE_SERIALIZE, 100 ddf_dev_get_handle(device), IPC_FLAG_BLOCKING); 101 101 if (!parent_sess) 102 102 return ENOMEM; -
uspace/drv/bus/usb/ohci/res.h
rbe2a38ad r56fd7cf 37 37 #include <ddf/driver.h> 38 38 39 int get_my_registers( constddf_dev_t *, uintptr_t *, size_t *, int *);40 int enable_interrupts( constddf_dev_t *);39 int get_my_registers(ddf_dev_t *, uintptr_t *, size_t *, int *); 40 int enable_interrupts(ddf_dev_t *); 41 41 42 42 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
