You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
819 B

  1. #!/bin/sh
  2. # Copyright (C) 2008 OpenWrt.org
  3. case "$ACTION" in
  4. add)
  5. SYSFS=/sys/bus/pcmcia/devices/
  6. DEVPATH=$SOCKET_NO.$((0x$DEVICE_NO))
  7. # check whether the CIS is completely broken
  8. if [ ! -h $SYSFS$DEVPATH/driver ]; then
  9. CISFILE=$(/usr/sbin/pcmcia-check-broken-cis $SOCKET_NO)
  10. echo PCMCIA: $CISFILE;
  11. if [ ! -z $CISFILE ]; then
  12. if [ -f /lib/firmware/$CISFILE ]; then
  13. cat /lib/firmware/$CISFILE > $SYSFS/class/pcmcia_socket/pcmcia_socket$(SOCKET_NO)/cis
  14. fi;
  15. fi;
  16. fi;
  17. # allow a match solely based on the "function ID" field
  18. if [ ! -h $SYSFS$DEVPATH/driver ]; then
  19. if [ -w $SYSFS$DEVPATH/allow_func_id_match ]; then
  20. echo PCMCIA: allowing func_id based match for PCMCIA device $SOCKET_NO.$DEVICE_NO
  21. echo -n "42" > $SYSFS$DEVPATH/allow_func_id_match;
  22. fi;
  23. fi;
  24. ;;
  25. esac