From owner-svn-src-all@freebsd.org Mon Oct 19 01:21:30 2015 Return-Path: Delivered-To: svn-src-all@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 C0AF7A18231; Mon, 19 Oct 2015 01:21:30 +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 71F241F06; Mon, 19 Oct 2015 01:21:30 +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 t9J1LTQK080352; Mon, 19 Oct 2015 01:21:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9J1LTZ2080351; Mon, 19 Oct 2015 01:21:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510190121.t9J1LTZ2080351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 19 Oct 2015 01:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289557 - head/sys/dev/otus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2015 01:21:30 -0000 Author: adrian Date: Mon Oct 19 01:21:29 2015 New Revision: 289557 URL: https://svnweb.freebsd.org/changeset/base/289557 Log: otus(4) - use the local node alloc function so there's space for statistics. * Use the correct malloc type for node allocation - M_80211_NODE - so the default node free method in net80211 will work correctly. * Fix otus_node_alloc() to suit FreeBSD's net80211. * .. and actually call otus_node_alloc() so there's space for the per-node tx statistics. Otherwise, well, it will be scribbling over random memory. Tested: * AR9170, STA mode Modified: head/sys/dev/otus/if_otus.c Modified: head/sys/dev/otus/if_otus.c ============================================================================== --- head/sys/dev/otus/if_otus.c Mon Oct 19 01:14:26 2015 (r289556) +++ head/sys/dev/otus/if_otus.c Mon Oct 19 01:21:29 2015 (r289557) @@ -164,7 +164,8 @@ int otus_cmd(struct otus_softc *, uint8 void *, int); void otus_write(struct otus_softc *, uint32_t, uint32_t); int otus_write_barrier(struct otus_softc *); -struct ieee80211_node *otus_node_alloc(struct ieee80211com *); +static struct ieee80211_node *otus_node_alloc(struct ieee80211vap *vap, + const uint8_t mac[IEEE80211_ADDR_LEN]); int otus_media_change(struct ifnet *); int otus_read_eeprom(struct otus_softc *); void otus_newassoc(struct ieee80211_node *, int); @@ -814,6 +815,7 @@ otus_attachhook(struct otus_softc *sc) ic->ic_ampdu_enable = otus_ampdu_enable; ic->ic_wme.wme_update = otus_wme_update; ic->ic_newassoc = otus_newassoc; + ic->ic_node_alloc = otus_node_alloc; #ifdef notyet ic->ic_set_key = otus_set_key; @@ -1387,10 +1389,12 @@ otus_write_barrier(struct otus_softc *sc return error; } -struct ieee80211_node * -otus_node_alloc(struct ieee80211com *ic) +static struct ieee80211_node * +otus_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) { - return malloc(sizeof (struct otus_node), M_DEVBUF, M_NOWAIT | M_ZERO); + + return malloc(sizeof (struct otus_node), M_80211_NODE, + M_NOWAIT | M_ZERO); } #if 0