#include <linux/ip.h>
#include <linux/in.h>
#include "core.h"
#include "debug.h"
#include "testmode.h"
#include "trace.h"
#include "../regd.h"
#include "../regd_common.h"
static int ath6kl_wmi_sync_point(struct wmi *wmi, u8 if_idx);
static const s32 wmi_rate_tbl[][2] = …;
static const s32 wmi_rate_tbl_mcs15[][2] = …;
static const u8 up_to_ac[] = …;
void ath6kl_wmi_set_control_ep(struct wmi *wmi, enum htc_endpoint_id ep_id)
{ … }
enum htc_endpoint_id ath6kl_wmi_get_control_ep(struct wmi *wmi)
{ … }
struct ath6kl_vif *ath6kl_get_vif_by_index(struct ath6kl *ar, u8 if_idx)
{ … }
int ath6kl_wmi_dix_2_dot3(struct wmi *wmi, struct sk_buff *skb)
{ … }
static int ath6kl_wmi_meta_add(struct wmi *wmi, struct sk_buff *skb,
u8 *version, void *tx_meta_info)
{ … }
int ath6kl_wmi_data_hdr_add(struct wmi *wmi, struct sk_buff *skb,
u8 msg_type, u32 flags,
enum wmi_data_hdr_data_type data_type,
u8 meta_ver, void *tx_meta_info, u8 if_idx)
{ … }
u8 ath6kl_wmi_determine_user_priority(u8 *pkt, u32 layer2_pri)
{ … }
u8 ath6kl_wmi_get_traffic_class(u8 user_priority)
{ … }
int ath6kl_wmi_implicit_create_pstream(struct wmi *wmi, u8 if_idx,
struct sk_buff *skb,
u32 layer2_priority, bool wmm_enabled,
u8 *ac)
{ … }
int ath6kl_wmi_dot11_hdr_remove(struct wmi *wmi, struct sk_buff *skb)
{ … }
int ath6kl_wmi_dot3_2_dix(struct sk_buff *skb)
{ … }
static int ath6kl_wmi_tx_complete_event_rx(u8 *datap, int len)
{ … }
static int ath6kl_wmi_remain_on_chnl_event_rx(struct wmi *wmi, u8 *datap,
int len, struct ath6kl_vif *vif)
{ … }
static int ath6kl_wmi_cancel_remain_on_chnl_event_rx(struct wmi *wmi,
u8 *datap, int len,
struct ath6kl_vif *vif)
{ … }
static int ath6kl_wmi_tx_status_event_rx(struct wmi *wmi, u8 *datap, int len,
struct ath6kl_vif *vif)
{ … }
static int ath6kl_wmi_rx_probe_req_event_rx(struct wmi *wmi, u8 *datap, int len,
struct ath6kl_vif *vif)
{ … }
static int ath6kl_wmi_p2p_capabilities_event_rx(u8 *datap, int len)
{ … }
static int ath6kl_wmi_rx_action_event_rx(struct wmi *wmi, u8 *datap, int len,
struct ath6kl_vif *vif)
{ … }
static int ath6kl_wmi_p2p_info_event_rx(u8 *datap, int len)
{ … }
static inline struct sk_buff *ath6kl_wmi_get_new_buf(u32 size)
{ … }
static int ath6kl_wmi_simple_cmd(struct wmi *wmi, u8 if_idx,
enum wmi_cmd_id cmd_id)
{ … }
static int ath6kl_wmi_ready_event_rx(struct wmi *wmi, u8 *datap, int len)
{ … }
int ath6kl_wmi_set_roam_lrssi_cmd(struct wmi *wmi, u8 lrssi)
{ … }
int ath6kl_wmi_force_roam_cmd(struct wmi *wmi, const u8 *bssid)
{ … }
int ath6kl_wmi_ap_set_beacon_intvl_cmd(struct wmi *wmi, u8 if_idx,
u32 beacon_intvl)
{ … }
int ath6kl_wmi_ap_set_dtim_cmd(struct wmi *wmi, u8 if_idx, u32 dtim_period)
{ … }
int ath6kl_wmi_set_roam_mode_cmd(struct wmi *wmi, enum wmi_roam_mode mode)
{ … }
static int ath6kl_wmi_connect_event_rx(struct wmi *wmi, u8 *datap, int len,
struct ath6kl_vif *vif)
{ … }
static struct country_code_to_enum_rd *
ath6kl_regd_find_country(u16 countryCode)
{ … }
static struct reg_dmn_pair_mapping *
ath6kl_get_regpair(u16 regdmn)
{ … }
static struct country_code_to_enum_rd *
ath6kl_regd_find_country_by_rd(u16 regdmn)
{ … }
static void ath6kl_wmi_regdomain_event(struct wmi *wmi, u8 *datap, int len)
{ … }
static int ath6kl_wmi_disconnect_event_rx(struct wmi *wmi, u8 *datap, int len,
struct ath6kl_vif *vif)
{ … }
static int ath6kl_wmi_peer_node_event_rx(struct wmi *wmi, u8 *datap, int len)
{ … }
static int ath6kl_wmi_tkip_micerr_event_rx(struct wmi *wmi, u8 *datap, int len,
struct ath6kl_vif *vif)
{ … }
void ath6kl_wmi_sscan_timer(struct timer_list *t)
{ … }
static int ath6kl_wmi_bssinfo_event_rx(struct wmi *wmi, u8 *datap, int len,
struct ath6kl_vif *vif)
{ … }
static int ath6kl_wmi_pstream_timeout_event_rx(struct wmi *wmi, u8 *datap,
int len)
{ … }
static int ath6kl_wmi_bitrate_reply_rx(struct wmi *wmi, u8 *datap, int len)
{ … }
static int ath6kl_wmi_test_rx(struct wmi *wmi, u8 *datap, int len)
{ … }
static int ath6kl_wmi_ratemask_reply_rx(struct wmi *wmi, u8 *datap, int len)
{ … }
static int ath6kl_wmi_ch_list_reply_rx(struct wmi *wmi, u8 *datap, int len)
{ … }
static int ath6kl_wmi_tx_pwr_reply_rx(struct wmi *wmi, u8 *datap, int len)
{ … }
static int ath6kl_wmi_keepalive_reply_rx(struct wmi *wmi, u8 *datap, int len)
{ … }
static int ath6kl_wmi_scan_complete_rx(struct wmi *wmi, u8 *datap, int len,
struct ath6kl_vif *vif)
{ … }
static int ath6kl_wmi_neighbor_report_event_rx(struct wmi *wmi, u8 *datap,
int len, struct ath6kl_vif *vif)
{ … }
static int ath6kl_wmi_error_event_rx(struct wmi *wmi, u8 *datap, int len)
{ … }
static int ath6kl_wmi_stats_event_rx(struct wmi *wmi, u8 *datap, int len,
struct ath6kl_vif *vif)
{ … }
static u8 ath6kl_wmi_get_upper_threshold(s16 rssi,
struct sq_threshold_params *sq_thresh,
u32 size)
{ … }
static u8 ath6kl_wmi_get_lower_threshold(s16 rssi,
struct sq_threshold_params *sq_thresh,
u32 size)
{ … }
static int ath6kl_wmi_send_rssi_threshold_params(struct wmi *wmi,
struct wmi_rssi_threshold_params_cmd *rssi_cmd)
{ … }
static int ath6kl_wmi_rssi_threshold_event_rx(struct wmi *wmi, u8 *datap,
int len)
{ … }
static int ath6kl_wmi_cac_event_rx(struct wmi *wmi, u8 *datap, int len,
struct ath6kl_vif *vif)
{ … }
static int ath6kl_wmi_txe_notify_event_rx(struct wmi *wmi, u8 *datap, int len,
struct ath6kl_vif *vif)
{ … }
int ath6kl_wmi_set_txe_notify(struct wmi *wmi, u8 idx,
u32 rate, u32 pkts, u32 intvl)
{ … }
int ath6kl_wmi_set_rssi_filter_cmd(struct wmi *wmi, u8 if_idx, s8 rssi)
{ … }
static int ath6kl_wmi_send_snr_threshold_params(struct wmi *wmi,
struct wmi_snr_threshold_params_cmd *snr_cmd)
{ … }
static int ath6kl_wmi_snr_threshold_event_rx(struct wmi *wmi, u8 *datap,
int len)
{ … }
static int ath6kl_wmi_aplist_event_rx(struct wmi *wmi, u8 *datap, int len)
{ … }
int ath6kl_wmi_cmd_send(struct wmi *wmi, u8 if_idx, struct sk_buff *skb,
enum wmi_cmd_id cmd_id, enum wmi_sync_flag sync_flag)
{ … }
int ath6kl_wmi_connect_cmd(struct wmi *wmi, u8 if_idx,
enum network_type nw_type,
enum dot11_auth_mode dot11_auth_mode,
enum auth_mode auth_mode,
enum ath6kl_crypto_type pairwise_crypto,
u8 pairwise_crypto_len,
enum ath6kl_crypto_type group_crypto,
u8 group_crypto_len, int ssid_len, u8 *ssid,
u8 *bssid, u16 channel, u32 ctrl_flags,
u8 nw_subtype)
{ … }
int ath6kl_wmi_reconnect_cmd(struct wmi *wmi, u8 if_idx, u8 *bssid,
u16 channel)
{ … }
int ath6kl_wmi_disconnect_cmd(struct wmi *wmi, u8 if_idx)
{ … }
static int ath6kl_wmi_startscan_cmd(struct wmi *wmi, u8 if_idx,
enum wmi_scan_type scan_type,
u32 force_fgscan, u32 is_legacy,
u32 home_dwell_time,
u32 force_scan_interval,
s8 num_chan, u16 *ch_list)
{ … }
int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx,
enum wmi_scan_type scan_type,
u32 force_fgscan, u32 is_legacy,
u32 home_dwell_time, u32 force_scan_interval,
s8 num_chan, u16 *ch_list, u32 no_cck, u32 *rates)
{ … }
int ath6kl_wmi_enable_sched_scan_cmd(struct wmi *wmi, u8 if_idx, bool enable)
{ … }
int ath6kl_wmi_scanparams_cmd(struct wmi *wmi, u8 if_idx,
u16 fg_start_sec,
u16 fg_end_sec, u16 bg_sec,
u16 minact_chdw_msec, u16 maxact_chdw_msec,
u16 pas_chdw_msec, u8 short_scan_ratio,
u8 scan_ctrl_flag, u32 max_dfsch_act_time,
u16 maxact_scan_per_ssid)
{ … }
int ath6kl_wmi_bssfilter_cmd(struct wmi *wmi, u8 if_idx, u8 filter, u32 ie_mask)
{ … }
int ath6kl_wmi_probedssid_cmd(struct wmi *wmi, u8 if_idx, u8 index, u8 flag,
u8 ssid_len, u8 *ssid)
{ … }
int ath6kl_wmi_listeninterval_cmd(struct wmi *wmi, u8 if_idx,
u16 listen_interval,
u16 listen_beacons)
{ … }
int ath6kl_wmi_bmisstime_cmd(struct wmi *wmi, u8 if_idx,
u16 bmiss_time, u16 num_beacons)
{ … }
int ath6kl_wmi_powermode_cmd(struct wmi *wmi, u8 if_idx, u8 pwr_mode)
{ … }
int ath6kl_wmi_pmparams_cmd(struct wmi *wmi, u8 if_idx, u16 idle_period,
u16 ps_poll_num, u16 dtim_policy,
u16 tx_wakeup_policy, u16 num_tx_to_wakeup,
u16 ps_fail_event_policy)
{ … }
int ath6kl_wmi_disctimeout_cmd(struct wmi *wmi, u8 if_idx, u8 timeout)
{ … }
int ath6kl_wmi_addkey_cmd(struct wmi *wmi, u8 if_idx, u8 key_index,
enum ath6kl_crypto_type key_type,
u8 key_usage, u8 key_len,
u8 *key_rsc, unsigned int key_rsc_len,
u8 *key_material,
u8 key_op_ctrl, u8 *mac_addr,
enum wmi_sync_flag sync_flag)
{ … }
int ath6kl_wmi_add_krk_cmd(struct wmi *wmi, u8 if_idx, const u8 *krk)
{ … }
int ath6kl_wmi_deletekey_cmd(struct wmi *wmi, u8 if_idx, u8 key_index)
{ … }
int ath6kl_wmi_setpmkid_cmd(struct wmi *wmi, u8 if_idx, const u8 *bssid,
const u8 *pmkid, bool set)
{ … }
static int ath6kl_wmi_data_sync_send(struct wmi *wmi, struct sk_buff *skb,
enum htc_endpoint_id ep_id, u8 if_idx)
{ … }
static int ath6kl_wmi_sync_point(struct wmi *wmi, u8 if_idx)
{ … }
int ath6kl_wmi_create_pstream_cmd(struct wmi *wmi, u8 if_idx,
struct wmi_create_pstream_cmd *params)
{ … }
int ath6kl_wmi_delete_pstream_cmd(struct wmi *wmi, u8 if_idx, u8 traffic_class,
u8 tsid)
{ … }
int ath6kl_wmi_set_ip_cmd(struct wmi *wmi, u8 if_idx,
__be32 ips0, __be32 ips1)
{ … }
static void ath6kl_wmi_relinquish_implicit_pstream_credits(struct wmi *wmi)
{ … }
static int ath6kl_set_bitrate_mask64(struct wmi *wmi, u8 if_idx,
const struct cfg80211_bitrate_mask *mask)
{ … }
static int ath6kl_set_bitrate_mask32(struct wmi *wmi, u8 if_idx,
const struct cfg80211_bitrate_mask *mask)
{ … }
int ath6kl_wmi_set_bitrate_mask(struct wmi *wmi, u8 if_idx,
const struct cfg80211_bitrate_mask *mask)
{ … }
int ath6kl_wmi_set_host_sleep_mode_cmd(struct wmi *wmi, u8 if_idx,
enum ath6kl_host_mode host_mode)
{ … }
static int ath6kl_wmi_host_sleep_mode_cmd_prcd_evt_rx(struct wmi *wmi,
struct ath6kl_vif *vif)
{ … }
int ath6kl_wmi_set_wow_mode_cmd(struct wmi *wmi, u8 if_idx,
enum ath6kl_wow_mode wow_mode,
u32 filter, u16 host_req_delay)
{ … }
int ath6kl_wmi_add_wow_pattern_cmd(struct wmi *wmi, u8 if_idx,
u8 list_id, u8 filter_size,
u8 filter_offset, const u8 *filter,
const u8 *mask)
{ … }
int ath6kl_wmi_del_wow_pattern_cmd(struct wmi *wmi, u8 if_idx,
u16 list_id, u16 filter_id)
{ … }
static int ath6kl_wmi_cmd_send_xtnd(struct wmi *wmi, struct sk_buff *skb,
enum wmix_command_id cmd_id,
enum wmi_sync_flag sync_flag)
{ … }
int ath6kl_wmi_get_challenge_resp_cmd(struct wmi *wmi, u32 cookie, u32 source)
{ … }
int ath6kl_wmi_config_debug_module_cmd(struct wmi *wmi, u32 valid, u32 config)
{ … }
int ath6kl_wmi_get_stats_cmd(struct wmi *wmi, u8 if_idx)
{ … }
int ath6kl_wmi_set_tx_pwr_cmd(struct wmi *wmi, u8 if_idx, u8 dbM)
{ … }
int ath6kl_wmi_get_tx_pwr_cmd(struct wmi *wmi, u8 if_idx)
{ … }
int ath6kl_wmi_get_roam_tbl_cmd(struct wmi *wmi)
{ … }
int ath6kl_wmi_set_lpreamble_cmd(struct wmi *wmi, u8 if_idx, u8 status,
u8 preamble_policy)
{ … }
int ath6kl_wmi_set_rts_cmd(struct wmi *wmi, u16 threshold)
{ … }
int ath6kl_wmi_set_wmm_txop(struct wmi *wmi, u8 if_idx, enum wmi_txop_cfg cfg)
{ … }
int ath6kl_wmi_set_keepalive_cmd(struct wmi *wmi, u8 if_idx,
u8 keep_alive_intvl)
{ … }
int ath6kl_wmi_set_htcap_cmd(struct wmi *wmi, u8 if_idx,
enum nl80211_band band,
struct ath6kl_htcap *htcap)
{ … }
int ath6kl_wmi_test_cmd(struct wmi *wmi, void *buf, size_t len)
{ … }
int ath6kl_wmi_mcast_filter_cmd(struct wmi *wmi, u8 if_idx, bool mc_all_on)
{ … }
int ath6kl_wmi_add_del_mcast_filter_cmd(struct wmi *wmi, u8 if_idx,
u8 *filter, bool add_filter)
{ … }
int ath6kl_wmi_sta_bmiss_enhance_cmd(struct wmi *wmi, u8 if_idx, bool enhance)
{ … }
int ath6kl_wmi_set_regdomain_cmd(struct wmi *wmi, const char *alpha2)
{ … }
s32 ath6kl_wmi_get_rate(struct wmi *wmi, s8 rate_index)
{ … }
static int ath6kl_wmi_get_pmkid_list_event_rx(struct wmi *wmi, u8 *datap,
u32 len)
{ … }
static int ath6kl_wmi_addba_req_event_rx(struct wmi *wmi, u8 *datap, int len,
struct ath6kl_vif *vif)
{ … }
static int ath6kl_wmi_delba_req_event_rx(struct wmi *wmi, u8 *datap, int len,
struct ath6kl_vif *vif)
{ … }
int ath6kl_wmi_ap_profile_commit(struct wmi *wmip, u8 if_idx,
struct wmi_connect_cmd *p)
{ … }
int ath6kl_wmi_ap_set_mlme(struct wmi *wmip, u8 if_idx, u8 cmd, const u8 *mac,
u16 reason)
{ … }
int ath6kl_wmi_ap_hidden_ssid(struct wmi *wmi, u8 if_idx, bool enable)
{ … }
int ath6kl_wmi_ap_set_apsd(struct wmi *wmi, u8 if_idx, u8 enable)
{ … }
int ath6kl_wmi_set_apsd_bfrd_traf(struct wmi *wmi, u8 if_idx,
u16 aid, u16 bitmap, u32 flags)
{ … }
static int ath6kl_wmi_pspoll_event_rx(struct wmi *wmi, u8 *datap, int len,
struct ath6kl_vif *vif)
{ … }
static int ath6kl_wmi_dtimexpiry_event_rx(struct wmi *wmi, u8 *datap, int len,
struct ath6kl_vif *vif)
{ … }
int ath6kl_wmi_set_pvb_cmd(struct wmi *wmi, u8 if_idx, u16 aid,
bool flag)
{ … }
int ath6kl_wmi_set_rx_frame_format_cmd(struct wmi *wmi, u8 if_idx,
u8 rx_meta_ver,
bool rx_dot11_hdr, bool defrag_on_host)
{ … }
int ath6kl_wmi_set_appie_cmd(struct wmi *wmi, u8 if_idx, u8 mgmt_frm_type,
const u8 *ie, u8 ie_len)
{ … }
int ath6kl_wmi_set_ie_cmd(struct wmi *wmi, u8 if_idx, u8 ie_id, u8 ie_field,
const u8 *ie_info, u8 ie_len)
{ … }
int ath6kl_wmi_disable_11b_rates_cmd(struct wmi *wmi, bool disable)
{ … }
int ath6kl_wmi_remain_on_chnl_cmd(struct wmi *wmi, u8 if_idx, u32 freq, u32 dur)
{ … }
static int ath6kl_wmi_send_action_cmd(struct wmi *wmi, u8 if_idx, u32 id,
u32 freq, u32 wait, const u8 *data,
u16 data_len)
{ … }
static int __ath6kl_wmi_send_mgmt_cmd(struct wmi *wmi, u8 if_idx, u32 id,
u32 freq, u32 wait, const u8 *data,
u16 data_len, u32 no_cck)
{ … }
int ath6kl_wmi_send_mgmt_cmd(struct wmi *wmi, u8 if_idx, u32 id, u32 freq,
u32 wait, const u8 *data, u16 data_len,
u32 no_cck)
{ … }
int ath6kl_wmi_send_probe_response_cmd(struct wmi *wmi, u8 if_idx, u32 freq,
const u8 *dst, const u8 *data,
u16 data_len)
{ … }
int ath6kl_wmi_probe_report_req_cmd(struct wmi *wmi, u8 if_idx, bool enable)
{ … }
int ath6kl_wmi_info_req_cmd(struct wmi *wmi, u8 if_idx, u32 info_req_flags)
{ … }
int ath6kl_wmi_cancel_remain_on_chnl_cmd(struct wmi *wmi, u8 if_idx)
{ … }
int ath6kl_wmi_set_inact_period(struct wmi *wmi, u8 if_idx, int inact_timeout)
{ … }
static void ath6kl_wmi_hb_challenge_resp_event(struct wmi *wmi, u8 *datap,
int len)
{ … }
static int ath6kl_wmi_control_rx_xtnd(struct wmi *wmi, struct sk_buff *skb)
{ … }
static int ath6kl_wmi_roam_tbl_event_rx(struct wmi *wmi, u8 *datap, int len)
{ … }
static int ath6kl_wmi_proc_events_vif(struct wmi *wmi, u16 if_idx, u16 cmd_id,
u8 *datap, u32 len)
{ … }
static int ath6kl_wmi_proc_events(struct wmi *wmi, struct sk_buff *skb)
{ … }
int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb)
{ … }
void ath6kl_wmi_reset(struct wmi *wmi)
{ … }
void *ath6kl_wmi_init(struct ath6kl *dev)
{ … }
void ath6kl_wmi_shutdown(struct wmi *wmi)
{ … }