3
. /etc/default/irda-utils
5
test "$AUTOMATIC" = "true" || exit 0
7
test -d /sys/bus/pnp/devices || exit 0
9
cd /sys/bus/pnp/devices
12
STATEFILE=/var/run/irdadev;
15
start|restart|reload|force-reload)
21
for y in `cat $x/id`; do
31
OPTIONS="dongle_id=0x09";
44
if [ $FIR = "false" -a $SIR = "false" ]; then
48
# Work out resource ranges, so we know which serial port to work with
49
PORTS=`grep io $x/resources | sed -e 's/io \(.*\)-.*/\1/'`
50
for PORT in $PORTS; do
74
if [ "$FIR" != "false" ]; then
75
# The BIOS doesn't always activate the device. Prod it
76
echo disable >$x/resources;
77
echo activate >$x/resources;
80
if [ "$PORT" != "UNKNOWN" ]; then
81
# We should attempt to disable the UART. However, we need to store
82
# it - there's a chance that things could still go horribly wrong
83
UART=`setserial $PORT | sed 's/.*UART: \(.*\), Port.*/\1/'`
84
setserial $PORT uart none
86
modprobe $FIR $OPTIONS;
87
if [ "$?" = "0" ]; then
88
echo "irda$IRDA fir" >$STATEFILE;
93
if [ "$UART" != "undefined" ]; then
94
setserial $PORT uart $UART;
99
if [ "$SIR" = "true" -o "$FIR" != "false" ]; then
100
# We'll only have got here if the FIR module has failed
102
if [ "$PORT" != "UNKNOWN" ]; then
103
# The BIOS doesn't always activate the device. Prod it
104
echo disable >$x/resources;
105
echo activate >$x/resources;
107
# The IRQ is not always set correctly, so try to deal with that
108
IRQ=`grep irq $x/resources | sed -e 's/irq \(.*\)/\1/'`
109
setserial $PORT irq $IRQ;
110
echo "$PORT sir" >$STATEFILE;