Commit f52a0ad0 authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brcm80211: further replaced wlc_ by brcmsmac_c_

Code cleanup. Renamed functions.
Signed-off-by: default avatarRoland Vossen <rvossen@broadcom.com>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent bddf5b14
......@@ -126,7 +126,7 @@ static void wlc_bsscfg_ID_assign(struct brcms_c_info *wlc,
/*
* The common driver entry routine. Error codes should be unique
*/
struct brcms_c_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
{
struct brcms_c_info *wlc;
......@@ -246,11 +246,11 @@ struct brcms_c_info *wlc_attach_malloc(uint unit, uint *err, uint devid)
return wlc;
fail:
wlc_detach_mfree(wlc);
brcms_c_detach_mfree(wlc);
return NULL;
}
void wlc_detach_mfree(struct brcms_c_info *wlc)
void brcms_c_detach_mfree(struct brcms_c_info *wlc)
{
if (wlc == NULL)
return;
......
......@@ -14,5 +14,6 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
extern struct brcms_c_info *wlc_attach_malloc(uint unit, uint *err, uint devid);
extern void wlc_detach_mfree(struct brcms_c_info *wlc);
extern struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err,
uint devid);
extern void brcms_c_detach_mfree(struct brcms_c_info *wlc);
This diff is collapsed.
......@@ -17,13 +17,14 @@
#ifndef _BRCM_AMPDU_H_
#define _BRCM_AMPDU_H_
extern struct ampdu_info *wlc_ampdu_attach(struct brcms_c_info *wlc);
extern void wlc_ampdu_detach(struct ampdu_info *ampdu);
extern int wlc_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
struct sk_buff **aggp, int prec);
extern void wlc_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
extern struct ampdu_info *brcms_c_ampdu_attach(struct brcms_c_info *wlc);
extern void brcms_c_ampdu_detach(struct ampdu_info *ampdu);
extern int brcms_c_sendampdu(struct ampdu_info *ampdu,
struct brcms_c_txq_info *qi,
struct sk_buff **aggp, int prec);
extern void brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
struct sk_buff *p, tx_status_t *txs);
extern void wlc_ampdu_macaddr_upd(struct brcms_c_info *wlc);
extern void wlc_ampdu_shm_upd(struct ampdu_info *ampdu);
extern void brcms_c_ampdu_macaddr_upd(struct brcms_c_info *wlc);
extern void brcms_c_ampdu_shm_upd(struct ampdu_info *ampdu);
#endif /* _BRCM_AMPDU_H_ */
......@@ -50,10 +50,11 @@
#define ANT_SELCFG_DEF_2x4 0x02 /* default antenna configuration */
/* static functions */
static int wlc_antsel_cfgupd(struct antsel_info *asi, wlc_antselcfg_t *antsel);
static u8 wlc_antsel_id2antcfg(struct antsel_info *asi, u8 id);
static u16 wlc_antsel_antcfg2antsel(struct antsel_info *asi, u8 ant_cfg);
static void wlc_antsel_init_cfg(struct antsel_info *asi,
static int brcms_c_antsel_cfgupd(struct antsel_info *asi,
wlc_antselcfg_t *antsel);
static u8 brcms_c_antsel_id2antcfg(struct antsel_info *asi, u8 id);
static u16 brcms_c_antsel_antcfg2antsel(struct antsel_info *asi, u8 ant_cfg);
static void brcms_c_antsel_init_cfg(struct antsel_info *asi,
wlc_antselcfg_t *antsel,
bool auto_sel);
......@@ -81,14 +82,14 @@ const u8 mimo_2x3_div_antselid_tbl[16] = {
0, 0, 0, 0, 0, 0, 0, 0 /* pat to antselid */
};
struct antsel_info *wlc_antsel_attach(struct brcms_c_info *wlc)
struct antsel_info *brcms_c_antsel_attach(struct brcms_c_info *wlc)
{
struct antsel_info *asi;
asi = kzalloc(sizeof(struct antsel_info), GFP_ATOMIC);
if (!asi) {
wiphy_err(wlc->wiphy, "wl%d: wlc_antsel_attach: out of mem\n",
wlc->pub->unit);
wiphy_err(wlc->wiphy, "wl%d: brcms_c_antsel_attach: out of "
"mem\n", wlc->pub->unit);
return NULL;
}
......@@ -117,7 +118,7 @@ struct antsel_info *wlc_antsel_attach(struct brcms_c_info *wlc)
asi->antsel_avail = false;
} else {
asi->antsel_avail = false;
wiphy_err(wlc->wiphy, "wlc_antsel_attach: 2o3 "
wiphy_err(wlc->wiphy, "antsel_attach: 2o3 "
"board cfg invalid\n");
}
break;
......@@ -139,27 +140,27 @@ struct antsel_info *wlc_antsel_attach(struct brcms_c_info *wlc)
brcms_b_antsel_type_set(wlc->hw, asi->antsel_type);
/* Init (auto/manual) antenna selection */
wlc_antsel_init_cfg(asi, &asi->antcfg_11n, true);
wlc_antsel_init_cfg(asi, &asi->antcfg_cur, true);
brcms_c_antsel_init_cfg(asi, &asi->antcfg_11n, true);
brcms_c_antsel_init_cfg(asi, &asi->antcfg_cur, true);
return asi;
}
void wlc_antsel_detach(struct antsel_info *asi)
void brcms_c_antsel_detach(struct antsel_info *asi)
{
kfree(asi);
}
void wlc_antsel_init(struct antsel_info *asi)
void brcms_c_antsel_init(struct antsel_info *asi)
{
if ((asi->antsel_type == ANTSEL_2x3) ||
(asi->antsel_type == ANTSEL_2x4))
wlc_antsel_cfgupd(asi, &asi->antcfg_11n);
brcms_c_antsel_cfgupd(asi, &asi->antcfg_11n);
}
/* boardlevel antenna selection: init antenna selection structure */
static void
wlc_antsel_init_cfg(struct antsel_info *asi, wlc_antselcfg_t *antsel,
brcms_c_antsel_init_cfg(struct antsel_info *asi, wlc_antselcfg_t *antsel,
bool auto_sel)
{
if (asi->antsel_type == ANTSEL_2x3) {
......@@ -190,7 +191,7 @@ wlc_antsel_init_cfg(struct antsel_info *asi, wlc_antselcfg_t *antsel,
}
void
wlc_antsel_antcfg_get(struct antsel_info *asi, bool usedef, bool sel,
brcms_c_antsel_antcfg_get(struct antsel_info *asi, bool usedef, bool sel,
u8 antselid, u8 fbantselid, u8 *antcfg,
u8 *fbantcfg)
{
......@@ -210,8 +211,8 @@ wlc_antsel_antcfg_get(struct antsel_info *asi, bool usedef, bool sel,
} else {
ant = asi->antcfg_11n.ant_config[ANT_SELCFG_TX_UNICAST];
if ((ant & ANT_SELCFG_AUTO) == ANT_SELCFG_AUTO) {
*antcfg = wlc_antsel_id2antcfg(asi, antselid);
*fbantcfg = wlc_antsel_id2antcfg(asi, fbantselid);
*antcfg = brcms_c_antsel_id2antcfg(asi, antselid);
*fbantcfg = brcms_c_antsel_id2antcfg(asi, fbantselid);
} else {
*antcfg =
asi->antcfg_11n.ant_config[ANT_SELCFG_TX_UNICAST];
......@@ -222,7 +223,7 @@ wlc_antsel_antcfg_get(struct antsel_info *asi, bool usedef, bool sel,
}
/* boardlevel antenna selection: convert mimo_antsel (ucode interface) to id */
u8 wlc_antsel_antsel2id(struct antsel_info *asi, u16 antsel)
u8 brcms_c_antsel_antsel2id(struct antsel_info *asi, u16 antsel)
{
u8 antselid = 0;
......@@ -241,7 +242,7 @@ u8 wlc_antsel_antsel2id(struct antsel_info *asi, u16 antsel)
}
/* boardlevel antenna selection: convert id to ant_cfg */
static u8 wlc_antsel_id2antcfg(struct antsel_info *asi, u8 id)
static u8 brcms_c_antsel_id2antcfg(struct antsel_info *asi, u8 id)
{
u8 antcfg = ANT_SELCFG_DEF_2x2;
......@@ -260,7 +261,7 @@ static u8 wlc_antsel_id2antcfg(struct antsel_info *asi, u8 id)
}
/* boardlevel antenna selection: convert ant_cfg to mimo_antsel (ucode interface) */
static u16 wlc_antsel_antcfg2antsel(struct antsel_info *asi, u8 ant_cfg)
static u16 brcms_c_antsel_antcfg2antsel(struct antsel_info *asi, u8 ant_cfg)
{
u8 idx = WLC_ANTIDX_11N(WLC_ANTSEL_11N(ant_cfg));
u16 mimo_antsel = 0;
......@@ -280,7 +281,8 @@ static u16 wlc_antsel_antcfg2antsel(struct antsel_info *asi, u8 ant_cfg)
}
/* boardlevel antenna selection: ucode interface control */
static int wlc_antsel_cfgupd(struct antsel_info *asi, wlc_antselcfg_t *antsel)
static int brcms_c_antsel_cfgupd(struct antsel_info *asi,
wlc_antselcfg_t *antsel)
{
struct brcms_c_info *wlc = asi->wlc;
u8 ant_cfg;
......@@ -290,7 +292,7 @@ static int wlc_antsel_cfgupd(struct antsel_info *asi, wlc_antselcfg_t *antsel)
* (aka default TX)
*/
ant_cfg = antsel->ant_config[ANT_SELCFG_TX_DEF];
mimo_antsel = wlc_antsel_antcfg2antsel(asi, ant_cfg);
mimo_antsel = brcms_c_antsel_antcfg2antsel(asi, ant_cfg);
brcms_c_write_shm(wlc, M_MIMO_ANTSEL_TXDFLT, mimo_antsel);
/* Update driver stats for currently selected default tx/rx antenna config */
asi->antcfg_cur.ant_config[ANT_SELCFG_TX_DEF] = ant_cfg;
......@@ -299,7 +301,7 @@ static int wlc_antsel_cfgupd(struct antsel_info *asi, wlc_antselcfg_t *antsel)
* (aka default RX)
*/
ant_cfg = antsel->ant_config[ANT_SELCFG_RX_DEF];
mimo_antsel = wlc_antsel_antcfg2antsel(asi, ant_cfg);
mimo_antsel = brcms_c_antsel_antcfg2antsel(asi, ant_cfg);
brcms_c_write_shm(wlc, M_MIMO_ANTSEL_RXDFLT, mimo_antsel);
/* Update driver stats for currently selected default tx/rx antenna config */
asi->antcfg_cur.ant_config[ANT_SELCFG_RX_DEF] = ant_cfg;
......
......@@ -17,13 +17,13 @@
#ifndef _BRCM_ANTSEL_H_
#define _BRCM_ANTSEL_H_
extern struct antsel_info *wlc_antsel_attach(struct brcms_c_info *wlc);
extern void wlc_antsel_detach(struct antsel_info *asi);
extern void wlc_antsel_init(struct antsel_info *asi);
extern void wlc_antsel_antcfg_get(struct antsel_info *asi, bool usedef,
extern struct antsel_info *brcms_c_antsel_attach(struct brcms_c_info *wlc);
extern void brcms_c_antsel_detach(struct antsel_info *asi);
extern void brcms_c_antsel_init(struct antsel_info *asi);
extern void brcms_c_antsel_antcfg_get(struct antsel_info *asi, bool usedef,
bool sel,
u8 id, u8 fbid, u8 *antcfg,
u8 *fbantcfg);
extern u8 wlc_antsel_antsel2id(struct antsel_info *asi, u16 antsel);
extern u8 brcms_c_antsel_antsel2id(struct antsel_info *asi, u16 antsel);
#endif /* _BRCM_ANTSEL_H_ */
......@@ -103,18 +103,18 @@ struct country_info {
const u8 locale_mimo_5G; /* 5G mimo info */
};
extern wlc_cm_info_t *wlc_channel_mgr_attach(struct brcms_c_info *wlc);
extern void wlc_channel_mgr_detach(wlc_cm_info_t *wlc_cm);
extern wlc_cm_info_t *brcms_c_channel_mgr_attach(struct brcms_c_info *wlc);
extern void brcms_c_channel_mgr_detach(wlc_cm_info_t *wlc_cm);
extern u8 wlc_channel_locale_flags_in_band(wlc_cm_info_t *wlc_cm,
extern u8 brcms_c_channel_locale_flags_in_band(wlc_cm_info_t *wlc_cm,
uint bandunit);
extern bool wlc_valid_chanspec_db(wlc_cm_info_t *wlc_cm, chanspec_t chspec);
extern bool brcms_c_valid_chanspec_db(wlc_cm_info_t *wlc_cm, chanspec_t chspec);
extern void wlc_channel_reg_limits(wlc_cm_info_t *wlc_cm,
extern void brcms_c_channel_reg_limits(wlc_cm_info_t *wlc_cm,
chanspec_t chanspec,
struct txpwr_limits *txpwr);
extern void wlc_channel_set_chanspec(wlc_cm_info_t *wlc_cm,
extern void brcms_c_channel_set_chanspec(wlc_cm_info_t *wlc_cm,
chanspec_t chanspec,
u8 local_constraint_qdbm);
......
......@@ -651,7 +651,7 @@ brcms_ops_ampdu_action(struct ieee80211_hw *hw,
case IEEE80211_AMPDU_TX_STOP:
LOCK(wl);
wlc_ampdu_flush(wl->wlc, sta, tid);
brcms_c_ampdu_flush(wl->wlc, sta, tid);
UNLOCK(wl);
ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
break;
......
This diff is collapsed.
......@@ -620,11 +620,11 @@ extern struct wlc_pub *brcms_c_pub(void *wlc);
/* common functions for every port */
extern void brcms_c_mhf(struct brcms_c_info *wlc, u8 idx, u16 mask, u16 val,
int bands);
extern void wlc_rate_lookup_init(struct brcms_c_info *wlc,
wlc_rateset_t *rateset);
extern void brcms_c_rate_lookup_init(struct brcms_c_info *wlc,
wlc_rateset_t *rateset);
extern void brcms_default_rateset(struct brcms_c_info *wlc, wlc_rateset_t *rs);
extern void wlc_ampdu_flush(struct brcms_c_info *wlc,
extern void brcms_c_ampdu_flush(struct brcms_c_info *wlc,
struct ieee80211_sta *sta, u16 tid);
extern int brcms_c_set_par(struct brcms_c_info *wlc, enum wlc_par_id par_id,
int val);
......
......@@ -246,12 +246,10 @@ const wlc_rateset_t cck_rates = {
0x00, 0x00, 0x00, 0x00}
};
static bool wlc_rateset_valid(wlc_rateset_t *rs, bool check_brate);
/* check if rateset is valid.
* if check_brate is true, rateset without a basic rate is considered NOT valid.
*/
static bool wlc_rateset_valid(wlc_rateset_t *rs, bool check_brate)
static bool brcms_c_rateset_valid(wlc_rateset_t *rs, bool check_brate)
{
uint idx;
......@@ -269,7 +267,7 @@ static bool wlc_rateset_valid(wlc_rateset_t *rs, bool check_brate)
return false;
}
void wlc_rateset_mcs_upd(wlc_rateset_t *rs, u8 txstreams)
void brcms_c_rateset_mcs_upd(wlc_rateset_t *rs, u8 txstreams)
{
int i;
for (i = txstreams; i < MAX_STREAMS_SUPPORTED; i++)
......@@ -280,7 +278,7 @@ void wlc_rateset_mcs_upd(wlc_rateset_t *rs, u8 txstreams)
* and check if resulting rateset is valid.
*/
bool
wlc_rate_hwrs_filter_sort_validate(wlc_rateset_t *rs,
brcms_c_rate_hwrs_filter_sort_validate(wlc_rateset_t *rs,
const wlc_rateset_t *hw_rs,
bool check_brate, u8 txstreams)
{
......@@ -315,14 +313,14 @@ wlc_rate_hwrs_filter_sort_validate(wlc_rateset_t *rs,
for (i = 0; i < MCSSET_LEN; i++)
rs->mcs[i] = (rs->mcs[i] & hw_rs->mcs[i]);
if (wlc_rateset_valid(rs, check_brate))
if (brcms_c_rateset_valid(rs, check_brate))
return true;
else
return false;
}
/* calculate the rate of a rx'd frame and return it as a ratespec */
ratespec_t wlc_compute_rspec(d11rxhdr_t *rxh, u8 *plcp)
ratespec_t brcms_c_compute_rspec(d11rxhdr_t *rxh, u8 *plcp)
{
int phy_type;
ratespec_t rspec = PHY_TXC1_BW_20MHZ << RSPEC_BW_SHIFT;
......@@ -368,7 +366,7 @@ ratespec_t wlc_compute_rspec(d11rxhdr_t *rxh, u8 *plcp)
}
/* copy rateset src to dst as-is (no masking or sorting) */
void wlc_rateset_copy(const wlc_rateset_t *src, wlc_rateset_t *dst)
void brcms_c_rateset_copy(const wlc_rateset_t *src, wlc_rateset_t *dst)
{
memcpy(dst, src, sizeof(wlc_rateset_t));
}
......@@ -383,7 +381,7 @@ void wlc_rateset_copy(const wlc_rateset_t *src, wlc_rateset_t *dst)
* 'xmask' is the copy mask (typically 0x7f or 0xff).
*/
void
wlc_rateset_filter(wlc_rateset_t *src, wlc_rateset_t *dst, bool basic_only,
brcms_c_rateset_filter(wlc_rateset_t *src, wlc_rateset_t *dst, bool basic_only,
u8 rates, uint xmask, bool mcsallow)
{
uint i;
......@@ -407,14 +405,14 @@ wlc_rateset_filter(wlc_rateset_t *src, wlc_rateset_t *dst, bool basic_only,
if (mcsallow && rates != WLC_RATES_CCK)
memcpy(&dst->mcs[0], &src->mcs[0], MCSSET_LEN);
else
wlc_rateset_mcs_clear(dst);
brcms_c_rateset_mcs_clear(dst);
}
/* select rateset for a given phy_type and bandtype and filter it, sort it
* and fill rs_tgt with result
*/
void
wlc_rateset_default(wlc_rateset_t *rs_tgt, const wlc_rateset_t *rs_hw,
brcms_c_rateset_default(wlc_rateset_t *rs_tgt, const wlc_rateset_t *rs_hw,
uint phy_type, int bandtype, bool cck_only, uint rate_mask,
bool mcsallow, u8 bw, u8 txstreams)
{
......@@ -447,16 +445,16 @@ wlc_rateset_default(wlc_rateset_t *rs_tgt, const wlc_rateset_t *rs_hw,
if (!rs_hw)
rs_hw = rs_dflt;
wlc_rateset_copy(rs_dflt, &rs_sel);
wlc_rateset_mcs_upd(&rs_sel, txstreams);
wlc_rateset_filter(&rs_sel, rs_tgt, false,
brcms_c_rateset_copy(rs_dflt, &rs_sel);
brcms_c_rateset_mcs_upd(&rs_sel, txstreams);
brcms_c_rateset_filter(&rs_sel, rs_tgt, false,
cck_only ? WLC_RATES_CCK : WLC_RATES_CCK_OFDM,
rate_mask, mcsallow);
wlc_rate_hwrs_filter_sort_validate(rs_tgt, rs_hw, false,
brcms_c_rate_hwrs_filter_sort_validate(rs_tgt, rs_hw, false,
mcsallow ? txstreams : 1);
}
s16 wlc_rate_legacy_phyctl(uint rate)
s16 brcms_c_rate_legacy_phyctl(uint rate)
{
uint i;
for (i = 0; i < LEGACY_PHYCFG_TABLE_SIZE; i++)
......@@ -466,21 +464,21 @@ s16 wlc_rate_legacy_phyctl(uint rate)
return -1;
}
void wlc_rateset_mcs_clear(wlc_rateset_t *rateset)
void brcms_c_rateset_mcs_clear(wlc_rateset_t *rateset)
{
uint i;
for (i = 0; i < MCSSET_LEN; i++)
rateset->mcs[i] = 0;
}
void wlc_rateset_mcs_build(wlc_rateset_t *rateset, u8 txstreams)
void brcms_c_rateset_mcs_build(wlc_rateset_t *rateset, u8 txstreams)
{
memcpy(&rateset->mcs[0], &cck_ofdm_mimo_rates.mcs[0], MCSSET_LEN);
wlc_rateset_mcs_upd(rateset, txstreams);
brcms_c_rateset_mcs_upd(rateset, txstreams);
}
/* Based on bandwidth passed, allow/disallow MCS 32 in the rateset */
void wlc_rateset_bw_mcs_filter(wlc_rateset_t *rateset, u8 bw)
void brcms_c_rateset_bw_mcs_filter(wlc_rateset_t *rateset, u8 bw)
{
if (bw == WLC_40_MHZ)
setbit(rateset->mcs, 32);
......
......@@ -133,35 +133,37 @@ extern const u8 ofdm_rate_lookup[];
#define OFDM_PHY2MAC_RATE(rlpt) (ofdm_rate_lookup[rlpt & 0x7])
#define CCK_PHY2MAC_RATE(signal) (signal/5)
/* Rates specified in wlc_rateset_filter() */
/* Rates specified in brcms_c_rateset_filter() */
#define WLC_RATES_CCK_OFDM 0
#define WLC_RATES_CCK 1
#define WLC_RATES_OFDM 2
/* sanitize, and sort a rateset with the basic bit(s) preserved, validate rateset */
extern bool wlc_rate_hwrs_filter_sort_validate(struct wlc_rateset *rs,
extern bool brcms_c_rate_hwrs_filter_sort_validate(struct wlc_rateset *rs,
const struct wlc_rateset *hw_rs,
bool check_brate,
u8 txstreams);
/* copy rateset src to dst as-is (no masking or sorting) */
extern void wlc_rateset_copy(const struct wlc_rateset *src,
extern void brcms_c_rateset_copy(const struct wlc_rateset *src,
struct wlc_rateset *dst);
/* would be nice to have these documented ... */
extern ratespec_t wlc_compute_rspec(d11rxhdr_t *rxh, u8 *plcp);
extern ratespec_t brcms_c_compute_rspec(d11rxhdr_t *rxh, u8 *plcp);
extern void wlc_rateset_filter(struct wlc_rateset *src, struct wlc_rateset *dst,
bool basic_only, u8 rates, uint xmask,
bool mcsallow);
extern void wlc_rateset_default(struct wlc_rateset *rs_tgt,
extern void brcms_c_rateset_filter(struct wlc_rateset *src,
struct wlc_rateset *dst, bool basic_only, u8 rates, uint xmask,
bool mcsallow);
extern void brcms_c_rateset_default(struct wlc_rateset *rs_tgt,
const struct wlc_rateset *rs_hw, uint phy_type,
int bandtype, bool cck_only, uint rate_mask,
bool mcsallow, u8 bw, u8 txstreams);
extern s16 wlc_rate_legacy_phyctl(uint rate);
extern s16 brcms_c_rate_legacy_phyctl(uint rate);
extern void wlc_rateset_mcs_upd(struct wlc_rateset *rs, u8 txstreams);
extern void wlc_rateset_mcs_clear(struct wlc_rateset *rateset);
extern void wlc_rateset_mcs_build(struct wlc_rateset *rateset, u8 txstreams);
extern void wlc_rateset_bw_mcs_filter(struct wlc_rateset *rateset, u8 bw);
extern void brcms_c_rateset_mcs_upd(struct wlc_rateset *rs, u8 txstreams);
extern void brcms_c_rateset_mcs_clear(struct wlc_rateset *rateset);
extern void brcms_c_rateset_mcs_build(struct wlc_rateset *rateset,
u8 txstreams);
extern void brcms_c_rateset_bw_mcs_filter(struct wlc_rateset *rateset, u8 bw);
#endif /* _WLC_RATE_H_ */
......@@ -31,13 +31,14 @@
#define WLC_STF_SS_STBC_RX(wlc) (WLCISNPHY(wlc->band) && \
NREV_GT(wlc->band->phyrev, 3) && NREV_LE(wlc->band->phyrev, 6))
static bool wlc_stf_stbc_tx_set(struct brcms_c_info *wlc, s32 int_val);
static int wlc_stf_txcore_set(struct brcms_c_info *wlc, u8 Nsts, u8 val);
static int wlc_stf_spatial_policy_set(struct brcms_c_info *wlc, int val);
static void wlc_stf_stbc_rx_ht_update(struct brcms_c_info *wlc, int val);
static bool brcms_c_stf_stbc_tx_set(struct brcms_c_info *wlc, s32 int_val);
static int brcms_c_stf_txcore_set(struct brcms_c_info *wlc, u8 Nsts, u8 val);
static int brcms_c_stf_spatial_policy_set(struct brcms_c_info *wlc, int val);
static void brcms_c_stf_stbc_rx_ht_update(struct brcms_c_info *wlc, int val);
static void _wlc_stf_phy_txant_upd(struct brcms_c_info *wlc);
static u16 _wlc_stf_phytxchain_sel(struct brcms_c_info *wlc, ratespec_t rspec);
static void _brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc);
static u16 _brcms_c_stf_phytxchain_sel(struct brcms_c_info *wlc,
ratespec_t rspec);
#define NSTS_1 1
#define NSTS_2 2
......@@ -51,7 +52,7 @@ const u8 txcore_default[5] = {
(0x0f) /* For Nsts = 4, enable all cores */
};
static void wlc_stf_stbc_rx_ht_update(struct brcms_c_info *wlc, int val)
static void brcms_c_stf_stbc_rx_ht_update(struct brcms_c_info *wlc, int val)
{
/* MIMOPHYs rev3-6 cannot receive STBC with only one rx core active */
if (WLC_STF_SS_STBC_RX(wlc)) {
......@@ -69,7 +70,7 @@ static void wlc_stf_stbc_rx_ht_update(struct brcms_c_info *wlc, int val)
}
/* every WLC_TEMPSENSE_PERIOD seconds temperature check to decide whether to turn on/off txchain */
void wlc_tempsense_upd(struct brcms_c_info *wlc)
void brcms_c_tempsense_upd(struct brcms_c_info *wlc)
{
wlc_phy_t *pi = wlc->band->pi;
uint active_chains, txchain;
......@@ -82,18 +83,18 @@ void wlc_tempsense_upd(struct brcms_c_info *wlc)
if (wlc->stf->txchain == wlc->stf->hw_txchain) {
if (txchain && (txchain < wlc->stf->hw_txchain)) {
/* turn off 1 tx chain */
wlc_stf_txchain_set(wlc, txchain, true);
brcms_c_stf_txchain_set(wlc, txchain, true);
}
} else if (wlc->stf->txchain < wlc->stf->hw_txchain) {
if (txchain == wlc->stf->hw_txchain) {
/* turn back on txchain */
wlc_stf_txchain_set(wlc, txchain, true);
brcms_c_stf_txchain_set(wlc, txchain, true);
}
}
}
void
wlc_stf_ss_algo_channel_get(struct brcms_c_info *wlc, u16 *ss_algo_channel,
brcms_c_stf_ss_algo_channel_get(struct brcms_c_info *wlc, u16 *ss_algo_channel,
chanspec_t chanspec)
{
tx_power_t power;
......@@ -134,7 +135,7 @@ wlc_stf_ss_algo_channel_get(struct brcms_c_info *wlc, u16 *ss_algo_channel,
setbit(ss_algo_channel, PHY_TXC1_MODE_STBC);
}
static bool wlc_stf_stbc_tx_set(struct brcms_c_info *wlc, s32 int_val)
static bool brcms_c_stf_stbc_tx_set(struct brcms_c_info *wlc, s32 int_val)
{
if ((int_val != AUTO) && (int_val != OFF) && (int_val != ON)) {
return false;
......@@ -155,7 +156,7 @@ static bool wlc_stf_stbc_tx_set(struct brcms_c_info *wlc, s32 int_val)
return true;
}
bool wlc_stf_stbc_rx_set(struct brcms_c_info *wlc, s32 int_val)
bool brcms_c_stf_stbc_rx_set(struct brcms_c_info *wlc, s32 int_val)
{
if ((int_val != HT_CAP_RX_STBC_NO)
&& (int_val != HT_CAP_RX_STBC_ONE_STREAM)) {
......@@ -168,11 +169,12 @@ bool wlc_stf_stbc_rx_set(struct brcms_c_info *wlc, s32 int_val)
return false;
}
wlc_stf_stbc_rx_ht_update(wlc, int_val);
brcms_c_stf_stbc_rx_ht_update(wlc, int_val);
return true;
}
static int wlc_stf_txcore_set(struct brcms_c_info *wlc, u8 Nsts, u8 core_mask)
static int brcms_c_stf_txcore_set(struct brcms_c_info *wlc, u8 Nsts,
u8 core_mask)
{
BCMMSG(wlc->wiphy, "wl%d: Nsts %d core_mask %x\n",
wlc->pub->unit, Nsts, core_mask);
......@@ -205,7 +207,7 @@ static int wlc_stf_txcore_set(struct brcms_c_info *wlc, u8 Nsts, u8 core_mask)
return 0;
}
static int wlc_stf_spatial_policy_set(struct brcms_c_info *wlc, int val)
static int brcms_c_stf_spatial_policy_set(struct brcms_c_info *wlc, int val)
{
int i;
u8 core_mask = 0;
......@@ -216,12 +218,12 @@ static int wlc_stf_spatial_policy_set(struct brcms_c_info *wlc, int val)
for (i = 1; i <= MAX_STREAMS_SUPPORTED; i++) {
core_mask = (val == MAX_SPATIAL_EXPANSION) ?
wlc->stf->txchain : txcore_default[i];
wlc_stf_txcore_set(wlc, (u8) i, core_mask);
brcms_c_stf_txcore_set(wlc, (u8) i, core_mask);
}
return 0;
}
int wlc_stf_txchain_set(struct brcms_c_info *wlc, s32 int_val, bool force)
int brcms_c_stf_txchain_set(struct brcms_c_info *wlc, s32 int_val, bool force)
{
u8 txchain = (u8) int_val;
u8 txstreams;
......@@ -271,24 +273,24 @@ int wlc_stf_txchain_set(struct brcms_c_info *wlc, s32 int_val, bool force)
wlc->stf->txchain = txchain;
wlc->stf->txstreams = txstreams;
wlc_stf_stbc_tx_set(wlc, wlc->band->band_stf_stbc_tx);
wlc_stf_ss_update(wlc, wlc->bandstate[BAND_2G_INDEX]);
wlc_stf_ss_update(wlc, wlc->bandstate[BAND_5G_INDEX]);
brcms_c_stf_stbc_tx_set(wlc, wlc->band->band_stf_stbc_tx);
brcms_c_stf_ss_update(wlc, wlc->bandstate[BAND_2G_INDEX]);
brcms_c_stf_ss_update(wlc, wlc->bandstate[BAND_5G_INDEX]);
wlc->stf->txant =
(wlc->stf->txstreams == 1) ? ANT_TX_FORCE_0 : ANT_TX_DEF;
_wlc_stf_phy_txant_upd(wlc);
_brcms_c_stf_phy_txant_upd(wlc);
wlc_phy_stf_chain_set(wlc->band->pi, wlc->stf->txchain,
wlc->stf->rxchain);
for (i = 1; i <= MAX_STREAMS_SUPPORTED; i++)
wlc_stf_txcore_set(wlc, (u8) i, txcore_default[i]);
brcms_c_stf_txcore_set(wlc, (u8) i, txcore_default[i]);
return 0;
}
/* update wlc->stf->ss_opmode which represents the operational stf_ss mode we're using */
int wlc_stf_ss_update(struct brcms_c_info *wlc, struct brcms_c_band *band)
int brcms_c_stf_ss_update(struct brcms_c_info *wlc, struct brcms_c_band *band)
{
int ret_code = 0;
u8 prev_stf_ss;
......@@ -320,7 +322,7 @@ int wlc_stf_ss_update(struct brcms_c_info *wlc, struct brcms_c_band *band)
return ret_code;
}
int wlc_stf_attach(struct brcms_c_info *wlc)
int brcms_c_stf_attach(struct brcms_c_info *wlc)
{
wlc->bandstate[BAND_2G_INDEX]->band_stf_ss_mode = PHY_TXC1_MODE_SISO;
wlc->bandstate[BAND_5G_INDEX]->band_stf_ss_mode = PHY_TXC1_MODE_CDD;
......@@ -329,10 +331,10 @@ int wlc_stf_attach(struct brcms_c_info *wlc)
(wlc_phy_txpower_hw_ctrl_get(wlc->band->pi) != PHY_TPC_HW_ON))
wlc->bandstate[BAND_2G_INDEX]->band_stf_ss_mode =
PHY_TXC1_MODE_CDD;
wlc_stf_ss_update(wlc, wlc->bandstate[BAND_2G_INDEX]);
wlc_stf_ss_update(wlc, wlc->bandstate[BAND_5G_INDEX]);
brcms_c_stf_ss_update(wlc, wlc->bandstate[BAND_2G_INDEX]);
brcms_c_stf_ss_update(wlc, wlc->bandstate[BAND_5G_INDEX]);
wlc_stf_stbc_rx_ht_update(wlc, HT_CAP_RX_STBC_NO);
brcms_c_stf_stbc_rx_ht_update(wlc, HT_CAP_RX_STBC_NO);
wlc->bandstate[BAND_2G_INDEX]->band_stf_stbc_tx = OFF;
wlc->bandstate[BAND_5G_INDEX]->band_stf_stbc_tx = OFF;
......@@ -343,7 +345,7 @@ int wlc_stf_attach(struct brcms_c_info *wlc)
return 0;
}
void wlc_stf_detach(struct brcms_c_info *wlc)
void brcms_c_stf_detach(struct brcms_c_info *wlc)
{
}
......@@ -361,7 +363,7 @@ void wlc_stf_detach(struct brcms_c_info *wlc)
* do tx-antenna selection for SISO transmissions
* for NREV>=7, bit 6 and bit 7 mean antenna 0 and 1 respectively, nit6+bit7 means both cores active
*/
static void _wlc_stf_phy_txant_upd(struct brcms_c_info *wlc)
static void _brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc)
{
s8 txant;
......@@ -399,12 +401,12 @@ static void _wlc_stf_phy_txant_upd(struct brcms_c_info *wlc)
brcms_b_txant_set(wlc->hw, wlc->stf->phytxant);
}
void wlc_stf_phy_txant_upd(struct brcms_c_info *wlc)
void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc)
{
_wlc_stf_phy_txant_upd(wlc);
_brcms_c_stf_phy_txant_upd(wlc);
}
void wlc_stf_phy_chain_calc(struct brcms_c_info *wlc)
void brcms_c_stf_phy_chain_calc(struct brcms_c_info *wlc)
{
/* get available rx/tx chains */
wlc->stf->hw_txchain = (u8) getintvar(wlc->pub->vars, "txchain");
......@@ -438,10 +440,11 @@ void wlc_stf_phy_chain_calc(struct brcms_c_info *wlc)
/* default spatial_policy */
wlc->stf->spatial_policy = MIN_SPATIAL_EXPANSION;
wlc_stf_spatial_policy_set(wlc, MIN_SPATIAL_EXPANSION);
brcms_c_stf_spatial_policy_set(wlc, MIN_SPATIAL_EXPANSION);
}
static u16 _wlc_stf_phytxchain_sel(struct brcms_c_info *wlc, ratespec_t rspec)
static u16 _brcms_c_stf_phytxchain_sel(struct brcms_c_info *wlc,
ratespec_t rspec)
{
u16 phytxant = wlc->stf->phytxant;
......@@ -453,19 +456,19 @@ static u16 _wlc_stf_phytxchain_sel(struct brcms_c_info *wlc, ratespec_t rspec)
return phytxant;
}
u16 wlc_stf_phytxchain_sel(struct brcms_c_info *wlc, ratespec_t rspec)
u16 brcms_c_stf_phytxchain_sel(struct brcms_c_info *wlc, ratespec_t rspec)
{
return _wlc_stf_phytxchain_sel(wlc, rspec);
return _brcms_c_stf_phytxchain_sel(wlc, rspec);
}
u16 wlc_stf_d11hdrs_phyctl_txant(struct brcms_c_info *wlc, ratespec_t rspec)
u16 brcms_c_stf_d11hdrs_phyctl_txant(struct brcms_c_info *wlc, ratespec_t rspec)
{
u16 phytxant = wlc->stf->phytxant;
u16 mask = PHY_TXC_ANT_MASK;
/* for non-siso rates or default setting, use the available chains */
if (WLCISNPHY(wlc->band)) {
phytxant = _wlc_stf_phytxchain_sel(wlc, rspec);
phytxant = _brcms_c_stf_phytxchain_sel(wlc, rspec);
mask = PHY_TXC_HTANT_MASK;
}
phytxant |= phytxant & mask;
......
......@@ -19,23 +19,24 @@
#include "types.h"
extern int wlc_stf_attach(struct brcms_c_info *wlc);
extern void wlc_stf_detach(struct brcms_c_info *wlc);
extern int brcms_c_stf_attach(struct brcms_c_info *wlc);
extern void brcms_c_stf_detach(struct brcms_c_info *wlc);
extern void wlc_tempsense_upd(struct brcms_c_info *wlc);
extern void wlc_stf_ss_algo_channel_get(struct brcms_c_info *wlc,
extern void brcms_c_tempsense_upd(struct brcms_c_info *wlc);
extern void brcms_c_stf_ss_algo_channel_get(struct brcms_c_info *wlc,
u16 *ss_algo_channel,
chanspec_t chanspec);
extern int wlc_stf_ss_update(struct brcms_c_info *wlc,
extern int brcms_c_stf_ss_update(struct brcms_c_info *wlc,
struct brcms_c_band *band);
extern void wlc_stf_phy_txant_upd(struct brcms_c_info *wlc);
extern int wlc_stf_txchain_set(struct brcms_c_info *wlc, s32 int_val,
extern void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc);
extern int brcms_c_stf_txchain_set(struct brcms_c_info *wlc, s32 int_val,
bool force);
extern bool wlc_stf_stbc_rx_set(struct brcms_c_info *wlc, s32 int_val);
extern void wlc_stf_phy_txant_upd(struct brcms_c_info *wlc);
extern void wlc_stf_phy_chain_calc(struct brcms_c_info *wlc);
extern u16 wlc_stf_phytxchain_sel(struct brcms_c_info *wlc, ratespec_t rspec);
extern u16 wlc_stf_d11hdrs_phyctl_txant(struct brcms_c_info *wlc,
extern bool brcms_c_stf_stbc_rx_set(struct brcms_c_info *wlc, s32 int_val);
extern void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc);
extern void brcms_c_stf_phy_chain_calc(struct brcms_c_info *wlc);
extern u16 brcms_c_stf_phytxchain_sel(struct brcms_c_info *wlc,
ratespec_t rspec);
extern u16 brcms_c_stf_d11hdrs_phyctl_txant(struct brcms_c_info *wlc,
ratespec_t rspec);
#endif /* _BRCM_STF_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment