1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-24 20:53:22 +02:00

[PATCH] Update mac80211 and make b43 driver build and load on targets other than brcm47xx (#4266)

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>


git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13431 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2008-11-29 15:48:42 +00:00
parent 93ca37623f
commit d52a2c41bf
14 changed files with 856 additions and 1187 deletions

View File

@ -13,12 +13,12 @@ PKG_NAME:=mac80211
PKG_RELEASE:=1
ifneq ($(CONFIG_LINUX_2_6_27),)
PKG_VERSION:=2008-11-03
PKG_SOURCE_URL:=http://www.orbit-lab.org/kernel/compat-wireless-2.6/2008/11
PKG_VERSION:=2008-11-29
PKG_SOURCE_URL:=http://wireless.kernel.org/download/compat-wireless-2.6/
else
PKG_VERSION:=2008-08-06
PKG_SOURCE_URL:=http://www.orbit-lab.org/kernel/compat-wireless-2.6/2008/08
PATCH_DIR:=$(if $(CONFIG_TARGET_brcm47xx),./patches-brcm,./patches-old)
PATCH_DIR:=./patches-old
endif
PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2
@ -288,7 +288,7 @@ define KernelPackage/b43-common
SUBMENU:=$(WMENU)
TITLE:=Generic stuff for Broadcom wireless devices
URL:=http://linuxwireless.org/en/users/Drivers/b43
DEPENDS:=+kmod-mac80211 +!TARGET_brcm47xx:kmod-ssb
DEPENDS:=+kmod-mac80211 +!TARGET_brcm47xx:kmod-ssb @LINUX_2_6_25||@LINUX_2_6_26||@LINUX_2_6_27||@LINUX_2_6_28
endef
define KernelPackage/b43
@ -316,7 +316,9 @@ endef
BUILDFLAGS:= \
-I$(PKG_BUILD_DIR)/include \
$(foreach opt,$(CONFOPTS),-DCONFIG_$(opt)) \
$(if $(CONFIG_LEDS_TRIGGERS), -DCONFIG_MAC80211_LEDS -DCONFIG_LEDS_TRIGGERS) \
$(if $(CONFIG_LEDS_TRIGGERS), -DCONFIG_MAC80211_LEDS -DCONFIG_LEDS_TRIGGERS -DCONFIG_B43_LEDS -DCONFIG_B43LEGACY_LEDS) \
$(if $(CONFIG_RFKILL),-DCONFIG_B43_RFKILL -DCONFIG_B43LEGACY_RFKILL) \
$(if $(CONFIG_PCMCIA),-DCONFIG_B43_PCMCIA) \
$(if $(CONFIG_DEBUG_FS), -DCONFIG_MAC80211_DEBUGFS) \
-D__CONFIG_MAC80211_RC_DEFAULT=minstrel \
@ -330,6 +332,13 @@ MAKE_OPTS:= \
CONFIG_MAC80211_RC_MINSTREL=y \
CONFIG_MAC80211_LEDS=$(CONFIG_LEDS_TRIGGERS) \
CONFIG_MAC80211_DEBUGFS=$(CONFIG_DEBUG_FS) \
CONFIG_B43_PCMCIA=$(CONFIG_PCMCIA) \
CONFIG_B43_RFKILL=$(CONFIG_RFKILL) \
CONFIG_B43LEGACY_RFKILL=$(CONFIG_RFKILL) \
CONFIG_B43LEGACY_LEDS=$(CONFIG_LEDS_TRIGGERS) \
CONFIG_B43_LEDS=$(CONFIG_LEDS_TRIGGERS) \
$(if $(CONFIG_PACKAGE_kmod-b43),CONFIG_B43=m) \
$(if $(CONFIG_PACKAGE_kmod-b43legacy),CONFIG_B43LEGACY=m) \
KLIB_BUILD="$(LINUX_DIR)" \
MODPROBE=:
@ -343,8 +352,7 @@ define Build/Prepare
unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT71FW)
-unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(RT2860FW)
$(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
$(if $(CONFIG_TARGET_brcm47xx),rm -rf $(PKG_BUILD_DIR)/include/linux/ssb)
rm $(PKG_BUILD_DIR)/include/net/ieee80211_crypt.h
rm -rf $(PKG_BUILD_DIR)/include/linux/ssb
rm $(PKG_BUILD_DIR)/include/net/ieee80211.h
rm $(PKG_BUILD_DIR)/include/net/ieee80211_radiotap.h
rm $(PKG_BUILD_DIR)/include/linux/eeprom_93cx6.h

View File

@ -1,157 +0,0 @@
diff -urN compat-wireless-2008-08-06/config.mk compat-wireless-2008-08-06.new/config.mk
--- compat-wireless-2008-08-06/config.mk 2008-07-18 06:11:03.000000000 +0200
+++ compat-wireless-2008-08-06.new/config.mk 2008-11-15 00:26:38.000000000 +0100
@@ -72,70 +72,34 @@
CONFIG_ATH5K=m
CONFIG_ATH5K_DEBUG=n
-# Required for older kernels which still use this flag.
-CONFIG_IWLWIFI=m
-
-CONFIG_IWLCORE=m
-CONFIG_IWL3945=m
-CONFIG_IWL4965=m
-CONFIG_IWL4965_HT=y
CONFIG_B43=m
+CONFIG_B43_NPHY=y
# 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_DMA=y
-CONFIG_B43_PIO=y
+# CONFIG_B43_PIO=y
# B43_PIO selects SSB_BLOCKIO
-CONFIG_SSB_BLOCKIO=y
-CONFIG_B43_DMA_AND_PIO_MODE=y
-CONFIG_B43_PCI_AUTOSELECT=y
-CONFIG_B43_PCICORE_AUTOSELECT=y
-#CONFIG_B43_RFKILL=n
+# CONFIG_SSB_BLOCKIO=y
+# CONFIG_B43_DMA_AND_PIO_MODE=y
+# CONFIG_B43_PCI_AUTOSELECT=y
+# CONFIG_B43_PCICORE_AUTOSELECT=y
+CONFIG_B43_RFKILL=y
CONFIG_B43_LEDS=y
# CONFIG_B43_DEBUG is not set
CONFIG_B43LEGACY=m
-CONFIG_B43LEGACY_PCI_AUTOSELECT=y
-CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y
+CONFIG_B43LEGACY_RFKILL=y
+CONFIG_B43LEGACY_LEDS=y
+# CONFIG_B43LEGACY_PCI_AUTOSELECT=y
+# CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y
CONFIG_B43LEGACY_DMA=y
-CONFIG_B43LEGACY_PIO=y
-CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
-
-# The Intel ipws
-CONFIG_IPW2100=m
-CONFIG_IPW2100_MONITOR=y
-CONFIG_IPW2200=m
-CONFIG_IPW2200_MONITOR=y
-CONFIG_IPW2200_RADIOTAP=y
-CONFIG_IPW2200_PROMISCUOUS=y
-# The above enables use a second interface prefixed 'rtap'.
-# Example usage:
-#
-# % modprobe ipw2200 rtap_iface=1
-# % ifconfig rtap0 up
-# % tethereal -i rtap0
-#
-# If you do not specify 'rtap_iface=1' as a module parameter then
-# the rtap interface will not be created and you will need to turn
-# it on via sysfs:
-#
-# % echo 1 > /sys/bus/pci/drivers/ipw2200/*/rtap_iface
-CONFIG_IPW2200_QOS=y
-
-NEED_IEEE80211=y
+# CONFIG_B43LEGACY_PIO=y
+# CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
CONFIG_P54_PCI=m
-CONFIG_SSB_PCIHOST_POSSIBLE=y
-CONFIG_SSB_PCIHOST=y
-CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
-CONFIG_SSB_DRIVER_PCICORE=y
-CONFIG_SSB_B43_PCI_BRIDGE=y
-
-CONFIG_RTL8180=m
-CONFIG_ADM8211=m
-
CONFIG_RT2X00_LIB_PCI=m
CONFIG_RT2400PCI=m
CONFIG_RT2500PCI=m
@@ -159,31 +123,7 @@
ifneq ($(CONFIG_USB),)
CONFIG_ZD1211RW=m
-# support for USB Wireless devices using Atmel at76c503,
-# at76c505 or at76c505a chips.
-CONFIG_USB_ATMEL=m
-
-# Stuff here things which depend on kernel versions for USB
-ifeq ($(shell test -e $(KLIB_BUILD)/Makefile && echo yes),yes)
-KERNEL_SUBLEVEL = $(shell $(MAKE) -C $(KLIB_BUILD) kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
-ifeq ($(shell test $(KERNEL_SUBLEVEL) -gt 21 && echo yes),yes)
-
-# Sorry, rndis_wlan uses cancel_work_sync which is new and can't be done in compat...
-
-# Wireless RNDIS USB support (RTL8185 802.11g) A-Link WL54PC
-# All of these devices are based on Broadcom 4320 chip which
-# is only wireless RNDIS chip known to date.
-# Note: this depends on CONFIG_USB_NET_RNDIS_HOST and CONFIG_USB_NET_CDCETHER
-# it also requires new RNDIS_HOST and CDC_ETHER modules which we add
-CONFIG_USB_NET_RNDIS_HOST=m
-CONFIG_USB_NET_RNDIS_WLAN=m
-CONFIG_USB_NET_CDCETHER=m
-
-endif
-endif
-
CONFIG_P54_USB=m
-CONFIG_RTL8187=m
# RT2500USB does not require firmware
CONFIG_RT2500USB=m
@@ -212,36 +152,6 @@
# p54
CONFIG_P54_COMMON=m
-# Sonics Silicon Backplane
-CONFIG_SSB_POSSIBLE=y
-CONFIG_SSB=m
-CONFIG_SSB_SPROM=y
-
-ifneq ($(CONFIG_PCMCIA),)
-CONFIG_SSB_PCMCIAHOST=y
-endif
-
-# These two are for mips
-CONFIG_SSB_DRIVER_MIPS=n
-CONFIG_SSB_PCICORE_HOSTMODE=n
-# CONFIG_SSB_DEBUG is not set
-# CONFIG_SSB_DRIVER_EXTIF=y
-
-ifneq ($(CONFIG_USB),)
-CONFIG_LIBERTAS_USB=m
-NEED_LIBERTAS=y
-endif
-ifneq ($(CONFIG_PCMCIA),)
-CONFIG_LIBERTAS_CS=m
-NEED_LIBERTAS=y
-endif
-ifeq ($(NEED_LIBERTAS),y)
-CONFIG_LIBERTAS=m
-# Libertas uses the old stack but not fully, it will soon
-# be cleaned.
-NEED_IEEE80211=y
-endif
-
ifeq ($(NEED_IEEE80211),y)
# Old ieee80211 "stack"
# Note: old softmac is scheduled for removal so we

View File

@ -1,25 +0,0 @@
Subject: mac80211: allow AP and VLAN modes
This patch allows switching interfaces into AP/VLAN modes using
cfg80211 (nl80211). Don't allow doing it with wext because then
people will just attempt to do it manually (without hostapd) and
complain that it doesn't work.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/cfg.c | 4 ++++
1 file changed, 4 insertions(+)
--- everything.orig/net/mac80211/cfg.c 2008-08-06 21:38:13.000000000 +0200
+++ everything/net/mac80211/cfg.c 2008-08-06 21:38:24.000000000 +0200
@@ -33,6 +33,10 @@ nl80211_type_to_mac80211_type(enum nl802
case NL80211_IFTYPE_MESH_POINT:
return IEEE80211_IF_TYPE_MESH_POINT;
#endif
+ case NL80211_IFTYPE_AP:
+ return IEEE80211_IF_TYPE_AP;
+ case NL80211_IFTYPE_AP_VLAN:
+ return IEEE80211_IF_TYPE_VLAN;
case NL80211_IFTYPE_WDS:
return IEEE80211_IF_TYPE_WDS;
default:

View File

@ -1,7 +1,6 @@
diff -urN compat-wireless-2008-08-06/config.mk compat-wireless-2008-08-06.new/config.mk
--- compat-wireless-2008-08-06/config.mk 2008-07-18 06:11:03.000000000 +0200
+++ compat-wireless-2008-08-06.new/config.mk 2008-11-15 00:21:17.000000000 +0100
@@ -72,70 +72,8 @@
+++ compat-wireless-2008-08-06.new/config.mk 2008-11-28 21:10:31.000000000 +0100
@@ -72,70 +72,34 @@
CONFIG_ATH5K=m
CONFIG_ATH5K_DEBUG=n
@ -13,25 +12,40 @@ diff -urN compat-wireless-2008-08-06/config.mk compat-wireless-2008-08-06.new/co
-CONFIG_IWL4965=m
-CONFIG_IWL4965_HT=y
-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=m
+CONFIG_B43_NPHY=y
# 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_DMA=y
+# CONFIG_B43_PCMCIA=y
CONFIG_B43_DMA=y
-CONFIG_B43_PIO=y
-# B43_PIO selects SSB_BLOCKIO
+# CONFIG_B43_PIO=y
# B43_PIO selects SSB_BLOCKIO
-CONFIG_SSB_BLOCKIO=y
-CONFIG_B43_DMA_AND_PIO_MODE=y
-CONFIG_B43_PCI_AUTOSELECT=y
-CONFIG_B43_PCICORE_AUTOSELECT=y
-#CONFIG_B43_RFKILL=n
-CONFIG_B43_LEDS=y
-# CONFIG_B43_DEBUG is not set
-
+# CONFIG_SSB_BLOCKIO=y
+# CONFIG_B43_DMA_AND_PIO_MODE=y
+# CONFIG_B43_PCI_AUTOSELECT=y
+# CONFIG_B43_PCICORE_AUTOSELECT=y
+# CONFIG_B43_RFKILL=y
+# CONFIG_B43_LEDS=y
# CONFIG_B43_DEBUG is not set
-CONFIG_B43LEGACY=m
-CONFIG_B43LEGACY_PCI_AUTOSELECT=y
-CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y
-CONFIG_B43LEGACY_DMA=y
+# CONFIG_B43LEGACY=m
+# CONFIG_B43LEGACY_RFKILL=y
+# CONFIG_B43LEGACY_LEDS=y
+# CONFIG_B43LEGACY_PCI_AUTOSELECT=y
+# CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y
CONFIG_B43LEGACY_DMA=y
-CONFIG_B43LEGACY_PIO=y
-CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
-
@ -57,7 +71,9 @@ diff -urN compat-wireless-2008-08-06/config.mk compat-wireless-2008-08-06.new/co
-CONFIG_IPW2200_QOS=y
-
-NEED_IEEE80211=y
-
+# CONFIG_B43LEGACY_PIO=y
+# CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
CONFIG_P54_PCI=m
-CONFIG_SSB_PCIHOST_POSSIBLE=y
@ -72,7 +88,7 @@ diff -urN compat-wireless-2008-08-06/config.mk compat-wireless-2008-08-06.new/co
CONFIG_RT2X00_LIB_PCI=m
CONFIG_RT2400PCI=m
CONFIG_RT2500PCI=m
@@ -159,31 +97,7 @@
@@ -159,31 +123,7 @@
ifneq ($(CONFIG_USB),)
CONFIG_ZD1211RW=m
@ -104,7 +120,7 @@ diff -urN compat-wireless-2008-08-06/config.mk compat-wireless-2008-08-06.new/co
# RT2500USB does not require firmware
CONFIG_RT2500USB=m
@@ -212,36 +126,6 @@
@@ -212,36 +152,6 @@
# p54
CONFIG_P54_COMMON=m

View File

@ -0,0 +1,10 @@
--- a/Makefile 2008-07-18 06:11:03.000000000 +0200
+++ b/Makefile 2008-11-28 19:31:58.000000000 +0100
@@ -19,7 +19,6 @@
obj-y := net/wireless/ net/mac80211/
ifeq ($(ONLY_CORE),)
obj-y += net/ieee80211/ \
- drivers/ssb/ \
drivers/misc/ \
drivers/net/usb/ \
drivers/net/wireless/

View File

@ -1,201 +0,0 @@
--- /dev/null
+++ b/net/mac80211/Kconfig
@@ -0,0 +1,198 @@
+config MAC80211
+ tristate "Generic IEEE 802.11 Networking Stack (mac80211)"
+ select CRYPTO
+ select CRYPTO_ECB
+ select CRYPTO_ARC4
+ select CRYPTO_AES
+ select CRC32
+ select WIRELESS_EXT
+ select CFG80211
+ ---help---
+ This option enables the hardware independent IEEE 802.11
+ networking stack.
+
+menu "Rate control algorithm selection"
+ depends on MAC80211 != n
+
+config MAC80211_RC_PID
+ bool "PID controller based rate control algorithm" if EMBEDDED
+ default y
+ ---help---
+ This option enables a TX rate control algorithm for
+ mac80211 that uses a PID controller to select the TX
+ rate.
+
+choice
+ prompt "Default rate control algorithm"
+ default MAC80211_RC_DEFAULT_PID
+ ---help---
+ This option selects the default rate control algorithm
+ mac80211 will use. Note that this default can still be
+ overriden through the ieee80211_default_rc_algo module
+ parameter if different algorithms are available.
+
+config MAC80211_RC_DEFAULT_PID
+ bool "PID controller based rate control algorithm"
+ depends on MAC80211_RC_PID
+ ---help---
+ Select the PID controller based rate control as the
+ default rate control algorithm. You should choose
+ this unless you know what you are doing.
+
+endchoice
+
+config MAC80211_RC_DEFAULT
+ string
+ default "pid" if MAC80211_RC_DEFAULT_PID
+ default ""
+
+endmenu
+
+config MAC80211_MESH
+ bool "Enable mac80211 mesh networking (pre-802.11s) support"
+ depends on MAC80211 && EXPERIMENTAL
+ ---help---
+ This options enables support of Draft 802.11s mesh networking.
+ The implementation is based on Draft 1.08 of the Mesh Networking
+ amendment. For more information visit http://o11s.org/.
+
+
+config MAC80211_LEDS
+ bool "Enable LED triggers"
+ depends on MAC80211
+ select NEW_LEDS
+ select LEDS_TRIGGERS
+ ---help---
+ This option enables a few LED triggers for different
+ packet receive/transmit events.
+
+config MAC80211_DEBUGFS
+ bool "Export mac80211 internals in DebugFS"
+ depends on MAC80211 && DEBUG_FS
+ ---help---
+ Select this to see extensive information about
+ the internal state of mac80211 in debugfs.
+
+ Say N unless you know you need this.
+
+menuconfig MAC80211_DEBUG_MENU
+ bool "Select mac80211 debugging features"
+ depends on MAC80211
+ ---help---
+ This option collects various mac80211 debug settings.
+
+config MAC80211_DEBUG_PACKET_ALIGNMENT
+ bool "Enable packet alignment debugging"
+ depends on MAC80211_DEBUG_MENU
+ ---help---
+ This option is recommended for driver authors and strongly
+ discouraged for everybody else, it will trigger a warning
+ when a driver hands mac80211 a buffer that is aligned in
+ a way that will cause problems with the IP stack on some
+ architectures.
+
+ Say N unless you're writing a mac80211 based driver.
+
+config MAC80211_NOINLINE
+ bool "Do not inline TX/RX handlers"
+ depends on MAC80211_DEBUG_MENU
+ ---help---
+ This option affects code generation in mac80211, when
+ selected some functions are marked "noinline" to allow
+ easier debugging of problems in the transmit and receive
+ paths.
+
+ This option increases code size a bit and inserts a lot
+ of function calls in the code, but is otherwise safe to
+ enable.
+
+ If unsure, say N unless you expect to be finding problems
+ in mac80211.
+
+config MAC80211_VERBOSE_DEBUG
+ bool "Verbose debugging output"
+ depends on MAC80211_DEBUG_MENU
+ ---help---
+ Selecting this option causes mac80211 to print out
+ many debugging messages. It should not be selected
+ on production systems as some of the messages are
+ remotely triggerable.
+
+ Do not select this option.
+
+config MAC80211_HT_DEBUG
+ bool "Verbose HT debugging"
+ depends on MAC80211_DEBUG_MENU
+ ---help---
+ This option enables 802.11n High Throughput features
+ debug tracing output.
+
+ It should not be selected on production systems as some
+ of the messages are remotely triggerable.
+
+ Do not select this option.
+
+config MAC80211_TKIP_DEBUG
+ bool "Verbose TKIP debugging"
+ depends on MAC80211_DEBUG_MENU
+ ---help---
+ Selecting this option causes mac80211 to print out
+ very verbose TKIP debugging messages. It should not
+ be selected on production systems as those messages
+ are remotely triggerable.
+
+ Do not select this option.
+
+config MAC80211_IBSS_DEBUG
+ bool "Verbose IBSS debugging"
+ depends on MAC80211_DEBUG_MENU
+ ---help---
+ Selecting this option causes mac80211 to print out
+ very verbose IBSS debugging messages. It should not
+ be selected on production systems as those messages
+ are remotely triggerable.
+
+ Do not select this option.
+
+config MAC80211_VERBOSE_PS_DEBUG
+ bool "Verbose powersave mode debugging"
+ depends on MAC80211_DEBUG_MENU
+ ---help---
+ Selecting this option causes mac80211 to print out very
+ verbose power save mode debugging messages (when mac80211
+ is an AP and has power saving stations.)
+ It should not be selected on production systems as those
+ messages are remotely triggerable.
+
+ Do not select this option.
+
+config MAC80211_VERBOSE_MPL_DEBUG
+ bool "Verbose mesh peer link debugging"
+ depends on MAC80211_DEBUG_MENU
+ depends on MAC80211_MESH
+ ---help---
+ Selecting this option causes mac80211 to print out very
+ verbose mesh peer link debugging messages (when mac80211
+ is taking part in a mesh network).
+ It should not be selected on production systems as those
+ messages are remotely triggerable.
+
+ Do not select this option.
+
+config MAC80211_DEBUG_COUNTERS
+ bool "Extra statistics for TX/RX debugging"
+ depends on MAC80211_DEBUG_MENU
+ depends on MAC80211_DEBUGFS
+ ---help---
+ Selecting this option causes mac80211 to keep additional
+ and very verbose statistics about TX and RX handler use
+ and show them in debugfs.
+
+ If unsure, say N.
+
+config MAC80211_VERBOSE_SPECT_MGMT_DEBUG
+ bool "Verbose Spectrum Management (IEEE 802.11h)debugging"
+ depends on MAC80211_DEBUG_MENU
+ ---help---
+ Say Y here to print out verbose Spectrum Management (IEEE 802.11h)
+ debug messages.

View File

@ -0,0 +1,14 @@
diff --git a/Makefile b/Makefile
index 6a5eff4..225c711 100644
--- a/Makefile
+++ b/Makefile
@@ -20,8 +20,7 @@ NOSTDINC_FLAGS := -I$(M)/include/ -include $(M)/include/net/compat.h $(CFLAGS)
obj-y := net/wireless/ net/mac80211/
ifeq ($(ONLY_CORE),)
obj-$(CONFIG_B44) += drivers/net/b44.o
-obj-y += drivers/ssb/ \
- drivers/misc/ \
+obj-y += drivers/misc/ \
drivers/net/usb/ \
drivers/net/wireless/
endif

View File

@ -1,13 +0,0 @@
--- a/config.mk
+++ b/config.mk
@@ -47,8 +47,9 @@ endif
endif # build check
endif # kernel Makefile check
-CONFIG_MAC80211_RC_DEFAULT=pid
+CONFIG_MAC80211_RC_DEFAULT=minstrel
CONFIG_MAC80211_RC_PID=y
+CONFIG_MAC80211_RC_MINSTREL=y
# enable mesh networking too
CONFIG_MAC80211_MESH=y

View File

@ -1,15 +1,51 @@
diff --git a/config.mk b/config.mk
index d94a976..39fcaea 100644
--- a/config.mk
+++ b/config.mk
@@ -108,12 +108,12 @@ CONFIG_B43LEGACY_PIO=y
@@ -69,10 +69,10 @@ CONFIG_MAC80211_LEDS=y
CONFIG_MAC80211_MESH=y
CONFIG_CFG80211=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
CONFIG_B43_PCI_AUTOSELECT=y
CONFIG_B43_PCICORE_AUTOSELECT=y
#CONFIG_B43_RFKILL=n
-CONFIG_B43_LEDS=y
+#CONFIG_B43_LEDS=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
# The Intel ipws
-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_LIBIPW=m
+#CONFIG_IPW2100=m
+#CONFIG_IPW2100_MONITOR=y
+#CONFIG_IPW2200=m
@ -19,26 +55,31 @@
# The above enables use a second interface prefixed 'rtap'.
# Example usage:
#
@@ -126,9 +126,9 @@ CONFIG_IPW2200_PROMISCUOUS=y
@@ -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
-NEED_IEEE80211=y
+# NEED_IEEE80211=y
CONFIG_P54_PCI=m
@@ -227,8 +227,8 @@ CONFIG_SSB_PCICORE_HOSTMODE=n
# CONFIG_SSB_DRIVER_EXTIF=y
@@ -239,15 +239,15 @@ CONFIG_SSB_PCICORE_HOSTMODE=n
ifneq ($(CONFIG_USB),)
-CONFIG_LIBERTAS_USB=m
ifneq ($(CONFIG_LIBERTAS_THINFIRM_USB),m)
CONFIG_LIBERTAS_USB=m
-NEED_LIBERTAS=y
+#CONFIG_LIBERTAS_USB=m
+#NEED_LIBERTAS=y
endif
endif
ifneq ($(CONFIG_PCMCIA),)
CONFIG_LIBERTAS_CS=m
-NEED_LIBERTAS=y
+#NEED_LIBERTAS=y
endif
ifeq ($(NEED_LIBERTAS),y)
-CONFIG_LIBERTAS=m
+#CONFIG_LIBERTAS=m
# Libertas uses the old stack but not fully, it will soon
# be cleaned.
endif

View File

@ -1,21 +0,0 @@
On ARM alignment is done slightly different from other architectures.
struct ieee80211_tx_rate is aligned to word size, even though it only has 3
single-byte members, which triggers the BUILD_BUG_ON in
ieee80211_tx_info_clear_status
This patch marks the struct ieee80211_tx_rate as packed, so that ARM
behaves like the other architectures.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -299,7 +299,7 @@ struct ieee80211_tx_rate {
s8 idx;
u8 count;
u8 flags;
-};
+} __attribute__((packed));
/**
* struct ieee80211_tx_info - skb transmit information

View File

@ -0,0 +1,248 @@
From: Ivo van Doorn <IvDoorn@gmail.com>
Date: Thu, 20 Nov 2008 22:29:36 +0000 (+0100)
Subject: rt2x00: Implement HW encryption (rt2500usb)
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fivd%2Frt2x00.git;a=commitdiff_plain;h=52fe465ab5eb6aeead5ac8d91dd70e363d0560b7
rt2x00: Implement HW encryption (rt2500usb)
rt2500usb supports hardware encryption.
rt2500usb supports up to 4 shared and pairwise keys.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 10cb46a..620ac65 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -36,6 +36,13 @@
#include "rt2500usb.h"
/*
+ * Allow hardware encryption to be disabled.
+ */
+static int modparam_nohwcrypt = 0;
+module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO);
+MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
+
+/*
* Register access.
* All access to the CSR registers will go through the methods
* rt2500usb_register_read and rt2500usb_register_write.
@@ -323,6 +330,85 @@ static void rt2500usb_init_led(struct rt2x00_dev *rt2x00dev,
/*
* Configuration handlers.
*/
+
+/*
+ * rt2500usb does not differentiate between shared and pairwise
+ * keys, so we should use the same function for both key types.
+ */
+static int rt2500usb_config_key(struct rt2x00_dev *rt2x00dev,
+ struct rt2x00lib_crypto *crypto,
+ struct ieee80211_key_conf *key)
+{
+ int timeout;
+ u32 mask;
+ u16 reg;
+
+ /* Support up to 4 keys */
+ if (key->hw_key_idx >= 4)
+ return -ENOSPC;
+
+ if (crypto->cmd == SET_KEY) {
+ /*
+ * Pairwise key will always be entry 0, but this
+ * could collide with a shared key on the same
+ * position...
+ */
+ mask = TXRX_CSR0_KEY_ID.bit_mask;
+
+ rt2500usb_register_read(rt2x00dev, TXRX_CSR0, &reg);
+
+ if ((reg & mask) && (reg & mask) == mask)
+ return -ENOSPC;
+
+ reg = rt2x00_get_field16(reg, TXRX_CSR0_KEY_ID);
+
+ key->hw_key_idx += reg ? ffz(reg) : 0;
+
+ /*
+ * The encryption key doesn't fit within the CSR cache,
+ * this means we should allocate it seperately and use
+ * rt2x00usb_vendor_request() to send the key to the hardware.
+ */
+ reg = KEY_ENTRY(key->hw_key_idx);
+ timeout = REGISTER_TIMEOUT32(sizeof(crypto->key));
+ rt2x00usb_vendor_request_large_buff(rt2x00dev, USB_MULTI_WRITE,
+ USB_VENDOR_REQUEST_OUT, reg,
+ crypto->key,
+ sizeof(crypto->key),
+ timeout);
+
+ /*
+ * The driver does not support the IV/EIV generation
+ * in hardware. However it doesn't support the IV/EIV
+ * inside the ieee80211 frame either, but requires it
+ * to be provided seperately for the descriptor.
+ * rt2x00lib will cut the IV/EIV data out of all frames
+ * given to us by mac80211, but we must tell mac80211
+ * to generate the IV/EIV data.
+ */
+ key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
+ key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
+ }
+
+ /*
+ * TXRX_CSR0_KEY_ID contains only single-bit fields to indicate
+ * a particular key is valid.
+ */
+ rt2500usb_register_read(rt2x00dev, TXRX_CSR0, &reg);
+ rt2x00_set_field16(&reg, TXRX_CSR0_ALGORITHM, crypto->cipher);
+ rt2x00_set_field16(&reg, TXRX_CSR0_IV_OFFSET, IEEE80211_HEADER);
+
+ mask = rt2x00_get_field16(reg, TXRX_CSR0_KEY_ID);
+ if (crypto->cmd == SET_KEY)
+ mask |= 1 << key->hw_key_idx;
+ else if (crypto->cmd == DISABLE_KEY)
+ mask &= ~(1 << key->hw_key_idx);
+ rt2x00_set_field16(&reg, TXRX_CSR0_KEY_ID, mask);
+ rt2500usb_register_write(rt2x00dev, TXRX_CSR0, reg);
+
+ return 0;
+}
+
static void rt2500usb_config_filter(struct rt2x00_dev *rt2x00dev,
const unsigned int filter_flags)
{
@@ -844,7 +930,7 @@ static int rt2500usb_init_registers(struct rt2x00_dev *rt2x00dev)
rt2500usb_register_read(rt2x00dev, TXRX_CSR0, &reg);
rt2x00_set_field16(&reg, TXRX_CSR0_IV_OFFSET, IEEE80211_HEADER);
- rt2x00_set_field16(&reg, TXRX_CSR0_KEY_ID, 0xff);
+ rt2x00_set_field16(&reg, TXRX_CSR0_KEY_ID, 0);
rt2500usb_register_write(rt2x00dev, TXRX_CSR0, reg);
rt2500usb_register_read(rt2x00dev, MAC_CSR18, &reg);
@@ -1066,7 +1152,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
* Start writing the descriptor words.
*/
rt2x00_desc_read(txd, 1, &word);
- rt2x00_set_field32(&word, TXD_W1_IV_OFFSET, IEEE80211_HEADER);
+ rt2x00_set_field32(&word, TXD_W1_IV_OFFSET, txdesc->iv_offset);
rt2x00_set_field32(&word, TXD_W1_AIFS, txdesc->aifs);
rt2x00_set_field32(&word, TXD_W1_CWMIN, txdesc->cw_min);
rt2x00_set_field32(&word, TXD_W1_CWMAX, txdesc->cw_max);
@@ -1079,6 +1165,11 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
rt2x00_set_field32(&word, TXD_W2_PLCP_LENGTH_HIGH, txdesc->length_high);
rt2x00_desc_write(txd, 2, word);
+ if (test_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags)) {
+ _rt2x00_desc_write(txd, 3, skbdesc->iv);
+ _rt2x00_desc_write(txd, 4, skbdesc->eiv);
+ }
+
rt2x00_desc_read(txd, 0, &word);
rt2x00_set_field32(&word, TXD_W0_RETRY_LIMIT, txdesc->retry_limit);
rt2x00_set_field32(&word, TXD_W0_MORE_FRAG,
@@ -1093,7 +1184,8 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags));
rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skb->len);
- rt2x00_set_field32(&word, TXD_W0_CIPHER, CIPHER_NONE);
+ rt2x00_set_field32(&word, TXD_W0_CIPHER, txdesc->cipher);
+ rt2x00_set_field32(&word, TXD_W0_KEY_ID, txdesc->key_idx);
rt2x00_desc_write(txd, 0, word);
}
@@ -1204,6 +1296,7 @@ static void rt2500usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
static void rt2500usb_fill_rxdone(struct queue_entry *entry,
struct rxdone_entry_desc *rxdesc)
{
+ struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
struct queue_entry_priv_usb *entry_priv = entry->priv_data;
struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
__le32 *rxd =
@@ -1231,6 +1324,31 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry,
if (rt2x00_get_field32(word0, RXD_W0_PHYSICAL_ERROR))
rxdesc->flags |= RX_FLAG_FAILED_PLCP_CRC;
+ if (test_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags)) {
+ rxdesc->cipher = rt2x00_get_field32(word0, RXD_W0_CIPHER);
+ if (rt2x00_get_field32(word0, RXD_W0_CIPHER_ERROR))
+ rxdesc->cipher_status = RX_CRYPTO_FAIL_KEY;
+ }
+
+ if (rxdesc->cipher != CIPHER_NONE) {
+ _rt2x00_desc_read(rxd, 2, &rxdesc->iv);
+ _rt2x00_desc_read(rxd, 3, &rxdesc->eiv);
+ /* ICV is located at the end of frame */
+
+ /*
+ * Hardware has stripped IV/EIV data from 802.11 frame during
+ * decryption. It has provided the data seperately but rt2x00lib
+ * should decide if it should be reinserted.
+ */
+ rxdesc->flags |= RX_FLAG_IV_STRIPPED;
+ if (rxdesc->cipher != CIPHER_TKIP)
+ rxdesc->flags |= RX_FLAG_MMIC_STRIPPED;
+ if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS)
+ rxdesc->flags |= RX_FLAG_DECRYPTED;
+ else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC)
+ rxdesc->flags |= RX_FLAG_MMIC_ERROR;
+ }
+
/*
* Obtain the status about this packet.
* When frame was received with an OFDM bitrate,
@@ -1238,8 +1356,8 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry,
* a CCK bitrate the signal is the rate in 100kbit/s.
*/
rxdesc->signal = rt2x00_get_field32(word1, RXD_W1_SIGNAL);
- rxdesc->rssi = rt2x00_get_field32(word1, RXD_W1_RSSI) -
- entry->queue->rt2x00dev->rssi_offset;
+ rxdesc->rssi =
+ rt2x00_get_field32(word1, RXD_W1_RSSI) - rt2x00dev->rssi_offset;
rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT);
if (rt2x00_get_field32(word0, RXD_W0_OFDM))
@@ -1729,6 +1847,8 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev)
__set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags);
__set_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags);
__set_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags);
+ if (!modparam_nohwcrypt)
+ __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags);
__set_bit(CONFIG_DISABLE_LINK_TUNING, &rt2x00dev->flags);
/*
@@ -1748,6 +1868,7 @@ static const struct ieee80211_ops rt2500usb_mac80211_ops = {
.config = rt2x00mac_config,
.config_interface = rt2x00mac_config_interface,
.configure_filter = rt2x00mac_configure_filter,
+ .set_key = rt2x00mac_set_key,
.get_stats = rt2x00mac_get_stats,
.bss_info_changed = rt2x00mac_bss_info_changed,
.conf_tx = rt2x00mac_conf_tx,
@@ -1769,6 +1890,8 @@ static const struct rt2x00lib_ops rt2500usb_rt2x00_ops = {
.get_tx_data_len = rt2500usb_get_tx_data_len,
.kick_tx_queue = rt2500usb_kick_tx_queue,
.fill_rxdone = rt2500usb_fill_rxdone,
+ .config_shared_key = rt2500usb_config_key,
+ .config_pairwise_key = rt2500usb_config_key,
.config_filter = rt2500usb_config_filter,
.config_intf = rt2500usb_config_intf,
.config_erp = rt2500usb_config_erp,
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.h b/drivers/net/wireless/rt2x00/rt2500usb.h
index dbb5d68..4347dfd 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.h
+++ b/drivers/net/wireless/rt2x00/rt2500usb.h
@@ -447,6 +447,9 @@
#define SEC_CSR30 0x04bc
#define SEC_CSR31 0x04be
+#define KEY_ENTRY(__idx) \
+ ( SEC_CSR0 + ((__idx) * 16) )
+
/*
* PHY control registers.
*/

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,8 @@
diff --git a/config.mk b/config.mk
index d94a976..a624bdf 100644
--- a/config.mk
+++ b/config.mk
@@ -146,6 +146,7 @@ CONFIG_ADM8211=m
@@ -156,6 +156,7 @@ CONFIG_ADM8211=m
CONFIG_RT2X00_LIB_PCI=m
CONFIG_RT2400PCI=m
CONFIG_RT2500PCI=m
@ -8,3 +10,11 @@
NEED_RT2X00=y
# Two rt2x00 drivers require firmware: rt61pci and rt73usb. They depend on
@@ -197,6 +198,7 @@ CONFIG_RTL8187=m
# RT2500USB does not require firmware
CONFIG_RT2500USB=m
CONFIG_RT2X00_LIB_USB=m
+CONFIG_RT2X00_LIB_CRYPTO=y
NEED_RT2X00=y
# RT73USB requires firmware
ifneq ($(CONFIG_CRC_ITU_T),)