[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openbsd-tech
Subject:    iwm/iwx: reset Rx BA session counter
From:       Stefan Sperling <stsp () stsp ! name>
Date:       2020-08-25 8:47:57
Message-ID: 20200825084757.GC89488 () ted ! stsp ! name
[Download RAW message or body]

The Rx block ack session counter is not reset when an iwm/iwx interface
disassociates from the AP or is put down via ifconfig.
This can lead to new Rx block ack session being refused upon re-association.

Found by zxystd from the OpenIntelWireless project (drivers for macOS).

The firmware associates Rx block ack state with its "STA node". So while the
device is running the best place to reset our counter is when this STA node
gets removed; this handles re-association without device reset. And we can
of course clear the counter unconditionally when the device is reset.

ok?

diff fd93b7840df11a14bfc329fed5b0c451ca1aff33 /usr/src
blob - c788d9762fd2d82acd39182deac0fbe81209d30d
file + sys/dev/pci/if_iwm.c
--- sys/dev/pci/if_iwm.c
+++ sys/dev/pci/if_iwm.c
@@ -6666,6 +6666,7 @@ iwm_deauth(struct iwm_softc *sc)
 			return err;
 		}
 		sc->sc_flags &= ~IWM_FLAG_STA_ACTIVE;
+		sc->sc_rx_ba_sessions = 0;
 	}
 
 	tfd_queue_msk = 0;
@@ -6743,6 +6744,7 @@ iwm_disassoc(struct iwm_softc *sc)
 			return err;
 		}
 		sc->sc_flags &= ~IWM_FLAG_STA_ACTIVE;
+		sc->sc_rx_ba_sessions = 0;
 	}
 
 	return 0;
@@ -8116,6 +8118,8 @@ iwm_stop(struct ifnet *ifp)
 	sc->sc_flags &= ~IWM_FLAG_TE_ACTIVE;
 	sc->sc_flags &= ~IWM_FLAG_HW_ERR;
 	sc->sc_flags &= ~IWM_FLAG_SHUTDOWN;
+
+	sc->sc_rx_ba_sessions = 0;
 
 	sc->sc_newstate(ic, IEEE80211_S_INIT, -1);
 
blob - 0482cf039bdd9b8060dbf1b2b89348e18db4d233
file + sys/dev/pci/if_iwx.c
--- sys/dev/pci/if_iwx.c
+++ sys/dev/pci/if_iwx.c
@@ -5736,6 +5736,7 @@ iwx_deauth(struct iwx_softc *sc)
 			return err;
 		}
 		sc->sc_flags &= ~IWX_FLAG_STA_ACTIVE;
+		sc->sc_rx_ba_sessions = 0;
 	}
 
 	if (sc->sc_flags & IWX_FLAG_BINDING_ACTIVE) {
@@ -5801,6 +5802,7 @@ iwx_disassoc(struct iwx_softc *sc)
 			return err;
 		}
 		sc->sc_flags &= ~IWX_FLAG_STA_ACTIVE;
+		sc->sc_rx_ba_sessions = 0;
 	}
 
 	return 0;
@@ -6759,6 +6761,8 @@ iwx_stop(struct ifnet *ifp)
 	sc->sc_flags &= ~IWX_FLAG_TE_ACTIVE;
 	sc->sc_flags &= ~IWX_FLAG_HW_ERR;
 	sc->sc_flags &= ~IWX_FLAG_SHUTDOWN;
+
+	sc->sc_rx_ba_sessions = 0;
 
 	sc->sc_newstate(ic, IEEE80211_S_INIT, -1);
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic