fwget: pci: hex strings use 0-9 and a-f not a-z

Reviewed by:	imp, manu
Differential Revision: https://reviews.freebsd.org/D52311

(cherry picked from commit 50cab1202d)
This commit is contained in:
Bjoern A. Zeeb 2025-08-31 18:51:12 +00:00
parent 53d1c328e9
commit 772579c13e

View file

@ -27,7 +27,7 @@
pci_get_class()
{
local hexclass=$(echo $1 | sed 's/.*class=\(0x[0-9a-z]\{2\}\).*/\1/')
local hexclass=$(echo $1 | sed 's/.*class=\(0x[0-9a-f]\{2\}\).*/\1/')
case "${hexclass}" in
0x00) echo "old" ;; # built before class codes were finalized
0x02) echo "network" ;;
@ -38,7 +38,7 @@ pci_get_class()
pci_get_vendor()
{
local hexvendor=$(echo $1 | sed 's/.*\ vendor=\(0x[0-9a-z]*\).*/\1/')
local hexvendor=$(echo $1 | sed 's/.*\ vendor=\(0x[0-9a-f]*\).*/\1/')
case "${hexvendor}" in
0x1002) echo "amd" ;;
@ -52,7 +52,7 @@ pci_get_vendor()
pci_get_device()
{
local hexdevice=$(echo $1 | sed 's/.*\ device=\(0x[0-9a-z]*\).*/\1/')
local hexdevice=$(echo $1 | sed 's/.*\ device=\(0x[0-9a-f]*\).*/\1/')
echo ${hexdevice}
}