Changeset 8e9becf6 in mainline for uspace/lib/usb/src/recognise.c


Ignore:
Timestamp:
2011-03-08T20:00:47Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
021351c
Parents:
0588062e (diff), d2fc1c2 (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.
Message:

Merged branch lelian/hidd

File:
1 edited

Legend:

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

    r0588062e r8e9becf6  
    3131 */
    3232/** @file
    33  * @brief Functions for recognising kind of attached devices.
     33 * Functions for recognition of attached devices.
    3434 */
    3535#include <sys/types.h>
     
    4444#include <assert.h>
    4545
     46/** Index to append after device name for uniqueness. */
    4647static size_t device_name_index = 0;
     48/** Mutex guard for device_name_index. */
    4749static FIBRIL_MUTEX_INITIALIZE(device_name_index_mutex);
    4850
     51/** DDF operations of child devices. */
    4952ddf_dev_ops_t child_ops = {
    5053        .interfaces[USB_DEV_IFACE] = &usb_iface_hub_child_impl
    5154};
    5255
     56/** Get integer part from BCD coded number. */
    5357#define BCD_INT(a) (((unsigned int)(a)) / 256)
     58/** Get fraction part from BCD coded number (as an integer, no less). */
    5459#define BCD_FRAC(a) (((unsigned int)(a)) % 256)
    5560
     61/** Format for BCD coded number to be used in printf. */
    5662#define BCD_FMT "%x.%x"
     63/** Arguments to printf for BCD coded number. */
    5764#define BCD_ARGS(a) BCD_INT((a)), BCD_FRAC((a))
    5865
     
    113120}
    114121
     122/** Add match id to list or return with error code.
     123 *
     124 * @param match_ids List of match ids.
     125 * @param score Match id score.
     126 * @param format Format of the matching string
     127 * @param ... Arguments for the format.
     128 */
    115129#define ADD_MATCHID_OR_RETURN(match_ids, score, format, ...) \
    116130        do { \
     
    124138/** Create device match ids based on its interface.
    125139 *
    126  * @param[in] descriptor Interface descriptor.
     140 * @param[in] desc_device Device descriptor.
     141 * @param[in] desc_interface Interface descriptor.
    127142 * @param[out] matches Initialized list of match ids.
    128143 * @return Error code (the two mentioned are not the only ones).
    129144 * @retval EINVAL Invalid input parameters (expects non NULL pointers).
    130  * @retval ENOENT Interface does not specify class.
     145 * @retval ENOENT Device class is not "use interface".
    131146 */
    132147int usb_device_create_match_ids_from_interface(
     
    319334 * @param[in] parent Parent device.
    320335 * @param[out] child_handle Handle of the child device.
     336 * @param[in] dev_ops Child device ops.
     337 * @param[in] dev_data Arbitrary pointer to be stored in the child
     338 *      as @c driver_data.
     339 * @param[out] child_fun Storage where pointer to allocated child function
     340 *      will be written.
    321341 * @return Error code.
    322342 */
Note: See TracChangeset for help on using the changeset viewer.