Changeset a763eb4 in mainline
- Timestamp:
- 2011-03-19T18:14:01Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 103cf26, 93855d4
- Parents:
- 81608b5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ehci-hcd/hc_iface.c
r81608b5 ra763eb4 48 48 methodname, __FILE__, __LINE__) 49 49 50 50 /** Reserve default address. 51 * 52 * This function may block the caller. 53 * 54 * @param[in] fun Device function the action was invoked on. 55 * @param[in] speed Speed of the device for which the default address is 56 * reserved. 57 * @return Error code. 58 */ 51 59 static int reserve_default_address(ddf_fun_t *fun, usb_speed_t speed) 52 60 { … … 56 64 } 57 65 66 /** Release default address. 67 * 68 * @param[in] fun Device function the action was invoked on. 69 * @return Error code. 70 */ 58 71 static int release_default_address(ddf_fun_t *fun) 59 72 { … … 63 76 } 64 77 65 static int request_address(ddf_fun_t *fun, usb_speed_t speed, usb_address_t *address) 78 /** Found free USB address. 79 * 80 * @param[in] fun Device function the action was invoked on. 81 * @param[in] speed Speed of the device that will get this address. 82 * @param[out] address Non-null pointer where to store the free address. 83 * @return Error code. 84 */ 85 static int request_address(ddf_fun_t *fun, usb_speed_t speed, 86 usb_address_t *address) 66 87 { 67 88 UNSUPPORTED("request_address"); … … 70 91 } 71 92 72 static int bind_address(ddf_fun_t *fun, usb_address_t address, devman_handle_t handle) 93 /** Bind USB address with device devman handle. 94 * 95 * @param[in] fun Device function the action was invoked on. 96 * @param[in] address USB address of the device. 97 * @param[in] handle Devman handle of the device. 98 * @return Error code. 99 */ 100 static int bind_address(ddf_fun_t *fun, 101 usb_address_t address, devman_handle_t handle) 73 102 { 74 103 UNSUPPORTED("bind_address"); … … 77 106 } 78 107 108 /** Release previously requested address. 109 * 110 * @param[in] fun Device function the action was invoked on. 111 * @param[in] address USB address to be released. 112 * @return Error code. 113 */ 79 114 static int release_address(ddf_fun_t *fun, usb_address_t address) 80 115 { … … 84 119 } 85 120 86 static int register_endpoint(ddf_fun_t *fun, usb_address_t address, usb_endpoint_t endpoint, 121 /** Register endpoint for bandwidth reservation. 122 * 123 * @param[in] fun Device function the action was invoked on. 124 * @param[in] address USB address of the device. 125 * @param[in] endpoint Endpoint number. 126 * @param[in] transfer_type USB transfer type. 127 * @param[in] direction Endpoint data direction. 128 * @param[in] max_packet_size Max packet size of the endpoint. 129 * @param[in] interval Polling interval. 130 * @return Error code. 131 */ 132 static int register_endpoint(ddf_fun_t *fun, 133 usb_address_t address, usb_endpoint_t endpoint, 87 134 usb_transfer_type_t transfer_type, usb_direction_t direction, 88 135 size_t max_packet_size, unsigned int interval) … … 93 140 } 94 141 95 static int unregister_endpoint(ddf_fun_t *fun, usb_address_t address, usb_endpoint_t endpoint, 96 usb_direction_t direction) 142 /** Unregister endpoint (free some bandwidth reservation). 143 * 144 * @param[in] fun Device function the action was invoked on. 145 * @param[in] address USB address of the device. 146 * @param[in] endpoint Endpoint number. 147 * @param[in] direction Endpoint data direction. 148 * @return Error code. 149 */ 150 static int unregister_endpoint(ddf_fun_t *fun, usb_address_t address, 151 usb_endpoint_t endpoint, usb_direction_t direction) 97 152 { 98 153 UNSUPPORTED("unregister_endpoint"); … … 101 156 } 102 157 158 /** Schedule interrupt out transfer. 159 * 160 * The callback is supposed to be called once the transfer (on the wire) is 161 * complete regardless of the outcome. 162 * However, the callback could be called only when this function returns 163 * with success status (i.e. returns EOK). 164 * 165 * @param[in] fun Device function the action was invoked on. 166 * @param[in] target Target pipe (address and endpoint number) specification. 167 * @param[in] max_packet_size Max packet size for the transfer. 168 * @param[in] data Data to be sent (in USB endianess, allocated and deallocated 169 * by the caller). 170 * @param[in] size Size of the @p data buffer in bytes. 171 * @param[in] callback Callback to be issued once the transfer is complete. 172 * @param[in] arg Pass-through argument to the callback. 173 * @return Error code. 174 */ 103 175 static int interrupt_out(ddf_fun_t *fun, usb_target_t target, 104 176 size_t max_packet_size, void *data, size_t size, … … 110 182 } 111 183 184 /** Schedule interrupt in transfer. 185 * 186 * The callback is supposed to be called once the transfer (on the wire) is 187 * complete regardless of the outcome. 188 * However, the callback could be called only when this function returns 189 * with success status (i.e. returns EOK). 190 * 191 * @param[in] fun Device function the action was invoked on. 192 * @param[in] target Target pipe (address and endpoint number) specification. 193 * @param[in] max_packet_size Max packet size for the transfer. 194 * @param[in] data Buffer where to store the data (in USB endianess, 195 * allocated and deallocated by the caller). 196 * @param[in] size Size of the @p data buffer in bytes. 197 * @param[in] callback Callback to be issued once the transfer is complete. 198 * @param[in] arg Pass-through argument to the callback. 199 * @return Error code. 200 */ 112 201 static int interrupt_in(ddf_fun_t *fun, usb_target_t target, 113 202 size_t max_packet_size, void *data, size_t size, … … 119 208 } 120 209 210 /** Schedule bulk out transfer. 211 * 212 * The callback is supposed to be called once the transfer (on the wire) is 213 * complete regardless of the outcome. 214 * However, the callback could be called only when this function returns 215 * with success status (i.e. returns EOK). 216 * 217 * @param[in] fun Device function the action was invoked on. 218 * @param[in] target Target pipe (address and endpoint number) specification. 219 * @param[in] max_packet_size Max packet size for the transfer. 220 * @param[in] data Data to be sent (in USB endianess, allocated and deallocated 221 * by the caller). 222 * @param[in] size Size of the @p data buffer in bytes. 223 * @param[in] callback Callback to be issued once the transfer is complete. 224 * @param[in] arg Pass-through argument to the callback. 225 * @return Error code. 226 */ 121 227 static int bulk_out(ddf_fun_t *fun, usb_target_t target, 122 228 size_t max_packet_size, void *data, size_t size, … … 128 234 } 129 235 236 /** Schedule bulk in transfer. 237 * 238 * The callback is supposed to be called once the transfer (on the wire) is 239 * complete regardless of the outcome. 240 * However, the callback could be called only when this function returns 241 * with success status (i.e. returns EOK). 242 * 243 * @param[in] fun Device function the action was invoked on. 244 * @param[in] target Target pipe (address and endpoint number) specification. 245 * @param[in] max_packet_size Max packet size for the transfer. 246 * @param[in] data Buffer where to store the data (in USB endianess, 247 * allocated and deallocated by the caller). 248 * @param[in] size Size of the @p data buffer in bytes. 249 * @param[in] callback Callback to be issued once the transfer is complete. 250 * @param[in] arg Pass-through argument to the callback. 251 * @return Error code. 252 */ 130 253 static int bulk_in(ddf_fun_t *fun, usb_target_t target, 131 254 size_t max_packet_size, void *data, size_t size, … … 137 260 } 138 261 262 /** Schedule control write transfer. 263 * 264 * The callback is supposed to be called once the transfer (on the wire) is 265 * complete regardless of the outcome. 266 * However, the callback could be called only when this function returns 267 * with success status (i.e. returns EOK). 268 * 269 * @param[in] fun Device function the action was invoked on. 270 * @param[in] target Target pipe (address and endpoint number) specification. 271 * @param[in] max_packet_size Max packet size for the transfer. 272 * @param[in] setup_packet Setup packet buffer (in USB endianess, allocated 273 * and deallocated by the caller). 274 * @param[in] setup_packet_size Size of @p setup_packet buffer in bytes. 275 * @param[in] data_buffer Data buffer (in USB endianess, allocated and 276 * deallocated by the caller). 277 * @param[in] data_buffer_size Size of @p data_buffer buffer in bytes. 278 * @param[in] callback Callback to be issued once the transfer is complete. 279 * @param[in] arg Pass-through argument to the callback. 280 * @return Error code. 281 */ 139 282 static int control_write(ddf_fun_t *fun, usb_target_t target, 140 283 size_t max_packet_size, 141 void *setup_packet, size_t setup_packet_size, void *data_buffer, size_t data_buffer_size, 284 void *setup_packet, size_t setup_packet_size, 285 void *data_buffer, size_t data_buffer_size, 142 286 usbhc_iface_transfer_out_callback_t callback, void *arg) 143 287 { … … 147 291 } 148 292 293 /** Schedule control read transfer. 294 * 295 * The callback is supposed to be called once the transfer (on the wire) is 296 * complete regardless of the outcome. 297 * However, the callback could be called only when this function returns 298 * with success status (i.e. returns EOK). 299 * 300 * @param[in] fun Device function the action was invoked on. 301 * @param[in] target Target pipe (address and endpoint number) specification. 302 * @param[in] max_packet_size Max packet size for the transfer. 303 * @param[in] setup_packet Setup packet buffer (in USB endianess, allocated 304 * and deallocated by the caller). 305 * @param[in] setup_packet_size Size of @p setup_packet buffer in bytes. 306 * @param[in] data_buffer Buffer where to store the data (in USB endianess, 307 * allocated and deallocated by the caller). 308 * @param[in] data_buffer_size Size of @p data_buffer buffer in bytes. 309 * @param[in] callback Callback to be issued once the transfer is complete. 310 * @param[in] arg Pass-through argument to the callback. 311 * @return Error code. 312 */ 149 313 static int control_read(ddf_fun_t *fun, usb_target_t target, 150 314 size_t max_packet_size, 151 void *setup_packet, size_t setup_packet_size, void *data_buffer, size_t data_buffer_size, 315 void *setup_packet, size_t setup_packet_size, 316 void *data_buffer, size_t data_buffer_size, 152 317 usbhc_iface_transfer_in_callback_t callback, void *arg) 153 318 { … … 157 322 } 158 323 159 324 /** Host controller interface implementation for EHCI. */ 160 325 usbhc_iface_t ehci_hc_iface = { 161 326 .reserve_default_address = reserve_default_address,
Note:
See TracChangeset
for help on using the changeset viewer.