Changeset 863d45e in mainline
- Timestamp:
- 2011-01-10T11:55:13Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1ffa73b, a97ea0f
- Parents:
- 263a9f1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/usbdrvreq.c
r263a9f1 r863d45e 36 36 #include <errno.h> 37 37 38 /** Prepare USB target for control endpoint. 39 * 40 * @param name Variable name with the USB target. 41 * @param target_address Target USB address. 42 */ 38 43 #define PREPARE_TARGET(name, target_address) \ 39 44 usb_target_t name = { \ … … 42 47 } 43 48 44 #define PREPARE_SETUP_PACKET(name, p_direction, p_type, p_recipient, p_request, p_value, p_index, p_length) \ 49 /** Prepare setup packet. 50 * 51 * @param name Variable name with the setup packet. 52 * @param p_direction Data transfer direction. 53 * @param p_type Request type (standard/class/vendor) 54 * @param p_recipient Recipient of the request. 55 * @param p_request Request. 56 * @param p_value wValue field of setup packet. 57 * @param p_index wIndex field of setup packet. 58 * @param p_length Length of extra data. 59 */ 60 #define PREPARE_SETUP_PACKET(name, p_direction, p_type, p_recipient, \ 61 p_request, p_value, p_index, p_length) \ 45 62 usb_device_request_setup_packet_t setup_packet = { \ 46 63 .request_type = \ … … 54 71 } 55 72 56 #define PREPARE_SETUP_PACKET_LOHI(name, p_direction, p_type, p_recipient, p_request, p_value_low, p_value_high, p_index, p_length) \ 73 /** Prepare setup packet. 74 * 75 * @param name Variable name with the setup packet. 76 * @param p_direction Data transfer direction. 77 * @param p_type Request type (standard/class/vendor) 78 * @param p_recipient Recipient of the request. 79 * @param p_request Request. 80 * @param p_value_low wValue field of setup packet (low byte). 81 * @param p_value_high wValue field of setup packet (high byte). 82 * @param p_index wIndex field of setup packet. 83 * @param p_length Length of extra data. 84 */ 85 #define PREPARE_SETUP_PACKET_LOHI(name, p_direction, p_type, p_recipient, \ 86 p_request, p_value_low, p_value_high, p_index, p_length) \ 57 87 PREPARE_SETUP_PACKET(name, p_direction, p_type, p_recipient, \ 58 88 p_request, (p_value_low) | ((p_value_high) << 8), \ … … 61 91 /** Retrieve status of a USB device. 62 92 * 63 * @param hc_phone64 * @param address65 * @param recipient66 * @param recipient_index67 * @param status68 * @return 93 * @param[in] hc_phone Open phone to HC driver. 94 * @param[in] address Device address. 95 * @param[in] recipient Recipient of the request. 96 * @param[in] recipient_index Index of @p recipient. 97 * @param[out] status Status (see figure 9-4 in USB 1.1 specification). 98 * @return Error code. 69 99 */ 70 100 int usb_drv_req_get_status(int hc_phone, usb_address_t address, … … 100 130 /** Clear or disable USB device feature. 101 131 * 102 * @param hc_phone103 * @param address104 * @param recipient105 * @param selector106 * @param index107 * @return 132 * @param[in] hc_phone Open phone to HC driver. 133 * @param[in] address Device address. 134 * @param[in] recipient Recipient of the request. 135 * @param[in] selector Feature selector. 136 * @param[in] index Index of @p recipient. 137 * @return Error code. 108 138 */ 109 139 int usb_drv_req_clear_feature(int hc_phone, usb_address_t address, … … 125 155 /** Set or enable USB device feature. 126 156 * 127 * @param hc_phone128 * @param address129 * @param recipient130 * @param selector131 * @param index132 * @return 157 * @param[in] hc_phone Open phone to HC driver. 158 * @param[in] address Device address. 159 * @param[in] recipient Recipient of the request. 160 * @param[in] selector Feature selector. 161 * @param[in] index Index of @p recipient. 162 * @return Error code. 133 163 */ 134 164 int usb_drv_req_set_feature(int hc_phone, usb_address_t address, … … 156 186 * @see usb_drv_bind_address 157 187 * 158 * @param phone Open phone to HC driver.159 * @param old_address Current address.160 * @param address Address to be set.188 * @param[in] phone Open phone to HC driver. 189 * @param[in] old_address Current address. 190 * @param[in] address Address to be set. 161 191 * @return Error code. 162 192 */ … … 179 209 * 180 210 * @param[in] hc_phone Open phone to HC driver. 181 * @param[in] address Device USBaddress.211 * @param[in] address Device address. 182 212 * @param[in] request_type Request type (standard/class/vendor). 183 213 * @param[in] descriptor_type Descriptor type (device/configuration/HID/...). … … 221 251 * 222 252 * @param[in] phone Open phone to HC driver. 223 * @param[in] address Device USBaddress.253 * @param[in] address Device address. 224 254 * @param[out] descriptor Storage for the device descriptor. 225 255 * @return Error code. … … 266 296 * 267 297 * @param[in] phone Open phone to HC driver. 268 * @param[in] address Device USBaddress.298 * @param[in] address Device address. 269 299 * @param[in] index Configuration descriptor index. 270 300 * @param[out] descriptor Storage for the configuration descriptor. … … 308 338 * 309 339 * @warning The @p buffer might be touched (i.e. its contents changed) 310 * even when error occur res.340 * even when error occurs. 311 341 * 312 342 * @param[in] phone Open phone to HC driver. 313 * @param[in] address Device USBaddress.343 * @param[in] address Device address. 314 344 * @param[in] index Configuration descriptor index. 315 345 * @param[out] buffer Buffer for the whole configuration descriptor. … … 335 365 /** Update existing descriptor of a USB device. 336 366 * 337 * @param hc_phone338 * @param address339 * @param descriptor_type340 * @param descriptor_index341 * @param language342 * @param descriptor343 * @param descriptor_size344 * @return 367 * @param[in] hc_phone Open phone to HC driver. 368 * @param[in] address Device address. 369 * @param[in] descriptor_type Descriptor type (device/configuration/...). 370 * @param[in] descriptor_index Descriptor index. 371 * @param[in] language Language index. 372 * @param[in] descriptor Actual descriptor data. 373 * @param[in] descriptor_size Descriptor size. 374 * @return Error code. 345 375 */ 346 376 int usb_drv_req_set_descriptor(int hc_phone, usb_address_t address, … … 349 379 void *descriptor, size_t descriptor_size) 350 380 { 381 // FIXME: check that descriptor is not too big 382 351 383 PREPARE_TARGET(target, address); 352 384 … … 365 397 /** Determine current configuration value of USB device. 366 398 * 367 * @param hc_phone368 * @param address369 * @param configuration_value370 * @return 399 * @param[in] hc_phone Open phone to HC driver. 400 * @param[in] address Device address. 401 * @param[out] configuration_value Current configuration value. 402 * @return Error code. 371 403 */ 372 404 int usb_drv_req_get_configuration(int hc_phone, usb_address_t address, … … 403 435 /** Set configuration of USB device. 404 436 * 405 * @param hc_phone406 * @param address407 * @param configuration_value408 * @return 437 * @param[in] hc_phone Open phone to HC driver. 438 * @param[in] address Device address. 439 * @param[in] configuration_value New configuration value. 440 * @return Error code. 409 441 */ 410 442 int usb_drv_req_set_configuration(int hc_phone, usb_address_t address, … … 426 458 /** Determine alternate setting of USB device interface. 427 459 * 428 * @param hc_phone429 * @param address430 * @param interface_index431 * @param alternate_setting432 * @return 460 * @param[in] hc_phone Open phone to HC driver. 461 * @param[in] address Device address. 462 * @param[in] interface_index Interface index. 463 * @param[out] alternate_setting Value of alternate setting. 464 * @return Error code. 433 465 */ 434 466 int usb_drv_req_get_interface(int hc_phone, usb_address_t address, … … 465 497 /** Select an alternate setting of USB device interface. 466 498 * 467 * @param hc_phone468 * @param address469 * @param interface_index470 * @param alternate_setting471 * @return 499 * @param[in] hc_phone Open phone to HC driver. 500 * @param[in] address Device address. 501 * @param[in] interface_index Interface index. 502 * @param[in] alternate_setting Value of alternate setting. 503 * @return Error code. 472 504 */ 473 505 int usb_drv_req_set_interface(int hc_phone, usb_address_t address,
Note:
See TracChangeset
for help on using the changeset viewer.