Changeset 03e3029 in mainline
- Timestamp:
- 2011-07-11T14:27:36Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 40c6cdf
- Parents:
- 2a0b1dd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/root_hub.c
r2a0b1dd r03e3029 168 168 static void create_interrupt_mask_in_instance(rh_t *instance); 169 169 170 static int process_get_port_status_request(170 static int get_port_status_request( 171 171 rh_t *instance, uint16_t port, usb_transfer_batch_t *request); 172 172 173 static int process_get_hub_status_request(173 static int get_hub_status_request( 174 174 rh_t *instance, usb_transfer_batch_t *request); 175 175 176 static int process_get_status_request(176 static int get_status_request( 177 177 rh_t *instance, usb_transfer_batch_t *request); 178 178 179 179 180 static int process_get_descriptor_request(180 static int get_descriptor_request( 181 181 rh_t *instance, usb_transfer_batch_t *request); 182 182 183 static int process_get_configuration_request(183 static int get_configuration_request( 184 184 rh_t *instance, usb_transfer_batch_t *request); 185 185 186 static int process_hub_feature_set_request(rh_t *instance, uint16_t feature);187 188 static int process_hub_feature_clear_request(186 static int hub_feature_set_request(rh_t *instance, uint16_t feature); 187 188 static int hub_feature_clear_request( 189 189 rh_t *instance, uint16_t feature); 190 190 191 static int p rocess_port_feature_set_request(191 static int port_feature_set_request( 192 192 rh_t *instance, uint16_t feature, uint16_t port); 193 193 194 static int p rocess_port_feature_clear_request(194 static int port_feature_clear_request( 195 195 rh_t *instance, uint16_t feature, uint16_t port); 196 196 197 static int process_request_with_input(197 static int request_with_input( 198 198 rh_t *instance, usb_transfer_batch_t *request); 199 199 200 static int process_request_with_output(200 static int request_with_output( 201 201 rh_t *instance, usb_transfer_batch_t *request); 202 202 203 static int process_request_without_data(203 static int request_without_data( 204 204 rh_t *instance, usb_transfer_batch_t *request); 205 205 206 static int process_ctrl_request(rh_t *instance, usb_transfer_batch_t *request);207 208 static int process_interrupt_mask_in_instance(206 static int ctrl_request(rh_t *instance, usb_transfer_batch_t *request); 207 208 static int interrupt_mask_in_instance( 209 209 rh_t *instance, usb_transfer_batch_t *request); 210 210 … … 218 218 * @return Error code 219 219 */ 220 static inline int process_address_set_request(rh_t *instance, uint16_t address)220 static inline int address_set_request(rh_t *instance, uint16_t address) 221 221 { return ENOTSUP; } 222 222 … … 270 270 case USB_TRANSFER_CONTROL: 271 271 usb_log_debug("Root hub got CONTROL packet\n"); 272 opResult = process_ctrl_request(instance, request);272 opResult = ctrl_request(instance, request); 273 273 usb_transfer_batch_finish_error(request, opResult); 274 274 break; … … 283 283 } else { 284 284 usb_log_debug("Processing changes..\n"); 285 process_interrupt_mask_in_instance(instance, request);285 interrupt_mask_in_instance(instance, request); 286 286 } 287 287 break; … … 306 306 usb_log_debug("Finalizing interrupt transfer\n"); 307 307 create_interrupt_mask_in_instance(instance); 308 process_interrupt_mask_in_instance(instance,308 interrupt_mask_in_instance(instance, 309 309 instance->unfinished_interrupt_transfer); 310 310 } … … 404 404 * @return Error code 405 405 */ 406 int process_get_port_status_request(406 int get_port_status_request( 407 407 rh_t *instance, uint16_t port, usb_transfer_batch_t * request) 408 408 { … … 430 430 * @return Error code 431 431 */ 432 int process_get_hub_status_request(432 int get_hub_status_request( 433 433 rh_t *instance, usb_transfer_batch_t *request) 434 434 { … … 452 452 * @return error code 453 453 */ 454 int process_get_status_request(rh_t *instance, usb_transfer_batch_t *request)454 int get_status_request(rh_t *instance, usb_transfer_batch_t *request) 455 455 { 456 456 assert(instance); … … 469 469 470 470 if (request_type == USB_HUB_REQ_TYPE_GET_HUB_STATUS) 471 return process_get_hub_status_request(instance, request);471 return get_hub_status_request(instance, request); 472 472 if (request_type == USB_HUB_REQ_TYPE_GET_PORT_STATUS) 473 return process_get_port_status_request(instance,473 return get_port_status_request(instance, 474 474 request_packet->index, request); 475 475 … … 491 491 assert(instance); 492 492 493 uint8_t * bitmap = (uint8_t*) (instance->interrupt_buffer);493 uint8_t * bitmap = instance->interrupt_buffer; 494 494 uint32_t mask = (1 << (USB_HUB_FEATURE_C_HUB_LOCAL_POWER + 16)) 495 495 | (1 << (USB_HUB_FEATURE_C_HUB_OVER_CURRENT + 16)); … … 517 517 * @return Error code 518 518 */ 519 int process_get_descriptor_request(519 int get_descriptor_request( 520 520 rh_t *instance, usb_transfer_batch_t *request) 521 521 { … … 591 591 * @return Error code 592 592 */ 593 int process_get_configuration_request(593 int get_configuration_request( 594 594 rh_t *instance, usb_transfer_batch_t *request) 595 595 { … … 611 611 * @return error code 612 612 */ 613 static int process_hub_feature_set_request(rh_t *instance,613 static int hub_feature_set_request(rh_t *instance, 614 614 uint16_t feature) { 615 615 if (!((1 << feature) & hub_set_feature_valid_mask)) … … 631 631 * @return error code 632 632 */ 633 int process_hub_feature_clear_request(rh_t *instance, uint16_t feature)633 int hub_feature_clear_request(rh_t *instance, uint16_t feature) 634 634 { 635 635 assert(instance); … … 662 662 * @return error code 663 663 */ 664 int p rocess_port_feature_set_request(664 int port_feature_set_request( 665 665 rh_t *instance, uint16_t feature, uint16_t port) 666 666 { … … 687 687 * @return error code 688 688 */ 689 int p rocess_port_feature_clear_request(689 int port_feature_clear_request( 690 690 rh_t *instance, uint16_t feature, uint16_t port) 691 691 { … … 720 720 * @return error code 721 721 */ 722 int process_request_with_output(rh_t *instance, usb_transfer_batch_t *request)722 int request_with_output(rh_t *instance, usb_transfer_batch_t *request) 723 723 { 724 724 assert(instance); … … 731 731 case USB_DEVREQ_GET_STATUS: 732 732 usb_log_debug("USB_DEVREQ_GET_STATUS\n"); 733 return process_get_status_request(instance, request);733 return get_status_request(instance, request); 734 734 case USB_DEVREQ_GET_DESCRIPTOR: 735 735 usb_log_debug("USB_DEVREQ_GET_DESCRIPTOR\n"); 736 return process_get_descriptor_request(instance, request);736 return get_descriptor_request(instance, request); 737 737 case USB_DEVREQ_GET_CONFIGURATION: 738 738 usb_log_debug("USB_DEVREQ_GET_CONFIGURATION\n"); 739 return process_get_configuration_request(instance, request);739 return get_configuration_request(instance, request); 740 740 } 741 741 return ENOTSUP; … … 751 751 * @return error code 752 752 */ 753 int process_request_with_input(rh_t *instance, usb_transfer_batch_t *request)753 int request_with_input(rh_t *instance, usb_transfer_batch_t *request) 754 754 { 755 755 assert(instance); … … 777 777 * @return error code 778 778 */ 779 int process_request_without_data(rh_t *instance, usb_transfer_batch_t *request)779 int request_without_data(rh_t *instance, usb_transfer_batch_t *request) 780 780 { 781 781 assert(instance); … … 791 791 if (request_type == USB_HUB_REQ_TYPE_SET_HUB_FEATURE) { 792 792 usb_log_debug("USB_HUB_REQ_TYPE_SET_HUB_FEATURE\n"); 793 return process_hub_feature_clear_request(instance,793 return hub_feature_clear_request(instance, 794 794 setup_request->value); 795 795 } 796 796 if (request_type == USB_HUB_REQ_TYPE_SET_PORT_FEATURE) { 797 797 usb_log_debug("USB_HUB_REQ_TYPE_SET_PORT_FEATURE\n"); 798 return p rocess_port_feature_clear_request(instance,798 return port_feature_clear_request(instance, 799 799 setup_request->value, setup_request->index); 800 800 } … … 806 806 if (request_type == USB_HUB_REQ_TYPE_SET_HUB_FEATURE) { 807 807 usb_log_debug("USB_HUB_REQ_TYPE_SET_HUB_FEATURE\n"); 808 return process_hub_feature_set_request(instance,808 return hub_feature_set_request(instance, 809 809 setup_request->value); 810 810 } 811 811 if (request_type == USB_HUB_REQ_TYPE_SET_PORT_FEATURE) { 812 812 usb_log_debug("USB_HUB_REQ_TYPE_SET_PORT_FEATURE\n"); 813 return p rocess_port_feature_set_request(instance,813 return port_feature_set_request(instance, 814 814 setup_request->value, setup_request->index); 815 815 } … … 820 820 case USB_DEVREQ_SET_ADDRESS: 821 821 usb_log_debug("USB_DEVREQ_SET_ADDRESS\n"); 822 return process_address_set_request(instance,822 return address_set_request(instance, 823 823 setup_request->value); 824 824 … … 848 848 * @return error code 849 849 */ 850 int process_ctrl_request(rh_t *instance, usb_transfer_batch_t *request)850 int ctrl_request(rh_t *instance, usb_transfer_batch_t *request) 851 851 { 852 852 assert(instance); … … 871 871 case USB_DEVREQ_GET_CONFIGURATION: 872 872 usb_log_debug2("Processing request with output\n"); 873 return process_request_with_output(instance, request);873 return request_with_output(instance, request); 874 874 case USB_DEVREQ_CLEAR_FEATURE: 875 875 case USB_DEVREQ_SET_FEATURE: … … 877 877 usb_log_debug2("Processing request without " 878 878 "additional data\n"); 879 return process_request_without_data(instance, request);879 return request_without_data(instance, request); 880 880 case USB_DEVREQ_SET_DESCRIPTOR: 881 881 case USB_DEVREQ_SET_CONFIGURATION: 882 882 usb_log_debug2("Processing request with input\n"); 883 return process_request_with_input(instance, request);883 return request_with_input(instance, request); 884 884 default: 885 885 usb_log_error("Received unsupported request: %d.\n", … … 902 902 * @return 903 903 */ 904 int process_interrupt_mask_in_instance(904 int interrupt_mask_in_instance( 905 905 rh_t *instance, usb_transfer_batch_t *request) 906 906 {
Note:
See TracChangeset
for help on using the changeset viewer.