diff options
Diffstat (limited to 'hwdb')
-rw-r--r-- | hwdb/20-sdio-vendor-model.hwdb | 24 | ||||
-rwxr-xr-x | hwdb/ids_parser.py | 46 |
2 files changed, 41 insertions, 29 deletions
diff --git a/hwdb/20-sdio-vendor-model.hwdb b/hwdb/20-sdio-vendor-model.hwdb index 9cf34b2a39..6c4dbe8ac4 100644 --- a/hwdb/20-sdio-vendor-model.hwdb +++ b/hwdb/20-sdio-vendor-model.hwdb @@ -80,9 +80,6 @@ sdio:c*v02D0* sdio:c*v02D0d044B* ID_MODEL_FROM_DATABASE=Nintendo Wii WLAN daughter card -sdio:c*v02D0dA887* - ID_MODEL_FROM_DATABASE=BCM43143 WLAN card - sdio:c*v02D0d4324* ID_MODEL_FROM_DATABASE=BCM43241 WLAN card @@ -95,21 +92,24 @@ sdio:c*v02D0d4330* sdio:c*v02D0d4334* ID_MODEL_FROM_DATABASE=BCM4334 WLAN card +sdio:c*v02D0d4335* + ID_MODEL_FROM_DATABASE=BCM4335/BCM4339 WLAN card + +sdio:c*v02D0d4354* + ID_MODEL_FROM_DATABASE=BCM4354 WLAN card + +sdio:c*v02D0dA887* + ID_MODEL_FROM_DATABASE=BCM43143 WLAN card + sdio:c*v02D0dA94C* ID_MODEL_FROM_DATABASE=BCM43340 WLAN card sdio:c*v02D0dA94D* ID_MODEL_FROM_DATABASE=BCM43341 WLAN card -sdio:c*v02D0d4335* - ID_MODEL_FROM_DATABASE=BCM4335/BCM4339 WLAN card - sdio:c*v02D0dA962* ID_MODEL_FROM_DATABASE=BCM43362 WLAN card -sdio:c*v02D0d4354* - ID_MODEL_FROM_DATABASE=BCM4354 WLAN card - sdio:c*v02DB* ID_VENDOR_FROM_DATABASE=SyChip Inc. @@ -146,12 +146,12 @@ sdio:c*v02DFd9129* sdio:c*v02DFd912A* ID_MODEL_FROM_DATABASE=SD8797 BT -sdio:c*v02DFd912E* - ID_MODEL_FROM_DATABASE=SD8897 BT - sdio:c*v02DFd912D* ID_MODEL_FROM_DATABASE=SD8897 WLAN +sdio:c*v02DFd912E* + ID_MODEL_FROM_DATABASE=SD8897 BT + sdio:c*v02FE* ID_VENDOR_FROM_DATABASE=Spectec Computer Co., Ltd diff --git a/hwdb/ids_parser.py b/hwdb/ids_parser.py index b8493e66c3..1b27005cf2 100755 --- a/hwdb/ids_parser.py +++ b/hwdb/ids_parser.py @@ -231,35 +231,47 @@ def pci_classes(p): print(f'Wrote {out.name}') def sdio_vendor_model(p): + items = {} + + for vendor_group in p.VENDORS: + vendor = vendor_group.VENDOR.vendor.upper() + text = vendor_group.VENDOR.text.strip() + add_item(items, (vendor,), text) + + for device_group in vendor_group.DEVICES: + device = device_group.device.upper() + text = device_group.text.strip() + add_item(items, (vendor, device), text) + with open('20-sdio-vendor-model.hwdb', 'wt') as out: header(out, 'hwdb/sdio.ids') - for vendor_group in p.VENDORS: - vendor = vendor_group.VENDOR.vendor.upper() - text = vendor_group.VENDOR.text.strip() - print(f'', - f'sdio:c*v{vendor}*', - f' ID_VENDOR_FROM_DATABASE={text}', sep='\n', file=out) + for key in sorted(items): + if len(key) == 1: + p, n = 'sdio:c*v{}*', 'VENDOR' + else: + p, n = 'sdio:c*v{}d{}*', 'MODEL' + print('', p.format(*key), + f' ID_{n}_FROM_DATABASE={items[key]}', sep='\n', file=out) - for device_group in vendor_group.DEVICES: - device = device_group.device.upper() - text = device_group.text.strip() - print(f'', - f'sdio:c*v{vendor}d{device}*', - f' ID_MODEL_FROM_DATABASE={text}', sep='\n', file=out) print(f'Wrote {out.name}') def sdio_classes(p): + items = {} + + for klass_group in p.CLASSES: + klass = klass_group.KLASS.klass.upper() + text = klass_group.KLASS.text.strip() + add_item(items, klass, text) + with open('20-sdio-classes.hwdb', 'wt') as out: header(out, 'hwdb/sdio.ids') - for klass_group in p.CLASSES: - klass = klass_group.KLASS.klass.upper() - text = klass_group.KLASS.text.strip() - + for klass in sorted(items): print(f'', f'sdio:c{klass}v*d*', - f' ID_SDIO_CLASS_FROM_DATABASE={text}', sep='\n', file=out) + f' ID_SDIO_CLASS_FROM_DATABASE={items[klass]}', sep='\n', file=out) + print(f'Wrote {out.name}') # MAC Address Block Large/Medium/Small |