Commit c98e507e authored by Jim Harris's avatar Jim Harris Committed by Daniel Verkamp
Browse files

setup.sh: use ~ to compare device/vendor IDs and class codes



Device IDs starting with 0e get treated as 0 due to numerical
interpretation (0 * 10^x = 0).  So use ~ to do a string regexp
comparison instead.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I4b5558c0127b0c4f021daf8151bf4d3f514e44da

Reviewed-on: https://review.gerrithub.io/374507


Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
parent 23b89186
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -6,13 +6,13 @@ rootdir=$(readlink -f $(dirname $0))/..

function linux_iter_pci_class_code {
	# Argument is the class code
	lspci -mm -n -D | tr -d '"' | awk -v cc="$1" -F " " '{if (cc == $2) print $1}'
	lspci -mm -n -D | tr -d '"' | awk -v cc="$1" -F " " '{if (cc ~ $2) print $1}'
}

function linux_iter_pci_dev_id {
	# Argument 1 is the vendor id
	# Argument 2 is the device id
	lspci -mm -n -D | tr -d '"' | awk -v ven="$1" -v dev="$2" -F " " '{if (ven == $3 && dev == $4) print $1}'
	lspci -mm -n -D | tr -d '"' | awk -v ven="$1" -v dev="$2" -F " " '{if (ven ~ $3 && dev ~ $4) print $1}'
}

function linux_bind_driver() {