Date: Sun, 25 Aug 2013 10:17:16 GMT From: ccqin@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r256487 - soc2013/ccqin/head/sys/net80211 Message-ID: <201308251017.r7PAHGcg074095@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <net80211/ieee80211_ratectl.h> 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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308251017.r7PAHGcg074095>