From owner-svn-src-head@freebsd.org Sun Oct 11 01:50:55 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86E40A0F841; Sun, 11 Oct 2015 01:50:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3940AE8C; Sun, 11 Oct 2015 01:50:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9B1osxe027250; Sun, 11 Oct 2015 01:50:54 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9B1osRr027249; Sun, 11 Oct 2015 01:50:54 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510110150.t9B1osRr027249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 11 Oct 2015 01:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289125 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Oct 2015 01:50:55 -0000 Author: adrian Date: Sun Oct 11 01:50:54 2015 New Revision: 289125 URL: https://svnweb.freebsd.org/changeset/base/289125 Log: wpi(4): do not override iv_recv_mgmt() in non-adhoc modes. Tested: * Tested with Intel 3945BG, IBSS and STA modes Submitted by: Differential Revision: https://reviews.freebsd.org/D3764 Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun Oct 11 01:31:18 2015 (r289124) +++ head/sys/dev/wpi/if_wpi.c Sun Oct 11 01:50:54 2015 (r289125) @@ -176,7 +176,7 @@ static int wpi_read_eeprom_group(struct 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, /* 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 *s } 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, 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);