Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright (c) 2013 Eugene Krasnikov <k.eugene.e@gmail.com>
0003  *
0004  * Permission to use, copy, modify, and/or distribute this software for any
0005  * purpose with or without fee is hereby granted, provided that the above
0006  * copyright notice and this permission notice appear in all copies.
0007  *
0008  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
0009  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
0010  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
0011  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
0012  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
0013  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
0014  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
0015  */
0016 
0017 #ifndef _SMD_H_
0018 #define _SMD_H_
0019 
0020 #include "wcn36xx.h"
0021 
0022 /* Max shared size is 4k but we take less.*/
0023 #define WCN36XX_NV_FRAGMENT_SIZE            3072
0024 
0025 #define WCN36XX_HAL_BUF_SIZE                4096
0026 
0027 #define HAL_MSG_TIMEOUT 10000
0028 #define WCN36XX_SMSM_WLAN_TX_ENABLE         0x00000400
0029 #define WCN36XX_SMSM_WLAN_TX_RINGS_EMPTY        0x00000200
0030 /* The PNO version info be contained in the rsp msg */
0031 #define WCN36XX_FW_MSG_PNO_VERSION_MASK         0x8000
0032 
0033 enum wcn36xx_fw_msg_result {
0034     WCN36XX_FW_MSG_RESULT_SUCCESS           = 0,
0035     WCN36XX_FW_MSG_RESULT_SUCCESS_SYNC      = 1,
0036 
0037     WCN36XX_FW_MSG_RESULT_MEM_FAIL          = 5,
0038 };
0039 
0040 /******************************/
0041 /* SMD requests and responses */
0042 /******************************/
0043 struct wcn36xx_fw_msg_status_rsp {
0044     u32 status;
0045 } __packed;
0046 
0047 struct wcn36xx_hal_ind_msg {
0048     struct list_head list;
0049     size_t msg_len;
0050     u8 msg[];
0051 };
0052 
0053 struct wcn36xx;
0054 struct rpmsg_device;
0055 
0056 int wcn36xx_smd_open(struct wcn36xx *wcn);
0057 void wcn36xx_smd_close(struct wcn36xx *wcn);
0058 
0059 int wcn36xx_smd_load_nv(struct wcn36xx *wcn);
0060 int wcn36xx_smd_start(struct wcn36xx *wcn);
0061 int wcn36xx_smd_stop(struct wcn36xx *wcn);
0062 int wcn36xx_smd_start_scan(struct wcn36xx *wcn, u8 scan_channel);
0063 int wcn36xx_smd_end_scan(struct wcn36xx *wcn, u8 scan_channel);
0064 int wcn36xx_smd_finish_scan(struct wcn36xx *wcn, enum wcn36xx_hal_sys_mode mode,
0065                 struct ieee80211_vif *vif);
0066 int wcn36xx_smd_init_scan(struct wcn36xx *wcn, enum wcn36xx_hal_sys_mode mode,
0067               struct ieee80211_vif *vif);
0068 
0069 int wcn36xx_smd_update_scan_params(struct wcn36xx *wcn, u8 *channels, size_t channel_count);
0070 int wcn36xx_smd_start_hw_scan(struct wcn36xx *wcn, struct ieee80211_vif *vif,
0071                   struct cfg80211_scan_request *req);
0072 int wcn36xx_smd_stop_hw_scan(struct wcn36xx *wcn);
0073 int wcn36xx_smd_update_channel_list(struct wcn36xx *wcn, struct cfg80211_scan_request *req);
0074 int wcn36xx_smd_add_sta_self(struct wcn36xx *wcn, struct ieee80211_vif *vif);
0075 int wcn36xx_smd_delete_sta_self(struct wcn36xx *wcn, u8 *addr);
0076 int wcn36xx_smd_delete_sta(struct wcn36xx *wcn, u8 sta_index);
0077 int wcn36xx_smd_join(struct wcn36xx *wcn, const u8 *bssid, u8 *vif, u8 ch);
0078 int wcn36xx_smd_set_link_st(struct wcn36xx *wcn, const u8 *bssid,
0079                 const u8 *sta_mac,
0080                 enum wcn36xx_hal_link_state state);
0081 int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif,
0082                struct ieee80211_sta *sta, const u8 *bssid,
0083                bool update);
0084 int wcn36xx_smd_delete_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif);
0085 int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif,
0086                struct ieee80211_sta *sta);
0087 int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct ieee80211_vif *vif,
0088                 struct sk_buff *skb_beacon, u16 tim_off,
0089                 u16 p2p_off);
0090 int wcn36xx_smd_switch_channel(struct wcn36xx *wcn,
0091                    struct ieee80211_vif *vif, int ch);
0092 int wcn36xx_smd_process_ptt_msg(struct wcn36xx *wcn,
0093                 struct ieee80211_vif *vif,
0094                 void *ptt_msg, size_t len,
0095                 void **ptt_rsp_msg);
0096 int wcn36xx_smd_update_proberesp_tmpl(struct wcn36xx *wcn,
0097                       struct ieee80211_vif *vif,
0098                       struct sk_buff *skb);
0099 int wcn36xx_smd_set_stakey(struct wcn36xx *wcn,
0100                enum ani_ed_type enc_type,
0101                u8 keyidx,
0102                u8 keylen,
0103                u8 *key,
0104                u8 sta_index);
0105 int wcn36xx_smd_set_bsskey(struct wcn36xx *wcn,
0106                enum ani_ed_type enc_type,
0107                u8 bssidx,
0108                u8 keyidx,
0109                u8 keylen,
0110                u8 *key);
0111 int wcn36xx_smd_remove_stakey(struct wcn36xx *wcn,
0112                   enum ani_ed_type enc_type,
0113                   u8 keyidx,
0114                   u8 sta_index);
0115 int wcn36xx_smd_remove_bsskey(struct wcn36xx *wcn,
0116                   enum ani_ed_type enc_type,
0117                   u8 bssidx,
0118                   u8 keyidx);
0119 int wcn36xx_smd_enter_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif);
0120 int wcn36xx_smd_exit_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif);
0121 int wcn36xx_smd_set_power_params(struct wcn36xx *wcn, bool ignore_dtim);
0122 int wcn36xx_smd_keep_alive_req(struct wcn36xx *wcn,
0123                    struct ieee80211_vif *vif,
0124                    int packet_type);
0125 int wcn36xx_smd_dump_cmd_req(struct wcn36xx *wcn, u32 arg1, u32 arg2,
0126                  u32 arg3, u32 arg4, u32 arg5);
0127 int wcn36xx_smd_feature_caps_exchange(struct wcn36xx *wcn);
0128 
0129 int wcn36xx_smd_add_ba_session(struct wcn36xx *wcn,
0130         struct ieee80211_sta *sta,
0131         u16 tid,
0132         u16 *ssn,
0133         u8 direction,
0134         u8 sta_index);
0135 int wcn36xx_smd_add_ba(struct wcn36xx *wcn, u8 session_id);
0136 int wcn36xx_smd_del_ba(struct wcn36xx *wcn, u16 tid, u8 direction, u8 sta_index);
0137 int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 sta_index, u16 tid, u16 *ssn);
0138 int wcn36xx_smd_get_stats(struct wcn36xx *wcn, u8 sta_index, u32 stats_mask,
0139               struct station_info *sinfo);
0140 
0141 int wcn36xx_smd_update_cfg(struct wcn36xx *wcn, u32 cfg_id, u32 value);
0142 
0143 int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev,
0144                 void *buf, int len, void *priv, u32 addr);
0145 
0146 int wcn36xx_smd_set_mc_list(struct wcn36xx *wcn,
0147                 struct ieee80211_vif *vif,
0148                 struct wcn36xx_hal_rcv_flt_mc_addr_list_type *fp);
0149 
0150 int wcn36xx_smd_arp_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif,
0151                 bool enable);
0152 
0153 int wcn36xx_smd_ipv6_ns_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif,
0154                 bool enable);
0155 
0156 int wcn36xx_smd_gtk_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif,
0157                 bool enable);
0158 
0159 int wcn36xx_smd_gtk_offload_get_info(struct wcn36xx *wcn,
0160                      struct ieee80211_vif *vif);
0161 
0162 int wcn36xx_smd_wlan_host_suspend_ind(struct wcn36xx *wcn);
0163 
0164 int wcn36xx_smd_host_resume(struct wcn36xx *wcn);
0165 
0166 int wcn36xx_smd_enter_imps(struct wcn36xx *wcn);
0167 int wcn36xx_smd_exit_imps(struct wcn36xx *wcn);
0168 
0169 int wcn36xx_smd_add_beacon_filter(struct wcn36xx *wcn,
0170                   struct ieee80211_vif *vif);
0171 
0172 #endif  /* _SMD_H_ */