Changeset e50cd7f in mainline for uspace/drv/usbhub/usbhub_private.h
- Timestamp:
- 2011-04-17T19:17:55Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63517c2, cfbbe1d3
- Parents:
- ef354b6 (diff), 8595577b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/usbhub_private.h
ref354b6 re50cd7f 54 54 // 55 55 //************ 56 #define usb_new(type) (type*)malloc(sizeof(type))57 56 58 57 59 /**60 * Create hub structure instance61 *62 * Set the address and port count information most importantly.63 *64 * @param device65 * @param hc host controller phone66 * @return67 */68 58 usb_hub_info_t * usb_create_hub_info(ddf_dev_t * device); 69 59 … … 110 100 111 101 /** 112 * create uint8_t array with serialized descriptor102 * Clear feature on hub port. 113 103 * 114 * @param descriptor 115 * @return newly created serializd descriptor pointer 104 * @param hc Host controller telephone 105 * @param address Hub address 106 * @param port_index Port 107 * @param feature Feature selector 108 * @return Operation result 116 109 */ 117 void * usb_serialize_hub_descriptor(usb_hub_descriptor_t * descriptor); 110 static inline int usb_hub_set_port_feature(usb_pipe_t *pipe, 111 int port_index, 112 usb_hub_class_feature_t feature) { 113 114 usb_device_request_setup_packet_t clear_request = { 115 .request_type = USB_HUB_REQ_TYPE_SET_PORT_FEATURE, 116 .request = USB_DEVREQ_SET_FEATURE, 117 .length = 0, 118 .index = port_index 119 }; 120 clear_request.value = feature; 121 return usb_pipe_control_write(pipe, &clear_request, 122 sizeof(clear_request), NULL, 0); 123 } 124 118 125 119 126 /** 120 * create deserialized desriptor structure out of serialized descriptor127 * Clear feature on hub port. 121 128 * 122 * The serialized descriptor must be proper usb hub descriptor, 123 * otherwise an eerror might occur. 129 * @param pipe pipe to hub control endpoint 130 * @param feature Feature selector 131 * @return Operation result 132 */ 133 static inline int usb_hub_clear_feature(usb_pipe_t *pipe, 134 usb_hub_class_feature_t feature) { 135 136 usb_device_request_setup_packet_t clear_request = { 137 .request_type = USB_HUB_REQ_TYPE_CLEAR_HUB_FEATURE, 138 .request = USB_DEVREQ_CLEAR_FEATURE, 139 .length = 0, 140 .index = 0 141 }; 142 clear_request.value = feature; 143 return usb_pipe_control_write(pipe, &clear_request, 144 sizeof(clear_request), NULL, 0); 145 } 146 147 /** 148 * Clear feature on hub port. 124 149 * 125 * @param sdescriptor serialized descriptor 126 * @return newly created deserialized descriptor pointer 150 * @param pipe pipe to hub control endpoint 151 * @param feature Feature selector 152 * @return Operation result 127 153 */ 128 usb_hub_descriptor_t * usb_deserialize_hub_desriptor(void * sdescriptor); 154 static inline int usb_hub_set_feature(usb_pipe_t *pipe, 155 usb_hub_class_feature_t feature) { 156 157 usb_device_request_setup_packet_t clear_request = { 158 .request_type = USB_HUB_REQ_TYPE_CLEAR_HUB_FEATURE, 159 .request = USB_DEVREQ_SET_FEATURE, 160 .length = 0, 161 .index = 0 162 }; 163 clear_request.value = feature; 164 return usb_pipe_control_write(pipe, &clear_request, 165 sizeof(clear_request), NULL, 0); 166 } 167 168 169 void * usb_create_serialized_hub_descriptor(usb_hub_descriptor_t * descriptor); 170 171 void usb_serialize_hub_descriptor(usb_hub_descriptor_t * descriptor, 172 void * serialized_descriptor); 173 174 usb_hub_descriptor_t * usb_create_deserialized_hub_desriptor( 175 void * serialized_descriptor); 176 177 void usb_deserialize_hub_desriptor(void * serialized_descriptor, 178 usb_hub_descriptor_t * descriptor); 129 179 130 180
Note:
See TracChangeset
for help on using the changeset viewer.