1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

hwdb: sort sdio entries

Nothing intersting here.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-10-02 13:19:23 +02:00
parent e4804bdae6
commit e979e502da
2 changed files with 41 additions and 29 deletions

View File

@ -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

View File

@ -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