madwifi: fix locking issues in state machine changes
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 23 Sep 2008 17:28:19 +0000 (17:28 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 23 Sep 2008 17:28:19 +0000 (17:28 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12670 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/madwifi/patches/355-eap_auth_disassoc.patch
package/madwifi/patches/370-wdsvap.patch
package/madwifi/patches/371-wds_sta_separation.patch
package/madwifi/patches/403-changeset_r3605.patch

index 9b58964..7774d6b 100644 (file)
@@ -5,21 +5,17 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
 
 --- a/ath/if_ath.c
 +++ b/ath/if_ath.c
 
 --- a/ath/if_ath.c
 +++ b/ath/if_ath.c
-@@ -8328,6 +8328,18 @@
+@@ -8328,6 +8328,14 @@
  #endif
                                if (ts->ts_status & HAL_TXERR_XRETRY) {
                                        sc->sc_stats.ast_tx_xretries++;
  #endif
                                if (ts->ts_status & HAL_TXERR_XRETRY) {
                                        sc->sc_stats.ast_tx_xretries++;
-+                                      if (SKB_CB(bf->bf_skb)->auth_pkt && (ni->ni_vap->iv_opmode == IEEE80211_M_STA)) {
-+                                              struct ieee80211com *ic = &sc->sc_ic;
++                                      if (SKB_CB(bf->bf_skb)->auth_pkt &&
++                                              (ni->ni_vap->iv_opmode == IEEE80211_M_STA)) {
++                                              struct ieee80211vap *vap = ni->ni_vap;
 +
 +                                              /* if roaming is enabled, try reassociating, otherwise
 +                                               * disassociate and go back to the scan state */
 +
 +                                              /* if roaming is enabled, try reassociating, otherwise
 +                                               * disassociate and go back to the scan state */
-+                                              IEEE80211_VAPS_LOCK_BH(ic);
-+                                              if (ic->ic_roaming == IEEE80211_ROAMING_AUTO)
-+                                                      ni->ni_vap->iv_newstate(ni->ni_vap, IEEE80211_S_ASSOC, 1);
-+                                              else
-+                                                      ni->ni_vap->iv_newstate(ni->ni_vap, IEEE80211_S_SCAN, 0);
-+                                              IEEE80211_VAPS_UNLOCK_BH(ic);
++                                              vap->iv_mgtsend.function(vap->iv_mgtsend.data);
 +                                      }
                                        if (ni->ni_flags & IEEE80211_NODE_UAPSD_TRIG) {
                                                ni->ni_stats.ns_tx_eosplost++;
 +                                      }
                                        if (ni->ni_flags & IEEE80211_NODE_UAPSD_TRIG) {
                                                ni->ni_stats.ns_tx_eosplost++;
index 05e1ca7..1cf334e 100644 (file)
@@ -77,7 +77,7 @@
                rfilt |= HAL_RX_FILTER_BEACON;
        if (sc->sc_nmonvaps > 0)
                rfilt |= (HAL_RX_FILTER_CONTROL | HAL_RX_FILTER_BEACON |
                rfilt |= HAL_RX_FILTER_BEACON;
        if (sc->sc_nmonvaps > 0)
                rfilt |= (HAL_RX_FILTER_CONTROL | HAL_RX_FILTER_BEACON |
-@@ -9030,8 +9031,6 @@
+@@ -9026,8 +9027,6 @@
                 * set sc->beacons if we might need to restart
                   * them after ath_reset. */
                if (!sc->sc_beacons &&
                 * set sc->beacons if we might need to restart
                   * them after ath_reset. */
                if (!sc->sc_beacons &&
index 9178594..a37ebd4 100644 (file)
  /* Locking */
  /* NB: beware, spin_is_locked() is not usefully defined for !(DEBUG || SMP)
   * because spinlocks do not exist in this configuration. Instead IRQs 
  /* Locking */
  /* NB: beware, spin_is_locked() is not usefully defined for !(DEBUG || SMP)
   * because spinlocks do not exist in this configuration. Instead IRQs 
-@@ -167,6 +196,18 @@
-       IEEE80211_VAPS_LOCK_ASSERT(_ic);                \
-       spin_unlock_bh(&(_ic)->ic_vapslock);            \
- } while (0)
-+#define       IEEE80211_VAPS_LOCK_IRQ(_ic) do {                                       \
-+      unsigned long __vlockflags;                                     \
-+      IEEE80211_VAPS_LOCK_CHECK(_ic);                                 \
-+      spin_lock_irqsave(&(_ic)->ic_vapslock, __vlockflags);
-+#define       IEEE80211_VAPS_UNLOCK_IRQ(_ic)                                  \
-+      IEEE80211_VAPS_LOCK_ASSERT(_ic);                                        \
-+      spin_unlock_irqrestore(&(_ic)->ic_vapslock, __vlockflags);      \
-+} while (0)
-+#define       IEEE80211_VAPS_UNLOCK_IRQ_EARLY(_ic)                                    \
-+      IEEE80211_VAPS_LOCK_ASSERT(_ic);                                        \
-+      spin_unlock_irqrestore(&(_ic)->ic_vapslock, __vlockflags);
-+
- #if (defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)) && defined(spin_is_locked)
- #define IEEE80211_VAPS_LOCK_ASSERT(_ic) \
 --- a/net80211/ieee80211_proto.c
 +++ b/net80211/ieee80211_proto.c
 @@ -1081,6 +1081,8 @@
 --- a/net80211/ieee80211_proto.c
 +++ b/net80211/ieee80211_proto.c
 @@ -1081,6 +1081,8 @@
        ieee80211_new_state(vap, IEEE80211_S_INIT, -1);
        if (dev->flags & IFF_RUNNING) {
                dev->flags &= ~IFF_RUNNING;             /* mark us stopped */
        ieee80211_new_state(vap, IEEE80211_S_INIT, -1);
        if (dev->flags & IFF_RUNNING) {
                dev->flags &= ~IFF_RUNNING;             /* mark us stopped */
-@@ -1342,9 +1366,9 @@
-       struct ieee80211com *ic = vap->iv_ic;
-       int rc;
--      IEEE80211_VAPS_LOCK_BH(ic);
-+      IEEE80211_VAPS_LOCK_IRQ(ic);
-       rc = vap->iv_newstate(vap, nstate, arg);
--      IEEE80211_VAPS_UNLOCK_BH(ic);
-+      IEEE80211_VAPS_UNLOCK_IRQ(ic);
-       return rc;
- }
 @@ -1630,6 +1654,7 @@
                 */
                if (ni->ni_authmode != IEEE80211_AUTH_8021X)
 @@ -1630,6 +1654,7 @@
                 */
                if (ni->ni_authmode != IEEE80211_AUTH_8021X)
index 18e377d..48981ec 100644 (file)
@@ -16,7 +16,7 @@
  #endif /* _ATH_COMPAT_H_ */
 --- a/net80211/ieee80211_linux.h
 +++ b/net80211/ieee80211_linux.h
  #endif /* _ATH_COMPAT_H_ */
 --- a/net80211/ieee80211_linux.h
 +++ b/net80211/ieee80211_linux.h
-@@ -350,13 +350,6 @@
+@@ -338,13 +338,6 @@
  #define       ACL_LOCK_CHECK(_as)
  #endif
  
  #define       ACL_LOCK_CHECK(_as)
  #endif
  
@@ -30,7 +30,7 @@
  /*
   * Per-node power-save queue definitions.  Beware of control
   * flow with IEEE80211_NODE_SAVEQ_LOCK/IEEE80211_NODE_SAVEQ_UNLOCK.
  /*
   * Per-node power-save queue definitions.  Beware of control
   * flow with IEEE80211_NODE_SAVEQ_LOCK/IEEE80211_NODE_SAVEQ_UNLOCK.
-@@ -400,16 +393,16 @@
+@@ -388,16 +381,16 @@
        _skb = __skb_dequeue(&(_ni)->ni_savedq);                \
        (_qlen) = skb_queue_len(&(_ni)->ni_savedq);             \
  } while (0)
        _skb = __skb_dequeue(&(_ni)->ni_savedq);                \
        (_qlen) = skb_queue_len(&(_ni)->ni_savedq);             \
  } while (0)
This page took 0.032002 seconds and 4 git commands to generate.