* [PATCH v2 13/13] ath10k: handle FW API differences for scan structures
From: Bartosz Markowski @ 2013-09-26 9:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Bartosz Markowski
In-Reply-To: <1380187792-25626-1-git-send-email-bartosz.markowski@tieto.com>
The wmi_start_scan_cmd has an extra filed in our main
firmware track, reflact that to not have a mismatch in
case of 10.x track.
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
---
drivers/net/wireless/ath/ath10k/wmi.c | 19 ++++++--
drivers/net/wireless/ath/ath10k/wmi.h | 82 +++++++++++++++++++++++++++++++++
2 files changed, 97 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 8c3316d..328d4eb 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -2341,11 +2341,15 @@ int ath10k_wmi_cmd_init(struct ath10k *ar)
return ret;
}
-static int ath10k_wmi_start_scan_calc_len(const struct wmi_start_scan_arg *arg)
+static int ath10k_wmi_start_scan_calc_len(struct ath10k *ar,
+ const struct wmi_start_scan_arg *arg)
{
int len;
- len = sizeof(struct wmi_start_scan_cmd);
+ if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features))
+ len = sizeof(struct wmi_start_scan_cmd_10x);
+ else
+ len = sizeof(struct wmi_start_scan_cmd);
if (arg->ie_len) {
if (!arg->ie)
@@ -2405,7 +2409,7 @@ int ath10k_wmi_start_scan(struct ath10k *ar,
int len = 0;
int i;
- len = ath10k_wmi_start_scan_calc_len(arg);
+ len = ath10k_wmi_start_scan_calc_len(ar, arg);
if (len < 0)
return len; /* len contains error code here */
@@ -2437,7 +2441,14 @@ int ath10k_wmi_start_scan(struct ath10k *ar,
cmd->scan_ctrl_flags = __cpu_to_le32(arg->scan_ctrl_flags);
/* TLV list starts after fields included in the struct */
- off = sizeof(*cmd);
+ /* There's just one filed that differes the two start_scan
+ * structures - burst_duration, which we are not using btw,
+ no point to make the split here, just shift the buffer to fit with
+ given FW */
+ if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features))
+ off = sizeof(struct wmi_start_scan_cmd_10x);
+ else
+ off = sizeof(struct wmi_start_scan_cmd);
if (arg->n_channels) {
channels = (void *)skb->data + off;
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 80ab2f0..7692c14 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -1715,6 +1715,88 @@ struct wmi_start_scan_cmd {
*/
} __packed;
+/* This is the definition from 10.X firmware branch */
+struct wmi_start_scan_cmd_10x {
+ /* Scan ID */
+ __le32 scan_id;
+
+ /* Scan requestor ID */
+ __le32 scan_req_id;
+
+ /* VDEV id(interface) that is requesting scan */
+ __le32 vdev_id;
+
+ /* Scan Priority, input to scan scheduler */
+ __le32 scan_priority;
+
+ /* Scan events subscription */
+ __le32 notify_scan_events;
+
+ /* dwell time in msec on active channels */
+ __le32 dwell_time_active;
+
+ /* dwell time in msec on passive channels */
+ __le32 dwell_time_passive;
+
+ /*
+ * min time in msec on the BSS channel,only valid if atleast one
+ * VDEV is active
+ */
+ __le32 min_rest_time;
+
+ /*
+ * max rest time in msec on the BSS channel,only valid if at least
+ * one VDEV is active
+ */
+ /*
+ * the scanner will rest on the bss channel at least min_rest_time
+ * after min_rest_time the scanner will start checking for tx/rx
+ * activity on all VDEVs. if there is no activity the scanner will
+ * switch to off channel. if there is activity the scanner will let
+ * the radio on the bss channel until max_rest_time expires.at
+ * max_rest_time scanner will switch to off channel irrespective of
+ * activity. activity is determined by the idle_time parameter.
+ */
+ __le32 max_rest_time;
+
+ /*
+ * time before sending next set of probe requests.
+ * The scanner keeps repeating probe requests transmission with
+ * period specified by repeat_probe_time.
+ * The number of probe requests specified depends on the ssid_list
+ * and bssid_list
+ */
+ __le32 repeat_probe_time;
+
+ /* time in msec between 2 consequetive probe requests with in a set. */
+ __le32 probe_spacing_time;
+
+ /*
+ * data inactivity time in msec on bss channel that will be used by
+ * scanner for measuring the inactivity.
+ */
+ __le32 idle_time;
+
+ /* maximum time in msec allowed for scan */
+ __le32 max_scan_time;
+
+ /*
+ * delay in msec before sending first probe request after switching
+ * to a channel
+ */
+ __le32 probe_delay;
+
+ /* Scan control flags */
+ __le32 scan_ctrl_flags;
+
+ /*
+ * TLV (tag length value ) paramerters follow the scan_cmd structure.
+ * TLV can contain channel list, bssid list, ssid list and
+ * ie. the TLV tags are defined above;
+ */
+} __packed;
+
+
struct wmi_ssid_arg {
int len;
const u8 *ssid;
--
1.7.10
^ permalink raw reply related
* [PATCH v2 12/13] ath10k: introduce dynamic pdev parameters
From: Bartosz Markowski @ 2013-09-26 9:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Bartosz Markowski
In-Reply-To: <1380187792-25626-1-git-send-email-bartosz.markowski@tieto.com>
This is done exactly the same way as for vdev.
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
---
drivers/net/wireless/ath/ath10k/core.h | 1 +
drivers/net/wireless/ath/ath10k/mac.c | 10 +--
drivers/net/wireless/ath/ath10k/wmi.c | 115 ++++++++++++++++++++++++-
drivers/net/wireless/ath/ath10k/wmi.h | 148 +++++++++++++++++++++++++++++++-
4 files changed, 265 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 124e724..d5da8a9 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -120,6 +120,7 @@ struct ath10k_wmi {
wait_queue_head_t tx_credits_wq;
struct wmi_cmd_map *cmd;
struct wmi_vdev_param_map *vdev_param;
+ struct wmi_pdev_param_map *pdev_param;
u32 num_mem_chunks;
struct ath10k_mem_chunk mem_chunks[ATH10K_MAX_MEM_REQS];
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index d8aba57..0b7e9ac 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1885,12 +1885,12 @@ static int ath10k_start(struct ieee80211_hw *hw)
else if (ar->state == ATH10K_STATE_RESTARTING)
ar->state = ATH10K_STATE_RESTARTED;
- ret = ath10k_wmi_pdev_set_param(ar, WMI_PDEV_PARAM_PMF_QOS, 1);
+ ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->pmf_qos, 1);
if (ret)
ath10k_warn("could not enable WMI_PDEV_PARAM_PMF_QOS (%d)\n",
ret);
- ret = ath10k_wmi_pdev_set_param(ar, WMI_PDEV_PARAM_DYNAMIC_BW, 0);
+ ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->dynamic_bw, 0);
if (ret)
ath10k_warn("could not init WMI_PDEV_PARAM_DYNAMIC_BW (%d)\n",
ret);
@@ -2212,7 +2212,7 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,
struct ath10k *ar = hw->priv;
struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
int ret = 0;
- u32 vdev_param;
+ u32 vdev_param, pdev_param;
mutex_lock(&ar->conf_mutex);
@@ -2238,8 +2238,8 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,
"vdev %d set beacon tx mode to staggered\n",
arvif->vdev_id);
- ret = ath10k_wmi_pdev_set_param(ar,
- WMI_PDEV_PARAM_BEACON_TX_MODE,
+ pdev_param = ar->wmi.pdev_param->beacon_tx_mode;
+ ret = ath10k_wmi_pdev_set_param(ar, pdev_param,
WMI_BEACON_STAGGERED_MODE);
if (ret)
ath10k_warn("Failed to set beacon mode for VDEV: %d\n",
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index a6bd87e..8c3316d 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -383,6 +383,111 @@ static struct wmi_vdev_param_map wmi_10x_vdev_param_map = {
WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
};
+static struct wmi_pdev_param_map wmi_pdev_param_map = {
+ .tx_chain_mask = WMI_PDEV_PARAM_TX_CHAIN_MASK,
+ .rx_chain_mask = WMI_PDEV_PARAM_RX_CHAIN_MASK,
+ .txpower_limit2g = WMI_PDEV_PARAM_TXPOWER_LIMIT2G,
+ .txpower_limit5g = WMI_PDEV_PARAM_TXPOWER_LIMIT5G,
+ .txpower_scale = WMI_PDEV_PARAM_TXPOWER_SCALE,
+ .beacon_gen_mode = WMI_PDEV_PARAM_BEACON_GEN_MODE,
+ .beacon_tx_mode = WMI_PDEV_PARAM_BEACON_TX_MODE,
+ .resmgr_offchan_mode = WMI_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
+ .protection_mode = WMI_PDEV_PARAM_PROTECTION_MODE,
+ .dynamic_bw = WMI_PDEV_PARAM_DYNAMIC_BW,
+ .non_agg_sw_retry_th = WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
+ .agg_sw_retry_th = WMI_PDEV_PARAM_AGG_SW_RETRY_TH,
+ .sta_kickout_th = WMI_PDEV_PARAM_STA_KICKOUT_TH,
+ .ac_aggrsize_scaling = WMI_PDEV_PARAM_AC_AGGRSIZE_SCALING,
+ .ltr_enable = WMI_PDEV_PARAM_LTR_ENABLE,
+ .ltr_ac_latency_be = WMI_PDEV_PARAM_LTR_AC_LATENCY_BE,
+ .ltr_ac_latency_bk = WMI_PDEV_PARAM_LTR_AC_LATENCY_BK,
+ .ltr_ac_latency_vi = WMI_PDEV_PARAM_LTR_AC_LATENCY_VI,
+ .ltr_ac_latency_vo = WMI_PDEV_PARAM_LTR_AC_LATENCY_VO,
+ .ltr_ac_latency_timeout = WMI_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
+ .ltr_sleep_override = WMI_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
+ .ltr_rx_override = WMI_PDEV_PARAM_LTR_RX_OVERRIDE,
+ .ltr_tx_activity_timeout = WMI_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
+ .l1ss_enable = WMI_PDEV_PARAM_L1SS_ENABLE,
+ .dsleep_enable = WMI_PDEV_PARAM_DSLEEP_ENABLE,
+ .pcielp_txbuf_flush = WMI_PDEV_PARAM_PCIELP_TXBUF_FLUSH,
+ .pcielp_txbuf_watermark = WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
+ .pcielp_txbuf_tmo_en = WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN,
+ .pcielp_txbuf_tmo_value = WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE,
+ .pdev_stats_update_period = WMI_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
+ .vdev_stats_update_period = WMI_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
+ .peer_stats_update_period = WMI_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
+ .bcnflt_stats_update_period = WMI_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
+ .pmf_qos = WMI_PDEV_PARAM_PMF_QOS,
+ .arp_ac_override = WMI_PDEV_PARAM_ARP_AC_OVERRIDE,
+ .arpdhcp_ac_override = WMI_PDEV_PARAM_UNSUPPORTED,
+ .dcs = WMI_PDEV_PARAM_DCS,
+ .ani_enable = WMI_PDEV_PARAM_ANI_ENABLE,
+ .ani_poll_period = WMI_PDEV_PARAM_ANI_POLL_PERIOD,
+ .ani_listen_period = WMI_PDEV_PARAM_ANI_LISTEN_PERIOD,
+ .ani_ofdm_level = WMI_PDEV_PARAM_ANI_OFDM_LEVEL,
+ .ani_cck_level = WMI_PDEV_PARAM_ANI_CCK_LEVEL,
+ .dyntxchain = WMI_PDEV_PARAM_DYNTXCHAIN,
+ .proxy_sta = WMI_PDEV_PARAM_PROXY_STA,
+ .idle_ps_config = WMI_PDEV_PARAM_IDLE_PS_CONFIG,
+ .power_gating_sleep = WMI_PDEV_PARAM_POWER_GATING_SLEEP,
+ .fast_channel_reset = WMI_PDEV_PARAM_UNSUPPORTED,
+ .burst_dur = WMI_PDEV_PARAM_UNSUPPORTED,
+ .burst_enable = WMI_PDEV_PARAM_UNSUPPORTED,
+};
+
+static struct wmi_pdev_param_map wmi_10x_pdev_param_map = {
+ .tx_chain_mask = WMI_10X_PDEV_PARAM_TX_CHAIN_MASK,
+ .rx_chain_mask = WMI_10X_PDEV_PARAM_RX_CHAIN_MASK,
+ .txpower_limit2g = WMI_10X_PDEV_PARAM_TXPOWER_LIMIT2G,
+ .txpower_limit5g = WMI_10X_PDEV_PARAM_TXPOWER_LIMIT5G,
+ .txpower_scale = WMI_10X_PDEV_PARAM_TXPOWER_SCALE,
+ .beacon_gen_mode = WMI_10X_PDEV_PARAM_BEACON_GEN_MODE,
+ .beacon_tx_mode = WMI_10X_PDEV_PARAM_BEACON_TX_MODE,
+ .resmgr_offchan_mode = WMI_10X_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
+ .protection_mode = WMI_10X_PDEV_PARAM_PROTECTION_MODE,
+ .dynamic_bw = WMI_10X_PDEV_PARAM_DYNAMIC_BW,
+ .non_agg_sw_retry_th = WMI_10X_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
+ .agg_sw_retry_th = WMI_10X_PDEV_PARAM_AGG_SW_RETRY_TH,
+ .sta_kickout_th = WMI_10X_PDEV_PARAM_STA_KICKOUT_TH,
+ .ac_aggrsize_scaling = WMI_10X_PDEV_PARAM_AC_AGGRSIZE_SCALING,
+ .ltr_enable = WMI_10X_PDEV_PARAM_LTR_ENABLE,
+ .ltr_ac_latency_be = WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BE,
+ .ltr_ac_latency_bk = WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BK,
+ .ltr_ac_latency_vi = WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VI,
+ .ltr_ac_latency_vo = WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VO,
+ .ltr_ac_latency_timeout = WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
+ .ltr_sleep_override = WMI_10X_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
+ .ltr_rx_override = WMI_10X_PDEV_PARAM_LTR_RX_OVERRIDE,
+ .ltr_tx_activity_timeout = WMI_10X_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
+ .l1ss_enable = WMI_10X_PDEV_PARAM_L1SS_ENABLE,
+ .dsleep_enable = WMI_10X_PDEV_PARAM_DSLEEP_ENABLE,
+ .pcielp_txbuf_flush = WMI_PDEV_PARAM_UNSUPPORTED,
+ .pcielp_txbuf_watermark = WMI_PDEV_PARAM_UNSUPPORTED,
+ .pcielp_txbuf_tmo_en = WMI_PDEV_PARAM_UNSUPPORTED,
+ .pcielp_txbuf_tmo_value = WMI_PDEV_PARAM_UNSUPPORTED,
+ .pdev_stats_update_period = WMI_10X_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
+ .vdev_stats_update_period = WMI_10X_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
+ .peer_stats_update_period = WMI_10X_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
+ .bcnflt_stats_update_period =
+ WMI_10X_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
+ .pmf_qos = WMI_10X_PDEV_PARAM_PMF_QOS,
+ .arp_ac_override = WMI_PDEV_PARAM_UNSUPPORTED,
+ .arpdhcp_ac_override = WMI_10X_PDEV_PARAM_ARPDHCP_AC_OVERRIDE,
+ .dcs = WMI_10X_PDEV_PARAM_DCS,
+ .ani_enable = WMI_10X_PDEV_PARAM_ANI_ENABLE,
+ .ani_poll_period = WMI_10X_PDEV_PARAM_ANI_POLL_PERIOD,
+ .ani_listen_period = WMI_10X_PDEV_PARAM_ANI_LISTEN_PERIOD,
+ .ani_ofdm_level = WMI_10X_PDEV_PARAM_ANI_OFDM_LEVEL,
+ .ani_cck_level = WMI_10X_PDEV_PARAM_ANI_CCK_LEVEL,
+ .dyntxchain = WMI_10X_PDEV_PARAM_DYNTXCHAIN,
+ .proxy_sta = WMI_PDEV_PARAM_UNSUPPORTED,
+ .idle_ps_config = WMI_PDEV_PARAM_UNSUPPORTED,
+ .power_gating_sleep = WMI_PDEV_PARAM_UNSUPPORTED,
+ .fast_channel_reset = WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET,
+ .burst_dur = WMI_10X_PDEV_PARAM_BURST_DUR,
+ .burst_enable = WMI_10X_PDEV_PARAM_BURST_ENABLE,
+};
+
int ath10k_wmi_wait_for_service_ready(struct ath10k *ar)
{
int ret;
@@ -1870,10 +1975,12 @@ int ath10k_wmi_attach(struct ath10k *ar)
ath10k_warn("Firmware 10.X is not yet supported\n");
ar->wmi.cmd = &wmi_10x_cmd_map;
ar->wmi.vdev_param = &wmi_10x_vdev_param_map;
+ ar->wmi.pdev_param = &wmi_10x_pdev_param_map;
ret = -ENOTSUPP;
} else {
ar->wmi.cmd = &wmi_cmd_map;
ar->wmi.vdev_param = &wmi_vdev_param_map;
+ ar->wmi.pdev_param = &wmi_pdev_param_map;
ret = 0;
}
@@ -2009,12 +2116,16 @@ int ath10k_wmi_pdev_resume_target(struct ath10k *ar)
return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_resume_cmdid);
}
-int ath10k_wmi_pdev_set_param(struct ath10k *ar, enum wmi_pdev_param id,
- u32 value)
+int ath10k_wmi_pdev_set_param(struct ath10k *ar, u32 id, u32 value)
{
struct wmi_pdev_set_param_cmd *cmd;
struct sk_buff *skb;
+ if (id == WMI_PDEV_PARAM_UNSUPPORTED) {
+ ath10k_warn("pdev param %d not supported by firmware\n", id);
+ return -EINVAL;
+ }
+
skb = ath10k_wmi_alloc_skb(sizeof(*cmd));
if (!skb)
return -ENOMEM;
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 1518586..80ab2f0 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -2072,6 +2072,60 @@ struct wmi_csa_event {
#define VDEV_DEFAULT_STATS_UPDATE_PERIOD 500
#define PEER_DEFAULT_STATS_UPDATE_PERIOD 500
+struct wmi_pdev_param_map {
+ u32 tx_chain_mask;
+ u32 rx_chain_mask;
+ u32 txpower_limit2g;
+ u32 txpower_limit5g;
+ u32 txpower_scale;
+ u32 beacon_gen_mode;
+ u32 beacon_tx_mode;
+ u32 resmgr_offchan_mode;
+ u32 protection_mode;
+ u32 dynamic_bw;
+ u32 non_agg_sw_retry_th;
+ u32 agg_sw_retry_th;
+ u32 sta_kickout_th;
+ u32 ac_aggrsize_scaling;
+ u32 ltr_enable;
+ u32 ltr_ac_latency_be;
+ u32 ltr_ac_latency_bk;
+ u32 ltr_ac_latency_vi;
+ u32 ltr_ac_latency_vo;
+ u32 ltr_ac_latency_timeout;
+ u32 ltr_sleep_override;
+ u32 ltr_rx_override;
+ u32 ltr_tx_activity_timeout;
+ u32 l1ss_enable;
+ u32 dsleep_enable;
+ u32 pcielp_txbuf_flush;
+ u32 pcielp_txbuf_watermark;
+ u32 pcielp_txbuf_tmo_en;
+ u32 pcielp_txbuf_tmo_value;
+ u32 pdev_stats_update_period;
+ u32 vdev_stats_update_period;
+ u32 peer_stats_update_period;
+ u32 bcnflt_stats_update_period;
+ u32 pmf_qos;
+ u32 arp_ac_override;
+ u32 arpdhcp_ac_override;
+ u32 dcs;
+ u32 ani_enable;
+ u32 ani_poll_period;
+ u32 ani_listen_period;
+ u32 ani_ofdm_level;
+ u32 ani_cck_level;
+ u32 dyntxchain;
+ u32 proxy_sta;
+ u32 idle_ps_config;
+ u32 power_gating_sleep;
+ u32 fast_channel_reset;
+ u32 burst_dur;
+ u32 burst_enable;
+};
+
+#define WMI_PDEV_PARAM_UNSUPPORTED 0
+
enum wmi_pdev_param {
/* TX chian mask */
WMI_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
@@ -2171,6 +2225,97 @@ enum wmi_pdev_param {
WMI_PDEV_PARAM_POWER_GATING_SLEEP,
};
+enum wmi_10x_pdev_param {
+ /* TX chian mask */
+ WMI_10X_PDEV_PARAM_TX_CHAIN_MASK = 0x1,
+ /* RX chian mask */
+ WMI_10X_PDEV_PARAM_RX_CHAIN_MASK,
+ /* TX power limit for 2G Radio */
+ WMI_10X_PDEV_PARAM_TXPOWER_LIMIT2G,
+ /* TX power limit for 5G Radio */
+ WMI_10X_PDEV_PARAM_TXPOWER_LIMIT5G,
+ /* TX power scale */
+ WMI_10X_PDEV_PARAM_TXPOWER_SCALE,
+ /* Beacon generation mode . 0: host, 1: target */
+ WMI_10X_PDEV_PARAM_BEACON_GEN_MODE,
+ /* Beacon generation mode . 0: staggered 1: bursted */
+ WMI_10X_PDEV_PARAM_BEACON_TX_MODE,
+ /*
+ * Resource manager off chan mode .
+ * 0: turn off off chan mode. 1: turn on offchan mode
+ */
+ WMI_10X_PDEV_PARAM_RESMGR_OFFCHAN_MODE,
+ /*
+ * Protection mode:
+ * 0: no protection 1:use CTS-to-self 2: use RTS/CTS
+ */
+ WMI_10X_PDEV_PARAM_PROTECTION_MODE,
+ /* Dynamic bandwidth 0: disable 1: enable */
+ WMI_10X_PDEV_PARAM_DYNAMIC_BW,
+ /* Non aggregrate/ 11g sw retry threshold.0-disable */
+ WMI_10X_PDEV_PARAM_NON_AGG_SW_RETRY_TH,
+ /* aggregrate sw retry threshold. 0-disable*/
+ WMI_10X_PDEV_PARAM_AGG_SW_RETRY_TH,
+ /* Station kickout threshold (non of consecutive failures).0-disable */
+ WMI_10X_PDEV_PARAM_STA_KICKOUT_TH,
+ /* Aggerate size scaling configuration per AC */
+ WMI_10X_PDEV_PARAM_AC_AGGRSIZE_SCALING,
+ /* LTR enable */
+ WMI_10X_PDEV_PARAM_LTR_ENABLE,
+ /* LTR latency for BE, in us */
+ WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BE,
+ /* LTR latency for BK, in us */
+ WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BK,
+ /* LTR latency for VI, in us */
+ WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VI,
+ /* LTR latency for VO, in us */
+ WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VO,
+ /* LTR AC latency timeout, in ms */
+ WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT,
+ /* LTR platform latency override, in us */
+ WMI_10X_PDEV_PARAM_LTR_SLEEP_OVERRIDE,
+ /* LTR-RX override, in us */
+ WMI_10X_PDEV_PARAM_LTR_RX_OVERRIDE,
+ /* Tx activity timeout for LTR, in us */
+ WMI_10X_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT,
+ /* L1SS state machine enable */
+ WMI_10X_PDEV_PARAM_L1SS_ENABLE,
+ /* Deep sleep state machine enable */
+ WMI_10X_PDEV_PARAM_DSLEEP_ENABLE,
+ /* pdev level stats update period in ms */
+ WMI_10X_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD,
+ /* vdev level stats update period in ms */
+ WMI_10X_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD,
+ /* peer level stats update period in ms */
+ WMI_10X_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD,
+ /* beacon filter status update period */
+ WMI_10X_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD,
+ /* QOS Mgmt frame protection MFP/PMF 0: disable, 1: enable */
+ WMI_10X_PDEV_PARAM_PMF_QOS,
+ /* Access category on which ARP and DHCP frames are sent */
+ WMI_10X_PDEV_PARAM_ARPDHCP_AC_OVERRIDE,
+ /* DCS configuration */
+ WMI_10X_PDEV_PARAM_DCS,
+ /* Enable/Disable ANI on target */
+ WMI_10X_PDEV_PARAM_ANI_ENABLE,
+ /* configure the ANI polling period */
+ WMI_10X_PDEV_PARAM_ANI_POLL_PERIOD,
+ /* configure the ANI listening period */
+ WMI_10X_PDEV_PARAM_ANI_LISTEN_PERIOD,
+ /* configure OFDM immunity level */
+ WMI_10X_PDEV_PARAM_ANI_OFDM_LEVEL,
+ /* configure CCK immunity level */
+ WMI_10X_PDEV_PARAM_ANI_CCK_LEVEL,
+ /* Enable/Disable CDD for 1x1 STAs in rate control module */
+ WMI_10X_PDEV_PARAM_DYNTXCHAIN,
+ /* Enable/Disable Fast channel reset*/
+ WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET,
+ /* Set Bursting DUR */
+ WMI_10X_PDEV_PARAM_BURST_DUR,
+ /* Set Bursting Enable*/
+ WMI_10X_PDEV_PARAM_BURST_ENABLE,
+};
+
struct wmi_pdev_set_param_cmd {
__le32 param_id;
__le32 param_value;
@@ -3797,8 +3942,7 @@ int ath10k_wmi_pdev_suspend_target(struct ath10k *ar);
int ath10k_wmi_pdev_resume_target(struct ath10k *ar);
int ath10k_wmi_pdev_set_regdomain(struct ath10k *ar, u16 rd, u16 rd2g,
u16 rd5g, u16 ctl2g, u16 ctl5g);
-int ath10k_wmi_pdev_set_param(struct ath10k *ar, enum wmi_pdev_param id,
- u32 value);
+int ath10k_wmi_pdev_set_param(struct ath10k *ar, u32 id, u32 value);
int ath10k_wmi_cmd_init(struct ath10k *ar);
int ath10k_wmi_start_scan(struct ath10k *ar, const struct wmi_start_scan_arg *);
void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *);
--
1.7.10
^ permalink raw reply related
* [PATCH v2 11/13] ath10k: introduce dynamic vdev parameters
From: Bartosz Markowski @ 2013-09-26 9:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Bartosz Markowski
In-Reply-To: <1380187792-25626-1-git-send-email-bartosz.markowski@tieto.com>
Both firmwares (main and 10.x) have different set of vdev
parameters. To stay in sync with FW API, this patch introduces
a dynamic registering method.
ath10k_wmi_vdev_set_param() takes now indirect u32 value
to identify the Vdev parameter it want's to set.
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
---
drivers/net/wireless/ath/ath10k/core.h | 1 +
drivers/net/wireless/ath/ath10k/mac.c | 55 +++++-----
drivers/net/wireless/ath/ath10k/wmi.c | 129 +++++++++++++++++++++++-
drivers/net/wireless/ath/ath10k/wmi.h | 172 +++++++++++++++++++++++++++++++-
4 files changed, 332 insertions(+), 25 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 984db11..124e724 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -119,6 +119,7 @@ struct ath10k_wmi {
struct completion unified_ready;
wait_queue_head_t tx_credits_wq;
struct wmi_cmd_map *cmd;
+ struct wmi_vdev_param_map *vdev_param;
u32 num_mem_chunks;
struct ath10k_mem_chunk mem_chunks[ATH10K_MAX_MEM_REQS];
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index cadf90d..d8aba57 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -334,25 +334,29 @@ static int ath10k_peer_create(struct ath10k *ar, u32 vdev_id, const u8 *addr)
static int ath10k_mac_set_rts(struct ath10k_vif *arvif, u32 value)
{
+ struct ath10k *ar = arvif->ar;
+ u32 vdev_param;
+
if (value != 0xFFFFFFFF)
value = min_t(u32, arvif->ar->hw->wiphy->rts_threshold,
ATH10K_RTS_MAX);
- return ath10k_wmi_vdev_set_param(arvif->ar, arvif->vdev_id,
- WMI_VDEV_PARAM_RTS_THRESHOLD,
- value);
+ vdev_param = ar->wmi.vdev_param->rts_threshold;
+ return ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, value);
}
static int ath10k_mac_set_frag(struct ath10k_vif *arvif, u32 value)
{
+ struct ath10k *ar = arvif->ar;
+ u32 vdev_param;
+
if (value != 0xFFFFFFFF)
value = clamp_t(u32, arvif->ar->hw->wiphy->frag_threshold,
ATH10K_FRAGMT_THRESHOLD_MIN,
ATH10K_FRAGMT_THRESHOLD_MAX);
- return ath10k_wmi_vdev_set_param(arvif->ar, arvif->vdev_id,
- WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
- value);
+ vdev_param = ar->wmi.vdev_param->fragmentation_threshold;
+ return ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, value);
}
static int ath10k_peer_delete(struct ath10k *ar, u32 vdev_id, const u8 *addr)
@@ -677,6 +681,7 @@ static void ath10k_control_ibss(struct ath10k_vif *arvif,
struct ieee80211_bss_conf *info,
const u8 self_peer[ETH_ALEN])
{
+ u32 vdev_param;
int ret = 0;
lockdep_assert_held(&arvif->ar->conf_mutex);
@@ -710,8 +715,8 @@ static void ath10k_control_ibss(struct ath10k_vif *arvif,
return;
}
- ret = ath10k_wmi_vdev_set_param(arvif->ar, arvif->vdev_id,
- WMI_VDEV_PARAM_ATIM_WINDOW,
+ vdev_param = arvif->ar->wmi.vdev_param->atim_window;
+ ret = ath10k_wmi_vdev_set_param(arvif->ar, arvif->vdev_id, vdev_param,
ATH10K_DEFAULT_ATIM);
if (ret)
ath10k_warn("Failed to set IBSS ATIM for VDEV:%d ret:%d\n",
@@ -1433,6 +1438,7 @@ static void ath10k_tx_h_update_wep_key(struct sk_buff *skb)
struct ath10k *ar = arvif->ar;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
struct ieee80211_key_conf *key = info->control.hw_key;
+ u32 vdev_param;
int ret;
if (!ieee80211_has_protected(hdr->frame_control))
@@ -1451,8 +1457,8 @@ static void ath10k_tx_h_update_wep_key(struct sk_buff *skb)
ath10k_dbg(ATH10K_DBG_MAC, "mac vdev %d keyidx %d\n",
arvif->vdev_id, key->keyidx);
- ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
- WMI_VDEV_PARAM_DEF_KEYID,
+ vdev_param = ar->wmi.vdev_param->def_keyid;
+ ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
key->keyidx);
if (ret) {
ath10k_warn("could not update wep keyidx (%d)\n", ret);
@@ -1986,6 +1992,7 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
int ret = 0;
u32 value;
int bit;
+ u32 vdev_param;
mutex_lock(&ar->conf_mutex);
@@ -2047,13 +2054,14 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
goto exit;
}
- ret = ath10k_wmi_vdev_set_param(ar, 0, WMI_VDEV_PARAM_DEF_KEYID,
+ vdev_param = ar->wmi.vdev_param->def_keyid;
+ ret = ath10k_wmi_vdev_set_param(ar, 0, vdev_param,
arvif->def_wep_key_index);
if (ret)
ath10k_warn("Failed to set default keyid: %d\n", ret);
- ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
- WMI_VDEV_PARAM_TX_ENCAP_TYPE,
+ vdev_param = ar->wmi.vdev_param->tx_encap_type;
+ ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
ATH10K_HW_TXRX_NATIVE_WIFI);
if (ret)
ath10k_warn("Failed to set TX encap: %d\n", ret);
@@ -2204,6 +2212,7 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,
struct ath10k *ar = hw->priv;
struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
int ret = 0;
+ u32 vdev_param;
mutex_lock(&ar->conf_mutex);
@@ -2212,8 +2221,8 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,
if (changed & BSS_CHANGED_BEACON_INT) {
arvif->beacon_interval = info->beacon_int;
- ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
- WMI_VDEV_PARAM_BEACON_INTERVAL,
+ vdev_param = ar->wmi.vdev_param->beacon_interval;
+ ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
arvif->beacon_interval);
ath10k_dbg(ATH10K_DBG_MAC,
"mac vdev %d beacon_interval %d\n",
@@ -2244,8 +2253,8 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,
"mac vdev %d dtim_period %d\n",
arvif->vdev_id, arvif->dtim_period);
- ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
- WMI_VDEV_PARAM_DTIM_PERIOD,
+ vdev_param = ar->wmi.vdev_param->dtim_period;
+ ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
arvif->dtim_period);
if (ret)
ath10k_warn("Failed to set dtim period for VDEV: %d\n",
@@ -2312,8 +2321,8 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,
ath10k_dbg(ATH10K_DBG_MAC, "mac vdev %d cts_prot %d\n",
arvif->vdev_id, cts_prot);
- ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
- WMI_VDEV_PARAM_ENABLE_RTSCTS,
+ vdev_param = ar->wmi.vdev_param->enable_rtscts;
+ ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
cts_prot);
if (ret)
ath10k_warn("Failed to set CTS prot for VDEV: %d\n",
@@ -2331,8 +2340,8 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,
ath10k_dbg(ATH10K_DBG_MAC, "mac vdev %d slot_time %d\n",
arvif->vdev_id, slottime);
- ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
- WMI_VDEV_PARAM_SLOT_TIME,
+ vdev_param = ar->wmi.vdev_param->slot_time;
+ ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
slottime);
if (ret)
ath10k_warn("Failed to set erp slot for VDEV: %d\n",
@@ -2350,8 +2359,8 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,
"mac vdev %d preamble %dn",
arvif->vdev_id, preamble);
- ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
- WMI_VDEV_PARAM_PREAMBLE,
+ vdev_param = ar->wmi.vdev_param->preamble;
+ ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
preamble);
if (ret)
ath10k_warn("Failed to set preamble for VDEV: %d\n",
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index de50856..a6bd87e 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -265,6 +265,124 @@ static struct wmi_cmd_map wmi_10x_cmd_map = {
.gpio_output_cmdid = WMI_10X_GPIO_OUTPUT_CMDID,
};
+/* MAIN WMI VDEV param map */
+static struct wmi_vdev_param_map wmi_vdev_param_map = {
+ .rts_threshold = WMI_VDEV_PARAM_RTS_THRESHOLD,
+ .fragmentation_threshold = WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
+ .beacon_interval = WMI_VDEV_PARAM_BEACON_INTERVAL,
+ .listen_interval = WMI_VDEV_PARAM_LISTEN_INTERVAL,
+ .multicast_rate = WMI_VDEV_PARAM_MULTICAST_RATE,
+ .mgmt_tx_rate = WMI_VDEV_PARAM_MGMT_TX_RATE,
+ .slot_time = WMI_VDEV_PARAM_SLOT_TIME,
+ .preamble = WMI_VDEV_PARAM_PREAMBLE,
+ .swba_time = WMI_VDEV_PARAM_SWBA_TIME,
+ .wmi_vdev_stats_update_period = WMI_VDEV_STATS_UPDATE_PERIOD,
+ .wmi_vdev_pwrsave_ageout_time = WMI_VDEV_PWRSAVE_AGEOUT_TIME,
+ .wmi_vdev_host_swba_interval = WMI_VDEV_HOST_SWBA_INTERVAL,
+ .dtim_period = WMI_VDEV_PARAM_DTIM_PERIOD,
+ .wmi_vdev_oc_scheduler_air_time_limit =
+ WMI_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
+ .wds = WMI_VDEV_PARAM_WDS,
+ .atim_window = WMI_VDEV_PARAM_ATIM_WINDOW,
+ .bmiss_count_max = WMI_VDEV_PARAM_BMISS_COUNT_MAX,
+ .bmiss_first_bcnt = WMI_VDEV_PARAM_BMISS_FIRST_BCNT,
+ .bmiss_final_bcnt = WMI_VDEV_PARAM_BMISS_FINAL_BCNT,
+ .feature_wmm = WMI_VDEV_PARAM_FEATURE_WMM,
+ .chwidth = WMI_VDEV_PARAM_CHWIDTH,
+ .chextoffset = WMI_VDEV_PARAM_CHEXTOFFSET,
+ .disable_htprotection = WMI_VDEV_PARAM_DISABLE_HTPROTECTION,
+ .sta_quickkickout = WMI_VDEV_PARAM_STA_QUICKKICKOUT,
+ .mgmt_rate = WMI_VDEV_PARAM_MGMT_RATE,
+ .protection_mode = WMI_VDEV_PARAM_PROTECTION_MODE,
+ .fixed_rate = WMI_VDEV_PARAM_FIXED_RATE,
+ .sgi = WMI_VDEV_PARAM_SGI,
+ .ldpc = WMI_VDEV_PARAM_LDPC,
+ .tx_stbc = WMI_VDEV_PARAM_TX_STBC,
+ .rx_stbc = WMI_VDEV_PARAM_RX_STBC,
+ .intra_bss_fwd = WMI_VDEV_PARAM_INTRA_BSS_FWD,
+ .def_keyid = WMI_VDEV_PARAM_DEF_KEYID,
+ .nss = WMI_VDEV_PARAM_NSS,
+ .bcast_data_rate = WMI_VDEV_PARAM_BCAST_DATA_RATE,
+ .mcast_data_rate = WMI_VDEV_PARAM_MCAST_DATA_RATE,
+ .mcast_indicate = WMI_VDEV_PARAM_MCAST_INDICATE,
+ .dhcp_indicate = WMI_VDEV_PARAM_DHCP_INDICATE,
+ .unknown_dest_indicate = WMI_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
+ .ap_keepalive_min_idle_inactive_time_secs =
+ WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
+ .ap_keepalive_max_idle_inactive_time_secs =
+ WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
+ .ap_keepalive_max_unresponsive_time_secs =
+ WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
+ .ap_enable_nawds = WMI_VDEV_PARAM_AP_ENABLE_NAWDS,
+ .mcast2ucast_set = WMI_VDEV_PARAM_UNSUPPORTED,
+ .enable_rtscts = WMI_VDEV_PARAM_ENABLE_RTSCTS,
+ .txbf = WMI_VDEV_PARAM_TXBF,
+ .packet_powersave = WMI_VDEV_PARAM_PACKET_POWERSAVE,
+ .drop_unencry = WMI_VDEV_PARAM_DROP_UNENCRY,
+ .tx_encap_type = WMI_VDEV_PARAM_TX_ENCAP_TYPE,
+ .ap_detect_out_of_sync_sleeping_sta_time_secs =
+ WMI_VDEV_PARAM_UNSUPPORTED,
+};
+
+/* 10.X WMI VDEV param map */
+static struct wmi_vdev_param_map wmi_10x_vdev_param_map = {
+ .rts_threshold = WMI_10X_VDEV_PARAM_RTS_THRESHOLD,
+ .fragmentation_threshold = WMI_10X_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
+ .beacon_interval = WMI_10X_VDEV_PARAM_BEACON_INTERVAL,
+ .listen_interval = WMI_10X_VDEV_PARAM_LISTEN_INTERVAL,
+ .multicast_rate = WMI_10X_VDEV_PARAM_MULTICAST_RATE,
+ .mgmt_tx_rate = WMI_10X_VDEV_PARAM_MGMT_TX_RATE,
+ .slot_time = WMI_10X_VDEV_PARAM_SLOT_TIME,
+ .preamble = WMI_10X_VDEV_PARAM_PREAMBLE,
+ .swba_time = WMI_10X_VDEV_PARAM_SWBA_TIME,
+ .wmi_vdev_stats_update_period = WMI_10X_VDEV_STATS_UPDATE_PERIOD,
+ .wmi_vdev_pwrsave_ageout_time = WMI_10X_VDEV_PWRSAVE_AGEOUT_TIME,
+ .wmi_vdev_host_swba_interval = WMI_10X_VDEV_HOST_SWBA_INTERVAL,
+ .dtim_period = WMI_10X_VDEV_PARAM_DTIM_PERIOD,
+ .wmi_vdev_oc_scheduler_air_time_limit =
+ WMI_10X_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
+ .wds = WMI_10X_VDEV_PARAM_WDS,
+ .atim_window = WMI_10X_VDEV_PARAM_ATIM_WINDOW,
+ .bmiss_count_max = WMI_10X_VDEV_PARAM_BMISS_COUNT_MAX,
+ .bmiss_first_bcnt = WMI_VDEV_PARAM_UNSUPPORTED,
+ .bmiss_final_bcnt = WMI_VDEV_PARAM_UNSUPPORTED,
+ .feature_wmm = WMI_10X_VDEV_PARAM_FEATURE_WMM,
+ .chwidth = WMI_10X_VDEV_PARAM_CHWIDTH,
+ .chextoffset = WMI_10X_VDEV_PARAM_CHEXTOFFSET,
+ .disable_htprotection = WMI_10X_VDEV_PARAM_DISABLE_HTPROTECTION,
+ .sta_quickkickout = WMI_10X_VDEV_PARAM_STA_QUICKKICKOUT,
+ .mgmt_rate = WMI_10X_VDEV_PARAM_MGMT_RATE,
+ .protection_mode = WMI_10X_VDEV_PARAM_PROTECTION_MODE,
+ .fixed_rate = WMI_10X_VDEV_PARAM_FIXED_RATE,
+ .sgi = WMI_10X_VDEV_PARAM_SGI,
+ .ldpc = WMI_10X_VDEV_PARAM_LDPC,
+ .tx_stbc = WMI_10X_VDEV_PARAM_TX_STBC,
+ .rx_stbc = WMI_10X_VDEV_PARAM_RX_STBC,
+ .intra_bss_fwd = WMI_10X_VDEV_PARAM_INTRA_BSS_FWD,
+ .def_keyid = WMI_10X_VDEV_PARAM_DEF_KEYID,
+ .nss = WMI_10X_VDEV_PARAM_NSS,
+ .bcast_data_rate = WMI_10X_VDEV_PARAM_BCAST_DATA_RATE,
+ .mcast_data_rate = WMI_10X_VDEV_PARAM_MCAST_DATA_RATE,
+ .mcast_indicate = WMI_10X_VDEV_PARAM_MCAST_INDICATE,
+ .dhcp_indicate = WMI_10X_VDEV_PARAM_DHCP_INDICATE,
+ .unknown_dest_indicate = WMI_10X_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
+ .ap_keepalive_min_idle_inactive_time_secs =
+ WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
+ .ap_keepalive_max_idle_inactive_time_secs =
+ WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
+ .ap_keepalive_max_unresponsive_time_secs =
+ WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
+ .ap_enable_nawds = WMI_10X_VDEV_PARAM_AP_ENABLE_NAWDS,
+ .mcast2ucast_set = WMI_10X_VDEV_PARAM_MCAST2UCAST_SET,
+ .enable_rtscts = WMI_10X_VDEV_PARAM_ENABLE_RTSCTS,
+ .txbf = WMI_VDEV_PARAM_UNSUPPORTED,
+ .packet_powersave = WMI_VDEV_PARAM_UNSUPPORTED,
+ .drop_unencry = WMI_VDEV_PARAM_UNSUPPORTED,
+ .tx_encap_type = WMI_VDEV_PARAM_UNSUPPORTED,
+ .ap_detect_out_of_sync_sleeping_sta_time_secs =
+ WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
+};
+
int ath10k_wmi_wait_for_service_ready(struct ath10k *ar)
{
int ret;
@@ -1751,9 +1869,11 @@ int ath10k_wmi_attach(struct ath10k *ar)
if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) {
ath10k_warn("Firmware 10.X is not yet supported\n");
ar->wmi.cmd = &wmi_10x_cmd_map;
+ ar->wmi.vdev_param = &wmi_10x_vdev_param_map;
ret = -ENOTSUPP;
} else {
ar->wmi.cmd = &wmi_cmd_map;
+ ar->wmi.vdev_param = &wmi_vdev_param_map;
ret = 0;
}
@@ -2516,11 +2636,18 @@ int ath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id)
}
int ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id,
- enum wmi_vdev_param param_id, u32 param_value)
+ u32 param_id, u32 param_value)
{
struct wmi_vdev_set_param_cmd *cmd;
struct sk_buff *skb;
+ if (param_id == WMI_VDEV_PARAM_UNSUPPORTED) {
+ ath10k_dbg(ATH10K_DBG_WMI,
+ "vdev param %d not supported by firmware\n",
+ param_id);
+ return -EINVAL;
+ }
+
skb = ath10k_wmi_alloc_skb(sizeof(*cmd));
if (!skb)
return -ENOMEM;
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 5383f7e..1518586 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -2695,6 +2695,61 @@ enum wmi_rate_preamble {
/* Value to disable fixed rate setting */
#define WMI_FIXED_RATE_NONE (0xff)
+struct wmi_vdev_param_map {
+ u32 rts_threshold;
+ u32 fragmentation_threshold;
+ u32 beacon_interval;
+ u32 listen_interval;
+ u32 multicast_rate;
+ u32 mgmt_tx_rate;
+ u32 slot_time;
+ u32 preamble;
+ u32 swba_time;
+ u32 wmi_vdev_stats_update_period;
+ u32 wmi_vdev_pwrsave_ageout_time;
+ u32 wmi_vdev_host_swba_interval;
+ u32 dtim_period;
+ u32 wmi_vdev_oc_scheduler_air_time_limit;
+ u32 wds;
+ u32 atim_window;
+ u32 bmiss_count_max;
+ u32 bmiss_first_bcnt;
+ u32 bmiss_final_bcnt;
+ u32 feature_wmm;
+ u32 chwidth;
+ u32 chextoffset;
+ u32 disable_htprotection;
+ u32 sta_quickkickout;
+ u32 mgmt_rate;
+ u32 protection_mode;
+ u32 fixed_rate;
+ u32 sgi;
+ u32 ldpc;
+ u32 tx_stbc;
+ u32 rx_stbc;
+ u32 intra_bss_fwd;
+ u32 def_keyid;
+ u32 nss;
+ u32 bcast_data_rate;
+ u32 mcast_data_rate;
+ u32 mcast_indicate;
+ u32 dhcp_indicate;
+ u32 unknown_dest_indicate;
+ u32 ap_keepalive_min_idle_inactive_time_secs;
+ u32 ap_keepalive_max_idle_inactive_time_secs;
+ u32 ap_keepalive_max_unresponsive_time_secs;
+ u32 ap_enable_nawds;
+ u32 mcast2ucast_set;
+ u32 enable_rtscts;
+ u32 txbf;
+ u32 packet_powersave;
+ u32 drop_unencry;
+ u32 tx_encap_type;
+ u32 ap_detect_out_of_sync_sleeping_sta_time_secs;
+};
+
+#define WMI_VDEV_PARAM_UNSUPPORTED 0
+
/* the definition of different VDEV parameters */
enum wmi_vdev_param {
/* RTS Threshold */
@@ -2826,6 +2881,121 @@ enum wmi_vdev_param {
WMI_VDEV_PARAM_TX_ENCAP_TYPE,
};
+/* the definition of different VDEV parameters */
+enum wmi_10x_vdev_param {
+ /* RTS Threshold */
+ WMI_10X_VDEV_PARAM_RTS_THRESHOLD = 0x1,
+ /* Fragmentation threshold */
+ WMI_10X_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
+ /* beacon interval in TUs */
+ WMI_10X_VDEV_PARAM_BEACON_INTERVAL,
+ /* Listen interval in TUs */
+ WMI_10X_VDEV_PARAM_LISTEN_INTERVAL,
+ /* muticast rate in Mbps */
+ WMI_10X_VDEV_PARAM_MULTICAST_RATE,
+ /* management frame rate in Mbps */
+ WMI_10X_VDEV_PARAM_MGMT_TX_RATE,
+ /* slot time (long vs short) */
+ WMI_10X_VDEV_PARAM_SLOT_TIME,
+ /* preamble (long vs short) */
+ WMI_10X_VDEV_PARAM_PREAMBLE,
+ /* SWBA time (time before tbtt in msec) */
+ WMI_10X_VDEV_PARAM_SWBA_TIME,
+ /* time period for updating VDEV stats */
+ WMI_10X_VDEV_STATS_UPDATE_PERIOD,
+ /* age out time in msec for frames queued for station in power save */
+ WMI_10X_VDEV_PWRSAVE_AGEOUT_TIME,
+ /*
+ * Host SWBA interval (time in msec before tbtt for SWBA event
+ * generation).
+ */
+ WMI_10X_VDEV_HOST_SWBA_INTERVAL,
+ /* DTIM period (specified in units of num beacon intervals) */
+ WMI_10X_VDEV_PARAM_DTIM_PERIOD,
+ /*
+ * scheduler air time limit for this VDEV. used by off chan
+ * scheduler.
+ */
+ WMI_10X_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT,
+ /* enable/dsiable WDS for this VDEV */
+ WMI_10X_VDEV_PARAM_WDS,
+ /* ATIM Window */
+ WMI_10X_VDEV_PARAM_ATIM_WINDOW,
+ /* BMISS max */
+ WMI_10X_VDEV_PARAM_BMISS_COUNT_MAX,
+ /* WMM enables/disabled */
+ WMI_10X_VDEV_PARAM_FEATURE_WMM,
+ /* Channel width */
+ WMI_10X_VDEV_PARAM_CHWIDTH,
+ /* Channel Offset */
+ WMI_10X_VDEV_PARAM_CHEXTOFFSET,
+ /* Disable HT Protection */
+ WMI_10X_VDEV_PARAM_DISABLE_HTPROTECTION,
+ /* Quick STA Kickout */
+ WMI_10X_VDEV_PARAM_STA_QUICKKICKOUT,
+ /* Rate to be used with Management frames */
+ WMI_10X_VDEV_PARAM_MGMT_RATE,
+ /* Protection Mode */
+ WMI_10X_VDEV_PARAM_PROTECTION_MODE,
+ /* Fixed rate setting */
+ WMI_10X_VDEV_PARAM_FIXED_RATE,
+ /* Short GI Enable/Disable */
+ WMI_10X_VDEV_PARAM_SGI,
+ /* Enable LDPC */
+ WMI_10X_VDEV_PARAM_LDPC,
+ /* Enable Tx STBC */
+ WMI_10X_VDEV_PARAM_TX_STBC,
+ /* Enable Rx STBC */
+ WMI_10X_VDEV_PARAM_RX_STBC,
+ /* Intra BSS forwarding */
+ WMI_10X_VDEV_PARAM_INTRA_BSS_FWD,
+ /* Setting Default xmit key for Vdev */
+ WMI_10X_VDEV_PARAM_DEF_KEYID,
+ /* NSS width */
+ WMI_10X_VDEV_PARAM_NSS,
+ /* Set the custom rate for the broadcast data frames */
+ WMI_10X_VDEV_PARAM_BCAST_DATA_RATE,
+ /* Set the custom rate (rate-code) for multicast data frames */
+ WMI_10X_VDEV_PARAM_MCAST_DATA_RATE,
+ /* Tx multicast packet indicate Enable/Disable */
+ WMI_10X_VDEV_PARAM_MCAST_INDICATE,
+ /* Tx DHCP packet indicate Enable/Disable */
+ WMI_10X_VDEV_PARAM_DHCP_INDICATE,
+ /* Enable host inspection of Tx unicast packet to unknown destination */
+ WMI_10X_VDEV_PARAM_UNKNOWN_DEST_INDICATE,
+
+ /* The minimum amount of time AP begins to consider STA inactive */
+ WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS,
+
+ /*
+ * An associated STA is considered inactive when there is no recent
+ * TX/RX activity and no downlink frames are buffered for it. Once a
+ * STA exceeds the maximum idle inactive time, the AP will send an
+ * 802.11 data-null as a keep alive to verify the STA is still
+ * associated. If the STA does ACK the data-null, or if the data-null
+ * is buffered and the STA does not retrieve it, the STA will be
+ * considered unresponsive
+ * (see WMI_10X_VDEV_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS).
+ */
+ WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS,
+
+ /*
+ * An associated STA is considered unresponsive if there is no recent
+ * TX/RX activity and downlink frames are buffered for it. Once a STA
+ * exceeds the maximum unresponsive time, the AP will send a
+ * WMI_10X_STA_KICKOUT event to the host so the STA can be deleted. */
+ WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS,
+
+ /* Enable NAWDS : MCAST INSPECT Enable, NAWDS Flag set */
+ WMI_10X_VDEV_PARAM_AP_ENABLE_NAWDS,
+
+ WMI_10X_VDEV_PARAM_MCAST2UCAST_SET,
+ /* Enable/Disable RTS-CTS */
+ WMI_10X_VDEV_PARAM_ENABLE_RTSCTS,
+
+ WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS,
+};
+
/* slot time long */
#define WMI_VDEV_SLOT_TIME_LONG 0x1
/* slot time short */
@@ -3648,7 +3818,7 @@ int ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid,
const u8 *bssid);
int ath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id);
int ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id,
- enum wmi_vdev_param param_id, u32 param_value);
+ u32 param_id, u32 param_value);
int ath10k_wmi_vdev_install_key(struct ath10k *ar,
const struct wmi_vdev_install_key_arg *arg);
int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
--
1.7.10
^ permalink raw reply related
* [PATCH v2 10/13] ath10k: add TARGET values for 10.x firmware
From: Bartosz Markowski @ 2013-09-26 9:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Bartosz Markowski
In-Reply-To: <1380187792-25626-1-git-send-email-bartosz.markowski@tieto.com>
Introduce all TARGET specific values for 10.x firmware.
Some of them are common for both firmwares we will support,
but to avoid confusion, define everything with prefix 10X_.
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
---
drivers/net/wireless/ath/ath10k/hw.h | 31 ++++++++++++++++++
drivers/net/wireless/ath/ath10k/wmi.c | 58 ++++++++++++++++-----------------
2 files changed, 60 insertions(+), 29 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
index 66e721a..2de13db 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -53,6 +53,7 @@ enum ath10k_mcast2ucast_mode {
ATH10K_MCAST2UCAST_ENABLED = 1,
};
+/* Target specific defines for MAIN firmware */
#define TARGET_NUM_VDEVS 8
#define TARGET_NUM_PEER_AST 2
#define TARGET_NUM_WDS_ENTRIES 32
@@ -87,6 +88,36 @@ enum ath10k_mcast2ucast_mode {
#define TARGET_NUM_MSDU_DESC (1024 + 400)
#define TARGET_MAX_FRAG_ENTRIES 0
+/* Target specific defines for 10.X firmware */
+#define TARGET_10X_NUM_VDEVS 16
+#define TARGET_10X_NUM_PEER_AST 2
+#define TARGET_10X_NUM_WDS_ENTRIES 32
+#define TARGET_10X_DMA_BURST_SIZE 0
+#define TARGET_10X_MAC_AGGR_DELIM 0
+#define TARGET_10X_AST_SKID_LIMIT 16
+#define TARGET_10X_NUM_PEERS (128 + (TARGET_10X_NUM_VDEVS))
+#define TARGET_10X_NUM_OFFLOAD_PEERS 0
+#define TARGET_10X_NUM_OFFLOAD_REORDER_BUFS 0
+#define TARGET_10X_NUM_PEER_KEYS 2
+#define TARGET_10X_NUM_TIDS 256
+#define TARGET_10X_TX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2))
+#define TARGET_10X_RX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2))
+#define TARGET_10X_RX_TIMEOUT_LO_PRI 100
+#define TARGET_10X_RX_TIMEOUT_HI_PRI 40
+#define TARGET_10X_RX_DECAP_MODE ATH10K_HW_TXRX_ETHERNET
+#define TARGET_10X_SCAN_MAX_PENDING_REQS 4
+#define TARGET_10X_BMISS_OFFLOAD_MAX_VDEV 2
+#define TARGET_10X_ROAM_OFFLOAD_MAX_VDEV 2
+#define TARGET_10X_ROAM_OFFLOAD_MAX_AP_PROFILES 8
+#define TARGET_10X_GTK_OFFLOAD_MAX_VDEV 3
+#define TARGET_10X_NUM_MCAST_GROUPS 0
+#define TARGET_10X_NUM_MCAST_TABLE_ELEMS 0
+#define TARGET_10X_MCAST2UCAST_MODE ATH10K_MCAST2UCAST_DISABLED
+#define TARGET_10X_TX_DBG_LOG_SIZE 1024
+#define TARGET_10X_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 1
+#define TARGET_10X_VOW_CONFIG 0
+#define TARGET_10X_NUM_MSDU_DESC (1024 + 400)
+#define TARGET_10X_MAX_FRAG_ENTRIES 0
/* Number of Copy Engines supported */
#define CE_COUNT 8
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index c81a8b7..de50856 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -1450,9 +1450,9 @@ static void ath10k_wmi_10x_service_ready_event_rx(struct ath10k *ar,
* peers, 1 extra for self peer on target */
/* this needs to be tied, host and target
* can get out of sync */
- num_units = TARGET_NUM_PEERS + 1;
+ num_units = TARGET_10X_NUM_PEERS + 1;
else if (num_unit_info & NUM_UNITS_IS_NUM_VDEVS)
- num_units = TARGET_NUM_VDEVS + 1;
+ num_units = TARGET_10X_NUM_VDEVS + 1;
ath10k_dbg(ATH10K_DBG_WMI,
"wmi mem_req_id %d num_units %d num_unit_info %d unit size %d actual units %d\n",
@@ -2015,48 +2015,48 @@ static int ath10k_wmi_10x_cmd_init(struct ath10k *ar)
u32 len, val;
int i;
- config.num_vdevs = __cpu_to_le32(TARGET_NUM_VDEVS);
- config.num_peers = __cpu_to_le32(TARGET_NUM_PEERS + TARGET_NUM_VDEVS);
- config.num_peer_keys = __cpu_to_le32(TARGET_NUM_PEER_KEYS);
- config.num_tids = __cpu_to_le32(TARGET_NUM_TIDS);
- config.ast_skid_limit = __cpu_to_le32(TARGET_AST_SKID_LIMIT);
- config.tx_chain_mask = __cpu_to_le32(TARGET_TX_CHAIN_MASK);
- config.rx_chain_mask = __cpu_to_le32(TARGET_RX_CHAIN_MASK);
- config.rx_timeout_pri_vo = __cpu_to_le32(TARGET_RX_TIMEOUT_LO_PRI);
- config.rx_timeout_pri_vi = __cpu_to_le32(TARGET_RX_TIMEOUT_LO_PRI);
- config.rx_timeout_pri_be = __cpu_to_le32(TARGET_RX_TIMEOUT_LO_PRI);
- config.rx_timeout_pri_bk = __cpu_to_le32(TARGET_RX_TIMEOUT_HI_PRI);
- config.rx_decap_mode = __cpu_to_le32(TARGET_RX_DECAP_MODE);
+ config.num_vdevs = __cpu_to_le32(TARGET_10X_NUM_VDEVS);
+ config.num_peers = __cpu_to_le32(TARGET_10X_NUM_PEERS);
+ config.num_peer_keys = __cpu_to_le32(TARGET_10X_NUM_PEER_KEYS);
+ config.num_tids = __cpu_to_le32(TARGET_10X_NUM_TIDS);
+ config.ast_skid_limit = __cpu_to_le32(TARGET_10X_AST_SKID_LIMIT);
+ config.tx_chain_mask = __cpu_to_le32(TARGET_10X_TX_CHAIN_MASK);
+ config.rx_chain_mask = __cpu_to_le32(TARGET_10X_RX_CHAIN_MASK);
+ config.rx_timeout_pri_vo = __cpu_to_le32(TARGET_10X_RX_TIMEOUT_LO_PRI);
+ config.rx_timeout_pri_vi = __cpu_to_le32(TARGET_10X_RX_TIMEOUT_LO_PRI);
+ config.rx_timeout_pri_be = __cpu_to_le32(TARGET_10X_RX_TIMEOUT_LO_PRI);
+ config.rx_timeout_pri_bk = __cpu_to_le32(TARGET_10X_RX_TIMEOUT_HI_PRI);
+ config.rx_decap_mode = __cpu_to_le32(TARGET_10X_RX_DECAP_MODE);
config.scan_max_pending_reqs =
- __cpu_to_le32(TARGET_SCAN_MAX_PENDING_REQS);
+ __cpu_to_le32(TARGET_10X_SCAN_MAX_PENDING_REQS);
config.bmiss_offload_max_vdev =
- __cpu_to_le32(TARGET_BMISS_OFFLOAD_MAX_VDEV);
+ __cpu_to_le32(TARGET_10X_BMISS_OFFLOAD_MAX_VDEV);
config.roam_offload_max_vdev =
- __cpu_to_le32(TARGET_ROAM_OFFLOAD_MAX_VDEV);
+ __cpu_to_le32(TARGET_10X_ROAM_OFFLOAD_MAX_VDEV);
config.roam_offload_max_ap_profiles =
- __cpu_to_le32(TARGET_ROAM_OFFLOAD_MAX_AP_PROFILES);
+ __cpu_to_le32(TARGET_10X_ROAM_OFFLOAD_MAX_AP_PROFILES);
- config.num_mcast_groups = __cpu_to_le32(TARGET_NUM_MCAST_GROUPS);
+ config.num_mcast_groups = __cpu_to_le32(TARGET_10X_NUM_MCAST_GROUPS);
config.num_mcast_table_elems =
- __cpu_to_le32(TARGET_NUM_MCAST_TABLE_ELEMS);
+ __cpu_to_le32(TARGET_10X_NUM_MCAST_TABLE_ELEMS);
- config.mcast2ucast_mode = __cpu_to_le32(TARGET_MCAST2UCAST_MODE);
- config.tx_dbg_log_size = __cpu_to_le32(TARGET_TX_DBG_LOG_SIZE);
- config.num_wds_entries = __cpu_to_le32(TARGET_NUM_WDS_ENTRIES);
- config.dma_burst_size = __cpu_to_le32(TARGET_DMA_BURST_SIZE);
- config.mac_aggr_delim = __cpu_to_le32(TARGET_MAC_AGGR_DELIM);
+ config.mcast2ucast_mode = __cpu_to_le32(TARGET_10X_MCAST2UCAST_MODE);
+ config.tx_dbg_log_size = __cpu_to_le32(TARGET_10X_TX_DBG_LOG_SIZE);
+ config.num_wds_entries = __cpu_to_le32(TARGET_10X_NUM_WDS_ENTRIES);
+ config.dma_burst_size = __cpu_to_le32(TARGET_10X_DMA_BURST_SIZE);
+ config.mac_aggr_delim = __cpu_to_le32(TARGET_10X_MAC_AGGR_DELIM);
- val = TARGET_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK;
+ val = TARGET_10X_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK;
config.rx_skip_defrag_timeout_dup_detection_check = __cpu_to_le32(val);
- config.vow_config = __cpu_to_le32(TARGET_VOW_CONFIG);
+ config.vow_config = __cpu_to_le32(TARGET_10X_VOW_CONFIG);
- config.num_msdu_desc = __cpu_to_le32(TARGET_NUM_MSDU_DESC);
- config.max_frag_entries = __cpu_to_le32(TARGET_MAX_FRAG_ENTRIES);
+ config.num_msdu_desc = __cpu_to_le32(TARGET_10X_NUM_MSDU_DESC);
+ config.max_frag_entries = __cpu_to_le32(TARGET_10X_MAX_FRAG_ENTRIES);
len = sizeof(*cmd) +
(sizeof(struct host_memory_chunk) * ar->wmi.num_mem_chunks);
--
1.7.10
^ permalink raw reply related
* [PATCH v2 09/13] ath10k: split wmi_cmd_init path
From: Bartosz Markowski @ 2013-09-26 9:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Bartosz Markowski
In-Reply-To: <1380187792-25626-1-git-send-email-bartosz.markowski@tieto.com>
Due to API differences in initialization structures for
main and 10.x firmwares we need to split the wmi_init_cmd
and wmi_resource_config structures.
This will be usefull also when setting the correct TARGET values,
like: number of peers, vdevs, pdevs etc.
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
---
drivers/net/wireless/ath/ath10k/wmi.c | 105 +++++++++++++++++-
drivers/net/wireless/ath/ath10k/wmi.h | 195 +++++++++++++++++++++++++++++++++
2 files changed, 299 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 422033a..c81a8b7 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -1908,7 +1908,7 @@ int ath10k_wmi_pdev_set_param(struct ath10k *ar, enum wmi_pdev_param id,
return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_set_param_cmdid);
}
-int ath10k_wmi_cmd_init(struct ath10k *ar)
+static int ath10k_wmi_main_cmd_init(struct ath10k *ar)
{
struct wmi_init_cmd *cmd;
struct sk_buff *buf;
@@ -2007,6 +2007,109 @@ out:
return ath10k_wmi_cmd_send(ar, buf, ar->wmi.cmd->init_cmdid);
}
+static int ath10k_wmi_10x_cmd_init(struct ath10k *ar)
+{
+ struct wmi_init_cmd_10x *cmd;
+ struct sk_buff *buf;
+ struct wmi_resource_config_10x config = {};
+ u32 len, val;
+ int i;
+
+ config.num_vdevs = __cpu_to_le32(TARGET_NUM_VDEVS);
+ config.num_peers = __cpu_to_le32(TARGET_NUM_PEERS + TARGET_NUM_VDEVS);
+ config.num_peer_keys = __cpu_to_le32(TARGET_NUM_PEER_KEYS);
+ config.num_tids = __cpu_to_le32(TARGET_NUM_TIDS);
+ config.ast_skid_limit = __cpu_to_le32(TARGET_AST_SKID_LIMIT);
+ config.tx_chain_mask = __cpu_to_le32(TARGET_TX_CHAIN_MASK);
+ config.rx_chain_mask = __cpu_to_le32(TARGET_RX_CHAIN_MASK);
+ config.rx_timeout_pri_vo = __cpu_to_le32(TARGET_RX_TIMEOUT_LO_PRI);
+ config.rx_timeout_pri_vi = __cpu_to_le32(TARGET_RX_TIMEOUT_LO_PRI);
+ config.rx_timeout_pri_be = __cpu_to_le32(TARGET_RX_TIMEOUT_LO_PRI);
+ config.rx_timeout_pri_bk = __cpu_to_le32(TARGET_RX_TIMEOUT_HI_PRI);
+ config.rx_decap_mode = __cpu_to_le32(TARGET_RX_DECAP_MODE);
+
+ config.scan_max_pending_reqs =
+ __cpu_to_le32(TARGET_SCAN_MAX_PENDING_REQS);
+
+ config.bmiss_offload_max_vdev =
+ __cpu_to_le32(TARGET_BMISS_OFFLOAD_MAX_VDEV);
+
+ config.roam_offload_max_vdev =
+ __cpu_to_le32(TARGET_ROAM_OFFLOAD_MAX_VDEV);
+
+ config.roam_offload_max_ap_profiles =
+ __cpu_to_le32(TARGET_ROAM_OFFLOAD_MAX_AP_PROFILES);
+
+ config.num_mcast_groups = __cpu_to_le32(TARGET_NUM_MCAST_GROUPS);
+ config.num_mcast_table_elems =
+ __cpu_to_le32(TARGET_NUM_MCAST_TABLE_ELEMS);
+
+ config.mcast2ucast_mode = __cpu_to_le32(TARGET_MCAST2UCAST_MODE);
+ config.tx_dbg_log_size = __cpu_to_le32(TARGET_TX_DBG_LOG_SIZE);
+ config.num_wds_entries = __cpu_to_le32(TARGET_NUM_WDS_ENTRIES);
+ config.dma_burst_size = __cpu_to_le32(TARGET_DMA_BURST_SIZE);
+ config.mac_aggr_delim = __cpu_to_le32(TARGET_MAC_AGGR_DELIM);
+
+ val = TARGET_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK;
+ config.rx_skip_defrag_timeout_dup_detection_check = __cpu_to_le32(val);
+
+ config.vow_config = __cpu_to_le32(TARGET_VOW_CONFIG);
+
+ config.num_msdu_desc = __cpu_to_le32(TARGET_NUM_MSDU_DESC);
+ config.max_frag_entries = __cpu_to_le32(TARGET_MAX_FRAG_ENTRIES);
+
+ len = sizeof(*cmd) +
+ (sizeof(struct host_memory_chunk) * ar->wmi.num_mem_chunks);
+
+ buf = ath10k_wmi_alloc_skb(len);
+ if (!buf)
+ return -ENOMEM;
+
+ cmd = (struct wmi_init_cmd_10x *)buf->data;
+
+ if (ar->wmi.num_mem_chunks == 0) {
+ cmd->num_host_mem_chunks = 0;
+ goto out;
+ }
+
+ ath10k_dbg(ATH10K_DBG_WMI, "wmi sending %d memory chunks info.\n",
+ __cpu_to_le32(ar->wmi.num_mem_chunks));
+
+ cmd->num_host_mem_chunks = __cpu_to_le32(ar->wmi.num_mem_chunks);
+
+ for (i = 0; i < ar->wmi.num_mem_chunks; i++) {
+ cmd->host_mem_chunks[i].ptr =
+ __cpu_to_le32(ar->wmi.mem_chunks[i].paddr);
+ cmd->host_mem_chunks[i].size =
+ __cpu_to_le32(ar->wmi.mem_chunks[i].len);
+ cmd->host_mem_chunks[i].req_id =
+ __cpu_to_le32(ar->wmi.mem_chunks[i].req_id);
+
+ ath10k_dbg(ATH10K_DBG_WMI,
+ "wmi chunk %d len %d requested, addr 0x%x\n",
+ i,
+ cmd->host_mem_chunks[i].size,
+ cmd->host_mem_chunks[i].ptr);
+ }
+out:
+ memcpy(&cmd->resource_config, &config, sizeof(config));
+
+ ath10k_dbg(ATH10K_DBG_WMI, "wmi init 10x\n");
+ return ath10k_wmi_cmd_send(ar, buf, ar->wmi.cmd->init_cmdid);
+}
+
+int ath10k_wmi_cmd_init(struct ath10k *ar)
+{
+ int ret;
+
+ if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features))
+ ret = ath10k_wmi_10x_cmd_init(ar);
+ else
+ ret = ath10k_wmi_main_cmd_init(ar);
+
+ return ret;
+}
+
static int ath10k_wmi_start_scan_calc_len(const struct wmi_start_scan_arg *arg)
{
int len;
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 1c515d6..5383f7e 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -1377,6 +1377,189 @@ struct wmi_resource_config {
__le32 max_frag_entries;
} __packed;
+struct wmi_resource_config_10x {
+ /* number of virtual devices (VAPs) to support */
+ __le32 num_vdevs;
+
+ /* number of peer nodes to support */
+ __le32 num_peers;
+
+ /* number of keys per peer */
+ __le32 num_peer_keys;
+
+ /* total number of TX/RX data TIDs */
+ __le32 num_tids;
+
+ /*
+ * max skid for resolving hash collisions
+ *
+ * The address search table is sparse, so that if two MAC addresses
+ * result in the same hash value, the second of these conflicting
+ * entries can slide to the next index in the address search table,
+ * and use it, if it is unoccupied. This ast_skid_limit parameter
+ * specifies the upper bound on how many subsequent indices to search
+ * over to find an unoccupied space.
+ */
+ __le32 ast_skid_limit;
+
+ /*
+ * the nominal chain mask for transmit
+ *
+ * The chain mask may be modified dynamically, e.g. to operate AP
+ * tx with a reduced number of chains if no clients are associated.
+ * This configuration parameter specifies the nominal chain-mask that
+ * should be used when not operating with a reduced set of tx chains.
+ */
+ __le32 tx_chain_mask;
+
+ /*
+ * the nominal chain mask for receive
+ *
+ * The chain mask may be modified dynamically, e.g. for a client
+ * to use a reduced number of chains for receive if the traffic to
+ * the client is low enough that it doesn't require downlink MIMO
+ * or antenna diversity.
+ * This configuration parameter specifies the nominal chain-mask that
+ * should be used when not operating with a reduced set of rx chains.
+ */
+ __le32 rx_chain_mask;
+
+ /*
+ * what rx reorder timeout (ms) to use for the AC
+ *
+ * Each WMM access class (voice, video, best-effort, background) will
+ * have its own timeout value to dictate how long to wait for missing
+ * rx MPDUs to arrive before flushing subsequent MPDUs that have
+ * already been received.
+ * This parameter specifies the timeout in milliseconds for each
+ * class.
+ */
+ __le32 rx_timeout_pri_vi;
+ __le32 rx_timeout_pri_vo;
+ __le32 rx_timeout_pri_be;
+ __le32 rx_timeout_pri_bk;
+
+ /*
+ * what mode the rx should decap packets to
+ *
+ * MAC can decap to RAW (no decap), native wifi or Ethernet types
+ * THis setting also determines the default TX behavior, however TX
+ * behavior can be modified on a per VAP basis during VAP init
+ */
+ __le32 rx_decap_mode;
+
+ /* what is the maximum scan requests than can be queued */
+ __le32 scan_max_pending_reqs;
+
+ /* maximum VDEV that could use BMISS offload */
+ __le32 bmiss_offload_max_vdev;
+
+ /* maximum VDEV that could use offload roaming */
+ __le32 roam_offload_max_vdev;
+
+ /* maximum AP profiles that would push to offload roaming */
+ __le32 roam_offload_max_ap_profiles;
+
+ /*
+ * how many groups to use for mcast->ucast conversion
+ *
+ * The target's WAL maintains a table to hold information regarding
+ * which peers belong to a given multicast group, so that if
+ * multicast->unicast conversion is enabled, the target can convert
+ * multicast tx frames to a series of unicast tx frames, to each
+ * peer within the multicast group.
+ This num_mcast_groups configuration parameter tells the target how
+ * many multicast groups to provide storage for within its multicast
+ * group membership table.
+ */
+ __le32 num_mcast_groups;
+
+ /*
+ * size to alloc for the mcast membership table
+ *
+ * This num_mcast_table_elems configuration parameter tells the
+ * target how many peer elements it needs to provide storage for in
+ * its multicast group membership table.
+ * These multicast group membership table elements are shared by the
+ * multicast groups stored within the table.
+ */
+ __le32 num_mcast_table_elems;
+
+ /*
+ * whether/how to do multicast->unicast conversion
+ *
+ * This configuration parameter specifies whether the target should
+ * perform multicast --> unicast conversion on transmit, and if so,
+ * what to do if it finds no entries in its multicast group
+ * membership table for the multicast IP address in the tx frame.
+ * Configuration value:
+ * 0 -> Do not perform multicast to unicast conversion.
+ * 1 -> Convert multicast frames to unicast, if the IP multicast
+ * address from the tx frame is found in the multicast group
+ * membership table. If the IP multicast address is not found,
+ * drop the frame.
+ * 2 -> Convert multicast frames to unicast, if the IP multicast
+ * address from the tx frame is found in the multicast group
+ * membership table. If the IP multicast address is not found,
+ * transmit the frame as multicast.
+ */
+ __le32 mcast2ucast_mode;
+
+ /*
+ * how much memory to allocate for a tx PPDU dbg log
+ *
+ * This parameter controls how much memory the target will allocate
+ * to store a log of tx PPDU meta-information (how large the PPDU
+ * was, when it was sent, whether it was successful, etc.)
+ */
+ __le32 tx_dbg_log_size;
+
+ /* how many AST entries to be allocated for WDS */
+ __le32 num_wds_entries;
+
+ /*
+ * MAC DMA burst size, e.g., For target PCI limit can be
+ * 0 -default, 1 256B
+ */
+ __le32 dma_burst_size;
+
+ /*
+ * Fixed delimiters to be inserted after every MPDU to
+ * account for interface latency to avoid underrun.
+ */
+ __le32 mac_aggr_delim;
+
+ /*
+ * determine whether target is responsible for detecting duplicate
+ * non-aggregate MPDU and timing out stale fragments.
+ *
+ * A-MPDU reordering is always performed on the target.
+ *
+ * 0: target responsible for frag timeout and dup checking
+ * 1: host responsible for frag timeout and dup checking
+ */
+ __le32 rx_skip_defrag_timeout_dup_detection_check;
+
+ /*
+ * Configuration for VoW :
+ * No of Video Nodes to be supported
+ * and Max no of descriptors for each Video link (node).
+ */
+ __le32 vow_config;
+
+ /* Number of msdu descriptors target should use */
+ __le32 num_msdu_desc;
+
+ /*
+ * Max. number of Tx fragments per MSDU
+ * This parameter controls the max number of Tx fragments per MSDU.
+ * This is sent by the target as part of the WMI_SERVICE_READY event
+ * and is overriden by the OS shim as required.
+ */
+ __le32 max_frag_entries;
+} __packed;
+
+
#define NUM_UNITS_IS_NUM_VDEVS 0x1
#define NUM_UNITS_IS_NUM_PEERS 0x2
@@ -1401,6 +1584,18 @@ struct wmi_init_cmd {
struct host_memory_chunk host_mem_chunks[1];
} __packed;
+/* _10x stucture is from 10.X FW API */
+struct wmi_init_cmd_10x {
+ struct wmi_resource_config_10x resource_config;
+ __le32 num_host_mem_chunks;
+
+ /*
+ * variable number of host memory chunks.
+ * This should be the last element in the structure
+ */
+ struct host_memory_chunk host_mem_chunks[1];
+} __packed;
+
/* TLV for channel list */
struct wmi_chan_list {
__le32 tag; /* WMI_CHAN_LIST_TAG */
--
1.7.10
^ permalink raw reply related
* [PATCH v2 08/13] ath10k: bring back the WMI path for mgmt frames
From: Bartosz Markowski @ 2013-09-26 9:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Bartosz Markowski
In-Reply-To: <1380187792-25626-1-git-send-email-bartosz.markowski@tieto.com>
This is still the only way to submit mgmt frames in case
of 10.X firmware.
This patch introduces wmi_mgmt_tx queue, because of the
fact WMI command can block. This is a problem for
ath10k_tx_htt(), since it's called from atomic context.
The skb queue and worker are introduced to move the mgmt
frame handling out of .tx callback context and not block.
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
---
drivers/net/wireless/ath/ath10k/core.c | 3 ++
drivers/net/wireless/ath/ath10k/core.h | 10 ++++-
drivers/net/wireless/ath/ath10k/htt_tx.c | 4 +-
drivers/net/wireless/ath/ath10k/mac.c | 70 +++++++++++++++++++++++++-----
drivers/net/wireless/ath/ath10k/mac.h | 2 +
drivers/net/wireless/ath/ath10k/wmi.c | 51 ++++++++++++++++++++++
drivers/net/wireless/ath/ath10k/wmi.h | 1 +
7 files changed, 128 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 31860a6..bd74dac 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -520,6 +520,9 @@ struct ath10k *ath10k_core_create(void *hif_priv, struct device *dev,
INIT_WORK(&ar->offchan_tx_work, ath10k_offchan_tx_work);
skb_queue_head_init(&ar->offchan_tx_queue);
+ INIT_WORK(&ar->wmi_mgmt_tx_work, ath10k_mgmt_over_wmi_tx_work);
+ skb_queue_head_init(&ar->wmi_mgmt_tx_queue);
+
init_waitqueue_head(&ar->event_queue);
INIT_WORK(&ar->restart_work, ath10k_core_restart);
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index e2a2658..984db11 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -43,15 +43,17 @@
/* Antenna noise floor */
#define ATH10K_DEFAULT_NOISE_FLOOR -95
+#define ATH10K_MAX_NUM_MGMT_PENDING 16
+
struct ath10k;
struct ath10k_skb_cb {
dma_addr_t paddr;
bool is_mapped;
bool is_aborted;
+ u8 vdev_id;
struct {
- u8 vdev_id;
u8 tid;
bool is_offchan;
@@ -284,6 +286,9 @@ enum ath10k_fw_features {
/* firmware from 10X branch */
ATH10K_FW_FEATURE_WMI_10X = 1,
+ /* firmware support tx frame management over WMI, otherwise it's HTT */
+ ATH10K_FW_FEATURE_HAS_WMI_MGMT_TX = 2,
+
/* keep last */
ATH10K_FW_FEATURE_COUNT,
};
@@ -393,6 +398,9 @@ struct ath10k {
struct completion offchan_tx_completed;
struct sk_buff *offchan_tx_skb;
+ struct work_struct wmi_mgmt_tx_work;
+ struct sk_buff_head wmi_mgmt_tx_queue;
+
enum ath10k_state state;
struct work_struct restart_work;
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index 3b93c6a..d9335e9 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -308,7 +308,7 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
struct sk_buff *txdesc = NULL;
struct htt_cmd *cmd;
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(msdu);
- u8 vdev_id = skb_cb->htt.vdev_id;
+ u8 vdev_id = skb_cb->vdev_id;
int len = 0;
int msdu_id = -1;
int res;
@@ -384,7 +384,7 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(msdu);
struct sk_buff *txdesc = NULL;
bool use_frags;
- u8 vdev_id = ATH10K_SKB_CB(msdu)->htt.vdev_id;
+ u8 vdev_id = ATH10K_SKB_CB(msdu)->vdev_id;
u8 tid;
int prefetch_len, desc_len;
int msdu_id = -1;
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 99a9bad..cadf90d 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1489,7 +1489,7 @@ static void ath10k_tx_h_add_p2p_noa_ie(struct ath10k *ar, struct sk_buff *skb)
static void ath10k_tx_htt(struct ath10k *ar, struct sk_buff *skb)
{
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
- int ret;
+ int ret = 0;
if (ar->htt.target_version_major >= 3) {
/* Since HTT 3.0 there is no separate mgmt tx command */
@@ -1497,16 +1497,32 @@ static void ath10k_tx_htt(struct ath10k *ar, struct sk_buff *skb)
goto exit;
}
- if (ieee80211_is_mgmt(hdr->frame_control))
- ret = ath10k_htt_mgmt_tx(&ar->htt, skb);
- else if (ieee80211_is_nullfunc(hdr->frame_control))
+ if (ieee80211_is_mgmt(hdr->frame_control)) {
+ if (test_bit(ATH10K_FW_FEATURE_HAS_WMI_MGMT_TX,
+ ar->fw_features)) {
+ if (skb_queue_len(&ar->wmi_mgmt_tx_queue) >=
+ ATH10K_MAX_NUM_MGMT_PENDING) {
+ ath10k_warn("wmi mgmt_tx queue limit reached\n");
+ ret = -EBUSY;
+ goto exit;
+ }
+
+ skb_queue_tail(&ar->wmi_mgmt_tx_queue, skb);
+ ieee80211_queue_work(ar->hw, &ar->wmi_mgmt_tx_work);
+ } else {
+ ret = ath10k_htt_mgmt_tx(&ar->htt, skb);
+ }
+ } else if (!test_bit(ATH10K_FW_FEATURE_HAS_WMI_MGMT_TX,
+ ar->fw_features) &&
+ ieee80211_is_nullfunc(hdr->frame_control)) {
/* FW does not report tx status properly for NullFunc frames
* unless they are sent through mgmt tx path. mac80211 sends
- * those frames when it detects link/beacon loss and depends on
- * the tx status to be correct. */
+ * those frames when it detects link/beacon loss and depends
+ * on the tx status to be correct. */
ret = ath10k_htt_mgmt_tx(&ar->htt, skb);
- else
+ } else {
ret = ath10k_htt_tx(&ar->htt, skb);
+ }
exit:
if (ret) {
@@ -1557,7 +1573,7 @@ void ath10k_offchan_tx_work(struct work_struct *work)
hdr = (struct ieee80211_hdr *)skb->data;
peer_addr = ieee80211_get_DA(hdr);
- vdev_id = ATH10K_SKB_CB(skb)->htt.vdev_id;
+ vdev_id = ATH10K_SKB_CB(skb)->vdev_id;
spin_lock_bh(&ar->data_lock);
peer = ath10k_peer_find(ar, vdev_id, peer_addr);
@@ -1599,6 +1615,36 @@ void ath10k_offchan_tx_work(struct work_struct *work)
}
}
+void ath10k_mgmt_over_wmi_tx_purge(struct ath10k *ar)
+{
+ struct sk_buff *skb;
+
+ for (;;) {
+ skb = skb_dequeue(&ar->wmi_mgmt_tx_queue);
+ if (!skb)
+ break;
+
+ ieee80211_free_txskb(ar->hw, skb);
+ }
+}
+
+void ath10k_mgmt_over_wmi_tx_work(struct work_struct *work)
+{
+ struct ath10k *ar = container_of(work, struct ath10k, wmi_mgmt_tx_work);
+ struct sk_buff *skb;
+ int ret;
+
+ for (;;) {
+ skb = skb_dequeue(&ar->wmi_mgmt_tx_queue);
+ if (!skb)
+ break;
+
+ ret = ath10k_wmi_mgmt_tx(ar, skb);
+ if (ret)
+ ath10k_warn("wmi mgmt_tx failed (%d)\n", ret);
+ }
+}
+
/************/
/* Scanning */
/************/
@@ -1757,14 +1803,14 @@ static void ath10k_tx(struct ieee80211_hw *hw,
ath10k_tx_h_seq_no(skb);
}
+ ATH10K_SKB_CB(skb)->vdev_id = vdev_id;
ATH10K_SKB_CB(skb)->htt.is_offchan = false;
- ATH10K_SKB_CB(skb)->htt.vdev_id = vdev_id;
ATH10K_SKB_CB(skb)->htt.tid = tid;
if (info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) {
spin_lock_bh(&ar->data_lock);
ATH10K_SKB_CB(skb)->htt.is_offchan = true;
- ATH10K_SKB_CB(skb)->htt.vdev_id = ar->scan.vdev_id;
+ ATH10K_SKB_CB(skb)->vdev_id = ar->scan.vdev_id;
spin_unlock_bh(&ar->data_lock);
ath10k_dbg(ATH10K_DBG_MAC, "queued offchannel skb %p\n", skb);
@@ -1786,6 +1832,7 @@ void ath10k_halt(struct ath10k *ar)
del_timer_sync(&ar->scan.timeout);
ath10k_offchan_tx_purge(ar);
+ ath10k_mgmt_over_wmi_tx_purge(ar);
ath10k_peer_cleanup_all(ar);
ath10k_core_stop(ar);
ath10k_hif_power_down(ar);
@@ -1862,7 +1909,10 @@ static void ath10k_stop(struct ieee80211_hw *hw)
ar->state = ATH10K_STATE_OFF;
mutex_unlock(&ar->conf_mutex);
+ ath10k_mgmt_over_wmi_tx_purge(ar);
+
cancel_work_sync(&ar->offchan_tx_work);
+ cancel_work_sync(&ar->wmi_mgmt_tx_work);
cancel_work_sync(&ar->restart_work);
}
diff --git a/drivers/net/wireless/ath/ath10k/mac.h b/drivers/net/wireless/ath/ath10k/mac.h
index 6fce9bf..ba10219 100644
--- a/drivers/net/wireless/ath/ath10k/mac.h
+++ b/drivers/net/wireless/ath/ath10k/mac.h
@@ -34,6 +34,8 @@ struct ath10k_vif *ath10k_get_arvif(struct ath10k *ar, u32 vdev_id);
void ath10k_reset_scan(unsigned long ptr);
void ath10k_offchan_tx_purge(struct ath10k *ar);
void ath10k_offchan_tx_work(struct work_struct *work);
+void ath10k_mgmt_over_wmi_tx_purge(struct ath10k *ar);
+void ath10k_mgmt_over_wmi_tx_work(struct work_struct *work);
void ath10k_halt(struct ath10k *ar);
static inline struct ath10k_vif *ath10k_vif_to_arvif(struct ieee80211_vif *vif)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index b57dfb8..422033a 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -409,6 +409,57 @@ static int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb,
return ret;
}
+int ath10k_wmi_mgmt_tx(struct ath10k *ar, struct sk_buff *skb)
+{
+ int ret = 0;
+ struct wmi_mgmt_tx_cmd *cmd;
+ struct ieee80211_hdr *hdr;
+ struct sk_buff *wmi_skb;
+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+ int len;
+ u16 fc;
+
+ hdr = (struct ieee80211_hdr *)skb->data;
+ fc = le16_to_cpu(hdr->frame_control);
+
+ if (WARN_ON_ONCE(!ieee80211_is_mgmt(hdr->frame_control)))
+ return -EINVAL;
+
+ len = sizeof(cmd->hdr) + skb->len;
+ len = round_up(len, 4);
+
+ wmi_skb = ath10k_wmi_alloc_skb(len);
+ if (!wmi_skb)
+ return -ENOMEM;
+
+ cmd = (struct wmi_mgmt_tx_cmd *)wmi_skb->data;
+
+ cmd->hdr.vdev_id = __cpu_to_le32(ATH10K_SKB_CB(skb)->vdev_id);
+ cmd->hdr.tx_rate = 0;
+ cmd->hdr.tx_power = 0;
+ cmd->hdr.buf_len = __cpu_to_le32((u32)(skb->len));
+
+ memcpy(cmd->hdr.peer_macaddr.addr, ieee80211_get_DA(hdr), ETH_ALEN);
+ memcpy(cmd->buf, skb->data, skb->len);
+
+ ath10k_dbg(ATH10K_DBG_WMI, "wmi mgmt tx skb %p len %d ftype %02x stype %02x\n",
+ wmi_skb, wmi_skb->len, fc & IEEE80211_FCTL_FTYPE,
+ fc & IEEE80211_FCTL_STYPE);
+
+ /* Send the management frame buffer to the target */
+ ret = ath10k_wmi_cmd_send(ar, wmi_skb, ar->wmi.cmd->mgmt_tx_cmdid);
+ if (ret) {
+ dev_kfree_skb_any(skb);
+ return ret;
+ }
+
+ /* TODO: report tx status to mac80211 - temporary just ACK */
+ info->flags |= IEEE80211_TX_STAT_ACK;
+ ieee80211_tx_status_irqsafe(ar->hw, skb);
+
+ return ret;
+}
+
static int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb)
{
struct wmi_scan_event *event = (struct wmi_scan_event *)skb->data;
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 56339d2..1c515d6 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -3483,5 +3483,6 @@ int ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar,
int ath10k_wmi_request_stats(struct ath10k *ar, enum wmi_stats_id stats_id);
int ath10k_wmi_force_fw_hang(struct ath10k *ar,
enum wmi_force_fw_hang_type type, u32 delay_ms);
+int ath10k_wmi_mgmt_tx(struct ath10k *ar, struct sk_buff *skb);
#endif /* _WMI_H_ */
--
1.7.10
^ permalink raw reply related
* [PATCH v2 06/13] ath10k: drop the fw versioning sanity check
From: Bartosz Markowski @ 2013-09-26 9:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Bartosz Markowski
In-Reply-To: <1380187792-25626-1-git-send-email-bartosz.markowski@tieto.com>
It was corrupted and leading to compilation warning
core.c: In function 'ath10k_check_fw_version':
core.c:79: warning: comparison is always true due to limited range of data type
Since we are going to support new FW track in the driver,
the sanity check for fw version number would be an overkill
then. This is just for information purposes anyway.
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
---
drivers/net/wireless/ath/ath10k/core.c | 25 -------------------------
drivers/net/wireless/ath/ath10k/hw.h | 6 ------
2 files changed, 31 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 76906d5..31860a6 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -59,27 +59,6 @@ static void ath10k_send_suspend_complete(struct ath10k *ar)
wake_up(&ar->event_queue);
}
-static int ath10k_check_fw_version(struct ath10k *ar)
-{
- char version[32];
-
- if (ar->fw_version_major >= SUPPORTED_FW_MAJOR &&
- ar->fw_version_minor >= SUPPORTED_FW_MINOR &&
- ar->fw_version_release >= SUPPORTED_FW_RELEASE &&
- ar->fw_version_build >= SUPPORTED_FW_BUILD)
- return 0;
-
- snprintf(version, sizeof(version), "%u.%u.%u.%u",
- SUPPORTED_FW_MAJOR, SUPPORTED_FW_MINOR,
- SUPPORTED_FW_RELEASE, SUPPORTED_FW_BUILD);
-
- ath10k_warn("WARNING: Firmware version %s is not officially supported.\n",
- ar->hw->wiphy->fw_version);
- ath10k_warn("Please upgrade to version %s (or newer)\n", version);
-
- return 0;
-}
-
static int ath10k_init_connect_htc(struct ath10k *ar)
{
int status;
@@ -616,10 +595,6 @@ int ath10k_core_start(struct ath10k *ar)
ath10k_info("firmware %s booted\n", ar->hw->wiphy->fw_version);
- status = ath10k_check_fw_version(ar);
- if (status)
- goto err_disconnect_htc;
-
status = ath10k_wmi_cmd_init(ar);
if (status) {
ath10k_err("could not send WMI init command (%d)\n", status);
diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
index 8c1be768..66e721a 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -20,12 +20,6 @@
#include "targaddrs.h"
-/* Supported FW version */
-#define SUPPORTED_FW_MAJOR 1
-#define SUPPORTED_FW_MINOR 0
-#define SUPPORTED_FW_RELEASE 0
-#define SUPPORTED_FW_BUILD 636
-
/* QCA988X 1.0 definitions (unsupported) */
#define QCA988X_HW_1_0_CHIP_ID_REV 0x0
--
1.7.10
^ permalink raw reply related
* [PATCH v2 07/13] ath10k: implement host memory chunks
From: Bartosz Markowski @ 2013-09-26 9:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Bartosz Markowski
In-Reply-To: <1380187792-25626-1-git-send-email-bartosz.markowski@tieto.com>
10.X firmware can request a memory pool from host to offload
it's own resources. This is a feature designed especially
for AP mode where the target has to deal with large number
of peers.
So we allocate and map a consistent DMA memory which FW can
use to store e.g. peer rate contol maps.
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
---
drivers/net/wireless/ath/ath10k/core.h | 12 +++
drivers/net/wireless/ath/ath10k/wmi.c | 126 ++++++++++++++++++++++++++++++--
drivers/net/wireless/ath/ath10k/wmi.h | 3 +
3 files changed, 133 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index acfee7c..e2a2658 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -102,12 +102,24 @@ struct ath10k_bmi {
bool done_sent;
};
+#define ATH10K_MAX_MEM_REQS 16
+
+struct ath10k_mem_chunk {
+ void *vaddr;
+ dma_addr_t paddr;
+ u32 len;
+ u32 req_id;
+};
+
struct ath10k_wmi {
enum ath10k_htc_ep_id eid;
struct completion service_ready;
struct completion unified_ready;
wait_queue_head_t tx_credits_wq;
struct wmi_cmd_map *cmd;
+
+ u32 num_mem_chunks;
+ struct ath10k_mem_chunk mem_chunks[ATH10K_MAX_MEM_REQS];
};
struct ath10k_peer_stat {
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 8f4d0f6..b57dfb8 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -1229,6 +1229,37 @@ static void ath10k_wmi_event_vdev_resume_req(struct ath10k *ar,
ath10k_dbg(ATH10K_DBG_WMI, "WMI_VDEV_RESUME_REQ_EVENTID\n");
}
+static int ath10k_wmi_alloc_host_mem(struct ath10k *ar, u32 req_id,
+ u32 num_units, u32 unit_len)
+{
+ dma_addr_t paddr;
+ u32 pool_size;
+ int idx = ar->wmi.num_mem_chunks;
+
+ pool_size = num_units * round_up(unit_len, 4);
+
+ if (!pool_size)
+ return -EINVAL;
+
+ ar->wmi.mem_chunks[idx].vaddr = dma_alloc_coherent(ar->dev,
+ pool_size,
+ &paddr,
+ GFP_ATOMIC);
+ if (!ar->wmi.mem_chunks[idx].vaddr) {
+ ath10k_warn("failed to allocate memory chunk\n");
+ return -ENOMEM;
+ }
+
+ memset(ar->wmi.mem_chunks[idx].vaddr, 0, pool_size);
+
+ ar->wmi.mem_chunks[idx].paddr = paddr;
+ ar->wmi.mem_chunks[idx].len = pool_size;
+ ar->wmi.mem_chunks[idx].req_id = req_id;
+ ar->wmi.num_mem_chunks++;
+
+ return 0;
+}
+
static void ath10k_wmi_service_ready_event_rx(struct ath10k *ar,
struct sk_buff *skb)
{
@@ -1303,6 +1334,8 @@ static void ath10k_wmi_service_ready_event_rx(struct ath10k *ar,
static void ath10k_wmi_10x_service_ready_event_rx(struct ath10k *ar,
struct sk_buff *skb)
{
+ u32 num_units, req_id, unit_size, num_mem_reqs, num_unit_info, i;
+ int ret;
struct wmi_service_ready_event_10x *ev = (void *)skb->data;
if (skb->len < sizeof(*ev)) {
@@ -1341,13 +1374,50 @@ static void ath10k_wmi_10x_service_ready_event_rx(struct ath10k *ar,
ar->fw_version_minor);
}
- /* FIXME: it probably should be better to support this.
- TODO: Next patch introduce memory chunks. It's a must for 10.x FW */
- if (__le32_to_cpu(ev->num_mem_reqs) > 0) {
- ath10k_warn("target requested %d memory chunks; ignoring\n",
- __le32_to_cpu(ev->num_mem_reqs));
+ num_mem_reqs = __le32_to_cpu(ev->num_mem_reqs);
+
+ if (num_mem_reqs > ATH10K_MAX_MEM_REQS) {
+ ath10k_warn("requested memory chunks number (%d) exceeds the limit\n",
+ num_mem_reqs);
+ return;
}
+ if (!num_mem_reqs)
+ goto exit;
+
+ ath10k_dbg(ATH10K_DBG_WMI, "firmware has requested %d memory chunks\n",
+ num_mem_reqs);
+
+ for (i = 0; i < num_mem_reqs; ++i) {
+ req_id = __le32_to_cpu(ev->mem_reqs[i].req_id);
+ num_units = __le32_to_cpu(ev->mem_reqs[i].num_units);
+ unit_size = __le32_to_cpu(ev->mem_reqs[i].unit_size);
+ num_unit_info = __le32_to_cpu(ev->mem_reqs[i].num_unit_info);
+
+ if (num_unit_info & NUM_UNITS_IS_NUM_PEERS)
+ /* number of units to allocate is number of
+ * peers, 1 extra for self peer on target */
+ /* this needs to be tied, host and target
+ * can get out of sync */
+ num_units = TARGET_NUM_PEERS + 1;
+ else if (num_unit_info & NUM_UNITS_IS_NUM_VDEVS)
+ num_units = TARGET_NUM_VDEVS + 1;
+
+ ath10k_dbg(ATH10K_DBG_WMI,
+ "wmi mem_req_id %d num_units %d num_unit_info %d unit size %d actual units %d\n",
+ req_id,
+ __le32_to_cpu(ev->mem_reqs[i].num_units),
+ num_unit_info,
+ unit_size,
+ num_units);
+
+ ret = ath10k_wmi_alloc_host_mem(ar, req_id, num_units,
+ unit_size);
+ if (ret)
+ return;
+ }
+
+exit:
ath10k_dbg(ATH10K_DBG_WMI,
"wmi event service ready sw_ver 0x%08x abi_ver %u phy_cap 0x%08x ht_cap 0x%08x vht_cap 0x%08x vht_supp_msc 0x%08x sys_cap_info 0x%08x mem_reqs %u num_rf_chains %u\n",
__le32_to_cpu(ev->sw_version),
@@ -1645,6 +1715,17 @@ int ath10k_wmi_attach(struct ath10k *ar)
void ath10k_wmi_detach(struct ath10k *ar)
{
+ int i;
+
+ /* free the host memory chunks requested by firmware */
+ for (i = 0; i < ar->wmi.num_mem_chunks; i++) {
+ dma_free_coherent(ar->dev,
+ ar->wmi.mem_chunks[i].len,
+ ar->wmi.mem_chunks[i].vaddr,
+ ar->wmi.mem_chunks[i].paddr);
+ }
+
+ ar->wmi.num_mem_chunks = 0;
}
int ath10k_wmi_connect_htc_service(struct ath10k *ar)
@@ -1781,7 +1862,8 @@ int ath10k_wmi_cmd_init(struct ath10k *ar)
struct wmi_init_cmd *cmd;
struct sk_buff *buf;
struct wmi_resource_config config = {};
- u32 val;
+ u32 len, val;
+ int i;
config.num_vdevs = __cpu_to_le32(TARGET_NUM_VDEVS);
config.num_peers = __cpu_to_le32(TARGET_NUM_PEERS + TARGET_NUM_VDEVS);
@@ -1834,12 +1916,40 @@ int ath10k_wmi_cmd_init(struct ath10k *ar)
config.num_msdu_desc = __cpu_to_le32(TARGET_NUM_MSDU_DESC);
config.max_frag_entries = __cpu_to_le32(TARGET_MAX_FRAG_ENTRIES);
- buf = ath10k_wmi_alloc_skb(sizeof(*cmd));
+ len = sizeof(*cmd) +
+ (sizeof(struct host_memory_chunk) * ar->wmi.num_mem_chunks);
+
+ buf = ath10k_wmi_alloc_skb(len);
if (!buf)
return -ENOMEM;
cmd = (struct wmi_init_cmd *)buf->data;
- cmd->num_host_mem_chunks = 0;
+
+ if (ar->wmi.num_mem_chunks == 0) {
+ cmd->num_host_mem_chunks = 0;
+ goto out;
+ }
+
+ ath10k_dbg(ATH10K_DBG_WMI, "wmi sending %d memory chunks info.\n",
+ __cpu_to_le32(ar->wmi.num_mem_chunks));
+
+ cmd->num_host_mem_chunks = __cpu_to_le32(ar->wmi.num_mem_chunks);
+
+ for (i = 0; i < ar->wmi.num_mem_chunks; i++) {
+ cmd->host_mem_chunks[i].ptr =
+ __cpu_to_le32(ar->wmi.mem_chunks[i].paddr);
+ cmd->host_mem_chunks[i].size =
+ __cpu_to_le32(ar->wmi.mem_chunks[i].len);
+ cmd->host_mem_chunks[i].req_id =
+ __cpu_to_le32(ar->wmi.mem_chunks[i].req_id);
+
+ ath10k_dbg(ATH10K_DBG_WMI,
+ "wmi chunk %d len %d requested, addr 0x%x\n",
+ i,
+ cmd->host_mem_chunks[i].size,
+ cmd->host_mem_chunks[i].ptr);
+ }
+out:
memcpy(&cmd->resource_config, &config, sizeof(config));
ath10k_dbg(ATH10K_DBG_WMI, "wmi init\n");
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index a0cfdfd..56339d2 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -1377,6 +1377,9 @@ struct wmi_resource_config {
__le32 max_frag_entries;
} __packed;
+#define NUM_UNITS_IS_NUM_VDEVS 0x1
+#define NUM_UNITS_IS_NUM_PEERS 0x2
+
/* strucutre describing host memory chunk. */
struct host_memory_chunk {
/* id of the request that is passed up in service ready */
--
1.7.10
^ permalink raw reply related
* [PATCH v2 04/13] ath10k: implement WMI events handling frame for both firmwares
From: Bartosz Markowski @ 2013-09-26 9:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Bartosz Markowski
In-Reply-To: <1380187792-25626-1-git-send-email-bartosz.markowski@tieto.com>
We still use the same function handlers for both main and 10.X
paths. Next step is to track down and make the split needed.
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
---
drivers/net/wireless/ath/ath10k/wmi.c | 131 ++++++++++++++++++++++++++++++++-
1 file changed, 130 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index fe55360..2a7de6d 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -1211,6 +1211,24 @@ static void ath10k_wmi_event_vdev_install_key_complete(struct ath10k *ar,
ath10k_dbg(ATH10K_DBG_WMI, "WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID\n");
}
+static void ath10k_wmi_event_inst_rssi_stats(struct ath10k *ar,
+ struct sk_buff *skb)
+{
+ ath10k_dbg(ATH10K_DBG_WMI, "WMI_INST_RSSI_STATS_EVENTID\n");
+}
+
+static void ath10k_wmi_event_vdev_standby_req(struct ath10k *ar,
+ struct sk_buff *skb)
+{
+ ath10k_dbg(ATH10K_DBG_WMI, "WMI_VDEV_STANDBY_REQ_EVENTID\n");
+}
+
+static void ath10k_wmi_event_vdev_resume_req(struct ath10k *ar,
+ struct sk_buff *skb)
+{
+ ath10k_dbg(ATH10K_DBG_WMI, "WMI_VDEV_RESUME_REQ_EVENTID\n");
+}
+
static void ath10k_wmi_service_ready_event_rx(struct ath10k *ar,
struct sk_buff *skb)
{
@@ -1421,10 +1439,121 @@ static void ath10k_wmi_main_process_rx(struct ath10k *ar, struct sk_buff *skb)
dev_kfree_skb(skb);
}
+static void ath10k_wmi_10x_process_rx(struct ath10k *ar, struct sk_buff *skb)
+{
+ struct wmi_cmd_hdr *cmd_hdr;
+ enum wmi_10x_event_id id;
+ u16 len;
+
+ cmd_hdr = (struct wmi_cmd_hdr *)skb->data;
+ id = MS(__le32_to_cpu(cmd_hdr->cmd_id), WMI_CMD_HDR_CMD_ID);
+
+ if (skb_pull(skb, sizeof(struct wmi_cmd_hdr)) == NULL)
+ return;
+
+ len = skb->len;
+
+ trace_ath10k_wmi_event(id, skb->data, skb->len);
+
+ switch (id) {
+ case WMI_10X_MGMT_RX_EVENTID:
+ ath10k_wmi_event_mgmt_rx(ar, skb);
+ /* mgmt_rx() owns the skb now! */
+ return;
+ case WMI_10X_SCAN_EVENTID:
+ ath10k_wmi_event_scan(ar, skb);
+ break;
+ case WMI_10X_CHAN_INFO_EVENTID:
+ ath10k_wmi_event_chan_info(ar, skb);
+ break;
+ case WMI_10X_ECHO_EVENTID:
+ ath10k_wmi_event_echo(ar, skb);
+ break;
+ case WMI_10X_DEBUG_MESG_EVENTID:
+ ath10k_wmi_event_debug_mesg(ar, skb);
+ break;
+ case WMI_10X_UPDATE_STATS_EVENTID:
+ ath10k_wmi_event_update_stats(ar, skb);
+ break;
+ case WMI_10X_VDEV_START_RESP_EVENTID:
+ ath10k_wmi_event_vdev_start_resp(ar, skb);
+ break;
+ case WMI_10X_VDEV_STOPPED_EVENTID:
+ ath10k_wmi_event_vdev_stopped(ar, skb);
+ break;
+ case WMI_10X_PEER_STA_KICKOUT_EVENTID:
+ ath10k_wmi_event_peer_sta_kickout(ar, skb);
+ break;
+ case WMI_10X_HOST_SWBA_EVENTID:
+ ath10k_wmi_event_host_swba(ar, skb);
+ break;
+ case WMI_10X_TBTTOFFSET_UPDATE_EVENTID:
+ ath10k_wmi_event_tbttoffset_update(ar, skb);
+ break;
+ case WMI_10X_PHYERR_EVENTID:
+ ath10k_wmi_event_phyerr(ar, skb);
+ break;
+ case WMI_10X_ROAM_EVENTID:
+ ath10k_wmi_event_roam(ar, skb);
+ break;
+ case WMI_10X_PROFILE_MATCH:
+ ath10k_wmi_event_profile_match(ar, skb);
+ break;
+ case WMI_10X_DEBUG_PRINT_EVENTID:
+ ath10k_wmi_event_debug_print(ar, skb);
+ break;
+ case WMI_10X_PDEV_QVIT_EVENTID:
+ ath10k_wmi_event_pdev_qvit(ar, skb);
+ break;
+ case WMI_10X_WLAN_PROFILE_DATA_EVENTID:
+ ath10k_wmi_event_wlan_profile_data(ar, skb);
+ break;
+ case WMI_10X_RTT_MEASUREMENT_REPORT_EVENTID:
+ ath10k_wmi_event_rtt_measurement_report(ar, skb);
+ break;
+ case WMI_10X_TSF_MEASUREMENT_REPORT_EVENTID:
+ ath10k_wmi_event_tsf_measurement_report(ar, skb);
+ break;
+ case WMI_10X_RTT_ERROR_REPORT_EVENTID:
+ ath10k_wmi_event_rtt_error_report(ar, skb);
+ break;
+ case WMI_10X_WOW_WAKEUP_HOST_EVENTID:
+ ath10k_wmi_event_wow_wakeup_host(ar, skb);
+ break;
+ case WMI_10X_DCS_INTERFERENCE_EVENTID:
+ ath10k_wmi_event_dcs_interference(ar, skb);
+ break;
+ case WMI_10X_PDEV_TPC_CONFIG_EVENTID:
+ ath10k_wmi_event_pdev_tpc_config(ar, skb);
+ break;
+ case WMI_10X_INST_RSSI_STATS_EVENTID:
+ ath10k_wmi_event_inst_rssi_stats(ar, skb);
+ break;
+ case WMI_10X_VDEV_STANDBY_REQ_EVENTID:
+ ath10k_wmi_event_vdev_standby_req(ar, skb);
+ break;
+ case WMI_10X_VDEV_RESUME_REQ_EVENTID:
+ ath10k_wmi_event_vdev_resume_req(ar, skb);
+ break;
+ case WMI_10X_SERVICE_READY_EVENTID:
+ ath10k_wmi_service_ready_event_rx(ar, skb);
+ break;
+ case WMI_10X_READY_EVENTID:
+ ath10k_wmi_ready_event_rx(ar, skb);
+ break;
+ default:
+ ath10k_warn("Unknown eventid: %d\n", id);
+ break;
+ }
+
+ dev_kfree_skb(skb);
+}
+
+
static void ath10k_wmi_process_rx(struct ath10k *ar, struct sk_buff *skb)
{
if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features))
- ath10k_warn("Firmware 10.X is not yet supported\n");
+ ath10k_wmi_10x_process_rx(ar, skb);
else
ath10k_wmi_main_process_rx(ar, skb);
}
--
1.7.10
^ permalink raw reply related
* [PATCH v2 05/13] ath10k: split ath10k_wmi_service_ready_event_rx
From: Bartosz Markowski @ 2013-09-26 9:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Bartosz Markowski
In-Reply-To: <1380187792-25626-1-git-send-email-bartosz.markowski@tieto.com>
Since the both firmwares we are going to support,
have significantly different APIs (WMI and shared
structures), it's easier to actually split the whole
event handling functions, instead cutting them inside.
The fork starts now on ath10k_wmi_process_rx().
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
---
drivers/net/wireless/ath/ath10k/wmi.c | 66 ++++++++++++++++++++++++++++++++-
drivers/net/wireless/ath/ath10k/wmi.h | 40 ++++++++++++++++++++
2 files changed, 105 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 2a7de6d..8f4d0f6 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -1300,6 +1300,70 @@ static void ath10k_wmi_service_ready_event_rx(struct ath10k *ar,
complete(&ar->wmi.service_ready);
}
+static void ath10k_wmi_10x_service_ready_event_rx(struct ath10k *ar,
+ struct sk_buff *skb)
+{
+ struct wmi_service_ready_event_10x *ev = (void *)skb->data;
+
+ if (skb->len < sizeof(*ev)) {
+ ath10k_warn("Service ready event was %d B but expected %zu B. Wrong firmware version?\n",
+ skb->len, sizeof(*ev));
+ return;
+ }
+
+ ar->hw_min_tx_power = __le32_to_cpu(ev->hw_min_tx_power);
+ ar->hw_max_tx_power = __le32_to_cpu(ev->hw_max_tx_power);
+ ar->ht_cap_info = __le32_to_cpu(ev->ht_cap_info);
+ ar->vht_cap_info = __le32_to_cpu(ev->vht_cap_info);
+ ar->fw_version_major =
+ (__le32_to_cpu(ev->sw_version) & 0xff000000) >> 24;
+ ar->fw_version_minor = (__le32_to_cpu(ev->sw_version) & 0x00ffffff);
+ ar->phy_capability = __le32_to_cpu(ev->phy_capability);
+ ar->num_rf_chains = __le32_to_cpu(ev->num_rf_chains);
+
+ if (ar->num_rf_chains > WMI_MAX_SPATIAL_STREAM) {
+ ath10k_warn("hardware advertises support for more spatial streams than it should (%d > %d)\n",
+ ar->num_rf_chains, WMI_MAX_SPATIAL_STREAM);
+ ar->num_rf_chains = WMI_MAX_SPATIAL_STREAM;
+ }
+
+ ar->ath_common.regulatory.current_rd =
+ __le32_to_cpu(ev->hal_reg_capabilities.eeprom_rd);
+
+ ath10k_debug_read_service_map(ar, ev->wmi_service_bitmap,
+ sizeof(ev->wmi_service_bitmap));
+
+ if (strlen(ar->hw->wiphy->fw_version) == 0) {
+ snprintf(ar->hw->wiphy->fw_version,
+ sizeof(ar->hw->wiphy->fw_version),
+ "%u.%u",
+ ar->fw_version_major,
+ ar->fw_version_minor);
+ }
+
+ /* FIXME: it probably should be better to support this.
+ TODO: Next patch introduce memory chunks. It's a must for 10.x FW */
+ if (__le32_to_cpu(ev->num_mem_reqs) > 0) {
+ ath10k_warn("target requested %d memory chunks; ignoring\n",
+ __le32_to_cpu(ev->num_mem_reqs));
+ }
+
+ ath10k_dbg(ATH10K_DBG_WMI,
+ "wmi event service ready sw_ver 0x%08x abi_ver %u phy_cap 0x%08x ht_cap 0x%08x vht_cap 0x%08x vht_supp_msc 0x%08x sys_cap_info 0x%08x mem_reqs %u num_rf_chains %u\n",
+ __le32_to_cpu(ev->sw_version),
+ __le32_to_cpu(ev->abi_version),
+ __le32_to_cpu(ev->phy_capability),
+ __le32_to_cpu(ev->ht_cap_info),
+ __le32_to_cpu(ev->vht_cap_info),
+ __le32_to_cpu(ev->vht_supp_mcs),
+ __le32_to_cpu(ev->sys_cap_info),
+ __le32_to_cpu(ev->num_mem_reqs),
+ __le32_to_cpu(ev->num_rf_chains));
+
+ complete(&ar->wmi.service_ready);
+}
+
+
static int ath10k_wmi_ready_event_rx(struct ath10k *ar, struct sk_buff *skb)
{
struct wmi_ready_event *ev = (struct wmi_ready_event *)skb->data;
@@ -1536,7 +1600,7 @@ static void ath10k_wmi_10x_process_rx(struct ath10k *ar, struct sk_buff *skb)
ath10k_wmi_event_vdev_resume_req(ar, skb);
break;
case WMI_10X_SERVICE_READY_EVENTID:
- ath10k_wmi_service_ready_event_rx(ar, skb);
+ ath10k_wmi_10x_service_ready_event_rx(ar, skb);
break;
case WMI_10X_READY_EVENTID:
ath10k_wmi_ready_event_rx(ar, skb);
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index d8414ab..a0cfdfd 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -1130,6 +1130,46 @@ struct wmi_service_ready_event {
struct wlan_host_mem_req mem_reqs[1];
} __packed;
+/* This is the definition from 10.X firmware branch */
+struct wmi_service_ready_event_10x {
+ __le32 sw_version;
+ __le32 abi_version;
+
+ /* WMI_PHY_CAPABILITY */
+ __le32 phy_capability;
+
+ /* Maximum number of frag table entries that SW will populate less 1 */
+ __le32 max_frag_entry;
+ __le32 wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
+ __le32 num_rf_chains;
+
+ /*
+ * The following field is only valid for service type
+ * WMI_SERVICE_11AC
+ */
+ __le32 ht_cap_info; /* WMI HT Capability */
+ __le32 vht_cap_info; /* VHT capability info field of 802.11ac */
+ __le32 vht_supp_mcs; /* VHT Supported MCS Set field Rx/Tx same */
+ __le32 hw_min_tx_power;
+ __le32 hw_max_tx_power;
+
+ struct hal_reg_capabilities hal_reg_capabilities;
+
+ __le32 sys_cap_info;
+ __le32 min_pkt_size_enable; /* Enterprise mode short pkt enable */
+
+ /*
+ * request to host to allocate a chuck of memory and pss it down to FW
+ * via WM_INIT. FW uses this as FW extesnsion memory for saving its
+ * data structures. Only valid for low latency interfaces like PCIE
+ * where FW can access this memory directly (or) by DMA.
+ */
+ __le32 num_mem_reqs;
+
+ struct wlan_host_mem_req mem_reqs[1];
+} __packed;
+
+
#define WMI_SERVICE_READY_TIMEOUT_HZ (5*HZ)
#define WMI_UNIFIED_READY_TIMEOUT_HZ (5*HZ)
--
1.7.10
^ permalink raw reply related
* [PATCH v2 03/13] ath10k: warn if give WMI command is not supported
From: Bartosz Markowski @ 2013-09-26 9:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Bartosz Markowski
In-Reply-To: <1380187792-25626-1-git-send-email-bartosz.markowski@tieto.com>
This will show and make it easier to track the API
differences in the new AP firmware.
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
---
drivers/net/wireless/ath/ath10k/wmi.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index cfb2082..fe55360 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -390,6 +390,11 @@ static int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb,
{
int ret = -EINVAL;
+ if (cmd_id == WMI_CMD_UNDEFINED) {
+ ath10k_warn("command not supported by given firmware\n");
+ return ret;
+ }
+
wait_event_timeout(ar->wmi.tx_credits_wq, ({
/* try to send pending beacons first. they take priority */
ath10k_wmi_tx_beacons_nowait(ar);
--
1.7.10
^ permalink raw reply related
* [PATCH v2 02/13] ath10k: add wmi_10x_<cmd/event> definitions
From: Bartosz Markowski @ 2013-09-26 9:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Bartosz Markowski
In-Reply-To: <1380187792-25626-1-git-send-email-bartosz.markowski@tieto.com>
Introduce the cmd and events definitions for 10.X FW API
and make up the wmi_10x_cmd_map. This is the core of
host-firmware WMI interface for 10.X FW branch.
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
---
drivers/net/wireless/ath/ath10k/wmi.c | 126 ++++++++++++++++++-
drivers/net/wireless/ath/ath10k/wmi.h | 215 ++++++++++++++++++++++++++++++++-
2 files changed, 338 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 1296dbe..cfb2082 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -143,7 +143,127 @@ static struct wmi_cmd_map wmi_cmd_map = {
.gpio_output_cmdid = WMI_GPIO_OUTPUT_CMDID,
};
-/* TODO: 10.X WMI cmd track */
+/* 10.X WMI cmd track */
+static struct wmi_cmd_map wmi_10x_cmd_map = {
+ .init_cmdid = WMI_10X_INIT_CMDID,
+ .start_scan_cmdid = WMI_10X_START_SCAN_CMDID,
+ .stop_scan_cmdid = WMI_10X_STOP_SCAN_CMDID,
+ .scan_chan_list_cmdid = WMI_10X_SCAN_CHAN_LIST_CMDID,
+ .scan_sch_prio_tbl_cmdid = WMI_CMD_UNDEFINED,
+ .pdev_set_regdomain_cmdid = WMI_10X_PDEV_SET_REGDOMAIN_CMDID,
+ .pdev_set_channel_cmdid = WMI_10X_PDEV_SET_CHANNEL_CMDID,
+ .pdev_set_param_cmdid = WMI_10X_PDEV_SET_PARAM_CMDID,
+ .pdev_pktlog_enable_cmdid = WMI_10X_PDEV_PKTLOG_ENABLE_CMDID,
+ .pdev_pktlog_disable_cmdid = WMI_10X_PDEV_PKTLOG_DISABLE_CMDID,
+ .pdev_set_wmm_params_cmdid = WMI_10X_PDEV_SET_WMM_PARAMS_CMDID,
+ .pdev_set_ht_cap_ie_cmdid = WMI_10X_PDEV_SET_HT_CAP_IE_CMDID,
+ .pdev_set_vht_cap_ie_cmdid = WMI_10X_PDEV_SET_VHT_CAP_IE_CMDID,
+ .pdev_set_dscp_tid_map_cmdid = WMI_10X_PDEV_SET_DSCP_TID_MAP_CMDID,
+ .pdev_set_quiet_mode_cmdid = WMI_10X_PDEV_SET_QUIET_MODE_CMDID,
+ .pdev_green_ap_ps_enable_cmdid = WMI_10X_PDEV_GREEN_AP_PS_ENABLE_CMDID,
+ .pdev_get_tpc_config_cmdid = WMI_10X_PDEV_GET_TPC_CONFIG_CMDID,
+ .pdev_set_base_macaddr_cmdid = WMI_10X_PDEV_SET_BASE_MACADDR_CMDID,
+ .vdev_create_cmdid = WMI_10X_VDEV_CREATE_CMDID,
+ .vdev_delete_cmdid = WMI_10X_VDEV_DELETE_CMDID,
+ .vdev_start_request_cmdid = WMI_10X_VDEV_START_REQUEST_CMDID,
+ .vdev_restart_request_cmdid = WMI_10X_VDEV_RESTART_REQUEST_CMDID,
+ .vdev_up_cmdid = WMI_10X_VDEV_UP_CMDID,
+ .vdev_stop_cmdid = WMI_10X_VDEV_STOP_CMDID,
+ .vdev_down_cmdid = WMI_10X_VDEV_DOWN_CMDID,
+ .vdev_set_param_cmdid = WMI_10X_VDEV_SET_PARAM_CMDID,
+ .vdev_install_key_cmdid = WMI_10X_VDEV_INSTALL_KEY_CMDID,
+ .peer_create_cmdid = WMI_10X_PEER_CREATE_CMDID,
+ .peer_delete_cmdid = WMI_10X_PEER_DELETE_CMDID,
+ .peer_flush_tids_cmdid = WMI_10X_PEER_FLUSH_TIDS_CMDID,
+ .peer_set_param_cmdid = WMI_10X_PEER_SET_PARAM_CMDID,
+ .peer_assoc_cmdid = WMI_10X_PEER_ASSOC_CMDID,
+ .peer_add_wds_entry_cmdid = WMI_10X_PEER_ADD_WDS_ENTRY_CMDID,
+ .peer_remove_wds_entry_cmdid = WMI_10X_PEER_REMOVE_WDS_ENTRY_CMDID,
+ .peer_mcast_group_cmdid = WMI_10X_PEER_MCAST_GROUP_CMDID,
+ .bcn_tx_cmdid = WMI_10X_BCN_TX_CMDID,
+ .pdev_send_bcn_cmdid = WMI_10X_PDEV_SEND_BCN_CMDID,
+ .bcn_tmpl_cmdid = WMI_CMD_UNDEFINED,
+ .bcn_filter_rx_cmdid = WMI_10X_BCN_FILTER_RX_CMDID,
+ .prb_req_filter_rx_cmdid = WMI_10X_PRB_REQ_FILTER_RX_CMDID,
+ .mgmt_tx_cmdid = WMI_10X_MGMT_TX_CMDID,
+ .prb_tmpl_cmdid = WMI_CMD_UNDEFINED,
+ .addba_clear_resp_cmdid = WMI_10X_ADDBA_CLEAR_RESP_CMDID,
+ .addba_send_cmdid = WMI_10X_ADDBA_SEND_CMDID,
+ .addba_status_cmdid = WMI_10X_ADDBA_STATUS_CMDID,
+ .delba_send_cmdid = WMI_10X_DELBA_SEND_CMDID,
+ .addba_set_resp_cmdid = WMI_10X_ADDBA_SET_RESP_CMDID,
+ .send_singleamsdu_cmdid = WMI_10X_SEND_SINGLEAMSDU_CMDID,
+ .sta_powersave_mode_cmdid = WMI_10X_STA_POWERSAVE_MODE_CMDID,
+ .sta_powersave_param_cmdid = WMI_10X_STA_POWERSAVE_PARAM_CMDID,
+ .sta_mimo_ps_mode_cmdid = WMI_10X_STA_MIMO_PS_MODE_CMDID,
+ .pdev_dfs_enable_cmdid = WMI_10X_PDEV_DFS_ENABLE_CMDID,
+ .pdev_dfs_disable_cmdid = WMI_10X_PDEV_DFS_DISABLE_CMDID,
+ .roam_scan_mode = WMI_10X_ROAM_SCAN_MODE,
+ .roam_scan_rssi_threshold = WMI_10X_ROAM_SCAN_RSSI_THRESHOLD,
+ .roam_scan_period = WMI_10X_ROAM_SCAN_PERIOD,
+ .roam_scan_rssi_change_threshold =
+ WMI_10X_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
+ .roam_ap_profile = WMI_10X_ROAM_AP_PROFILE,
+ .ofl_scan_add_ap_profile = WMI_10X_OFL_SCAN_ADD_AP_PROFILE,
+ .ofl_scan_remove_ap_profile = WMI_10X_OFL_SCAN_REMOVE_AP_PROFILE,
+ .ofl_scan_period = WMI_10X_OFL_SCAN_PERIOD,
+ .p2p_dev_set_device_info = WMI_10X_P2P_DEV_SET_DEVICE_INFO,
+ .p2p_dev_set_discoverability = WMI_10X_P2P_DEV_SET_DISCOVERABILITY,
+ .p2p_go_set_beacon_ie = WMI_10X_P2P_GO_SET_BEACON_IE,
+ .p2p_go_set_probe_resp_ie = WMI_10X_P2P_GO_SET_PROBE_RESP_IE,
+ .p2p_set_vendor_ie_data_cmdid = WMI_CMD_UNDEFINED,
+ .ap_ps_peer_param_cmdid = WMI_CMD_UNDEFINED,
+ .ap_ps_peer_uapsd_coex_cmdid = WMI_CMD_UNDEFINED,
+ .peer_rate_retry_sched_cmdid = WMI_10X_PEER_RATE_RETRY_SCHED_CMDID,
+ .wlan_profile_trigger_cmdid = WMI_10X_WLAN_PROFILE_TRIGGER_CMDID,
+ .wlan_profile_set_hist_intvl_cmdid =
+ WMI_10X_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
+ .wlan_profile_get_profile_data_cmdid =
+ WMI_10X_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
+ .wlan_profile_enable_profile_id_cmdid =
+ WMI_10X_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
+ .wlan_profile_list_profile_id_cmdid =
+ WMI_10X_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
+ .pdev_suspend_cmdid = WMI_10X_PDEV_SUSPEND_CMDID,
+ .pdev_resume_cmdid = WMI_10X_PDEV_RESUME_CMDID,
+ .add_bcn_filter_cmdid = WMI_10X_ADD_BCN_FILTER_CMDID,
+ .rmv_bcn_filter_cmdid = WMI_10X_RMV_BCN_FILTER_CMDID,
+ .wow_add_wake_pattern_cmdid = WMI_10X_WOW_ADD_WAKE_PATTERN_CMDID,
+ .wow_del_wake_pattern_cmdid = WMI_10X_WOW_DEL_WAKE_PATTERN_CMDID,
+ .wow_enable_disable_wake_event_cmdid =
+ WMI_10X_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
+ .wow_enable_cmdid = WMI_10X_WOW_ENABLE_CMDID,
+ .wow_hostwakeup_from_sleep_cmdid =
+ WMI_10X_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
+ .rtt_measreq_cmdid = WMI_10X_RTT_MEASREQ_CMDID,
+ .rtt_tsf_cmdid = WMI_10X_RTT_TSF_CMDID,
+ .vdev_spectral_scan_configure_cmdid =
+ WMI_10X_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
+ .vdev_spectral_scan_enable_cmdid =
+ WMI_10X_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
+ .request_stats_cmdid = WMI_10X_REQUEST_STATS_CMDID,
+ .set_arp_ns_offload_cmdid = WMI_CMD_UNDEFINED,
+ .network_list_offload_config_cmdid = WMI_CMD_UNDEFINED,
+ .gtk_offload_cmdid = WMI_CMD_UNDEFINED,
+ .csa_offload_enable_cmdid = WMI_CMD_UNDEFINED,
+ .csa_offload_chanswitch_cmdid = WMI_CMD_UNDEFINED,
+ .chatter_set_mode_cmdid = WMI_CMD_UNDEFINED,
+ .peer_tid_addba_cmdid = WMI_CMD_UNDEFINED,
+ .peer_tid_delba_cmdid = WMI_CMD_UNDEFINED,
+ .sta_dtim_ps_method_cmdid = WMI_CMD_UNDEFINED,
+ .sta_uapsd_auto_trig_cmdid = WMI_CMD_UNDEFINED,
+ .sta_keepalive_cmd = WMI_CMD_UNDEFINED,
+ .echo_cmdid = WMI_10X_ECHO_CMDID,
+ .pdev_utf_cmdid = WMI_10X_PDEV_UTF_CMDID,
+ .dbglog_cfg_cmdid = WMI_10X_DBGLOG_CFG_CMDID,
+ .pdev_qvit_cmdid = WMI_10X_PDEV_QVIT_CMDID,
+ .pdev_ftm_intg_cmdid = WMI_CMD_UNDEFINED,
+ .vdev_set_keepalive_cmdid = WMI_CMD_UNDEFINED,
+ .vdev_get_keepalive_cmdid = WMI_CMD_UNDEFINED,
+ .force_fw_hang_cmdid = WMI_CMD_UNDEFINED,
+ .gpio_config_cmdid = WMI_10X_GPIO_CONFIG_CMDID,
+ .gpio_output_cmdid = WMI_10X_GPIO_OUTPUT_CMDID,
+};
int ath10k_wmi_wait_for_service_ready(struct ath10k *ar)
{
@@ -1307,13 +1427,15 @@ static void ath10k_wmi_process_rx(struct ath10k *ar, struct sk_buff *skb)
/* WMI Initialization functions */
int ath10k_wmi_attach(struct ath10k *ar)
{
- int ret = 0;
+ int ret;
if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) {
ath10k_warn("Firmware 10.X is not yet supported\n");
+ ar->wmi.cmd = &wmi_10x_cmd_map;
ret = -ENOTSUPP;
} else {
ar->wmi.cmd = &wmi_cmd_map;
+ ret = 0;
}
init_completion(&ar->wmi.service_ready);
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index b8b446a..d8414ab 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -359,7 +359,9 @@ enum wmi_cmd_group {
#define WMI_CMD_GRP(grp_id) (((grp_id) << 12) | 0x1)
#define WMI_EVT_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1)
-/* Command IDs and commande events. */
+#define WMI_CMD_UNDEFINED 0
+
+/* Command IDs and command events for MAIN FW. */
enum wmi_cmd_id {
WMI_INIT_CMDID = 0x1,
@@ -600,6 +602,217 @@ enum wmi_event_id {
WMI_GPIO_INPUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GPIO),
};
+/* Command IDs and command events for 10.X firmware */
+enum wmi_10x_cmd_id {
+ WMI_10X_START_CMDID = 0x9000,
+ WMI_10X_END_CMDID = 0x9FFF,
+
+ /* initialize the wlan sub system */
+ WMI_10X_INIT_CMDID,
+
+ /* Scan specific commands */
+
+ WMI_10X_START_SCAN_CMDID = WMI_10X_START_CMDID,
+ WMI_10X_STOP_SCAN_CMDID,
+ WMI_10X_SCAN_CHAN_LIST_CMDID,
+ WMI_10X_ECHO_CMDID,
+
+ /* PDEV(physical device) specific commands */
+ WMI_10X_PDEV_SET_REGDOMAIN_CMDID,
+ WMI_10X_PDEV_SET_CHANNEL_CMDID,
+ WMI_10X_PDEV_SET_PARAM_CMDID,
+ WMI_10X_PDEV_PKTLOG_ENABLE_CMDID,
+ WMI_10X_PDEV_PKTLOG_DISABLE_CMDID,
+ WMI_10X_PDEV_SET_WMM_PARAMS_CMDID,
+ WMI_10X_PDEV_SET_HT_CAP_IE_CMDID,
+ WMI_10X_PDEV_SET_VHT_CAP_IE_CMDID,
+ WMI_10X_PDEV_SET_BASE_MACADDR_CMDID,
+ WMI_10X_PDEV_SET_DSCP_TID_MAP_CMDID,
+ WMI_10X_PDEV_SET_QUIET_MODE_CMDID,
+ WMI_10X_PDEV_GREEN_AP_PS_ENABLE_CMDID,
+ WMI_10X_PDEV_GET_TPC_CONFIG_CMDID,
+
+ /* VDEV(virtual device) specific commands */
+ WMI_10X_VDEV_CREATE_CMDID,
+ WMI_10X_VDEV_DELETE_CMDID,
+ WMI_10X_VDEV_START_REQUEST_CMDID,
+ WMI_10X_VDEV_RESTART_REQUEST_CMDID,
+ WMI_10X_VDEV_UP_CMDID,
+ WMI_10X_VDEV_STOP_CMDID,
+ WMI_10X_VDEV_DOWN_CMDID,
+ WMI_10X_VDEV_STANDBY_RESPONSE_CMDID,
+ WMI_10X_VDEV_RESUME_RESPONSE_CMDID,
+ WMI_10X_VDEV_SET_PARAM_CMDID,
+ WMI_10X_VDEV_INSTALL_KEY_CMDID,
+
+ /* peer specific commands */
+ WMI_10X_PEER_CREATE_CMDID,
+ WMI_10X_PEER_DELETE_CMDID,
+ WMI_10X_PEER_FLUSH_TIDS_CMDID,
+ WMI_10X_PEER_SET_PARAM_CMDID,
+ WMI_10X_PEER_ASSOC_CMDID,
+ WMI_10X_PEER_ADD_WDS_ENTRY_CMDID,
+ WMI_10X_PEER_REMOVE_WDS_ENTRY_CMDID,
+ WMI_10X_PEER_MCAST_GROUP_CMDID,
+
+ /* beacon/management specific commands */
+
+ WMI_10X_BCN_TX_CMDID,
+ WMI_10X_BCN_PRB_TMPL_CMDID,
+ WMI_10X_BCN_FILTER_RX_CMDID,
+ WMI_10X_PRB_REQ_FILTER_RX_CMDID,
+ WMI_10X_MGMT_TX_CMDID,
+
+ /* commands to directly control ba negotiation directly from host. */
+ WMI_10X_ADDBA_CLEAR_RESP_CMDID,
+ WMI_10X_ADDBA_SEND_CMDID,
+ WMI_10X_ADDBA_STATUS_CMDID,
+ WMI_10X_DELBA_SEND_CMDID,
+ WMI_10X_ADDBA_SET_RESP_CMDID,
+ WMI_10X_SEND_SINGLEAMSDU_CMDID,
+
+ /* Station power save specific config */
+ WMI_10X_STA_POWERSAVE_MODE_CMDID,
+ WMI_10X_STA_POWERSAVE_PARAM_CMDID,
+ WMI_10X_STA_MIMO_PS_MODE_CMDID,
+
+ /* set debug log config */
+ WMI_10X_DBGLOG_CFG_CMDID,
+
+ /* DFS-specific commands */
+ WMI_10X_PDEV_DFS_ENABLE_CMDID,
+ WMI_10X_PDEV_DFS_DISABLE_CMDID,
+
+ /* QVIT specific command id */
+ WMI_10X_PDEV_QVIT_CMDID,
+
+ /* Offload Scan and Roaming related commands */
+ WMI_10X_ROAM_SCAN_MODE,
+ WMI_10X_ROAM_SCAN_RSSI_THRESHOLD,
+ WMI_10X_ROAM_SCAN_PERIOD,
+ WMI_10X_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
+ WMI_10X_ROAM_AP_PROFILE,
+ WMI_10X_OFL_SCAN_ADD_AP_PROFILE,
+ WMI_10X_OFL_SCAN_REMOVE_AP_PROFILE,
+ WMI_10X_OFL_SCAN_PERIOD,
+
+ /* P2P specific commands */
+ WMI_10X_P2P_DEV_SET_DEVICE_INFO,
+ WMI_10X_P2P_DEV_SET_DISCOVERABILITY,
+ WMI_10X_P2P_GO_SET_BEACON_IE,
+ WMI_10X_P2P_GO_SET_PROBE_RESP_IE,
+
+ /* AP power save specific config */
+ WMI_10X_AP_PS_PEER_PARAM_CMDID,
+ WMI_10X_AP_PS_PEER_UAPSD_COEX_CMDID,
+
+ /* Rate-control specific commands */
+ WMI_10X_PEER_RATE_RETRY_SCHED_CMDID,
+
+ /* WLAN Profiling commands. */
+ WMI_10X_WLAN_PROFILE_TRIGGER_CMDID,
+ WMI_10X_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
+ WMI_10X_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
+ WMI_10X_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
+ WMI_10X_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
+
+ /* Suspend resume command Ids */
+ WMI_10X_PDEV_SUSPEND_CMDID,
+ WMI_10X_PDEV_RESUME_CMDID,
+
+ /* Beacon filter commands */
+ WMI_10X_ADD_BCN_FILTER_CMDID,
+ WMI_10X_RMV_BCN_FILTER_CMDID,
+
+ /* WOW Specific WMI commands*/
+ WMI_10X_WOW_ADD_WAKE_PATTERN_CMDID,
+ WMI_10X_WOW_DEL_WAKE_PATTERN_CMDID,
+ WMI_10X_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
+ WMI_10X_WOW_ENABLE_CMDID,
+ WMI_10X_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
+
+ /* RTT measurement related cmd */
+ WMI_10X_RTT_MEASREQ_CMDID,
+ WMI_10X_RTT_TSF_CMDID,
+
+ /* transmit beacon by value */
+ WMI_10X_PDEV_SEND_BCN_CMDID,
+
+ /* F/W stats */
+ WMI_10X_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
+ WMI_10X_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
+ WMI_10X_REQUEST_STATS_CMDID,
+
+ /* GPIO Configuration */
+ WMI_10X_GPIO_CONFIG_CMDID,
+ WMI_10X_GPIO_OUTPUT_CMDID,
+
+ WMI_10X_PDEV_UTF_CMDID = WMI_10X_END_CMDID - 1,
+};
+
+enum wmi_10x_event_id {
+ WMI_10X_SERVICE_READY_EVENTID = 0x8000,
+ WMI_10X_READY_EVENTID,
+ WMI_10X_START_EVENTID = 0x9000,
+ WMI_10X_END_EVENTID = 0x9FFF,
+
+ /* Scan specific events */
+ WMI_10X_SCAN_EVENTID = WMI_10X_START_EVENTID,
+ WMI_10X_ECHO_EVENTID,
+ WMI_10X_DEBUG_MESG_EVENTID,
+ WMI_10X_UPDATE_STATS_EVENTID,
+
+ /* Instantaneous RSSI event */
+ WMI_10X_INST_RSSI_STATS_EVENTID,
+
+ /* VDEV specific events */
+ WMI_10X_VDEV_START_RESP_EVENTID,
+ WMI_10X_VDEV_STANDBY_REQ_EVENTID,
+ WMI_10X_VDEV_RESUME_REQ_EVENTID,
+ WMI_10X_VDEV_STOPPED_EVENTID,
+
+ /* peer specific events */
+ WMI_10X_PEER_STA_KICKOUT_EVENTID,
+
+ /* beacon/mgmt specific events */
+ WMI_10X_HOST_SWBA_EVENTID,
+ WMI_10X_TBTTOFFSET_UPDATE_EVENTID,
+ WMI_10X_MGMT_RX_EVENTID,
+
+ /* Channel stats event */
+ WMI_10X_CHAN_INFO_EVENTID,
+
+ /* PHY Error specific WMI event */
+ WMI_10X_PHYERR_EVENTID,
+
+ /* Roam event to trigger roaming on host */
+ WMI_10X_ROAM_EVENTID,
+
+ /* matching AP found from list of profiles */
+ WMI_10X_PROFILE_MATCH,
+
+ /* debug print message used for tracing FW code while debugging */
+ WMI_10X_DEBUG_PRINT_EVENTID,
+ /* VI spoecific event */
+ WMI_10X_PDEV_QVIT_EVENTID,
+ /* FW code profile data in response to profile request */
+ WMI_10X_WLAN_PROFILE_DATA_EVENTID,
+
+ /*RTT related event ID*/
+ WMI_10X_RTT_MEASUREMENT_REPORT_EVENTID,
+ WMI_10X_TSF_MEASUREMENT_REPORT_EVENTID,
+ WMI_10X_RTT_ERROR_REPORT_EVENTID,
+
+ WMI_10X_WOW_WAKEUP_HOST_EVENTID,
+ WMI_10X_DCS_INTERFERENCE_EVENTID,
+
+ /* TPC config for the current operating channel */
+ WMI_10X_PDEV_TPC_CONFIG_EVENTID,
+
+ WMI_10X_GPIO_INPUT_EVENTID,
+ WMI_10X_PDEV_UTF_EVENTID = WMI_10X_END_EVENTID-1,
+};
+
enum wmi_phy_mode {
MODE_11A = 0, /* 11a Mode */
MODE_11G = 1, /* 11b/g Mode */
--
1.7.10
^ permalink raw reply related
* [PATCH v2 01/13] ath10k: introduce dynamic WMI structures
From: Bartosz Markowski @ 2013-09-26 9:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Bartosz Markowski
In-Reply-To: <1380187792-25626-1-git-send-email-bartosz.markowski@tieto.com>
This is the initial framework to implement dynamic
WMI API in order to support new firmware (from so
called 10.X branch)
The realization is to have a static WMI cmd map for
each of the firmwares, registered upom wmi init.
This patch creates such map for MAIN FW, updates
wmi_cmd_send() calls to take as a parameter
the map value instead of direct WMI enum.
As soon as complete 10.X API will be on place,
we will introduce the FW IE mechanics to dynamicaly
identify which FW is being used and based on that
we will use correct map, API, structures, etc.
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
---
drivers/net/wireless/ath/ath10k/core.h | 4 +
drivers/net/wireless/ath/ath10k/wmi.c | 230 ++++++++++++++++++++++++++------
drivers/net/wireless/ath/ath10k/wmi.h | 112 ++++++++++++++++
3 files changed, 305 insertions(+), 41 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 292ad45..acfee7c 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -107,6 +107,7 @@ struct ath10k_wmi {
struct completion service_ready;
struct completion unified_ready;
wait_queue_head_t tx_credits_wq;
+ struct wmi_cmd_map *cmd;
};
struct ath10k_peer_stat {
@@ -268,6 +269,9 @@ enum ath10k_fw_features {
/* wmi_mgmt_rx_hdr contains extra RSSI information */
ATH10K_FW_FEATURE_EXT_WMI_MGMT_RX = 0,
+ /* firmware from 10X branch */
+ ATH10K_FW_FEATURE_WMI_10X = 1,
+
/* keep last */
ATH10K_FW_FEATURE_COUNT,
};
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 6803ead..1296dbe 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -23,6 +23,128 @@
#include "wmi.h"
#include "mac.h"
+/* MAIN WMI cmd track */
+static struct wmi_cmd_map wmi_cmd_map = {
+ .init_cmdid = WMI_INIT_CMDID,
+ .start_scan_cmdid = WMI_START_SCAN_CMDID,
+ .stop_scan_cmdid = WMI_STOP_SCAN_CMDID,
+ .scan_chan_list_cmdid = WMI_SCAN_CHAN_LIST_CMDID,
+ .scan_sch_prio_tbl_cmdid = WMI_SCAN_SCH_PRIO_TBL_CMDID,
+ .pdev_set_regdomain_cmdid = WMI_PDEV_SET_REGDOMAIN_CMDID,
+ .pdev_set_channel_cmdid = WMI_PDEV_SET_CHANNEL_CMDID,
+ .pdev_set_param_cmdid = WMI_PDEV_SET_PARAM_CMDID,
+ .pdev_pktlog_enable_cmdid = WMI_PDEV_PKTLOG_ENABLE_CMDID,
+ .pdev_pktlog_disable_cmdid = WMI_PDEV_PKTLOG_DISABLE_CMDID,
+ .pdev_set_wmm_params_cmdid = WMI_PDEV_SET_WMM_PARAMS_CMDID,
+ .pdev_set_ht_cap_ie_cmdid = WMI_PDEV_SET_HT_CAP_IE_CMDID,
+ .pdev_set_vht_cap_ie_cmdid = WMI_PDEV_SET_VHT_CAP_IE_CMDID,
+ .pdev_set_dscp_tid_map_cmdid = WMI_PDEV_SET_DSCP_TID_MAP_CMDID,
+ .pdev_set_quiet_mode_cmdid = WMI_PDEV_SET_QUIET_MODE_CMDID,
+ .pdev_green_ap_ps_enable_cmdid = WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID,
+ .pdev_get_tpc_config_cmdid = WMI_PDEV_GET_TPC_CONFIG_CMDID,
+ .pdev_set_base_macaddr_cmdid = WMI_PDEV_SET_BASE_MACADDR_CMDID,
+ .vdev_create_cmdid = WMI_VDEV_CREATE_CMDID,
+ .vdev_delete_cmdid = WMI_VDEV_DELETE_CMDID,
+ .vdev_start_request_cmdid = WMI_VDEV_START_REQUEST_CMDID,
+ .vdev_restart_request_cmdid = WMI_VDEV_RESTART_REQUEST_CMDID,
+ .vdev_up_cmdid = WMI_VDEV_UP_CMDID,
+ .vdev_stop_cmdid = WMI_VDEV_STOP_CMDID,
+ .vdev_down_cmdid = WMI_VDEV_DOWN_CMDID,
+ .vdev_set_param_cmdid = WMI_VDEV_SET_PARAM_CMDID,
+ .vdev_install_key_cmdid = WMI_VDEV_INSTALL_KEY_CMDID,
+ .peer_create_cmdid = WMI_PEER_CREATE_CMDID,
+ .peer_delete_cmdid = WMI_PEER_DELETE_CMDID,
+ .peer_flush_tids_cmdid = WMI_PEER_FLUSH_TIDS_CMDID,
+ .peer_set_param_cmdid = WMI_PEER_SET_PARAM_CMDID,
+ .peer_assoc_cmdid = WMI_PEER_ASSOC_CMDID,
+ .peer_add_wds_entry_cmdid = WMI_PEER_ADD_WDS_ENTRY_CMDID,
+ .peer_remove_wds_entry_cmdid = WMI_PEER_REMOVE_WDS_ENTRY_CMDID,
+ .peer_mcast_group_cmdid = WMI_PEER_MCAST_GROUP_CMDID,
+ .bcn_tx_cmdid = WMI_BCN_TX_CMDID,
+ .pdev_send_bcn_cmdid = WMI_PDEV_SEND_BCN_CMDID,
+ .bcn_tmpl_cmdid = WMI_BCN_TMPL_CMDID,
+ .bcn_filter_rx_cmdid = WMI_BCN_FILTER_RX_CMDID,
+ .prb_req_filter_rx_cmdid = WMI_PRB_REQ_FILTER_RX_CMDID,
+ .mgmt_tx_cmdid = WMI_MGMT_TX_CMDID,
+ .prb_tmpl_cmdid = WMI_PRB_TMPL_CMDID,
+ .addba_clear_resp_cmdid = WMI_ADDBA_CLEAR_RESP_CMDID,
+ .addba_send_cmdid = WMI_ADDBA_SEND_CMDID,
+ .addba_status_cmdid = WMI_ADDBA_STATUS_CMDID,
+ .delba_send_cmdid = WMI_DELBA_SEND_CMDID,
+ .addba_set_resp_cmdid = WMI_ADDBA_SET_RESP_CMDID,
+ .send_singleamsdu_cmdid = WMI_SEND_SINGLEAMSDU_CMDID,
+ .sta_powersave_mode_cmdid = WMI_STA_POWERSAVE_MODE_CMDID,
+ .sta_powersave_param_cmdid = WMI_STA_POWERSAVE_PARAM_CMDID,
+ .sta_mimo_ps_mode_cmdid = WMI_STA_MIMO_PS_MODE_CMDID,
+ .pdev_dfs_enable_cmdid = WMI_PDEV_DFS_ENABLE_CMDID,
+ .pdev_dfs_disable_cmdid = WMI_PDEV_DFS_DISABLE_CMDID,
+ .roam_scan_mode = WMI_ROAM_SCAN_MODE,
+ .roam_scan_rssi_threshold = WMI_ROAM_SCAN_RSSI_THRESHOLD,
+ .roam_scan_period = WMI_ROAM_SCAN_PERIOD,
+ .roam_scan_rssi_change_threshold = WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
+ .roam_ap_profile = WMI_ROAM_AP_PROFILE,
+ .ofl_scan_add_ap_profile = WMI_ROAM_AP_PROFILE,
+ .ofl_scan_remove_ap_profile = WMI_OFL_SCAN_REMOVE_AP_PROFILE,
+ .ofl_scan_period = WMI_OFL_SCAN_PERIOD,
+ .p2p_dev_set_device_info = WMI_P2P_DEV_SET_DEVICE_INFO,
+ .p2p_dev_set_discoverability = WMI_P2P_DEV_SET_DISCOVERABILITY,
+ .p2p_go_set_beacon_ie = WMI_P2P_GO_SET_BEACON_IE,
+ .p2p_go_set_probe_resp_ie = WMI_P2P_GO_SET_PROBE_RESP_IE,
+ .p2p_set_vendor_ie_data_cmdid = WMI_P2P_SET_VENDOR_IE_DATA_CMDID,
+ .ap_ps_peer_param_cmdid = WMI_AP_PS_PEER_PARAM_CMDID,
+ .ap_ps_peer_uapsd_coex_cmdid = WMI_AP_PS_PEER_UAPSD_COEX_CMDID,
+ .peer_rate_retry_sched_cmdid = WMI_PEER_RATE_RETRY_SCHED_CMDID,
+ .wlan_profile_trigger_cmdid = WMI_WLAN_PROFILE_TRIGGER_CMDID,
+ .wlan_profile_set_hist_intvl_cmdid =
+ WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
+ .wlan_profile_get_profile_data_cmdid =
+ WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
+ .wlan_profile_enable_profile_id_cmdid =
+ WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
+ .wlan_profile_list_profile_id_cmdid =
+ WMI_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
+ .pdev_suspend_cmdid = WMI_PDEV_SUSPEND_CMDID,
+ .pdev_resume_cmdid = WMI_PDEV_RESUME_CMDID,
+ .add_bcn_filter_cmdid = WMI_ADD_BCN_FILTER_CMDID,
+ .rmv_bcn_filter_cmdid = WMI_RMV_BCN_FILTER_CMDID,
+ .wow_add_wake_pattern_cmdid = WMI_WOW_ADD_WAKE_PATTERN_CMDID,
+ .wow_del_wake_pattern_cmdid = WMI_WOW_DEL_WAKE_PATTERN_CMDID,
+ .wow_enable_disable_wake_event_cmdid =
+ WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
+ .wow_enable_cmdid = WMI_WOW_ENABLE_CMDID,
+ .wow_hostwakeup_from_sleep_cmdid = WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
+ .rtt_measreq_cmdid = WMI_RTT_MEASREQ_CMDID,
+ .rtt_tsf_cmdid = WMI_RTT_TSF_CMDID,
+ .vdev_spectral_scan_configure_cmdid =
+ WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
+ .vdev_spectral_scan_enable_cmdid = WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
+ .request_stats_cmdid = WMI_REQUEST_STATS_CMDID,
+ .set_arp_ns_offload_cmdid = WMI_SET_ARP_NS_OFFLOAD_CMDID,
+ .network_list_offload_config_cmdid =
+ WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID,
+ .gtk_offload_cmdid = WMI_GTK_OFFLOAD_CMDID,
+ .csa_offload_enable_cmdid = WMI_CSA_OFFLOAD_ENABLE_CMDID,
+ .csa_offload_chanswitch_cmdid = WMI_CSA_OFFLOAD_CHANSWITCH_CMDID,
+ .chatter_set_mode_cmdid = WMI_CHATTER_SET_MODE_CMDID,
+ .peer_tid_addba_cmdid = WMI_PEER_TID_ADDBA_CMDID,
+ .peer_tid_delba_cmdid = WMI_PEER_TID_DELBA_CMDID,
+ .sta_dtim_ps_method_cmdid = WMI_STA_DTIM_PS_METHOD_CMDID,
+ .sta_uapsd_auto_trig_cmdid = WMI_STA_UAPSD_AUTO_TRIG_CMDID,
+ .sta_keepalive_cmd = WMI_STA_KEEPALIVE_CMD,
+ .echo_cmdid = WMI_ECHO_CMDID,
+ .pdev_utf_cmdid = WMI_PDEV_UTF_CMDID,
+ .dbglog_cfg_cmdid = WMI_DBGLOG_CFG_CMDID,
+ .pdev_qvit_cmdid = WMI_PDEV_QVIT_CMDID,
+ .pdev_ftm_intg_cmdid = WMI_PDEV_FTM_INTG_CMDID,
+ .vdev_set_keepalive_cmdid = WMI_VDEV_SET_KEEPALIVE_CMDID,
+ .vdev_get_keepalive_cmdid = WMI_VDEV_GET_KEEPALIVE_CMDID,
+ .force_fw_hang_cmdid = WMI_FORCE_FW_HANG_CMDID,
+ .gpio_config_cmdid = WMI_GPIO_CONFIG_CMDID,
+ .gpio_output_cmdid = WMI_GPIO_OUTPUT_CMDID,
+};
+
+/* TODO: 10.X WMI cmd track */
+
int ath10k_wmi_wait_for_service_ready(struct ath10k *ar)
{
int ret;
@@ -64,7 +186,7 @@ static void ath10k_wmi_htc_tx_complete(struct ath10k *ar, struct sk_buff *skb)
}
static int ath10k_wmi_cmd_send_nowait(struct ath10k *ar, struct sk_buff *skb,
- enum wmi_cmd_id cmd_id)
+ u32 cmd_id)
{
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
struct wmi_cmd_hdr *cmd_hdr;
@@ -144,7 +266,7 @@ static void ath10k_wmi_op_ep_tx_credits(struct ath10k *ar)
}
static int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb,
- enum wmi_cmd_id cmd_id)
+ u32 cmd_id)
{
int ret = -EINVAL;
@@ -1055,7 +1177,7 @@ static int ath10k_wmi_ready_event_rx(struct ath10k *ar, struct sk_buff *skb)
return 0;
}
-static void ath10k_wmi_process_rx(struct ath10k *ar, struct sk_buff *skb)
+static void ath10k_wmi_main_process_rx(struct ath10k *ar, struct sk_buff *skb)
{
struct wmi_cmd_hdr *cmd_hdr;
enum wmi_event_id id;
@@ -1174,14 +1296,31 @@ static void ath10k_wmi_process_rx(struct ath10k *ar, struct sk_buff *skb)
dev_kfree_skb(skb);
}
+static void ath10k_wmi_process_rx(struct ath10k *ar, struct sk_buff *skb)
+{
+ if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features))
+ ath10k_warn("Firmware 10.X is not yet supported\n");
+ else
+ ath10k_wmi_main_process_rx(ar, skb);
+}
+
/* WMI Initialization functions */
int ath10k_wmi_attach(struct ath10k *ar)
{
+ int ret = 0;
+
+ if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) {
+ ath10k_warn("Firmware 10.X is not yet supported\n");
+ ret = -ENOTSUPP;
+ } else {
+ ar->wmi.cmd = &wmi_cmd_map;
+ }
+
init_completion(&ar->wmi.service_ready);
init_completion(&ar->wmi.unified_ready);
init_waitqueue_head(&ar->wmi.tx_credits_wq);
- return 0;
+ return ret;
}
void ath10k_wmi_detach(struct ath10k *ar)
@@ -1237,7 +1376,8 @@ int ath10k_wmi_pdev_set_regdomain(struct ath10k *ar, u16 rd, u16 rd2g,
"wmi pdev regdomain rd %x rd2g %x rd5g %x ctl2g %x ctl5g %x\n",
rd, rd2g, rd5g, ctl2g, ctl5g);
- return ath10k_wmi_cmd_send(ar, skb, WMI_PDEV_SET_REGDOMAIN_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->pdev_set_regdomain_cmdid);
}
int ath10k_wmi_pdev_set_channel(struct ath10k *ar,
@@ -1267,7 +1407,8 @@ int ath10k_wmi_pdev_set_channel(struct ath10k *ar,
"wmi set channel mode %d freq %d\n",
arg->mode, arg->freq);
- return ath10k_wmi_cmd_send(ar, skb, WMI_PDEV_SET_CHANNEL_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->pdev_set_channel_cmdid);
}
int ath10k_wmi_pdev_suspend_target(struct ath10k *ar)
@@ -1282,7 +1423,7 @@ int ath10k_wmi_pdev_suspend_target(struct ath10k *ar)
cmd = (struct wmi_pdev_suspend_cmd *)skb->data;
cmd->suspend_opt = WMI_PDEV_SUSPEND;
- return ath10k_wmi_cmd_send(ar, skb, WMI_PDEV_SUSPEND_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_suspend_cmdid);
}
int ath10k_wmi_pdev_resume_target(struct ath10k *ar)
@@ -1293,7 +1434,7 @@ int ath10k_wmi_pdev_resume_target(struct ath10k *ar)
if (skb == NULL)
return -ENOMEM;
- return ath10k_wmi_cmd_send(ar, skb, WMI_PDEV_RESUME_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_resume_cmdid);
}
int ath10k_wmi_pdev_set_param(struct ath10k *ar, enum wmi_pdev_param id,
@@ -1312,7 +1453,7 @@ int ath10k_wmi_pdev_set_param(struct ath10k *ar, enum wmi_pdev_param id,
ath10k_dbg(ATH10K_DBG_WMI, "wmi pdev set param %d value %d\n",
id, value);
- return ath10k_wmi_cmd_send(ar, skb, WMI_PDEV_SET_PARAM_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_set_param_cmdid);
}
int ath10k_wmi_cmd_init(struct ath10k *ar)
@@ -1382,7 +1523,7 @@ int ath10k_wmi_cmd_init(struct ath10k *ar)
memcpy(&cmd->resource_config, &config, sizeof(config));
ath10k_dbg(ATH10K_DBG_WMI, "wmi init\n");
- return ath10k_wmi_cmd_send(ar, buf, WMI_INIT_CMDID);
+ return ath10k_wmi_cmd_send(ar, buf, ar->wmi.cmd->init_cmdid);
}
static int ath10k_wmi_start_scan_calc_len(const struct wmi_start_scan_arg *arg)
@@ -1543,7 +1684,7 @@ int ath10k_wmi_start_scan(struct ath10k *ar,
}
ath10k_dbg(ATH10K_DBG_WMI, "wmi start scan\n");
- return ath10k_wmi_cmd_send(ar, skb, WMI_START_SCAN_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->start_scan_cmdid);
}
void ath10k_wmi_start_scan_init(struct ath10k *ar,
@@ -1603,7 +1744,7 @@ int ath10k_wmi_stop_scan(struct ath10k *ar, const struct wmi_stop_scan_arg *arg)
ath10k_dbg(ATH10K_DBG_WMI,
"wmi stop scan reqid %d req_type %d vdev/scan_id %d\n",
arg->req_id, arg->req_type, arg->u.scan_id);
- return ath10k_wmi_cmd_send(ar, skb, WMI_STOP_SCAN_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->stop_scan_cmdid);
}
int ath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id,
@@ -1628,7 +1769,7 @@ int ath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id,
"WMI vdev create: id %d type %d subtype %d macaddr %pM\n",
vdev_id, type, subtype, macaddr);
- return ath10k_wmi_cmd_send(ar, skb, WMI_VDEV_CREATE_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_create_cmdid);
}
int ath10k_wmi_vdev_delete(struct ath10k *ar, u32 vdev_id)
@@ -1646,20 +1787,20 @@ int ath10k_wmi_vdev_delete(struct ath10k *ar, u32 vdev_id)
ath10k_dbg(ATH10K_DBG_WMI,
"WMI vdev delete id %d\n", vdev_id);
- return ath10k_wmi_cmd_send(ar, skb, WMI_VDEV_DELETE_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_delete_cmdid);
}
static int ath10k_wmi_vdev_start_restart(struct ath10k *ar,
const struct wmi_vdev_start_request_arg *arg,
- enum wmi_cmd_id cmd_id)
+ u32 cmd_id)
{
struct wmi_vdev_start_request_cmd *cmd;
struct sk_buff *skb;
const char *cmdname;
u32 flags = 0;
- if (cmd_id != WMI_VDEV_START_REQUEST_CMDID &&
- cmd_id != WMI_VDEV_RESTART_REQUEST_CMDID)
+ if (cmd_id != ar->wmi.cmd->vdev_start_request_cmdid &&
+ cmd_id != ar->wmi.cmd->vdev_restart_request_cmdid)
return -EINVAL;
if (WARN_ON(arg->ssid && arg->ssid_len == 0))
return -EINVAL;
@@ -1668,9 +1809,9 @@ static int ath10k_wmi_vdev_start_restart(struct ath10k *ar,
if (WARN_ON(arg->ssid_len > sizeof(cmd->ssid.ssid)))
return -EINVAL;
- if (cmd_id == WMI_VDEV_START_REQUEST_CMDID)
+ if (cmd_id == ar->wmi.cmd->vdev_start_request_cmdid)
cmdname = "start";
- else if (cmd_id == WMI_VDEV_RESTART_REQUEST_CMDID)
+ else if (cmd_id == ar->wmi.cmd->vdev_restart_request_cmdid)
cmdname = "restart";
else
return -EINVAL; /* should not happen, we already check cmd_id */
@@ -1721,15 +1862,17 @@ static int ath10k_wmi_vdev_start_restart(struct ath10k *ar,
int ath10k_wmi_vdev_start(struct ath10k *ar,
const struct wmi_vdev_start_request_arg *arg)
{
- return ath10k_wmi_vdev_start_restart(ar, arg,
- WMI_VDEV_START_REQUEST_CMDID);
+ u32 cmd_id = ar->wmi.cmd->vdev_start_request_cmdid;
+
+ return ath10k_wmi_vdev_start_restart(ar, arg, cmd_id);
}
int ath10k_wmi_vdev_restart(struct ath10k *ar,
const struct wmi_vdev_start_request_arg *arg)
{
- return ath10k_wmi_vdev_start_restart(ar, arg,
- WMI_VDEV_RESTART_REQUEST_CMDID);
+ u32 cmd_id = ar->wmi.cmd->vdev_restart_request_cmdid;
+
+ return ath10k_wmi_vdev_start_restart(ar, arg, cmd_id);
}
int ath10k_wmi_vdev_stop(struct ath10k *ar, u32 vdev_id)
@@ -1746,7 +1889,7 @@ int ath10k_wmi_vdev_stop(struct ath10k *ar, u32 vdev_id)
ath10k_dbg(ATH10K_DBG_WMI, "wmi vdev stop id 0x%x\n", vdev_id);
- return ath10k_wmi_cmd_send(ar, skb, WMI_VDEV_STOP_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_stop_cmdid);
}
int ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid, const u8 *bssid)
@@ -1767,7 +1910,7 @@ int ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid, const u8 *bssid)
"wmi mgmt vdev up id 0x%x assoc id %d bssid %pM\n",
vdev_id, aid, bssid);
- return ath10k_wmi_cmd_send(ar, skb, WMI_VDEV_UP_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_up_cmdid);
}
int ath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id)
@@ -1785,7 +1928,7 @@ int ath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id)
ath10k_dbg(ATH10K_DBG_WMI,
"wmi mgmt vdev down id 0x%x\n", vdev_id);
- return ath10k_wmi_cmd_send(ar, skb, WMI_VDEV_DOWN_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_down_cmdid);
}
int ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id,
@@ -1807,7 +1950,7 @@ int ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id,
"wmi vdev id 0x%x set param %d value %d\n",
vdev_id, param_id, param_value);
- return ath10k_wmi_cmd_send(ar, skb, WMI_VDEV_SET_PARAM_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_set_param_cmdid);
}
int ath10k_wmi_vdev_install_key(struct ath10k *ar,
@@ -1842,7 +1985,8 @@ int ath10k_wmi_vdev_install_key(struct ath10k *ar,
ath10k_dbg(ATH10K_DBG_WMI,
"wmi vdev install key idx %d cipher %d len %d\n",
arg->key_idx, arg->key_cipher, arg->key_len);
- return ath10k_wmi_cmd_send(ar, skb, WMI_VDEV_INSTALL_KEY_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->vdev_install_key_cmdid);
}
int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
@@ -1862,7 +2006,7 @@ int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
ath10k_dbg(ATH10K_DBG_WMI,
"wmi peer create vdev_id %d peer_addr %pM\n",
vdev_id, peer_addr);
- return ath10k_wmi_cmd_send(ar, skb, WMI_PEER_CREATE_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_create_cmdid);
}
int ath10k_wmi_peer_delete(struct ath10k *ar, u32 vdev_id,
@@ -1882,7 +2026,7 @@ int ath10k_wmi_peer_delete(struct ath10k *ar, u32 vdev_id,
ath10k_dbg(ATH10K_DBG_WMI,
"wmi peer delete vdev_id %d peer_addr %pM\n",
vdev_id, peer_addr);
- return ath10k_wmi_cmd_send(ar, skb, WMI_PEER_DELETE_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_delete_cmdid);
}
int ath10k_wmi_peer_flush(struct ath10k *ar, u32 vdev_id,
@@ -1903,7 +2047,7 @@ int ath10k_wmi_peer_flush(struct ath10k *ar, u32 vdev_id,
ath10k_dbg(ATH10K_DBG_WMI,
"wmi peer flush vdev_id %d peer_addr %pM tids %08x\n",
vdev_id, peer_addr, tid_bitmap);
- return ath10k_wmi_cmd_send(ar, skb, WMI_PEER_FLUSH_TIDS_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_flush_tids_cmdid);
}
int ath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id,
@@ -1927,7 +2071,7 @@ int ath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id,
"wmi vdev %d peer 0x%pM set param %d value %d\n",
vdev_id, peer_addr, param_id, param_value);
- return ath10k_wmi_cmd_send(ar, skb, WMI_PEER_SET_PARAM_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_set_param_cmdid);
}
int ath10k_wmi_set_psmode(struct ath10k *ar, u32 vdev_id,
@@ -1948,7 +2092,8 @@ int ath10k_wmi_set_psmode(struct ath10k *ar, u32 vdev_id,
"wmi set powersave id 0x%x mode %d\n",
vdev_id, psmode);
- return ath10k_wmi_cmd_send(ar, skb, WMI_STA_POWERSAVE_MODE_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->sta_powersave_mode_cmdid);
}
int ath10k_wmi_set_sta_ps_param(struct ath10k *ar, u32 vdev_id,
@@ -1970,7 +2115,8 @@ int ath10k_wmi_set_sta_ps_param(struct ath10k *ar, u32 vdev_id,
ath10k_dbg(ATH10K_DBG_WMI,
"wmi sta ps param vdev_id 0x%x param %d value %d\n",
vdev_id, param_id, value);
- return ath10k_wmi_cmd_send(ar, skb, WMI_STA_POWERSAVE_PARAM_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->sta_powersave_param_cmdid);
}
int ath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac,
@@ -1996,7 +2142,8 @@ int ath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac,
"wmi ap ps param vdev_id 0x%X param %d value %d mac_addr %pM\n",
vdev_id, param_id, value, mac);
- return ath10k_wmi_cmd_send(ar, skb, WMI_AP_PS_PEER_PARAM_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->ap_ps_peer_param_cmdid);
}
int ath10k_wmi_scan_chan_list(struct ath10k *ar,
@@ -2049,7 +2196,7 @@ int ath10k_wmi_scan_chan_list(struct ath10k *ar,
ci->flags |= __cpu_to_le32(flags);
}
- return ath10k_wmi_cmd_send(ar, skb, WMI_SCAN_CHAN_LIST_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->scan_chan_list_cmdid);
}
int ath10k_wmi_peer_assoc(struct ath10k *ar,
@@ -2108,7 +2255,7 @@ int ath10k_wmi_peer_assoc(struct ath10k *ar,
ath10k_dbg(ATH10K_DBG_WMI,
"wmi peer assoc vdev %d addr %pM\n",
arg->vdev_id, arg->addr);
- return ath10k_wmi_cmd_send(ar, skb, WMI_PEER_ASSOC_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_assoc_cmdid);
}
int ath10k_wmi_beacon_send_nowait(struct ath10k *ar,
@@ -2128,7 +2275,7 @@ int ath10k_wmi_beacon_send_nowait(struct ath10k *ar,
cmd->hdr.bcn_len = __cpu_to_le32(arg->bcn_len);
memcpy(cmd->bcn, arg->bcn, arg->bcn_len);
- return ath10k_wmi_cmd_send_nowait(ar, skb, WMI_BCN_TX_CMDID);
+ return ath10k_wmi_cmd_send_nowait(ar, skb, ar->wmi.cmd->bcn_tx_cmdid);
}
static void ath10k_wmi_pdev_set_wmm_param(struct wmi_wmm_params *params,
@@ -2159,7 +2306,8 @@ int ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar,
ath10k_wmi_pdev_set_wmm_param(&cmd->ac_vo, &arg->ac_vo);
ath10k_dbg(ATH10K_DBG_WMI, "wmi pdev set wmm params\n");
- return ath10k_wmi_cmd_send(ar, skb, WMI_PDEV_SET_WMM_PARAMS_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb,
+ ar->wmi.cmd->pdev_set_wmm_params_cmdid);
}
int ath10k_wmi_request_stats(struct ath10k *ar, enum wmi_stats_id stats_id)
@@ -2175,7 +2323,7 @@ int ath10k_wmi_request_stats(struct ath10k *ar, enum wmi_stats_id stats_id)
cmd->stats_id = __cpu_to_le32(stats_id);
ath10k_dbg(ATH10K_DBG_WMI, "wmi request stats %d\n", (int)stats_id);
- return ath10k_wmi_cmd_send(ar, skb, WMI_REQUEST_STATS_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->request_stats_cmdid);
}
int ath10k_wmi_force_fw_hang(struct ath10k *ar,
@@ -2194,5 +2342,5 @@ int ath10k_wmi_force_fw_hang(struct ath10k *ar,
ath10k_dbg(ATH10K_DBG_WMI, "wmi force fw hang %d delay %d\n",
type, delay_ms);
- return ath10k_wmi_cmd_send(ar, skb, WMI_FORCE_FW_HANG_CMDID);
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid);
}
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 2c52c23..b8b446a 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -208,6 +208,118 @@ struct wmi_mac_addr {
(c_macaddr)[5] = (((pwmi_mac_addr)->word1) >> 8) & 0xff; \
} while (0)
+struct wmi_cmd_map {
+ u32 init_cmdid;
+ u32 start_scan_cmdid;
+ u32 stop_scan_cmdid;
+ u32 scan_chan_list_cmdid;
+ u32 scan_sch_prio_tbl_cmdid;
+ u32 pdev_set_regdomain_cmdid;
+ u32 pdev_set_channel_cmdid;
+ u32 pdev_set_param_cmdid;
+ u32 pdev_pktlog_enable_cmdid;
+ u32 pdev_pktlog_disable_cmdid;
+ u32 pdev_set_wmm_params_cmdid;
+ u32 pdev_set_ht_cap_ie_cmdid;
+ u32 pdev_set_vht_cap_ie_cmdid;
+ u32 pdev_set_dscp_tid_map_cmdid;
+ u32 pdev_set_quiet_mode_cmdid;
+ u32 pdev_green_ap_ps_enable_cmdid;
+ u32 pdev_get_tpc_config_cmdid;
+ u32 pdev_set_base_macaddr_cmdid;
+ u32 vdev_create_cmdid;
+ u32 vdev_delete_cmdid;
+ u32 vdev_start_request_cmdid;
+ u32 vdev_restart_request_cmdid;
+ u32 vdev_up_cmdid;
+ u32 vdev_stop_cmdid;
+ u32 vdev_down_cmdid;
+ u32 vdev_set_param_cmdid;
+ u32 vdev_install_key_cmdid;
+ u32 peer_create_cmdid;
+ u32 peer_delete_cmdid;
+ u32 peer_flush_tids_cmdid;
+ u32 peer_set_param_cmdid;
+ u32 peer_assoc_cmdid;
+ u32 peer_add_wds_entry_cmdid;
+ u32 peer_remove_wds_entry_cmdid;
+ u32 peer_mcast_group_cmdid;
+ u32 bcn_tx_cmdid;
+ u32 pdev_send_bcn_cmdid;
+ u32 bcn_tmpl_cmdid;
+ u32 bcn_filter_rx_cmdid;
+ u32 prb_req_filter_rx_cmdid;
+ u32 mgmt_tx_cmdid;
+ u32 prb_tmpl_cmdid;
+ u32 addba_clear_resp_cmdid;
+ u32 addba_send_cmdid;
+ u32 addba_status_cmdid;
+ u32 delba_send_cmdid;
+ u32 addba_set_resp_cmdid;
+ u32 send_singleamsdu_cmdid;
+ u32 sta_powersave_mode_cmdid;
+ u32 sta_powersave_param_cmdid;
+ u32 sta_mimo_ps_mode_cmdid;
+ u32 pdev_dfs_enable_cmdid;
+ u32 pdev_dfs_disable_cmdid;
+ u32 roam_scan_mode;
+ u32 roam_scan_rssi_threshold;
+ u32 roam_scan_period;
+ u32 roam_scan_rssi_change_threshold;
+ u32 roam_ap_profile;
+ u32 ofl_scan_add_ap_profile;
+ u32 ofl_scan_remove_ap_profile;
+ u32 ofl_scan_period;
+ u32 p2p_dev_set_device_info;
+ u32 p2p_dev_set_discoverability;
+ u32 p2p_go_set_beacon_ie;
+ u32 p2p_go_set_probe_resp_ie;
+ u32 p2p_set_vendor_ie_data_cmdid;
+ u32 ap_ps_peer_param_cmdid;
+ u32 ap_ps_peer_uapsd_coex_cmdid;
+ u32 peer_rate_retry_sched_cmdid;
+ u32 wlan_profile_trigger_cmdid;
+ u32 wlan_profile_set_hist_intvl_cmdid;
+ u32 wlan_profile_get_profile_data_cmdid;
+ u32 wlan_profile_enable_profile_id_cmdid;
+ u32 wlan_profile_list_profile_id_cmdid;
+ u32 pdev_suspend_cmdid;
+ u32 pdev_resume_cmdid;
+ u32 add_bcn_filter_cmdid;
+ u32 rmv_bcn_filter_cmdid;
+ u32 wow_add_wake_pattern_cmdid;
+ u32 wow_del_wake_pattern_cmdid;
+ u32 wow_enable_disable_wake_event_cmdid;
+ u32 wow_enable_cmdid;
+ u32 wow_hostwakeup_from_sleep_cmdid;
+ u32 rtt_measreq_cmdid;
+ u32 rtt_tsf_cmdid;
+ u32 vdev_spectral_scan_configure_cmdid;
+ u32 vdev_spectral_scan_enable_cmdid;
+ u32 request_stats_cmdid;
+ u32 set_arp_ns_offload_cmdid;
+ u32 network_list_offload_config_cmdid;
+ u32 gtk_offload_cmdid;
+ u32 csa_offload_enable_cmdid;
+ u32 csa_offload_chanswitch_cmdid;
+ u32 chatter_set_mode_cmdid;
+ u32 peer_tid_addba_cmdid;
+ u32 peer_tid_delba_cmdid;
+ u32 sta_dtim_ps_method_cmdid;
+ u32 sta_uapsd_auto_trig_cmdid;
+ u32 sta_keepalive_cmd;
+ u32 echo_cmdid;
+ u32 pdev_utf_cmdid;
+ u32 dbglog_cfg_cmdid;
+ u32 pdev_qvit_cmdid;
+ u32 pdev_ftm_intg_cmdid;
+ u32 vdev_set_keepalive_cmdid;
+ u32 vdev_get_keepalive_cmdid;
+ u32 force_fw_hang_cmdid;
+ u32 gpio_config_cmdid;
+ u32 gpio_output_cmdid;
+};
+
/*
* wmi command groups.
*/
--
1.7.10
^ permalink raw reply related
* [PATCH v2 00/13] ath10k: dual-firmware support (MAIN and 10.X)
From: Bartosz Markowski @ 2013-09-26 9:29 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Bartosz Markowski
This patch-set adds framework for dynamic support of 10.X FW branch.
The major changes covered by this work:
* dynamic WMI structures
* WMI cmd/event definitions from 10.x FW track
* memory host chunks feature
* management frames path over WMI for 10.x
* WMI RX events handling for MAIN and 10.X split
* target config split (LARGE AP feature for 10.x)
* scan start sctructure split
* dynamic VDEV and PDEV parameters structures
Changes in v2
(review comments from Kalle and Michal):
* WMI cmd, pdev and vdev params names trimmed
* ath10k_wmi_cmd_init() exposed only
* few 'if' statements simplifications
* 10.x mgmt frames over WMI - 'BUG: scheduling while atomic' fixed
Bartosz Markowski (13):
ath10k: introduce dynamic WMI structures
ath10k: add wmi_10x_<cmd/event> definitions
ath10k: warn if give WMI command is not supported
ath10k: implement WMI events handling frame for both firmwares
ath10k: split ath10k_wmi_service_ready_event_rx
ath10k: drop the fw versioning sanity check
ath10k: implement host memory chunks
ath10k: bring back the WMI path for mgmt frames
ath10k: split wmi_cmd_init path
ath10k: add TARGET values for 10.x firmware
ath10k: introduce dynamic vdev parameters
ath10k: introduce dynamic pdev parameters
ath10k: handle FW API differences for scan structures
drivers/net/wireless/ath/ath10k/core.c | 28 +-
drivers/net/wireless/ath/ath10k/core.h | 28 +-
drivers/net/wireless/ath/ath10k/htt_tx.c | 4 +-
drivers/net/wireless/ath/ath10k/hw.h | 37 +-
drivers/net/wireless/ath/ath10k/mac.c | 133 +++-
drivers/net/wireless/ath/ath10k/mac.h | 2 +
drivers/net/wireless/ath/ath10k/wmi.c | 1085 ++++++++++++++++++++++++++++--
drivers/net/wireless/ath/ath10k/wmi.h | 968 +++++++++++++++++++++++++-
8 files changed, 2158 insertions(+), 127 deletions(-)
--
1.7.10
^ permalink raw reply
* Re: [PATCH 01/13] ath10k: introduce dynamic WMI structures
From: Kalle Valo @ 2013-09-26 9:07 UTC (permalink / raw)
To: Michal Kazior; +Cc: Bartosz Markowski, ath10k, linux-wireless
In-Reply-To: <CA+BoTQk98WwdqyVtyHy9A1Z5kWgmkC6sHVjgaQNbrRLfm8YSiA@mail.gmail.com>
Michal Kazior <michal.kazior@tieto.com> writes:
> On 26 September 2013 10:54, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
>> Bartosz Markowski <bartosz.markowski@tieto.com> writes:
>>
>>> @@ -1293,7 +1438,8 @@ int ath10k_wmi_pdev_resume_target(struct ath10k *ar)
>>> if (skb == NULL)
>>> return -ENOMEM;
>>>
>>> - return ath10k_wmi_cmd_send(ar, skb, WMI_PDEV_RESUME_CMDID);
>>> + return ath10k_wmi_cmd_send(ar, skb,
>>> + ar->wmi.cmd->wmi_pdev_resume_cmdid);
>>> }
>>
>> I was thinking of adding a macro WMI_PDEV_RESUME_CMDID(ar) for all
>> dynamic wmi ids, that way it would look as closely as possible with the
>> original code. But I'm not sure if that makes sense anymore. Thoughts?
>
> Seems like an unnecessary indirection to me. You still need to have
> the mapping structure, unless you want to use macro concatenation (##)
> instead.
Yeah, there's no real benefit from the macro.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 07/13] ath10k: implement host memory chunks
From: Kalle Valo @ 2013-09-26 9:04 UTC (permalink / raw)
To: Bartosz Markowski; +Cc: ath10k, linux-wireless
In-Reply-To: <1380101891-18312-8-git-send-email-bartosz.markowski@tieto.com>
Bartosz Markowski <bartosz.markowski@tieto.com> writes:
> 10.X firmware can request a memory pool from host to offload
> it's own resources. This is a feature designed especially
> for AP mode where the target has to deal with large number
> of peers.
>
> So we allocate and map a consistent DMA memory which FW can
> use to store e.g. peer rate contol maps.
>
> Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
[...]
> + if (num_unit_info) {
> + if (num_unit_info & NUM_UNITS_IS_NUM_PEERS)
> + /* number of units to allocate is number of
> + * peers, 1 extra for self peer on target */
> + /* this needs to be tied, host and target
> + * can get out of sync */
> + num_units = TARGET_NUM_PEERS + 1;
> + if (num_unit_info & NUM_UNITS_IS_NUM_VDEVS)
> + num_units = TARGET_NUM_VDEVS + 1;
> + }
The outer if test looks useless. I think this can be simplified to just:
if (num_unit_info & NUM_UNITS_IS_NUM_PEERS)
....
else if (num_unit_info & NUM_UNITS_IS_NUM_VDEVS)
...
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 01/13] ath10k: introduce dynamic WMI structures
From: Michal Kazior @ 2013-09-26 9:03 UTC (permalink / raw)
To: Kalle Valo; +Cc: Bartosz Markowski, ath10k, linux-wireless
In-Reply-To: <87ob7grmhv.fsf@kamboji.qca.qualcomm.com>
On 26 September 2013 10:54, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> Bartosz Markowski <bartosz.markowski@tieto.com> writes:
>
>> This is the initial framework to implement dynamic
>> WMI API in order to support new firmware (from so
>> called 10.X branch)
>>
>> The realization is to have a static WMI cmd map for
>> each of the firmwares, registered upom wmi init.
>>
>> This patch creates such map for MAIN FW, updates
>> wmi_cmd_send() calls to take as a parameter
>> the map value instead of direct WMI enum.
>>
>> As soon as complete 10.X API will be on place,
>> we will introduce the FW IE mechanics to dynamicaly
>> identify which FW is being used and based on that
>> we will use correct map, API, structures, etc.
>>
>> Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
>> ---
>
> [...]
>
>> @@ -1293,7 +1438,8 @@ int ath10k_wmi_pdev_resume_target(struct ath10k *ar)
>> if (skb == NULL)
>> return -ENOMEM;
>>
>> - return ath10k_wmi_cmd_send(ar, skb, WMI_PDEV_RESUME_CMDID);
>> + return ath10k_wmi_cmd_send(ar, skb,
>> + ar->wmi.cmd->wmi_pdev_resume_cmdid);
>> }
>
> I was thinking of adding a macro WMI_PDEV_RESUME_CMDID(ar) for all
> dynamic wmi ids, that way it would look as closely as possible with the
> original code. But I'm not sure if that makes sense anymore. Thoughts?
Seems like an unnecessary indirection to me. You still need to have
the mapping structure, unless you want to use macro concatenation (##)
instead.
Michał.
^ permalink raw reply
* Re: [PATCH 01/13] ath10k: introduce dynamic WMI structures
From: Kalle Valo @ 2013-09-26 8:54 UTC (permalink / raw)
To: Bartosz Markowski; +Cc: ath10k, linux-wireless
In-Reply-To: <1380101891-18312-2-git-send-email-bartosz.markowski@tieto.com>
Bartosz Markowski <bartosz.markowski@tieto.com> writes:
> This is the initial framework to implement dynamic
> WMI API in order to support new firmware (from so
> called 10.X branch)
>
> The realization is to have a static WMI cmd map for
> each of the firmwares, registered upom wmi init.
>
> This patch creates such map for MAIN FW, updates
> wmi_cmd_send() calls to take as a parameter
> the map value instead of direct WMI enum.
>
> As soon as complete 10.X API will be on place,
> we will introduce the FW IE mechanics to dynamicaly
> identify which FW is being used and based on that
> we will use correct map, API, structures, etc.
>
> Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
> ---
[...]
> @@ -1293,7 +1438,8 @@ int ath10k_wmi_pdev_resume_target(struct ath10k *ar)
> if (skb == NULL)
> return -ENOMEM;
>
> - return ath10k_wmi_cmd_send(ar, skb, WMI_PDEV_RESUME_CMDID);
> + return ath10k_wmi_cmd_send(ar, skb,
> + ar->wmi.cmd->wmi_pdev_resume_cmdid);
> }
I was thinking of adding a macro WMI_PDEV_RESUME_CMDID(ar) for all
dynamic wmi ids, that way it would look as closely as possible with the
original code. But I'm not sure if that makes sense anymore. Thoughts?
--
Kalle Valo
^ permalink raw reply
* Re: bcma 3.12-rc1 scheduling while atomic
From: Daniel Borkmann @ 2013-09-26 8:17 UTC (permalink / raw)
To: Arend van Spriel
Cc: Dan Williams, linux-wireless, Hauke Mehrtens, John W. Linville
In-Reply-To: <5243E72A.4040108@broadcom.com>
On 09/26/2013 09:50 AM, Arend van Spriel wrote:
> On 09/25/2013 11:02 PM, Dan Williams wrote:
>> static int brcms_ops_start(struct ieee80211_hw *hw)
>> {
>> ...
>> spin_lock_bh(&wl->lock);
>> ...
>> err = brcms_up(wl);
>> <eventually calls usleep() from bcma_pcie_mdio_set_phy()>
>> ...
>> spin_unlock_bh(&wl->lock);
>> ...
>> }
>
> Hi Dan,
>
> I submitted two patches to John yesterday to address this.
>
> http://mid.gmane.org/1380103864-10447-3-git-send-email-arend@broadcom.com
> http://mid.gmane.org/1380103864-10447-4-git-send-email-arend@broadcom.com
Awesome, thanks !
> Regards,
> Arend
>
>> [ 7.607842] BUG: scheduling while atomic: NetworkManager/523/0x00000200
>> [ 7.607846] Modules linked in: arc4 brcmsmac cordic brcmutil b43 mac80211 nls_utf8 hfsplus snd_hda_codec_hdmi snd_hda_codec_cirrus cfg80211 i915 snd_hda_intel snd_hda_codec snd_hwdep ssb snd_seq snd_seq_device mmc_core snd_pcm joydev iTCO_wdt snd_page_alloc iTCO_vendor_support snd_timer uvcvideo x86_pkg_temp_thermal videobuf2_vmalloc videobuf2_memops videobuf2_core videodev snd coretemp kvm_intel kvm btusb bluetooth applesmc input_polldev crc32_pclmul crc32c_intel i2c_algo_bit media drm_kms_helper ghash_clmulni_intel soundcore drm rfkill microcode pcspkr bcm5974 lpc_ich mfd_core bcma i2c_i801 mei_me shpchp mei video apple_bl i2c_core
>> [ 7.607889] CPU: 0 PID: 523 Comm: NetworkManager Not tainted 3.12.0-rc1+ #3
>> [ 7.607891] Hardware name: Apple Inc. MacBookAir5,1/Mac-66F35F19FE2A0D05, BIOS MBA51.88Z.00EF.B02.1211271028 11/27/2012
>> [ 7.607893] ffff88026f214280 ffff880257751498 ffffffff81659c85 ffff8802577515d0
>> [ 7.607896] ffff8802577514a8 ffffffff81655f39 ffff880257751508 ffffffff8165e8a6
>> [ 7.607899] ffff880257751fd8 0000000000014280 ffff880257751fd8 0000000000014280
>> [ 7.607902] Call Trace:
>> [ 7.607910] [<ffffffff81659c85>] dump_stack+0x45/0x56
>> [ 7.607914] [<ffffffff81655f39>] __schedule_bug+0x4d/0x5b
>> [ 7.607918] [<ffffffff8165e8a6>] __schedule+0x746/0x750
>> [ 7.607922] [<ffffffff8165e8d9>] schedule+0x29/0x70
>> [ 7.607926] [<ffffffff8165dd0c>] schedule_hrtimeout_range_clock+0x12c/0x170
>> [ 7.607930] [<ffffffff8108cb00>] ? hrtimer_get_res+0x50/0x50
>> [ 7.607933] [<ffffffff8165dc8c>] ? schedule_hrtimeout_range_clock+0xac/0x170
>> [ 7.607936] [<ffffffff8165dd63>] schedule_hrtimeout_range+0x13/0x20
>> [ 7.607941] [<ffffffff81073bf0>] usleep_range+0x40/0x50
>> [ 7.607948] [<ffffffffa00603df>] bcma_pcie_mdio_set_phy.isra.3+0x4f/0x80 [bcma]
>> [ 7.607954] [<ffffffffa00605c7>] bcma_pcie_mdio_write.isra.5+0xc7/0xd0 [bcma]
>> [ 7.607960] [<ffffffffa00606aa>] bcma_pcie_mdio_writeread.isra.6.constprop.13+0x1a/0x30 [bcma]
>> [ 7.607965] [<ffffffffa00606fa>] bcma_core_pci_power_save+0x3a/0x70 [bcma]
>> [ 7.607971] [<ffffffffa0060869>] bcma_core_pci_up+0x29/0x60 [bcma]
>> [ 7.607981] [<ffffffffa05b55df>] brcms_c_up+0xff/0x440 [brcmsmac]
>> [ 7.607987] [<ffffffffa05ab242>] brcms_ops_start+0xf2/0x360 [brcmsmac]
>> [ 7.607999] [<ffffffffa042be3a>] ? cfg80211_netdev_notifier_call+0x40a/0x600 [cfg80211]
>> [ 7.608005] [<ffffffff815c9f48>] ? inetdev_event+0x38/0x510
>> [ 7.608019] [<ffffffffa04cda71>] ieee80211_do_open+0x2e1/0xd80 [mac80211]
>> [ 7.608022] [<ffffffff8166466c>] ? notifier_call_chain+0x4c/0x70
>> [ 7.608032] [<ffffffffa04ce579>] ieee80211_open+0x69/0x70 [mac80211]
>> [ 7.608036] [<ffffffff8155f14f>] __dev_open+0xbf/0x140
>> [ 7.608040] [<ffffffff8155f412>] __dev_change_flags+0x92/0x170
>> [ 7.608043] [<ffffffff8155f59d>] dev_change_flags+0x1d/0x60
>> [ 7.608047] [<ffffffff8156ca69>] do_setlink+0x339/0xa00
>> [ 7.608051] [<ffffffff8131f020>] ? __nla_put+0x20/0x30
>> [ 7.608063] [<ffffffffa044544c>] ? nl80211_send_wiphy+0x3fc/0x2470 [cfg80211]
>> [ 7.608066] [<ffffffff8131edd2>] ? nla_parse+0x32/0xe0
>> [ 7.608070] [<ffffffff8156dd94>] rtnl_newlink+0x394/0x5e0
>> [ 7.608075] [<ffffffff8129e63e>] ? selinux_capable+0x2e/0x40
>> [ 7.608079] [<ffffffff8156a769>] rtnetlink_rcv_msg+0x99/0x260
>> [ 7.608082] [<ffffffff8129b8c5>] ? sock_has_perm+0x75/0x90
>> [ 7.608085] [<ffffffff8156a6d0>] ? rtnetlink_rcv+0x30/0x30
>> [ 7.608089] [<ffffffff81589709>] netlink_rcv_skb+0xa9/0xc0
>> [ 7.608093] [<ffffffff8156a6c8>] rtnetlink_rcv+0x28/0x30
>> [ 7.608097] [<ffffffff81588d5d>] netlink_unicast+0xdd/0x190
>> [ 7.608100] [<ffffffff8158910f>] netlink_sendmsg+0x2ff/0x740
>> [ 7.608104] [<ffffffff81585d02>] ? netlink_seq_next+0x142/0x150
>> [ 7.608107] [<ffffffff8158707c>] ? netlink_recvmsg+0x1ec/0x390
>> [ 7.608112] [<ffffffff81544b9b>] sock_sendmsg+0x8b/0xc0
>> [ 7.608116] [<ffffffff8154488e>] ? move_addr_to_kernel.part.16+0x1e/0x60
>> [ 7.608120] [<ffffffff81545401>] ? move_addr_to_kernel+0x21/0x30
>> [ 7.608123] [<ffffffff815453cc>] ___sys_sendmsg+0x36c/0x380
>> [ 7.608127] [<ffffffff81544d95>] ? SYSC_sendto+0x175/0x1c0
>> [ 7.608131] [<ffffffff81545ad2>] __sys_sendmsg+0x42/0x80
>> [ 7.608134] [<ffffffff81545b22>] SyS_sendmsg+0x12/0x20
>> [ 7.608138] [<ffffffff81668c29>] system_call_fastpath+0x16/0x1b
>>
>>
>
>
^ permalink raw reply
* Re: [PATCH 09/13] ath10k: split wmi_cmd_init path
From: Kalle Valo @ 2013-09-26 8:15 UTC (permalink / raw)
To: Bartosz Markowski; +Cc: ath10k, linux-wireless
In-Reply-To: <1380101891-18312-10-git-send-email-bartosz.markowski@tieto.com>
Bartosz Markowski <bartosz.markowski@tieto.com> writes:
> Due to API differences in initialization structures for
> main and 10.x firmwares we need to split the wmi_init_cmd
> and wmi_resource_config structures.
>
> This will be usefull also when setting the correct TARGET values,
> like: number of peers, vdevs, pdevs etc.
>
> Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
> ---
> drivers/net/wireless/ath/ath10k/core.c | 6 +-
> drivers/net/wireless/ath/ath10k/wmi.c | 91 +++++++++++++++
> drivers/net/wireless/ath/ath10k/wmi.h | 196 ++++++++++++++++++++++++++++++++
> 3 files changed, 292 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
> index 31860a6..3a56715 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -595,7 +595,11 @@ int ath10k_core_start(struct ath10k *ar)
>
> ath10k_info("firmware %s booted\n", ar->hw->wiphy->fw_version);
>
> - status = ath10k_wmi_cmd_init(ar);
> + if (test_bit(ATH10K_FW_FEATURE_10X, ar->fw_features))
> + status = ath10k_wmi_10x_cmd_init(ar);
> + else
> + status = ath10k_wmi_cmd_init(ar);
It's better to hide the feature check inside ath10k_wmi_cmd_init() and
then that function can just call ath10k_wmi_10x_cmd_init() or
ath10k_wmi_main_cmd_init() (or whatever naming would be approriate
here). So we only expose ath10k_wmi_cmd_init() outside of wmi.c.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 01/13] ath10k: introduce dynamic WMI structures
From: Kalle Valo @ 2013-09-26 8:12 UTC (permalink / raw)
To: Bartosz Markowski; +Cc: ath10k, linux-wireless
In-Reply-To: <1380101891-18312-2-git-send-email-bartosz.markowski@tieto.com>
Bartosz Markowski <bartosz.markowski@tieto.com> writes:
> This is the initial framework to implement dynamic
> WMI API in order to support new firmware (from so
> called 10.X branch)
>
> The realization is to have a static WMI cmd map for
> each of the firmwares, registered upom wmi init.
>
> This patch creates such map for MAIN FW, updates
> wmi_cmd_send() calls to take as a parameter
> the map value instead of direct WMI enum.
>
> As soon as complete 10.X API will be on place,
> we will introduce the FW IE mechanics to dynamicaly
> identify which FW is being used and based on that
> we will use correct map, API, structures, etc.
>
> Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
[...]
> @@ -268,6 +269,9 @@ enum ath10k_fw_features {
> /* wmi_mgmt_rx_hdr contains extra RSSI information */
> ATH10K_FW_FEATURE_EXT_WMI_MGMT_RX = 0,
>
> + /* firmware from 10X branch */
> + ATH10K_FW_FEATURE_10X = 1,
> +
As this feature bit seems to be only used related the WMI code, I think
it's better to rename it to ATH10K_FW_FEATURE_WMI_10X. Better to keep
the scope of feature bits as small as practically possible. That way
it's easier to disable features when the firmware interface changes.
--
Kalle Valo
^ permalink raw reply
* Re: bcma 3.12-rc1 scheduling while atomic
From: Arend van Spriel @ 2013-09-26 7:50 UTC (permalink / raw)
To: Dan Williams, linux-wireless
Cc: Daniel Borkmann, Hauke Mehrtens, John W. Linville
In-Reply-To: <1380142945.23272.42.camel@dcbw.foobar.com>
On 09/25/2013 11:02 PM, Dan Williams wrote:
> static int brcms_ops_start(struct ieee80211_hw *hw)
> {
> ...
> spin_lock_bh(&wl->lock);
> ...
> err = brcms_up(wl);
> <eventually calls usleep() from bcma_pcie_mdio_set_phy()>
> ...
> spin_unlock_bh(&wl->lock);
> ...
> }
Hi Dan,
I submitted two patches to John yesterday to address this.
http://mid.gmane.org/1380103864-10447-3-git-send-email-arend@broadcom.com
http://mid.gmane.org/1380103864-10447-4-git-send-email-arend@broadcom.com
Regards,
Arend
> [ 7.607842] BUG: scheduling while atomic: NetworkManager/523/0x00000200
> [ 7.607846] Modules linked in: arc4 brcmsmac cordic brcmutil b43 mac80211 nls_utf8 hfsplus snd_hda_codec_hdmi snd_hda_codec_cirrus cfg80211 i915 snd_hda_intel snd_hda_codec snd_hwdep ssb snd_seq snd_seq_device mmc_core snd_pcm joydev iTCO_wdt snd_page_alloc iTCO_vendor_support snd_timer uvcvideo x86_pkg_temp_thermal videobuf2_vmalloc videobuf2_memops videobuf2_core videodev snd coretemp kvm_intel kvm btusb bluetooth applesmc input_polldev crc32_pclmul crc32c_intel i2c_algo_bit media drm_kms_helper ghash_clmulni_intel soundcore drm rfkill microcode pcspkr bcm5974 lpc_ich mfd_core bcma i2c_i801 mei_me shpchp mei video apple_bl i2c_core
> [ 7.607889] CPU: 0 PID: 523 Comm: NetworkManager Not tainted 3.12.0-rc1+ #3
> [ 7.607891] Hardware name: Apple Inc. MacBookAir5,1/Mac-66F35F19FE2A0D05, BIOS MBA51.88Z.00EF.B02.1211271028 11/27/2012
> [ 7.607893] ffff88026f214280 ffff880257751498 ffffffff81659c85 ffff8802577515d0
> [ 7.607896] ffff8802577514a8 ffffffff81655f39 ffff880257751508 ffffffff8165e8a6
> [ 7.607899] ffff880257751fd8 0000000000014280 ffff880257751fd8 0000000000014280
> [ 7.607902] Call Trace:
> [ 7.607910] [<ffffffff81659c85>] dump_stack+0x45/0x56
> [ 7.607914] [<ffffffff81655f39>] __schedule_bug+0x4d/0x5b
> [ 7.607918] [<ffffffff8165e8a6>] __schedule+0x746/0x750
> [ 7.607922] [<ffffffff8165e8d9>] schedule+0x29/0x70
> [ 7.607926] [<ffffffff8165dd0c>] schedule_hrtimeout_range_clock+0x12c/0x170
> [ 7.607930] [<ffffffff8108cb00>] ? hrtimer_get_res+0x50/0x50
> [ 7.607933] [<ffffffff8165dc8c>] ? schedule_hrtimeout_range_clock+0xac/0x170
> [ 7.607936] [<ffffffff8165dd63>] schedule_hrtimeout_range+0x13/0x20
> [ 7.607941] [<ffffffff81073bf0>] usleep_range+0x40/0x50
> [ 7.607948] [<ffffffffa00603df>] bcma_pcie_mdio_set_phy.isra.3+0x4f/0x80 [bcma]
> [ 7.607954] [<ffffffffa00605c7>] bcma_pcie_mdio_write.isra.5+0xc7/0xd0 [bcma]
> [ 7.607960] [<ffffffffa00606aa>] bcma_pcie_mdio_writeread.isra.6.constprop.13+0x1a/0x30 [bcma]
> [ 7.607965] [<ffffffffa00606fa>] bcma_core_pci_power_save+0x3a/0x70 [bcma]
> [ 7.607971] [<ffffffffa0060869>] bcma_core_pci_up+0x29/0x60 [bcma]
> [ 7.607981] [<ffffffffa05b55df>] brcms_c_up+0xff/0x440 [brcmsmac]
> [ 7.607987] [<ffffffffa05ab242>] brcms_ops_start+0xf2/0x360 [brcmsmac]
> [ 7.607999] [<ffffffffa042be3a>] ? cfg80211_netdev_notifier_call+0x40a/0x600 [cfg80211]
> [ 7.608005] [<ffffffff815c9f48>] ? inetdev_event+0x38/0x510
> [ 7.608019] [<ffffffffa04cda71>] ieee80211_do_open+0x2e1/0xd80 [mac80211]
> [ 7.608022] [<ffffffff8166466c>] ? notifier_call_chain+0x4c/0x70
> [ 7.608032] [<ffffffffa04ce579>] ieee80211_open+0x69/0x70 [mac80211]
> [ 7.608036] [<ffffffff8155f14f>] __dev_open+0xbf/0x140
> [ 7.608040] [<ffffffff8155f412>] __dev_change_flags+0x92/0x170
> [ 7.608043] [<ffffffff8155f59d>] dev_change_flags+0x1d/0x60
> [ 7.608047] [<ffffffff8156ca69>] do_setlink+0x339/0xa00
> [ 7.608051] [<ffffffff8131f020>] ? __nla_put+0x20/0x30
> [ 7.608063] [<ffffffffa044544c>] ? nl80211_send_wiphy+0x3fc/0x2470 [cfg80211]
> [ 7.608066] [<ffffffff8131edd2>] ? nla_parse+0x32/0xe0
> [ 7.608070] [<ffffffff8156dd94>] rtnl_newlink+0x394/0x5e0
> [ 7.608075] [<ffffffff8129e63e>] ? selinux_capable+0x2e/0x40
> [ 7.608079] [<ffffffff8156a769>] rtnetlink_rcv_msg+0x99/0x260
> [ 7.608082] [<ffffffff8129b8c5>] ? sock_has_perm+0x75/0x90
> [ 7.608085] [<ffffffff8156a6d0>] ? rtnetlink_rcv+0x30/0x30
> [ 7.608089] [<ffffffff81589709>] netlink_rcv_skb+0xa9/0xc0
> [ 7.608093] [<ffffffff8156a6c8>] rtnetlink_rcv+0x28/0x30
> [ 7.608097] [<ffffffff81588d5d>] netlink_unicast+0xdd/0x190
> [ 7.608100] [<ffffffff8158910f>] netlink_sendmsg+0x2ff/0x740
> [ 7.608104] [<ffffffff81585d02>] ? netlink_seq_next+0x142/0x150
> [ 7.608107] [<ffffffff8158707c>] ? netlink_recvmsg+0x1ec/0x390
> [ 7.608112] [<ffffffff81544b9b>] sock_sendmsg+0x8b/0xc0
> [ 7.608116] [<ffffffff8154488e>] ? move_addr_to_kernel.part.16+0x1e/0x60
> [ 7.608120] [<ffffffff81545401>] ? move_addr_to_kernel+0x21/0x30
> [ 7.608123] [<ffffffff815453cc>] ___sys_sendmsg+0x36c/0x380
> [ 7.608127] [<ffffffff81544d95>] ? SYSC_sendto+0x175/0x1c0
> [ 7.608131] [<ffffffff81545ad2>] __sys_sendmsg+0x42/0x80
> [ 7.608134] [<ffffffff81545b22>] SyS_sendmsg+0x12/0x20
> [ 7.608138] [<ffffffff81668c29>] system_call_fastpath+0x16/0x1b
>
>
^ permalink raw reply
* Re: [PATCH 0/5] ath10k: improve RX performance
From: Michal Kazior @ 2013-09-26 7:45 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath10k, linux-wireless
In-Reply-To: <87a9j0t5ep.fsf@kamboji.qca.qualcomm.com>
On 26 September 2013 09:21, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> Michal Kazior <michal.kazior@tieto.com> writes:
>
>> This patchset gives clear RX performance
>> improvement on AP135. Throughput is at least
>> doubled (300mbps -> 600mbps, UDP RX, 2x2).
>>
>> This contains a workaround for
>> retransmission/duplication recovery.
>>
>> There's a pending patch for mac80211 that will
>> allow proper individiual A-MSDU subframe
>> reporting.
>>
>> Changes since RFC:
>> * comments fixes (Kalle)
>> * one patch extracted/split (Kalle)
>> * commit message adjustments
>>
>>
>> Michal Kazior (5):
>> ath10k: report A-MSDU subframes individually
>> ath10k: document decap modes
>> ath10k: cleanup RX decap handling
>> ath10k: fix Native Wifi decap mode RX
>> ath10k: align RX frames properly
>
> All five applies, thanks.
>
> There were few long lines, I fixed those myself. Can you please double
> check that I didn't break anything?
>
> Kalle
>
> For patch 1 I did:
>
> (...)
Looks good. Thanks!
Michał.
^ permalink raw reply
* [PATCH] cfg80211: Provision to pass probe response ie along with remain on channel request
From: Sreenath Sharma @ 2013-09-26 7:34 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, j
The probe response ie should be set in driver before the listen state
for a listen only P2P device. Right now probe response ie is set using
driver specific private command implementations. This commit enhances the
remain_on_channel command handler to pass probe response ie along with
rest of the arguments.
Another approach is the addition of a new nl80211 command specific to pass
ies to driver. This will give more flexibilty to upper layer.
Signed-off-by: Sreenath Sharma <sreenats@broadcom.com>
---
include/net/cfg80211.h | 24 +++++++++++++++++++++---
net/wireless/nl80211.c | 42 ++++++++++++++++++++++++++++++++++--------
net/wireless/rdev-ops.h | 11 +++++------
3 files changed, 60 insertions(+), 17 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d530c54..71f7d84 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1425,6 +1425,26 @@ struct cfg80211_sched_scan_request {
};
/**
+ * struct cfg80211_roc_request - remain on channel request description
+ *
+ * @chandef: defines the channel to remain on
+ * @duration: duration in milliseconds that the driver intents to remain on the
+ * channel
+ * @ie: optional information element(s) to add into Probe Response or %NULL
+ * @ie_len: length of ie in octets
+ * @cookie: the request cookie to be filled by the driver
+ */
+struct cfg80211_roc_request {
+ struct cfg80211_chan_def chandef;
+ unsigned int duration;
+ const u8 *ie;
+ size_t ie_len;
+
+ /* keep last */
+ u64 *cookie;
+};
+
+/**
* enum cfg80211_signal_type - signal type
*
* @CFG80211_SIGNAL_TYPE_NONE: no signal strength information available
@@ -2313,9 +2333,7 @@ struct cfg80211_ops {
int (*remain_on_channel)(struct wiphy *wiphy,
struct wireless_dev *wdev,
- struct ieee80211_channel *chan,
- unsigned int duration,
- u64 *cookie);
+ struct cfg80211_roc_request *request);
int (*cancel_remain_on_channel)(struct wiphy *wiphy,
struct wireless_dev *wdev,
u64 cookie);
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index af8d84a..c0db346 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7093,12 +7093,13 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
{
struct cfg80211_registered_device *rdev = info->user_ptr[0];
struct wireless_dev *wdev = info->user_ptr[1];
+ struct cfg80211_roc_request *request;
struct cfg80211_chan_def chandef;
struct sk_buff *msg;
void *hdr;
- u64 cookie;
u32 duration;
int err;
+ size_t ie_len;
if (!info->attrs[NL80211_ATTR_WIPHY_FREQ] ||
!info->attrs[NL80211_ATTR_DURATION])
@@ -7122,24 +7123,47 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
if (err)
return err;
- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
- if (!msg)
+ if (info->attrs[NL80211_ATTR_IE])
+ ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
+ else
+ ie_len = 0;
+ if (ie_len > rdev->wiphy.max_scan_ie_len)
+ return -EINVAL;
+ request = kzalloc(sizeof(*request)
+ + sizeof(*request->cookie)
+ + ie_len, GFP_KERNEL);
+ if (!request)
return -ENOMEM;
+ memcpy(&request->chandef, &chandef, sizeof(request->chandef));
+ request->duration = duration;
+ if (ie_len) {
+ request->ie_len = ie_len;
+ request->ie = (void *)(request) + sizeof(*request);
+ memcpy((void *)request->ie,
+ nla_data(info->attrs[NL80211_ATTR_IE]),
+ request->ie_len);
+ request->cookie = (void *)(request->ie) + request->ie_len;
+ } else
+ request->cookie = (void *)(request) + sizeof(*request);
+ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+ if (!msg) {
+ err = -ENOMEM;
+ goto free_buf;
+ }
hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
NL80211_CMD_REMAIN_ON_CHANNEL);
- if (!hdr) {
- err = -ENOBUFS;
+ if (IS_ERR(hdr)) {
+ err = PTR_ERR(hdr);
goto free_msg;
}
- err = rdev_remain_on_channel(rdev, wdev, chandef.chan,
- duration, &cookie);
+ err = rdev_remain_on_channel(rdev, wdev, request);
if (err)
goto free_msg;
- if (nla_put_u64(msg, NL80211_ATTR_COOKIE, cookie))
+ if (nla_put_u64(msg, NL80211_ATTR_COOKIE, *request->cookie))
goto nla_put_failure;
genlmsg_end(msg, hdr);
@@ -7150,6 +7174,8 @@ static int nl80211_remain_on_channel(struct sk_buff *skb,
err = -ENOBUFS;
free_msg:
nlmsg_free(msg);
+ free_buf:
+ kfree(request);
return err;
}
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index 37ce9fd..e521116 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -600,14 +600,13 @@ static inline int rdev_flush_pmksa(struct cfg80211_registered_device *rdev,
static inline int
rdev_remain_on_channel(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev,
- struct ieee80211_channel *chan,
- unsigned int duration, u64 *cookie)
+ struct cfg80211_roc_request *request)
{
int ret;
- trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, duration);
- ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan,
- duration, cookie);
- trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
+ trace_rdev_remain_on_channel(&rdev->wiphy, wdev, request->chandef.chan,
+ request->duration);
+ ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, request);
+ trace_rdev_return_int_cookie(&rdev->wiphy, ret, *request->cookie);
return ret;
}
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH 05/11] brcm80211: Remove extern from function prototypes
From: Arend van Spriel @ 2013-09-26 7:32 UTC (permalink / raw)
To: Joe Perches, netdev
Cc: David S. Miller, Brett Rudley, Franky (Zhenhui) Lin,
Hante Meuleman, John W. Linville, linux-wireless,
brcm80211-dev-list, linux-kernel
In-Reply-To: <9bd91f3c00bd8dd54339499a9253b31c6bac7c7b.1380137609.git.joe@perches.com>
On 09/25/2013 09:37 PM, Joe Perches wrote:
> There are a mix of function prototypes with and without extern
> in the kernel sources. Standardize on not using extern for
> function prototypes.
>
> Function prototypes don't need to be written with extern.
> extern is assumed by the compiler. Its use is as unnecessary as
> using auto to declare automatic/local variables in a block.
Acked-by: Arend van Spriel <arend@broadcom.com>
> Signed-off-by: Joe Perches <joe@perches.com>
As a side note, I submitted a patch to the wireless tree yesterday
adding a function prototype and I decided to ignore the checkpatch
warning and follow the convention in the header file (for now). So that
patch is going to collide with this one.
Regards,
Arend
> ---
> drivers/net/wireless/brcm80211/brcmfmac/dhd.h | 30 +-
> drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h | 27 +-
> .../net/wireless/brcm80211/brcmfmac/dhd_proto.h | 12 +-
> .../net/wireless/brcm80211/brcmfmac/sdio_chip.h | 23 +-
> .../net/wireless/brcm80211/brcmfmac/sdio_host.h | 92 +++--
> drivers/net/wireless/brcm80211/brcmsmac/aiutils.h | 18 +-
> drivers/net/wireless/brcm80211/brcmsmac/ampdu.h | 22 +-
> drivers/net/wireless/brcm80211/brcmsmac/antsel.h | 14 +-
> drivers/net/wireless/brcm80211/brcmsmac/channel.h | 20 +-
> .../net/wireless/brcm80211/brcmsmac/mac80211_if.h | 38 +--
> drivers/net/wireless/brcm80211/brcmsmac/main.h | 110 +++---
> .../net/wireless/brcm80211/brcmsmac/phy/phy_hal.h | 219 ++++++------
> .../net/wireless/brcm80211/brcmsmac/phy/phy_int.h | 371 ++++++++++-----------
> drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h | 91 +++--
> drivers/net/wireless/brcm80211/brcmsmac/pmu.h | 4 +-
> drivers/net/wireless/brcm80211/brcmsmac/pub.h | 145 ++++----
> drivers/net/wireless/brcm80211/brcmsmac/rate.h | 48 ++-
> drivers/net/wireless/brcm80211/brcmsmac/stf.h | 31 +-
> .../net/wireless/brcm80211/brcmsmac/ucode_loader.h | 16 +-
> drivers/net/wireless/brcm80211/include/brcmu_d11.h | 2 +-
> .../net/wireless/brcm80211/include/brcmu_utils.h | 44 ++-
> 21 files changed, 644 insertions(+), 733 deletions(-)
>
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
> index 2eb9e64..34af9d1 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
> @@ -632,29 +632,29 @@ struct brcmf_skb_reorder_data {
> u8 *reorder;
> };
>
> -extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev);
> +int brcmf_netdev_wait_pend8021x(struct net_device *ndev);
>
> /* Return pointer to interface name */
> -extern char *brcmf_ifname(struct brcmf_pub *drvr, int idx);
> +char *brcmf_ifname(struct brcmf_pub *drvr, int idx);
>
> /* Query dongle */
> -extern int brcmf_proto_cdc_query_dcmd(struct brcmf_pub *drvr, int ifidx,
> - uint cmd, void *buf, uint len);
> -extern int brcmf_proto_cdc_set_dcmd(struct brcmf_pub *drvr, int ifidx, uint cmd,
> - void *buf, uint len);
> +int brcmf_proto_cdc_query_dcmd(struct brcmf_pub *drvr, int ifidx, uint cmd,
> + void *buf, uint len);
> +int brcmf_proto_cdc_set_dcmd(struct brcmf_pub *drvr, int ifidx, uint cmd,
> + void *buf, uint len);
>
> /* Remove any protocol-specific data header. */
> -extern int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws, u8 *ifidx,
> - struct sk_buff *rxp);
> +int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws, u8 *ifidx,
> + struct sk_buff *rxp);
>
> -extern int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked);
> -extern struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx,
> - s32 ifidx, char *name, u8 *mac_addr);
> -extern void brcmf_del_if(struct brcmf_pub *drvr, s32 bssidx);
> +int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked);
> +struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx,
> + char *name, u8 *mac_addr);
> +void brcmf_del_if(struct brcmf_pub *drvr, s32 bssidx);
> void brcmf_txflowblock_if(struct brcmf_if *ifp,
> enum brcmf_netif_stop_reason reason, bool state);
> -extern u32 brcmf_get_chip_info(struct brcmf_if *ifp);
> -extern void brcmf_txfinalize(struct brcmf_pub *drvr, struct sk_buff *txp,
> - bool success);
> +u32 brcmf_get_chip_info(struct brcmf_if *ifp);
> +void brcmf_txfinalize(struct brcmf_pub *drvr, struct sk_buff *txp,
> + bool success);
>
> #endif /* _BRCMF_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
> index f7c1985..5bc0276 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
> @@ -132,34 +132,33 @@ struct pktq *brcmf_bus_gettxq(struct brcmf_bus *bus)
> * interface functions from common layer
> */
>
> -extern bool brcmf_c_prec_enq(struct device *dev, struct pktq *q,
> - struct sk_buff *pkt, int prec);
> +bool brcmf_c_prec_enq(struct device *dev, struct pktq *q, struct sk_buff *pkt,
> + int prec);
>
> /* Receive frame for delivery to OS. Callee disposes of rxp. */
> -extern void brcmf_rx_frames(struct device *dev, struct sk_buff_head *rxlist);
> +void brcmf_rx_frames(struct device *dev, struct sk_buff_head *rxlist);
>
> /* Indication from bus module regarding presence/insertion of dongle. */
> -extern int brcmf_attach(uint bus_hdrlen, struct device *dev);
> +int brcmf_attach(uint bus_hdrlen, struct device *dev);
> /* Indication from bus module regarding removal/absence of dongle */
> -extern void brcmf_detach(struct device *dev);
> +void brcmf_detach(struct device *dev);
> /* Indication from bus module that dongle should be reset */
> -extern void brcmf_dev_reset(struct device *dev);
> +void brcmf_dev_reset(struct device *dev);
> /* Indication from bus module to change flow-control state */
> -extern void brcmf_txflowblock(struct device *dev, bool state);
> +void brcmf_txflowblock(struct device *dev, bool state);
>
> /* Notify the bus has transferred the tx packet to firmware */
> -extern void brcmf_txcomplete(struct device *dev, struct sk_buff *txp,
> - bool success);
> +void brcmf_txcomplete(struct device *dev, struct sk_buff *txp, bool success);
>
> -extern int brcmf_bus_start(struct device *dev);
> +int brcmf_bus_start(struct device *dev);
>
> #ifdef CONFIG_BRCMFMAC_SDIO
> -extern void brcmf_sdio_exit(void);
> -extern void brcmf_sdio_init(void);
> +void brcmf_sdio_exit(void);
> +void brcmf_sdio_init(void);
> #endif
> #ifdef CONFIG_BRCMFMAC_USB
> -extern void brcmf_usb_exit(void);
> -extern void brcmf_usb_init(void);
> +void brcmf_usb_exit(void);
> +void brcmf_usb_init(void);
> #endif
>
> #endif /* _BRCMF_BUS_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_proto.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd_proto.h
> index ef91798..53c6e71 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_proto.h
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_proto.h
> @@ -22,21 +22,21 @@
> */
>
> /* Linkage, sets prot link and updates hdrlen in pub */
> -extern int brcmf_proto_attach(struct brcmf_pub *drvr);
> +int brcmf_proto_attach(struct brcmf_pub *drvr);
>
> /* Unlink, frees allocated protocol memory (including brcmf_proto) */
> -extern void brcmf_proto_detach(struct brcmf_pub *drvr);
> +void brcmf_proto_detach(struct brcmf_pub *drvr);
>
> /* Stop protocol: sync w/dongle state. */
> -extern void brcmf_proto_stop(struct brcmf_pub *drvr);
> +void brcmf_proto_stop(struct brcmf_pub *drvr);
>
> /* Add any protocol-specific data header.
> * Caller must reserve prot_hdrlen prepend space.
> */
> -extern void brcmf_proto_hdrpush(struct brcmf_pub *, int ifidx, u8 offset,
> - struct sk_buff *txp);
> +void brcmf_proto_hdrpush(struct brcmf_pub *, int ifidx, u8 offset,
> + struct sk_buff *txp);
>
> /* Sets dongle media info (drv_version, mac address). */
> -extern int brcmf_c_preinit_dcmds(struct brcmf_if *ifp);
> +int brcmf_c_preinit_dcmds(struct brcmf_if *ifp);
>
> #endif /* _BRCMF_PROTO_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h
> index 83c041f..f0780ee 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h
> @@ -215,17 +215,16 @@ struct sdpcmd_regs {
> u16 PAD[0x80];
> };
>
> -extern int brcmf_sdio_chip_attach(struct brcmf_sdio_dev *sdiodev,
> - struct chip_info **ci_ptr, u32 regs);
> -extern void brcmf_sdio_chip_detach(struct chip_info **ci_ptr);
> -extern void brcmf_sdio_chip_drivestrengthinit(struct brcmf_sdio_dev *sdiodev,
> - struct chip_info *ci,
> - u32 drivestrength);
> -extern u8 brcmf_sdio_chip_getinfidx(struct chip_info *ci, u16 coreid);
> -extern void brcmf_sdio_chip_enter_download(struct brcmf_sdio_dev *sdiodev,
> - struct chip_info *ci);
> -extern bool brcmf_sdio_chip_exit_download(struct brcmf_sdio_dev *sdiodev,
> - struct chip_info *ci, char *nvram_dat,
> - uint nvram_sz);
> +int brcmf_sdio_chip_attach(struct brcmf_sdio_dev *sdiodev,
> + struct chip_info **ci_ptr, u32 regs);
> +void brcmf_sdio_chip_detach(struct chip_info **ci_ptr);
> +void brcmf_sdio_chip_drivestrengthinit(struct brcmf_sdio_dev *sdiodev,
> + struct chip_info *ci, u32 drivestrength);
> +u8 brcmf_sdio_chip_getinfidx(struct chip_info *ci, u16 coreid);
> +void brcmf_sdio_chip_enter_download(struct brcmf_sdio_dev *sdiodev,
> + struct chip_info *ci);
> +bool brcmf_sdio_chip_exit_download(struct brcmf_sdio_dev *sdiodev,
> + struct chip_info *ci, char *nvram_dat,
> + uint nvram_sz);
>
> #endif /* _BRCMFMAC_SDIO_CHIP_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h b/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h
> index 2b5407f..c9b06b4 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h
> @@ -181,18 +181,18 @@ struct brcmf_sdio_dev {
> };
>
> /* Register/deregister interrupt handler. */
> -extern int brcmf_sdio_intr_register(struct brcmf_sdio_dev *sdiodev);
> -extern int brcmf_sdio_intr_unregister(struct brcmf_sdio_dev *sdiodev);
> +int brcmf_sdio_intr_register(struct brcmf_sdio_dev *sdiodev);
> +int brcmf_sdio_intr_unregister(struct brcmf_sdio_dev *sdiodev);
>
> /* sdio device register access interface */
> -extern u8 brcmf_sdio_regrb(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret);
> -extern u32 brcmf_sdio_regrl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret);
> -extern void brcmf_sdio_regwb(struct brcmf_sdio_dev *sdiodev, u32 addr,
> - u8 data, int *ret);
> -extern void brcmf_sdio_regwl(struct brcmf_sdio_dev *sdiodev, u32 addr,
> - u32 data, int *ret);
> -extern int brcmf_sdio_regrw_helper(struct brcmf_sdio_dev *sdiodev, u32 addr,
> - void *data, bool write);
> +u8 brcmf_sdio_regrb(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret);
> +u32 brcmf_sdio_regrl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret);
> +void brcmf_sdio_regwb(struct brcmf_sdio_dev *sdiodev, u32 addr, u8 data,
> + int *ret);
> +void brcmf_sdio_regwl(struct brcmf_sdio_dev *sdiodev, u32 addr, u32 data,
> + int *ret);
> +int brcmf_sdio_regrw_helper(struct brcmf_sdio_dev *sdiodev, u32 addr,
> + void *data, bool write);
>
> /* Buffer transfer to/from device (client) core via cmd53.
> * fn: function number
> @@ -206,22 +206,17 @@ extern int brcmf_sdio_regrw_helper(struct brcmf_sdio_dev *sdiodev, u32 addr,
> * Returns 0 or error code.
> * NOTE: Async operation is not currently supported.
> */
> -extern int
> -brcmf_sdcard_send_pkt(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> - uint flags, struct sk_buff_head *pktq);
> -extern int
> -brcmf_sdcard_send_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> - uint flags, u8 *buf, uint nbytes);
> -
> -extern int
> -brcmf_sdcard_recv_pkt(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> - uint flags, struct sk_buff *pkt);
> -extern int
> -brcmf_sdcard_recv_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> - uint flags, u8 *buf, uint nbytes);
> -extern int
> -brcmf_sdcard_recv_chain(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> - uint flags, struct sk_buff_head *pktq);
> +int brcmf_sdcard_send_pkt(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> + uint flags, struct sk_buff_head *pktq);
> +int brcmf_sdcard_send_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> + uint flags, u8 *buf, uint nbytes);
> +
> +int brcmf_sdcard_recv_pkt(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> + uint flags, struct sk_buff *pkt);
> +int brcmf_sdcard_recv_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> + uint flags, u8 *buf, uint nbytes);
> +int brcmf_sdcard_recv_chain(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> + uint flags, struct sk_buff_head *pktq);
>
> /* Flags bits */
>
> @@ -237,46 +232,43 @@ brcmf_sdcard_recv_chain(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> * nbytes: number of bytes to transfer to/from buf
> * Returns 0 or error code.
> */
> -extern int brcmf_sdcard_rwdata(struct brcmf_sdio_dev *sdiodev, uint rw,
> - u32 addr, u8 *buf, uint nbytes);
> -extern int brcmf_sdio_ramrw(struct brcmf_sdio_dev *sdiodev, bool write,
> - u32 address, u8 *data, uint size);
> +int brcmf_sdcard_rwdata(struct brcmf_sdio_dev *sdiodev, uint rw, u32 addr,
> + u8 *buf, uint nbytes);
> +int brcmf_sdio_ramrw(struct brcmf_sdio_dev *sdiodev, bool write, u32 address,
> + u8 *data, uint size);
>
> /* Issue an abort to the specified function */
> -extern int brcmf_sdcard_abort(struct brcmf_sdio_dev *sdiodev, uint fn);
> +int brcmf_sdcard_abort(struct brcmf_sdio_dev *sdiodev, uint fn);
>
> /* platform specific/high level functions */
> -extern int brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev);
> -extern int brcmf_sdio_remove(struct brcmf_sdio_dev *sdiodev);
> +int brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev);
> +int brcmf_sdio_remove(struct brcmf_sdio_dev *sdiodev);
>
> /* attach, return handler on success, NULL if failed.
> * The handler shall be provided by all subsequent calls. No local cache
> * cfghdl points to the starting address of pci device mapped memory
> */
> -extern int brcmf_sdioh_attach(struct brcmf_sdio_dev *sdiodev);
> -extern void brcmf_sdioh_detach(struct brcmf_sdio_dev *sdiodev);
> +int brcmf_sdioh_attach(struct brcmf_sdio_dev *sdiodev);
> +void brcmf_sdioh_detach(struct brcmf_sdio_dev *sdiodev);
>
> /* read or write one byte using cmd52 */
> -extern int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw,
> - uint fnc, uint addr, u8 *byte);
> +int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint fnc,
> + uint addr, u8 *byte);
>
> /* read or write 2/4 bytes using cmd53 */
> -extern int
> -brcmf_sdioh_request_word(struct brcmf_sdio_dev *sdiodev,
> - uint rw, uint fnc, uint addr,
> - u32 *word, uint nbyte);
> +int brcmf_sdioh_request_word(struct brcmf_sdio_dev *sdiodev, uint rw, uint fnc,
> + uint addr, u32 *word, uint nbyte);
>
> /* Watchdog timer interface for pm ops */
> -extern void brcmf_sdio_wdtmr_enable(struct brcmf_sdio_dev *sdiodev,
> - bool enable);
> +void brcmf_sdio_wdtmr_enable(struct brcmf_sdio_dev *sdiodev, bool enable);
>
> -extern void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev);
> -extern void brcmf_sdbrcm_disconnect(void *ptr);
> -extern void brcmf_sdbrcm_isr(void *arg);
> +void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev);
> +void brcmf_sdbrcm_disconnect(void *ptr);
> +void brcmf_sdbrcm_isr(void *arg);
>
> -extern void brcmf_sdbrcm_wd_timer(struct brcmf_sdio *bus, uint wdtick);
> +void brcmf_sdbrcm_wd_timer(struct brcmf_sdio *bus, uint wdtick);
>
> -extern void brcmf_pm_resume_wait(struct brcmf_sdio_dev *sdiodev,
> - wait_queue_head_t *wq);
> -extern bool brcmf_pm_resume_error(struct brcmf_sdio_dev *sdiodev);
> +void brcmf_pm_resume_wait(struct brcmf_sdio_dev *sdiodev,
> + wait_queue_head_t *wq);
> +bool brcmf_pm_resume_error(struct brcmf_sdio_dev *sdiodev);
> #endif /* _BRCM_SDH_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
> index a8a267b..2d08c15 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
> @@ -172,19 +172,19 @@ struct si_info {
>
>
> /* AMBA Interconnect exported externs */
> -extern u32 ai_core_cflags(struct bcma_device *core, u32 mask, u32 val);
> +u32 ai_core_cflags(struct bcma_device *core, u32 mask, u32 val);
>
> /* === exported functions === */
> -extern struct si_pub *ai_attach(struct bcma_bus *pbus);
> -extern void ai_detach(struct si_pub *sih);
> -extern uint ai_cc_reg(struct si_pub *sih, uint regoff, u32 mask, u32 val);
> -extern void ai_clkctl_init(struct si_pub *sih);
> -extern u16 ai_clkctl_fast_pwrup_delay(struct si_pub *sih);
> -extern bool ai_clkctl_cc(struct si_pub *sih, enum bcma_clkmode mode);
> -extern bool ai_deviceremoved(struct si_pub *sih);
> +struct si_pub *ai_attach(struct bcma_bus *pbus);
> +void ai_detach(struct si_pub *sih);
> +uint ai_cc_reg(struct si_pub *sih, uint regoff, u32 mask, u32 val);
> +void ai_clkctl_init(struct si_pub *sih);
> +u16 ai_clkctl_fast_pwrup_delay(struct si_pub *sih);
> +bool ai_clkctl_cc(struct si_pub *sih, enum bcma_clkmode mode);
> +bool ai_deviceremoved(struct si_pub *sih);
>
> /* Enable Ex-PA for 4313 */
> -extern void ai_epa_4313war(struct si_pub *sih);
> +void ai_epa_4313war(struct si_pub *sih);
>
> static inline u32 ai_get_cccaps(struct si_pub *sih)
> {
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/ampdu.h b/drivers/net/wireless/brcm80211/brcmsmac/ampdu.h
> index 73d01e5..03bdcf2 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/ampdu.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/ampdu.h
> @@ -37,17 +37,17 @@ struct brcms_ampdu_session {
> u16 dma_len;
> };
>
> -extern void brcms_c_ampdu_reset_session(struct brcms_ampdu_session *session,
> - struct brcms_c_info *wlc);
> -extern int brcms_c_ampdu_add_frame(struct brcms_ampdu_session *session,
> - struct sk_buff *p);
> -extern void brcms_c_ampdu_finalize(struct brcms_ampdu_session *session);
> +void brcms_c_ampdu_reset_session(struct brcms_ampdu_session *session,
> + struct brcms_c_info *wlc);
> +int brcms_c_ampdu_add_frame(struct brcms_ampdu_session *session,
> + struct sk_buff *p);
> +void brcms_c_ampdu_finalize(struct brcms_ampdu_session *session);
>
> -extern struct ampdu_info *brcms_c_ampdu_attach(struct brcms_c_info *wlc);
> -extern void brcms_c_ampdu_detach(struct ampdu_info *ampdu);
> -extern void brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
> - struct sk_buff *p, struct tx_status *txs);
> -extern void brcms_c_ampdu_macaddr_upd(struct brcms_c_info *wlc);
> -extern void brcms_c_ampdu_shm_upd(struct ampdu_info *ampdu);
> +struct ampdu_info *brcms_c_ampdu_attach(struct brcms_c_info *wlc);
> +void brcms_c_ampdu_detach(struct ampdu_info *ampdu);
> +void brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
> + struct sk_buff *p, struct tx_status *txs);
> +void brcms_c_ampdu_macaddr_upd(struct brcms_c_info *wlc);
> +void brcms_c_ampdu_shm_upd(struct ampdu_info *ampdu);
>
> #endif /* _BRCM_AMPDU_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/antsel.h b/drivers/net/wireless/brcm80211/brcmsmac/antsel.h
> index 97ea388..a3d487a 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/antsel.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/antsel.h
> @@ -17,13 +17,11 @@
> #ifndef _BRCM_ANTSEL_H_
> #define _BRCM_ANTSEL_H_
>
> -extern struct antsel_info *brcms_c_antsel_attach(struct brcms_c_info *wlc);
> -extern void brcms_c_antsel_detach(struct antsel_info *asi);
> -extern void brcms_c_antsel_init(struct antsel_info *asi);
> -extern void brcms_c_antsel_antcfg_get(struct antsel_info *asi, bool usedef,
> - bool sel,
> - u8 id, u8 fbid, u8 *antcfg,
> - u8 *fbantcfg);
> -extern u8 brcms_c_antsel_antsel2id(struct antsel_info *asi, u16 antsel);
> +struct antsel_info *brcms_c_antsel_attach(struct brcms_c_info *wlc);
> +void brcms_c_antsel_detach(struct antsel_info *asi);
> +void brcms_c_antsel_init(struct antsel_info *asi);
> +void brcms_c_antsel_antcfg_get(struct antsel_info *asi, bool usedef, bool sel,
> + u8 id, u8 fbid, u8 *antcfg, u8 *fbantcfg);
> +u8 brcms_c_antsel_antsel2id(struct antsel_info *asi, u16 antsel);
>
> #endif /* _BRCM_ANTSEL_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.h b/drivers/net/wireless/brcm80211/brcmsmac/channel.h
> index 006483a..39dd3a5 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/channel.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.h
> @@ -32,20 +32,16 @@
>
> #define BRCMS_DFS_EU (BRCMS_DFS_TPC | BRCMS_RADAR_TYPE_EU) /* Flag for DFS EU */
>
> -extern struct brcms_cm_info *
> -brcms_c_channel_mgr_attach(struct brcms_c_info *wlc);
> +struct brcms_cm_info *brcms_c_channel_mgr_attach(struct brcms_c_info *wlc);
>
> -extern void brcms_c_channel_mgr_detach(struct brcms_cm_info *wlc_cm);
> +void brcms_c_channel_mgr_detach(struct brcms_cm_info *wlc_cm);
>
> -extern bool brcms_c_valid_chanspec_db(struct brcms_cm_info *wlc_cm,
> - u16 chspec);
> +bool brcms_c_valid_chanspec_db(struct brcms_cm_info *wlc_cm, u16 chspec);
>
> -extern void brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm,
> - u16 chanspec,
> - struct txpwr_limits *txpwr);
> -extern void brcms_c_channel_set_chanspec(struct brcms_cm_info *wlc_cm,
> - u16 chanspec,
> - u8 local_constraint_qdbm);
> -extern void brcms_c_regd_init(struct brcms_c_info *wlc);
> +void brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, u16 chanspec,
> + struct txpwr_limits *txpwr);
> +void brcms_c_channel_set_chanspec(struct brcms_cm_info *wlc_cm, u16 chanspec,
> + u8 local_constraint_qdbm);
> +void brcms_c_regd_init(struct brcms_c_info *wlc);
>
> #endif /* _WLC_CHANNEL_H */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h
> index 4090032..198053d 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h
> @@ -88,26 +88,26 @@ struct brcms_info {
> };
>
> /* misc callbacks */
> -extern void brcms_init(struct brcms_info *wl);
> -extern uint brcms_reset(struct brcms_info *wl);
> -extern void brcms_intrson(struct brcms_info *wl);
> -extern u32 brcms_intrsoff(struct brcms_info *wl);
> -extern void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask);
> -extern int brcms_up(struct brcms_info *wl);
> -extern void brcms_down(struct brcms_info *wl);
> -extern void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
> - bool state, int prio);
> -extern bool brcms_rfkill_set_hw_state(struct brcms_info *wl);
> +void brcms_init(struct brcms_info *wl);
> +uint brcms_reset(struct brcms_info *wl);
> +void brcms_intrson(struct brcms_info *wl);
> +u32 brcms_intrsoff(struct brcms_info *wl);
> +void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask);
> +int brcms_up(struct brcms_info *wl);
> +void brcms_down(struct brcms_info *wl);
> +void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
> + bool state, int prio);
> +bool brcms_rfkill_set_hw_state(struct brcms_info *wl);
>
> /* timer functions */
> -extern struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
> - void (*fn) (void *arg), void *arg,
> - const char *name);
> -extern void brcms_free_timer(struct brcms_timer *timer);
> -extern void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic);
> -extern bool brcms_del_timer(struct brcms_timer *timer);
> -extern void brcms_dpc(unsigned long data);
> -extern void brcms_timer(struct brcms_timer *t);
> -extern void brcms_fatal_error(struct brcms_info *wl);
> +struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
> + void (*fn) (void *arg), void *arg,
> + const char *name);
> +void brcms_free_timer(struct brcms_timer *timer);
> +void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic);
> +bool brcms_del_timer(struct brcms_timer *timer);
> +void brcms_dpc(unsigned long data);
> +void brcms_timer(struct brcms_timer *t);
> +void brcms_fatal_error(struct brcms_info *wl);
>
> #endif /* _BRCM_MAC80211_IF_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.h b/drivers/net/wireless/brcm80211/brcmsmac/main.h
> index b5d7a38..c4d135c 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/main.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.h
> @@ -616,66 +616,54 @@ struct brcms_bss_cfg {
> struct brcms_bss_info *current_bss;
> };
>
> -extern int brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo,
> - struct sk_buff *p);
> -extern int brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo,
> - uint *blocks);
> -
> -extern int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config);
> -extern void brcms_c_mac_promisc(struct brcms_c_info *wlc, uint filter_flags);
> -extern u16 brcms_c_calc_lsig_len(struct brcms_c_info *wlc, u32 ratespec,
> - uint mac_len);
> -extern u32 brcms_c_rspec_to_rts_rspec(struct brcms_c_info *wlc,
> - u32 rspec,
> - bool use_rspec, u16 mimo_ctlchbw);
> -extern u16 brcms_c_compute_rtscts_dur(struct brcms_c_info *wlc, bool cts_only,
> - u32 rts_rate,
> - u32 frame_rate,
> - u8 rts_preamble_type,
> - u8 frame_preamble_type, uint frame_len,
> - bool ba);
> -extern void brcms_c_inval_dma_pkts(struct brcms_hardware *hw,
> - struct ieee80211_sta *sta,
> - void (*dma_callback_fn));
> -extern void brcms_c_update_probe_resp(struct brcms_c_info *wlc, bool suspend);
> -extern int brcms_c_set_nmode(struct brcms_c_info *wlc);
> -extern void brcms_c_beacon_phytxctl_txant_upd(struct brcms_c_info *wlc,
> - u32 bcn_rate);
> -extern void brcms_b_antsel_type_set(struct brcms_hardware *wlc_hw,
> - u8 antsel_type);
> -extern void brcms_b_set_chanspec(struct brcms_hardware *wlc_hw,
> - u16 chanspec,
> - bool mute, struct txpwr_limits *txpwr);
> -extern void brcms_b_write_shm(struct brcms_hardware *wlc_hw, uint offset,
> - u16 v);
> -extern u16 brcms_b_read_shm(struct brcms_hardware *wlc_hw, uint offset);
> -extern void brcms_b_mhf(struct brcms_hardware *wlc_hw, u8 idx, u16 mask,
> - u16 val, int bands);
> -extern void brcms_b_corereset(struct brcms_hardware *wlc_hw, u32 flags);
> -extern void brcms_b_mctrl(struct brcms_hardware *wlc_hw, u32 mask, u32 val);
> -extern void brcms_b_phy_reset(struct brcms_hardware *wlc_hw);
> -extern void brcms_b_bw_set(struct brcms_hardware *wlc_hw, u16 bw);
> -extern void brcms_b_core_phypll_reset(struct brcms_hardware *wlc_hw);
> -extern void brcms_c_ucode_wake_override_set(struct brcms_hardware *wlc_hw,
> - u32 override_bit);
> -extern void brcms_c_ucode_wake_override_clear(struct brcms_hardware *wlc_hw,
> - u32 override_bit);
> -extern void brcms_b_write_template_ram(struct brcms_hardware *wlc_hw,
> - int offset, int len, void *buf);
> -extern u16 brcms_b_rate_shm_offset(struct brcms_hardware *wlc_hw, u8 rate);
> -extern void brcms_b_copyto_objmem(struct brcms_hardware *wlc_hw,
> - uint offset, const void *buf, int len,
> - u32 sel);
> -extern void brcms_b_copyfrom_objmem(struct brcms_hardware *wlc_hw, uint offset,
> - void *buf, int len, u32 sel);
> -extern void brcms_b_switch_macfreq(struct brcms_hardware *wlc_hw, u8 spurmode);
> -extern u16 brcms_b_get_txant(struct brcms_hardware *wlc_hw);
> -extern void brcms_b_phyclk_fgc(struct brcms_hardware *wlc_hw, bool clk);
> -extern void brcms_b_macphyclk_set(struct brcms_hardware *wlc_hw, bool clk);
> -extern void brcms_b_core_phypll_ctl(struct brcms_hardware *wlc_hw, bool on);
> -extern void brcms_b_txant_set(struct brcms_hardware *wlc_hw, u16 phytxant);
> -extern void brcms_b_band_stf_ss_set(struct brcms_hardware *wlc_hw,
> - u8 stf_mode);
> -extern void brcms_c_init_scb(struct scb *scb);
> +int brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo, struct sk_buff *p);
> +int brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo,
> + uint *blocks);
> +
> +int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config);
> +void brcms_c_mac_promisc(struct brcms_c_info *wlc, uint filter_flags);
> +u16 brcms_c_calc_lsig_len(struct brcms_c_info *wlc, u32 ratespec, uint mac_len);
> +u32 brcms_c_rspec_to_rts_rspec(struct brcms_c_info *wlc, u32 rspec,
> + bool use_rspec, u16 mimo_ctlchbw);
> +u16 brcms_c_compute_rtscts_dur(struct brcms_c_info *wlc, bool cts_only,
> + u32 rts_rate, u32 frame_rate,
> + u8 rts_preamble_type, u8 frame_preamble_type,
> + uint frame_len, bool ba);
> +void brcms_c_inval_dma_pkts(struct brcms_hardware *hw,
> + struct ieee80211_sta *sta, void (*dma_callback_fn));
> +void brcms_c_update_probe_resp(struct brcms_c_info *wlc, bool suspend);
> +int brcms_c_set_nmode(struct brcms_c_info *wlc);
> +void brcms_c_beacon_phytxctl_txant_upd(struct brcms_c_info *wlc, u32 bcn_rate);
> +void brcms_b_antsel_type_set(struct brcms_hardware *wlc_hw, u8 antsel_type);
> +void brcms_b_set_chanspec(struct brcms_hardware *wlc_hw, u16 chanspec,
> + bool mute, struct txpwr_limits *txpwr);
> +void brcms_b_write_shm(struct brcms_hardware *wlc_hw, uint offset, u16 v);
> +u16 brcms_b_read_shm(struct brcms_hardware *wlc_hw, uint offset);
> +void brcms_b_mhf(struct brcms_hardware *wlc_hw, u8 idx, u16 mask, u16 val,
> + int bands);
> +void brcms_b_corereset(struct brcms_hardware *wlc_hw, u32 flags);
> +void brcms_b_mctrl(struct brcms_hardware *wlc_hw, u32 mask, u32 val);
> +void brcms_b_phy_reset(struct brcms_hardware *wlc_hw);
> +void brcms_b_bw_set(struct brcms_hardware *wlc_hw, u16 bw);
> +void brcms_b_core_phypll_reset(struct brcms_hardware *wlc_hw);
> +void brcms_c_ucode_wake_override_set(struct brcms_hardware *wlc_hw,
> + u32 override_bit);
> +void brcms_c_ucode_wake_override_clear(struct brcms_hardware *wlc_hw,
> + u32 override_bit);
> +void brcms_b_write_template_ram(struct brcms_hardware *wlc_hw, int offset,
> + int len, void *buf);
> +u16 brcms_b_rate_shm_offset(struct brcms_hardware *wlc_hw, u8 rate);
> +void brcms_b_copyto_objmem(struct brcms_hardware *wlc_hw, uint offset,
> + const void *buf, int len, u32 sel);
> +void brcms_b_copyfrom_objmem(struct brcms_hardware *wlc_hw, uint offset,
> + void *buf, int len, u32 sel);
> +void brcms_b_switch_macfreq(struct brcms_hardware *wlc_hw, u8 spurmode);
> +u16 brcms_b_get_txant(struct brcms_hardware *wlc_hw);
> +void brcms_b_phyclk_fgc(struct brcms_hardware *wlc_hw, bool clk);
> +void brcms_b_macphyclk_set(struct brcms_hardware *wlc_hw, bool clk);
> +void brcms_b_core_phypll_ctl(struct brcms_hardware *wlc_hw, bool on);
> +void brcms_b_txant_set(struct brcms_hardware *wlc_hw, u16 phytxant);
> +void brcms_b_band_stf_ss_set(struct brcms_hardware *wlc_hw, u8 stf_mode);
> +void brcms_c_init_scb(struct scb *scb);
>
> #endif /* _BRCM_MAIN_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_hal.h b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_hal.h
> index e34a71e..4d3734f 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_hal.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_hal.h
> @@ -179,121 +179,106 @@ struct shared_phy_params {
> };
>
>
> -extern struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp);
> -extern struct brcms_phy_pub *wlc_phy_attach(struct shared_phy *sh,
> - struct bcma_device *d11core,
> - int bandtype, struct wiphy *wiphy);
> -extern void wlc_phy_detach(struct brcms_phy_pub *ppi);
> -
> -extern bool wlc_phy_get_phyversion(struct brcms_phy_pub *pih, u16 *phytype,
> - u16 *phyrev, u16 *radioid,
> - u16 *radiover);
> -extern bool wlc_phy_get_encore(struct brcms_phy_pub *pih);
> -extern u32 wlc_phy_get_coreflags(struct brcms_phy_pub *pih);
> -
> -extern void wlc_phy_hw_clk_state_upd(struct brcms_phy_pub *ppi, bool newstate);
> -extern void wlc_phy_hw_state_upd(struct brcms_phy_pub *ppi, bool newstate);
> -extern void wlc_phy_init(struct brcms_phy_pub *ppi, u16 chanspec);
> -extern void wlc_phy_watchdog(struct brcms_phy_pub *ppi);
> -extern int wlc_phy_down(struct brcms_phy_pub *ppi);
> -extern u32 wlc_phy_clk_bwbits(struct brcms_phy_pub *pih);
> -extern void wlc_phy_cal_init(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_antsel_init(struct brcms_phy_pub *ppi, bool lut_init);
> -
> -extern void wlc_phy_chanspec_set(struct brcms_phy_pub *ppi,
> - u16 chanspec);
> -extern u16 wlc_phy_chanspec_get(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_chanspec_radio_set(struct brcms_phy_pub *ppi,
> - u16 newch);
> -extern u16 wlc_phy_bw_state_get(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_bw_state_set(struct brcms_phy_pub *ppi, u16 bw);
> -
> -extern int wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
> - struct d11rxhdr *rxh);
> -extern void wlc_phy_por_inform(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_noise_sample_intr(struct brcms_phy_pub *ppi);
> -extern bool wlc_phy_bist_check_phy(struct brcms_phy_pub *ppi);
> -
> -extern void wlc_phy_set_deaf(struct brcms_phy_pub *ppi, bool user_flag);
> -
> -extern void wlc_phy_switch_radio(struct brcms_phy_pub *ppi, bool on);
> -extern void wlc_phy_anacore(struct brcms_phy_pub *ppi, bool on);
> -
> -
> -extern void wlc_phy_BSSinit(struct brcms_phy_pub *ppi, bool bonlyap, int rssi);
> -
> -extern void wlc_phy_chanspec_ch14_widefilter_set(struct brcms_phy_pub *ppi,
> - bool wide_filter);
> -extern void wlc_phy_chanspec_band_validch(struct brcms_phy_pub *ppi, uint band,
> - struct brcms_chanvec *channels);
> -extern u16 wlc_phy_chanspec_band_firstch(struct brcms_phy_pub *ppi,
> - uint band);
> -
> -extern void wlc_phy_txpower_sromlimit(struct brcms_phy_pub *ppi, uint chan,
> - u8 *_min_, u8 *_max_, int rate);
> -extern void wlc_phy_txpower_sromlimit_max_get(struct brcms_phy_pub *ppi,
> - uint chan, u8 *_max_, u8 *_min_);
> -extern void wlc_phy_txpower_boardlimit_band(struct brcms_phy_pub *ppi,
> - uint band, s32 *, s32 *, u32 *);
> -extern void wlc_phy_txpower_limit_set(struct brcms_phy_pub *ppi,
> - struct txpwr_limits *,
> - u16 chanspec);
> -extern int wlc_phy_txpower_get(struct brcms_phy_pub *ppi, uint *qdbm,
> - bool *override);
> -extern int wlc_phy_txpower_set(struct brcms_phy_pub *ppi, uint qdbm,
> - bool override);
> -extern void wlc_phy_txpower_target_set(struct brcms_phy_pub *ppi,
> - struct txpwr_limits *);
> -extern bool wlc_phy_txpower_hw_ctrl_get(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_txpower_hw_ctrl_set(struct brcms_phy_pub *ppi,
> - bool hwpwrctrl);
> -extern u8 wlc_phy_txpower_get_target_min(struct brcms_phy_pub *ppi);
> -extern u8 wlc_phy_txpower_get_target_max(struct brcms_phy_pub *ppi);
> -extern bool wlc_phy_txpower_ipa_ison(struct brcms_phy_pub *pih);
> -
> -extern void wlc_phy_stf_chain_init(struct brcms_phy_pub *pih, u8 txchain,
> - u8 rxchain);
> -extern void wlc_phy_stf_chain_set(struct brcms_phy_pub *pih, u8 txchain,
> - u8 rxchain);
> -extern void wlc_phy_stf_chain_get(struct brcms_phy_pub *pih, u8 *txchain,
> - u8 *rxchain);
> -extern u8 wlc_phy_stf_chain_active_get(struct brcms_phy_pub *pih);
> -extern s8 wlc_phy_stf_ssmode_get(struct brcms_phy_pub *pih,
> - u16 chanspec);
> -extern void wlc_phy_ldpc_override_set(struct brcms_phy_pub *ppi, bool val);
> -
> -extern void wlc_phy_cal_perical(struct brcms_phy_pub *ppi, u8 reason);
> -extern void wlc_phy_noise_sample_request_external(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_edcrs_lock(struct brcms_phy_pub *pih, bool lock);
> -extern void wlc_phy_cal_papd_recal(struct brcms_phy_pub *ppi);
> -
> -extern void wlc_phy_ant_rxdiv_set(struct brcms_phy_pub *ppi, u8 val);
> -extern void wlc_phy_clear_tssi(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_hold_upd(struct brcms_phy_pub *ppi, u32 id, bool val);
> -extern void wlc_phy_mute_upd(struct brcms_phy_pub *ppi, bool val, u32 flags);
> -
> -extern void wlc_phy_antsel_type_set(struct brcms_phy_pub *ppi, u8 antsel_type);
> -
> -extern void wlc_phy_txpower_get_current(struct brcms_phy_pub *ppi,
> - struct tx_power *power, uint channel);
> -
> -extern void wlc_phy_initcal_enable(struct brcms_phy_pub *pih, bool initcal);
> -extern bool wlc_phy_test_ison(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_txpwr_percent_set(struct brcms_phy_pub *ppi,
> - u8 txpwr_percent);
> -extern void wlc_phy_ofdm_rateset_war(struct brcms_phy_pub *pih, bool war);
> -extern void wlc_phy_bf_preempt_enable(struct brcms_phy_pub *pih,
> - bool bf_preempt);
> -extern void wlc_phy_machwcap_set(struct brcms_phy_pub *ppi, u32 machwcap);
> -
> -extern void wlc_phy_runbist_config(struct brcms_phy_pub *ppi, bool start_end);
> -
> -extern void wlc_phy_freqtrack_start(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_freqtrack_end(struct brcms_phy_pub *ppi);
> -
> -extern const u8 *wlc_phy_get_ofdm_rate_lookup(void);
> -
> -extern s8 wlc_phy_get_tx_power_offset_by_mcs(struct brcms_phy_pub *ppi,
> - u8 mcs_offset);
> -extern s8 wlc_phy_get_tx_power_offset(struct brcms_phy_pub *ppi, u8 tbl_offset);
> +struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp);
> +struct brcms_phy_pub *wlc_phy_attach(struct shared_phy *sh,
> + struct bcma_device *d11core, int bandtype,
> + struct wiphy *wiphy);
> +void wlc_phy_detach(struct brcms_phy_pub *ppi);
> +
> +bool wlc_phy_get_phyversion(struct brcms_phy_pub *pih, u16 *phytype,
> + u16 *phyrev, u16 *radioid, u16 *radiover);
> +bool wlc_phy_get_encore(struct brcms_phy_pub *pih);
> +u32 wlc_phy_get_coreflags(struct brcms_phy_pub *pih);
> +
> +void wlc_phy_hw_clk_state_upd(struct brcms_phy_pub *ppi, bool newstate);
> +void wlc_phy_hw_state_upd(struct brcms_phy_pub *ppi, bool newstate);
> +void wlc_phy_init(struct brcms_phy_pub *ppi, u16 chanspec);
> +void wlc_phy_watchdog(struct brcms_phy_pub *ppi);
> +int wlc_phy_down(struct brcms_phy_pub *ppi);
> +u32 wlc_phy_clk_bwbits(struct brcms_phy_pub *pih);
> +void wlc_phy_cal_init(struct brcms_phy_pub *ppi);
> +void wlc_phy_antsel_init(struct brcms_phy_pub *ppi, bool lut_init);
> +
> +void wlc_phy_chanspec_set(struct brcms_phy_pub *ppi, u16 chanspec);
> +u16 wlc_phy_chanspec_get(struct brcms_phy_pub *ppi);
> +void wlc_phy_chanspec_radio_set(struct brcms_phy_pub *ppi, u16 newch);
> +u16 wlc_phy_bw_state_get(struct brcms_phy_pub *ppi);
> +void wlc_phy_bw_state_set(struct brcms_phy_pub *ppi, u16 bw);
> +
> +int wlc_phy_rssi_compute(struct brcms_phy_pub *pih, struct d11rxhdr *rxh);
> +void wlc_phy_por_inform(struct brcms_phy_pub *ppi);
> +void wlc_phy_noise_sample_intr(struct brcms_phy_pub *ppi);
> +bool wlc_phy_bist_check_phy(struct brcms_phy_pub *ppi);
> +
> +void wlc_phy_set_deaf(struct brcms_phy_pub *ppi, bool user_flag);
> +
> +void wlc_phy_switch_radio(struct brcms_phy_pub *ppi, bool on);
> +void wlc_phy_anacore(struct brcms_phy_pub *ppi, bool on);
> +
> +
> +void wlc_phy_BSSinit(struct brcms_phy_pub *ppi, bool bonlyap, int rssi);
> +
> +void wlc_phy_chanspec_ch14_widefilter_set(struct brcms_phy_pub *ppi,
> + bool wide_filter);
> +void wlc_phy_chanspec_band_validch(struct brcms_phy_pub *ppi, uint band,
> + struct brcms_chanvec *channels);
> +u16 wlc_phy_chanspec_band_firstch(struct brcms_phy_pub *ppi, uint band);
> +
> +void wlc_phy_txpower_sromlimit(struct brcms_phy_pub *ppi, uint chan, u8 *_min_,
> + u8 *_max_, int rate);
> +void wlc_phy_txpower_sromlimit_max_get(struct brcms_phy_pub *ppi, uint chan,
> + u8 *_max_, u8 *_min_);
> +void wlc_phy_txpower_boardlimit_band(struct brcms_phy_pub *ppi, uint band,
> + s32 *, s32 *, u32 *);
> +void wlc_phy_txpower_limit_set(struct brcms_phy_pub *ppi, struct txpwr_limits *,
> + u16 chanspec);
> +int wlc_phy_txpower_get(struct brcms_phy_pub *ppi, uint *qdbm, bool *override);
> +int wlc_phy_txpower_set(struct brcms_phy_pub *ppi, uint qdbm, bool override);
> +void wlc_phy_txpower_target_set(struct brcms_phy_pub *ppi,
> + struct txpwr_limits *);
> +bool wlc_phy_txpower_hw_ctrl_get(struct brcms_phy_pub *ppi);
> +void wlc_phy_txpower_hw_ctrl_set(struct brcms_phy_pub *ppi, bool hwpwrctrl);
> +u8 wlc_phy_txpower_get_target_min(struct brcms_phy_pub *ppi);
> +u8 wlc_phy_txpower_get_target_max(struct brcms_phy_pub *ppi);
> +bool wlc_phy_txpower_ipa_ison(struct brcms_phy_pub *pih);
> +
> +void wlc_phy_stf_chain_init(struct brcms_phy_pub *pih, u8 txchain, u8 rxchain);
> +void wlc_phy_stf_chain_set(struct brcms_phy_pub *pih, u8 txchain, u8 rxchain);
> +void wlc_phy_stf_chain_get(struct brcms_phy_pub *pih, u8 *txchain, u8 *rxchain);
> +u8 wlc_phy_stf_chain_active_get(struct brcms_phy_pub *pih);
> +s8 wlc_phy_stf_ssmode_get(struct brcms_phy_pub *pih, u16 chanspec);
> +void wlc_phy_ldpc_override_set(struct brcms_phy_pub *ppi, bool val);
> +
> +void wlc_phy_cal_perical(struct brcms_phy_pub *ppi, u8 reason);
> +void wlc_phy_noise_sample_request_external(struct brcms_phy_pub *ppi);
> +void wlc_phy_edcrs_lock(struct brcms_phy_pub *pih, bool lock);
> +void wlc_phy_cal_papd_recal(struct brcms_phy_pub *ppi);
> +
> +void wlc_phy_ant_rxdiv_set(struct brcms_phy_pub *ppi, u8 val);
> +void wlc_phy_clear_tssi(struct brcms_phy_pub *ppi);
> +void wlc_phy_hold_upd(struct brcms_phy_pub *ppi, u32 id, bool val);
> +void wlc_phy_mute_upd(struct brcms_phy_pub *ppi, bool val, u32 flags);
> +
> +void wlc_phy_antsel_type_set(struct brcms_phy_pub *ppi, u8 antsel_type);
> +
> +void wlc_phy_txpower_get_current(struct brcms_phy_pub *ppi,
> + struct tx_power *power, uint channel);
> +
> +void wlc_phy_initcal_enable(struct brcms_phy_pub *pih, bool initcal);
> +bool wlc_phy_test_ison(struct brcms_phy_pub *ppi);
> +void wlc_phy_txpwr_percent_set(struct brcms_phy_pub *ppi, u8 txpwr_percent);
> +void wlc_phy_ofdm_rateset_war(struct brcms_phy_pub *pih, bool war);
> +void wlc_phy_bf_preempt_enable(struct brcms_phy_pub *pih, bool bf_preempt);
> +void wlc_phy_machwcap_set(struct brcms_phy_pub *ppi, u32 machwcap);
> +
> +void wlc_phy_runbist_config(struct brcms_phy_pub *ppi, bool start_end);
> +
> +void wlc_phy_freqtrack_start(struct brcms_phy_pub *ppi);
> +void wlc_phy_freqtrack_end(struct brcms_phy_pub *ppi);
> +
> +const u8 *wlc_phy_get_ofdm_rate_lookup(void);
> +
> +s8 wlc_phy_get_tx_power_offset_by_mcs(struct brcms_phy_pub *ppi,
> + u8 mcs_offset);
> +s8 wlc_phy_get_tx_power_offset(struct brcms_phy_pub *ppi, u8 tbl_offset);
> #endif /* _BRCM_PHY_HAL_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h
> index 1dc767c..4960f7d 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h
> @@ -910,113 +910,103 @@ struct lcnphy_radio_regs {
> u8 do_init_g;
> };
>
> -extern u16 read_phy_reg(struct brcms_phy *pi, u16 addr);
> -extern void write_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
> -extern void and_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
> -extern void or_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
> -extern void mod_phy_reg(struct brcms_phy *pi, u16 addr, u16 mask, u16 val);
> -
> -extern u16 read_radio_reg(struct brcms_phy *pi, u16 addr);
> -extern void or_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
> -extern void and_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
> -extern void mod_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask,
> - u16 val);
> -extern void xor_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask);
> -
> -extern void write_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
> -
> -extern void wlc_phyreg_enter(struct brcms_phy_pub *pih);
> -extern void wlc_phyreg_exit(struct brcms_phy_pub *pih);
> -extern void wlc_radioreg_enter(struct brcms_phy_pub *pih);
> -extern void wlc_radioreg_exit(struct brcms_phy_pub *pih);
> -
> -extern void wlc_phy_read_table(struct brcms_phy *pi,
> - const struct phytbl_info *ptbl_info,
> - u16 tblAddr, u16 tblDataHi,
> - u16 tblDatalo);
> -extern void wlc_phy_write_table(struct brcms_phy *pi,
> - const struct phytbl_info *ptbl_info,
> - u16 tblAddr, u16 tblDataHi, u16 tblDatalo);
> -extern void wlc_phy_table_addr(struct brcms_phy *pi, uint tbl_id,
> - uint tbl_offset, u16 tblAddr, u16 tblDataHi,
> - u16 tblDataLo);
> -extern void wlc_phy_table_data_write(struct brcms_phy *pi, uint width, u32 val);
> -
> -extern void write_phy_channel_reg(struct brcms_phy *pi, uint val);
> -extern void wlc_phy_txpower_update_shm(struct brcms_phy *pi);
> -
> -extern u8 wlc_phy_nbits(s32 value);
> -extern void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_dB, u8 core);
> -
> -extern uint wlc_phy_init_radio_regs_allbands(struct brcms_phy *pi,
> - struct radio_20xx_regs *radioregs);
> -extern uint wlc_phy_init_radio_regs(struct brcms_phy *pi,
> - const struct radio_regs *radioregs,
> - u16 core_offset);
> -
> -extern void wlc_phy_txpower_ipa_upd(struct brcms_phy *pi);
> -
> -extern void wlc_phy_do_dummy_tx(struct brcms_phy *pi, bool ofdm, bool pa_on);
> -extern void wlc_phy_papd_decode_epsilon(u32 epsilon, s32 *eps_real,
> - s32 *eps_imag);
> -
> -extern void wlc_phy_cal_perical_mphase_reset(struct brcms_phy *pi);
> -extern void wlc_phy_cal_perical_mphase_restart(struct brcms_phy *pi);
> -
> -extern bool wlc_phy_attach_nphy(struct brcms_phy *pi);
> -extern bool wlc_phy_attach_lcnphy(struct brcms_phy *pi);
> -
> -extern void wlc_phy_detach_lcnphy(struct brcms_phy *pi);
> -
> -extern void wlc_phy_init_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_init_lcnphy(struct brcms_phy *pi);
> -
> -extern void wlc_phy_cal_init_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_cal_init_lcnphy(struct brcms_phy *pi);
> -
> -extern void wlc_phy_chanspec_set_nphy(struct brcms_phy *pi,
> - u16 chanspec);
> -extern void wlc_phy_chanspec_set_lcnphy(struct brcms_phy *pi,
> - u16 chanspec);
> -extern void wlc_phy_chanspec_set_fixup_lcnphy(struct brcms_phy *pi,
> - u16 chanspec);
> -extern int wlc_phy_channel2freq(uint channel);
> -extern int wlc_phy_chanspec_freq2bandrange_lpssn(uint);
> -extern int wlc_phy_chanspec_bandrange_get(struct brcms_phy *, u16 chanspec);
> -
> -extern void wlc_lcnphy_set_tx_pwr_ctrl(struct brcms_phy *pi, u16 mode);
> -extern s8 wlc_lcnphy_get_current_tx_pwr_idx(struct brcms_phy *pi);
> -
> -extern void wlc_phy_txpower_recalc_target_nphy(struct brcms_phy *pi);
> -extern void wlc_lcnphy_txpower_recalc_target(struct brcms_phy *pi);
> -extern void wlc_phy_txpower_recalc_target_lcnphy(struct brcms_phy *pi);
> -
> -extern void wlc_lcnphy_set_tx_pwr_by_index(struct brcms_phy *pi, int index);
> -extern void wlc_lcnphy_tx_pu(struct brcms_phy *pi, bool bEnable);
> -extern void wlc_lcnphy_stop_tx_tone(struct brcms_phy *pi);
> -extern void wlc_lcnphy_start_tx_tone(struct brcms_phy *pi, s32 f_kHz,
> - u16 max_val, bool iqcalmode);
> -
> -extern void wlc_phy_txpower_sromlimit_get_nphy(struct brcms_phy *pi, uint chan,
> - u8 *max_pwr, u8 rate_id);
> -extern void wlc_phy_ofdm_to_mcs_powers_nphy(u8 *power, u8 rate_mcs_start,
> - u8 rate_mcs_end,
> - u8 rate_ofdm_start);
> -extern void wlc_phy_mcs_to_ofdm_powers_nphy(u8 *power,
> - u8 rate_ofdm_start,
> - u8 rate_ofdm_end,
> - u8 rate_mcs_start);
> -
> -extern u16 wlc_lcnphy_tempsense(struct brcms_phy *pi, bool mode);
> -extern s16 wlc_lcnphy_tempsense_new(struct brcms_phy *pi, bool mode);
> -extern s8 wlc_lcnphy_tempsense_degree(struct brcms_phy *pi, bool mode);
> -extern s8 wlc_lcnphy_vbatsense(struct brcms_phy *pi, bool mode);
> -extern void wlc_phy_carrier_suppress_lcnphy(struct brcms_phy *pi);
> -extern void wlc_lcnphy_crsuprs(struct brcms_phy *pi, int channel);
> -extern void wlc_lcnphy_epa_switch(struct brcms_phy *pi, bool mode);
> -extern void wlc_2064_vco_cal(struct brcms_phy *pi);
> -
> -extern void wlc_phy_txpower_recalc_target(struct brcms_phy *pi);
> +u16 read_phy_reg(struct brcms_phy *pi, u16 addr);
> +void write_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
> +void and_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
> +void or_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
> +void mod_phy_reg(struct brcms_phy *pi, u16 addr, u16 mask, u16 val);
> +
> +u16 read_radio_reg(struct brcms_phy *pi, u16 addr);
> +void or_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
> +void and_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
> +void mod_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask, u16 val);
> +void xor_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask);
> +
> +void write_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
> +
> +void wlc_phyreg_enter(struct brcms_phy_pub *pih);
> +void wlc_phyreg_exit(struct brcms_phy_pub *pih);
> +void wlc_radioreg_enter(struct brcms_phy_pub *pih);
> +void wlc_radioreg_exit(struct brcms_phy_pub *pih);
> +
> +void wlc_phy_read_table(struct brcms_phy *pi,
> + const struct phytbl_info *ptbl_info,
> + u16 tblAddr, u16 tblDataHi, u16 tblDatalo);
> +void wlc_phy_write_table(struct brcms_phy *pi,
> + const struct phytbl_info *ptbl_info,
> + u16 tblAddr, u16 tblDataHi, u16 tblDatalo);
> +void wlc_phy_table_addr(struct brcms_phy *pi, uint tbl_id, uint tbl_offset,
> + u16 tblAddr, u16 tblDataHi, u16 tblDataLo);
> +void wlc_phy_table_data_write(struct brcms_phy *pi, uint width, u32 val);
> +
> +void write_phy_channel_reg(struct brcms_phy *pi, uint val);
> +void wlc_phy_txpower_update_shm(struct brcms_phy *pi);
> +
> +u8 wlc_phy_nbits(s32 value);
> +void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_dB, u8 core);
> +
> +uint wlc_phy_init_radio_regs_allbands(struct brcms_phy *pi,
> + struct radio_20xx_regs *radioregs);
> +uint wlc_phy_init_radio_regs(struct brcms_phy *pi,
> + const struct radio_regs *radioregs,
> + u16 core_offset);
> +
> +void wlc_phy_txpower_ipa_upd(struct brcms_phy *pi);
> +
> +void wlc_phy_do_dummy_tx(struct brcms_phy *pi, bool ofdm, bool pa_on);
> +void wlc_phy_papd_decode_epsilon(u32 epsilon, s32 *eps_real, s32 *eps_imag);
> +
> +void wlc_phy_cal_perical_mphase_reset(struct brcms_phy *pi);
> +void wlc_phy_cal_perical_mphase_restart(struct brcms_phy *pi);
> +
> +bool wlc_phy_attach_nphy(struct brcms_phy *pi);
> +bool wlc_phy_attach_lcnphy(struct brcms_phy *pi);
> +
> +void wlc_phy_detach_lcnphy(struct brcms_phy *pi);
> +
> +void wlc_phy_init_nphy(struct brcms_phy *pi);
> +void wlc_phy_init_lcnphy(struct brcms_phy *pi);
> +
> +void wlc_phy_cal_init_nphy(struct brcms_phy *pi);
> +void wlc_phy_cal_init_lcnphy(struct brcms_phy *pi);
> +
> +void wlc_phy_chanspec_set_nphy(struct brcms_phy *pi, u16 chanspec);
> +void wlc_phy_chanspec_set_lcnphy(struct brcms_phy *pi, u16 chanspec);
> +void wlc_phy_chanspec_set_fixup_lcnphy(struct brcms_phy *pi, u16 chanspec);
> +int wlc_phy_channel2freq(uint channel);
> +int wlc_phy_chanspec_freq2bandrange_lpssn(uint);
> +int wlc_phy_chanspec_bandrange_get(struct brcms_phy *, u16 chanspec);
> +
> +void wlc_lcnphy_set_tx_pwr_ctrl(struct brcms_phy *pi, u16 mode);
> +s8 wlc_lcnphy_get_current_tx_pwr_idx(struct brcms_phy *pi);
> +
> +void wlc_phy_txpower_recalc_target_nphy(struct brcms_phy *pi);
> +void wlc_lcnphy_txpower_recalc_target(struct brcms_phy *pi);
> +void wlc_phy_txpower_recalc_target_lcnphy(struct brcms_phy *pi);
> +
> +void wlc_lcnphy_set_tx_pwr_by_index(struct brcms_phy *pi, int index);
> +void wlc_lcnphy_tx_pu(struct brcms_phy *pi, bool bEnable);
> +void wlc_lcnphy_stop_tx_tone(struct brcms_phy *pi);
> +void wlc_lcnphy_start_tx_tone(struct brcms_phy *pi, s32 f_kHz, u16 max_val,
> + bool iqcalmode);
> +
> +void wlc_phy_txpower_sromlimit_get_nphy(struct brcms_phy *pi, uint chan,
> + u8 *max_pwr, u8 rate_id);
> +void wlc_phy_ofdm_to_mcs_powers_nphy(u8 *power, u8 rate_mcs_start,
> + u8 rate_mcs_end, u8 rate_ofdm_start);
> +void wlc_phy_mcs_to_ofdm_powers_nphy(u8 *power, u8 rate_ofdm_start,
> + u8 rate_ofdm_end, u8 rate_mcs_start);
> +
> +u16 wlc_lcnphy_tempsense(struct brcms_phy *pi, bool mode);
> +s16 wlc_lcnphy_tempsense_new(struct brcms_phy *pi, bool mode);
> +s8 wlc_lcnphy_tempsense_degree(struct brcms_phy *pi, bool mode);
> +s8 wlc_lcnphy_vbatsense(struct brcms_phy *pi, bool mode);
> +void wlc_phy_carrier_suppress_lcnphy(struct brcms_phy *pi);
> +void wlc_lcnphy_crsuprs(struct brcms_phy *pi, int channel);
> +void wlc_lcnphy_epa_switch(struct brcms_phy *pi, bool mode);
> +void wlc_2064_vco_cal(struct brcms_phy *pi);
> +
> +void wlc_phy_txpower_recalc_target(struct brcms_phy *pi);
>
> #define LCNPHY_TBL_ID_PAPDCOMPDELTATBL 0x18
> #define LCNPHY_TX_POWER_TABLE_SIZE 128
> @@ -1030,26 +1020,24 @@ extern void wlc_phy_txpower_recalc_target(struct brcms_phy *pi);
>
> #define LCNPHY_TX_PWR_CTRL_TEMPBASED 0xE001
>
> -extern void wlc_lcnphy_write_table(struct brcms_phy *pi,
> - const struct phytbl_info *pti);
> -extern void wlc_lcnphy_read_table(struct brcms_phy *pi,
> - struct phytbl_info *pti);
> -extern void wlc_lcnphy_set_tx_iqcc(struct brcms_phy *pi, u16 a, u16 b);
> -extern void wlc_lcnphy_set_tx_locc(struct brcms_phy *pi, u16 didq);
> -extern void wlc_lcnphy_get_tx_iqcc(struct brcms_phy *pi, u16 *a, u16 *b);
> -extern u16 wlc_lcnphy_get_tx_locc(struct brcms_phy *pi);
> -extern void wlc_lcnphy_get_radio_loft(struct brcms_phy *pi, u8 *ei0,
> - u8 *eq0, u8 *fi0, u8 *fq0);
> -extern void wlc_lcnphy_calib_modes(struct brcms_phy *pi, uint mode);
> -extern void wlc_lcnphy_deaf_mode(struct brcms_phy *pi, bool mode);
> -extern bool wlc_phy_tpc_isenabled_lcnphy(struct brcms_phy *pi);
> -extern void wlc_lcnphy_tx_pwr_update_npt(struct brcms_phy *pi);
> -extern s32 wlc_lcnphy_tssi2dbm(s32 tssi, s32 a1, s32 b0, s32 b1);
> -extern void wlc_lcnphy_get_tssi(struct brcms_phy *pi, s8 *ofdm_pwr,
> - s8 *cck_pwr);
> -extern void wlc_lcnphy_tx_power_adjustment(struct brcms_phy_pub *ppi);
> -
> -extern s32 wlc_lcnphy_rx_signal_power(struct brcms_phy *pi, s32 gain_index);
> +void wlc_lcnphy_write_table(struct brcms_phy *pi,
> + const struct phytbl_info *pti);
> +void wlc_lcnphy_read_table(struct brcms_phy *pi, struct phytbl_info *pti);
> +void wlc_lcnphy_set_tx_iqcc(struct brcms_phy *pi, u16 a, u16 b);
> +void wlc_lcnphy_set_tx_locc(struct brcms_phy *pi, u16 didq);
> +void wlc_lcnphy_get_tx_iqcc(struct brcms_phy *pi, u16 *a, u16 *b);
> +u16 wlc_lcnphy_get_tx_locc(struct brcms_phy *pi);
> +void wlc_lcnphy_get_radio_loft(struct brcms_phy *pi, u8 *ei0, u8 *eq0, u8 *fi0,
> + u8 *fq0);
> +void wlc_lcnphy_calib_modes(struct brcms_phy *pi, uint mode);
> +void wlc_lcnphy_deaf_mode(struct brcms_phy *pi, bool mode);
> +bool wlc_phy_tpc_isenabled_lcnphy(struct brcms_phy *pi);
> +void wlc_lcnphy_tx_pwr_update_npt(struct brcms_phy *pi);
> +s32 wlc_lcnphy_tssi2dbm(s32 tssi, s32 a1, s32 b0, s32 b1);
> +void wlc_lcnphy_get_tssi(struct brcms_phy *pi, s8 *ofdm_pwr, s8 *cck_pwr);
> +void wlc_lcnphy_tx_power_adjustment(struct brcms_phy_pub *ppi);
> +
> +s32 wlc_lcnphy_rx_signal_power(struct brcms_phy *pi, s32 gain_index);
>
> #define NPHY_MAX_HPVGA1_INDEX 10
> #define NPHY_DEF_HPVGA1_INDEXLIMIT 7
> @@ -1060,9 +1048,8 @@ struct phy_iq_est {
> u32 q_pwr;
> };
>
> -extern void wlc_phy_stay_in_carriersearch_nphy(struct brcms_phy *pi,
> - bool enable);
> -extern void wlc_nphy_deaf_mode(struct brcms_phy *pi, bool mode);
> +void wlc_phy_stay_in_carriersearch_nphy(struct brcms_phy *pi, bool enable);
> +void wlc_nphy_deaf_mode(struct brcms_phy *pi, bool mode);
>
> #define wlc_phy_write_table_nphy(pi, pti) \
> wlc_phy_write_table(pi, pti, 0x72, 0x74, 0x73)
> @@ -1076,10 +1063,10 @@ extern void wlc_nphy_deaf_mode(struct brcms_phy *pi, bool mode);
> #define wlc_nphy_table_data_write(pi, w, v) \
> wlc_phy_table_data_write((pi), (w), (v))
>
> -extern void wlc_phy_table_read_nphy(struct brcms_phy *pi, u32, u32 l, u32 o,
> - u32 w, void *d);
> -extern void wlc_phy_table_write_nphy(struct brcms_phy *pi, u32, u32, u32,
> - u32, const void *);
> +void wlc_phy_table_read_nphy(struct brcms_phy *pi, u32, u32 l, u32 o, u32 w,
> + void *d);
> +void wlc_phy_table_write_nphy(struct brcms_phy *pi, u32, u32, u32, u32,
> + const void *);
>
> #define PHY_IPA(pi) \
> ((pi->ipa2g_on && CHSPEC_IS2G(pi->radio_chanspec)) || \
> @@ -1089,73 +1076,67 @@ extern void wlc_phy_table_write_nphy(struct brcms_phy *pi, u32, u32, u32,
> if (NREV_LT((pi)->pubpi.phy_rev, 3)) \
> (void)bcma_read32(pi->d11core, D11REGOFFS(maccontrol))
>
> -extern void wlc_phy_cal_perical_nphy_run(struct brcms_phy *pi, u8 caltype);
> -extern void wlc_phy_aci_reset_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_pa_override_nphy(struct brcms_phy *pi, bool en);
> -
> -extern u8 wlc_phy_get_chan_freq_range_nphy(struct brcms_phy *pi, uint chan);
> -extern void wlc_phy_switch_radio_nphy(struct brcms_phy *pi, bool on);
> -
> -extern void wlc_phy_stf_chain_upd_nphy(struct brcms_phy *pi);
> -
> -extern void wlc_phy_force_rfseq_nphy(struct brcms_phy *pi, u8 cmd);
> -extern s16 wlc_phy_tempsense_nphy(struct brcms_phy *pi);
> -
> -extern u16 wlc_phy_classifier_nphy(struct brcms_phy *pi, u16 mask, u16 val);
> -
> -extern void wlc_phy_rx_iq_est_nphy(struct brcms_phy *pi, struct phy_iq_est *est,
> - u16 num_samps, u8 wait_time,
> - u8 wait_for_crs);
> -
> -extern void wlc_phy_rx_iq_coeffs_nphy(struct brcms_phy *pi, u8 write,
> - struct nphy_iq_comp *comp);
> -extern void wlc_phy_aci_and_noise_reduction_nphy(struct brcms_phy *pi);
> -
> -extern void wlc_phy_rxcore_setstate_nphy(struct brcms_phy_pub *pih,
> - u8 rxcore_bitmask);
> -extern u8 wlc_phy_rxcore_getstate_nphy(struct brcms_phy_pub *pih);
> -
> -extern void wlc_phy_txpwrctrl_enable_nphy(struct brcms_phy *pi, u8 ctrl_type);
> -extern void wlc_phy_txpwr_fixpower_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_txpwr_apply_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_txpwr_papd_cal_nphy(struct brcms_phy *pi);
> -extern u16 wlc_phy_txpwr_idx_get_nphy(struct brcms_phy *pi);
> -
> -extern struct nphy_txgains wlc_phy_get_tx_gain_nphy(struct brcms_phy *pi);
> -extern int wlc_phy_cal_txiqlo_nphy(struct brcms_phy *pi,
> - struct nphy_txgains target_gain,
> - bool full, bool m);
> -extern int wlc_phy_cal_rxiq_nphy(struct brcms_phy *pi,
> - struct nphy_txgains target_gain,
> - u8 type, bool d);
> -extern void wlc_phy_txpwr_index_nphy(struct brcms_phy *pi, u8 core_mask,
> - s8 txpwrindex, bool res);
> -extern void wlc_phy_rssisel_nphy(struct brcms_phy *pi, u8 core, u8 rssi_type);
> -extern int wlc_phy_poll_rssi_nphy(struct brcms_phy *pi, u8 rssi_type,
> - s32 *rssi_buf, u8 nsamps);
> -extern void wlc_phy_rssi_cal_nphy(struct brcms_phy *pi);
> -extern int wlc_phy_aci_scan_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_cal_txgainctrl_nphy(struct brcms_phy *pi,
> - s32 dBm_targetpower, bool debug);
> -extern int wlc_phy_tx_tone_nphy(struct brcms_phy *pi, u32 f_kHz, u16 max_val,
> - u8 mode, u8, bool);
> -extern void wlc_phy_stopplayback_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_est_tonepwr_nphy(struct brcms_phy *pi, s32 *qdBm_pwrbuf,
> - u8 num_samps);
> -extern void wlc_phy_radio205x_vcocal_nphy(struct brcms_phy *pi);
> -
> -extern int wlc_phy_rssi_compute_nphy(struct brcms_phy *pi,
> - struct d11rxhdr *rxh);
> +void wlc_phy_cal_perical_nphy_run(struct brcms_phy *pi, u8 caltype);
> +void wlc_phy_aci_reset_nphy(struct brcms_phy *pi);
> +void wlc_phy_pa_override_nphy(struct brcms_phy *pi, bool en);
> +
> +u8 wlc_phy_get_chan_freq_range_nphy(struct brcms_phy *pi, uint chan);
> +void wlc_phy_switch_radio_nphy(struct brcms_phy *pi, bool on);
> +
> +void wlc_phy_stf_chain_upd_nphy(struct brcms_phy *pi);
> +
> +void wlc_phy_force_rfseq_nphy(struct brcms_phy *pi, u8 cmd);
> +s16 wlc_phy_tempsense_nphy(struct brcms_phy *pi);
> +
> +u16 wlc_phy_classifier_nphy(struct brcms_phy *pi, u16 mask, u16 val);
> +
> +void wlc_phy_rx_iq_est_nphy(struct brcms_phy *pi, struct phy_iq_est *est,
> + u16 num_samps, u8 wait_time, u8 wait_for_crs);
> +
> +void wlc_phy_rx_iq_coeffs_nphy(struct brcms_phy *pi, u8 write,
> + struct nphy_iq_comp *comp);
> +void wlc_phy_aci_and_noise_reduction_nphy(struct brcms_phy *pi);
> +
> +void wlc_phy_rxcore_setstate_nphy(struct brcms_phy_pub *pih, u8 rxcore_bitmask);
> +u8 wlc_phy_rxcore_getstate_nphy(struct brcms_phy_pub *pih);
> +
> +void wlc_phy_txpwrctrl_enable_nphy(struct brcms_phy *pi, u8 ctrl_type);
> +void wlc_phy_txpwr_fixpower_nphy(struct brcms_phy *pi);
> +void wlc_phy_txpwr_apply_nphy(struct brcms_phy *pi);
> +void wlc_phy_txpwr_papd_cal_nphy(struct brcms_phy *pi);
> +u16 wlc_phy_txpwr_idx_get_nphy(struct brcms_phy *pi);
> +
> +struct nphy_txgains wlc_phy_get_tx_gain_nphy(struct brcms_phy *pi);
> +int wlc_phy_cal_txiqlo_nphy(struct brcms_phy *pi,
> + struct nphy_txgains target_gain, bool full, bool m);
> +int wlc_phy_cal_rxiq_nphy(struct brcms_phy *pi, struct nphy_txgains target_gain,
> + u8 type, bool d);
> +void wlc_phy_txpwr_index_nphy(struct brcms_phy *pi, u8 core_mask,
> + s8 txpwrindex, bool res);
> +void wlc_phy_rssisel_nphy(struct brcms_phy *pi, u8 core, u8 rssi_type);
> +int wlc_phy_poll_rssi_nphy(struct brcms_phy *pi, u8 rssi_type,
> + s32 *rssi_buf, u8 nsamps);
> +void wlc_phy_rssi_cal_nphy(struct brcms_phy *pi);
> +int wlc_phy_aci_scan_nphy(struct brcms_phy *pi);
> +void wlc_phy_cal_txgainctrl_nphy(struct brcms_phy *pi, s32 dBm_targetpower,
> + bool debug);
> +int wlc_phy_tx_tone_nphy(struct brcms_phy *pi, u32 f_kHz, u16 max_val, u8 mode,
> + u8, bool);
> +void wlc_phy_stopplayback_nphy(struct brcms_phy *pi);
> +void wlc_phy_est_tonepwr_nphy(struct brcms_phy *pi, s32 *qdBm_pwrbuf,
> + u8 num_samps);
> +void wlc_phy_radio205x_vcocal_nphy(struct brcms_phy *pi);
> +
> +int wlc_phy_rssi_compute_nphy(struct brcms_phy *pi, struct d11rxhdr *rxh);
>
> #define NPHY_TESTPATTERN_BPHY_EVM 0
> #define NPHY_TESTPATTERN_BPHY_RFCS 1
>
> -extern void wlc_phy_nphy_tkip_rifs_war(struct brcms_phy *pi, u8 rifs);
> +void wlc_phy_nphy_tkip_rifs_war(struct brcms_phy *pi, u8 rifs);
>
> void wlc_phy_get_pwrdet_offsets(struct brcms_phy *pi, s8 *cckoffset,
> s8 *ofdmoffset);
> -extern s8 wlc_phy_upd_rssi_offset(struct brcms_phy *pi, s8 rssi,
> - u16 chanspec);
> +s8 wlc_phy_upd_rssi_offset(struct brcms_phy *pi, s8 rssi, u16 chanspec);
>
> -extern bool wlc_phy_n_txpower_ipa_ison(struct brcms_phy *pih);
> +bool wlc_phy_n_txpower_ipa_ison(struct brcms_phy *pih);
> #endif /* _BRCM_PHY_INT_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h b/drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h
> index 2c5b66b..dd87747 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h
> @@ -124,56 +124,49 @@
>
> struct brcms_phy;
>
> -extern struct phy_shim_info *wlc_phy_shim_attach(struct brcms_hardware *wlc_hw,
> - struct brcms_info *wl,
> - struct brcms_c_info *wlc);
> -extern void wlc_phy_shim_detach(struct phy_shim_info *physhim);
> +struct phy_shim_info *wlc_phy_shim_attach(struct brcms_hardware *wlc_hw,
> + struct brcms_info *wl,
> + struct brcms_c_info *wlc);
> +void wlc_phy_shim_detach(struct phy_shim_info *physhim);
>
> /* PHY to WL utility functions */
> -extern struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
> - void (*fn) (struct brcms_phy *pi),
> - void *arg, const char *name);
> -extern void wlapi_free_timer(struct wlapi_timer *t);
> -extern void wlapi_add_timer(struct wlapi_timer *t, uint ms, int periodic);
> -extern bool wlapi_del_timer(struct wlapi_timer *t);
> -extern void wlapi_intrson(struct phy_shim_info *physhim);
> -extern u32 wlapi_intrsoff(struct phy_shim_info *physhim);
> -extern void wlapi_intrsrestore(struct phy_shim_info *physhim,
> - u32 macintmask);
> -
> -extern void wlapi_bmac_write_shm(struct phy_shim_info *physhim, uint offset,
> - u16 v);
> -extern u16 wlapi_bmac_read_shm(struct phy_shim_info *physhim, uint offset);
> -extern void wlapi_bmac_mhf(struct phy_shim_info *physhim, u8 idx,
> - u16 mask, u16 val, int bands);
> -extern void wlapi_bmac_corereset(struct phy_shim_info *physhim, u32 flags);
> -extern void wlapi_suspend_mac_and_wait(struct phy_shim_info *physhim);
> -extern void wlapi_switch_macfreq(struct phy_shim_info *physhim, u8 spurmode);
> -extern void wlapi_enable_mac(struct phy_shim_info *physhim);
> -extern void wlapi_bmac_mctrl(struct phy_shim_info *physhim, u32 mask,
> - u32 val);
> -extern void wlapi_bmac_phy_reset(struct phy_shim_info *physhim);
> -extern void wlapi_bmac_bw_set(struct phy_shim_info *physhim, u16 bw);
> -extern void wlapi_bmac_phyclk_fgc(struct phy_shim_info *physhim, bool clk);
> -extern void wlapi_bmac_macphyclk_set(struct phy_shim_info *physhim, bool clk);
> -extern void wlapi_bmac_core_phypll_ctl(struct phy_shim_info *physhim, bool on);
> -extern void wlapi_bmac_core_phypll_reset(struct phy_shim_info *physhim);
> -extern void wlapi_bmac_ucode_wake_override_phyreg_set(struct phy_shim_info *
> - physhim);
> -extern void wlapi_bmac_ucode_wake_override_phyreg_clear(struct phy_shim_info *
> - physhim);
> -extern void wlapi_bmac_write_template_ram(struct phy_shim_info *physhim, int o,
> - int len, void *buf);
> -extern u16 wlapi_bmac_rate_shm_offset(struct phy_shim_info *physhim,
> - u8 rate);
> -extern void wlapi_ucode_sample_init(struct phy_shim_info *physhim);
> -extern void wlapi_copyfrom_objmem(struct phy_shim_info *physhim, uint,
> - void *buf, int, u32 sel);
> -extern void wlapi_copyto_objmem(struct phy_shim_info *physhim, uint,
> - const void *buf, int, u32);
> -
> -extern void wlapi_high_update_phy_mode(struct phy_shim_info *physhim,
> - u32 phy_mode);
> -extern u16 wlapi_bmac_get_txant(struct phy_shim_info *physhim);
> +struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
> + void (*fn)(struct brcms_phy *pi),
> + void *arg, const char *name);
> +void wlapi_free_timer(struct wlapi_timer *t);
> +void wlapi_add_timer(struct wlapi_timer *t, uint ms, int periodic);
> +bool wlapi_del_timer(struct wlapi_timer *t);
> +void wlapi_intrson(struct phy_shim_info *physhim);
> +u32 wlapi_intrsoff(struct phy_shim_info *physhim);
> +void wlapi_intrsrestore(struct phy_shim_info *physhim, u32 macintmask);
> +
> +void wlapi_bmac_write_shm(struct phy_shim_info *physhim, uint offset, u16 v);
> +u16 wlapi_bmac_read_shm(struct phy_shim_info *physhim, uint offset);
> +void wlapi_bmac_mhf(struct phy_shim_info *physhim, u8 idx, u16 mask, u16 val,
> + int bands);
> +void wlapi_bmac_corereset(struct phy_shim_info *physhim, u32 flags);
> +void wlapi_suspend_mac_and_wait(struct phy_shim_info *physhim);
> +void wlapi_switch_macfreq(struct phy_shim_info *physhim, u8 spurmode);
> +void wlapi_enable_mac(struct phy_shim_info *physhim);
> +void wlapi_bmac_mctrl(struct phy_shim_info *physhim, u32 mask, u32 val);
> +void wlapi_bmac_phy_reset(struct phy_shim_info *physhim);
> +void wlapi_bmac_bw_set(struct phy_shim_info *physhim, u16 bw);
> +void wlapi_bmac_phyclk_fgc(struct phy_shim_info *physhim, bool clk);
> +void wlapi_bmac_macphyclk_set(struct phy_shim_info *physhim, bool clk);
> +void wlapi_bmac_core_phypll_ctl(struct phy_shim_info *physhim, bool on);
> +void wlapi_bmac_core_phypll_reset(struct phy_shim_info *physhim);
> +void wlapi_bmac_ucode_wake_override_phyreg_set(struct phy_shim_info *physhim);
> +void wlapi_bmac_ucode_wake_override_phyreg_clear(struct phy_shim_info *physhim);
> +void wlapi_bmac_write_template_ram(struct phy_shim_info *physhim, int o,
> + int len, void *buf);
> +u16 wlapi_bmac_rate_shm_offset(struct phy_shim_info *physhim, u8 rate);
> +void wlapi_ucode_sample_init(struct phy_shim_info *physhim);
> +void wlapi_copyfrom_objmem(struct phy_shim_info *physhim, uint, void *buf,
> + int, u32 sel);
> +void wlapi_copyto_objmem(struct phy_shim_info *physhim, uint, const void *buf,
> + int, u32);
> +
> +void wlapi_high_update_phy_mode(struct phy_shim_info *physhim, u32 phy_mode);
> +u16 wlapi_bmac_get_txant(struct phy_shim_info *physhim);
>
> #endif /* _BRCM_PHY_SHIM_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/pmu.h b/drivers/net/wireless/brcm80211/brcmsmac/pmu.h
> index 20e2012..a014bbc 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/pmu.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/pmu.h
> @@ -20,7 +20,7 @@
>
> #include "types.h"
>
> -extern u16 si_pmu_fast_pwrup_delay(struct si_pub *sih);
> -extern u32 si_pmu_measure_alpclk(struct si_pub *sih);
> +u16 si_pmu_fast_pwrup_delay(struct si_pub *sih);
> +u32 si_pmu_measure_alpclk(struct si_pub *sih);
>
> #endif /* _BRCM_PMU_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/pub.h b/drivers/net/wireless/brcm80211/brcmsmac/pub.h
> index d36ea5e..4da38cb 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/pub.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/pub.h
> @@ -266,83 +266,76 @@ struct brcms_antselcfg {
> };
>
> /* common functions for every port */
> -extern struct brcms_c_info *
> -brcms_c_attach(struct brcms_info *wl, struct bcma_device *core, uint unit,
> - bool piomode, uint *perr);
> -extern uint brcms_c_detach(struct brcms_c_info *wlc);
> -extern int brcms_c_up(struct brcms_c_info *wlc);
> -extern uint brcms_c_down(struct brcms_c_info *wlc);
> -
> -extern bool brcms_c_chipmatch(struct bcma_device *core);
> -extern void brcms_c_init(struct brcms_c_info *wlc, bool mute_tx);
> -extern void brcms_c_reset(struct brcms_c_info *wlc);
> -
> -extern void brcms_c_intrson(struct brcms_c_info *wlc);
> -extern u32 brcms_c_intrsoff(struct brcms_c_info *wlc);
> -extern void brcms_c_intrsrestore(struct brcms_c_info *wlc, u32 macintmask);
> -extern bool brcms_c_intrsupd(struct brcms_c_info *wlc);
> -extern bool brcms_c_isr(struct brcms_c_info *wlc);
> -extern bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded);
> -extern bool brcms_c_sendpkt_mac80211(struct brcms_c_info *wlc,
> - struct sk_buff *sdu,
> - struct ieee80211_hw *hw);
> -extern bool brcms_c_aggregatable(struct brcms_c_info *wlc, u8 tid);
> -extern void brcms_c_protection_upd(struct brcms_c_info *wlc, uint idx,
> - int val);
> -extern int brcms_c_get_header_len(void);
> -extern void brcms_c_set_addrmatch(struct brcms_c_info *wlc,
> - int match_reg_offset,
> - const u8 *addr);
> -extern void brcms_c_wme_setparams(struct brcms_c_info *wlc, u16 aci,
> - const struct ieee80211_tx_queue_params *arg,
> - bool suspend);
> -extern struct brcms_pub *brcms_c_pub(struct brcms_c_info *wlc);
> -extern void brcms_c_ampdu_flush(struct brcms_c_info *wlc,
> - struct ieee80211_sta *sta, u16 tid);
> -extern void brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
> - u8 ba_wsize, uint max_rx_ampdu_bytes);
> -extern int brcms_c_module_register(struct brcms_pub *pub,
> - const char *name, struct brcms_info *hdl,
> - int (*down_fn)(void *handle));
> -extern int brcms_c_module_unregister(struct brcms_pub *pub, const char *name,
> - struct brcms_info *hdl);
> -extern void brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc);
> -extern void brcms_c_enable_mac(struct brcms_c_info *wlc);
> -extern void brcms_c_associate_upd(struct brcms_c_info *wlc, bool state);
> -extern void brcms_c_scan_start(struct brcms_c_info *wlc);
> -extern void brcms_c_scan_stop(struct brcms_c_info *wlc);
> -extern int brcms_c_get_curband(struct brcms_c_info *wlc);
> -extern int brcms_c_set_channel(struct brcms_c_info *wlc, u16 channel);
> -extern int brcms_c_set_rate_limit(struct brcms_c_info *wlc, u16 srl, u16 lrl);
> -extern void brcms_c_get_current_rateset(struct brcms_c_info *wlc,
> +struct brcms_c_info *brcms_c_attach(struct brcms_info *wl,
> + struct bcma_device *core, uint unit,
> + bool piomode, uint *perr);
> +uint brcms_c_detach(struct brcms_c_info *wlc);
> +int brcms_c_up(struct brcms_c_info *wlc);
> +uint brcms_c_down(struct brcms_c_info *wlc);
> +
> +bool brcms_c_chipmatch(struct bcma_device *core);
> +void brcms_c_init(struct brcms_c_info *wlc, bool mute_tx);
> +void brcms_c_reset(struct brcms_c_info *wlc);
> +
> +void brcms_c_intrson(struct brcms_c_info *wlc);
> +u32 brcms_c_intrsoff(struct brcms_c_info *wlc);
> +void brcms_c_intrsrestore(struct brcms_c_info *wlc, u32 macintmask);
> +bool brcms_c_intrsupd(struct brcms_c_info *wlc);
> +bool brcms_c_isr(struct brcms_c_info *wlc);
> +bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded);
> +bool brcms_c_sendpkt_mac80211(struct brcms_c_info *wlc, struct sk_buff *sdu,
> + struct ieee80211_hw *hw);
> +bool brcms_c_aggregatable(struct brcms_c_info *wlc, u8 tid);
> +void brcms_c_protection_upd(struct brcms_c_info *wlc, uint idx, int val);
> +int brcms_c_get_header_len(void);
> +void brcms_c_set_addrmatch(struct brcms_c_info *wlc, int match_reg_offset,
> + const u8 *addr);
> +void brcms_c_wme_setparams(struct brcms_c_info *wlc, u16 aci,
> + const struct ieee80211_tx_queue_params *arg,
> + bool suspend);
> +struct brcms_pub *brcms_c_pub(struct brcms_c_info *wlc);
> +void brcms_c_ampdu_flush(struct brcms_c_info *wlc, struct ieee80211_sta *sta,
> + u16 tid);
> +void brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
> + u8 ba_wsize, uint max_rx_ampdu_bytes);
> +int brcms_c_module_register(struct brcms_pub *pub, const char *name,
> + struct brcms_info *hdl,
> + int (*down_fn)(void *handle));
> +int brcms_c_module_unregister(struct brcms_pub *pub, const char *name,
> + struct brcms_info *hdl);
> +void brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc);
> +void brcms_c_enable_mac(struct brcms_c_info *wlc);
> +void brcms_c_associate_upd(struct brcms_c_info *wlc, bool state);
> +void brcms_c_scan_start(struct brcms_c_info *wlc);
> +void brcms_c_scan_stop(struct brcms_c_info *wlc);
> +int brcms_c_get_curband(struct brcms_c_info *wlc);
> +int brcms_c_set_channel(struct brcms_c_info *wlc, u16 channel);
> +int brcms_c_set_rate_limit(struct brcms_c_info *wlc, u16 srl, u16 lrl);
> +void brcms_c_get_current_rateset(struct brcms_c_info *wlc,
> struct brcm_rateset *currs);
> -extern int brcms_c_set_rateset(struct brcms_c_info *wlc,
> - struct brcm_rateset *rs);
> -extern int brcms_c_set_beacon_period(struct brcms_c_info *wlc, u16 period);
> -extern u16 brcms_c_get_phy_type(struct brcms_c_info *wlc, int phyidx);
> -extern void brcms_c_set_shortslot_override(struct brcms_c_info *wlc,
> +int brcms_c_set_rateset(struct brcms_c_info *wlc, struct brcm_rateset *rs);
> +int brcms_c_set_beacon_period(struct brcms_c_info *wlc, u16 period);
> +u16 brcms_c_get_phy_type(struct brcms_c_info *wlc, int phyidx);
> +void brcms_c_set_shortslot_override(struct brcms_c_info *wlc,
> s8 sslot_override);
> -extern void brcms_c_set_beacon_listen_interval(struct brcms_c_info *wlc,
> - u8 interval);
> -extern u64 brcms_c_tsf_get(struct brcms_c_info *wlc);
> -extern void brcms_c_tsf_set(struct brcms_c_info *wlc, u64 tsf);
> -extern int brcms_c_set_tx_power(struct brcms_c_info *wlc, int txpwr);
> -extern int brcms_c_get_tx_power(struct brcms_c_info *wlc);
> -extern bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc);
> -extern void brcms_c_mute(struct brcms_c_info *wlc, bool on);
> -extern bool brcms_c_tx_flush_completed(struct brcms_c_info *wlc);
> -extern void brcms_c_start_station(struct brcms_c_info *wlc, u8 *addr);
> -extern void brcms_c_start_ap(struct brcms_c_info *wlc, u8 *addr,
> - const u8 *bssid, u8 *ssid, size_t ssid_len);
> -extern void brcms_c_start_adhoc(struct brcms_c_info *wlc, u8 *addr);
> -extern void brcms_c_update_beacon(struct brcms_c_info *wlc);
> -extern void brcms_c_set_new_beacon(struct brcms_c_info *wlc,
> - struct sk_buff *beacon, u16 tim_offset,
> - u16 dtim_period);
> -extern void brcms_c_set_new_probe_resp(struct brcms_c_info *wlc,
> - struct sk_buff *probe_resp);
> -extern void brcms_c_enable_probe_resp(struct brcms_c_info *wlc, bool enable);
> -extern void brcms_c_set_ssid(struct brcms_c_info *wlc, u8 *ssid,
> - size_t ssid_len);
> +void brcms_c_set_beacon_listen_interval(struct brcms_c_info *wlc, u8 interval);
> +u64 brcms_c_tsf_get(struct brcms_c_info *wlc);
> +void brcms_c_tsf_set(struct brcms_c_info *wlc, u64 tsf);
> +int brcms_c_set_tx_power(struct brcms_c_info *wlc, int txpwr);
> +int brcms_c_get_tx_power(struct brcms_c_info *wlc);
> +bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc);
> +void brcms_c_mute(struct brcms_c_info *wlc, bool on);
> +bool brcms_c_tx_flush_completed(struct brcms_c_info *wlc);
> +void brcms_c_start_station(struct brcms_c_info *wlc, u8 *addr);
> +void brcms_c_start_ap(struct brcms_c_info *wlc, u8 *addr, const u8 *bssid,
> + u8 *ssid, size_t ssid_len);
> +void brcms_c_start_adhoc(struct brcms_c_info *wlc, u8 *addr);
> +void brcms_c_update_beacon(struct brcms_c_info *wlc);
> +void brcms_c_set_new_beacon(struct brcms_c_info *wlc, struct sk_buff *beacon,
> + u16 tim_offset, u16 dtim_period);
> +void brcms_c_set_new_probe_resp(struct brcms_c_info *wlc,
> + struct sk_buff *probe_resp);
> +void brcms_c_enable_probe_resp(struct brcms_c_info *wlc, bool enable);
> +void brcms_c_set_ssid(struct brcms_c_info *wlc, u8 *ssid, size_t ssid_len);
>
> #endif /* _BRCM_PUB_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/rate.h b/drivers/net/wireless/brcm80211/brcmsmac/rate.h
> index 980d578..5bb88b7 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/rate.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/rate.h
> @@ -216,34 +216,30 @@ static inline u8 cck_phy2mac_rate(u8 signal)
>
> /* sanitize, and sort a rateset with the basic bit(s) preserved, validate
> * rateset */
> -extern bool
> -brcms_c_rate_hwrs_filter_sort_validate(struct brcms_c_rateset *rs,
> - const struct brcms_c_rateset *hw_rs,
> - bool check_brate, u8 txstreams);
> +bool brcms_c_rate_hwrs_filter_sort_validate(struct brcms_c_rateset *rs,
> + const struct brcms_c_rateset *hw_rs,
> + bool check_brate, u8 txstreams);
> /* copy rateset src to dst as-is (no masking or sorting) */
> -extern void brcms_c_rateset_copy(const struct brcms_c_rateset *src,
> - struct brcms_c_rateset *dst);
> +void brcms_c_rateset_copy(const struct brcms_c_rateset *src,
> + struct brcms_c_rateset *dst);
>
> /* would be nice to have these documented ... */
> -extern u32 brcms_c_compute_rspec(struct d11rxhdr *rxh, u8 *plcp);
> -
> -extern void brcms_c_rateset_filter(struct brcms_c_rateset *src,
> - struct brcms_c_rateset *dst, bool basic_only, u8 rates, uint xmask,
> - bool mcsallow);
> -
> -extern void
> -brcms_c_rateset_default(struct brcms_c_rateset *rs_tgt,
> - const struct brcms_c_rateset *rs_hw, uint phy_type,
> - int bandtype, bool cck_only, uint rate_mask,
> - bool mcsallow, u8 bw, u8 txstreams);
> -
> -extern s16 brcms_c_rate_legacy_phyctl(uint rate);
> -
> -extern void brcms_c_rateset_mcs_upd(struct brcms_c_rateset *rs, u8 txstreams);
> -extern void brcms_c_rateset_mcs_clear(struct brcms_c_rateset *rateset);
> -extern void brcms_c_rateset_mcs_build(struct brcms_c_rateset *rateset,
> - u8 txstreams);
> -extern void brcms_c_rateset_bw_mcs_filter(struct brcms_c_rateset *rateset,
> - u8 bw);
> +u32 brcms_c_compute_rspec(struct d11rxhdr *rxh, u8 *plcp);
> +
> +void brcms_c_rateset_filter(struct brcms_c_rateset *src,
> + struct brcms_c_rateset *dst, bool basic_only,
> + u8 rates, uint xmask, bool mcsallow);
> +
> +void brcms_c_rateset_default(struct brcms_c_rateset *rs_tgt,
> + const struct brcms_c_rateset *rs_hw, uint phy_type,
> + int bandtype, bool cck_only, uint rate_mask,
> + bool mcsallow, u8 bw, u8 txstreams);
> +
> +s16 brcms_c_rate_legacy_phyctl(uint rate);
> +
> +void brcms_c_rateset_mcs_upd(struct brcms_c_rateset *rs, u8 txstreams);
> +void brcms_c_rateset_mcs_clear(struct brcms_c_rateset *rateset);
> +void brcms_c_rateset_mcs_build(struct brcms_c_rateset *rateset, u8 txstreams);
> +void brcms_c_rateset_bw_mcs_filter(struct brcms_c_rateset *rateset, u8 bw);
>
> #endif /* _BRCM_RATE_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/stf.h b/drivers/net/wireless/brcm80211/brcmsmac/stf.h
> index 19f6580..ba94930 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/stf.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/stf.h
> @@ -19,24 +19,19 @@
>
> #include "types.h"
>
> -extern int brcms_c_stf_attach(struct brcms_c_info *wlc);
> -extern void brcms_c_stf_detach(struct brcms_c_info *wlc);
> +int brcms_c_stf_attach(struct brcms_c_info *wlc);
> +void brcms_c_stf_detach(struct brcms_c_info *wlc);
>
> -extern void brcms_c_tempsense_upd(struct brcms_c_info *wlc);
> -extern void brcms_c_stf_ss_algo_channel_get(struct brcms_c_info *wlc,
> - u16 *ss_algo_channel,
> - u16 chanspec);
> -extern int brcms_c_stf_ss_update(struct brcms_c_info *wlc,
> - struct brcms_band *band);
> -extern void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc);
> -extern int brcms_c_stf_txchain_set(struct brcms_c_info *wlc, s32 int_val,
> - bool force);
> -extern bool brcms_c_stf_stbc_rx_set(struct brcms_c_info *wlc, s32 int_val);
> -extern void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc);
> -extern void brcms_c_stf_phy_chain_calc(struct brcms_c_info *wlc);
> -extern u16 brcms_c_stf_phytxchain_sel(struct brcms_c_info *wlc,
> - u32 rspec);
> -extern u16 brcms_c_stf_d11hdrs_phyctl_txant(struct brcms_c_info *wlc,
> - u32 rspec);
> +void brcms_c_tempsense_upd(struct brcms_c_info *wlc);
> +void brcms_c_stf_ss_algo_channel_get(struct brcms_c_info *wlc,
> + u16 *ss_algo_channel, u16 chanspec);
> +int brcms_c_stf_ss_update(struct brcms_c_info *wlc, struct brcms_band *band);
> +void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc);
> +int brcms_c_stf_txchain_set(struct brcms_c_info *wlc, s32 int_val, bool force);
> +bool brcms_c_stf_stbc_rx_set(struct brcms_c_info *wlc, s32 int_val);
> +void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc);
> +void brcms_c_stf_phy_chain_calc(struct brcms_c_info *wlc);
> +u16 brcms_c_stf_phytxchain_sel(struct brcms_c_info *wlc, u32 rspec);
> +u16 brcms_c_stf_d11hdrs_phyctl_txant(struct brcms_c_info *wlc, u32 rspec);
>
> #endif /* _BRCM_STF_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/ucode_loader.h b/drivers/net/wireless/brcm80211/brcmsmac/ucode_loader.h
> index 18750a8..c87dd89 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/ucode_loader.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/ucode_loader.h
> @@ -43,16 +43,14 @@ struct brcms_ucode {
> u32 *bcm43xx_bomminor;
> };
>
> -extern int
> -brcms_ucode_data_init(struct brcms_info *wl, struct brcms_ucode *ucode);
> +int brcms_ucode_data_init(struct brcms_info *wl, struct brcms_ucode *ucode);
>
> -extern void brcms_ucode_data_free(struct brcms_ucode *ucode);
> +void brcms_ucode_data_free(struct brcms_ucode *ucode);
>
> -extern int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf,
> - unsigned int idx);
> -extern int brcms_ucode_init_uint(struct brcms_info *wl, size_t *n_bytes,
> - unsigned int idx);
> -extern void brcms_ucode_free_buf(void *);
> -extern int brcms_check_firmwares(struct brcms_info *wl);
> +int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, unsigned int idx);
> +int brcms_ucode_init_uint(struct brcms_info *wl, size_t *n_bytes,
> + unsigned int idx);
> +void brcms_ucode_free_buf(void *);
> +int brcms_check_firmwares(struct brcms_info *wl);
>
> #endif /* _BRCM_UCODE_H_ */
> diff --git a/drivers/net/wireless/brcm80211/include/brcmu_d11.h b/drivers/net/wireless/brcm80211/include/brcmu_d11.h
> index 92623f0..8660a2c 100644
> --- a/drivers/net/wireless/brcm80211/include/brcmu_d11.h
> +++ b/drivers/net/wireless/brcm80211/include/brcmu_d11.h
> @@ -140,6 +140,6 @@ struct brcmu_d11inf {
> void (*decchspec)(struct brcmu_chan *ch);
> };
>
> -extern void brcmu_d11_attach(struct brcmu_d11inf *d11inf);
> +void brcmu_d11_attach(struct brcmu_d11inf *d11inf);
>
> #endif /* _BRCMU_CHANNELS_H_ */
> diff --git a/drivers/net/wireless/brcm80211/include/brcmu_utils.h b/drivers/net/wireless/brcm80211/include/brcmu_utils.h
> index 898cacb..8ba445b 100644
> --- a/drivers/net/wireless/brcm80211/include/brcmu_utils.h
> +++ b/drivers/net/wireless/brcm80211/include/brcmu_utils.h
> @@ -114,31 +114,29 @@ static inline struct sk_buff *pktq_ppeek_tail(struct pktq *pq, int prec)
> return skb_peek_tail(&pq->q[prec].skblist);
> }
>
> -extern struct sk_buff *brcmu_pktq_penq(struct pktq *pq, int prec,
> - struct sk_buff *p);
> -extern struct sk_buff *brcmu_pktq_penq_head(struct pktq *pq, int prec,
> - struct sk_buff *p);
> -extern struct sk_buff *brcmu_pktq_pdeq(struct pktq *pq, int prec);
> -extern struct sk_buff *brcmu_pktq_pdeq_tail(struct pktq *pq, int prec);
> -extern struct sk_buff *brcmu_pktq_pdeq_match(struct pktq *pq, int prec,
> - bool (*match_fn)(struct sk_buff *p,
> - void *arg),
> - void *arg);
> +struct sk_buff *brcmu_pktq_penq(struct pktq *pq, int prec, struct sk_buff *p);
> +struct sk_buff *brcmu_pktq_penq_head(struct pktq *pq, int prec,
> + struct sk_buff *p);
> +struct sk_buff *brcmu_pktq_pdeq(struct pktq *pq, int prec);
> +struct sk_buff *brcmu_pktq_pdeq_tail(struct pktq *pq, int prec);
> +struct sk_buff *brcmu_pktq_pdeq_match(struct pktq *pq, int prec,
> + bool (*match_fn)(struct sk_buff *p,
> + void *arg),
> + void *arg);
>
> /* packet primitives */
> -extern struct sk_buff *brcmu_pkt_buf_get_skb(uint len);
> -extern void brcmu_pkt_buf_free_skb(struct sk_buff *skb);
> +struct sk_buff *brcmu_pkt_buf_get_skb(uint len);
> +void brcmu_pkt_buf_free_skb(struct sk_buff *skb);
>
> /* Empty the queue at particular precedence level */
> /* callback function fn(pkt, arg) returns true if pkt belongs to if */
> -extern void brcmu_pktq_pflush(struct pktq *pq, int prec,
> - bool dir, bool (*fn)(struct sk_buff *, void *), void *arg);
> +void brcmu_pktq_pflush(struct pktq *pq, int prec, bool dir,
> + bool (*fn)(struct sk_buff *, void *), void *arg);
>
> /* operations on a set of precedences in packet queue */
>
> -extern int brcmu_pktq_mlen(struct pktq *pq, uint prec_bmp);
> -extern struct sk_buff *brcmu_pktq_mdeq(struct pktq *pq, uint prec_bmp,
> - int *prec_out);
> +int brcmu_pktq_mlen(struct pktq *pq, uint prec_bmp);
> +struct sk_buff *brcmu_pktq_mdeq(struct pktq *pq, uint prec_bmp, int *prec_out);
>
> /* operations on packet queue as a whole */
>
> @@ -167,11 +165,11 @@ static inline bool pktq_empty(struct pktq *pq)
> return pq->len == 0;
> }
>
> -extern void brcmu_pktq_init(struct pktq *pq, int num_prec, int max_len);
> +void brcmu_pktq_init(struct pktq *pq, int num_prec, int max_len);
> /* prec_out may be NULL if caller is not interested in return value */
> -extern struct sk_buff *brcmu_pktq_peek_tail(struct pktq *pq, int *prec_out);
> -extern void brcmu_pktq_flush(struct pktq *pq, bool dir,
> - bool (*fn)(struct sk_buff *, void *), void *arg);
> +struct sk_buff *brcmu_pktq_peek_tail(struct pktq *pq, int *prec_out);
> +void brcmu_pktq_flush(struct pktq *pq, bool dir,
> + bool (*fn)(struct sk_buff *, void *), void *arg);
>
> /* externs */
> /* ip address */
> @@ -204,13 +202,13 @@ static inline u16 brcmu_maskget16(u16 var, u16 mask, u8 shift)
> /* externs */
> /* format/print */
> #ifdef DEBUG
> -extern void brcmu_prpkt(const char *msg, struct sk_buff *p0);
> +void brcmu_prpkt(const char *msg, struct sk_buff *p0);
> #else
> #define brcmu_prpkt(a, b)
> #endif /* DEBUG */
>
> #ifdef DEBUG
> -extern __printf(3, 4)
> +__printf(3, 4)
> void brcmu_dbg_hex_dump(const void *data, size_t size, const char *fmt, ...);
> #else
> __printf(3, 4)
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox