spacer projects / dragonfly.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch (parent: 5d3c818)
kernel - Add sysctl to bypass wifi chipset hardware crypto
authorMatthew Dillon <dillon@laptop1.(none)>
Sun, 14 Nov 2010 16:02:48 +0000 (08:02 -0800)
committerMatthew Dillon <dillon@laptop1.(none)>
Sun, 14 Nov 2010 16:02:48 +0000 (08:02 -0800)
* Add sysctl net.wlan.force_swcrypto, default disabled.  If set to 1
  prior to attaching wlan to the underlying wireless interface this
  will force software crypto to be used and bypass the hardware
  crypto implemented by the wireless chipset.

* Currently we know there is at least one serious issue with the
  Atheros 9280 when used with WEP2 (shows up as RSN in list scan) + WPS,
  and possibly other combinations.  The wrong transmit key winds up
  being used for broadcast packets, including ARP.

* This sysctl works around the problem.  If your wpa_supplicant is able
  to connect to a network but you are unable to dhclient / use the
  network you might be hitting this problem and setting the sysctl to
  1 may fix it.

  Note that the sysctl must be set prior to attaching the wlan to the
  underlying wireless driver, so it is typically best to do it at boot
  time or near the top of whatever script you use.

Inspired-by: 2-days of connectivity issues at NYCBSDCON.

sys/netproto/802_11/ieee80211_dragonfly.h patch | blob | blame | history
sys/netproto/802_11/wlan/ieee80211_crypto.c patch | blob | blame | history
sys/netproto/802_11/wlan/ieee80211_dragonfly.c patch | blob | blame | history

diff --git a/sys/netproto/802_11/ieee80211_dragonfly.h b/sys/netproto/802_11/ieee80211_dragonfly.h
index 0ba82f5..a84248f 100644 (file)
--- a/sys/netproto/802_11/ieee80211_dragonfly.h
+++ b/sys/netproto/802_11/ieee80211_dragonfly.h
@@ -61,6 +61,7 @@
  * Global serializer (operates like a non-reentrant lockmgr lock)
  */
 extern struct lwkt_serialize wlan_global_serializer;
+extern int ieee80211_force_swcrypto;
 
 #define wlan_serialize_enter() _wlan_serialize_enter(__FUNCTION__)
 #define wlan_serialize_exit()  _wlan_serialize_exit(__FUNCTION__)
diff --git a/sys/netproto/802_11/wlan/ieee80211_crypto.c b/sys/netproto/802_11/wlan/ieee80211_crypto.c
index 38440ac..88f4cea 100644 (file)
--- a/sys/netproto/802_11/wlan/ieee80211_crypto.c
+++ b/sys/netproto/802_11/wlan/ieee80211_crypto.c
@@ -324,6 +324,10 @@ ieee80211_crypto_newkey(struct ieee80211vap *vap,
                    __func__, cip->ic_name);
                flags |= IEEE80211_KEY_SWCRYPT;
        }
+       if (ieee80211_force_swcrypto) {
+               flags |= IEEE80211_KEY_SWCRYPT;
+               flags |= IEEE80211_KEY_SWMIC;
+       }
        /*
         * Hardware TKIP with software MIC is an important
         * combination; we handle it by flagging each key,
diff --git a/sys/netproto/802_11/wlan/ieee80211_dragonfly.c b/sys/netproto/802_11/wlan/ieee80211_dragonfly.c
index 67fc38e..1f4e178 100644 (file)
--- a/sys/netproto/802_11/wlan/ieee80211_dragonfly.c
+++ b/sys/netproto/802_11/wlan/ieee80211_dragonfly.c
@@ -59,8 +59,11 @@ SYSCTL_NODE(_net, OID_AUTO, wlan, CTLFLAG_RD, 0, "IEEE 80211 parameters");
 
 #ifdef IEEE80211_DEBUG
 int    ieee80211_debug = 0;
+int    ieee80211_force_swcrypto = 0;
 SYSCTL_INT(_net_wlan, OID_AUTO, debug, CTLFLAG_RW, &ieee80211_debug,
            0, "debugging printfs");
+SYSCTL_INT(_net_wlan, OID_AUTO, force_swcrypto, CTLFLAG_RW,
+           &ieee80211_force_swcrypto, 0, "force software crypto");
 #endif
 
 MALLOC_DEFINE(M_80211_COM, "80211com", "802.11 com state");
DragonFly Project GIT Source repo
RSS Atom
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.