From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 20:46:25 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 431F6965; Sun, 15 Mar 2015 20:46:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 154521D7; Sun, 15 Mar 2015 20:46:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2FKkOx2069647; Sun, 15 Mar 2015 20:46:24 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2FKkOXX069646; Sun, 15 Mar 2015 20:46:24 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503152046.t2FKkOXX069646@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 15 Mar 2015 20:46:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280079 - 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.18-1 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, 15 Mar 2015 20:46:25 -0000 Author: adrian Date: Sun Mar 15 20:46:24 2015 New Revision: 280079 URL: https://svnweb.freebsd.org/changeset/base/280079 Log: Move IBSS assocation processing to wpi_newassoc(). PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun Mar 15 20:45:43 2015 (r280078) +++ head/sys/dev/wpi/if_wpi.c Sun Mar 15 20:46:24 2015 (r280079) @@ -228,6 +228,7 @@ static int wpi_scan(struct wpi_softc *, static int wpi_auth(struct wpi_softc *, struct ieee80211vap *); static void wpi_update_beacon(struct ieee80211vap *, int); static int wpi_setup_beacon(struct wpi_softc *, struct ieee80211_node *); +static void wpi_newassoc(struct ieee80211_node *, int); static int wpi_run(struct wpi_softc *, struct ieee80211vap *); static int wpi_key_alloc(struct ieee80211vap *, struct ieee80211_key *, ieee80211_keyix *, ieee80211_keyix *); @@ -500,6 +501,7 @@ wpi_attach(device_t dev) ic->ic_wme.wme_update = wpi_updateedca; ic->ic_update_promisc = wpi_update_promisc; ic->ic_update_mcast = wpi_update_mcast; + ic->ic_newassoc = wpi_newassoc; ic->ic_scan_start = wpi_scan_start; ic->ic_scan_end = wpi_scan_end; ic->ic_set_channel = wpi_set_channel; @@ -2563,20 +2565,6 @@ wpi_tx_data(struct wpi_softc *sc, struct if (ismcast || type != IEEE80211_FC0_TYPE_DATA) tx.id = WPI_ID_BROADCAST; else { - if (wn->id == WPI_ID_UNDEFINED && - (vap->iv_opmode == IEEE80211_M_IBSS || - vap->iv_opmode == IEEE80211_M_AHDEMO)) { - WPI_NT_LOCK(sc); - error = wpi_add_ibss_node(sc, ni); - WPI_NT_UNLOCK(sc); - if (error != 0) { - device_printf(sc->sc_dev, - "%s: could not add IBSS node, error %d\n", - __func__, error); - goto fail; - } - } - if (wn->id == WPI_ID_UNDEFINED) { device_printf(sc->sc_dev, "%s: undefined node id\n", __func__); @@ -4019,6 +4007,28 @@ wpi_update_beacon(struct ieee80211vap *v WPI_UNLOCK(sc); } +static void +wpi_newassoc(struct ieee80211_node *ni, int isnew) +{ + struct ieee80211vap *vap = ni->ni_vap; + struct wpi_softc *sc = ni->ni_ic->ic_ifp->if_softc; + struct wpi_node *wn = WPI_NODE(ni); + int error; + + WPI_NT_LOCK(sc); + + DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_DOING, __func__); + + if (vap->iv_opmode != IEEE80211_M_STA && wn->id == WPI_ID_UNDEFINED) { + if ((error = wpi_add_ibss_node(sc, ni)) != 0) { + device_printf(sc->sc_dev, + "%s: could not add IBSS node, error %d\n", + __func__, error); + } + } + WPI_NT_UNLOCK(sc); +} + static int wpi_run(struct wpi_softc *sc, struct ieee80211vap *vap) {