Changeset 1256a0a in mainline for uspace/drv/uhci-rhd
- Timestamp:
- 2011-02-01T00:08:46Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 993a1e1
- Parents:
- 37ac7bb
- Location:
- uspace/drv/uhci-rhd
- Files:
-
- 5 added
- 6 moved
-
Makefile (added)
-
debug.h (moved) (moved from uspace/drv/uhci-hcd/root_hub/debug.h ) (1 diff)
-
main.c (added)
-
name.h (added)
-
port.c (moved) (moved from uspace/drv/uhci-hcd/root_hub/port.c ) (3 diffs)
-
port.h (moved) (moved from uspace/drv/uhci-hcd/root_hub/port.h ) (1 diff)
-
port_status.c (moved) (moved from uspace/drv/uhci-hcd/root_hub/port_status.c )
-
port_status.h (moved) (moved from uspace/drv/uhci-hcd/root_hub/port_status.h )
-
root_hub.c (added)
-
root_hub.h (moved) (moved from uspace/drv/uhci-hcd/root_hub/root_hub.h ) (1 diff)
-
uhci-rhd.ma (added)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-rhd/debug.h
r37ac7bb r1256a0a 38 38 #include <usb/debug.h> 39 39 40 #define NAME "uhci_root_hubd" 40 #include "name.h" 41 41 42 42 43 enum debug_levels { -
uspace/drv/uhci-rhd/port.c
r37ac7bb r1256a0a 11 11 static int uhci_port_remove_device(uhci_port_t *port); 12 12 static int uhci_port_set_enabled(uhci_port_t *port, bool enabled); 13 static int uhci_port_check(void *port); 13 14 15 int uhci_port_init( 16 uhci_port_t *port, port_status_t *address, unsigned number, 17 unsigned usec, device_t *rh) 18 { 19 assert(port); 20 port->address = address; 21 port->number = number; 22 port->wait_period_usec = usec; 23 port->attached_device = 0; 24 port->rh = rh; 25 port->hc_phone = rh->parent_phone; 26 27 port->checker = fibril_create(uhci_port_check, port); 28 if (port->checker == 0) { 29 uhci_print_error(": failed to launch root hub fibril."); 30 return ENOMEM; 31 } 32 fibril_add_ready(port->checker); 33 uhci_print_verbose( 34 "Added fibril for port %d: %p.\n", number, port->checker); 35 return EOK; 36 } 37 /*----------------------------------------------------------------------------*/ 38 void uhci_port_fini(uhci_port_t *port) 39 { 40 // fibril_teardown(port->checker); 41 return; 42 } 14 43 /*----------------------------------------------------------------------------*/ 15 44 int uhci_port_check(void *port) … … 18 47 uhci_port_t *port_instance = port; 19 48 assert(port_instance); 20 port_instance->hc_phone = devman_device_connect(port_instance->hc->handle, 0);21 if (port_instance->hc_phone < 0) {22 uhci_print_fatal("Failed(%d) to connect to the hc(handle=%x.\n",23 port_instance->hc_phone, (unsigned)port_instance->hc->handle);24 return port_instance->hc_phone;25 }26 49 27 50 while (1) { … … 119 142 assert(port->attached_device == 0); 120 143 121 ret = usb_drv_register_child_in_devman(port->hc_phone, port-> hc, usb_address,122 &port->attached_device);144 ret = usb_drv_register_child_in_devman(port->hc_phone, port->rh, 145 usb_address, &port->attached_device); 123 146 124 147 if (ret != EOK) { /* something went wrong */ -
uspace/drv/uhci-rhd/port.h
r37ac7bb r1256a0a 44 44 { 45 45 port_status_t *address; 46 device_t *hc;47 46 unsigned number; 48 47 unsigned wait_period_usec; 49 48 int hc_phone; 49 device_t *rh; 50 50 devman_handle_t attached_device; 51 fid_t checker; 51 52 } uhci_port_t; 52 53 53 static inline void uhci_port_init( 54 uhci_port_t *port, port_status_t *address, device_t *hc, unsigned number, 55 unsigned usec) 56 { 57 assert(port); 58 port->address = address; 59 port->hc = hc; 60 port->number = number; 61 port->hc_phone = -1; 62 port->wait_period_usec = usec; 63 port->attached_device = 0; 64 } 54 int uhci_port_init( 55 uhci_port_t *port, port_status_t *address, unsigned number, 56 unsigned usec, device_t *rh); 65 57 66 int uhci_port_check(void*port);58 void uhci_port_fini(uhci_port_t *port); 67 59 #endif 68 60 /** -
uspace/drv/uhci-rhd/root_hub.h
r37ac7bb r1256a0a 46 46 typedef struct root_hub { 47 47 uhci_port_t ports[UHCI_ROOT_HUB_PORT_COUNT]; 48 fid_t checker[UHCI_ROOT_HUB_PORT_COUNT];48 devman_handle_t hc_handle; 49 49 } uhci_root_hub_t; 50 50 51 51 int uhci_root_hub_init( 52 uhci_root_hub_t *instance, device_t *device, void *addr);52 uhci_root_hub_t *instance, void *addr, size_t size, device_t *rh); 53 53 54 54 int uhci_root_hub_fini(uhci_root_hub_t* instance);
Note:
See TracChangeset
for help on using the changeset viewer.
