Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 863d45e in mainline


Ignore:
Timestamp:
2011-01-10T11:55:13Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial
Children:
1ffa73b, a97ea0f
Parents:
263a9f1
Message:

Add some missing comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/usbdrvreq.c

    r263a9f1 r863d45e  
    3636#include <errno.h>
    3737
     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 */
    3843#define PREPARE_TARGET(name, target_address) \
    3944        usb_target_t name = { \
     
    4247        }
    4348
    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) \
    4562        usb_device_request_setup_packet_t setup_packet = { \
    4663                .request_type = \
     
    5471        }
    5572
    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) \
    5787        PREPARE_SETUP_PACKET(name, p_direction, p_type, p_recipient, \
    5888            p_request, (p_value_low) | ((p_value_high) << 8), \
     
    6191/** Retrieve status of a USB device.
    6292 *
    63  * @param hc_phone
    64  * @param address
    65  * @param recipient
    66  * @param recipient_index
    67  * @param status
    68  * @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.
    6999 */
    70100int usb_drv_req_get_status(int hc_phone, usb_address_t address,
     
    100130/** Clear or disable USB device feature.
    101131 *
    102  * @param hc_phone
    103  * @param address
    104  * @param recipient
    105  * @param selector
    106  * @param index
    107  * @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.
    108138 */
    109139int usb_drv_req_clear_feature(int hc_phone, usb_address_t address,
     
    125155/** Set or enable USB device feature.
    126156 *
    127  * @param hc_phone
    128  * @param address
    129  * @param recipient
    130  * @param selector
    131  * @param index
    132  * @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.
    133163 */
    134164int usb_drv_req_set_feature(int hc_phone, usb_address_t address,
     
    156186 * @see usb_drv_bind_address
    157187 *
    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.
    161191 * @return Error code.
    162192 */
     
    179209 *
    180210 * @param[in] hc_phone Open phone to HC driver.
    181  * @param[in] address Device USB address.
     211 * @param[in] address Device address.
    182212 * @param[in] request_type Request type (standard/class/vendor).
    183213 * @param[in] descriptor_type Descriptor type (device/configuration/HID/...).
     
    221251 *
    222252 * @param[in] phone Open phone to HC driver.
    223  * @param[in] address Device USB address.
     253 * @param[in] address Device address.
    224254 * @param[out] descriptor Storage for the device descriptor.
    225255 * @return Error code.
     
    266296 *
    267297 * @param[in] phone Open phone to HC driver.
    268  * @param[in] address Device USB address.
     298 * @param[in] address Device address.
    269299 * @param[in] index Configuration descriptor index.
    270300 * @param[out] descriptor Storage for the configuration descriptor.
     
    308338 *
    309339 * @warning The @p buffer might be touched (i.e. its contents changed)
    310  * even when error occurres.
     340 * even when error occurs.
    311341 *
    312342 * @param[in] phone Open phone to HC driver.
    313  * @param[in] address Device USB address.
     343 * @param[in] address Device address.
    314344 * @param[in] index Configuration descriptor index.
    315345 * @param[out] buffer Buffer for the whole configuration descriptor.
     
    335365/** Update existing descriptor of a USB device.
    336366 *
    337  * @param hc_phone
    338  * @param address
    339  * @param descriptor_type
    340  * @param descriptor_index
    341  * @param language
    342  * @param descriptor
    343  * @param descriptor_size
    344  * @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.
    345375 */
    346376int usb_drv_req_set_descriptor(int hc_phone, usb_address_t address,
     
    349379    void *descriptor, size_t descriptor_size)
    350380{
     381        // FIXME: check that descriptor is not too big
     382
    351383        PREPARE_TARGET(target, address);
    352384
     
    365397/** Determine current configuration value of USB device.
    366398 *
    367  * @param hc_phone
    368  * @param address
    369  * @param configuration_value
    370  * @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.
    371403 */
    372404int usb_drv_req_get_configuration(int hc_phone, usb_address_t address,
     
    403435/** Set configuration of USB device.
    404436 *
    405  * @param hc_phone
    406  * @param address
    407  * @param configuration_value
    408  * @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.
    409441 */
    410442int usb_drv_req_set_configuration(int hc_phone, usb_address_t address,
     
    426458/** Determine alternate setting of USB device interface.
    427459 *
    428  * @param hc_phone
    429  * @param address
    430  * @param interface_index
    431  * @param alternate_setting
    432  * @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.
    433465 */
    434466int usb_drv_req_get_interface(int hc_phone, usb_address_t address,
     
    465497/** Select an alternate setting of USB device interface.
    466498 *
    467  * @param hc_phone
    468  * @param address
    469  * @param interface_index
    470  * @param alternate_setting
    471  * @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.
    472504 */
    473505int usb_drv_req_set_interface(int hc_phone, usb_address_t address,
Note: See TracChangeset for help on using the changeset viewer.