Richard Kennedy's udev patch. This allows FC5/USB to work properly, as

hotplug is officially deprecated.

This stuff probably applies to the new PCMCIA subsystem too, although 
prism2_cs won't build on >=2.6.16.
This commit is contained in:
solomon 2006-06-26 15:03:27 +00:00
parent ea88becf6f
commit 1c2388f60f
5 changed files with 36 additions and 2 deletions

View file

@ -41,6 +41,7 @@
* Intersil Corporation as part of PRISM(R) chipset product development.
*
* --------------------------------------------------------------------
- udev support for USB targets (Richard Kennedy)
- semaphores are deprecated as of 2.6.16 (Chris Rankin)
- prism2_usb build fix for 2.6.16
- Patches from Debian (via Victor Seva)

View file

@ -0,0 +1 @@
ACTION=="add",BUS=="usb",DRIVER=="prism2_usb" ,RUN+="/etc/wlan/wlan-udev.sh %k"

View file

@ -55,7 +55,7 @@ install:
if [ ! -f $(TARGET_ROOT_ON_HOST)/etc/wlan/wlan.conf ] ; then \
cp wlan.conf $(TARGET_ROOT_ON_HOST)/etc/wlan/wlan.conf ; \
fi
cp shared wlancfg-DEFAULT \
cp shared wlancfg-DEFAULT wlan-udev.sh \
$(TARGET_ROOT_ON_HOST)/etc/wlan
chmod 700 $(TARGET_ROOT_ON_HOST)/etc/wlan/wlancfg-*
echo FIRMWARE_DIR=$(FIRMWARE_DIR) >> $(TARGET_ROOT_ON_HOST)/etc/wlan/shared

View file

@ -49,12 +49,14 @@ if [ ! -n "$ECHO" ]; then
ECHO=echo
fi
if [ ! -n "$WLAN_UDEV" ] ; then
if [ -x /sbin/modprobe ] ; then
MODPROBE=/sbin/modprobe
else
${ECHO} "/sbin/modprobe not found."
exit 1
fi
fi
if [ -x /sbin/wlanctl-ng ] ; then
WLANCTL=/sbin/wlanctl-ng
@ -71,6 +73,7 @@ fi
# exit 1
#fi
if [ ! -n "$WLAN_UDEV" ] ; then
if [ -f /proc/sys/kernel/hotplug -a \
-x `cat /proc/sys/kernel/hotplug` -a \
-f /etc/hotplug/wlan.agent ] ; then
@ -78,6 +81,7 @@ if [ -f /proc/sys/kernel/hotplug -a \
else
HAS_HOTPLUG=n
fi
fi
# Source the wlan configuration
if [ -f /etc/wlan/wlan.conf ] ; then
@ -122,6 +126,9 @@ wlan_enable ()
#=======ENABLE IFSTATE=============================
# Bring the device into its operable state
# if running under udev module must be loaded to get here so skip checks
if [ ! -n "$WLAN_UDEV" ] ; then
$MODPROBE $1
# First, make sure the driver is loaded....
@ -132,7 +139,7 @@ wlan_enable ()
${ECHO} "the appropriate aliase(s)."
return 1
fi
fi
# Call the nsd script's fwload function, in case the card needs
# a firmware load, or could use an optional one.

25
etc/wlan/wlan-udev.sh Normal file
View file

@ -0,0 +1,25 @@
#! /bin/bash
# script to start prism2 wlan for fedora FC5 udev
#udev rule
#ACTION=="add",BUS=="usb",DRIVER=="prism2_usb",RUN+="/etc/wlan/wlan-udev.sh %k"
DEVICE=$1
WLAN_UDEV=1
. /etc/wlan/shared
wlan_bring_it_up $DEVICE $WLAN_WEXT
if [ $? = 0 ] ; then
echo $DEVICE start OK
#allow time during boot to let other things start
sleep 5
/sbin/ifup $DEVICE
else
echo $DEVICE failed to come up! >&2
exit 1
fi