Changeset 540e2d2 in mainline
- Timestamp:
- 2011-02-20T12:38:40Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3ae93a8
- Parents:
- 745d2ad
- Location:
- uspace/lib/usb
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/include/usb/recognise.h
r745d2ad r540e2d2 41 41 #include <ipc/devman.h> 42 42 43 int usb_device_create_match_ids_from_interface( 44 const usb_standard_interface_descriptor_t *, match_id_list_t *); 45 43 46 int usb_device_create_match_ids(usb_endpoint_pipe_t *, match_id_list_t *); 44 47 -
uspace/lib/usb/src/recognise.c
r745d2ad r540e2d2 142 142 } 143 143 144 /** Create device match ids based on its interface. 145 * 146 * @param[in] descriptor Interface descriptor. 147 * @param[out] matches Initialized list of match ids. 148 * @return Error code (the two mentioned are not the only ones). 149 * @retval EINVAL Invalid input parameters (expects non NULL pointers). 150 * @retval ENOENT Interface does not specify class. 151 */ 152 int usb_device_create_match_ids_from_interface( 153 const usb_standard_interface_descriptor_t *descriptor, 154 match_id_list_t *matches) 155 { 156 if (descriptor == NULL) { 157 return EINVAL; 158 } 159 if (matches == NULL) { 160 return EINVAL; 161 } 162 163 int rc; 164 165 if (descriptor->interface_class == USB_CLASS_USE_INTERFACE) { 166 return ENOENT; 167 } 168 169 const char *classname = usb_str_class(descriptor->interface_class); 170 assert(classname != NULL); 171 172 rc = usb_add_match_id(matches, 50, 173 "usb&interface&class=%s", 174 classname); 175 if (rc != EOK) { 176 return rc; 177 } 178 179 rc = usb_add_match_id(matches, 70, 180 "usb&interface&class=%s&subclass=0x%02x", 181 classname, descriptor->interface_subclass); 182 if (rc != EOK) { 183 return rc; 184 } 185 186 rc = usb_add_match_id(matches, 100, 187 "usb&interface&class=%s&subclass=0x%02x&protocol=0x%02x", 188 classname, descriptor->interface_subclass, 189 descriptor->interface_protocol); 190 191 return rc; 192 } 193 144 194 /** Create DDF match ids from USB device descriptor. 145 195 *
Note:
See TracChangeset
for help on using the changeset viewer.