Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > a4656ba0601a845ade6f4f3b1617fb40 > files > 4

libmlx4-1.0.1-6.fc14.x86_64.rpm

BEGIN {
	dir="/sys/bus/pci/drivers/mlx4_core"
	if (system("[ -d "dir" ]") != 0)
		exit 1
}
/^[[:xdigit:]]+:[[:xdigit:]]+:[[:xdigit:]]+\.[[:xdigit:]]([[:blank:]](ib|eth|auto))+/ {
	device=$1
	port1=$2
	port2=$3
	if (system("[ -d "dir"/"device" ]") != 0)
		next
	if (system("[ -f "dir"/"device"/port_trigger ]") == 0)
		print "all" > dir"/"device"/port_trigger"
	if (system("[ -f "dir"/"device"/mlx4_port2 ]") == 0)
		print port2 > dir"/"device"/mlx4_port2"
	if (system("[ -f "dir"/"device"/mlx4_port1 ]") == 0)
		print port1 > dir"/"device"/mlx4_port1"
}