home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / linux / system / usr_pci_modem.sh < prev   
Linux/UNIX/POSIX Shell Script  |  2000-05-02  |  1KB  |  35 lines

  1. #!/bin/sh
  2.  
  3. # 01:08.0 Class 0700: 12b9:1008 (rev 01) (prog-if 02)
  4. #        Subsystem: 12b9:00ad
  5. #        Flags: medium devsel, IRQ 11
  6. #        I/O ports at dff0
  7. #        Capabilities: [dc] Power Management version 2
  8.  
  9. # A nasty hack to make the USR/3COM pci modem work.
  10.  
  11. #Scan the pci bus exit if no modem.
  12. /sbin/lspci -d 12b9:1008 | /bin/grep -q "US Robotics" || exit
  13.  
  14. #Figure out what resources we need.
  15. ioport=`/sbin/lspci -nvd 12b9:1008 | /bin/grep "I/O ports" | awk '{ print $4 }'`
  16. irq=`/sbin/lspci -nvd 12b9:1008 | /bin/grep " IRQ " | awk '{ print $5 }'`
  17.  
  18. #Use the ttyS3 device, COM 4 under DOS.
  19. serport=/dev/ttyS3
  20.  
  21. #Bind modem to device.
  22. /bin/setserial $serport irq $irq port 0x$ioport ^fourport ^auto_irq skip_test autoconfig spd_vhi
  23. /bin/setserial $serport skip_test autoconfig 
  24.  
  25. #check for symlink /dev/modem
  26. if [ -L /dev/modem ]; then
  27.     #if it exists bail out
  28.     exit 0
  29.     else
  30.     #if not set the symlink. 
  31.     ln -s $serport /dev/modem
  32. fi
  33. #In the unlikely event /dev/modem is not a symlink this will produce an error.
  34.  
  35.