From 6887fa041983903966cc0a6800cfd990ece871a0 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Tue, 26 Jun 2007 09:36:04 +0000 Subject: prism-firmware: added support of loading 1.8.4 firmware for Prism2/3 CF cards on insert (from Poky) 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. --- packages/misc-binary-only/prism-firmware.bb | 30 ++++++++++++++++++++ .../misc-binary-only/prism-firmware/.mtn2git_empty | 0 .../misc-binary-only/prism-firmware/hostap.rules | 4 +++ .../misc-binary-only/prism-firmware/prism-fw.sh | 33 ++++++++++++++++++++++ 4 files changed, 67 insertions(+) create mode 100644 packages/misc-binary-only/prism-firmware.bb create mode 100644 packages/misc-binary-only/prism-firmware/.mtn2git_empty create mode 100644 packages/misc-binary-only/prism-firmware/hostap.rules create mode 100644 packages/misc-binary-only/prism-firmware/prism-fw.sh (limited to 'packages') diff --git a/packages/misc-binary-only/prism-firmware.bb b/packages/misc-binary-only/prism-firmware.bb new file mode 100644 index 0000000000..4b18d865da --- /dev/null +++ b/packages/misc-binary-only/prism-firmware.bb @@ -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}" diff --git a/packages/misc-binary-only/prism-firmware/.mtn2git_empty b/packages/misc-binary-only/prism-firmware/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/misc-binary-only/prism-firmware/hostap.rules b/packages/misc-binary-only/prism-firmware/hostap.rules new file mode 100644 index 0000000000..dece98ae93 --- /dev/null +++ b/packages/misc-binary-only/prism-firmware/hostap.rules @@ -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" diff --git a/packages/misc-binary-only/prism-firmware/prism-fw.sh b/packages/misc-binary-only/prism-firmware/prism-fw.sh new file mode 100644 index 0000000000..c58600791c --- /dev/null +++ b/packages/misc-binary-only/prism-firmware/prism-fw.sh @@ -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 -- cgit v1.2.3 From 1a2f5e35fc5f0f94abade0c5722d3703f226718f Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Tue, 26 Jun 2007 09:36:40 +0000 Subject: prism3-firmware: dropped in favour of prism-firmware --- packages/misc-binary-only/prism3-firmware_1.8.3.bb | 27 ---------------------- packages/misc-binary-only/prism3-firmware_1.8.4.bb | 27 ---------------------- 2 files changed, 54 deletions(-) delete mode 100644 packages/misc-binary-only/prism3-firmware_1.8.3.bb delete mode 100644 packages/misc-binary-only/prism3-firmware_1.8.4.bb (limited to 'packages') diff --git a/packages/misc-binary-only/prism3-firmware_1.8.3.bb b/packages/misc-binary-only/prism3-firmware_1.8.3.bb deleted file mode 100644 index fb8f83afac..0000000000 --- a/packages/misc-binary-only/prism3-firmware_1.8.3.bb +++ /dev/null @@ -1,27 +0,0 @@ -DESCRIPTION = "Firmware for the Prism3 cards" -SECTION = "base" -LICENSE = "Unknown" -PR = "r3" - -SRC_URI = "http://www.red-bean.com/~proski/firmware/${PV}.tar.bz2 \ - http://www.red-bean.com/~proski/firmware/primary.tar.bz2" -S = "${WORKDIR}" - -do_install() { - install -d ${D}${sysconfdir}/pcmcia/ - install -m 0644 primary/pm010102.hex ${D}${sysconfdir}/pcmcia/ - install -m 0644 ${PV}/rf010803.hex ${D}${sysconfdir}/pcmcia/ - cat >${D}${sysconfdir}/pcmcia/README.prism3-firmware <> /etc/apm/suspend.d/ifdown - 3.) chmod a+rx /etc/apm/suspend.d/ifdown - 4.) echo -e "#!/bin/sh\nifup wlan0" >> /etc/apm/resume.d/ifup - 5.) chmod a+rx /etc/apm/suspend.d/ifup -EOF -} - -PACKAGE_ARCH = "all" - diff --git a/packages/misc-binary-only/prism3-firmware_1.8.4.bb b/packages/misc-binary-only/prism3-firmware_1.8.4.bb deleted file mode 100644 index 2983ea7710..0000000000 --- a/packages/misc-binary-only/prism3-firmware_1.8.4.bb +++ /dev/null @@ -1,27 +0,0 @@ -DESCRIPTION = "Firmware for the Prism3 cards" -SECTION = "base" -LICENSE = "Unknown" -PR = "r0" - -SRC_URI = "http://www.red-bean.com/~proski/firmware/${PV}.tar.bz2 \ - http://www.red-bean.com/~proski/firmware/primary.tar.bz2" -S = "${WORKDIR}" - -do_install() { - install -d ${D}${sysconfdir}/pcmcia/ - install -m 0644 primary/pm010102.hex ${D}${sysconfdir}/pcmcia/ - install -m 0644 ${PV}/rf010804.hex ${D}${sysconfdir}/pcmcia/ - cat >${D}${sysconfdir}/pcmcia/README.prism3-firmware <> /etc/apm/suspend.d/ifdown - 3.) chmod a+rx /etc/apm/suspend.d/ifdown - 4.) echo -e "#!/bin/sh\nifup wlan0" >> /etc/apm/resume.d/ifup - 5.) chmod a+rx /etc/apm/suspend.d/ifup -EOF -} - -PACKAGE_ARCH = "all" - -- cgit v1.2.3 From 615a9fb7e7cec4c64be696f697e5bc5948a10c29 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Tue, 26 Jun 2007 09:37:28 +0000 Subject: prism3-support: dropped in favour of prism-firmware --- packages/prism3-support/.mtn2git_empty | 0 packages/prism3-support/files/.mtn2git_empty | 0 packages/prism3-support/files/hostap-fw-load | 26 ------------------------- packages/prism3-support/prism3-support_1.0.0.bb | 15 -------------- 4 files changed, 41 deletions(-) delete mode 100644 packages/prism3-support/.mtn2git_empty delete mode 100644 packages/prism3-support/files/.mtn2git_empty delete mode 100644 packages/prism3-support/files/hostap-fw-load delete mode 100644 packages/prism3-support/prism3-support_1.0.0.bb (limited to 'packages') diff --git a/packages/prism3-support/.mtn2git_empty b/packages/prism3-support/.mtn2git_empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/prism3-support/files/.mtn2git_empty b/packages/prism3-support/files/.mtn2git_empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/prism3-support/files/hostap-fw-load b/packages/prism3-support/files/hostap-fw-load deleted file mode 100644 index 1f37aaf744..0000000000 --- a/packages/prism3-support/files/hostap-fw-load +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -# dont handle non-wireless interfaces -if [ -z "`grep $IFACE /proc/net/wireless`" ]; then - exit 0 -fi - -if test -e /sbin/cardctl; then - CARDCTL=/sbin/cardctl -elif test -e /sbin/pccardctl; then - CARDCTL=/sbin/pccardctl -else - exit 0 -fi - -# Special case for prism3 cards needing firmware upload -# Add more known manfids, if necessary - -if [ `$CARDCTL info|grep "d601,0010\|d601,0101"` ]; then - iwpriv "$IFACE" reset 1 - hostap_fw_load "$IFACE" -fi - -# lets hope that run-parts obeys the order :D - -exit 0 diff --git a/packages/prism3-support/prism3-support_1.0.0.bb b/packages/prism3-support/prism3-support_1.0.0.bb deleted file mode 100644 index bcf571e093..0000000000 --- a/packages/prism3-support/prism3-support_1.0.0.bb +++ /dev/null @@ -1,15 +0,0 @@ -DESCRIPTION = "meta-package for prism3 support through ifupdown and hostap_fw_load" -SECTION = "base" -LICENSE = "GPL" -DEPENDS = "prism3-firmware hostap-utils" -RDEPENDS = "prism3-firmware hostap-utils" -PACKAGE_ARCH = "all" -PR = "r5" - -SRC_URI = "file://hostap-fw-load" - -do_install() { - install -d ${D}${sysconfdir}/network/if-pre-up.d/ - install -m 0755 ${WORKDIR}/hostap-fw-load ${D}${sysconfdir}/network/if-pre-up.d/ -} - -- cgit v1.2.3 From 8bb87e16226fb6cfabacdc2ae7257003900a980a Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Tue, 26 Jun 2007 09:38:23 +0000 Subject: task-base: use prism-firmware instead of older ways of support for Prism2/3 cards (based on Poky work) --- packages/tasks/task-base.bb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'packages') diff --git a/packages/tasks/task-base.bb b/packages/tasks/task-base.bb index d89d781202..0c11eeedc1 100644 --- a/packages/tasks/task-base.bb +++ b/packages/tasks/task-base.bb @@ -1,5 +1,5 @@ DESCRIPTION = "Merge machine and distro options to create a basic machine task/package" -PR = "r36" +PR = "r37" DEPENDS = "task-boot" PROVIDES = "${PACKAGES}" @@ -196,8 +196,7 @@ RRECOMMENDS_task-base-alsa = "\ RDEPENDS_task-base-pcmcia = "\ ${PCMCIA_MANAGER} \ - ${@base_contains('DISTRO_FEATURES', 'wifi', 'prism3-firmware', '',d)} \ - ${@base_contains('DISTRO_FEATURES', 'wifi', 'prism3-support', '',d)} \ + ${@base_contains('DISTRO_FEATURES', 'wifi', 'prism-firmware', '',d)} \ ${@base_contains('DISTRO_FEATURES', 'wifi', 'spectrum-fw', '',d)} \ " -- cgit v1.2.3