Changes in uspace/drv/uhci-rhd/main.c [275bf456:dced52a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-rhd/main.c
r275bf456 rdced52a 35 35 #include <devman.h> 36 36 #include <device/hw_res.h> 37 #include <errno.h>38 37 #include <usb_iface.h> 39 38 #include <usb/ddfiface.h> 39 40 #include <errno.h> 41 40 42 #include <usb/debug.h> 41 42 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 /*----------------------------------------------------------------------------*/ 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 */ 69 75 70 static int uhci_rh_add_device(ddf_dev_t *device) 76 71 { … … 109 104 return EOK; 110 105 } 111 /*----------------------------------------------------------------------------*/ 106 112 107 static driver_ops_t uhci_rh_driver_ops = { 113 108 .add_device = uhci_rh_add_device, 114 109 }; 115 /*----------------------------------------------------------------------------*/ 110 116 111 static driver_t uhci_rh_driver = { 117 112 .name = NAME, … … 119 114 }; 120 115 /*----------------------------------------------------------------------------*/ 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 */129 116 int main(int argc, char *argv[]) 130 117 { … … 133 120 } 134 121 /*----------------------------------------------------------------------------*/ 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) 122 int hc_get_my_registers(ddf_dev_t *dev, 123 uintptr_t *io_reg_address, size_t *io_reg_size) 144 124 { 145 125 assert(dev != NULL); … … 166 146 for (i = 0; i < hw_resources.count; i++) { 167 147 hw_resource_t *res = &hw_resources.resources[i]; 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;148 switch (res->type) { 149 case IO_RANGE: 150 io_address = (uintptr_t) 151 res->res.io_range.address; 152 io_size = res->res.io_range.size; 153 io_found = true; 154 break; 155 default: 156 break; 177 157 } 178 158 } … … 190 170 } 191 171 rc = EOK; 192 193 172 leave: 194 173 async_hangup(parent_phone); 174 195 175 return rc; 196 176 }
Note:
See TracChangeset
for help on using the changeset viewer.