Changeset 361e61b in mainline for uspace/drv/ohci/root_hub.c
- Timestamp:
- 2011-03-21T14:23:15Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 55e388a1
- Parents:
- c32688d (diff), 48fe0c9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/root_hub.c
rc32688d r361e61b 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup usb28 /** @addtogroup drvusbohci 29 29 * @{ 30 30 */ 31 31 /** @file 32 * @brief UHCI driver32 * @brief OHCI driver 33 33 */ 34 34 #include <assert.h> 35 #include <stdio.h> 35 #include <errno.h> 36 #include <str_error.h> 36 37 37 38 #include <usb/debug.h> 38 39 39 #include " port_status.h"40 #include "root_hub.h" 40 41 41 struct flag_name 42 { 43 uint16_t flag; 44 const char *name; 45 }; 46 47 static const struct flag_name flags[] = 48 { 49 { STATUS_SUSPEND, "suspended" }, 50 { STATUS_IN_RESET, "in reset" }, 51 { STATUS_LOW_SPEED, "low speed device" }, 52 { STATUS_ALWAYS_ONE, "always 1 bit" }, 53 { STATUS_RESUME, "resume" }, 54 { STATUS_LINE_D_MINUS, "line D- value" }, 55 { STATUS_LINE_D_PLUS, "line D+ value" }, 56 { STATUS_ENABLED_CHANGED, "enabled changed" }, 57 { STATUS_ENABLED, "enabled" }, 58 { STATUS_CONNECTED_CHANGED, "connected changed" }, 59 { STATUS_CONNECTED, "connected" } 60 }; 61 62 /** Prints portr status in a human readable way. 63 * 64 * @param[in] value Port value to print. 42 /** Root hub initialization 65 43 * @return Error code. 66 44 */ 67 void print_port_status(port_status_t value)45 int rh_init(rh_t *instance, ddf_dev_t *dev, ohci_regs_t *regs) 68 46 { 69 unsigned i = 0; 70 for (;i < sizeof(flags)/sizeof(struct flag_name); ++i) { 71 usb_log_debug2("\t%s status: %s.\n", flags[i].name, 72 ((value & flags[i].flag) != 0) ? "YES" : "NO"); 47 assert(instance); 48 instance->address = -1; 49 instance->registers = regs; 50 instance->device = dev; 51 52 usb_log_info("OHCI root hub with %d ports.\n", regs->rh_desc_a & 0xff); 53 54 /* TODO: implement */ 55 return EOK; 56 } 57 /*----------------------------------------------------------------------------*/ 58 int rh_request(rh_t *instance, batch_t *request) 59 { 60 assert(instance); 61 assert(request); 62 /* TODO: implement */ 63 if (request->setup_buffer) { 64 usb_log_info("Root hub got SETUP packet: %s.\n", 65 usb_debug_str_buffer((const uint8_t *)request->setup_buffer, 8, 8)); 73 66 } 67 usb_log_error("Root hub request processing not implemented.\n"); 68 batch_finish(request, ENOTSUP); 69 return EOK; 70 } 71 /*----------------------------------------------------------------------------*/ 72 void rh_interrupt(rh_t *instance) 73 { 74 usb_log_error("Root hub interrupt not implemented.\n"); 75 /* TODO: implement */ 74 76 } 75 77 /**
Note:
See TracChangeset
for help on using the changeset viewer.