Changeset bba0f1fc in mainline
- Timestamp:
- 2011-09-23T11:50:29Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d6e2938
- Parents:
- b3433a2
- Location:
- uspace/drv/bus/usb/usbhub
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhub/usbhub.c
rb3433a2 rbba0f1fc 59 59 /** Standard get hub global status request */ 60 60 static const usb_device_request_setup_packet_t get_hub_status_request = { 61 .index = 0,62 61 .request_type = USB_HUB_REQ_TYPE_GET_HUB_STATUS, 63 62 .request = USB_HUB_REQUEST_GET_STATUS, 63 .index = 0, 64 64 .value = 0, 65 65 .length = sizeof(usb_hub_status_t), … … 441 441 * Just ACK the change. 442 442 */ 443 const int opResult = usb_hub_clear_feature( 444 control_pipe, USB_HUB_FEATURE_C_HUB_LOCAL_POWER); 443 const int opResult = usb_request_clear_feature( 444 control_pipe, USB_REQUEST_TYPE_CLASS, 445 USB_REQUEST_RECIPIENT_DEVICE, 446 USB_HUB_FEATURE_C_HUB_LOCAL_POWER, 0); 445 447 if (opResult != EOK) { 446 usb_log_error( "Cannot clear hub power change flag: "447 " %s\n",448 usb_log_error( 449 "Failed to clear hub power change flag: %s.\n", 448 450 str_error(opResult)); 449 451 } -
uspace/drv/bus/usb/usbhub/utils.h
rb3433a2 rbba0f1fc 50 50 #include "usbhub.h" 51 51 52 //************53 //54 // convenience define for malloc55 //56 //************57 58 /**59 * Set the device request to be a get hub descriptor request.60 * @warning the size is allways set to USB_HUB_MAX_DESCRIPTOR_SIZE61 * @param request62 * @param addr63 */64 static inline void usb_hub_set_descriptor_request(65 usb_device_request_setup_packet_t *request )66 {67 request->index = 0;68 request->request_type = USB_HUB_REQ_TYPE_GET_DESCRIPTOR;69 request->request = USB_HUB_REQUEST_GET_DESCRIPTOR;70 request->value_high = USB_DESCTYPE_HUB;71 request->value_low = 0;72 request->length = USB_HUB_MAX_DESCRIPTOR_SIZE;73 }74 75 52 /** 76 53 * Clear feature on hub port. … … 121 98 } 122 99 123 /**124 * Clear feature on hub port.125 *126 * @param pipe pipe to hub control endpoint127 * @param feature Feature selector128 * @return Operation result129 */130 static inline int usb_hub_clear_feature(usb_pipe_t *pipe,131 usb_hub_class_feature_t feature) {132 133 usb_device_request_setup_packet_t clear_request = {134 .request_type = USB_HUB_REQ_TYPE_CLEAR_HUB_FEATURE,135 .request = USB_DEVREQ_CLEAR_FEATURE,136 .length = 0,137 .index = 0138 };139 clear_request.value = feature;140 return usb_pipe_control_write(pipe, &clear_request,141 sizeof (clear_request), NULL, 0);142 }143 144 /**145 * Clear feature on hub port.146 *147 * @param pipe pipe to hub control endpoint148 * @param feature Feature selector149 * @return Operation result150 */151 static inline int usb_hub_set_feature(usb_pipe_t *pipe,152 usb_hub_class_feature_t feature)153 {154 155 usb_device_request_setup_packet_t clear_request = {156 .request_type = USB_HUB_REQ_TYPE_CLEAR_HUB_FEATURE,157 .request = USB_DEVREQ_SET_FEATURE,158 .length = 0,159 .index = 0160 };161 clear_request.value = feature;162 return usb_pipe_control_write(pipe, &clear_request,163 sizeof (clear_request), NULL, 0);164 }165 166 100 void * usb_create_serialized_hub_descriptor(usb_hub_descriptor_t *descriptor); 167 101
Note:
See TracChangeset
for help on using the changeset viewer.