Changes in uspace/drv/ohci/root_hub.c [63d4d4fd:8bb61e6] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/root_hub.c
r63d4d4fd r8bb61e6 61 61 .vendor_id = 0x16db, 62 62 .product_id = 0x0001, 63 /// \TODO these values migt be different 63 64 .str_serial_number = 0, 64 65 .usb_spec_version = 0x110, … … 118 119 static const uint32_t hub_clear_feature_by_writing_one_mask = 119 120 RHS_CLEAR_PORT_POWER; 121 // 1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER; 120 122 121 123 /** … … 125 127 RHS_LPSC_FLAG | 126 128 RHS_OCIC_FLAG; 129 //(1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT) | 130 //(1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER); 127 131 128 132 /** … … 131 135 static const uint32_t hub_set_feature_direct_mask = 132 136 RHS_SET_PORT_POWER; 137 //(1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT); 133 138 134 139 /** … … 155 160 RHPS_PRSC_FLAG; 156 161 162 /* 163 164 (1 << USB_HUB_FEATURE_PORT_CONNECTION) | 165 (1 << USB_HUB_FEATURE_PORT_SUSPEND) | 166 (1 << USB_HUB_FEATURE_PORT_OVER_CURRENT) | 167 (1 << USB_HUB_FEATURE_PORT_POWER) | 168 (1 << USB_HUB_FEATURE_C_PORT_CONNECTION) | 169 (1 << USB_HUB_FEATURE_C_PORT_ENABLE) | 170 (1 << USB_HUB_FEATURE_C_PORT_SUSPEND) | 171 (1 << USB_HUB_FEATURE_C_PORT_OVER_CURRENT) | 172 (1 << USB_HUB_FEATURE_C_PORT_RESET); 173 */ 157 174 //note that USB_HUB_FEATURE_PORT_POWER bit is translated into 158 175 //USB_HUB_FEATURE_PORT_LOW_SPEED for port set feature request … … 162 179 */ 163 180 static const uint32_t port_status_change_mask = RHPS_CHANGE_WC_MASK; 181 /* (1 << USB_HUB_FEATURE_C_PORT_CONNECTION) | 182 (1 << USB_HUB_FEATURE_C_PORT_ENABLE) | 183 (1 << USB_HUB_FEATURE_C_PORT_OVER_CURRENT) | 184 (1 << USB_HUB_FEATURE_C_PORT_RESET) | 185 (1 << USB_HUB_FEATURE_C_PORT_SUSPEND); 186 */ 164 187 165 188 static int create_serialized_hub_descriptor(rh_t *instance); … … 410 433 if (port < 1 || port > instance->port_count) 411 434 return EINVAL; 435 uint32_t * uint32_buffer = (uint32_t*) request->data_buffer; 412 436 request->transfered_size = 4; 413 uint32_t data = instance->registers->rh_port_status[port - 1]; 414 memcpy(request->data_buffer,&data,4); 437 uint32_buffer[0] = instance->registers->rh_port_status[port - 1]; 415 438 #if 0 416 439 int i; … … 439 462 static int process_get_hub_status_request(rh_t *instance, 440 463 usb_transfer_batch_t * request) { 441 //uint32_t * uint32_buffer = (uint32_t*) request->data_buffer;464 uint32_t * uint32_buffer = (uint32_t*) request->data_buffer; 442 465 request->transfered_size = 4; 443 466 //bits, 0,1,16,17 444 467 uint32_t mask = 1 | (1 << 1) | (1 << 16) | (1 << 17); 445 uint32_t data = mask & instance->registers->rh_status; 446 //uint32_buffer[0] = mask & instance->registers->rh_status; 447 memcpy(request->data_buffer,&data,4); 468 uint32_buffer[0] = mask & instance->registers->rh_status; 448 469 449 470 return EOK; … … 499 520 | (1 << (USB_HUB_FEATURE_C_HUB_OVER_CURRENT + 16)); 500 521 bzero(bitmap, instance->interrupt_mask_size); 501 if ( (instance->registers->rh_status & mask) !=0) {522 if (instance->registers->rh_status & mask) { 502 523 bitmap[0] = 1; 503 524 } … … 505 526 mask = port_status_change_mask; 506 527 for (port = 1; port <= instance->port_count; ++port) { 507 if (mask & instance->registers->rh_port_status[port - 1] != 0) {528 if (mask & instance->registers->rh_port_status[port - 1]) { 508 529 509 530 bitmap[(port) / 8] += 1 << (port % 8);
Note:
See TracChangeset
for help on using the changeset viewer.