Get the linux modules for our pci devices


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # search modules for pci devices
  2. get_pci_modules () {
  3. while read IGNORE ID IGNORE
  4. do
  5. VENDOR=`echo $ID | cut -b1-4`
  6. DEVICE=`echo $ID | cut -b5-8`
  7. DEVENTRY=`echo 0x0000${VENDOR} 0x0000${DEVICE}`
  8. cat /lib/modules/`uname -r`/*.pcimap | grep "$DEVENTRY" | cut -d ' ' -f1
  9. done
  10. }
  11.  
  12. for MODULE in `get_pci_modules < /proc/bus/pci/devices | sort -u` ; do
  13. echo $MODULE
  14. done

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.