Changeset 95285378 in mainline
- Timestamp:
- 2011-05-07T13:45:39Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1866945
- Parents:
- 192ba25
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/root_hub.c
r192ba25 r95285378 45 45 46 46 /** 47 * 47 * standart device descriptor for ohci root hub 48 48 */ 49 49 static const usb_standard_device_descriptor_t ohci_rh_device_descriptor = { … … 69 69 */ 70 70 static const usb_standard_configuration_descriptor_t ohci_rh_conf_descriptor = { 71 /// \TODO some values are default or guessed72 71 .attributes = 1 << 7, 73 72 .configuration_number = 1, … … 87 86 .endpoint_count = 1, 88 87 .interface_class = USB_CLASS_HUB, 89 /// \TODO is this correct?90 88 .interface_number = 1, 91 89 .interface_protocol = 0, … … 107 105 }; 108 106 107 /** 108 * bitmask of hub features that are valid to be cleared 109 */ 109 110 static const uint32_t hub_clear_feature_valid_mask = 110 111 (1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER) | 111 112 (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT); 112 113 114 /** 115 * bitmask of hub features that are cleared by writing 1 (and not 0) 116 */ 113 117 static const uint32_t hub_clear_feature_by_writing_one_mask = 114 118 1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER; 115 119 120 /** 121 * bitmask of hub features that are valid to be set 122 */ 116 123 static const uint32_t hub_set_feature_valid_mask = 117 124 (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT) | 118 125 (1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER); 119 126 120 127 /** 128 * bitmask of hub features that are set by writing 1 and cleared by writing 0 129 */ 121 130 static const uint32_t hub_set_feature_direct_mask = 122 131 (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT); 123 132 133 /** 134 * bitmask of port features that are valid to be set 135 */ 124 136 static const uint32_t port_set_feature_valid_mask = 125 137 (1 << USB_HUB_FEATURE_PORT_ENABLE) | … … 128 140 (1 << USB_HUB_FEATURE_PORT_POWER); 129 141 142 /** 143 * bitmask of port features that can be cleared 144 */ 130 145 static const uint32_t port_clear_feature_valid_mask = 131 146 (1 << USB_HUB_FEATURE_PORT_CONNECTION) | … … 141 156 //USB_HUB_FEATURE_PORT_LOW_SPEED 142 157 158 /** 159 * bitmask with port status changes 160 */ 143 161 static const uint32_t port_status_change_mask = 144 162 (1 << USB_HUB_FEATURE_C_PORT_CONNECTION) | … … 152 170 153 171 static int rh_init_descriptors(rh_t *instance); 154 155 static void rh_check_port_connectivity(rh_t * instance);156 172 157 173 static int process_get_port_status_request(rh_t *instance, uint16_t port, … … 220 236 if (!instance->interrupt_buffer) 221 237 return ENOMEM; 222 rh_check_port_connectivity(instance); 223 224 225 usb_log_info("OHCI root hub with %d ports.\n", instance->port_count); 238 239 usb_log_info("OHCI root hub with %d ports initialized.\n", 240 instance->port_count); 226 241 227 242 return EOK; … … 381 396 return EOK; 382 397 } 383 /*----------------------------------------------------------------------------*/384 385 /**386 * check whether there are connected devices on ports and if yes, indicate387 * connection change388 *389 * @param instance390 */391 static void rh_check_port_connectivity(rh_t * instance) {392 size_t port;393 usb_log_debug("rh_check_port_connectivity\n");394 for (port = 1; port < instance->port_count; ++port) {395 bool connected =396 ((instance->registers->rh_port_status[port - 1]) &397 (1 << USB_HUB_FEATURE_PORT_CONNECTION)) != 0;398 if (connected) {399 usb_log_debug("port %d has connected device\n", port);400 instance->registers->rh_port_status[port - 1] =401 instance->registers->rh_port_status[port - 1]402 | (1 << USB_HUB_FEATURE_C_PORT_CONNECTION);403 usb_log_debug("change indicated to status "404 "register\n");405 }406 }407 }408 409 410 398 /*----------------------------------------------------------------------------*/ 411 399
Note:
See TracChangeset
for help on using the changeset viewer.