Lines Matching full:asi
79 brcms_c_antsel_init_cfg(struct antsel_info *asi, struct brcms_antselcfg *antsel, in brcms_c_antsel_init_cfg() argument
82 if (asi->antsel_type == ANTSEL_2x3) { in brcms_c_antsel_init_cfg()
84 ((asi->antsel_avail && auto_sel) ? ANT_SELCFG_AUTO : 0); in brcms_c_antsel_init_cfg()
91 } else if (asi->antsel_type == ANTSEL_2x4) { in brcms_c_antsel_init_cfg()
111 struct antsel_info *asi; in brcms_c_antsel_attach() local
114 asi = kzalloc(sizeof(struct antsel_info), GFP_ATOMIC); in brcms_c_antsel_attach()
115 if (!asi) in brcms_c_antsel_attach()
118 asi->wlc = wlc; in brcms_c_antsel_attach()
119 asi->pub = wlc->pub; in brcms_c_antsel_attach()
120 asi->antsel_type = ANTSEL_NA; in brcms_c_antsel_attach()
121 asi->antsel_avail = false; in brcms_c_antsel_attach()
122 asi->antsel_antswitch = sprom->antswitch; in brcms_c_antsel_attach()
124 if ((asi->pub->sromrev >= 4) && (asi->antsel_antswitch != 0)) { in brcms_c_antsel_attach()
125 switch (asi->antsel_antswitch) { in brcms_c_antsel_attach()
130 asi->antsel_type = ANTSEL_2x3; in brcms_c_antsel_attach()
134 asi->antsel_avail = true; in brcms_c_antsel_attach()
138 asi->antsel_avail = false; in brcms_c_antsel_attach()
140 asi->antsel_avail = false; in brcms_c_antsel_attach()
150 } else if ((asi->pub->sromrev == 4) && in brcms_c_antsel_attach()
154 asi->antsel_type = ANTSEL_2x3; in brcms_c_antsel_attach()
155 asi->antsel_avail = true; in brcms_c_antsel_attach()
156 } else if (asi->pub->boardflags2 & BFL2_2X4_DIV) { in brcms_c_antsel_attach()
157 asi->antsel_type = ANTSEL_2x4; in brcms_c_antsel_attach()
158 asi->antsel_avail = true; in brcms_c_antsel_attach()
162 brcms_b_antsel_type_set(wlc->hw, asi->antsel_type); in brcms_c_antsel_attach()
165 brcms_c_antsel_init_cfg(asi, &asi->antcfg_11n, true); in brcms_c_antsel_attach()
166 brcms_c_antsel_init_cfg(asi, &asi->antcfg_cur, true); in brcms_c_antsel_attach()
168 return asi; in brcms_c_antsel_attach()
171 void brcms_c_antsel_detach(struct antsel_info *asi) in brcms_c_antsel_detach() argument
173 kfree(asi); in brcms_c_antsel_detach()
180 static u16 brcms_c_antsel_antcfg2antsel(struct antsel_info *asi, u8 ant_cfg) in brcms_c_antsel_antcfg2antsel() argument
185 if (asi->antsel_type == ANTSEL_2x4) { in brcms_c_antsel_antcfg2antsel()
190 } else if (asi->antsel_type == ANTSEL_2x3) { in brcms_c_antsel_antcfg2antsel()
200 static int brcms_c_antsel_cfgupd(struct antsel_info *asi, in brcms_c_antsel_cfgupd() argument
203 struct brcms_c_info *wlc = asi->wlc; in brcms_c_antsel_cfgupd()
211 mimo_antsel = brcms_c_antsel_antcfg2antsel(asi, ant_cfg); in brcms_c_antsel_cfgupd()
217 asi->antcfg_cur.ant_config[ANT_SELCFG_TX_DEF] = ant_cfg; in brcms_c_antsel_cfgupd()
223 mimo_antsel = brcms_c_antsel_antcfg2antsel(asi, ant_cfg); in brcms_c_antsel_cfgupd()
229 asi->antcfg_cur.ant_config[ANT_SELCFG_RX_DEF] = ant_cfg; in brcms_c_antsel_cfgupd()
234 void brcms_c_antsel_init(struct antsel_info *asi) in brcms_c_antsel_init() argument
236 if ((asi->antsel_type == ANTSEL_2x3) || in brcms_c_antsel_init()
237 (asi->antsel_type == ANTSEL_2x4)) in brcms_c_antsel_init()
238 brcms_c_antsel_cfgupd(asi, &asi->antcfg_11n); in brcms_c_antsel_init()
242 static u8 brcms_c_antsel_id2antcfg(struct antsel_info *asi, u8 id) in brcms_c_antsel_id2antcfg() argument
246 if (asi->antsel_type == ANTSEL_2x4) { in brcms_c_antsel_id2antcfg()
251 } else if (asi->antsel_type == ANTSEL_2x3) { in brcms_c_antsel_id2antcfg()
261 brcms_c_antsel_antcfg_get(struct antsel_info *asi, bool usedef, bool sel, in brcms_c_antsel_antcfg_get() argument
269 *antcfg = asi->antcfg_11n.ant_config[ANT_SELCFG_TX_DEF]; in brcms_c_antsel_antcfg_get()
275 *antcfg = asi->antcfg_11n.ant_config[ANT_SELCFG_TX_UNICAST]; in brcms_c_antsel_antcfg_get()
279 ant = asi->antcfg_11n.ant_config[ANT_SELCFG_TX_UNICAST]; in brcms_c_antsel_antcfg_get()
281 *antcfg = brcms_c_antsel_id2antcfg(asi, antselid); in brcms_c_antsel_antcfg_get()
282 *fbantcfg = brcms_c_antsel_id2antcfg(asi, fbantselid); in brcms_c_antsel_antcfg_get()
285 asi->antcfg_11n.ant_config[ANT_SELCFG_TX_UNICAST]; in brcms_c_antsel_antcfg_get()
293 u8 brcms_c_antsel_antsel2id(struct antsel_info *asi, u16 antsel) in brcms_c_antsel_antsel2id() argument
297 if (asi->antsel_type == ANTSEL_2x4) { in brcms_c_antsel_antsel2id()
302 } else if (asi->antsel_type == ANTSEL_2x3) { in brcms_c_antsel_antsel2id()