| 331 | } |
| 332 | |
| 333 | static int usb_set_interface(int iface, int altsetting) |
| 334 | { |
| 335 | int iface_count = 0; |
| 336 | |
| 337 | for (struct usbd_function_ctx_header *fh = &usb.functions; |
| 338 | fh != NULL; |
| 339 | fh = fh->next, iface_count += fh->function->interface_count) { |
| 340 | if (iface - iface_count < fh->function->interface_count) { |
| 341 | if (fh->function->configure != NULL) |
| 342 | return (fh->function->configure(iface, |
| 343 | iface - iface_count, |
| 344 | altsetting, |
| 345 | fh)); |
| 346 | |
| 347 | /* Default to a single altsetting */ |
| 348 | if (altsetting != 0) |
| 349 | return (-1); |
| 350 | else |
| 351 | return (0); |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | return (-1); |
| 356 | } |
| 357 | |
| 358 | static int usb_tx_config_desc(int idx, int reqlen) |
| 359 | { |
no outgoing calls
no test coverage detected
searching dependent graphs…