796b06c21b62d13c9021e2fbd9c58a5c6edb2764Kay Sieversuse warnings;
378cf88f72a9cda84baf703ed24f54c8c539fdcfKay Sievers "# Data imported from: http://www.linux-usb.org/usb.ids\n");
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers $line =~ s/\s+$//;
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers if (defined $1) {
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers print(OUT " ID_VENDOR_FROM_DATABASE=" . $text . "\n");
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers if (defined $1) {
1d09582ab9d8bc619de3a01f01d614eab44d31c0Kay Sievers print(OUT "usb:v" . $vendor . "p" . $model . "*\n");
1d09582ab9d8bc619de3a01f01d614eab44d31c0Kay Sievers print(OUT " ID_MODEL_FROM_DATABASE=" . $text . "\n");
378cf88f72a9cda84baf703ed24f54c8c539fdcfKay Sievers "# Data imported from: http://www.linux-usb.org/usb.ids\n");
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers $line =~ s/\s+$//;
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers if (defined $1) {
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers print(OUT " ID_USB_CLASS_FROM_DATABASE=" . $text . "\n");
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers if (not defined $class) {
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers } elsif ($line =~ m/^$/) {
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers if (defined $1) {
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers print(OUT "usb:v*p*d*dc" . $class . "dsc" . $subclass . "*\n");
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers print(OUT " ID_USB_SUBCLASS_FROM_DATABASE=" . $text . "\n");
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers if (defined $1) {
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers print(OUT "usb:v*p*d*dc" . $class . "dsc" . $subclass . "dp" . $protocol . "*\n");
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers print(OUT " ID_USB_PROTOCOL_FROM_DATABASE=" . $text . "\n");
378cf88f72a9cda84baf703ed24f54c8c539fdcfKay Sievers "# Data imported from: http://pci-ids.ucw.cz/v2.2/pci.ids\n");
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers $line =~ s/\s+$//;
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers if (defined $1) {
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers print(OUT " ID_VENDOR_FROM_DATABASE=" . $text . "\n");
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers if (defined $1) {
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers print(OUT "pci:v0000" . $vendor . "d0000" . $device . "*\n");
d060b62fcb4746d3758c567e9379c6728a035b66Kay Sievers print(OUT " ID_MODEL_FROM_DATABASE=" . $device_text . "\n");
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers $line =~ m/^\t\t([0-9a-f]{4})\s*([0-9a-f]{4})\s*(.*)$/;
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers if (defined $1) {
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers print(OUT "pci:v0000" . $vendor . "d0000" . $device . "sv0000" . $sub_vendor . "sd0000" . $sub_device . "*\n");
d060b62fcb4746d3758c567e9379c6728a035b66Kay Sievers print(OUT " ID_MODEL_FROM_DATABASE=" . $device_text . $sub_text . "\n");
378cf88f72a9cda84baf703ed24f54c8c539fdcfKay Sievers "# Data imported from: http://pci-ids.ucw.cz/v2.2/pci.ids\n");
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers $line =~ s/\s+$//;
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers if (defined $1) {
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers print(OUT " ID_PCI_CLASS_FROM_DATABASE=" . $text . "\n");
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers if (not defined $class) {
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers } elsif ($line =~ m/^$/) {
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers if (defined $1) {
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers print(OUT "pci:v*d*sv*sd*bc" . $class . "sc" . $subclass . "*\n");
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers print(OUT " ID_PCI_SUBCLASS_FROM_DATABASE=" . $text . "\n");
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers if (defined $1) {
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers print(OUT "pci:v*d*sv*sd*bc" . $class . "sc" . $subclass . "i" . $interface . "*\n");
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers print(OUT " ID_PCI_INTERFACE_FROM_DATABASE=" . $text . "\n");
56243d0936f85b2580f4c1028e1af98b96d77b72Marcel Holtmann open(OUT, ">", "20-sdio-vendor-model.hwdb");
56243d0936f85b2580f4c1028e1af98b96d77b72Marcel Holtmann print(OUT "# This file is part of systemd.\n" .
56243d0936f85b2580f4c1028e1af98b96d77b72Marcel Holtmann "# Data imported from: hwdb/sdio.ids\n");
56243d0936f85b2580f4c1028e1af98b96d77b72Marcel Holtmann $line =~ s/\s+$//;
56243d0936f85b2580f4c1028e1af98b96d77b72Marcel Holtmann if (defined $1) {
56243d0936f85b2580f4c1028e1af98b96d77b72Marcel Holtmann print(OUT " ID_VENDOR_FROM_DATABASE=" . $text . "\n");
56243d0936f85b2580f4c1028e1af98b96d77b72Marcel Holtmann if (defined $1) {
56243d0936f85b2580f4c1028e1af98b96d77b72Marcel Holtmann print(OUT "sdio:c*v" . $vendor . "d" . $device . "*\n");
56243d0936f85b2580f4c1028e1af98b96d77b72Marcel Holtmann print(OUT " ID_MODEL_FROM_DATABASE=" . $text . "\n");
56243d0936f85b2580f4c1028e1af98b96d77b72Marcel Holtmann print(OUT "# This file is part of systemd.\n" .
56243d0936f85b2580f4c1028e1af98b96d77b72Marcel Holtmann "# Data imported from: hwdb/sdio.ids\n");
56243d0936f85b2580f4c1028e1af98b96d77b72Marcel Holtmann $line =~ s/\s+$//;
56243d0936f85b2580f4c1028e1af98b96d77b72Marcel Holtmann if (defined $1) {
56243d0936f85b2580f4c1028e1af98b96d77b72Marcel Holtmann print(OUT " ID_SDIO_CLASS_FROM_DATABASE=" . $text . "\n");
fd5a461316d34d3070d599f4be74bd8ae4b3d00fKay Sievers# MAC Address Block Large/Medium/Small
fd5a461316d34d3070d599f4be74bd8ae4b3d00fKay Sievers# Large MA-L 24/24 bit (OUI)
fd5a461316d34d3070d599f4be74bd8ae4b3d00fKay Sievers# Medium MA-M 28/20 bit (OUI prefix owned by IEEE)
fd5a461316d34d3070d599f4be74bd8ae4b3d00fKay Sievers# Small MA-S 36/12 bit (OUI prefix owned by IEEE)
378cf88f72a9cda84baf703ed24f54c8c539fdcfKay Sievers "# Data imported from:\n" .
fd5a461316d34d3070d599f4be74bd8ae4b3d00fKay Sievers "# https://services13.ieee.org/RST/standards-ra-web/rest/assignments/download/?registry=MA-L&format=txt\n" .
fd5a461316d34d3070d599f4be74bd8ae4b3d00fKay Sievers "# https://services13.ieee.org/RST/standards-ra-web/rest/assignments/download/?registry=MA-M&format=txt\n" .
fd5a461316d34d3070d599f4be74bd8ae4b3d00fKay Sievers "# https://services13.ieee.org/RST/standards-ra-web/rest/assignments/download/?registry=MA-S&format=txt\n");
f2f1861383c5cf4c07a7c6098d7c0b7134f06d51Kay Sievers $line =~ s/^ +//;
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers $line =~ s/\s+$//;
5fe25affc01fb003a3a66937458a25640a6075ceTom Gundersen $line =~ m/^([0-9A-F]{2})-([0-9A-F]{2})-([0-9A-F]{2})\s*\(hex\)\s*.+$/;
5fe25affc01fb003a3a66937458a25640a6075ceTom Gundersen if (defined $1) {
5fe25affc01fb003a3a66937458a25640a6075ceTom Gundersen $line =~ m/^([0-9A-F]{3})000-\g1FFF\s*\(base 16\)\s*(.+)$/;
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers if (defined $1) {
8db6dcfd3c3d19d35767f04884a99368f6c64b36Kay Sievers print(OUT " ID_OUI_FROM_DATABASE=" . $text . "\n");
fd5a461316d34d3070d599f4be74bd8ae4b3d00fKay Sievers $line =~ s/^ +//;
fd5a461316d34d3070d599f4be74bd8ae4b3d00fKay Sievers $line =~ s/\s+$//;
fd5a461316d34d3070d599f4be74bd8ae4b3d00fKay Sievers $line =~ m/^([0-9A-F]{2})-([0-9A-F]{2})-([0-9A-F]{2})\s*\(hex\)\s*.+$/;
fd5a461316d34d3070d599f4be74bd8ae4b3d00fKay Sievers if (defined $1) {
fd5a461316d34d3070d599f4be74bd8ae4b3d00fKay Sievers $line =~ m/^([0-9A-F])00000-\g1FFFFF\s*\(base 16\)\s*(.+)$/;
fd5a461316d34d3070d599f4be74bd8ae4b3d00fKay Sievers if (defined $1) {
fd5a461316d34d3070d599f4be74bd8ae4b3d00fKay Sievers print(OUT " ID_OUI_FROM_DATABASE=" . $text . "\n");
f2f1861383c5cf4c07a7c6098d7c0b7134f06d51Kay Sievers $line =~ s/^ +//;
5fe25affc01fb003a3a66937458a25640a6075ceTom Gundersen $line =~ s/\s+$//;
5fe25affc01fb003a3a66937458a25640a6075ceTom Gundersen $line =~ m/^([0-9A-F]{6})\s*\(base 16\)\s*(.+)$/;
5fe25affc01fb003a3a66937458a25640a6075ceTom Gundersen if (defined $1) {
fd5a461316d34d3070d599f4be74bd8ae4b3d00fKay Sievers # skip the IEEE owned prefixes
5fe25affc01fb003a3a66937458a25640a6075ceTom Gundersen print(OUT " ID_OUI_FROM_DATABASE=" . $text . "\n");