Changeset a6d1bc1 in mainline
- Timestamp:
- 2011-03-21T11:52:29Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8627377
- Parents:
- b0beee82
- Location:
- uspace/drv/ohci
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/hc.c
rb0beee82 ra6d1bc1 39 39 #include <usb/debug.h> 40 40 #include <usb/usb.h> 41 #include <usb/hub.h> 42 #include <usb/usbdevice.h> 41 43 #include <usb/ddfiface.h> 42 #include <usb_iface.h>43 44 44 45 #include "hc.h" 45 46 46 int hc_init(hc_t *instance, ddf_fun_t *fun, 47 /*----------------------------------------------------------------------------*/ 48 int hc_init(hc_t *instance, ddf_fun_t *fun, ddf_dev_t *dev, 47 49 uintptr_t regs, size_t reg_size, bool interrupts) 48 50 { … … 56 58 57 59 58 rh_init(&instance->rh, instance->registers);60 rh_init(&instance->rh, dev, instance->registers); 59 61 /* TODO: implement */ 60 62 /* TODO: register root hub */ 61 63 return EOK; 64 } 65 /*----------------------------------------------------------------------------*/ 66 int hc_register_hub(hc_t *instance, ddf_dev_t *dev) 67 { 68 assert(instance); 69 return rh_register(&instance->rh, dev); 62 70 } 63 71 /*----------------------------------------------------------------------------*/ … … 71 79 } 72 80 /* TODO: implement */ 73 return E OK;81 return ENOTSUP; 74 82 } 75 83 /*----------------------------------------------------------------------------*/ -
uspace/drv/ohci/hc.h
rb0beee82 ra6d1bc1 51 51 ohci_regs_t *registers; 52 52 usb_address_t rh_address; 53 ohci_rh_t rh;53 rh_t rh; 54 54 ddf_fun_t *ddf_instance; 55 55 device_keeper_t manager; 56 56 } hc_t; 57 57 58 int hc_init(hc_t *instance, ddf_fun_t *fun, 58 int hc_init(hc_t *instance, ddf_fun_t *fun, ddf_dev_t *dev, 59 59 uintptr_t regs, size_t reg_size, bool interrupts); 60 61 int hc_register_hub(hc_t *instance, ddf_dev_t *dev); 60 62 61 63 int hc_schedule(hc_t *instance, batch_t *batch); -
uspace/drv/ohci/main.c
rb0beee82 ra6d1bc1 129 129 } 130 130 131 ret = hc_init(hcd, hc_fun, mem_reg_base, mem_reg_size, interrupts);131 ret = hc_init(hcd, hc_fun, device, mem_reg_base, mem_reg_size, interrupts); 132 132 if (ret != EOK) { 133 133 usb_log_error("Failed to initialize OHCI driver.\n"); … … 148 148 hc_fun->driver_data = hcd; 149 149 150 /* TODO: register interrupt handler */150 hc_register_hub(hcd, device); 151 151 152 152 usb_log_info("Controlling new OHCI device `%s' (handle %llu).\n", -
uspace/drv/ohci/root_hub.c
rb0beee82 ra6d1bc1 43 43 * @return Error code. 44 44 */ 45 int rh_init( ohci_rh_t *instance, ohci_regs_t *regs)45 int rh_init(rh_t *instance, ddf_dev_t *dev, ohci_regs_t *regs) 46 46 { 47 47 assert(instance); 48 48 instance->address = 0; 49 49 instance->registers = regs; 50 instance->device = dev; 50 51 51 52 usb_log_info("OHCI root hub with %d ports.\n", regs->rh_desc_a & 0xff); … … 55 56 } 56 57 /*----------------------------------------------------------------------------*/ 57 void rh_request( ohci_rh_t *instance, batch_t *request)58 void rh_request(rh_t *instance, batch_t *request) 58 59 { 60 usb_log_error("Request processing not implemented.\n"); 59 61 /* TODO: implement */ 60 62 } 61 63 /*----------------------------------------------------------------------------*/ 62 void rh_interrupt( ohci_rh_t *instance)64 void rh_interrupt(rh_t *instance) 63 65 { 64 usb_log_ info("Interrupt!!.\n");66 usb_log_error("Root hub interrupt not implemented.\n"); 65 67 /* TODO: implement */ 68 } 69 /*----------------------------------------------------------------------------*/ 70 int rh_register(rh_t *instance, ddf_dev_t *dev) 71 { 72 return EOK; 66 73 } 67 74 /** -
uspace/drv/ohci/root_hub.h
rb0beee82 ra6d1bc1 41 41 #include "batch.h" 42 42 43 typedef struct ohci_rh {43 typedef struct rh { 44 44 ohci_regs_t *registers; 45 45 usb_address_t address; 46 } ohci_rh_t; 46 ddf_dev_t *device; 47 } rh_t; 47 48 48 int rh_init( ohci_rh_t *instance, ohci_regs_t *regs);49 int rh_init(rh_t *instance, ddf_dev_t *dev, ohci_regs_t *regs); 49 50 50 void rh_request( ohci_rh_t *instance, batch_t *request);51 void rh_request(rh_t *instance, batch_t *request); 51 52 52 void rh_interrupt(ohci_rh_t *instance); 53 void rh_interrupt(rh_t *instance); 54 55 int rh_register(rh_t *instance, ddf_dev_t *dev); 53 56 #endif 54 57 /**
Note:
See TracChangeset
for help on using the changeset viewer.