Changeset a6add7a in mainline for uspace/lib/usb/src/recognise.c
- Timestamp:
- 2011-03-04T23:35:22Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 960bee9
- Parents:
- d78a32f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/recognise.c
rd78a32f ra6add7a 31 31 */ 32 32 /** @file 33 * @brief Functions for recognising kindof attached devices.33 * Functions for recognition of attached devices. 34 34 */ 35 35 #include <sys/types.h> … … 44 44 #include <assert.h> 45 45 46 /** Index to append after device name for uniqueness. */ 46 47 static size_t device_name_index = 0; 48 /** Mutex guard for device_name_index. */ 47 49 static FIBRIL_MUTEX_INITIALIZE(device_name_index_mutex); 48 50 51 /** DDF operations of child devices. */ 49 52 ddf_dev_ops_t child_ops = { 50 53 .interfaces[USB_DEV_IFACE] = &usb_iface_hub_child_impl 51 54 }; 52 55 56 /** Get integer part from BCD coded number. */ 53 57 #define BCD_INT(a) (((unsigned int)(a)) / 256) 58 /** Get fraction part from BCD coded number (as an integer, no less). */ 54 59 #define BCD_FRAC(a) (((unsigned int)(a)) % 256) 55 60 61 /** Format for BCD coded number to be used in printf. */ 56 62 #define BCD_FMT "%x.%x" 63 /** Arguments to printf for BCD coded number. */ 57 64 #define BCD_ARGS(a) BCD_INT((a)), BCD_FRAC((a)) 58 65 … … 113 120 } 114 121 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 */ 115 129 #define ADD_MATCHID_OR_RETURN(match_ids, score, format, ...) \ 116 130 do { \
Note:
See TracChangeset
for help on using the changeset viewer.