Changeset 7ce0fe3 in mainline for uspace/drv/uhci-rhd/main.c
- Timestamp:
- 2011-02-01T22:02:23Z (12 years ago)
- Branches:
- lfn, master, serial
- Children:
- afcd86e
- Parents:
- 993a1e1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-rhd/main.c
r993a1e1 r7ce0fe3 28 28 #include <driver.h> 29 29 #include <errno.h> 30 #include <str_error.h> 30 31 31 #include <usb_iface.h> 32 #include <usb/debug.h> 32 33 33 #include "debug.h"34 //#include "iface.h"35 34 #include "root_hub.h" 35 36 #define NAME "uhci-rhd" 36 37 37 38 static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle) 38 39 { 39 /* This shall be called only for the UHCI itself. */40 40 assert(dev); 41 41 assert(dev->driver_data); 42 assert(handle); 43 42 44 *handle = ((uhci_root_hub_t*)dev->driver_data)->hc_handle; 45 usb_log_debug("Answering HC handle: %d.\n", *handle); 43 46 44 47 return EOK; … … 58 61 return ENOTSUP; 59 62 60 u hci_print_info("%s called device %d\n", __FUNCTION__, device->handle);63 usb_log_debug2("%s called device %d\n", __FUNCTION__, device->handle); 61 64 device->ops = &uhci_rh_ops; 62 65 63 66 uhci_root_hub_t *rh = malloc(sizeof(uhci_root_hub_t)); 64 67 if (!rh) { 68 usb_log_error("Failed to allocate memory for driver instance.\n"); 65 69 return ENOMEM; 66 70 } 71 72 /* TODO: get register values from hc */ 67 73 int ret = uhci_root_hub_init(rh, (void*)0xc030, 4, device); 68 74 if (ret != EOK) { 75 usb_log_error("Failed(%d) to initialize driver instance.\n", ret); 69 76 free(rh); 70 77 return ret; 71 78 } 79 72 80 device->driver_data = rh; 81 usb_log_info("Sucessfully initialized driver isntance for device:%d.\n", 82 device->handle); 73 83 return EOK; 74 84 } … … 85 95 int main(int argc, char *argv[]) 86 96 { 87 /* 88 * Do some global initializations. 89 */ 90 usb_dprintf_enable(NAME, DEBUG_LEVEL_INFO); 91 97 usb_log_enable(USB_LOG_LEVEL_INFO, NAME); 92 98 return driver_main(&uhci_rh_driver); 93 99 }
Note: See TracChangeset
for help on using the changeset viewer.