prism-firmware: added support of loading 1.8.4 firmware for Prism2/3 CF cards on insert

This will give possibility of using WPA/WPA2 for users which cards have firmware
older then 1.7.4 (which was first version with WPA support).
It is alternative to reflashing cards.

Tested on Prism2 and Prism3 cards, replace all previous ways of supporting them.


git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1999 311d38ba-8fff-0310-9ca6-ca027cbcb966
This commit is contained in:
Marcin Juszkiewicz
2007-06-26 09:13:21 +00:00
parent 3abd842df0
commit 4816b77538
3 changed files with 67 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
DESCRIPTION = "Firmware for the Prism 2.x/3 cards"
SECTION = "base"
LICENSE = "closed"
RDEPENDS = "hostap-utils"
RREPLACES = "prism3-firmware prism3-support"
RCONFLICTS = "prism3-firmware prism3-support"
PACKAGE_ARCH = "all"
PR = "r1"
SRC_URI = "http://www.red-bean.com/~proski/firmware/Latest-prism.tar.bz2 \
file://prism-fw.sh \
file://hostap.rules"
S = "${WORKDIR}/Latest-prism/"
do_install() {
install -d ${D}${base_libdir}/firmware/
install -d ${D}${base_libdir}/udev/
install -d ${D}${sysconfdir}/pcmcia/
install -d ${D}${sysconfdir}/udev/rules.d/
install -m 0644 primary-RAM/*.hex ${D}${base_libdir}/firmware/
install -m 0644 secondary-RAM/rf010804.hex ${D}${base_libdir}/firmware/
install -m 0755 ${WORKDIR}/prism-fw.sh ${D}${base_libdir}/udev/
install -m 0644 ${WORKDIR}/hostap.rules ${D}${sysconfdir}/udev/rules.d/
}
PACKAGES = "${PN}"
FILES_${PN} += "${base_libdir}"

View File

@@ -0,0 +1,4 @@
#
# update firmware on Prism cards (load it to RAM, not to Flash)
#
SUBSYSTEM=="net", KERNEL=="wlan*" RUN="/lib/udev/prism-fw.sh"

View File

@@ -0,0 +1,33 @@
#!/bin/sh
CARD_ID=`/usr/sbin/hostap_diag $INTERFACE|grep NICID|awk '{print $2}'|sed -e 's/id=0x//'`
# 801d cards lack even Primary firmware so we cannot use hostap_diag
PRI=/lib/firmware/pm010102.hex
STA=/lib/firmware/rf010804.hex
if [ $CARD_ID = '800c' ] || [ $CARD_ID = '8013' ] || [ $CARD_ID = '8017' ] || \
[ $CARD_ID = '801b' ] || [ $CARD_ID = '8022' ] || [ $CARD_ID = '8023' ] ; then
PRI=/lib/firmware/ak010104.hex
elif [ $CARD_ID = '800b' ] || [ $CARD_ID = '8012' ] || [ $CARD_ID = '8016' ] || \
[ $CARD_ID = '801a' ] ; then
PRI=/lib/firmware/af010104.hex
elif [ $CARD_ID = '800e' ] || [ $CARD_ID = '8015' ] || [ $CARD_ID = '8019' ] || \
[ $CARD_ID = '801d' ] ; then
PRI=/lib/firmware/pm010102.hex
fi
DIR=/proc/net/hostap/wlan0
if [ ! -d $DIR ]; then
exit 1
fi
if grep -q no_pri=1 $DIR/debug; then
/usr/sbin/prism2_srec -gs wlan0 $PRI
/usr/sbin/prism2_srec -gp wlan0 $PRI
fi
if grep -q pri_only=0 $DIR/debug; then
/usr/sbin/prism2_srec -rp wlan0 $STA
fi