/* * Copyright (c) 2013 Eugene Krasnikov <[email protected]> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef _WCN36XX_H_ #define _WCN36XX_H_ #include <linux/completion.h> #include <linux/in6.h> #include <linux/printk.h> #include <linux/spinlock.h> #include <net/mac80211.h> #include "hal.h" #include "smd.h" #include "txrx.h" #include "dxe.h" #include "pmc.h" #include "debug.h" #define WLAN_NV_FILE … #define WCN36XX_AGGR_BUFFER_SIZE … extern unsigned int wcn36xx_dbg_mask; enum wcn36xx_debug_mask { … }; #define wcn36xx_err(fmt, arg...) … #define wcn36xx_warn(fmt, arg...) … #define wcn36xx_info(fmt, arg...) … #define wcn36xx_dbg(mask, fmt, arg...) … #define wcn36xx_dbg_dump(mask, prefix_str, buf, len) … enum wcn36xx_ampdu_state { … }; #define HW_VALUE_PHY_SHIFT … #define HW_VALUE_PHY(hw_value) … #define HW_VALUE_CHANNEL(hw_value) … #define WCN36XX_HW_CHANNEL(__wcn) … #define WCN36XX_BAND(__wcn) … #define WCN36XX_CENTER_FREQ(__wcn) … #define WCN36XX_LISTEN_INTERVAL(__wcn) … #define WCN36XX_FLAGS(__wcn) … #define WCN36XX_MAX_POWER(__wcn) … #define RF_UNKNOWN … #define RF_IRIS_WCN3620 … #define RF_IRIS_WCN3660 … #define RF_IRIS_WCN3680 … static inline void buff_to_be(void *buf, size_t len) { … } struct nv_data { … }; /** * struct wcn36xx_vif - holds VIF related fields * * @bss_index: bss_index is initially set to 0xFF. bss_index is received from * HW after first config_bss call and must be used in delete_bss and * enter/exit_bmps. */ struct wcn36xx_vif { … }; /** * struct wcn36xx_sta - holds STA related fields * * @tid: traffic ID that is used during AMPDU and in TX BD. * @sta_index: STA index is returned from HW after config_sta call and is * used in both SMD channel and TX BD. * @dpu_desc_index: DPU descriptor index is returned from HW after config_sta * call and is used in TX BD. * @bss_sta_index: STA index is returned from HW after config_bss call and is * used in both SMD channel and TX BD. See table bellow when it is used. * @bss_dpu_desc_index: DPU descriptor index is returned from HW after * config_bss call and is used in TX BD. * ______________________________________________ * | | STA | AP | * |______________|_____________|_______________| * | TX BD |bss_sta_index| sta_index | * |______________|_____________|_______________| * |all SMD calls |bss_sta_index| sta_index | * |______________|_____________|_______________| * |smd_delete_sta| sta_index | sta_index | * |______________|_____________|_______________| */ struct wcn36xx_sta { … }; struct wcn36xx_dxe_ch; struct wcn36xx_chan_survey { … }; struct wcn36xx { … }; static inline bool wcn36xx_is_fw_version(struct wcn36xx *wcn, u8 major, u8 minor, u8 version, u8 revision) { … } void wcn36xx_set_default_rates(struct wcn36xx_hal_supported_rates *rates); void wcn36xx_set_default_rates_v1(struct wcn36xx_hal_supported_rates_v1 *rates); static inline struct ieee80211_sta *wcn36xx_priv_to_sta(struct wcn36xx_sta *sta_priv) { … } static inline struct wcn36xx_vif *wcn36xx_vif_to_priv(struct ieee80211_vif *vif) { … } static inline struct ieee80211_vif *wcn36xx_priv_to_vif(struct wcn36xx_vif *vif_priv) { … } static inline struct wcn36xx_sta *wcn36xx_sta_to_priv(struct ieee80211_sta *sta) { … } #endif /* _WCN36XX_H_ */