# configuration for ethtool -- tuning networkinterfaces after initial uP
#
#TODO:
# - test if lspci is available else parse /proc/pci for get_pci_string()
#
#######################################################################

ETHTOOL='/usr/sbin/ethtool'

# path to lspci

LSPCI="/sbin/lspci"

#
#
# get pci-id of device
function get_pci ()
{
    eval echo \$pci_${1?}
	#$ETHTOOL -i ${1:?} | grep -i 'bus-info' | cut -d' ' -f 2
}
#
# get pci-vendor string of device
function get_pci_string ()
{
    case $(uname -r | cut -d'.' -f 2) in
	4) $LSPCI -s ${1:?} ;;
	5|6) $LSPCI -s $(echo ${1?} | sed -e '/....:..:..\.0/s/[^:]*://')
    esac
}
#
#######################################################################
