From owner-svn-soc-all@FreeBSD.ORG Sun Aug 25 10:17:16 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 87C1196F for ; Sun, 25 Aug 2013 10:17:16 +0000 (UTC) (envelope-from ccqin@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5B26B258F for ; Sun, 25 Aug 2013 10:17:16 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7PAHGsM074097 for ; Sun, 25 Aug 2013 10:17:16 GMT (envelope-from ccqin@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r7PAHGcg074095 for svn-soc-all@FreeBSD.org; Sun, 25 Aug 2013 10:17:16 GMT (envelope-from ccqin@FreeBSD.org) Date: Sun, 25 Aug 2013 10:17:16 GMT Message-Id: <201308251017.r7PAHGcg074095@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to ccqin@FreeBSD.org using -f From: ccqin@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r256487 - soc2013/ccqin/head/sys/net80211 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Aug 2013 10:17:16 -0000 Author: ccqin Date: Sun Aug 25 10:17:16 2013 New Revision: 256487 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=256487 Log: change to ieee80211_ratectl_none * rename ieee80211_ratectl_none.c to ieee80211_rc_none.c * update __init__ and __node_init__ interface * add ieee80211_ratectl_none.h for the common state fields. Added: soc2013/ccqin/head/sys/net80211/ieee80211_rc_none.c - copied, changed from r255970, soc2013/ccqin/head/sys/net80211/ieee80211_ratectl_none.c Deleted: soc2013/ccqin/head/sys/net80211/ieee80211_ratectl_none.c Copied and modified: soc2013/ccqin/head/sys/net80211/ieee80211_rc_none.c (from r255970, soc2013/ccqin/head/sys/net80211/ieee80211_ratectl_none.c) ============================================================================== --- soc2013/ccqin/head/sys/net80211/ieee80211_ratectl_none.c Thu Aug 15 10:18:36 2013 (r255970, copy source) +++ soc2013/ccqin/head/sys/net80211/ieee80211_rc_none.c Sun Aug 25 10:17:16 2013 (r256487) @@ -46,8 +46,23 @@ #include static void -none_init(struct ieee80211vap *vap) +none_init(struct ieee80211vap *vap, uint32_t capabilities) { + struct ieee80211_node *none; + + KASSERT(vap->iv_rs == NULL, ("%s called multiple times", __func__)); + + none = vap->iv_rs = malloc(sizeof(struct ieee80211_none), + M_80211_RATECTL, M_NOWAIT|M_ZERO); + if (none == NULL) { + if_printf(vap->iv_ifp, "couldn't alloc ratectl structure\n"); + return; + } + + struct ieee80211_rc_stat * irs = IEEE80211_RATECTL_STAT(vap); + irs->irs_capabilities = capabilities; + + /* ... */ } static void @@ -57,8 +72,29 @@ } static void -none_node_init(struct ieee80211_node *ni, uint32_t capabilities) +none_node_init(struct ieee80211_node *ni) { + const struct ieee80211_rateset *rs = NULL; + struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211_amrr *amrr = vap->iv_rs; + struct ieee80211_none_node *non; + uint8_t rate; + + if (ni->ni_rctls == NULL) { + ni->ni_rctls = non = malloc(sizeof(struct ieee80211_none_node), + M_80211_RATECTL, M_NOWAIT|M_ZERO); + if (non == NULL) { + if_printf(vap->iv_ifp, "couldn't alloc per-node ratectl " + "structure\n"); + return; + } + } else + non = ni->ni_rctls; + + non->non_none = none; + + /* ... */ + ni->ni_txrate = ni->ni_rates.rs_rates[0] & IEEE80211_RATE_VAL; }