ids-update.pl revision fd5a461316d34d3070d599f4be74bd8ae4b3d00f
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbuse strict;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbbuse warnings;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "# Data imported from: http://www.linux-usb.org/usb.ids\n");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb $line =~ s/\s+$//;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (defined $1) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (defined $1) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "# Data imported from: http://www.linux-usb.org/usb.ids\n");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb $line =~ s/\s+$//;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (defined $1) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb print(OUT " ID_USB_CLASS_FROM_DATABASE=" . $text . "\n");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (not defined $class) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb } elsif ($line =~ m/^$/) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (defined $1) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb print(OUT "usb:v*p*d*dc" . $class . "dsc" . $subclass . "*\n");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb print(OUT " ID_USB_SUBCLASS_FROM_DATABASE=" . $text . "\n");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (defined $1) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb print(OUT "usb:v*p*d*dc" . $class . "dsc" . $subclass . "dp" . $protocol . "*\n");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb print(OUT " ID_USB_PROTOCOL_FROM_DATABASE=" . $text . "\n");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb "# Data imported from: http://pci-ids.ucw.cz/v2.2/pci.ids\n");
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb $line =~ s/\s+$//;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (defined $1) {
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe print(OUT " ID_VENDOR_FROM_DATABASE=" . $text . "\n");
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe if (defined $1) {
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe print(OUT "pci:v0000" . $vendor . "d0000" . $device . "*\n");
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe print(OUT " ID_MODEL_FROM_DATABASE=" . $device_text . "\n");
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe $line =~ m/^\t\t([0-9a-f]{4})\s*([0-9a-f]{4})\s*(.*)$/;
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe if (defined $1) {
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe print(OUT "pci:v0000" . $vendor . "d0000" . $device . "sv0000" . $sub_vendor . "sd0000" . $sub_device . "*\n");
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe print(OUT " ID_MODEL_FROM_DATABASE=" . $device_text . $sub_text . "\n");
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe "# Data imported from: http://pci-ids.ucw.cz/v2.2/pci.ids\n");
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe $line =~ s/\s+$//;
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe if (defined $1) {
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe print(OUT " ID_PCI_CLASS_FROM_DATABASE=" . $text . "\n");
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe if (not defined $class) {
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe } elsif ($line =~ m/^$/) {
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe if (defined $1) {
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe print(OUT "pci:v*d*sv*sd*bc" . $class . "sc" . $subclass . "*\n");
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe print(OUT " ID_PCI_SUBCLASS_FROM_DATABASE=" . $text . "\n");
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe if (defined $1) {
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe print(OUT "pci:v*d*sv*sd*bc" . $class . "sc" . $subclass . "i" . $interface . "*\n");
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe print(OUT " ID_PCI_INTERFACE_FROM_DATABASE=" . $text . "\n");
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe "# Data imported from: hwdb/sdio.ids\n");
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe $line =~ s/\s+$//;
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe if (defined $1) {
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe print(OUT " ID_VENDOR_FROM_DATABASE=" . $text . "\n");
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe if (defined $1) {
fa06de8a28a737e8fbaad76d7f3ff67aaa5e4a09wrowe print(OUT "sdio:c*v" . $vendor . "d" . $device . "*\n");
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe "# Data imported from: hwdb/sdio.ids\n");
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe $line =~ s/\s+$//;
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe if (defined $1) {
83a8dc5a596a8a1b9d14f063268287d123b9ed7ewrowe print(OUT " ID_SDIO_CLASS_FROM_DATABASE=" . $text . "\n");
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe# MAC Address Block Large/Medium/Small
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe# Large MA-L 24/24 bit (OUI)
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe# Medium MA-M 28/20 bit (OUI prefix owned by IEEE)
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe# Small MA-S 36/12 bit (OUI prefix owned by IEEE)
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe "# Data imported from:\n" .
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe "# https://services13.ieee.org/RST/standards-ra-web/rest/assignments/download/?registry=MA-L&format=txt\n" .
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe "# https://services13.ieee.org/RST/standards-ra-web/rest/assignments/download/?registry=MA-M&format=txt\n" .
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe "# https://services13.ieee.org/RST/standards-ra-web/rest/assignments/download/?registry=MA-S&format=txt\n");
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe $line =~ s/^ +//;
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe $line =~ s/\s+$//;
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe $line =~ m/^([0-9A-F]{2})-([0-9A-F]{2})-([0-9A-F]{2})\s*\(hex\)\s*.+$/;
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe if (defined $1) {
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe $line =~ m/^([0-9A-F]{3})000-\g1FFF\s*\(base 16\)\s*(.+)$/;
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe if (defined $1) {
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe $line =~ s/^ +//;
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe $line =~ s/\s+$//;
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe $line =~ m/^([0-9A-F]{2})-([0-9A-F]{2})-([0-9A-F]{2})\s*\(hex\)\s*.+$/;
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe if (defined $1) {
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe $line =~ m/^([0-9A-F])00000-\g1FFFFF\s*\(base 16\)\s*(.+)$/;
cc9582e53aead2a044077c4a92f3dfc3605590b3wrowe if (defined $1) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb $line =~ s/^ +//;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb $line =~ s/\s+$//;
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb if (defined $1) {
b38846b15c8891c6dec44dcc4f96ca40721bf663rbb # skip the IEEE owned prefixes