Commit d626566
committed
shared/tinyusb,extmod/machine_usb_device: Add NCM USB networking support.
This commit adds Network Control Model (NCM) USB class support to the USB
device configurability framework, enabling USB-based networking functionality.
Key features:
- NCM class flag (USB_BUILTIN_FLAG_NCM, value 0x04) for bitfield operations
- BUILTIN_NCM constant for user-level enable/disable control
- Dynamic NCM descriptor generation based on enabled state
- Automatic interface/endpoint/string counting for NCM (2 interfaces, 3 endpoints)
- Runtime NCM cleanup on disable (calls usbnet_deinit())
- Guarded by MICROPY_HW_NETWORK_USBNET compile flag
NCM support integrates with the existing CDC/MSC infrastructure, following
the same enable/disable patterns and descriptor generation logic.
Signed-off-by: Andrew Leech <[email protected]>1 parent c812ca3 commit d626566
3 files changed
+82
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
95 | 100 | | |
96 | 101 | | |
97 | 102 | | |
| |||
381 | 386 | | |
382 | 387 | | |
383 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
384 | 394 | | |
385 | 395 | | |
386 | 396 | | |
| |||
392 | 402 | | |
393 | 403 | | |
394 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
395 | 410 | | |
396 | 411 | | |
397 | 412 | | |
| |||
403 | 418 | | |
404 | 419 | | |
405 | 420 | | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
406 | 426 | | |
407 | 427 | | |
408 | 428 | | |
| |||
481 | 501 | | |
482 | 502 | | |
483 | 503 | | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
484 | 510 | | |
485 | 511 | | |
486 | 512 | | |
| |||
524 | 550 | | |
525 | 551 | | |
526 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
527 | 557 | | |
528 | 558 | | |
529 | 559 | | |
| |||
542 | 572 | | |
543 | 573 | | |
544 | 574 | | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
545 | 579 | | |
546 | 580 | | |
547 | 581 | | |
| |||
594 | 628 | | |
595 | 629 | | |
596 | 630 | | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
597 | 635 | | |
598 | 636 | | |
599 | 637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| 72 | + | |
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
76 | 82 | | |
77 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
78 | 93 | | |
79 | 94 | | |
80 | 95 | | |
| |||
87 | 102 | | |
88 | 103 | | |
89 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
90 | 108 | | |
91 | 109 | | |
92 | 110 | | |
| |||
100 | 118 | | |
101 | 119 | | |
102 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
103 | 124 | | |
104 | 125 | | |
105 | 126 | | |
| |||
148 | 169 | | |
149 | 170 | | |
150 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
151 | 183 | | |
152 | 184 | | |
153 | 185 | | |
| |||
170 | 202 | | |
171 | 203 | | |
172 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
173 | 208 | | |
174 | 209 | | |
175 | 210 | | |
| |||
188 | 223 | | |
189 | 224 | | |
190 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
191 | 230 | | |
192 | 231 | | |
193 | 232 | | |
| |||
204 | 243 | | |
205 | 244 | | |
206 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
207 | 249 | | |
208 | 250 | | |
209 | 251 | | |
| |||
0 commit comments