#!/bin/sh lspci -m | sed 's/\S\+ \S\+ \S\+ "\(\S\+\)" "\(\S\+\)" "\(\S\+\)" "\(\S\+\)"/\1 \2 \3 \4/' | while read vendor device subvendor subdevice; do grep -h "^[^ ]\+ \+\(0x0000$vendor\|0xffffffff\) \(0x0000$device\|0xffffffff\) \(0x0000$subvendor\|0xffffffff\) \(0x0000$subdevice\|0xffffffff\) " /lib/modules/$(uname -r)/modules.pcimap.${1-*} 2>/dev/null | cut -d " " -f1 done | sort -u