pci: import pci script and updated database from 9atom

This commit is contained in:
mischief 2014-12-20 21:41:34 -08:00
parent 84f45a4491
commit d44d679793
2 changed files with 26185 additions and 7713 deletions

33552
lib/pci

File diff suppressed because it is too large Load diff

View file

@ -19,13 +19,13 @@ fn verbose {
file="/lib/pci" file="/lib/pci"
FS="\t" FS="\t"
while(getline <file > 0){ while(getline <file > 0){
if(/^;/) continue if(/^[#;]/) continue
if(/^[0-9a-fA-F]/){ if(/^[0-9A-Fa-f]/){
vid=lower($1) vid=$1 #vid=lower($1)
vendor[vid] = $2 vendor[vid] = $2
} }
if(/^ [0-9a-fA-F]/){ if(/^ [0-9A-Fa-f]/){
did=lower($2) did=$2 #lower($2)
id[vid "/" did] = $3 id[vid "/" did] = $3
} }
} }
@ -45,32 +45,27 @@ fn verbose {
} }
' '
} }
fn usage {
echo usage: $1 '[-bv]' >[1=2] filter=cat
flagfmt=v,b
args='[vid/did ...]'
if(! ifs=() eval `{aux/getflags $*}){
aux/usage
exit usage exit usage
} }
filter=cat if(! ~ $#* 0){
bridges=yes {
done=0 for(i in `{echo $* | tr 'A-Z' 'a-z'})
while (~ $done 0 && ! ~ $#* 0 && ~ $1 -*) { echo '- - -' $i
if (~ $1 -*b*) } | verbose | sed 's:^- - - ::'
bridges=no exit ''
if (~ $1 -*v*)
filter=verbose
switch ($1) {
case --
done = 1 # no break in rc, alas
case -*[~bv]*
usage $0
} }
shift
}
if (! ~ $#* 0)
usage $0
builtin cd '#$/pci' && grep . *ctl | { if(~ $#flagv 1)
if (~ $bridges no) filter=verbose
builtin cd '#$/pci' && grep . `{ls -n | grep ctl} | {
if (~ $#flagb 1)
sed /:06/d sed /:06/d
if not if not
cat cat
@ -86,10 +81,19 @@ builtin cd '#$/pci' && grep . *ctl | {
s/: 05/: mem 05/ s/: 05/: mem 05/
s/: 06/: brg 06/ s/: 06/: brg 06/
s/: 07/: ser 07/ s/: 07/: ser 07/
s/: 08/: base 08/
s/: 09/: inpt 09/
s/: 0a/: dock 0a/
s/: 0b/: proc 0b/
s/: 0c\.03/: usb 0c.03/ s/: 0c\.03/: usb 0c.03/
s/: 0c\.05/: smb 0c.05/ s/: 0c\.05/: smb 0c.05/
s/: 0c\.07/: ipmi 0c.07/
s/: 0d/: rad 0d/ s/: 0d/: rad 0d/
s/: 0e/: intl 0e/
s/: 0f/: sat 0f/
s/: 10/: cryp 10/ s/: 10/: cryp 10/
s/: 11/: sigl 11/
s/: 12/: exl 12/
t t
s/ / --- / s/ / --- /
' | $filter ' | $filter