aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2015-10-11 01:50:54 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2015-10-11 01:50:54 +0000
commit57c61f5d051f9d175871e866a48fdc37a67953ef (patch)
treeacdce5122dd171ac32390601502f31251fa01ecd
parent525a3d47d855ee04056fbc7406631fbb14267493 (diff)
downloadsrc-57c61f5d051f9d175871e866a48fdc37a67953ef.tar.gz
src-57c61f5d051f9d175871e866a48fdc37a67953ef.zip
wpi(4): do not override iv_recv_mgmt() in non-adhoc modes.
Tested: * Tested with Intel 3945BG, IBSS and STA modes Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3764
Notes
Notes: svn path=/head/; revision=289125
-rw-r--r--sys/dev/wpi/if_wpi.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c
index dacee7d6056a..f4bcc017249e 100644
--- a/sys/dev/wpi/if_wpi.c
+++ b/sys/dev/wpi/if_wpi.c
@@ -176,7 +176,7 @@ static int wpi_read_eeprom_group(struct wpi_softc *, uint8_t);
static struct ieee80211_node *wpi_node_alloc(struct ieee80211vap *,
const uint8_t mac[IEEE80211_ADDR_LEN]);
static void wpi_node_free(struct ieee80211_node *);
-static void wpi_recv_mgmt(struct ieee80211_node *, struct mbuf *, int,
+static void wpi_ibss_recv_mgmt(struct ieee80211_node *, struct mbuf *, int,
const struct ieee80211_rx_stats *,
int, int);
static void wpi_restore_node(void *, struct ieee80211_node *);
@@ -640,8 +640,10 @@ wpi_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit,
/* Override with driver methods. */
vap->iv_key_set = wpi_key_set;
vap->iv_key_delete = wpi_key_delete;
- wvp->wv_recv_mgmt = vap->iv_recv_mgmt;
- vap->iv_recv_mgmt = wpi_recv_mgmt;
+ if (opmode == IEEE80211_M_IBSS) {
+ wvp->wv_recv_mgmt = vap->iv_recv_mgmt;
+ vap->iv_recv_mgmt = wpi_ibss_recv_mgmt;
+ }
wvp->wv_newstate = vap->iv_newstate;
vap->iv_newstate = wpi_newstate;
vap->iv_update_beacon = wpi_update_beacon;
@@ -1664,7 +1666,7 @@ wpi_check_bss_filter(struct wpi_softc *sc)
}
static void
-wpi_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, int subtype,
+wpi_ibss_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, int subtype,
const struct ieee80211_rx_stats *rxs,
int rssi, int nf)
{
@@ -1675,8 +1677,7 @@ wpi_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, int subtype,
wvp->wv_recv_mgmt(ni, m, subtype, rxs, rssi, nf);
- if (vap->iv_opmode == IEEE80211_M_IBSS &&
- vap->iv_state == IEEE80211_S_RUN &&
+ if (vap->iv_state == IEEE80211_S_RUN &&
(subtype == IEEE80211_FC0_SUBTYPE_BEACON ||
subtype == IEEE80211_FC0_SUBTYPE_PROBE_RESP)) {
ni_tstamp = le64toh(ni->ni_tstamp.tsf);