diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2009-01-22 14:52:27 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2009-01-22 14:52:27 +0000 |
commit | a0c3da6d61efd0c39c4728f710e2037b2f60faff (patch) | |
tree | ef7465220fe9d7f4a3b9c48182cd104fb12241e3 /package/mac80211/patches | |
parent | cfd684128b77f48e33030a8bd40a6073149f24ba (diff) | |
download | upstream-a0c3da6d61efd0c39c4728f710e2037b2f60faff.tar.gz upstream-a0c3da6d61efd0c39c4728f710e2037b2f60faff.tar.bz2 upstream-a0c3da6d61efd0c39c4728f710e2037b2f60faff.zip |
mac80211: update compat-wireless to 2009-01-19
SVN-Revision: 14145
Diffstat (limited to 'package/mac80211/patches')
34 files changed, 1538 insertions, 2132 deletions
diff --git a/package/mac80211/patches/210-remove_unused_stuff.patch b/package/mac80211/patches/210-remove_unused_stuff.patch index 277cf0d8d1..6a7ed86f2f 100644 --- a/package/mac80211/patches/210-remove_unused_stuff.patch +++ b/package/mac80211/patches/210-remove_unused_stuff.patch @@ -1,68 +1,67 @@ --- a/config.mk +++ b/config.mk -@@ -69,10 +69,10 @@ CONFIG_MAC80211_LEDS=y - CONFIG_MAC80211_MESH=y - +@@ -72,10 +72,10 @@ CONFIG_MAC80211_MESH=y CONFIG_CFG80211=m + # CONFIG_CFG80211_REG_DEBUG is not set + -CONFIG_LIB80211=m -CONFIG_LIB80211_CRYPT_WEP=m -CONFIG_LIB80211_CRYPT_CCMP=m -CONFIG_LIB80211_CRYPT_TKIP=m -+#CONFIG_LIB80211=m -+#CONFIG_LIB80211_CRYPT_WEP=m -+#CONFIG_LIB80211_CRYPT_CCMP=m -+#CONFIG_LIB80211_CRYPT_TKIP=m ++# CONFIG_LIB80211=m ++# CONFIG_LIB80211_CRYPT_WEP=m ++# CONFIG_LIB80211_CRYPT_CCMP=m ++# CONFIG_LIB80211_CRYPT_TKIP=m CONFIG_NL80211=y - # We'll disable this as soon major distributions -@@ -101,14 +101,14 @@ CONFIG_B43=m - # B43 uses PCMCIA only for Compact Flash. The Cardbus cards uses PCI - # Example, bcm4318: - # http://www.multicap.biz/wireless-lan/indoor-wlan-hardware/sdc-cf10g-80211g-compact-flash-module --CONFIG_B43_PCMCIA=y -+#CONFIG_B43_PCMCIA=y - CONFIG_B43_PIO=y - # B43_PIO selects SSB_BLOCKIO - CONFIG_SSB_BLOCKIO=y + +@@ -115,16 +115,16 @@ CONFIG_IWL3945_LEDS=y + CONFIG_B43=m CONFIG_B43_PCI_AUTOSELECT=y CONFIG_B43_PCICORE_AUTOSELECT=y - #CONFIG_B43_RFKILL=n +-CONFIG_B43_PCMCIA=y ++# CONFIG_B43_PCMCIA=y + CONFIG_B43_PIO=y -CONFIG_B43_LEDS=y -+#CONFIG_B43_LEDS=y ++# CONFIG_B43_LEDS=y + # CONFIG_B43_RFKILL=y # CONFIG_B43_DEBUG is not set CONFIG_B43LEGACY=m -@@ -119,13 +119,13 @@ CONFIG_B43LEGACY_PIO=y - CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y + CONFIG_B43LEGACY_PCI_AUTOSELECT=y + CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y +-CONFIG_B43LEGACY_LEDS=y ++# CONFIG_B43LEGACY_LEDS=y + # CONFIG_B43LEGACY_RFKILL=y + # CONFIG_B43LEGACY_DEBUG=y + CONFIG_B43LEGACY_DMA=y +@@ -134,17 +134,17 @@ CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y + # CONFIG_B43LEGACY_PIO_MODE is not set # The Intel ipws -CONFIG_LIBIPW=m ++# CONFIG_LIBIPW=m + # CONFIG_LIBIPW_DEBUG is not set + -CONFIG_IPW2100=m -CONFIG_IPW2100_MONITOR=y ++# CONFIG_IPW2100=m ++# CONFIG_IPW2100_MONITOR=y + # CONFIG_IPW2100_DEBUG is not set -CONFIG_IPW2200=m -CONFIG_IPW2200_MONITOR=y -CONFIG_IPW2200_RADIOTAP=y -CONFIG_IPW2200_PROMISCUOUS=y -+#CONFIG_LIBIPW=m -+#CONFIG_IPW2100=m -+#CONFIG_IPW2100_MONITOR=y -+#CONFIG_IPW2200=m -+#CONFIG_IPW2200_MONITOR=y -+#CONFIG_IPW2200_RADIOTAP=y -+#CONFIG_IPW2200_PROMISCUOUS=y +-CONFIG_IPW2200_QOS=y ++# CONFIG_IPW2200=m ++# CONFIG_IPW2200_MONITOR=y ++# CONFIG_IPW2200_RADIOTAP=y ++# CONFIG_IPW2200_PROMISCUOUS=y ++# CONFIG_IPW2200_QOS=y + # CONFIG_IPW2200_DEBUG is not set # The above enables use a second interface prefixed 'rtap'. # Example usage: - # -@@ -138,7 +138,7 @@ CONFIG_IPW2200_PROMISCUOUS=y - # it on via sysfs: - # - # % echo 1 > /sys/bus/pci/drivers/ipw2200/*/rtap_iface --CONFIG_IPW2200_QOS=y -+#CONFIG_IPW2200_QOS=y - - CONFIG_P54_PCI=m - -@@ -239,15 +239,15 @@ CONFIG_SSB_PCICORE_HOSTMODE=n +@@ -266,15 +266,15 @@ CONFIG_SSB_SPROM=y ifneq ($(CONFIG_USB),) ifneq ($(CONFIG_LIBERTAS_THINFIRM_USB),m) CONFIG_LIBERTAS_USB=m diff --git a/package/mac80211/patches/304-rt2x00-Update-copyright-year-to-2009.patch b/package/mac80211/patches/304-rt2x00-Update-copyright-year-to-2009.patch new file mode 100644 index 0000000000..66eb553ba3 --- /dev/null +++ b/package/mac80211/patches/304-rt2x00-Update-copyright-year-to-2009.patch @@ -0,0 +1,319 @@ +From 9b9917b3acb758bb72c0e59b3f5b884ad6aec8cd Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 10 Jan 2009 14:03:40 +0100 +Subject: [PATCH] rt2x00: Update copyright year to 2009 + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2400pci.c | 2 +- + drivers/net/wireless/rt2x00/rt2400pci.h | 2 +- + drivers/net/wireless/rt2x00/rt2500pci.c | 2 +- + drivers/net/wireless/rt2x00/rt2500pci.h | 2 +- + drivers/net/wireless/rt2x00/rt2500usb.c | 2 +- + drivers/net/wireless/rt2x00/rt2500usb.h | 2 +- + drivers/net/wireless/rt2x00/rt2x00.h | 2 +- + drivers/net/wireless/rt2x00/rt2x00config.c | 2 +- + drivers/net/wireless/rt2x00/rt2x00crypto.c | 2 +- + drivers/net/wireless/rt2x00/rt2x00debug.c | 2 +- + drivers/net/wireless/rt2x00/rt2x00debug.h | 2 +- + drivers/net/wireless/rt2x00/rt2x00dev.c | 2 +- + drivers/net/wireless/rt2x00/rt2x00dump.h | 2 +- + drivers/net/wireless/rt2x00/rt2x00firmware.c | 2 +- + drivers/net/wireless/rt2x00/rt2x00leds.c | 2 +- + drivers/net/wireless/rt2x00/rt2x00leds.h | 2 +- + drivers/net/wireless/rt2x00/rt2x00lib.h | 2 +- + drivers/net/wireless/rt2x00/rt2x00link.c | 2 +- + drivers/net/wireless/rt2x00/rt2x00mac.c | 2 +- + drivers/net/wireless/rt2x00/rt2x00pci.c | 2 +- + drivers/net/wireless/rt2x00/rt2x00pci.h | 2 +- + drivers/net/wireless/rt2x00/rt2x00queue.c | 2 +- + drivers/net/wireless/rt2x00/rt2x00queue.h | 2 +- + drivers/net/wireless/rt2x00/rt2x00reg.h | 2 +- + drivers/net/wireless/rt2x00/rt2x00rfkill.c | 2 +- + drivers/net/wireless/rt2x00/rt2x00usb.c | 2 +- + drivers/net/wireless/rt2x00/rt2x00usb.h | 2 +- + drivers/net/wireless/rt2x00/rt61pci.c | 2 +- + drivers/net/wireless/rt2x00/rt61pci.h | 2 +- + drivers/net/wireless/rt2x00/rt73usb.c | 2 +- + drivers/net/wireless/rt2x00/rt73usb.h | 2 +- + 31 files changed, 31 insertions(+), 31 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2400pci.c ++++ b/drivers/net/wireless/rt2x00/rt2400pci.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2400pci.h ++++ b/drivers/net/wireless/rt2x00/rt2400pci.h +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2500pci.c ++++ b/drivers/net/wireless/rt2x00/rt2500pci.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2500pci.h ++++ b/drivers/net/wireless/rt2x00/rt2500pci.h +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2500usb.c ++++ b/drivers/net/wireless/rt2x00/rt2500usb.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2500usb.h ++++ b/drivers/net/wireless/rt2x00/rt2500usb.h +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00.h ++++ b/drivers/net/wireless/rt2x00/rt2x00.h +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00config.c ++++ b/drivers/net/wireless/rt2x00/rt2x00config.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00crypto.c ++++ b/drivers/net/wireless/rt2x00/rt2x00crypto.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00debug.c ++++ b/drivers/net/wireless/rt2x00/rt2x00debug.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00debug.h ++++ b/drivers/net/wireless/rt2x00/rt2x00debug.h +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00dev.c ++++ b/drivers/net/wireless/rt2x00/rt2x00dev.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00dump.h ++++ b/drivers/net/wireless/rt2x00/rt2x00dump.h +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00firmware.c ++++ b/drivers/net/wireless/rt2x00/rt2x00firmware.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00leds.c ++++ b/drivers/net/wireless/rt2x00/rt2x00leds.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00leds.h ++++ b/drivers/net/wireless/rt2x00/rt2x00leds.h +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00lib.h ++++ b/drivers/net/wireless/rt2x00/rt2x00lib.h +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00link.c ++++ b/drivers/net/wireless/rt2x00/rt2x00link.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00mac.c ++++ b/drivers/net/wireless/rt2x00/rt2x00mac.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00pci.c ++++ b/drivers/net/wireless/rt2x00/rt2x00pci.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00pci.h ++++ b/drivers/net/wireless/rt2x00/rt2x00pci.h +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00queue.c ++++ b/drivers/net/wireless/rt2x00/rt2x00queue.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00queue.h ++++ b/drivers/net/wireless/rt2x00/rt2x00queue.h +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00reg.h ++++ b/drivers/net/wireless/rt2x00/rt2x00reg.h +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00rfkill.c ++++ b/drivers/net/wireless/rt2x00/rt2x00rfkill.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00usb.c ++++ b/drivers/net/wireless/rt2x00/rt2x00usb.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2x00usb.h ++++ b/drivers/net/wireless/rt2x00/rt2x00usb.h +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt61pci.c ++++ b/drivers/net/wireless/rt2x00/rt61pci.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt61pci.h ++++ b/drivers/net/wireless/rt2x00/rt61pci.h +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt73usb.c ++++ b/drivers/net/wireless/rt2x00/rt73usb.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt73usb.h ++++ b/drivers/net/wireless/rt2x00/rt73usb.h +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify diff --git a/package/mac80211/patches/305-rt2x00-Update-rt2x00ht.patch b/package/mac80211/patches/305-rt2x00-Update-rt2x00ht.patch new file mode 100644 index 0000000000..24a5572331 --- /dev/null +++ b/package/mac80211/patches/305-rt2x00-Update-rt2x00ht.patch @@ -0,0 +1,19 @@ +From 8447ae720ac565d9c521e0c295705179d8876959 Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 10 Jan 2009 14:04:34 +0100 +Subject: [PATCH] rt2x00: Update rt2x00ht + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2x00ht.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2x00ht.c ++++ b/drivers/net/wireless/rt2x00/rt2x00ht.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify diff --git a/package/mac80211/patches/306-rt2x00-Update-rt2800pci.patch b/package/mac80211/patches/306-rt2x00-Update-rt2800pci.patch new file mode 100644 index 0000000000..00a65bce6b --- /dev/null +++ b/package/mac80211/patches/306-rt2x00-Update-rt2800pci.patch @@ -0,0 +1,29 @@ +From eb419a370a4c87fae945950442e4f7609aea952c Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 10 Jan 2009 14:05:01 +0100 +Subject: [PATCH] rt2x00: Update rt2800pci + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800pci.c | 2 +- + drivers/net/wireless/rt2x00/rt2800pci.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800pci.c ++++ b/drivers/net/wireless/rt2x00/rt2800pci.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2800pci.h ++++ b/drivers/net/wireless/rt2x00/rt2800pci.h +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify diff --git a/package/mac80211/patches/307-rt2x00-Update-rt2800usb.patch b/package/mac80211/patches/307-rt2x00-Update-rt2800usb.patch new file mode 100644 index 0000000000..73db3640ec --- /dev/null +++ b/package/mac80211/patches/307-rt2x00-Update-rt2800usb.patch @@ -0,0 +1,29 @@ +From 1d5b075d27b109fc7a6b6a67e60754e2862b2d6b Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 10 Jan 2009 14:05:21 +0100 +Subject: [PATCH] rt2x00: Update rt2800usb + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800usb.c | 2 +- + drivers/net/wireless/rt2x00/rt2800usb.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800usb.c ++++ b/drivers/net/wireless/rt2x00/rt2800usb.c +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify +--- a/drivers/net/wireless/rt2x00/rt2800usb.h ++++ b/drivers/net/wireless/rt2x00/rt2800usb.h +@@ -1,5 +1,5 @@ + /* +- Copyright (C) 2004 - 2008 rt2x00 SourceForge Project ++ Copyright (C) 2004 - 2009 rt2x00 SourceForge Project + <http://rt2x00.serialmonkey.com> + + This program is free software; you can redistribute it and/or modify diff --git a/package/mac80211/patches/308-rt2x00-Add-powersaving-support-rt2800pci.patch b/package/mac80211/patches/308-rt2x00-Add-powersaving-support-rt2800pci.patch new file mode 100644 index 0000000000..583c2d9ecc --- /dev/null +++ b/package/mac80211/patches/308-rt2x00-Add-powersaving-support-rt2800pci.patch @@ -0,0 +1,69 @@ +From 059fef55f609bded8e83ec8b54729a2f500db938 Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 10 Jan 2009 14:29:21 +0100 +Subject: [PATCH] rt2x00: Add powersaving support (rt2800pci) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800pci.c | 36 ++++++++++++++++++++++++++++++- + 1 files changed, 35 insertions(+), 1 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800pci.c ++++ b/drivers/net/wireless/rt2x00/rt2800pci.c +@@ -880,6 +880,36 @@ static void rt2800pci_config_duration(st + rt2x00pci_register_write(rt2x00dev, BCN_TIME_CFG, reg); + } + ++static void rt2800pci_config_ps(struct rt2x00_dev *rt2x00dev, ++ struct rt2x00lib_conf *libconf) ++{ ++ enum dev_state state = ++ (libconf->conf->flags & IEEE80211_CONF_PS) ? ++ STATE_SLEEP : STATE_AWAKE; ++ u32 reg; ++ ++ if (state == STATE_SLEEP) { ++ rt2x00pci_register_write(rt2x00dev, AUTOWAKEUP_CFG, 0); ++ ++ rt2x00pci_register_read(rt2x00dev, AUTOWAKEUP_CFG, ®); ++ rt2x00_set_field32(®, AUTOWAKEUP_CFG_AUTO_LEAD_TIME, 5); ++ rt2x00_set_field32(®, AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE, ++ libconf->conf->listen_interval - 1); ++ rt2x00_set_field32(®, AUTOWAKEUP_CFG_AUTOWAKE, 1); ++ rt2x00pci_register_write(rt2x00dev, AUTOWAKEUP_CFG, reg); ++ ++ rt2800pci_mcu_request(rt2x00dev, MCU_SLEEP, 0xff, 0, 0); ++ } else { ++ rt2800pci_mcu_request(rt2x00dev, MCU_WAKEUP, 0xff, 0, 0); ++ ++ rt2x00pci_register_read(rt2x00dev, AUTOWAKEUP_CFG, ®); ++ rt2x00_set_field32(®, AUTOWAKEUP_CFG_AUTO_LEAD_TIME, 0); ++ rt2x00_set_field32(®, AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE, 0); ++ rt2x00_set_field32(®, AUTOWAKEUP_CFG_AUTOWAKE, 0); ++ rt2x00pci_register_write(rt2x00dev, AUTOWAKEUP_CFG, reg); ++ } ++} ++ + static void rt2800pci_config(struct rt2x00_dev *rt2x00dev, + struct rt2x00lib_conf *libconf, + const unsigned int flags) +@@ -896,6 +926,8 @@ static void rt2800pci_config(struct rt2x + rt2800pci_config_retry_limit(rt2x00dev, libconf); + if (flags & IEEE80211_CONF_CHANGE_BEACON_INTERVAL) + rt2800pci_config_duration(rt2x00dev, libconf); ++ if (flags & IEEE80211_CONF_CHANGE_PS) ++ rt2800pci_config_ps(rt2x00dev, libconf); + } + + /* +@@ -2346,7 +2378,9 @@ static int rt2800pci_probe_hw_mode(struc + */ + rt2x00dev->hw->flags = + IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | +- IEEE80211_HW_SIGNAL_DBM; ++ IEEE80211_HW_SIGNAL_DBM | ++ IEEE80211_HW_SUPPORTS_PS | ++ IEEE80211_HW_PS_NULLFUNC_STACK; + rt2x00dev->hw->extra_tx_headroom = TXWI_DESC_SIZE; + + SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); diff --git a/package/mac80211/patches/309-rt2x00-Add-powersaving-support-rt2800usb.patch b/package/mac80211/patches/309-rt2x00-Add-powersaving-support-rt2800usb.patch new file mode 100644 index 0000000000..2b7dcc7b9b --- /dev/null +++ b/package/mac80211/patches/309-rt2x00-Add-powersaving-support-rt2800usb.patch @@ -0,0 +1,69 @@ +From fa9b7fc2e662e086a7c0e045e541f773bf34c555 Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 10 Jan 2009 14:31:00 +0100 +Subject: [PATCH] rt2x00: Add powersaving support (rt2800usb) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800usb.c | 36 ++++++++++++++++++++++++++++++- + 1 files changed, 35 insertions(+), 1 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800usb.c ++++ b/drivers/net/wireless/rt2x00/rt2800usb.c +@@ -860,6 +860,36 @@ static void rt2800usb_config_duration(st + rt2x00usb_register_write(rt2x00dev, BCN_TIME_CFG, reg); + } + ++static void rt2800usb_config_ps(struct rt2x00_dev *rt2x00dev, ++ struct rt2x00lib_conf *libconf) ++{ ++ enum dev_state state = ++ (libconf->conf->flags & IEEE80211_CONF_PS) ? ++ STATE_SLEEP : STATE_AWAKE; ++ u32 reg; ++ ++ if (state == STATE_SLEEP) { ++ rt2x00usb_register_write(rt2x00dev, AUTOWAKEUP_CFG, 0); ++ ++ rt2x00usb_register_read(rt2x00dev, AUTOWAKEUP_CFG, ®); ++ rt2x00_set_field32(®, AUTOWAKEUP_CFG_AUTO_LEAD_TIME, 5); ++ rt2x00_set_field32(®, AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE, ++ libconf->conf->listen_interval - 1); ++ rt2x00_set_field32(®, AUTOWAKEUP_CFG_AUTOWAKE, 1); ++ rt2x00usb_register_write(rt2x00dev, AUTOWAKEUP_CFG, reg); ++ ++ rt2800usb_mcu_request(rt2x00dev, MCU_SLEEP, 0xff, 0, 0); ++ } else { ++ rt2800usb_mcu_request(rt2x00dev, MCU_WAKEUP, 0xff, 0, 0); ++ ++ rt2x00usb_register_read(rt2x00dev, AUTOWAKEUP_CFG, ®); ++ rt2x00_set_field32(®, AUTOWAKEUP_CFG_AUTO_LEAD_TIME, 0); ++ rt2x00_set_field32(®, AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE, 0); ++ rt2x00_set_field32(®, AUTOWAKEUP_CFG_AUTOWAKE, 0); ++ rt2x00usb_register_write(rt2x00dev, AUTOWAKEUP_CFG, reg); ++ } ++} ++ + static void rt2800usb_config(struct rt2x00_dev *rt2x00dev, + struct rt2x00lib_conf *libconf, + const unsigned int flags) +@@ -876,6 +906,8 @@ static void rt2800usb_config(struct rt2x + rt2800usb_config_retry_limit(rt2x00dev, libconf); + if (flags & IEEE80211_CONF_CHANGE_BEACON_INTERVAL) + rt2800usb_config_duration(rt2x00dev, libconf); ++ if (flags & IEEE80211_CONF_CHANGE_PS) ++ rt2800usb_config_ps(rt2x00dev, libconf); + } + + /* +@@ -2112,7 +2144,9 @@ static int rt2800usb_probe_hw_mode(struc + */ + rt2x00dev->hw->flags = + IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | +- IEEE80211_HW_SIGNAL_DBM; ++ IEEE80211_HW_SIGNAL_DBM | ++ IEEE80211_HW_SUPPORTS_PS | ++ IEEE80211_HW_PS_NULLFUNC_STACK; + rt2x00dev->hw->extra_tx_headroom = TXD_DESC_SIZE + TXINFO_DESC_SIZE; + + SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); diff --git a/package/mac80211/patches/310-rt2x00-Accept-beacons-in-normal-mode-rt2800pci.patch b/package/mac80211/patches/310-rt2x00-Accept-beacons-in-normal-mode-rt2800pci.patch new file mode 100644 index 0000000000..06d242adea --- /dev/null +++ b/package/mac80211/patches/310-rt2x00-Accept-beacons-in-normal-mode-rt2800pci.patch @@ -0,0 +1,22 @@ +From 7191a5e338105009714415358773c828bbe90bb9 Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 10 Jan 2009 14:50:44 +0100 +Subject: [PATCH] rt2x00: Accept beacons in normal mode (rt2800pci) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800pci.c | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800pci.c ++++ b/drivers/net/wireless/rt2x00/rt2800pci.c +@@ -467,8 +467,7 @@ static void rt2800pci_config_filter(stru + !(filter_flags & FIF_PLCPFAIL)); + rt2x00_set_field32(®, RX_FILTER_CFG_DROP_NOT_TO_ME, + !(filter_flags & FIF_PROMISC_IN_BSS)); +- rt2x00_set_field32(®, RX_FILTER_CFG_DROP_NOT_MY_BSSD, +- !(filter_flags & FIF_OTHER_BSS)); ++ rt2x00_set_field32(®, RX_FILTER_CFG_DROP_NOT_MY_BSSD, 0); + rt2x00_set_field32(®, RX_FILTER_CFG_DROP_VER_ERROR, 1); + rt2x00_set_field32(®, RX_FILTER_CFG_DROP_MULTICAST, + !(filter_flags & FIF_ALLMULTI)); diff --git a/package/mac80211/patches/311-rt2x00-Accept-beacons-in-normal-mode-rt2800usb.patch b/package/mac80211/patches/311-rt2x00-Accept-beacons-in-normal-mode-rt2800usb.patch new file mode 100644 index 0000000000..674ee003c1 --- /dev/null +++ b/package/mac80211/patches/311-rt2x00-Accept-beacons-in-normal-mode-rt2800usb.patch @@ -0,0 +1,22 @@ +From 6a27df44711605e730a92b1029fe54d6c988ed13 Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 10 Jan 2009 14:51:24 +0100 +Subject: [PATCH] rt2x00: Accept beacons in normal mode (rt2800usb) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800usb.c | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800usb.c ++++ b/drivers/net/wireless/rt2x00/rt2800usb.c +@@ -447,8 +447,7 @@ static void rt2800usb_config_filter(stru + !(filter_flags & FIF_PLCPFAIL)); + rt2x00_set_field32(®, RX_FILTER_CFG_DROP_NOT_TO_ME, + !(filter_flags & FIF_PROMISC_IN_BSS)); +- rt2x00_set_field32(®, RX_FILTER_CFG_DROP_NOT_MY_BSSD, +- !(filter_flags & FIF_OTHER_BSS)); ++ rt2x00_set_field32(®, RX_FILTER_CFG_DROP_NOT_MY_BSSD, 0); + rt2x00_set_field32(®, RX_FILTER_CFG_DROP_VER_ERROR, 1); + rt2x00_set_field32(®, RX_FILTER_CFG_DROP_MULTICAST, + !(filter_flags & FIF_ALLMULTI)); diff --git a/package/mac80211/patches/312-rt2x00-Fix-TX-descriptor-usage-rt2800usb.patch b/package/mac80211/patches/312-rt2x00-Fix-TX-descriptor-usage-rt2800usb.patch new file mode 100644 index 0000000000..897a62e829 --- /dev/null +++ b/package/mac80211/patches/312-rt2x00-Fix-TX-descriptor-usage-rt2800usb.patch @@ -0,0 +1,112 @@ +From e9a3a3b9744f0204ec4beec8f9bea3c11ce6f54b Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 10 Jan 2009 19:21:46 +0100 +Subject: [PATCH] rt2x00: Fix TX descriptor usage (rt2800usb) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800usb.c | 46 ++++++++++--------------------- + drivers/net/wireless/rt2x00/rt2800usb.h | 1 + + 2 files changed, 16 insertions(+), 31 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800usb.c ++++ b/drivers/net/wireless/rt2x00/rt2800usb.c +@@ -1635,8 +1635,8 @@ static void rt2800usb_write_tx_desc(stru + struct txentry_desc *txdesc) + { + struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); +- __le32 *txd = skbdesc->desc; +- __le32 *txwi = txd + TXD_DESC_SIZE; ++ __le32 *txi = skbdesc->desc; ++ __le32 *txwi = txi + TXINFO_DESC_SIZE; + u32 word; + + /* +@@ -1683,31 +1683,15 @@ static void rt2800usb_write_tx_desc(stru + /* + * Initialize TX descriptor + */ +- rt2x00_desc_read(txd, 0, &word); +- rt2x00_set_field32(&word, TXD_W0_SD_PTR0, skbdesc->skb_dma); +- rt2x00_desc_write(txd, 0, word); +- +- rt2x00_desc_read(txd, 1, &word); +- rt2x00_set_field32(&word, TXD_W1_SD_LEN1, skb->len); +- rt2x00_set_field32(&word, TXD_W1_LAST_SEC1, 1); +- rt2x00_set_field32(&word, TXD_W1_BURST, ++ rt2x00_desc_read(txi, 0, &word); ++ rt2x00_set_field32(&word, TXINFO_W0_USB_DMA_TX_PKT_LEN, skb->len); ++ rt2x00_set_field32(&word, TXINFO_W0_WIV, 1); ++ rt2x00_set_field32(&word, TXINFO_W0_QSEL, 2); ++ rt2x00_set_field32(&word, TXINFO_W0_SW_USE_LAST_ROUND, 0); ++ rt2x00_set_field32(&word, TXINFO_W0_USB_DMA_NEXT_VALID, 0); ++ rt2x00_set_field32(&word, TXINFO_W0_USB_DMA_TX_BURST, + test_bit(ENTRY_TXD_BURST, &txdesc->flags)); +- rt2x00_set_field32(&word, TXD_W1_SD_LEN0, +- rt2x00dev->hw->extra_tx_headroom); +- rt2x00_set_field32(&word, TXD_W1_LAST_SEC0, +- !test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); +- rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 0); +- rt2x00_desc_write(txd, 1, word); +- +- rt2x00_desc_read(txd, 2, &word); +- rt2x00_set_field32(&word, TXD_W2_SD_PTR1, +- skbdesc->skb_dma + rt2x00dev->hw->extra_tx_headroom); +- rt2x00_desc_write(txd, 2, word); +- +- rt2x00_desc_read(txd, 3, &word); +- rt2x00_set_field32(&word, TXD_W3_WIV, 1); +- rt2x00_set_field32(&word, TXD_W3_QSEL, 2); +- rt2x00_desc_write(txd, 3, word); ++ rt2x00_desc_write(txi, 0, word); + } + + /* +@@ -1881,9 +1865,9 @@ static void rt2800usb_fill_rxdone(struct + rxdesc->size = rt2x00_get_field32(rxwi0, RXWI_W0_MPDU_TOTAL_BYTE_COUNT); + + /* +- * Remove TXWI descriptor from start of buffer. ++ * Remove RXWI descriptor from start of buffer. + */ +- skb_pull(entry->skb, TXWI_DESC_SIZE + skbdesc->desc_len); ++ skb_pull(entry->skb, RXWI_DESC_SIZE + skbdesc->desc_len); + skb_trim(entry->skb, rxdesc->size); + } + +@@ -2146,7 +2130,7 @@ static int rt2800usb_probe_hw_mode(struc + IEEE80211_HW_SIGNAL_DBM | + IEEE80211_HW_SUPPORTS_PS | + IEEE80211_HW_PS_NULLFUNC_STACK; +- rt2x00dev->hw->extra_tx_headroom = TXD_DESC_SIZE + TXINFO_DESC_SIZE; ++ rt2x00dev->hw->extra_tx_headroom = TXINFO_DESC_SIZE + TXWI_DESC_SIZE; + + SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); + SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, +@@ -2445,14 +2429,14 @@ static const struct data_queue_desc rt28 + static const struct data_queue_desc rt2800usb_queue_tx = { + .entry_num = TX_ENTRIES, + .data_size = DATA_FRAME_SIZE, +- .desc_size = TXD_DESC_SIZE, ++ .desc_size = TXINFO_DESC_SIZE + TXWI_DESC_SIZE, + .priv_size = sizeof(struct queue_entry_priv_usb), + }; + + static const struct data_queue_desc rt2800usb_queue_bcn = { + .entry_num = 8 * BEACON_ENTRIES, + .data_size = MGMT_FRAME_SIZE, +- .desc_size = TXWI_DESC_SIZE, ++ .desc_size = TXINFO_DESC_SIZE + TXWI_DESC_SIZE, + .priv_size = sizeof(struct queue_entry_priv_usb), + }; + +--- a/drivers/net/wireless/rt2x00/rt2800usb.h ++++ b/drivers/net/wireless/rt2x00/rt2800usb.h +@@ -1744,6 +1744,7 @@ struct hw_key_entry { + #define TXINFO_W0_USB_DMA_TX_PKT_LEN FIELD32(0x0000ffff) + #define TXINFO_W0_WIV FIELD32(0x01000000) + #define TXINFO_W0_QSEL FIELD32(0x06000000) ++#define TXINFO_W0_SW_USE_LAST_ROUND FIELD32(0x08000000) + #define TXINFO_W0_USB_DMA_NEXT_VALID FIELD32(0x40000000) + #define TXINFO_W0_USB_DMA_TX_BURST FIELD32(0x80000000) + diff --git a/package/mac80211/patches/313-rt2x00-Add-TXWI-to-DMA-size-rt2800usb.patch b/package/mac80211/patches/313-rt2x00-Add-TXWI-to-DMA-size-rt2800usb.patch new file mode 100644 index 0000000000..1ccae4d895 --- /dev/null +++ b/package/mac80211/patches/313-rt2x00-Add-TXWI-to-DMA-size-rt2800usb.patch @@ -0,0 +1,22 @@ +From fa9b5f135ba5e7877d1e3e970d39fcfa07f4004b Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 10 Jan 2009 20:07:13 +0100 +Subject: [PATCH] rt2x00: Add TXWI to DMA size (rt2800usb) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800usb.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800usb.c ++++ b/drivers/net/wireless/rt2x00/rt2800usb.c +@@ -1684,7 +1684,8 @@ static void rt2800usb_write_tx_desc(stru + * Initialize TX descriptor + */ + rt2x00_desc_read(txi, 0, &word); +- rt2x00_set_field32(&word, TXINFO_W0_USB_DMA_TX_PKT_LEN, skb->len); ++ rt2x00_set_field32(&word, TXINFO_W0_USB_DMA_TX_PKT_LEN, ++ roundup(skb->len + TXWI_DESC_SIZE, 4)); + rt2x00_set_field32(&word, TXINFO_W0_WIV, 1); + rt2x00_set_field32(&word, TXINFO_W0_QSEL, 2); + rt2x00_set_field32(&word, TXINFO_W0_SW_USE_LAST_ROUND, 0); diff --git a/package/mac80211/patches/314-rt2x00-Wait-for-WPDMA-between-CRS-and-BBP-init-rt2.patch b/package/mac80211/patches/314-rt2x00-Wait-for-WPDMA-between-CRS-and-BBP-init-rt2.patch new file mode 100644 index 0000000000..43ed0c28d6 --- /dev/null +++ b/package/mac80211/patches/314-rt2x00-Wait-for-WPDMA-between-CRS-and-BBP-init-rt2.patch @@ -0,0 +1,30 @@ +From 827feb9f680fff5a4f1e04740357ea2c92e10b06 Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Tue, 13 Jan 2009 21:29:37 +0100 +Subject: [PATCH] rt2x00: Wait for WPDMA between CRS and BBP init (rt2800pci) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800pci.c | 4 +--- + 1 files changed, 1 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800pci.c ++++ b/drivers/net/wireless/rt2x00/rt2800pci.c +@@ -1622,6 +1622,7 @@ static int rt2800pci_enable_radio(struct + if (unlikely(rt2800pci_wait_wpdma_ready(rt2x00dev) || + rt2800pci_init_queues(rt2x00dev) || + rt2800pci_init_registers(rt2x00dev) || ++ rt2800pci_wait_wpdma_ready(rt2x00dev) || + rt2800pci_init_bbp(rt2x00dev))) + return -EIO; + +@@ -1630,9 +1631,6 @@ static int rt2800pci_enable_radio(struct + */ + rt2800pci_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0xff, 0, 0); + +- /* Wait for DMA, ignore error */ +- rt2800pci_wait_wpdma_ready(rt2x00dev); +- + /* + * Enable RX. + */ diff --git a/package/mac80211/patches/316-rt2x00-Fix-register-initialization-rt2800pci.patch b/package/mac80211/patches/316-rt2x00-Fix-register-initialization-rt2800pci.patch new file mode 100644 index 0000000000..0f45cf9c49 --- /dev/null +++ b/package/mac80211/patches/316-rt2x00-Fix-register-initialization-rt2800pci.patch @@ -0,0 +1,55 @@ +From c3a42af4455fd75735c218ffac392ef86a3a250f Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 17 Jan 2009 19:18:38 +0100 +Subject: [PATCH] rt2x00: Fix register initialization (rt2800pci) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800pci.c | 19 +++++++++++++++---- + 1 files changed, 15 insertions(+), 4 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800pci.c ++++ b/drivers/net/wireless/rt2x00/rt2800pci.c +@@ -602,9 +602,12 @@ static void rt2800pci_config_ant(struct + */ + switch (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_TXPATH)) { + case 1: ++ rt2x00_set_field8(&r1, BBP1_TX_ANTENNA, 0); + rt2x00_set_field8(&r3, BBP3_RX_ANTENNA, 0); + break; + case 2: ++ rt2x00_set_field8(&r1, BBP1_TX_ANTENNA, 16); ++ break; + case 3: + /* Do nothing */ + break; +@@ -1371,7 +1374,7 @@ static int rt2800pci_init_registers(stru + * ASIC will keep garbage value after boot, clear encryption keys. + */ + for (i = 0; i < 254; i++) { +- u32 wcid[2] = { 0xffffffff, 0x0000ffff }; ++ u32 wcid[2] = { 0xffffffff, 0x00ffffff }; + rt2x00pci_register_multiwrite(rt2x00dev, MAC_WCID_ENTRY(i), + wcid, sizeof(wcid)); + } +@@ -2158,9 +2161,17 @@ static int rt2800pci_validate_eeprom(str + } + + rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &word); +- if (word != 0) { +- /* NIC configuration must always be 0. */ +- word = 0; ++ if (word == 0xffff) { ++ rt2x00_set_field16(&word, EEPROM_NIC_HW_RADIO, 0); ++ rt2x00_set_field16(&word, EEPROM_NIC_DYNAMIC_TX_AGC, 0); ++ rt2x00_set_field16(&word, EEPROM_NIC_EXTERNAL_LNA_BG, 0); ++ rt2x00_set_field16(&word, EEPROM_NIC_EXTERNAL_LNA_A, 0); ++ rt2x00_set_field16(&word, EEPROM_NIC_CARDBUS_ACCEL, 0); ++ rt2x00_set_field16(&word, EEPROM_NIC_BW40M_SB_BG, 0); ++ rt2x00_set_field16(&word, EEPROM_NIC_BW40M_SB_A, 0); ++ rt2x00_set_field16(&word, EEPROM_NIC_WPS_PBC, 0); ++ rt2x00_set_field16(&word, EEPROM_NIC_BW40M_BG, 0); ++ rt2x00_set_field16(&word, EEPROM_NIC_BW40M_A, 0); + rt2x00_eeprom_write(rt2x00dev, EEPROM_NIC, word); + EEPROM(rt2x00dev, "NIC: 0x%04x\n", word); + } diff --git a/package/mac80211/patches/317-rt2x00-Fix-register-initialization-rt2800usb.patch b/package/mac80211/patches/317-rt2x00-Fix-register-initialization-rt2800usb.patch new file mode 100644 index 0000000000..de54242f38 --- /dev/null +++ b/package/mac80211/patches/317-rt2x00-Fix-register-initialization-rt2800usb.patch @@ -0,0 +1,63 @@ +From d97bb9291c59852989a86667ba317613fa2b77c5 Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 17 Jan 2009 19:19:16 +0100 +Subject: [PATCH] rt2x00: Fix register initialization (rt2800usb) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800usb.c | 20 ++++++++++++++++---- + 1 files changed, 16 insertions(+), 4 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800usb.c ++++ b/drivers/net/wireless/rt2x00/rt2800usb.c +@@ -582,9 +582,12 @@ static void rt2800usb_config_ant(struct + */ + switch (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_TXPATH)) { + case 1: ++ rt2x00_set_field8(&r1, BBP1_TX_ANTENNA, 0); + rt2x00_set_field8(&r3, BBP3_RX_ANTENNA, 0); + break; + case 2: ++ rt2x00_set_field8(&r1, BBP1_TX_ANTENNA, 16); ++ break; + case 3: + /* Do nothing */ + break; +@@ -1279,7 +1282,7 @@ static int rt2800usb_init_registers(stru + * ASIC will keep garbage value after boot, clear encryption keys. + */ + for (i = 0; i < 254; i++) { +- u32 wcid[2] = { 0xffffffff, 0x0000ffff }; ++ u32 wcid[2] = { 0xffffffff, 0x00ffffff }; + rt2x00usb_register_multiwrite(rt2x00dev, MAC_WCID_ENTRY(i), + wcid, sizeof(wcid)); + } +@@ -1421,6 +1424,7 @@ static int rt2800usb_init_bbp(struct rt2 + rt2800usb_bbp_write(rt2x00dev, 86, 0x00); + rt2800usb_bbp_write(rt2x00dev, 91, 0x04); + rt2800usb_bbp_write(rt2x00dev, 92, 0x00); ++ rt2800usb_bbp_write(rt2x00dev, 103, 0x00); + rt2800usb_bbp_write(rt2x00dev, 105, 0x05); + + if (rt2x00_rev(&rt2x00dev->chip) == RT2870_VERSION_C) { +@@ -1904,9 +1908,17 @@ static int rt2800usb_validate_eeprom(str + } + + rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &word); +- if (word != 0) { +- /* NIC configuration must always be 0. */ +- word = 0; ++ if (word == 0xffff) { ++ rt2x00_set_field16(&word, EEPROM_NIC_HW_RADIO, 0); ++ rt2x00_set_field16(&word, EEPROM_NIC_DYNAMIC_TX_AGC, 0); ++ rt2x00_set_field16(&word, EEPROM_NIC_EXTERNAL_LNA_BG, 0); ++ rt2x00_set_field16(&word, EEPROM_NIC_EXTERNAL_LNA_A, 0); ++ rt2x00_set_field16(&word, EEPROM_NIC_CARDBUS_ACCEL, 0); ++ rt2x00_set_field16(&word, EEPROM_NIC_BW40M_SB_BG, 0); ++ rt2x00_set_field16(&word, EEPROM_NIC_BW40M_SB_A, 0); ++ rt2x00_set_field16(&word, EEPROM_NIC_WPS_PBC, 0); ++ rt2x00_set_field16(&word, EEPROM_NIC_BW40M_BG, 0); ++ rt2x00_set_field16(&word, EEPROM_NIC_BW40M_A, 0); + rt2x00_eeprom_write(rt2x00dev, EEPROM_NIC, word); + EEPROM(rt2x00dev, "NIC: 0x%04x\n", word); + } diff --git a/package/mac80211/patches/318-rt2x00-conf_tx-only-need-register-access-for-WMM.patch b/package/mac80211/patches/318-rt2x00-conf_tx-only-need-register-access-for-WMM.patch new file mode 100644 index 0000000000..c454165182 --- /dev/null +++ b/package/mac80211/patches/318-rt2x00-conf_tx-only-need-register-access-for-WMM.patch @@ -0,0 +1,116 @@ +From bbb27190d504b453625d1a663124b2b1cec0fe8b Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 17 Jan 2009 20:25:27 +0100 +Subject: [PATCH] rt2x00: conf_tx() only need register access for WMM queues + +conf_tx() in rt61pci and rt73usb only have to check once +if the queue_idx indicates a non-WMM queue and break of +the function immediately if that is the case. + +Only the WMM queues need to have the TX configuration written +to the registers. + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt61pci.c | 30 +++++++++++++++--------------- + drivers/net/wireless/rt2x00/rt73usb.c | 30 +++++++++++++++--------------- + 2 files changed, 30 insertions(+), 30 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt61pci.c ++++ b/drivers/net/wireless/rt2x00/rt61pci.c +@@ -2657,6 +2657,7 @@ static int rt61pci_conf_tx(struct ieee80 + struct rt2x00_field32 field; + int retval; + u32 reg; ++ u32 offset; + + /* + * First pass the configuration through rt2x00lib, that will +@@ -2668,24 +2669,23 @@ static int rt61pci_conf_tx(struct ieee80 + if (retval) + return retval; + ++ /* ++ * We only need to perform additional register initialization ++ * for WMM queues/ ++ */ ++ if (queue_idx >= 4) ++ return 0; ++ + queue = rt2x00queue_get_queue(rt2x00dev, queue_idx); + + /* Update WMM TXOP register */ +- if (queue_idx < 2) { +- field.bit_offset = queue_idx * 16; +- field.bit_mask = 0xffff << field.bit_offset; +- +- rt2x00pci_register_read(rt2x00dev, AC_TXOP_CSR0, ®); +- rt2x00_set_field32(®, field, queue->txop); +- rt2x00pci_register_write(rt2x00dev, AC_TXOP_CSR0, reg); +- } else if (queue_idx < 4) { +- field.bit_offset = (queue_idx - 2) * 16; +- field.bit_mask = 0xffff << field.bit_offset; +- +- rt2x00pci_register_read(rt2x00dev, AC_TXOP_CSR1, ®); +- rt2x00_set_field32(®, field, queue->txop); +- rt2x00pci_register_write(rt2x00dev, AC_TXOP_CSR1, reg); +- } ++ offset = AC_TXOP_CSR0 + (sizeof(u32) * (!!(queue_idx & 2))); ++ field.bit_offset = (queue_idx & 1) * 16; ++ field.bit_mask = 0xffff << field.bit_offset; ++ ++ rt2x00pci_register_read(rt2x00dev, offset, ®); ++ rt2x00_set_field32(®, field, queue->txop); ++ rt2x00pci_register_write(rt2x00dev, offset, reg); + + /* Update WMM registers */ + field.bit_offset = queue_idx * 4; +--- a/drivers/net/wireless/rt2x00/rt73usb.c ++++ b/drivers/net/wireless/rt2x00/rt73usb.c +@@ -2180,6 +2180,7 @@ static int rt73usb_conf_tx(struct ieee80 + struct rt2x00_field32 field; + int retval; + u32 reg; ++ u32 offset; + + /* + * First pass the configuration through rt2x00lib, that will +@@ -2191,24 +2192,23 @@ static int rt73usb_conf_tx(struct ieee80 + if (retval) + return retval; + ++ /* ++ * We only need to perform additional register initialization ++ * for WMM queues/ ++ */ ++ if (queue_idx >= 4) ++ return 0; ++ + queue = rt2x00queue_get_queue(rt2x00dev, queue_idx); + + /* Update WMM TXOP register */ +- if (queue_idx < 2) { +- field.bit_offset = queue_idx * 16; +- field.bit_mask = 0xffff << field.bit_offset; +- +- rt2x00usb_register_read(rt2x00dev, AC_TXOP_CSR0, ®); +- rt2x00_set_field32(®, field, queue->txop); +- rt2x00usb_register_write(rt2x00dev, AC_TXOP_CSR0, reg); +- } else if (queue_idx < 4) { +- field.bit_offset = (queue_idx - 2) * 16; +- field.bit_mask = 0xffff << field.bit_offset; +- +- rt2x00usb_register_read(rt2x00dev, AC_TXOP_CSR1, ®); +- rt2x00_set_field32(®, field, queue->txop); +- rt2x00usb_register_write(rt2x00dev, AC_TXOP_CSR1, reg); +- } ++ offset = AC_TXOP_CSR0 + (sizeof(u32) * (!!(queue_idx & 2))); ++ field.bit_offset = (queue_idx & 1) * 16; ++ field.bit_mask = 0xffff << field.bit_offset; ++ ++ rt2x00usb_register_read(rt2x00dev, offset, ®); ++ rt2x00_set_field32(®, field, queue->txop); ++ rt2x00usb_register_write(rt2x00dev, offset, reg); + + /* Update WMM registers */ + field.bit_offset = queue_idx * 4; diff --git a/package/mac80211/patches/319-rt2x00-More-register-fixes-rt2800pci.patch b/package/mac80211/patches/319-rt2x00-More-register-fixes-rt2800pci.patch new file mode 100644 index 0000000000..0d0162d9bf --- /dev/null +++ b/package/mac80211/patches/319-rt2x00-More-register-fixes-rt2800pci.patch @@ -0,0 +1,154 @@ +From de75c463ca06352ac36c4a28440d10d5523bd6d9 Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 17 Jan 2009 20:27:10 +0100 +Subject: [PATCH] rt2x00: More register fixes (rt2800pci) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800pci.c | 59 +++++++++++++++---------------- + drivers/net/wireless/rt2x00/rt2800pci.h | 8 ++-- + 2 files changed, 33 insertions(+), 34 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800pci.c ++++ b/drivers/net/wireless/rt2x00/rt2800pci.c +@@ -2506,33 +2506,34 @@ static int rt2800pci_set_rts_threshold(s + { + struct rt2x00_dev *rt2x00dev = hw->priv; + u32 reg; ++ bool enabled = (value < IEEE80211_MAX_RTS_THRESHOLD); + + rt2x00pci_register_read(rt2x00dev, TX_RTS_CFG, ®); + rt2x00_set_field32(®, TX_RTS_CFG_RTS_THRES, value); + rt2x00pci_register_write(rt2x00dev, TX_RTS_CFG, reg); + + rt2x00pci_register_read(rt2x00dev, CCK_PROT_CFG, ®); +- rt2x00_set_field32(®, CCK_PROT_CFG_RTS_TH_EN, 1); ++ rt2x00_set_field32(®, CCK_PROT_CFG_RTS_TH_EN, enabled); + rt2x00pci_register_write(rt2x00dev, CCK_PROT_CFG, reg); + + rt2x00pci_register_read(rt2x00dev, OFDM_PROT_CFG, ®); +- rt2x00_set_field32(®, OFDM_PROT_CFG_RTS_TH_EN, 1); ++ rt2x00_set_field32(®, OFDM_PROT_CFG_RTS_TH_EN, enabled); + rt2x00pci_register_write(rt2x00dev, OFDM_PROT_CFG, reg); + + rt2x00pci_register_read(rt2x00dev, MM20_PROT_CFG, ®); +- rt2x00_set_field32(®, MM20_PROT_CFG_RTS_TH_EN, 1); ++ rt2x00_set_field32(®, MM20_PROT_CFG_RTS_TH_EN, enabled); + rt2x00pci_register_write(rt2x00dev, MM20_PROT_CFG, reg); + + rt2x00pci_register_read(rt2x00dev, MM40_PROT_CFG, ®); +- rt2x00_set_field32(®, MM40_PROT_CFG_RTS_TH_EN, 1); ++ rt2x00_set_field32(®, MM40_PROT_CFG_RTS_TH_EN, enabled); + rt2x00pci_register_write(rt2x00dev, MM40_PROT_CFG, reg); + + rt2x00pci_register_read(rt2x00dev, GF20_PROT_CFG, ®); +- rt2x00_set_field32(®, GF20_PROT_CFG_RTS_TH_EN, 1); ++ rt2x00_set_field32(®, GF20_PROT_CFG_RTS_TH_EN, enabled); + rt2x00pci_register_write(rt2x00dev, GF20_PROT_CFG, reg); + + rt2x00pci_register_read(rt2x00dev, GF40_PROT_CFG, ®); +- rt2x00_set_field32(®, GF40_PROT_CFG_RTS_TH_EN, 1); ++ rt2x00_set_field32(®, GF40_PROT_CFG_RTS_TH_EN, enabled); + rt2x00pci_register_write(rt2x00dev, GF40_PROT_CFG, reg); + + return 0; +@@ -2558,24 +2559,23 @@ static int rt2800pci_conf_tx(struct ieee + if (retval) + return retval; + ++ /* ++ * We only need to perform additional register initialization ++ * for WMM queues/ ++ */ ++ if (queue_idx >= 4) ++ return 0; ++ + queue = rt2x00queue_get_queue(rt2x00dev, queue_idx); + + /* Update WMM TXOP register */ +- if (queue_idx < 2) { +- field.bit_offset = queue_idx * 16; +- field.bit_mask = 0xffff << field.bit_offset; +- +- rt2x00pci_register_read(rt2x00dev, WMM_TXOP0_CFG, ®); +- rt2x00_set_field32(®, field, queue->txop); +- rt2x00pci_register_write(rt2x00dev, WMM_TXOP0_CFG, reg); +- } else if (queue_idx < 4) { +- field.bit_offset = (queue_idx - 2) * 16; +- field.bit_mask = 0xffff << field.bit_offset; +- +- rt2x00pci_register_read(rt2x00dev, WMM_TXOP1_CFG, ®); +- rt2x00_set_field32(®, field, queue->txop); +- rt2x00pci_register_write(rt2x00dev, WMM_TXOP1_CFG, reg); +- } ++ offset = WMM_TXOP0_CFG + (sizeof(u32) * (!!(queue_idx & 2))); ++ field.bit_offset = (queue_idx & 1) * 16; ++ field.bit_mask = 0xffff << field.bit_offset; ++ ++ rt2x00pci_register_read(rt2x00dev, offset, ®); ++ rt2x00_set_field32(®, field, queue->txop); ++ rt2x00pci_register_write(rt2x00dev, offset, reg); + + /* Update WMM registers */ + field.bit_offset = queue_idx * 4; +@@ -2594,15 +2594,14 @@ static int rt2800pci_conf_tx(struct ieee + rt2x00pci_register_write(rt2x00dev, WMM_CWMAX_CFG, reg); + + /* Update EDCA registers */ +- if (queue_idx < 4) { +- offset = EDCA_AC0_CFG + (sizeof(u32) * queue_idx); ++ offset = EDCA_AC0_CFG + (sizeof(u32) * queue_idx); + +- rt2x00pci_register_read(rt2x00dev, offset, ®); +- rt2x00_set_field32(®, EDCA_AC0_CFG_AIFSN, queue->aifs); +- rt2x00_set_field32(®, EDCA_AC0_CFG_CWMIN, queue->cw_min); +- rt2x00_set_field32(®, EDCA_AC0_CFG_CWMAX, queue->cw_max); +- rt2x00pci_register_write(rt2x00dev, offset, reg); +- } ++ rt2x00pci_register_read(rt2x00dev, offset, ®); ++ rt2x00_set_field32(®, EDCA_AC0_CFG_TX_OP, queue->txop); ++ rt2x00_set_field32(®, EDCA_AC0_CFG_AIFSN, queue->aifs); ++ rt2x00_set_field32(®, EDCA_AC0_CFG_CWMIN, queue->cw_min); ++ rt2x00_set_field32(®, EDCA_AC0_CFG_CWMAX, queue->cw_max); ++ rt2x00pci_register_write(rt2x00dev, offset, reg); + + return 0; + } +--- a/drivers/net/wireless/rt2x00/rt2800pci.h ++++ b/drivers/net/wireless/rt2x00/rt2800pci.h +@@ -667,7 +667,7 @@ + * EDCA_AC0_CFG: + */ + #define EDCA_AC0_CFG 0x1300 +-#define EDCA_AC0_CFG_AC_TX_OP FIELD32(0x000000ff) ++#define EDCA_AC0_CFG_TX_OP FIELD32(0x000000ff) + #define EDCA_AC0_CFG_AIFSN FIELD32(0x00000f00) + #define EDCA_AC0_CFG_CWMIN FIELD32(0x0000f000) + #define EDCA_AC0_CFG_CWMAX FIELD32(0x000f0000) +@@ -676,7 +676,7 @@ + * EDCA_AC1_CFG: + */ + #define EDCA_AC1_CFG 0x1304 +-#define EDCA_AC1_CFG_AC_TX_OP FIELD32(0x000000ff) ++#define EDCA_AC1_CFG_TX_OP FIELD32(0x000000ff) + #define EDCA_AC1_CFG_AIFSN FIELD32(0x00000f00) + #define EDCA_AC1_CFG_CWMIN FIELD32(0x0000f000) + #define EDCA_AC1_CFG_CWMAX FIELD32(0x000f0000) +@@ -685,7 +685,7 @@ + * EDCA_AC2_CFG: + */ + #define EDCA_AC2_CFG 0x1308 +-#define EDCA_AC2_CFG_AC_TX_OP FIELD32(0x000000ff) ++#define EDCA_AC2_CFG_TX_OP FIELD32(0x000000ff) + #define EDCA_AC2_CFG_AIFSN FIELD32(0x00000f00) + #define EDCA_AC2_CFG_CWMIN FIELD32(0x0000f000) + #define EDCA_AC2_CFG_CWMAX FIELD32(0x000f0000) +@@ -694,7 +694,7 @@ + * EDCA_AC3_CFG: + */ + #define EDCA_AC3_CFG 0x130c +-#define EDCA_AC3_CFG_AC_TX_OP FIELD32(0x000000ff) ++#define EDCA_AC3_CFG_TX_OP FIELD32(0x000000ff) + #define EDCA_AC3_CFG_AIFSN FIELD32(0x00000f00) + #define EDCA_AC3_CFG_CWMIN FIELD32(0x0000f000) + #define EDCA_AC3_CFG_CWMAX FIELD32(0x000f0000) diff --git a/package/mac80211/patches/320-enable_rt2800.patch b/package/mac80211/patches/320-enable_rt2800.patch deleted file mode 100644 index 818063948f..0000000000 --- a/package/mac80211/patches/320-enable_rt2800.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/config.mk -+++ b/config.mk -@@ -156,6 +156,7 @@ CONFIG_ADM8211=m - CONFIG_RT2X00_LIB_PCI=m - CONFIG_RT2400PCI=m - CONFIG_RT2500PCI=m -+CONFIG_RT2800PCI=m - NEED_RT2X00=y - - # Two rt2x00 drivers require firmware: rt61pci and rt73usb. They depend on -@@ -197,6 +198,8 @@ CONFIG_RTL8187=m - # RT2500USB does not require firmware - CONFIG_RT2500USB=m - CONFIG_RT2X00_LIB_USB=m -+CONFIG_RT2X00_LIB_CRYPTO=y -+CONFIG_RT2X00_LIB_HT=y - NEED_RT2X00=y - # RT73USB requires firmware - ifneq ($(CONFIG_CRC_ITU_T),) -@@ -204,6 +207,9 @@ CONFIG_RT73USB=m - NEED_RT2X00_FIRMWARE=y - endif - -+# RT2800USB support -+CONFIG_RT2800USB=m -+ - endif # end of USB driver list - - # Common rt2x00 requirements diff --git a/package/mac80211/patches/320-rt2x00-More-register-fixes-rt2800usb.patch b/package/mac80211/patches/320-rt2x00-More-register-fixes-rt2800usb.patch new file mode 100644 index 0000000000..2e7c496378 --- /dev/null +++ b/package/mac80211/patches/320-rt2x00-More-register-fixes-rt2800usb.patch @@ -0,0 +1,154 @@ +From 6d9ef2042aff47309dbe973da5723c4972ed95bb Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 17 Jan 2009 20:27:40 +0100 +Subject: [PATCH] rt2x00: More register fixes (rt2800usb) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2800usb.c | 59 +++++++++++++++---------------- + drivers/net/wireless/rt2x00/rt2800usb.h | 8 ++-- + 2 files changed, 33 insertions(+), 34 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2800usb.c ++++ b/drivers/net/wireless/rt2x00/rt2800usb.c +@@ -2261,33 +2261,34 @@ static int rt2800usb_set_rts_threshold(s + { + struct rt2x00_dev *rt2x00dev = hw->priv; + u32 reg; ++ bool enabled = (value < IEEE80211_MAX_RTS_THRESHOLD); + + rt2x00usb_register_read(rt2x00dev, TX_RTS_CFG, ®); + rt2x00_set_field32(®, TX_RTS_CFG_RTS_THRES, value); + rt2x00usb_register_write(rt2x00dev, TX_RTS_CFG, reg); + + rt2x00usb_register_read(rt2x00dev, CCK_PROT_CFG, ®); +- rt2x00_set_field32(®, CCK_PROT_CFG_RTS_TH_EN, 1); ++ rt2x00_set_field32(®, CCK_PROT_CFG_RTS_TH_EN, enabled); + rt2x00usb_register_write(rt2x00dev, CCK_PROT_CFG, reg); + + rt2x00usb_register_read(rt2x00dev, OFDM_PROT_CFG, ®); +- rt2x00_set_field32(®, OFDM_PROT_CFG_RTS_TH_EN, 1); ++ rt2x00_set_field32(®, OFDM_PROT_CFG_RTS_TH_EN, enabled); + rt2x00usb_register_write(rt2x00dev, OFDM_PROT_CFG, reg); + + rt2x00usb_register_read(rt2x00dev, MM20_PROT_CFG, ®); +- rt2x00_set_field32(®, MM20_PROT_CFG_RTS_TH_EN, 1); ++ rt2x00_set_field32(®, MM20_PROT_CFG_RTS_TH_EN, enabled); + rt2x00usb_register_write(rt2x00dev, MM20_PROT_CFG, reg); + + rt2x00usb_register_read(rt2x00dev, MM40_PROT_CFG, ®); +- rt2x00_set_field32(®, MM40_PROT_CFG_RTS_TH_EN, 1); ++ rt2x00_set_field32(®, MM40_PROT_CFG_RTS_TH_EN, enabled); + rt2x00usb_register_write(rt2x00dev, MM40_PROT_CFG, reg); + + rt2x00usb_register_read(rt2x00dev, GF20_PROT_CFG, ®); +- rt2x00_set_field32(®, GF20_PROT_CFG_RTS_TH_EN, 1); ++ rt2x00_set_field32(®, GF20_PROT_CFG_RTS_TH_EN, enabled); + rt2x00usb_register_write(rt2x00dev, GF20_PROT_CFG, reg); + + rt2x00usb_register_read(rt2x00dev, GF40_PROT_CFG, ®); +- rt2x00_set_field32(®, GF40_PROT_CFG_RTS_TH_EN, 1); ++ rt2x00_set_field32(®, GF40_PROT_CFG_RTS_TH_EN, enabled); + rt2x00usb_register_write(rt2x00dev, GF40_PROT_CFG, reg); + + return 0; +@@ -2313,24 +2314,23 @@ static int rt2800usb_conf_tx(struct ieee + if (retval) + return retval; + ++ /* ++ * We only need to perform additional register initialization ++ * for WMM queues/ ++ */ ++ if (queue_idx >= 4) ++ return 0; ++ + queue = rt2x00queue_get_queue(rt2x00dev, queue_idx); + + /* Update WMM TXOP register */ +- if (queue_idx < 2) { +- field.bit_offset = queue_idx * 16; +- field.bit_mask = 0xffff << field.bit_offset; +- +- rt2x00usb_register_read(rt2x00dev, WMM_TXOP0_CFG, ®); +- rt2x00_set_field32(®, field, queue->txop); +- rt2x00usb_register_write(rt2x00dev, WMM_TXOP0_CFG, reg); +- } else if (queue_idx < 4) { +- field.bit_offset = (queue_idx - 2) * 16; +- field.bit_mask = 0xffff << field.bit_offset; +- +- rt2x00usb_register_read(rt2x00dev, WMM_TXOP1_CFG, ®); +- rt2x00_set_field32(®, field, queue->txop); +- rt2x00usb_register_write(rt2x00dev, WMM_TXOP1_CFG, reg); +- } ++ offset = WMM_TXOP0_CFG + (sizeof(u32) * (!!(queue_idx & 2))); ++ field.bit_offset = (queue_idx & 1) * 16; ++ field.bit_mask = 0xffff << field.bit_offset; ++ ++ rt2x00usb_register_read(rt2x00dev, offset, ®); ++ rt2x00_set_field32(®, field, queue->txop); ++ rt2x00usb_register_write(rt2x00dev, offset, reg); + + /* Update WMM registers */ + field.bit_offset = queue_idx * 4; +@@ -2349,15 +2349,14 @@ static int rt2800usb_conf_tx(struct ieee + rt2x00usb_register_write(rt2x00dev, WMM_CWMAX_CFG, reg); + + /* Update EDCA registers */ +- if (queue_idx < 4) { +- offset = EDCA_AC0_CFG + (sizeof(u32) * queue_idx); ++ offset = EDCA_AC0_CFG + (sizeof(u32) * queue_idx); + +- rt2x00usb_register_read(rt2x00dev, offset, ®); +- rt2x00_set_field32(®, EDCA_AC0_CFG_AIFSN, queue->aifs); +- rt2x00_set_field32(®, EDCA_AC0_CFG_CWMIN, queue->cw_min); +- rt2x00_set_field32(®, EDCA_AC0_CFG_CWMAX, queue->cw_max); +- rt2x00usb_register_write(rt2x00dev, offset, reg); +- } ++ rt2x00usb_register_read(rt2x00dev, offset, ®); ++ rt2x00_set_field32(®, EDCA_AC0_CFG_TX_OP, queue->txop); ++ rt2x00_set_field32(®, EDCA_AC0_CFG_AIFSN, queue->aifs); ++ rt2x00_set_field32(®, EDCA_AC0_CFG_CWMIN, queue->cw_min); ++ rt2x00_set_field32(®, EDCA_AC0_CFG_CWMAX, queue->cw_max); ++ rt2x00usb_register_write(rt2x00dev, offset, reg); + + return 0; + } +--- a/drivers/net/wireless/rt2x00/rt2800usb.h ++++ b/drivers/net/wireless/rt2x00/rt2800usb.h +@@ -670,7 +670,7 @@ + * EDCA_AC0_CFG: + */ + #define EDCA_AC0_CFG 0x1300 +-#define EDCA_AC0_CFG_AC_TX_OP FIELD32(0x000000ff) ++#define EDCA_AC0_CFG_TX_OP FIELD32(0x000000ff) + #define EDCA_AC0_CFG_AIFSN FIELD32(0x00000f00) + #define EDCA_AC0_CFG_CWMIN FIELD32(0x0000f000) + #define EDCA_AC0_CFG_CWMAX FIELD32(0x000f0000) +@@ -679,7 +679,7 @@ + * EDCA_AC1_CFG: + */ + #define EDCA_AC1_CFG 0x1304 +-#define EDCA_AC1_CFG_AC_TX_OP FIELD32(0x000000ff) ++#define EDCA_AC1_CFG_TX_OP FIELD32(0x000000ff) + #define EDCA_AC1_CFG_AIFSN FIELD32(0x00000f00) + #define EDCA_AC1_CFG_CWMIN FIELD32(0x0000f000) + #define EDCA_AC1_CFG_CWMAX FIELD32(0x000f0000) +@@ -688,7 +688,7 @@ + * EDCA_AC2_CFG: + */ + #define EDCA_AC2_CFG 0x1308 +-#define EDCA_AC2_CFG_AC_TX_OP FIELD32(0x000000ff) ++#define EDCA_AC2_CFG_TX_OP FIELD32(0x000000ff) + #define EDCA_AC2_CFG_AIFSN FIELD32(0x00000f00) + #define EDCA_AC2_CFG_CWMIN FIELD32(0x0000f000) + #define EDCA_AC2_CFG_CWMAX FIELD32(0x000f0000) +@@ -697,7 +697,7 @@ + * EDCA_AC3_CFG: + */ + #define EDCA_AC3_CFG 0x130c +-#define EDCA_AC3_CFG_AC_TX_OP FIELD32(0x000000ff) ++#define EDCA_AC3_CFG_TX_OP FIELD32(0x000000ff) + #define EDCA_AC3_CFG_AIFSN FIELD32(0x00000f00) + #define EDCA_AC3_CFG_CWMIN FIELD32(0x0000f000) + #define EDCA_AC3_CFG_CWMAX FIELD32(0x000f0000) diff --git a/package/mac80211/patches/322-rt2x00-Add-LED_MODE_ASUS-support.patch b/package/mac80211/patches/322-rt2x00-Add-LED_MODE_ASUS-support.patch new file mode 100644 index 0000000000..c19edd9d4a --- /dev/null +++ b/package/mac80211/patches/322-rt2x00-Add-LED_MODE_ASUS-support.patch @@ -0,0 +1,54 @@ +From ac8402781662b40a9f69bc33a3ec20292331e940 Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sat, 17 Jan 2009 20:36:44 +0100 +Subject: [PATCH] rt2x00: Add LED_MODE_ASUS support + +When the led mode is asus, the activity led mode must +be registered otherwise the second LED will not be enabled. + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2400pci.c | 4 +++- + drivers/net/wireless/rt2x00/rt2500pci.c | 4 +++- + drivers/net/wireless/rt2x00/rt2500usb.c | 4 +++- + 3 files changed, 9 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2400pci.c ++++ b/drivers/net/wireless/rt2x00/rt2400pci.c +@@ -1395,7 +1395,9 @@ static int rt2400pci_init_eeprom(struct + value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_LED_MODE); + + rt2400pci_init_led(rt2x00dev, &rt2x00dev->led_radio, LED_TYPE_RADIO); +- if (value == LED_MODE_TXRX_ACTIVITY || value == LED_MODE_DEFAULT) ++ if (value == LED_MODE_TXRX_ACTIVITY || ++ value == LED_MODE_DEFAULT || ++ value == LED_MODE_ASUS) + rt2400pci_init_led(rt2x00dev, &rt2x00dev->led_qual, + LED_TYPE_ACTIVITY); + #endif /* CONFIG_RT2X00_LIB_LEDS */ +--- a/drivers/net/wireless/rt2x00/rt2500pci.c ++++ b/drivers/net/wireless/rt2x00/rt2500pci.c +@@ -1552,7 +1552,9 @@ static int rt2500pci_init_eeprom(struct + value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_LED_MODE); + + rt2500pci_init_led(rt2x00dev, &rt2x00dev->led_radio, LED_TYPE_RADIO); +- if (value == LED_MODE_TXRX_ACTIVITY || value == LED_MODE_DEFAULT) ++ if (value == LED_MODE_TXRX_ACTIVITY || ++ value == LED_MODE_DEFAULT || ++ value == LED_MODE_ASUS) + rt2500pci_init_led(rt2x00dev, &rt2x00dev->led_qual, + LED_TYPE_ACTIVITY); + #endif /* CONFIG_RT2X00_LIB_LEDS */ +--- a/drivers/net/wireless/rt2x00/rt2500usb.c ++++ b/drivers/net/wireless/rt2x00/rt2500usb.c +@@ -1603,7 +1603,9 @@ static int rt2500usb_init_eeprom(struct + value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_LED_MODE); + + rt2500usb_init_led(rt2x00dev, &rt2x00dev->led_radio, LED_TYPE_RADIO); +- if (value == LED_MODE_TXRX_ACTIVITY || value == LED_MODE_DEFAULT) ++ if (value == LED_MODE_TXRX_ACTIVITY || ++ value == LED_MODE_DEFAULT || ++ value == LED_MODE_ASUS) + rt2500usb_init_led(rt2x00dev, &rt2x00dev->led_qual, + LED_TYPE_ACTIVITY); + #endif /* CONFIG_RT2X00_LIB_LEDS */ diff --git a/package/mac80211/patches/323-rt2x00-Fix-TX-rate-short-preamble-detection.patch b/package/mac80211/patches/323-rt2x00-Fix-TX-rate-short-preamble-detection.patch new file mode 100644 index 0000000000..712dea64a4 --- /dev/null +++ b/package/mac80211/patches/323-rt2x00-Fix-TX-rate-short-preamble-detection.patch @@ -0,0 +1,51 @@ +From 4f9ea5700c714afce77e410d1c0c114c42d5a910 Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sun, 18 Jan 2009 20:17:10 +0100 +Subject: [PATCH] rt2x00: Fix TX rate short preamble detection + +Mac80211 provides 2 structures to handle bitrates, namely +ieee80211_rate and ieee80211_tx_rate. To determine the short preamble +mode for an outgoing frame, the flag IEEE80211_TX_RC_USE_SHORT_PREAMBLE +must be checked on ieee80211_tx_rate and not ieee80211_rate (which rt2x00 did). + +This fixes a regression which was triggered in 2.6.29-rcX as reported by Chris Clayton. + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2x00queue.c | 9 +++++---- + 1 files changed, 5 insertions(+), 4 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2x00queue.c ++++ b/drivers/net/wireless/rt2x00/rt2x00queue.c +@@ -186,10 +186,11 @@ static void rt2x00queue_create_tx_descri + + static void rt2x00queue_create_tx_descriptor_plcp(struct queue_entry *entry, + struct txentry_desc *txdesc, +- struct ieee80211_rate *rate) ++ const struct rt2x00_rate *hwrate) + { + struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; +- const struct rt2x00_rate *hwrate = rt2x00_get_rate(rate->hw_value); ++ struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); ++ struct ieee80211_tx_rate *txrate = &tx_info->control.rates[0]; + unsigned int data_length; + unsigned int duration; + unsigned int residual; +@@ -232,7 +233,7 @@ static void rt2x00queue_create_tx_descri + * When preamble is enabled we should set the + * preamble bit for the signal. + */ +- if (rate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) ++ if (txrate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) + txdesc->signal |= 0x08; + } + } +@@ -327,7 +328,7 @@ static void rt2x00queue_create_tx_descri + rt2x00crypto_create_tx_descriptor(entry, txdesc); + rt2x00ht_create_tx_descriptor(entry, txdesc, rate); + rt2x00queue_create_tx_descriptor_seq(entry, txdesc); +- rt2x00queue_create_tx_descriptor_plcp(entry, txdesc, rate); ++ rt2x00queue_create_tx_descriptor_plcp(entry, txdesc, hwrate); + } + + static void rt2x00queue_write_tx_descriptor(struct queue_entry *entry, diff --git a/package/mac80211/patches/324-rt2x00-Fix-preamble-detection-rt2x00ht.patch b/package/mac80211/patches/324-rt2x00-Fix-preamble-detection-rt2x00ht.patch new file mode 100644 index 0000000000..1321232111 --- /dev/null +++ b/package/mac80211/patches/324-rt2x00-Fix-preamble-detection-rt2x00ht.patch @@ -0,0 +1,80 @@ +From ecce227dab27aaf2d1c81a605d3e6e6f6d55908a Mon Sep 17 00:00:00 2001 +From: Ivo van Doorn <IvDoorn@gmail.com> +Date: Sun, 18 Jan 2009 20:20:08 +0100 +Subject: [PATCH] rt2x00: Fix preamble detection (rt2x00ht) + +Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> +--- + drivers/net/wireless/rt2x00/rt2x00ht.c | 14 +++++++------- + drivers/net/wireless/rt2x00/rt2x00lib.h | 4 ++-- + drivers/net/wireless/rt2x00/rt2x00queue.c | 2 +- + 3 files changed, 10 insertions(+), 10 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2x00ht.c ++++ b/drivers/net/wireless/rt2x00/rt2x00ht.c +@@ -31,10 +31,10 @@ + + void rt2x00ht_create_tx_descriptor(struct queue_entry *entry, + struct txentry_desc *txdesc, +- struct ieee80211_rate *rate) ++ const struct rt2x00_rate *hwrate) + { + struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); +- const struct rt2x00_rate *hwrate = rt2x00_get_rate(rate->hw_value); ++ struct ieee80211_tx_rate *txrate = &tx_info->control.rates[0]; + + if (tx_info->control.sta) + txdesc->mpdu_density = +@@ -46,7 +46,7 @@ void rt2x00ht_create_tx_descriptor(struc + txdesc->stbc = 0; /* FIXME: What value is needed? */ + + txdesc->mcs = rt2x00_get_rate_mcs(hwrate->mcs); +- if (rate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) ++ if (txrate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) + txdesc->mcs |= 0x08; + + /* +@@ -58,12 +58,12 @@ void rt2x00ht_create_tx_descriptor(struc + /* + * Determine HT Mix/Greenfield rate mode + */ +- if (tx_info->control.rates[0].flags & IEEE80211_TX_RC_MCS) ++ if (txrate->flags & IEEE80211_TX_RC_MCS) + txdesc->rate_mode = RATE_MODE_HT_MIX; +- if (tx_info->control.rates[0].flags & IEEE80211_TX_RC_GREEN_FIELD) ++ if (txrate->flags & IEEE80211_TX_RC_GREEN_FIELD) + txdesc->rate_mode = RATE_MODE_HT_GREENFIELD; +- if (tx_info->control.rates[0].flags & IEEE80211_TX_RC_40_MHZ_WIDTH) ++ if (txrate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH) + __set_bit(ENTRY_TXD_HT_BW_40, &txdesc->flags); +- if (tx_info->control.rates[0].flags & IEEE80211_TX_RC_SHORT_GI) ++ if (txrate->flags & IEEE80211_TX_RC_SHORT_GI) + __set_bit(ENTRY_TXD_HT_SHORT_GI, &txdesc->flags); + } +--- a/drivers/net/wireless/rt2x00/rt2x00lib.h ++++ b/drivers/net/wireless/rt2x00/rt2x00lib.h +@@ -344,11 +344,11 @@ static inline void rt2x00crypto_rx_inser + #ifdef CONFIG_RT2X00_LIB_HT + void rt2x00ht_create_tx_descriptor(struct queue_entry *entry, + struct txentry_desc *txdesc, +- struct ieee80211_rate *rate); ++ const struct rt2x00_rate *hwrate); + #else + static inline void rt2x00ht_create_tx_descriptor(struct queue_entry *entry, + struct txentry_desc *txdesc, +- struct ieee80211_rate *rate) ++ const struct rt2x00_rate *hwrate) + { + } + #endif /* CONFIG_RT2X00_LIB_HT */ +--- a/drivers/net/wireless/rt2x00/rt2x00queue.c ++++ b/drivers/net/wireless/rt2x00/rt2x00queue.c +@@ -326,7 +326,7 @@ static void rt2x00queue_create_tx_descri + * Apply TX descriptor handling by components + */ + rt2x00crypto_create_tx_descriptor(entry, txdesc); +- rt2x00ht_create_tx_descriptor(entry, txdesc, rate); ++ rt2x00ht_create_tx_descriptor(entry, txdesc, hwrate); + rt2x00queue_create_tx_descriptor_seq(entry, txdesc); + rt2x00queue_create_tx_descriptor_plcp(entry, txdesc, hwrate); + } diff --git a/package/mac80211/patches/400-ath9k-restore-ath9k_platform.h.patch b/package/mac80211/patches/400-ath9k-restore-ath9k_platform.h.patch new file mode 100644 index 0000000000..6c7d29d043 --- /dev/null +++ b/package/mac80211/patches/400-ath9k-restore-ath9k_platform.h.patch @@ -0,0 +1,31 @@ +--- /dev/null ++++ b/include/linux/ath9k_platform.h +@@ -0,0 +1,28 @@ ++/* ++ * Copyright (c) 2008 Atheros Communications Inc. ++ * Copyright (c) 2009 Gabor Juhos <juhosg@openwrt.org> ++ * Copyright (c) 2009 Imre Kaloz <kaloz@openwrt.org> ++ * ++ * Permission to use, copy, modify, and/or distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES ++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ */ ++ ++#ifndef _LINUX_ATH9K_PLATFORM_H ++#define _LINUX_ATH9K_PLATFORM_H ++ ++#define ATH9K_PLAT_EEP_MAX_WORDS 2048 ++ ++struct ath9k_platform_data { ++ u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS]; ++}; ++ ++#endif /* _LINUX_ATH9K_PLATFORM_H */ diff --git a/package/mac80211/patches/401-ath9k-convert-to-struct-device.patch b/package/mac80211/patches/401-ath9k-convert-to-struct-device.patch deleted file mode 100644 index a7ad76e1fa..0000000000 --- a/package/mac80211/patches/401-ath9k-convert-to-struct-device.patch +++ /dev/null @@ -1,227 +0,0 @@ -From 1f8e398032f7aa8a06ac950fe1d4e0a48d7578b2 Mon Sep 17 00:00:00 2001 -From: Gabor Juhos <juhosg@openwrt.org> -Date: Mon, 5 Jan 2009 10:45:00 +0100 -Subject: [PATCH v3 01/11] ath9k: convert to struct device - -Convert 'struct pci_dev' to 'struct device' to make it usable on the AHB -bus as well. - -Changes-licensed-under: ISC - -Signed-off-by: Gabor Juhos <juhosg@openwrt.org> -Signed-off-by: Imre Kaloz <kaloz@openwrt.org> ---- - drivers/net/wireless/ath9k/beacon.c | 17 ++++++++++------- - drivers/net/wireless/ath9k/core.h | 2 +- - drivers/net/wireless/ath9k/main.c | 21 +++++++++++---------- - drivers/net/wireless/ath9k/recv.c | 15 +++++++++------ - drivers/net/wireless/ath9k/xmit.c | 7 ++++--- - 5 files changed, 35 insertions(+), 27 deletions(-) - ---- a/drivers/net/wireless/ath9k/beacon.c -+++ b/drivers/net/wireless/ath9k/beacon.c -@@ -164,7 +164,7 @@ static struct ath_buf *ath_beacon_genera - bf = avp->av_bcbuf; - skb = (struct sk_buff *)bf->bf_mpdu; - if (skb) { -- pci_unmap_single(sc->pdev, bf->bf_dmacontext, -+ pci_unmap_single(to_pci_dev(sc->dev), bf->bf_dmacontext, - skb->len, - PCI_DMA_TODEVICE); - dev_kfree_skb_any(skb); -@@ -188,10 +188,11 @@ static struct ath_buf *ath_beacon_genera - } - - bf->bf_buf_addr = bf->bf_dmacontext = -- pci_map_single(sc->pdev, skb->data, -+ pci_map_single(to_pci_dev(sc->dev), skb->data, - skb->len, - PCI_DMA_TODEVICE); -- if (unlikely(pci_dma_mapping_error(sc->pdev, bf->bf_buf_addr))) { -+ if (unlikely(pci_dma_mapping_error(to_pci_dev(sc->dev), -+ bf->bf_buf_addr))) { - dev_kfree_skb_any(skb); - bf->bf_mpdu = NULL; - DPRINTF(sc, ATH_DBG_CONFIG, -@@ -343,7 +344,7 @@ int ath_beacon_alloc(struct ath_softc *s - bf = avp->av_bcbuf; - if (bf->bf_mpdu != NULL) { - skb = (struct sk_buff *)bf->bf_mpdu; -- pci_unmap_single(sc->pdev, bf->bf_dmacontext, -+ pci_unmap_single(to_pci_dev(sc->dev), bf->bf_dmacontext, - skb->len, - PCI_DMA_TODEVICE); - dev_kfree_skb_any(skb); -@@ -402,10 +403,11 @@ int ath_beacon_alloc(struct ath_softc *s - - bf->bf_mpdu = skb; - bf->bf_buf_addr = bf->bf_dmacontext = -- pci_map_single(sc->pdev, skb->data, -+ pci_map_single(to_pci_dev(sc->dev), skb->data, - skb->len, - PCI_DMA_TODEVICE); -- if (unlikely(pci_dma_mapping_error(sc->pdev, bf->bf_buf_addr))) { -+ if (unlikely(pci_dma_mapping_error(to_pci_dev(sc->dev), -+ bf->bf_buf_addr))) { - dev_kfree_skb_any(skb); - bf->bf_mpdu = NULL; - DPRINTF(sc, ATH_DBG_CONFIG, -@@ -429,7 +431,8 @@ void ath_beacon_return(struct ath_softc - bf = avp->av_bcbuf; - if (bf->bf_mpdu != NULL) { - struct sk_buff *skb = (struct sk_buff *)bf->bf_mpdu; -- pci_unmap_single(sc->pdev, bf->bf_dmacontext, -+ pci_unmap_single(to_pci_dev(sc->dev), -+ bf->bf_dmacontext, - skb->len, - PCI_DMA_TODEVICE); - dev_kfree_skb_any(skb); ---- a/drivers/net/wireless/ath9k/core.h -+++ b/drivers/net/wireless/ath9k/core.h -@@ -695,7 +695,7 @@ enum PROT_MODE { - - struct ath_softc { - struct ieee80211_hw *hw; -- struct pci_dev *pdev; -+ struct device *dev; - struct tasklet_struct intr_tq; - struct tasklet_struct bcon_tasklet; - struct ath_hal *sc_ah; ---- a/drivers/net/wireless/ath9k/main.c -+++ b/drivers/net/wireless/ath9k/main.c -@@ -46,7 +46,8 @@ static void bus_read_cachesize(struct at - { - u8 u8tmp; - -- pci_read_config_byte(sc->pdev, PCI_CACHE_LINE_SIZE, (u8 *)&u8tmp); -+ pci_read_config_byte(to_pci_dev(sc->dev), PCI_CACHE_LINE_SIZE, -+ (u8 *)&u8tmp); - *csz = (int)u8tmp; - - /* -@@ -1269,11 +1270,11 @@ static int ath_start_rfkill_poll(struct - - /* Deinitialize the device */ - ath_detach(sc); -- if (sc->pdev->irq) -- free_irq(sc->pdev->irq, sc); -- pci_iounmap(sc->pdev, sc->mem); -- pci_release_region(sc->pdev, 0); -- pci_disable_device(sc->pdev); -+ if (to_pci_dev(sc->dev)->irq) -+ free_irq(to_pci_dev(sc->dev)->irq, sc); -+ pci_iounmap(to_pci_dev(sc->dev), sc->mem); -+ pci_release_region(to_pci_dev(sc->dev), 0); -+ pci_disable_device(to_pci_dev(sc->dev)); - ieee80211_free_hw(sc->hw); - return -EIO; - } else { -@@ -1716,7 +1717,7 @@ int ath_descdma_setup(struct ath_softc * - } - - /* allocate descriptors */ -- dd->dd_desc = pci_alloc_consistent(sc->pdev, -+ dd->dd_desc = pci_alloc_consistent(to_pci_dev(sc->dev), - dd->dd_desc_len, - &dd->dd_desc_paddr); - if (dd->dd_desc == NULL) { -@@ -1764,7 +1765,7 @@ int ath_descdma_setup(struct ath_softc * - } - return 0; - fail2: -- pci_free_consistent(sc->pdev, -+ pci_free_consistent(to_pci_dev(sc->dev), - dd->dd_desc_len, dd->dd_desc, dd->dd_desc_paddr); - fail: - memset(dd, 0, sizeof(*dd)); -@@ -1778,7 +1779,7 @@ void ath_descdma_cleanup(struct ath_soft - struct ath_descdma *dd, - struct list_head *head) - { -- pci_free_consistent(sc->pdev, -+ pci_free_consistent(to_pci_dev(sc->dev), - dd->dd_desc_len, dd->dd_desc, dd->dd_desc_paddr); - - INIT_LIST_HEAD(head); -@@ -2624,7 +2625,7 @@ static int ath_pci_probe(struct pci_dev - - sc = hw->priv; - sc->hw = hw; -- sc->pdev = pdev; -+ sc->dev = &pdev->dev; - sc->mem = mem; - - if (ath_attach(id->device, sc) != 0) { ---- a/drivers/net/wireless/ath9k/recv.c -+++ b/drivers/net/wireless/ath9k/recv.c -@@ -291,10 +291,11 @@ int ath_rx_init(struct ath_softc *sc, in - } - - bf->bf_mpdu = skb; -- bf->bf_buf_addr = pci_map_single(sc->pdev, skb->data, -+ bf->bf_buf_addr = pci_map_single(to_pci_dev(sc->dev), -+ skb->data, - sc->rx.bufsize, - PCI_DMA_FROMDEVICE); -- if (unlikely(pci_dma_mapping_error(sc->pdev, -+ if (unlikely(pci_dma_mapping_error(to_pci_dev(sc->dev), - bf->bf_buf_addr))) { - dev_kfree_skb_any(skb); - bf->bf_mpdu = NULL; -@@ -524,7 +525,8 @@ int ath_rx_tasklet(struct ath_softc *sc, - * 1. accessing the frame - * 2. requeueing the same buffer to h/w - */ -- pci_dma_sync_single_for_cpu(sc->pdev, bf->bf_buf_addr, -+ pci_dma_sync_single_for_cpu(to_pci_dev(sc->dev), -+ bf->bf_buf_addr, - sc->rx.bufsize, - PCI_DMA_FROMDEVICE); - -@@ -557,7 +559,7 @@ int ath_rx_tasklet(struct ath_softc *sc, - goto requeue; - - /* Unmap the frame */ -- pci_unmap_single(sc->pdev, bf->bf_buf_addr, -+ pci_unmap_single(to_pci_dev(sc->dev), bf->bf_buf_addr, - sc->rx.bufsize, - PCI_DMA_FROMDEVICE); - -@@ -605,10 +607,11 @@ int ath_rx_tasklet(struct ath_softc *sc, - - /* We will now give hardware our shiny new allocated skb */ - bf->bf_mpdu = requeue_skb; -- bf->bf_buf_addr = pci_map_single(sc->pdev, requeue_skb->data, -+ bf->bf_buf_addr = pci_map_single(to_pci_dev(sc->dev), -+ requeue_skb->data, - sc->rx.bufsize, - PCI_DMA_FROMDEVICE); -- if (unlikely(pci_dma_mapping_error(sc->pdev, -+ if (unlikely(pci_dma_mapping_error(to_pci_dev(sc->dev), - bf->bf_buf_addr))) { - dev_kfree_skb_any(requeue_skb); - bf->bf_mpdu = NULL; ---- a/drivers/net/wireless/ath9k/xmit.c -+++ b/drivers/net/wireless/ath9k/xmit.c -@@ -340,7 +340,7 @@ static void ath_tx_complete_buf(struct a - } - - /* Unmap this frame */ -- pci_unmap_single(sc->pdev, -+ pci_unmap_single(to_pci_dev(sc->dev), - bf->bf_dmacontext, - skb->len, - PCI_DMA_TODEVICE); -@@ -1716,9 +1716,10 @@ static int ath_tx_setup_buffer(struct at - /* DMA setup */ - bf->bf_mpdu = skb; - -- bf->bf_dmacontext = pci_map_single(sc->pdev, skb->data, -+ bf->bf_dmacontext = pci_map_single(to_pci_dev(sc->dev), skb->data, - skb->len, PCI_DMA_TODEVICE); -- if (unlikely(pci_dma_mapping_error(sc->pdev, bf->bf_dmacontext))) { -+ if (unlikely(pci_dma_mapping_error(to_pci_dev(sc->dev), -+ bf->bf_dmacontext))) { - bf->bf_mpdu = NULL; - DPRINTF(sc, ATH_DBG_CONFIG, - "pci_dma_mapping_error() on TX\n"); diff --git a/package/mac80211/patches/402-ath9k-convert-to-use-bus-agnostic-DMA-routines.patch b/package/mac80211/patches/402-ath9k-convert-to-use-bus-agnostic-DMA-routines.patch deleted file mode 100644 index 9a5b301819..0000000000 --- a/package/mac80211/patches/402-ath9k-convert-to-use-bus-agnostic-DMA-routines.patch +++ /dev/null @@ -1,235 +0,0 @@ -From 4180ca5827fe3ac377a8a71fca955c99ad6a2b5b Mon Sep 17 00:00:00 2001 -From: Gabor Juhos <juhosg@openwrt.org> -Date: Mon, 5 Jan 2009 10:50:30 +0100 -Subject: [PATCH v3 02/11] ath9k: convert to use bus-agnostic DMA routines - -Convert to use bus-agnostic DMA routines to make it usable on AHB bus as well. - -Changes-licensed-under: ISC - -Signed-off-by: Gabor Juhos <juhosg@openwrt.org> -Signed-off-by: Imre Kaloz <kaloz@openwrt.org> ---- - drivers/net/wireless/ath9k/beacon.c | 31 ++++++++++++++----------------- - drivers/net/wireless/ath9k/main.c | 13 ++++++------- - drivers/net/wireless/ath9k/recv.c | 27 ++++++++++++--------------- - drivers/net/wireless/ath9k/xmit.c | 15 ++++++--------- - 4 files changed, 38 insertions(+), 48 deletions(-) - ---- a/drivers/net/wireless/ath9k/beacon.c -+++ b/drivers/net/wireless/ath9k/beacon.c -@@ -164,9 +164,9 @@ static struct ath_buf *ath_beacon_genera - bf = avp->av_bcbuf; - skb = (struct sk_buff *)bf->bf_mpdu; - if (skb) { -- pci_unmap_single(to_pci_dev(sc->dev), bf->bf_dmacontext, -+ dma_unmap_single(sc->dev, bf->bf_dmacontext, - skb->len, -- PCI_DMA_TODEVICE); -+ DMA_TO_DEVICE); - dev_kfree_skb_any(skb); - } - -@@ -188,15 +188,14 @@ static struct ath_buf *ath_beacon_genera - } - - bf->bf_buf_addr = bf->bf_dmacontext = -- pci_map_single(to_pci_dev(sc->dev), skb->data, -+ dma_map_single(sc->dev, skb->data, - skb->len, -- PCI_DMA_TODEVICE); -- if (unlikely(pci_dma_mapping_error(to_pci_dev(sc->dev), -- bf->bf_buf_addr))) { -+ DMA_TO_DEVICE); -+ if (unlikely(dma_mapping_error(sc->dev, bf->bf_buf_addr))) { - dev_kfree_skb_any(skb); - bf->bf_mpdu = NULL; - DPRINTF(sc, ATH_DBG_CONFIG, -- "pci_dma_mapping_error() on beaconing\n"); -+ "dma_mapping_error() on beaconing\n"); - return NULL; - } - -@@ -344,9 +343,9 @@ int ath_beacon_alloc(struct ath_softc *s - bf = avp->av_bcbuf; - if (bf->bf_mpdu != NULL) { - skb = (struct sk_buff *)bf->bf_mpdu; -- pci_unmap_single(to_pci_dev(sc->dev), bf->bf_dmacontext, -+ dma_unmap_single(sc->dev, bf->bf_dmacontext, - skb->len, -- PCI_DMA_TODEVICE); -+ DMA_TO_DEVICE); - dev_kfree_skb_any(skb); - bf->bf_mpdu = NULL; - } -@@ -403,15 +402,14 @@ int ath_beacon_alloc(struct ath_softc *s - - bf->bf_mpdu = skb; - bf->bf_buf_addr = bf->bf_dmacontext = -- pci_map_single(to_pci_dev(sc->dev), skb->data, -+ dma_map_single(sc->dev, skb->data, - skb->len, -- PCI_DMA_TODEVICE); -- if (unlikely(pci_dma_mapping_error(to_pci_dev(sc->dev), -- bf->bf_buf_addr))) { -+ DMA_TO_DEVICE); -+ if (unlikely(dma_mapping_error(sc->dev, bf->bf_buf_addr))) { - dev_kfree_skb_any(skb); - bf->bf_mpdu = NULL; - DPRINTF(sc, ATH_DBG_CONFIG, -- "pci_dma_mapping_error() on beacon alloc\n"); -+ "dma_mapping_error() on beacon alloc\n"); - return -ENOMEM; - } - -@@ -431,10 +429,9 @@ void ath_beacon_return(struct ath_softc - bf = avp->av_bcbuf; - if (bf->bf_mpdu != NULL) { - struct sk_buff *skb = (struct sk_buff *)bf->bf_mpdu; -- pci_unmap_single(to_pci_dev(sc->dev), -- bf->bf_dmacontext, -+ dma_unmap_single(sc->dev, bf->bf_dmacontext, - skb->len, -- PCI_DMA_TODEVICE); -+ DMA_TO_DEVICE); - dev_kfree_skb_any(skb); - bf->bf_mpdu = NULL; - } ---- a/drivers/net/wireless/ath9k/main.c -+++ b/drivers/net/wireless/ath9k/main.c -@@ -1717,9 +1717,8 @@ int ath_descdma_setup(struct ath_softc * - } - - /* allocate descriptors */ -- dd->dd_desc = pci_alloc_consistent(to_pci_dev(sc->dev), -- dd->dd_desc_len, -- &dd->dd_desc_paddr); -+ dd->dd_desc = dma_alloc_coherent(sc->dev, dd->dd_desc_len, -+ &dd->dd_desc_paddr, GFP_ATOMIC); - if (dd->dd_desc == NULL) { - error = -ENOMEM; - goto fail; -@@ -1765,8 +1764,8 @@ int ath_descdma_setup(struct ath_softc * - } - return 0; - fail2: -- pci_free_consistent(to_pci_dev(sc->dev), -- dd->dd_desc_len, dd->dd_desc, dd->dd_desc_paddr); -+ dma_free_coherent(sc->dev, dd->dd_desc_len, dd->dd_desc, -+ dd->dd_desc_paddr); - fail: - memset(dd, 0, sizeof(*dd)); - return error; -@@ -1779,8 +1778,8 @@ void ath_descdma_cleanup(struct ath_soft - struct ath_descdma *dd, - struct list_head *head) - { -- pci_free_consistent(to_pci_dev(sc->dev), -- dd->dd_desc_len, dd->dd_desc, dd->dd_desc_paddr); -+ dma_free_coherent(sc->dev, dd->dd_desc_len, dd->dd_desc, -+ dd->dd_desc_paddr); - - INIT_LIST_HEAD(head); - kfree(dd->dd_bufptr); ---- a/drivers/net/wireless/ath9k/recv.c -+++ b/drivers/net/wireless/ath9k/recv.c -@@ -291,16 +291,15 @@ int ath_rx_init(struct ath_softc *sc, in - } - - bf->bf_mpdu = skb; -- bf->bf_buf_addr = pci_map_single(to_pci_dev(sc->dev), -- skb->data, -+ bf->bf_buf_addr = dma_map_single(sc->dev, skb->data, - sc->rx.bufsize, -- PCI_DMA_FROMDEVICE); -- if (unlikely(pci_dma_mapping_error(to_pci_dev(sc->dev), -+ DMA_FROM_DEVICE); -+ if (unlikely(dma_mapping_error(sc->dev, - bf->bf_buf_addr))) { - dev_kfree_skb_any(skb); - bf->bf_mpdu = NULL; - DPRINTF(sc, ATH_DBG_CONFIG, -- "pci_dma_mapping_error() on RX init\n"); -+ "dma_mapping_error() on RX init\n"); - error = -ENOMEM; - break; - } -@@ -525,10 +524,9 @@ int ath_rx_tasklet(struct ath_softc *sc, - * 1. accessing the frame - * 2. requeueing the same buffer to h/w - */ -- pci_dma_sync_single_for_cpu(to_pci_dev(sc->dev), -- bf->bf_buf_addr, -+ dma_sync_single_for_cpu(sc->dev, bf->bf_buf_addr, - sc->rx.bufsize, -- PCI_DMA_FROMDEVICE); -+ DMA_FROM_DEVICE); - - /* - * If we're asked to flush receive queue, directly -@@ -559,9 +557,9 @@ int ath_rx_tasklet(struct ath_softc *sc, - goto requeue; - - /* Unmap the frame */ -- pci_unmap_single(to_pci_dev(sc->dev), bf->bf_buf_addr, -+ dma_unmap_single(sc->dev, bf->bf_buf_addr, - sc->rx.bufsize, -- PCI_DMA_FROMDEVICE); -+ DMA_FROM_DEVICE); - - skb_put(skb, ds->ds_rxstat.rs_datalen); - skb->protocol = cpu_to_be16(ETH_P_CONTROL); -@@ -607,16 +605,15 @@ int ath_rx_tasklet(struct ath_softc *sc, - - /* We will now give hardware our shiny new allocated skb */ - bf->bf_mpdu = requeue_skb; -- bf->bf_buf_addr = pci_map_single(to_pci_dev(sc->dev), -- requeue_skb->data, -+ bf->bf_buf_addr = dma_map_single(sc->dev, requeue_skb->data, - sc->rx.bufsize, -- PCI_DMA_FROMDEVICE); -- if (unlikely(pci_dma_mapping_error(to_pci_dev(sc->dev), -+ DMA_FROM_DEVICE); -+ if (unlikely(dma_mapping_error(sc->dev, - bf->bf_buf_addr))) { - dev_kfree_skb_any(requeue_skb); - bf->bf_mpdu = NULL; - DPRINTF(sc, ATH_DBG_CONFIG, -- "pci_dma_mapping_error() on RX\n"); -+ "dma_mapping_error() on RX\n"); - break; - } - bf->bf_dmacontext = bf->bf_buf_addr; ---- a/drivers/net/wireless/ath9k/xmit.c -+++ b/drivers/net/wireless/ath9k/xmit.c -@@ -340,10 +340,8 @@ static void ath_tx_complete_buf(struct a - } - - /* Unmap this frame */ -- pci_unmap_single(to_pci_dev(sc->dev), -- bf->bf_dmacontext, -- skb->len, -- PCI_DMA_TODEVICE); -+ dma_unmap_single(sc->dev, bf->bf_dmacontext, skb->len, DMA_TO_DEVICE); -+ - /* complete this frame */ - ath_tx_complete(sc, skb, &tx_status); - -@@ -1716,13 +1714,12 @@ static int ath_tx_setup_buffer(struct at - /* DMA setup */ - bf->bf_mpdu = skb; - -- bf->bf_dmacontext = pci_map_single(to_pci_dev(sc->dev), skb->data, -- skb->len, PCI_DMA_TODEVICE); -- if (unlikely(pci_dma_mapping_error(to_pci_dev(sc->dev), -- bf->bf_dmacontext))) { -+ bf->bf_dmacontext = dma_map_single(sc->dev, skb->data, -+ skb->len, DMA_TO_DEVICE); -+ if (unlikely(dma_mapping_error(sc->dev, bf->bf_dmacontext))) { - bf->bf_mpdu = NULL; - DPRINTF(sc, ATH_DBG_CONFIG, -- "pci_dma_mapping_error() on TX\n"); -+ "dma_mapping_error() on TX\n"); - return -ENOMEM; - } - diff --git a/package/mac80211/patches/403-ath9k-introduce-bus-specific-cache-size-routine.patch b/package/mac80211/patches/403-ath9k-introduce-bus-specific-cache-size-routine.patch deleted file mode 100644 index 99acbf967f..0000000000 --- a/package/mac80211/patches/403-ath9k-introduce-bus-specific-cache-size-routine.patch +++ /dev/null @@ -1,87 +0,0 @@ -From b9aae7ff9c6ca6864434882cce9c9c6fea88220b Mon Sep 17 00:00:00 2001 -From: Gabor Juhos <juhosg@openwrt.org> -Date: Mon, 5 Jan 2009 10:57:42 +0100 -Subject: [PATCH v3 03/11] ath9k: introduce bus specific cache size routine - -The PCI specific bus_read_cachesize routine won't work on the AHB bus, -we have to replace it with a suitable one later. - -Changes-licensed-under: ISC - -Signed-off-by: Gabor Juhos <juhosg@openwrt.org> -Signed-off-by: Imre Kaloz <kaloz@openwrt.org> ---- - drivers/net/wireless/ath9k/core.h | 10 ++++++++++ - drivers/net/wireless/ath9k/main.c | 9 +++++++-- - 2 files changed, 17 insertions(+), 2 deletions(-) - ---- a/drivers/net/wireless/ath9k/core.h -+++ b/drivers/net/wireless/ath9k/core.h -@@ -693,6 +693,10 @@ enum PROT_MODE { - #define SC_OP_RFKILL_SW_BLOCKED BIT(12) - #define SC_OP_RFKILL_HW_BLOCKED BIT(13) - -+struct ath_bus_ops { -+ void (*read_cachesize)(struct ath_softc *sc, int *csz); -+}; -+ - struct ath_softc { - struct ieee80211_hw *hw; - struct device *dev; -@@ -743,6 +747,7 @@ struct ath_softc { - #ifdef CONFIG_ATH9K_DEBUG - struct ath9k_debug sc_debug; - #endif -+ struct ath_bus_ops *bus_ops; - }; - - int ath_reset(struct ath_softc *sc, bool retry_tx); -@@ -750,4 +755,9 @@ int ath_get_hal_qnum(u16 queue, struct a - int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc); - int ath_cabq_update(struct ath_softc *); - -+static inline void ath_read_cachesize(struct ath_softc *sc, int *csz) -+{ -+ sc->bus_ops->read_cachesize(sc, csz); -+} -+ - #endif /* CORE_H */ ---- a/drivers/net/wireless/ath9k/main.c -+++ b/drivers/net/wireless/ath9k/main.c -@@ -42,7 +42,7 @@ static void ath_detach(struct ath_softc - - /* return bus cachesize in 4B word units */ - --static void bus_read_cachesize(struct ath_softc *sc, int *csz) -+static void ath_pci_read_cachesize(struct ath_softc *sc, int *csz) - { - u8 u8tmp; - -@@ -1340,7 +1340,7 @@ static int ath_init(u16 devid, struct at - * Cache line size is used to size and align various - * structures used to communicate with the hardware. - */ -- bus_read_cachesize(sc, &csz); -+ ath_read_cachesize(sc, &csz); - /* XXX assert csz is non-zero */ - sc->sc_cachelsz = csz << 2; /* convert to bytes */ - -@@ -2538,6 +2538,10 @@ ath_rf_name(u16 rf_version) - return "????"; - } - -+static struct ath_bus_ops ath_pci_bus_ops = { -+ .read_cachesize = ath_pci_read_cachesize, -+}; -+ - static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) - { - void __iomem *mem; -@@ -2626,6 +2630,7 @@ static int ath_pci_probe(struct pci_dev - sc->hw = hw; - sc->dev = &pdev->dev; - sc->mem = mem; -+ sc->bus_ops = &ath_pci_bus_ops; - - if (ath_attach(id->device, sc) != 0) { - ret = -ENODEV; diff --git a/package/mac80211/patches/404-ath9k-introduce-bus-specific-cleanup-routine.patch b/package/mac80211/patches/404-ath9k-introduce-bus-specific-cleanup-routine.patch deleted file mode 100644 index 5fbb4fcec6..0000000000 --- a/package/mac80211/patches/404-ath9k-introduce-bus-specific-cleanup-routine.patch +++ /dev/null @@ -1,128 +0,0 @@ -From 72542311c85de25b6f612e8de8cfdeb96efe7308 Mon Sep 17 00:00:00 2001 -From: Gabor Juhos <juhosg@openwrt.org> -Date: Mon, 5 Jan 2009 10:59:29 +0100 -Subject: [PATCH v3 04/11] ath9k: introduce bus specific cleanup routine - -We have left only some PCI specific cleanup code. We have to convert -them as well. - -Changes-licensed-under: ISC - -Signed-off-by: Gabor Juhos <juhosg@openwrt.org> -Signed-off-by: Imre Kaloz <kaloz@openwrt.org> ---- - drivers/net/wireless/ath9k/core.h | 7 +++++++ - drivers/net/wireless/ath9k/main.c | 37 +++++++++++++++++++++++-------------- - 2 files changed, 30 insertions(+), 14 deletions(-) - ---- a/drivers/net/wireless/ath9k/core.h -+++ b/drivers/net/wireless/ath9k/core.h -@@ -695,6 +695,7 @@ enum PROT_MODE { - - struct ath_bus_ops { - void (*read_cachesize)(struct ath_softc *sc, int *csz); -+ void (*cleanup)(struct ath_softc *sc); - }; - - struct ath_softc { -@@ -704,6 +705,7 @@ struct ath_softc { - struct tasklet_struct bcon_tasklet; - struct ath_hal *sc_ah; - void __iomem *mem; -+ int irq; - spinlock_t sc_resetlock; - struct mutex mutex; - -@@ -760,4 +762,9 @@ static inline void ath_read_cachesize(st - sc->bus_ops->read_cachesize(sc, csz); - } - -+static inline void ath_bus_cleanup(struct ath_softc *sc) -+{ -+ sc->bus_ops->cleanup(sc); -+} -+ - #endif /* CORE_H */ ---- a/drivers/net/wireless/ath9k/main.c -+++ b/drivers/net/wireless/ath9k/main.c -@@ -39,6 +39,7 @@ static struct pci_device_id ath_pci_id_t - }; - - static void ath_detach(struct ath_softc *sc); -+static void ath_cleanup(struct ath_softc *sc); - - /* return bus cachesize in 4B word units */ - -@@ -1269,13 +1270,7 @@ static int ath_start_rfkill_poll(struct - rfkill_free(sc->rf_kill.rfkill); - - /* Deinitialize the device */ -- ath_detach(sc); -- if (to_pci_dev(sc->dev)->irq) -- free_irq(to_pci_dev(sc->dev)->irq, sc); -- pci_iounmap(to_pci_dev(sc->dev), sc->mem); -- pci_release_region(to_pci_dev(sc->dev), 0); -- pci_disable_device(to_pci_dev(sc->dev)); -- ieee80211_free_hw(sc->hw); -+ ath_cleanup(sc); - return -EIO; - } else { - sc->sc_flags |= SC_OP_RFKILL_REGISTERED; -@@ -1286,6 +1281,14 @@ static int ath_start_rfkill_poll(struct - } - #endif /* CONFIG_RFKILL */ - -+static void ath_cleanup(struct ath_softc *sc) -+{ -+ ath_detach(sc); -+ free_irq(sc->irq, sc); -+ ath_bus_cleanup(sc); -+ ieee80211_free_hw(sc->hw); -+} -+ - static void ath_detach(struct ath_softc *sc) - { - struct ieee80211_hw *hw = sc->hw; -@@ -2538,8 +2541,18 @@ ath_rf_name(u16 rf_version) - return "????"; - } - -+static void ath_pci_cleanup(struct ath_softc *sc) -+{ -+ struct pci_dev *pdev = to_pci_dev(sc->dev); -+ -+ pci_iounmap(pdev, sc->mem); -+ pci_release_region(pdev, 0); -+ pci_disable_device(pdev); -+} -+ - static struct ath_bus_ops ath_pci_bus_ops = { - .read_cachesize = ath_pci_read_cachesize, -+ .cleanup = ath_pci_cleanup, - }; - - static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) -@@ -2646,6 +2659,8 @@ static int ath_pci_probe(struct pci_dev - goto bad4; - } - -+ sc->irq = pdev->irq; -+ - ah = sc->sc_ah; - printk(KERN_INFO - "%s: Atheros AR%s MAC/BB Rev:%x " -@@ -2676,13 +2691,7 @@ static void ath_pci_remove(struct pci_de - struct ieee80211_hw *hw = pci_get_drvdata(pdev); - struct ath_softc *sc = hw->priv; - -- ath_detach(sc); -- if (pdev->irq) -- free_irq(pdev->irq, sc); -- pci_iounmap(pdev, sc->mem); -- pci_release_region(pdev, 0); -- pci_disable_device(pdev); -- ieee80211_free_hw(hw); -+ ath_cleanup(sc); - } - - #ifdef CONFIG_PM diff --git a/package/mac80211/patches/405-ath9k-move-PCI-code-into-separate-file.patch b/package/mac80211/patches/405-ath9k-move-PCI-code-into-separate-file.patch deleted file mode 100644 index 4a55ded9e7..0000000000 --- a/package/mac80211/patches/405-ath9k-move-PCI-code-into-separate-file.patch +++ /dev/null @@ -1,735 +0,0 @@ -From 4803193b165c67abcd7cb10dd0c178dbcffb6cc7 Mon Sep 17 00:00:00 2001 -From: Gabor Juhos <juhosg@openwrt.org> -Date: Mon, 5 Jan 2009 11:01:09 +0100 -Subject: [PATCH v3 05/11] ath9k: move PCI code into separate file - -Now that we have converted all bus specific routines to replaceable, we -can move the PCI specific codes into a separate file. - -Changes-licensed-under: ISC - -Signed-off-by: Gabor Juhos <juhosg@openwrt.org> -Signed-off-by: Imre Kaloz <kaloz@openwrt.org> ---- - drivers/net/wireless/ath9k/Makefile | 1 + - drivers/net/wireless/ath9k/core.h | 19 ++- - drivers/net/wireless/ath9k/main.c | 300 +++-------------------------------- - drivers/net/wireless/ath9k/pci.c | 287 +++++++++++++++++++++++++++++++++ - 4 files changed, 328 insertions(+), 279 deletions(-) - create mode 100644 drivers/net/wireless/ath9k/pci.c - ---- a/drivers/net/wireless/ath9k/Makefile -+++ b/drivers/net/wireless/ath9k/Makefile -@@ -11,6 +11,7 @@ ath9k-y += hw.o \ - xmit.o \ - rc.o - -+ath9k-$(CONFIG_PCI) += pci.o - ath9k-$(CONFIG_ATH9K_DEBUG) += debug.o - - obj-$(CONFIG_ATH9K) += ath9k.o ---- a/drivers/net/wireless/ath9k/core.h -+++ b/drivers/net/wireless/ath9k/core.h -@@ -18,7 +18,7 @@ - #define CORE_H - - #include <linux/etherdevice.h> --#include <linux/pci.h> -+#include <linux/device.h> - #include <net/mac80211.h> - #include <linux/leds.h> - #include <linux/rfkill.h> -@@ -767,4 +767,21 @@ static inline void ath_bus_cleanup(struc - sc->bus_ops->cleanup(sc); - } - -+extern struct ieee80211_ops ath9k_ops; -+ -+irqreturn_t ath_isr(int irq, void *dev); -+void ath_cleanup(struct ath_softc *sc); -+int ath_attach(u16 devid, struct ath_softc *sc); -+void ath_detach(struct ath_softc *sc); -+const char *ath_mac_bb_name(u32 mac_bb_version); -+const char *ath_rf_name(u16 rf_version); -+ -+#ifdef CONFIG_PCI -+int ath_pci_init(void); -+void ath_pci_exit(void); -+#else -+static inline int ath_pci_init(void) { return 0; }; -+static inline void ath_pci_exit(void) {}; -+#endif -+ - #endif /* CORE_H */ ---- a/drivers/net/wireless/ath9k/main.c -+++ b/drivers/net/wireless/ath9k/main.c -@@ -28,39 +28,6 @@ MODULE_DESCRIPTION("Support for Atheros - MODULE_SUPPORTED_DEVICE("Atheros 802.11n WLAN cards"); - MODULE_LICENSE("Dual BSD/GPL"); - --static struct pci_device_id ath_pci_id_table[] __devinitdata = { -- { PCI_VDEVICE(ATHEROS, 0x0023) }, /* PCI */ -- { PCI_VDEVICE(ATHEROS, 0x0024) }, /* PCI-E */ -- { PCI_VDEVICE(ATHEROS, 0x0027) }, /* PCI */ -- { PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */ -- { PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */ -- { PCI_VDEVICE(ATHEROS, 0x002B) }, /* PCI-E */ -- { 0 } --}; -- --static void ath_detach(struct ath_softc *sc); --static void ath_cleanup(struct ath_softc *sc); -- --/* return bus cachesize in 4B word units */ -- --static void ath_pci_read_cachesize(struct ath_softc *sc, int *csz) --{ -- u8 u8tmp; -- -- pci_read_config_byte(to_pci_dev(sc->dev), PCI_CACHE_LINE_SIZE, -- (u8 *)&u8tmp); -- *csz = (int)u8tmp; -- -- /* -- * This check was put in to avoid "unplesant" consequences if -- * the bootrom has not fully initialized all PCI devices. -- * Sometimes the cache line size register is not set -- */ -- -- if (*csz == 0) -- *csz = DEFAULT_CACHELINE >> 2; /* Use the default size */ --} -- - static void ath_cache_conf_rate(struct ath_softc *sc, - struct ieee80211_conf *conf) - { -@@ -500,7 +467,7 @@ static void ath9k_tasklet(unsigned long - ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_imask); - } - --static irqreturn_t ath_isr(int irq, void *dev) -+irqreturn_t ath_isr(int irq, void *dev) - { - struct ath_softc *sc = dev; - struct ath_hal *ah = sc->sc_ah; -@@ -1281,7 +1248,7 @@ static int ath_start_rfkill_poll(struct - } - #endif /* CONFIG_RFKILL */ - --static void ath_cleanup(struct ath_softc *sc) -+void ath_cleanup(struct ath_softc *sc) - { - ath_detach(sc); - free_irq(sc->irq, sc); -@@ -1289,7 +1256,7 @@ static void ath_cleanup(struct ath_softc - ieee80211_free_hw(sc->hw); - } - --static void ath_detach(struct ath_softc *sc) -+void ath_detach(struct ath_softc *sc) - { - struct ieee80211_hw *hw = sc->hw; - int i = 0; -@@ -1543,7 +1510,7 @@ bad: - return error; - } - --static int ath_attach(u16 devid, struct ath_softc *sc) -+int ath_attach(u16 devid, struct ath_softc *sc) - { - struct ieee80211_hw *hw = sc->hw; - int error = 0; -@@ -2466,7 +2433,7 @@ static int ath9k_ampdu_action(struct iee - return ret; - } - --static struct ieee80211_ops ath9k_ops = { -+struct ieee80211_ops ath9k_ops = { - .tx = ath9k_tx, - .start = ath9k_start, - .stop = ath9k_stop, -@@ -2510,7 +2477,7 @@ static struct { - /* - * Return the MAC/BB name. "????" is returned if the MAC/BB is unknown. - */ --static const char * -+const char * - ath_mac_bb_name(u32 mac_bb_version) - { - int i; -@@ -2527,7 +2494,7 @@ ath_mac_bb_name(u32 mac_bb_version) - /* - * Return the RF name. "????" is returned if the RF is unknown. - */ --static const char * -+const char * - ath_rf_name(u16 rf_version) - { - int i; -@@ -2541,234 +2508,7 @@ ath_rf_name(u16 rf_version) - return "????"; - } - --static void ath_pci_cleanup(struct ath_softc *sc) --{ -- struct pci_dev *pdev = to_pci_dev(sc->dev); -- -- pci_iounmap(pdev, sc->mem); -- pci_release_region(pdev, 0); -- pci_disable_device(pdev); --} -- --static struct ath_bus_ops ath_pci_bus_ops = { -- .read_cachesize = ath_pci_read_cachesize, -- .cleanup = ath_pci_cleanup, --}; -- --static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) --{ -- void __iomem *mem; -- struct ath_softc *sc; -- struct ieee80211_hw *hw; -- u8 csz; -- u32 val; -- int ret = 0; -- struct ath_hal *ah; -- -- if (pci_enable_device(pdev)) -- return -EIO; -- -- ret = pci_set_dma_mask(pdev, DMA_32BIT_MASK); -- -- if (ret) { -- printk(KERN_ERR "ath9k: 32-bit DMA not available\n"); -- goto bad; -- } -- -- ret = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); -- -- if (ret) { -- printk(KERN_ERR "ath9k: 32-bit DMA consistent " -- "DMA enable failed\n"); -- goto bad; -- } -- -- /* -- * Cache line size is used to size and align various -- * structures used to communicate with the hardware. -- */ -- pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &csz); -- if (csz == 0) { -- /* -- * Linux 2.4.18 (at least) writes the cache line size -- * register as a 16-bit wide register which is wrong. -- * We must have this setup properly for rx buffer -- * DMA to work so force a reasonable value here if it -- * comes up zero. -- */ -- csz = L1_CACHE_BYTES / sizeof(u32); -- pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, csz); -- } -- /* -- * The default setting of latency timer yields poor results, -- * set it to the value used by other systems. It may be worth -- * tweaking this setting more. -- */ -- pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xa8); -- -- pci_set_master(pdev); -- -- /* -- * Disable the RETRY_TIMEOUT register (0x41) to keep -- * PCI Tx retries from interfering with C3 CPU state. -- */ -- pci_read_config_dword(pdev, 0x40, &val); -- if ((val & 0x0000ff00) != 0) -- pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); -- -- ret = pci_request_region(pdev, 0, "ath9k"); -- if (ret) { -- dev_err(&pdev->dev, "PCI memory region reserve error\n"); -- ret = -ENODEV; -- goto bad; -- } -- -- mem = pci_iomap(pdev, 0, 0); -- if (!mem) { -- printk(KERN_ERR "PCI memory map error\n") ; -- ret = -EIO; -- goto bad1; -- } -- -- hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops); -- if (hw == NULL) { -- printk(KERN_ERR "ath_pci: no memory for ieee80211_hw\n"); -- goto bad2; -- } -- -- SET_IEEE80211_DEV(hw, &pdev->dev); -- pci_set_drvdata(pdev, hw); -- -- sc = hw->priv; -- sc->hw = hw; -- sc->dev = &pdev->dev; -- sc->mem = mem; -- sc->bus_ops = &ath_pci_bus_ops; -- -- if (ath_attach(id->device, sc) != 0) { -- ret = -ENODEV; -- goto bad3; -- } -- -- /* setup interrupt service routine */ -- -- if (request_irq(pdev->irq, ath_isr, IRQF_SHARED, "ath", sc)) { -- printk(KERN_ERR "%s: request_irq failed\n", -- wiphy_name(hw->wiphy)); -- ret = -EIO; -- goto bad4; -- } -- -- sc->irq = pdev->irq; -- -- ah = sc->sc_ah; -- printk(KERN_INFO -- "%s: Atheros AR%s MAC/BB Rev:%x " -- "AR%s RF Rev:%x: mem=0x%lx, irq=%d\n", -- wiphy_name(hw->wiphy), -- ath_mac_bb_name(ah->ah_macVersion), -- ah->ah_macRev, -- ath_rf_name((ah->ah_analog5GhzRev & AR_RADIO_SREV_MAJOR)), -- ah->ah_phyRev, -- (unsigned long)mem, pdev->irq); -- -- return 0; --bad4: -- ath_detach(sc); --bad3: -- ieee80211_free_hw(hw); --bad2: -- pci_iounmap(pdev, mem); --bad1: -- pci_release_region(pdev, 0); --bad: -- pci_disable_device(pdev); -- return ret; --} -- --static void ath_pci_remove(struct pci_dev *pdev) --{ -- struct ieee80211_hw *hw = pci_get_drvdata(pdev); -- struct ath_softc *sc = hw->priv; -- -- ath_cleanup(sc); --} -- --#ifdef CONFIG_PM -- --static int ath_pci_suspend(struct pci_dev *pdev, pm_message_t state) --{ -- struct ieee80211_hw *hw = pci_get_drvdata(pdev); -- struct ath_softc *sc = hw->priv; -- -- ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 1); -- --#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) -- if (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_RFSILENT) -- cancel_delayed_work_sync(&sc->rf_kill.rfkill_poll); --#endif -- -- pci_save_state(pdev); -- pci_disable_device(pdev); -- pci_set_power_state(pdev, 3); -- -- return 0; --} -- --static int ath_pci_resume(struct pci_dev *pdev) --{ -- struct ieee80211_hw *hw = pci_get_drvdata(pdev); -- struct ath_softc *sc = hw->priv; -- u32 val; -- int err; -- -- err = pci_enable_device(pdev); -- if (err) -- return err; -- pci_restore_state(pdev); -- /* -- * Suspend/Resume resets the PCI configuration space, so we have to -- * re-disable the RETRY_TIMEOUT register (0x41) to keep -- * PCI Tx retries from interfering with C3 CPU state -- */ -- pci_read_config_dword(pdev, 0x40, &val); -- if ((val & 0x0000ff00) != 0) -- pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); -- -- /* Enable LED */ -- ath9k_hw_cfg_output(sc->sc_ah, ATH_LED_PIN, -- AR_GPIO_OUTPUT_MUX_AS_OUTPUT); -- ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 1); -- --#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) -- /* -- * check the h/w rfkill state on resume -- * and start the rfkill poll timer -- */ -- if (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_RFSILENT) -- queue_delayed_work(sc->hw->workqueue, -- &sc->rf_kill.rfkill_poll, 0); --#endif -- -- return 0; --} -- --#endif /* CONFIG_PM */ -- --MODULE_DEVICE_TABLE(pci, ath_pci_id_table); -- --static struct pci_driver ath_pci_driver = { -- .name = "ath9k", -- .id_table = ath_pci_id_table, -- .probe = ath_pci_probe, -- .remove = ath_pci_remove, --#ifdef CONFIG_PM -- .suspend = ath_pci_suspend, -- .resume = ath_pci_resume, --#endif /* CONFIG_PM */ --}; -- --static int __init init_ath_pci(void) -+static int __init ath9k_init(void) - { - int error; - -@@ -2780,26 +2520,30 @@ static int __init init_ath_pci(void) - printk(KERN_ERR - "Unable to register rate control algorithm: %d\n", - error); -- ath_rate_control_unregister(); -- return error; -+ goto err_out; - } - -- if (pci_register_driver(&ath_pci_driver) < 0) { -+ error = ath_pci_init(); -+ if (error < 0) { - printk(KERN_ERR - "ath_pci: No devices found, driver not installed.\n"); -- ath_rate_control_unregister(); -- pci_unregister_driver(&ath_pci_driver); -- return -ENODEV; -+ error = -ENODEV; -+ goto err_rate_unregister; - } - - return 0; -+ -+ err_rate_unregister: -+ ath_rate_control_unregister(); -+ err_out: -+ return error; - } --module_init(init_ath_pci); -+module_init(ath9k_init); - --static void __exit exit_ath_pci(void) -+static void __exit ath9k_exit(void) - { -+ ath_pci_exit(); - ath_rate_control_unregister(); -- pci_unregister_driver(&ath_pci_driver); - printk(KERN_INFO "%s: Driver unloaded\n", dev_info); - } --module_exit(exit_ath_pci); -+module_exit(ath9k_exit); ---- /dev/null -+++ b/drivers/net/wireless/ath9k/pci.c -@@ -0,0 +1,287 @@ -+/* -+ * Copyright (c) 2008 Atheros Communications Inc. -+ * -+ * Permission to use, copy, modify, and/or distribute this software for any -+ * purpose with or without fee is hereby granted, provided that the above -+ * copyright notice and this permission notice appear in all copies. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+#include <linux/nl80211.h> -+#include <linux/pci.h> -+#include "core.h" -+#include "reg.h" -+#include "hw.h" -+ -+static struct pci_device_id ath_pci_id_table[] __devinitdata = { -+ { PCI_VDEVICE(ATHEROS, 0x0023) }, /* PCI */ -+ { PCI_VDEVICE(ATHEROS, 0x0024) }, /* PCI-E */ -+ { PCI_VDEVICE(ATHEROS, 0x0027) }, /* PCI */ -+ { PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */ -+ { PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */ -+ { PCI_VDEVICE(ATHEROS, 0x002B) }, /* PCI-E */ -+ { 0 } -+}; -+ -+/* return bus cachesize in 4B word units */ -+static void ath_pci_read_cachesize(struct ath_softc *sc, int *csz) -+{ -+ u8 u8tmp; -+ -+ pci_read_config_byte(to_pci_dev(sc->dev), PCI_CACHE_LINE_SIZE, -+ (u8 *)&u8tmp); -+ *csz = (int)u8tmp; -+ -+ /* -+ * This check was put in to avoid "unplesant" consequences if -+ * the bootrom has not fully initialized all PCI devices. -+ * Sometimes the cache line size register is not set -+ */ -+ -+ if (*csz == 0) -+ *csz = DEFAULT_CACHELINE >> 2; /* Use the default size */ -+} -+ -+static void ath_pci_cleanup(struct ath_softc *sc) -+{ -+ struct pci_dev *pdev = to_pci_dev(sc->dev); -+ -+ pci_iounmap(pdev, sc->mem); -+ pci_release_region(pdev, 0); -+ pci_disable_device(pdev); -+} -+ -+static struct ath_bus_ops ath_pci_bus_ops = { -+ .read_cachesize = ath_pci_read_cachesize, -+ .cleanup = ath_pci_cleanup, -+}; -+ -+static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) -+{ -+ void __iomem *mem; -+ struct ath_softc *sc; -+ struct ieee80211_hw *hw; -+ u8 csz; -+ u32 val; -+ int ret = 0; -+ struct ath_hal *ah; -+ -+ if (pci_enable_device(pdev)) -+ return -EIO; -+ -+ ret = pci_set_dma_mask(pdev, DMA_32BIT_MASK); -+ -+ if (ret) { -+ printk(KERN_ERR "ath9k: 32-bit DMA not available\n"); -+ goto bad; -+ } -+ -+ ret = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); -+ -+ if (ret) { -+ printk(KERN_ERR "ath9k: 32-bit DMA consistent " -+ "DMA enable failed\n"); -+ goto bad; -+ } -+ -+ /* -+ * Cache line size is used to size and align various -+ * structures used to communicate with the hardware. -+ */ -+ pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &csz); -+ if (csz == 0) { -+ /* -+ * Linux 2.4.18 (at least) writes the cache line size -+ * register as a 16-bit wide register which is wrong. -+ * We must have this setup properly for rx buffer -+ * DMA to work so force a reasonable value here if it -+ * comes up zero. -+ */ -+ csz = L1_CACHE_BYTES / sizeof(u32); -+ pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, csz); -+ } -+ /* -+ * The default setting of latency timer yields poor results, -+ * set it to the value used by other systems. It may be worth -+ * tweaking this setting more. -+ */ -+ pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xa8); -+ -+ pci_set_master(pdev); -+ -+ /* -+ * Disable the RETRY_TIMEOUT register (0x41) to keep -+ * PCI Tx retries from interfering with C3 CPU state. -+ */ -+ pci_read_config_dword(pdev, 0x40, &val); -+ if ((val & 0x0000ff00) != 0) -+ pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); -+ -+ ret = pci_request_region(pdev, 0, "ath9k"); -+ if (ret) { -+ dev_err(&pdev->dev, "PCI memory region reserve error\n"); -+ ret = -ENODEV; -+ goto bad; -+ } -+ -+ mem = pci_iomap(pdev, 0, 0); -+ if (!mem) { -+ printk(KERN_ERR "PCI memory map error\n") ; -+ ret = -EIO; -+ goto bad1; -+ } -+ -+ hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops); -+ if (hw == NULL) { -+ printk(KERN_ERR "ath_pci: no memory for ieee80211_hw\n"); -+ goto bad2; -+ } -+ -+ SET_IEEE80211_DEV(hw, &pdev->dev); -+ pci_set_drvdata(pdev, hw); -+ -+ sc = hw->priv; -+ sc->hw = hw; -+ sc->dev = &pdev->dev; -+ sc->mem = mem; -+ sc->bus_ops = &ath_pci_bus_ops; -+ -+ if (ath_attach(id->device, sc) != 0) { -+ ret = -ENODEV; -+ goto bad3; -+ } -+ -+ /* setup interrupt service routine */ -+ -+ if (request_irq(pdev->irq, ath_isr, IRQF_SHARED, "ath", sc)) { -+ printk(KERN_ERR "%s: request_irq failed\n", -+ wiphy_name(hw->wiphy)); -+ ret = -EIO; -+ goto bad4; -+ } -+ -+ sc->irq = pdev->irq; -+ -+ ah = sc->sc_ah; -+ printk(KERN_INFO -+ "%s: Atheros AR%s MAC/BB Rev:%x " -+ "AR%s RF Rev:%x: mem=0x%lx, irq=%d\n", -+ wiphy_name(hw->wiphy), -+ ath_mac_bb_name(ah->ah_macVersion), -+ ah->ah_macRev, -+ ath_rf_name((ah->ah_analog5GhzRev & AR_RADIO_SREV_MAJOR)), -+ ah->ah_phyRev, -+ (unsigned long)mem, pdev->irq); -+ -+ return 0; -+bad4: -+ ath_detach(sc); -+bad3: -+ ieee80211_free_hw(hw); -+bad2: -+ pci_iounmap(pdev, mem); -+bad1: -+ pci_release_region(pdev, 0); -+bad: -+ pci_disable_device(pdev); -+ return ret; -+} -+ -+static void ath_pci_remove(struct pci_dev *pdev) -+{ -+ struct ieee80211_hw *hw = pci_get_drvdata(pdev); -+ struct ath_softc *sc = hw->priv; -+ -+ ath_cleanup(sc); -+} -+ -+#ifdef CONFIG_PM -+ -+static int ath_pci_suspend(struct pci_dev *pdev, pm_message_t state) -+{ -+ struct ieee80211_hw *hw = pci_get_drvdata(pdev); -+ struct ath_softc *sc = hw->priv; -+ -+ ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 1); -+ -+#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) -+ if (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_RFSILENT) -+ cancel_delayed_work_sync(&sc->rf_kill.rfkill_poll); -+#endif -+ -+ pci_save_state(pdev); -+ pci_disable_device(pdev); -+ pci_set_power_state(pdev, 3); -+ -+ return 0; -+} -+ -+static int ath_pci_resume(struct pci_dev *pdev) -+{ -+ struct ieee80211_hw *hw = pci_get_drvdata(pdev); -+ struct ath_softc *sc = hw->priv; -+ u32 val; -+ int err; -+ -+ err = pci_enable_device(pdev); -+ if (err) -+ return err; -+ pci_restore_state(pdev); -+ /* -+ * Suspend/Resume resets the PCI configuration space, so we have to -+ * re-disable the RETRY_TIMEOUT register (0x41) to keep -+ * PCI Tx retries from interfering with C3 CPU state -+ */ -+ pci_read_config_dword(pdev, 0x40, &val); -+ if ((val & 0x0000ff00) != 0) -+ pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); -+ -+ /* Enable LED */ -+ ath9k_hw_cfg_output(sc->sc_ah, ATH_LED_PIN, -+ AR_GPIO_OUTPUT_MUX_AS_OUTPUT); -+ ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 1); -+ -+#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) -+ /* -+ * check the h/w rfkill state on resume -+ * and start the rfkill poll timer -+ */ -+ if (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_RFSILENT) -+ queue_delayed_work(sc->hw->workqueue, -+ &sc->rf_kill.rfkill_poll, 0); -+#endif -+ -+ return 0; -+} -+ -+#endif /* CONFIG_PM */ -+ -+MODULE_DEVICE_TABLE(pci, ath_pci_id_table); -+ -+static struct pci_driver ath_pci_driver = { -+ .name = "ath9k", -+ .id_table = ath_pci_id_table, -+ .probe = ath_pci_probe, -+ .remove = ath_pci_remove, -+#ifdef CONFIG_PM -+ .suspend = ath_pci_suspend, -+ .resume = ath_pci_resume, -+#endif /* CONFIG_PM */ -+}; -+ -+int __init ath_pci_init(void) -+{ -+ return pci_register_driver(&ath_pci_driver); -+} -+ -+void ath_pci_exit(void) -+{ -+ pci_unregister_driver(&ath_pci_driver); -+} diff --git a/package/mac80211/patches/406-ath9k-introduce-platform-driver-for-AHB-bus-support.patch b/package/mac80211/patches/406-ath9k-introduce-platform-driver-for-AHB-bus-support.patch deleted file mode 100644 index 7b04128268..0000000000 --- a/package/mac80211/patches/406-ath9k-introduce-platform-driver-for-AHB-bus-support.patch +++ /dev/null @@ -1,236 +0,0 @@ -From 23f9e44a18b5a2dfaa1326aa30dd07e1449e8b5f Mon Sep 17 00:00:00 2001 -From: Gabor Juhos <juhosg@openwrt.org> -Date: Mon, 5 Jan 2009 11:03:17 +0100 -Subject: [PATCH v3 06/11] ath9k: introduce platform driver for AHB bus support - -This patch adds the platform_driver itself, and modifies the main driver -to register it. - -Changes-licensed-under: ISC - -Signed-off-by: Gabor Juhos <juhosg@openwrt.org> -Signed-off-by: Imre Kaloz <kaloz@openwrt.org> ---- - drivers/net/wireless/ath9k/Makefile | 1 + - drivers/net/wireless/ath9k/ahb.c | 160 +++++++++++++++++++++++++++++++++++ - drivers/net/wireless/ath9k/core.h | 8 ++ - drivers/net/wireless/ath9k/main.c | 10 ++ - 4 files changed, 179 insertions(+), 0 deletions(-) - create mode 100644 drivers/net/wireless/ath9k/ahb.c - ---- a/drivers/net/wireless/ath9k/Makefile -+++ b/drivers/net/wireless/ath9k/Makefile -@@ -12,6 +12,7 @@ ath9k-y += hw.o \ - rc.o - - ath9k-$(CONFIG_PCI) += pci.o -+ath9k-$(CONFIG_ATHEROS_AR71XX) += ahb.o - ath9k-$(CONFIG_ATH9K_DEBUG) += debug.o - - obj-$(CONFIG_ATH9K) += ath9k.o ---- /dev/null -+++ b/drivers/net/wireless/ath9k/ahb.c -@@ -0,0 +1,160 @@ -+/* -+ * Copyright (c) 2008 Atheros Communications Inc. -+ * Copyright (c) 2009 Gabor Juhos <juhosg@openwrt.org> -+ * Copyright (c) 2009 Imre Kaloz <kaloz@openwrt.org> -+ * -+ * Permission to use, copy, modify, and/or distribute this software for any -+ * purpose with or without fee is hereby granted, provided that the above -+ * copyright notice and this permission notice appear in all copies. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+#include <linux/nl80211.h> -+#include <linux/platform_device.h> -+#include "core.h" -+#include "reg.h" -+#include "hw.h" -+ -+/* return bus cachesize in 4B word units */ -+static void ath_ahb_read_cachesize(struct ath_softc *sc, int *csz) -+{ -+ *csz = L1_CACHE_BYTES >> 2; -+} -+ -+static void ath_ahb_cleanup(struct ath_softc *sc) -+{ -+ iounmap(sc->mem); -+} -+ -+static struct ath_bus_ops ath_ahb_bus_ops = { -+ .read_cachesize = ath_ahb_read_cachesize, -+ .cleanup = ath_ahb_cleanup, -+}; -+ -+static int ath_ahb_probe(struct platform_device *pdev) -+{ -+ void __iomem *mem; -+ struct ath_softc *sc; -+ struct ieee80211_hw *hw; -+ struct resource *res; -+ int irq; -+ int ret = 0; -+ struct ath_hal *ah; -+ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ if (res == NULL) { -+ dev_err(&pdev->dev, "no memory resource found\n"); -+ ret = -ENXIO; -+ goto err_out; -+ } -+ -+ mem = ioremap_nocache(res->start, res->end - res->start + 1); -+ if (mem == NULL) { -+ dev_err(&pdev->dev, "ioremap failed\n"); -+ ret = -ENOMEM; -+ goto err_out; -+ } -+ -+ res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); -+ if (res == NULL) { -+ dev_err(&pdev->dev, "no IRQ resource found\n"); -+ ret = -ENXIO; -+ goto err_iounmap; -+ } -+ -+ irq = res->start; -+ -+ hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops); -+ if (hw == NULL) { -+ dev_err(&pdev->dev, "no memory for ieee80211_hw\n"); -+ ret = -ENOMEM; -+ goto err_iounmap; -+ } -+ -+ SET_IEEE80211_DEV(hw, &pdev->dev); -+ platform_set_drvdata(pdev, hw); -+ -+ sc = hw->priv; -+ sc->hw = hw; -+ sc->dev = &pdev->dev; -+ sc->mem = mem; -+ sc->bus_ops = &ath_ahb_bus_ops; -+ sc->irq = irq; -+ -+ ret = ath_attach(AR5416_AR9100_DEVID, sc); -+ if (ret != 0) { -+ dev_err(&pdev->dev, "failed to attach device, err=%d\n", ret); -+ ret = -ENODEV; -+ goto err_free_hw; -+ } -+ -+ ret = request_irq(irq, ath_isr, IRQF_SHARED, "ath9k", sc); -+ if (ret) { -+ dev_err(&pdev->dev, "request_irq failed, err=%d\n", ret); -+ ret = -EIO; -+ goto err_detach; -+ } -+ -+ ah = sc->sc_ah; -+ printk(KERN_INFO -+ "%s: Atheros AR%s MAC/BB Rev:%x, " -+ "AR%s RF Rev:%x, mem=0x%lx, irq=%d\n", -+ wiphy_name(hw->wiphy), -+ ath_mac_bb_name(ah->ah_macVersion), -+ ah->ah_macRev, -+ ath_rf_name((ah->ah_analog5GhzRev & AR_RADIO_SREV_MAJOR)), -+ ah->ah_phyRev, -+ (unsigned long)mem, irq); -+ -+ return 0; -+ -+ err_detach: -+ ath_detach(sc); -+ err_free_hw: -+ ieee80211_free_hw(hw); -+ platform_set_drvdata(pdev, NULL); -+ err_iounmap: -+ iounmap(mem); -+ err_out: -+ return ret; -+} -+ -+static int ath_ahb_remove(struct platform_device *pdev) -+{ -+ struct ieee80211_hw *hw = platform_get_drvdata(pdev); -+ -+ if (hw) { -+ struct ath_softc *sc = hw->priv; -+ -+ ath_cleanup(sc); -+ platform_set_drvdata(pdev, NULL); -+ } -+ -+ return 0; -+} -+ -+static struct platform_driver ath_ahb_driver = { -+ .probe = ath_ahb_probe, -+ .remove = ath_ahb_remove, -+ .driver = { -+ .name = "ath9k", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+int ath_ahb_init(void) -+{ -+ return platform_driver_register(&ath_ahb_driver); -+} -+ -+void ath_ahb_exit(void) -+{ -+ platform_driver_unregister(&ath_ahb_driver); -+} ---- a/drivers/net/wireless/ath9k/core.h -+++ b/drivers/net/wireless/ath9k/core.h -@@ -784,4 +784,12 @@ static inline int ath_pci_init(void) { r - static inline void ath_pci_exit(void) {}; - #endif - -+#ifdef CONFIG_ATHEROS_AR71XX -+int ath_ahb_init(void); -+void ath_ahb_exit(void); -+#else -+static inline int ath_ahb_init(void) { return 0; }; -+static inline void ath_ahb_exit(void) {}; -+#endif -+ - #endif /* CORE_H */ ---- a/drivers/net/wireless/ath9k/main.c -+++ b/drivers/net/wireless/ath9k/main.c -@@ -2531,8 +2531,17 @@ static int __init ath9k_init(void) - goto err_rate_unregister; - } - -+ error = ath_ahb_init(); -+ if (error < 0) { -+ error = -ENODEV; -+ goto err_pci_exit; -+ } -+ - return 0; - -+ err_pci_exit: -+ ath_pci_exit(); -+ - err_rate_unregister: - ath_rate_control_unregister(); - err_out: -@@ -2542,6 +2551,7 @@ module_init(ath9k_init); - - static void __exit ath9k_exit(void) - { -+ ath_ahb_exit(); - ath_pci_exit(); - ath_rate_control_unregister(); - printk(KERN_INFO "%s: Driver unloaded\n", dev_info); diff --git a/package/mac80211/patches/407-ath9k-get-EEPROM-contents-from-platform-data-on-AHB.patch b/package/mac80211/patches/407-ath9k-get-EEPROM-contents-from-platform-data-on-AHB.patch deleted file mode 100644 index 4394c3c4ce..0000000000 --- a/package/mac80211/patches/407-ath9k-get-EEPROM-contents-from-platform-data-on-AHB.patch +++ /dev/null @@ -1,215 +0,0 @@ -From 5941741f36a3870e8d22760e290ae7ea45293cdd Mon Sep 17 00:00:00 2001 -From: Gabor Juhos <juhosg@openwrt.org> -Date: Mon, 5 Jan 2009 11:05:05 +0100 -Subject: [PATCH v3 07/11] ath9k: get EEPROM contents from platform data on AHB bus - -On the AR913x SOCs we have to provide EEPROM contents via platform_data, -because accessing the flash via MMIO is not safe. Additionally different -boards may store the radio calibration data at different locations. - -Changes-licensed-under: ISC - -Signed-off-by: Gabor Juhos <juhosg@openwrt.org> -Signed-off-by: Imre Kaloz <kaloz@openwrt.org> ---- - drivers/net/wireless/ath9k/ahb.c | 27 ++++++++++++++++++ - drivers/net/wireless/ath9k/core.h | 1 + - drivers/net/wireless/ath9k/eeprom.c | 51 ++-------------------------------- - drivers/net/wireless/ath9k/pci.c | 18 ++++++++++++ - include/linux/ath9k_platform.h | 28 +++++++++++++++++++ - 5 files changed, 77 insertions(+), 48 deletions(-) - create mode 100644 include/linux/ath9k_platform.h - ---- a/drivers/net/wireless/ath9k/ahb.c -+++ b/drivers/net/wireless/ath9k/ahb.c -@@ -18,6 +18,7 @@ - - #include <linux/nl80211.h> - #include <linux/platform_device.h> -+#include <linux/ath9k_platform.h> - #include "core.h" - #include "reg.h" - #include "hw.h" -@@ -33,9 +34,29 @@ static void ath_ahb_cleanup(struct ath_s - iounmap(sc->mem); - } - -+static bool ath_ahb_eeprom_read(struct ath_hal *ah, u32 off, u16 *data) -+{ -+ struct ath_softc *sc = ah->ah_sc; -+ struct platform_device *pdev = to_platform_device(sc->dev); -+ struct ath9k_platform_data *pdata; -+ -+ pdata = (struct ath9k_platform_data *) pdev->dev.platform_data; -+ if (off >= (ARRAY_SIZE(pdata->eeprom_data))) { -+ DPRINTF(ah->ah_sc, ATH_DBG_FATAL, -+ "%s: flash read failed, offset %08x is out of range\n", -+ __func__, off); -+ return false; -+ } -+ -+ *data = pdata->eeprom_data[off]; -+ return true; -+} -+ - static struct ath_bus_ops ath_ahb_bus_ops = { - .read_cachesize = ath_ahb_read_cachesize, - .cleanup = ath_ahb_cleanup, -+ -+ .eeprom_read = ath_ahb_eeprom_read, - }; - - static int ath_ahb_probe(struct platform_device *pdev) -@@ -48,6 +69,12 @@ static int ath_ahb_probe(struct platform - int ret = 0; - struct ath_hal *ah; - -+ if (!pdev->dev.platform_data) { -+ dev_err(&pdev->dev, "no platform data specified\n"); -+ ret = -EINVAL; -+ goto err_out; -+ } -+ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (res == NULL) { - dev_err(&pdev->dev, "no memory resource found\n"); ---- a/drivers/net/wireless/ath9k/core.h -+++ b/drivers/net/wireless/ath9k/core.h -@@ -696,6 +696,7 @@ enum PROT_MODE { - struct ath_bus_ops { - void (*read_cachesize)(struct ath_softc *sc, int *csz); - void (*cleanup)(struct ath_softc *sc); -+ bool (*eeprom_read)(struct ath_hal *ah, u32 off, u16 *data); - }; - - struct ath_softc { ---- a/drivers/net/wireless/ath9k/eeprom.c -+++ b/drivers/net/wireless/ath9k/eeprom.c -@@ -91,53 +91,11 @@ static inline bool ath9k_hw_get_lower_up - return false; - } - --static bool ath9k_hw_eeprom_read(struct ath_hal *ah, u32 off, u16 *data) --{ -- (void)REG_READ(ah, AR5416_EEPROM_OFFSET + (off << AR5416_EEPROM_S)); -- -- if (!ath9k_hw_wait(ah, -- AR_EEPROM_STATUS_DATA, -- AR_EEPROM_STATUS_DATA_BUSY | -- AR_EEPROM_STATUS_DATA_PROT_ACCESS, 0)) { -- return false; -- } -- -- *data = MS(REG_READ(ah, AR_EEPROM_STATUS_DATA), -- AR_EEPROM_STATUS_DATA_VAL); -- -- return true; --} -- --static int ath9k_hw_flash_map(struct ath_hal *ah) --{ -- struct ath_hal_5416 *ahp = AH5416(ah); -- -- ahp->ah_cal_mem = ioremap(AR5416_EEPROM_START_ADDR, AR5416_EEPROM_MAX); -- -- if (!ahp->ah_cal_mem) { -- DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, -- "cannot remap eeprom region \n"); -- return -EIO; -- } -- -- return 0; --} -- --static bool ath9k_hw_flash_read(struct ath_hal *ah, u32 off, u16 *data) --{ -- struct ath_hal_5416 *ahp = AH5416(ah); -- -- *data = ioread16(ahp->ah_cal_mem + off); -- -- return true; --} -- - static inline bool ath9k_hw_nvram_read(struct ath_hal *ah, u32 off, u16 *data) - { -- if (ath9k_hw_use_flash(ah)) -- return ath9k_hw_flash_read(ah, off, data); -- else -- return ath9k_hw_eeprom_read(ah, off, data); -+ struct ath_softc *sc = ah->ah_sc; -+ -+ return sc->bus_ops->eeprom_read(ah, off, data); - } - - static bool ath9k_hw_fill_4k_eeprom(struct ath_hal *ah) -@@ -2825,9 +2783,6 @@ int ath9k_hw_eeprom_attach(struct ath_ha - int status; - struct ath_hal_5416 *ahp = AH5416(ah); - -- if (ath9k_hw_use_flash(ah)) -- ath9k_hw_flash_map(ah); -- - if (AR_SREV_9285(ah)) - ahp->ah_eep_map = EEP_MAP_4KBITS; - else ---- a/drivers/net/wireless/ath9k/pci.c -+++ b/drivers/net/wireless/ath9k/pci.c -@@ -58,9 +58,27 @@ static void ath_pci_cleanup(struct ath_s - pci_disable_device(pdev); - } - -+static bool ath_pci_eeprom_read(struct ath_hal *ah, u32 off, u16 *data) -+{ -+ (void)REG_READ(ah, AR5416_EEPROM_OFFSET + (off << AR5416_EEPROM_S)); -+ -+ if (!ath9k_hw_wait(ah, -+ AR_EEPROM_STATUS_DATA, -+ AR_EEPROM_STATUS_DATA_BUSY | -+ AR_EEPROM_STATUS_DATA_PROT_ACCESS, 0)) { -+ return false; -+ } -+ -+ *data = MS(REG_READ(ah, AR_EEPROM_STATUS_DATA), -+ AR_EEPROM_STATUS_DATA_VAL); -+ -+ return true; -+} -+ - static struct ath_bus_ops ath_pci_bus_ops = { - .read_cachesize = ath_pci_read_cachesize, - .cleanup = ath_pci_cleanup, -+ .eeprom_read = ath_pci_eeprom_read, - }; - - static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) ---- /dev/null -+++ b/include/linux/ath9k_platform.h -@@ -0,0 +1,28 @@ -+/* -+ * Copyright (c) 2008 Atheros Communications Inc. -+ * Copyright (c) 2009 Gabor Juhos <juhosg@openwrt.org> -+ * Copyright (c) 2009 Imre Kaloz <kaloz@openwrt.org> -+ * -+ * Permission to use, copy, modify, and/or distribute this software for any -+ * purpose with or without fee is hereby granted, provided that the above -+ * copyright notice and this permission notice appear in all copies. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+#ifndef _LINUX_ATH9K_PLATFORM_H -+#define _LINUX_ATH9K_PLATFORM_H -+ -+#define ATH9K_PLAT_EEP_MAX_WORDS 2048 -+ -+struct ath9k_platform_data { -+ u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS]; -+}; -+ -+#endif /* _LINUX_ATH9K_PLATFORM_H */ diff --git a/package/mac80211/patches/408-ath9k-remove-u16-casts-from-rtc-register-access.patch b/package/mac80211/patches/408-ath9k-remove-u16-casts-from-rtc-register-access.patch deleted file mode 100644 index 1bea258bd4..0000000000 --- a/package/mac80211/patches/408-ath9k-remove-u16-casts-from-rtc-register-access.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 480e7cbba032b1710768ffa1f067f34f99016a73 Mon Sep 17 00:00:00 2001 -From: Gabor Juhos <juhosg@openwrt.org> -Date: Mon, 5 Jan 2009 11:11:28 +0100 -Subject: [PATCH v3 08/11] ath9k: remove (u16) casts from rtc register access - -The RTC register offsets don't fit into 'u16' on the AR913x, so we have -to remove the existing casts. - -Changes-licensed-under: ISC - -Signed-off-by: Gabor Juhos <juhosg@openwrt.org> -Signed-off-by: Imre Kaloz <kaloz@openwrt.org> ---- - drivers/net/wireless/ath9k/hw.c | 14 +++++++------- - drivers/net/wireless/ath9k/reg.h | 4 ++-- - 2 files changed, 9 insertions(+), 9 deletions(-) - ---- a/drivers/net/wireless/ath9k/hw.c -+++ b/drivers/net/wireless/ath9k/hw.c -@@ -1008,7 +1008,7 @@ static void ath9k_hw_init_pll(struct ath - pll |= SM(0xb, AR_RTC_PLL_DIV); - } - } -- REG_WRITE(ah, (u16) (AR_RTC_PLL_CONTROL), pll); -+ REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll); - - udelay(RTC_PLL_SETTLE_DELAY); - -@@ -1547,11 +1547,11 @@ static bool ath9k_hw_set_reset(struct at - rst_flags |= AR_RTC_RC_MAC_COLD; - } - -- REG_WRITE(ah, (u16) (AR_RTC_RC), rst_flags); -+ REG_WRITE(ah, AR_RTC_RC, rst_flags); - udelay(50); - -- REG_WRITE(ah, (u16) (AR_RTC_RC), 0); -- if (!ath9k_hw_wait(ah, (u16) (AR_RTC_RC), AR_RTC_RC_M, 0)) { -+ REG_WRITE(ah, AR_RTC_RC, 0); -+ if (!ath9k_hw_wait(ah, AR_RTC_RC, AR_RTC_RC_M, 0)) { - DPRINTF(ah->ah_sc, ATH_DBG_RESET, - "RTC stuck in MAC reset\n"); - return false; -@@ -1573,8 +1573,8 @@ static bool ath9k_hw_set_reset_power_on( - REG_WRITE(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN | - AR_RTC_FORCE_WAKE_ON_INT); - -- REG_WRITE(ah, (u16) (AR_RTC_RESET), 0); -- REG_WRITE(ah, (u16) (AR_RTC_RESET), 1); -+ REG_WRITE(ah, AR_RTC_RESET, 0); -+ REG_WRITE(ah, AR_RTC_RESET, 1); - - if (!ath9k_hw_wait(ah, - AR_RTC_STATUS, -@@ -2616,7 +2616,7 @@ static void ath9k_set_power_sleep(struct - if (!AR_SREV_9100(ah)) - REG_WRITE(ah, AR_RC, AR_RC_AHB | AR_RC_HOSTIF); - -- REG_CLR_BIT(ah, (u16) (AR_RTC_RESET), -+ REG_CLR_BIT(ah, (AR_RTC_RESET), - AR_RTC_RESET_EN); - } - } ---- a/drivers/net/wireless/ath9k/reg.h -+++ b/drivers/net/wireless/ath9k/reg.h -@@ -953,7 +953,7 @@ enum { - - #define AR_RTC_BASE 0x00020000 - #define AR_RTC_RC \ -- (AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x0000) : 0x7000 -+ ((AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x0000) : 0x7000) - #define AR_RTC_RC_M 0x00000003 - #define AR_RTC_RC_MAC_WARM 0x00000001 - #define AR_RTC_RC_MAC_COLD 0x00000002 -@@ -961,7 +961,7 @@ enum { - #define AR_RTC_RC_WARM_RESET 0x00000008 - - #define AR_RTC_PLL_CONTROL \ -- (AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x0014) : 0x7014 -+ ((AR_SREV_9100(ah)) ? (AR_RTC_BASE + 0x0014) : 0x7014) - - #define AR_RTC_PLL_DIV 0x0000001f - #define AR_RTC_PLL_DIV_S 0 diff --git a/package/mac80211/patches/409-ath9k-fix-ar5416Addac_9100-values.patch b/package/mac80211/patches/409-ath9k-fix-ar5416Addac_9100-values.patch deleted file mode 100644 index e868c7b199..0000000000 --- a/package/mac80211/patches/409-ath9k-fix-ar5416Addac_9100-values.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 7421bd5ad39586fe58e487477e154275479b6821 Mon Sep 17 00:00:00 2001 -From: Gabor Juhos <juhosg@openwrt.org> -Date: Mon, 5 Jan 2009 11:13:04 +0100 -Subject: [PATCH v3 09/11] ath9k: fix ar5416Addac_9100 values - -Writing the register at offset 0x98c4 causes a deadlock on the AR913x -SoCs. Although i don't have detailed knowledge about these registers, -but if i change the register offset according to the 'ar5416Addac' table, -it works. Additionally there is no reference to the 0x98c4 elsewhere. - -Changes-licensed-under: ISC - -Signed-off-by: Gabor Juhos <juhosg@openwrt.org> -Signed-off-by: Imre Kaloz <kaloz@openwrt.org> ---- - drivers/net/wireless/ath9k/initvals.h | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - ---- a/drivers/net/wireless/ath9k/initvals.h -+++ b/drivers/net/wireless/ath9k/initvals.h -@@ -658,7 +658,7 @@ static const u32 ar5416Addac_9100[][2] = - {0x0000989c, 0x00000000 }, - {0x0000989c, 0x00000000 }, - {0x0000989c, 0x00000000 }, -- {0x000098c4, 0x00000000 }, -+ {0x000098cc, 0x00000000 }, - }; - - static const u32 ar5416Modes[][6] = { diff --git a/package/mac80211/patches/410-ath9k-fix-null-pointer-dereference-in-ani-monitor-c.patch b/package/mac80211/patches/410-ath9k-fix-null-pointer-dereference-in-ani-monitor-c.patch deleted file mode 100644 index 61b8e85a80..0000000000 --- a/package/mac80211/patches/410-ath9k-fix-null-pointer-dereference-in-ani-monitor-c.patch +++ /dev/null @@ -1,40 +0,0 @@ -From ea298030ddc0089f308eec39571355aa359a1563 Mon Sep 17 00:00:00 2001 -From: Gabor Juhos <juhosg@openwrt.org> -Date: Mon, 5 Jan 2009 11:14:14 +0100 -Subject: [PATCH v3 10/11] ath9k: fix null pointer dereference in ani monitor code - -In 'ath9k_ani_reset' the 'ahp->ah_curani' will be initialized only -if 'DO_ANI(ah)' true. In 'ath9k_hw_ani_monitor' we are using -'ahp->ah_curani' unconditionally, and it will cause a NULL pointer -dereference on AR9100. - -Changes-licensed-under: ISC - -Signed-off-by: Gabor Juhos <juhosg@openwrt.org> -Signed-off-by: Imre Kaloz <kaloz@openwrt.org> ---- - drivers/net/wireless/ath9k/ani.c | 6 +++--- - 1 files changed, 3 insertions(+), 3 deletions(-) - ---- a/drivers/net/wireless/ath9k/ani.c -+++ b/drivers/net/wireless/ath9k/ani.c -@@ -551,6 +551,9 @@ void ath9k_hw_ani_monitor(struct ath_hal - struct ar5416AniState *aniState; - int32_t listenTime; - -+ if (!DO_ANI(ah)) -+ return; -+ - aniState = ahp->ah_curani; - ahp->ah_stats.ast_nodestats = *stats; - -@@ -610,9 +613,6 @@ void ath9k_hw_ani_monitor(struct ath_hal - aniState->cckPhyErrCount = cckPhyErrCnt; - } - -- if (!DO_ANI(ah)) -- return; -- - if (aniState->listenTime > 5 * ahp->ah_aniPeriod) { - if (aniState->ofdmPhyErrCount <= aniState->listenTime * - aniState->ofdmTrigLow / 1000 && diff --git a/package/mac80211/patches/411-ath9k-enable-support-for-AR9100.patch b/package/mac80211/patches/411-ath9k-enable-support-for-AR9100.patch deleted file mode 100644 index f9c28b0329..0000000000 --- a/package/mac80211/patches/411-ath9k-enable-support-for-AR9100.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 40f16a1776f223eee7eeb00860e8215e7ce33a98 Mon Sep 17 00:00:00 2001 -From: Gabor Juhos <juhosg@openwrt.org> -Date: Mon, 5 Jan 2009 11:10:28 +0100 -Subject: [PATCH v3 11/11] ath9k: enable support for AR9100 - -Because we have support for the AR9100 devices now, we can enable them. - -Changes-licensed-under: ISC - -Signed-off-by: Gabor Juhos <juhosg@openwrt.org> -Signed-off-by: Imre Kaloz <kaloz@openwrt.org> ---- - drivers/net/wireless/ath9k/hw.c | 3 +++ - 1 files changed, 3 insertions(+), 0 deletions(-) - ---- a/drivers/net/wireless/ath9k/hw.c -+++ b/drivers/net/wireless/ath9k/hw.c -@@ -373,6 +373,8 @@ static const char *ath9k_hw_devname(u16 - return "Atheros 5418"; - case AR9160_DEVID_PCI: - return "Atheros 9160"; -+ case AR5416_AR9100_DEVID: -+ return "Atheros 9100"; - case AR9280_DEVID_PCI: - case AR9280_DEVID_PCIE: - return "Atheros 9280"; -@@ -1176,6 +1178,7 @@ struct ath_hal *ath9k_hw_attach(u16 devi - switch (devid) { - case AR5416_DEVID_PCI: - case AR5416_DEVID_PCIE: -+ case AR5416_AR9100_DEVID: - case AR9160_DEVID_PCI: - case AR9280_DEVID_PCI: - case AR9280_DEVID_PCIE: diff --git a/package/mac80211/patches/421-ath9k_print_correct_revision_of_an_unsupported_radio.patch b/package/mac80211/patches/421-ath9k_print_correct_revision_of_an_unsupported_radio.patch deleted file mode 100644 index 620ea591e1..0000000000 --- a/package/mac80211/patches/421-ath9k_print_correct_revision_of_an_unsupported_radio.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/drivers/net/wireless/ath9k/hw.c -+++ b/drivers/net/wireless/ath9k/hw.c -@@ -509,10 +509,10 @@ static int ath9k_hw_rf_claim(struct ath_ - case AR_RAD2122_SREV_MAJOR: - break; - default: -- DPRINTF(ah->ah_sc, ATH_DBG_CHANNEL, -+ DPRINTF(ah->ah_sc, ATH_DBG_FATAL, - "5G Radio Chip Rev 0x%02X is not " - "supported by this driver\n", -- ah->ah_analog5GhzRev); -+ val); - return -EOPNOTSUPP; - } - |