Changes in uspace/drv/uhci-rhd/main.c [dced52a:275bf456] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-rhd/main.c
rdced52a r275bf456 35 35 #include <devman.h> 36 36 #include <device/hw_res.h> 37 #include <errno.h> 37 38 #include <usb_iface.h> 38 39 #include <usb/ddfiface.h> 40 #include <usb/debug.h> 39 41 40 #include <errno.h>41 42 42 #include <usb/debug.h>43 43 44 44 #include "root_hub.h" … … 47 47 static int hc_get_my_registers(ddf_dev_t *dev, 48 48 uintptr_t *io_reg_address, size_t *io_reg_size); 49 49 /*----------------------------------------------------------------------------*/ 50 50 static int usb_iface_get_hc_handle(ddf_fun_t *fun, devman_handle_t *handle) 51 51 { … … 58 58 return EOK; 59 59 } 60 60 /*----------------------------------------------------------------------------*/ 61 61 static usb_iface_t uhci_rh_usb_iface = { 62 62 .get_hc_handle = usb_iface_get_hc_handle, 63 63 .get_address = usb_iface_get_address_hub_impl 64 64 }; 65 65 /*----------------------------------------------------------------------------*/ 66 66 static ddf_dev_ops_t uhci_rh_ops = { 67 67 .interfaces[USB_DEV_IFACE] = &uhci_rh_usb_iface, 68 68 }; 69 69 /*----------------------------------------------------------------------------*/ 70 /** Initializes a new ddf driver instance of UHCI root hub. 71 * 72 * @param[in] device DDF instance of the device to initialize. 73 * @return Error code. 74 */ 70 75 static int uhci_rh_add_device(ddf_dev_t *device) 71 76 { … … 104 109 return EOK; 105 110 } 106 111 /*----------------------------------------------------------------------------*/ 107 112 static driver_ops_t uhci_rh_driver_ops = { 108 113 .add_device = uhci_rh_add_device, 109 114 }; 110 115 /*----------------------------------------------------------------------------*/ 111 116 static driver_t uhci_rh_driver = { 112 117 .name = NAME, … … 114 119 }; 115 120 /*----------------------------------------------------------------------------*/ 121 /** Initializes global driver structures (NONE). 122 * 123 * @param[in] argc Nmber of arguments in argv vector (ignored). 124 * @param[in] argv Cmdline argument vector (ignored). 125 * @return Error code. 126 * 127 * Driver debug level is set here. 128 */ 116 129 int main(int argc, char *argv[]) 117 130 { … … 120 133 } 121 134 /*----------------------------------------------------------------------------*/ 122 int hc_get_my_registers(ddf_dev_t *dev, 123 uintptr_t *io_reg_address, size_t *io_reg_size) 135 /** Get address of I/O registers. 136 * 137 * @param[in] dev Device asking for the addresses. 138 * @param[out] io_reg_address Base address of the memory range. 139 * @param[out] io_reg_size Size of the memory range. 140 * @return Error code. 141 */ 142 int hc_get_my_registers( 143 ddf_dev_t *dev, uintptr_t *io_reg_address, size_t *io_reg_size) 124 144 { 125 145 assert(dev != NULL); … … 146 166 for (i = 0; i < hw_resources.count; i++) { 147 167 hw_resource_t *res = &hw_resources.resources[i]; 148 switch (res->type) {149 case IO_RANGE:150 io_address = (uintptr_t)151 152 153 154 break; 155 156 168 switch (res->type) 169 { 170 case IO_RANGE: 171 io_address = (uintptr_t) res->res.io_range.address; 172 io_size = res->res.io_range.size; 173 io_found = true; 174 175 default: 176 break; 157 177 } 158 178 } … … 170 190 } 171 191 rc = EOK; 192 172 193 leave: 173 194 async_hangup(parent_phone); 174 175 195 return rc; 176 196 }
Note:
See TracChangeset
for help on using the changeset viewer.