• Home
  • Raw
  • Download

Lines Matching refs:common

211 static void rsi_set_default_parameters(struct rsi_common *common)  in rsi_set_default_parameters()  argument
213 common->band = IEEE80211_BAND_2GHZ; in rsi_set_default_parameters()
214 common->channel_width = BW_20MHZ; in rsi_set_default_parameters()
215 common->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD; in rsi_set_default_parameters()
216 common->channel = 1; in rsi_set_default_parameters()
217 common->min_rate = 0xffff; in rsi_set_default_parameters()
218 common->fsm_state = FSM_CARD_NOT_READY; in rsi_set_default_parameters()
219 common->iface_down = true; in rsi_set_default_parameters()
220 common->endpoint = EP_2GHZ_20MHZ; in rsi_set_default_parameters()
230 static void rsi_set_contention_vals(struct rsi_common *common) in rsi_set_contention_vals() argument
235 common->tx_qinfo[ii].wme_params = in rsi_set_contention_vals()
236 (((common->edca_params[ii].cw_min / 2) + in rsi_set_contention_vals()
237 (common->edca_params[ii].aifs)) * in rsi_set_contention_vals()
239 common->tx_qinfo[ii].weight = common->tx_qinfo[ii].wme_params; in rsi_set_contention_vals()
240 common->tx_qinfo[ii].pkt_contended = 0; in rsi_set_contention_vals()
253 static int rsi_send_internal_mgmt_frame(struct rsi_common *common, in rsi_send_internal_mgmt_frame() argument
264 skb_queue_tail(&common->tx_queue[MGMT_SOFT_Q], skb); in rsi_send_internal_mgmt_frame()
265 rsi_set_event(&common->tx_thread.event); in rsi_send_internal_mgmt_frame()
276 static int rsi_load_radio_caps(struct rsi_common *common) in rsi_load_radio_caps() argument
279 struct rsi_hw *adapter = common->priv; in rsi_load_radio_caps()
306 if (common->channel_width == BW_40MHZ) { in rsi_load_radio_caps()
310 if (common->fsm_state == FSM_MAC_INIT_DONE) { in rsi_load_radio_caps()
350 cpu_to_le16(common->edca_params[ii].cw_min); in rsi_load_radio_caps()
352 cpu_to_le16(common->edca_params[ii].cw_max); in rsi_load_radio_caps()
354 cpu_to_le16((common->edca_params[ii].aifs) << 8); in rsi_load_radio_caps()
356 cpu_to_le16(common->edca_params[ii].txop); in rsi_load_radio_caps()
359 memcpy(&common->rate_pwr[0], &gc[0], 40); in rsi_load_radio_caps()
362 cpu_to_le16(common->rate_pwr[ii] & 0x00FF); in rsi_load_radio_caps()
371 return rsi_send_internal_mgmt_frame(common, skb); in rsi_load_radio_caps()
383 static int rsi_mgmt_pkt_to_core(struct rsi_common *common, in rsi_mgmt_pkt_to_core() argument
388 struct rsi_hw *adapter = common->priv; in rsi_mgmt_pkt_to_core()
427 rsi_indicate_pkt_to_os(common, skb); in rsi_mgmt_pkt_to_core()
447 static int rsi_hal_send_sta_notify_frame(struct rsi_common *common, in rsi_hal_send_sta_notify_frame() argument
498 status = rsi_send_internal_mgmt_frame(common, skb); in rsi_hal_send_sta_notify_frame()
501 rsi_set_contention_vals(common); in rsi_hal_send_sta_notify_frame()
502 status = rsi_load_radio_caps(common); in rsi_hal_send_sta_notify_frame()
518 int rsi_send_aggregation_params_frame(struct rsi_common *common, in rsi_send_aggregation_params_frame() argument
568 return rsi_send_internal_mgmt_frame(common, skb); in rsi_send_aggregation_params_frame()
578 static int rsi_program_bb_rf(struct rsi_common *common) in rsi_program_bb_rf() argument
597 mgmt_frame->desc_word[4] = cpu_to_le16(common->endpoint); in rsi_program_bb_rf()
599 if (common->rf_reset) { in rsi_program_bb_rf()
603 common->rf_reset = 0; in rsi_program_bb_rf()
605 common->bb_rf_prog_count = 1; in rsi_program_bb_rf()
610 return rsi_send_internal_mgmt_frame(common, skb); in rsi_program_bb_rf()
620 int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode) in rsi_set_vap_capabilities() argument
624 struct rsi_hw *adapter = common->priv; in rsi_set_vap_capabilities()
646 (common->channel_width << 8)); in rsi_set_vap_capabilities()
648 (common->mac_id << 4) | in rsi_set_vap_capabilities()
649 common->radio_id); in rsi_set_vap_capabilities()
651 memcpy(vap_caps->mac_addr, common->mac_addr, IEEE80211_ADDR_LEN); in rsi_set_vap_capabilities()
655 vap_caps->rts_threshold = cpu_to_le16(common->rts_threshold); in rsi_set_vap_capabilities()
658 if (common->band == IEEE80211_BAND_5GHZ) { in rsi_set_vap_capabilities()
660 if (conf_is_ht40(&common->priv->hw->conf)) { in rsi_set_vap_capabilities()
680 return rsi_send_internal_mgmt_frame(common, skb); in rsi_set_vap_capabilities()
694 int rsi_hal_load_key(struct rsi_common *common, in rsi_hal_load_key() argument
752 return rsi_send_internal_mgmt_frame(common, skb); in rsi_hal_load_key()
761 static int rsi_load_bootup_params(struct rsi_common *common) in rsi_load_bootup_params() argument
779 if (common->channel_width == BW_40MHZ) { in rsi_load_bootup_params()
813 return rsi_send_internal_mgmt_frame(common, skb); in rsi_load_bootup_params()
823 static int rsi_send_reset_mac(struct rsi_common *common) in rsi_send_reset_mac() argument
846 return rsi_send_internal_mgmt_frame(common, skb); in rsi_send_reset_mac()
855 int rsi_band_check(struct rsi_common *common) in rsi_band_check() argument
857 struct rsi_hw *adapter = common->priv; in rsi_band_check()
859 u8 prev_bw = common->channel_width; in rsi_band_check()
860 u8 prev_ep = common->endpoint; in rsi_band_check()
864 if (common->band != curchan->band) { in rsi_band_check()
865 common->rf_reset = 1; in rsi_band_check()
866 common->band = curchan->band; in rsi_band_check()
871 common->channel_width = BW_20MHZ; in rsi_band_check()
873 common->channel_width = BW_40MHZ; in rsi_band_check()
875 if (common->band == IEEE80211_BAND_2GHZ) { in rsi_band_check()
876 if (common->channel_width) in rsi_band_check()
877 common->endpoint = EP_2GHZ_40MHZ; in rsi_band_check()
879 common->endpoint = EP_2GHZ_20MHZ; in rsi_band_check()
881 if (common->channel_width) in rsi_band_check()
882 common->endpoint = EP_5GHZ_40MHZ; in rsi_band_check()
884 common->endpoint = EP_5GHZ_20MHZ; in rsi_band_check()
887 if (common->endpoint != prev_ep) { in rsi_band_check()
888 status = rsi_program_bb_rf(common); in rsi_band_check()
893 if (common->channel_width != prev_bw) { in rsi_band_check()
894 status = rsi_load_bootup_params(common); in rsi_band_check()
898 status = rsi_load_radio_caps(common); in rsi_band_check()
913 int rsi_set_channel(struct rsi_common *common, u16 channel) in rsi_set_channel() argument
942 if (common->channel_width == BW_40MHZ) in rsi_set_channel()
945 common->channel = channel; in rsi_set_channel()
949 return rsi_send_internal_mgmt_frame(common, skb); in rsi_set_channel()
1006 static int rsi_send_auto_rate_request(struct rsi_common *common) in rsi_send_auto_rate_request() argument
1011 struct ieee80211_hw *hw = common->priv->hw; in rsi_send_auto_rate_request()
1015 u32 rate_bitmap = common->bitrate_mask[band]; in rsi_send_auto_rate_request()
1047 if (common->channel_width == BW_40MHZ) in rsi_send_auto_rate_request()
1068 if (common->vif_info[0].is_ht) { in rsi_send_auto_rate_request()
1089 if (common->vif_info[0].is_ht) { in rsi_send_auto_rate_request()
1092 if (common->vif_info[0].sgi || in rsi_send_auto_rate_request()
1093 conf_is_ht40(&common->priv->hw->conf)) in rsi_send_auto_rate_request()
1122 return rsi_send_internal_mgmt_frame(common, skb); in rsi_send_auto_rate_request()
1137 void rsi_inform_bss_status(struct rsi_common *common, in rsi_inform_bss_status() argument
1144 rsi_hal_send_sta_notify_frame(common, in rsi_inform_bss_status()
1150 if (common->min_rate == 0xffff) in rsi_inform_bss_status()
1151 rsi_send_auto_rate_request(common); in rsi_inform_bss_status()
1153 rsi_hal_send_sta_notify_frame(common, in rsi_inform_bss_status()
1169 static int rsi_eeprom_read(struct rsi_common *common) in rsi_eeprom_read() argument
1199 return rsi_send_internal_mgmt_frame(common, skb); in rsi_eeprom_read()
1210 int rsi_send_block_unblock_frame(struct rsi_common *common, bool block_event) in rsi_send_block_unblock_frame() argument
1240 return rsi_send_internal_mgmt_frame(common, skb); in rsi_send_block_unblock_frame()
1252 static int rsi_handle_ta_confirm_type(struct rsi_common *common, in rsi_handle_ta_confirm_type() argument
1261 if (common->fsm_state == FSM_BOOT_PARAMS_SENT) { in rsi_handle_ta_confirm_type()
1262 if (rsi_eeprom_read(common)) { in rsi_handle_ta_confirm_type()
1263 common->fsm_state = FSM_CARD_NOT_READY; in rsi_handle_ta_confirm_type()
1266 common->fsm_state = FSM_EEPROM_READ_MAC_ADDR; in rsi_handle_ta_confirm_type()
1271 __func__, common->fsm_state); in rsi_handle_ta_confirm_type()
1277 if (common->fsm_state == FSM_EEPROM_READ_MAC_ADDR) { in rsi_handle_ta_confirm_type()
1281 memcpy(common->mac_addr, in rsi_handle_ta_confirm_type()
1284 memcpy(&common->fw_ver, in rsi_handle_ta_confirm_type()
1289 common->fsm_state = FSM_CARD_NOT_READY; in rsi_handle_ta_confirm_type()
1292 if (rsi_send_reset_mac(common)) in rsi_handle_ta_confirm_type()
1295 common->fsm_state = FSM_RESET_MAC_SENT; in rsi_handle_ta_confirm_type()
1299 __func__, common->fsm_state); in rsi_handle_ta_confirm_type()
1305 if (common->fsm_state == FSM_RESET_MAC_SENT) { in rsi_handle_ta_confirm_type()
1309 if (rsi_load_radio_caps(common)) in rsi_handle_ta_confirm_type()
1312 common->fsm_state = FSM_RADIO_CAPS_SENT; in rsi_handle_ta_confirm_type()
1316 __func__, common->fsm_state); in rsi_handle_ta_confirm_type()
1322 if (common->fsm_state == FSM_RADIO_CAPS_SENT) { in rsi_handle_ta_confirm_type()
1323 common->rf_reset = 1; in rsi_handle_ta_confirm_type()
1324 if (rsi_program_bb_rf(common)) { in rsi_handle_ta_confirm_type()
1327 common->fsm_state = FSM_BB_RF_PROG_SENT; in rsi_handle_ta_confirm_type()
1334 __func__, common->fsm_state); in rsi_handle_ta_confirm_type()
1343 if (common->fsm_state == FSM_BB_RF_PROG_SENT) { in rsi_handle_ta_confirm_type()
1344 common->bb_rf_prog_count--; in rsi_handle_ta_confirm_type()
1345 if (!common->bb_rf_prog_count) { in rsi_handle_ta_confirm_type()
1346 common->fsm_state = FSM_MAC_INIT_DONE; in rsi_handle_ta_confirm_type()
1347 return rsi_mac80211_attach(common); in rsi_handle_ta_confirm_type()
1352 __func__, common->fsm_state); in rsi_handle_ta_confirm_type()
1377 int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg) in rsi_mgmt_pkt_recv() argument
1387 return rsi_handle_ta_confirm_type(common, msg); in rsi_mgmt_pkt_recv()
1391 if (common->fsm_state == FSM_CARD_NOT_READY) { in rsi_mgmt_pkt_recv()
1392 rsi_set_default_parameters(common); in rsi_mgmt_pkt_recv()
1394 ret = rsi_load_bootup_params(common); in rsi_mgmt_pkt_recv()
1398 common->fsm_state = FSM_BOOT_PARAMS_SENT; in rsi_mgmt_pkt_recv()
1404 common->mgmt_q_block = false; in rsi_mgmt_pkt_recv()
1409 return rsi_mgmt_pkt_to_core(common, msg, msg_len, msg_type); in rsi_mgmt_pkt_recv()