Skip to content

Commit 56025ca

Browse files
committed
Merge tag 'wireless-drivers-next-for-davem-2016-05-13' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
Kalle Valo says: ==================== wireless-drivers patches for 4.7 Major changes: iwlwifi * remove IWLWIFI_DEBUG_EXPERIMENTAL_UCODE kconfig option * work for RX multiqueue continues * dynamic queue allocation work continues * add Luca as maintainer * a bunch of fixes and improvements all over brcmfmac * add 4356 sdio support ath6kl * add ability to set debug uart baud rate with a module parameter wil6210 * add debugfs file to configure firmware led functionality ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 05a5648 + 52776a7 commit 56025ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+7274
-5289
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5895,6 +5895,7 @@ F: drivers/net/wireless/intel/iwlegacy/
58955895
INTEL WIRELESS WIFI LINK (iwlwifi)
58965896
M: Johannes Berg <johannes.berg@intel.com>
58975897
M: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
5898+
M: Luca Coelho <luciano.coelho@intel.com>
58985899
M: Intel Linux Wireless <linuxwifi@intel.com>
58995900
L: linux-wireless@vger.kernel.org
59005901
W: http://intellinuxwireless.org

drivers/net/wireless/ath/ath10k/core.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
202202
.name = "qca4019 hw1.0",
203203
.patch_load_addr = QCA4019_HW_1_0_PATCH_LOAD_ADDR,
204204
.uart_pin = 7,
205+
.has_shifted_cc_wraparound = true,
205206
.otp_exe_param = 0x0010000,
206207
.continuous_frag_desc = true,
207208
.channel_counters_freq_hz = 125000,
@@ -686,6 +687,9 @@ static void ath10k_core_free_firmware_files(struct ath10k *ar)
686687
if (!IS_ERR(ar->cal_file))
687688
release_firmware(ar->cal_file);
688689

690+
if (!IS_ERR(ar->pre_cal_file))
691+
release_firmware(ar->pre_cal_file);
692+
689693
ath10k_swap_code_seg_release(ar);
690694

691695
ar->normal_mode_fw.fw_file.otp_data = NULL;
@@ -696,6 +700,7 @@ static void ath10k_core_free_firmware_files(struct ath10k *ar)
696700
ar->normal_mode_fw.fw_file.firmware_len = 0;
697701

698702
ar->cal_file = NULL;
703+
ar->pre_cal_file = NULL;
699704
}
700705

701706
static int ath10k_fetch_cal_file(struct ath10k *ar)
@@ -1392,6 +1397,7 @@ static void ath10k_core_restart(struct work_struct *work)
13921397
complete_all(&ar->install_key_done);
13931398
complete_all(&ar->vdev_setup_done);
13941399
complete_all(&ar->thermal.wmi_sync);
1400+
complete_all(&ar->bss_survey_done);
13951401
wake_up(&ar->htt.empty_tx_wq);
13961402
wake_up(&ar->wmi.tx_credits_wq);
13971403
wake_up(&ar->peer_mapping_wq);
@@ -1724,6 +1730,9 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
17241730
if (ath10k_peer_stats_enabled(ar))
17251731
val = WMI_10_4_PEER_STATS;
17261732

1733+
if (test_bit(WMI_SERVICE_BSS_CHANNEL_INFO_64, ar->wmi.svc_map))
1734+
val |= WMI_10_4_BSS_CHANNEL_INFO_64;
1735+
17271736
status = ath10k_mac_ext_resource_config(ar, val);
17281737
if (status) {
17291738
ath10k_err(ar,
@@ -1758,6 +1767,10 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
17581767
goto err_hif_stop;
17591768
}
17601769

1770+
ar->free_vdev_map = (1LL << ar->max_num_vdevs) - 1;
1771+
1772+
INIT_LIST_HEAD(&ar->arvifs);
1773+
17611774
/* we don't care about HTT in UTF mode */
17621775
if (mode == ATH10K_FIRMWARE_MODE_NORMAL) {
17631776
status = ath10k_htt_setup(&ar->htt);
@@ -1771,10 +1784,6 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
17711784
if (status)
17721785
goto err_hif_stop;
17731786

1774-
ar->free_vdev_map = (1LL << ar->max_num_vdevs) - 1;
1775-
1776-
INIT_LIST_HEAD(&ar->arvifs);
1777-
17781787
return 0;
17791788

17801789
err_hif_stop:
@@ -2085,6 +2094,7 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev,
20852094
init_completion(&ar->install_key_done);
20862095
init_completion(&ar->vdev_setup_done);
20872096
init_completion(&ar->thermal.wmi_sync);
2097+
init_completion(&ar->bss_survey_done);
20882098

20892099
INIT_DELAYED_WORK(&ar->scan.timeout, ath10k_scan_timeout_work);
20902100

drivers/net/wireless/ath/ath10k/core.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,15 +876,14 @@ struct ath10k {
876876
* avoid reporting garbage data.
877877
*/
878878
bool ch_info_can_report_survey;
879+
struct completion bss_survey_done;
879880

880881
struct dfs_pattern_detector *dfs_detector;
881882

882883
unsigned long tx_paused; /* see ATH10K_TX_PAUSE_ */
883884

884885
#ifdef CONFIG_ATH10K_DEBUGFS
885886
struct ath10k_debug debug;
886-
#endif
887-
888887
struct {
889888
/* relay(fs) channel for spectral scan */
890889
struct rchan *rfs_chan_spec_scan;
@@ -893,6 +892,7 @@ struct ath10k {
893892
enum ath10k_spectral_mode mode;
894893
struct ath10k_spec_scan config;
895894
} spectral;
895+
#endif
896896

897897
struct {
898898
/* protected by conf_mutex */

drivers/net/wireless/ath/ath10k/mac.c

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4278,9 +4278,6 @@ static void ath10k_mac_setup_ht_vht_cap(struct ath10k *ar)
42784278
if (ar->phy_capability & WHAL_WLAN_11G_CAPABILITY) {
42794279
band = &ar->mac.sbands[NL80211_BAND_2GHZ];
42804280
band->ht_cap = ht_cap;
4281-
4282-
/* Enable the VHT support at 2.4 GHz */
4283-
band->vht_cap = vht_cap;
42844281
}
42854282
if (ar->phy_capability & WHAL_WLAN_11A_CAPABILITY) {
42864283
band = &ar->mac.sbands[NL80211_BAND_5GHZ];
@@ -4346,7 +4343,7 @@ static int ath10k_start(struct ieee80211_hw *hw)
43464343

43474344
/*
43484345
* This makes sense only when restarting hw. It is harmless to call
4349-
* uncoditionally. This is necessary to make sure no HTT/WMI tx
4346+
* unconditionally. This is necessary to make sure no HTT/WMI tx
43504347
* commands will be submitted while restarting.
43514348
*/
43524349
ath10k_drain_tx(ar);
@@ -6407,6 +6404,39 @@ static void ath10k_reconfig_complete(struct ieee80211_hw *hw,
64076404
mutex_unlock(&ar->conf_mutex);
64086405
}
64096406

6407+
static void
6408+
ath10k_mac_update_bss_chan_survey(struct ath10k *ar,
6409+
struct ieee80211_channel *channel)
6410+
{
6411+
int ret;
6412+
enum wmi_bss_survey_req_type type = WMI_BSS_SURVEY_REQ_TYPE_READ_CLEAR;
6413+
6414+
lockdep_assert_held(&ar->conf_mutex);
6415+
6416+
if (!test_bit(WMI_SERVICE_BSS_CHANNEL_INFO_64, ar->wmi.svc_map) ||
6417+
(ar->rx_channel != channel))
6418+
return;
6419+
6420+
if (ar->scan.state != ATH10K_SCAN_IDLE) {
6421+
ath10k_dbg(ar, ATH10K_DBG_MAC, "ignoring bss chan info request while scanning..\n");
6422+
return;
6423+
}
6424+
6425+
reinit_completion(&ar->bss_survey_done);
6426+
6427+
ret = ath10k_wmi_pdev_bss_chan_info_request(ar, type);
6428+
if (ret) {
6429+
ath10k_warn(ar, "failed to send pdev bss chan info request\n");
6430+
return;
6431+
}
6432+
6433+
ret = wait_for_completion_timeout(&ar->bss_survey_done, 3 * HZ);
6434+
if (!ret) {
6435+
ath10k_warn(ar, "bss channel survey timed out\n");
6436+
return;
6437+
}
6438+
}
6439+
64106440
static int ath10k_get_survey(struct ieee80211_hw *hw, int idx,
64116441
struct survey_info *survey)
64126442
{
@@ -6431,6 +6461,8 @@ static int ath10k_get_survey(struct ieee80211_hw *hw, int idx,
64316461
goto exit;
64326462
}
64336463

6464+
ath10k_mac_update_bss_chan_survey(ar, survey->channel);
6465+
64346466
spin_lock_bh(&ar->data_lock);
64356467
memcpy(survey, ar_survey, sizeof(*survey));
64366468
spin_unlock_bh(&ar->data_lock);

drivers/net/wireless/ath/ath10k/wmi-ops.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ struct wmi_ops {
191191
u32 fw_feature_bitmap);
192192
int (*get_vdev_subtype)(struct ath10k *ar,
193193
enum wmi_vdev_subtype subtype);
194+
struct sk_buff *(*gen_pdev_bss_chan_info_req)
195+
(struct ath10k *ar,
196+
enum wmi_bss_survey_req_type type);
194197
};
195198

196199
int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
@@ -1361,4 +1364,22 @@ ath10k_wmi_get_vdev_subtype(struct ath10k *ar, enum wmi_vdev_subtype subtype)
13611364
return ar->wmi.ops->get_vdev_subtype(ar, subtype);
13621365
}
13631366

1367+
static inline int
1368+
ath10k_wmi_pdev_bss_chan_info_request(struct ath10k *ar,
1369+
enum wmi_bss_survey_req_type type)
1370+
{
1371+
struct ath10k_wmi *wmi = &ar->wmi;
1372+
struct sk_buff *skb;
1373+
1374+
if (!wmi->ops->gen_pdev_bss_chan_info_req)
1375+
return -EOPNOTSUPP;
1376+
1377+
skb = wmi->ops->gen_pdev_bss_chan_info_req(ar, type);
1378+
if (IS_ERR(skb))
1379+
return PTR_ERR(skb);
1380+
1381+
return ath10k_wmi_cmd_send(ar, skb,
1382+
wmi->cmd->pdev_bss_chan_info_request_cmdid);
1383+
}
1384+
13641385
#endif

drivers/net/wireless/ath/ath10k/wmi.c

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,8 @@ static struct wmi_cmd_map wmi_10_2_4_cmd_map = {
521521
.vdev_filter_neighbor_rx_packets_cmdid = WMI_CMD_UNSUPPORTED,
522522
.mu_cal_start_cmdid = WMI_CMD_UNSUPPORTED,
523523
.set_cca_params_cmdid = WMI_CMD_UNSUPPORTED,
524-
.pdev_bss_chan_info_request_cmdid = WMI_CMD_UNSUPPORTED,
524+
.pdev_bss_chan_info_request_cmdid =
525+
WMI_10_2_PDEV_BSS_CHAN_INFO_REQUEST_CMDID,
525526
};
526527

527528
/* 10.4 WMI cmd track */
@@ -1633,6 +1634,7 @@ void ath10k_wmi_put_wmi_channel(struct wmi_channel *ch,
16331634
ch->max_power = arg->max_power;
16341635
ch->reg_power = arg->max_reg_power;
16351636
ch->antenna_max = arg->max_antenna_gain;
1637+
ch->max_tx_power = arg->max_power;
16361638

16371639
/* mode & flags share storage */
16381640
ch->mode = arg->mode;
@@ -4792,6 +4794,58 @@ static int ath10k_wmi_event_temperature(struct ath10k *ar, struct sk_buff *skb)
47924794
return 0;
47934795
}
47944796

4797+
static int ath10k_wmi_event_pdev_bss_chan_info(struct ath10k *ar,
4798+
struct sk_buff *skb)
4799+
{
4800+
struct wmi_pdev_bss_chan_info_event *ev;
4801+
struct survey_info *survey;
4802+
u64 busy, total, tx, rx, rx_bss;
4803+
u32 freq, noise_floor;
4804+
u32 cc_freq_hz = ar->hw_params.channel_counters_freq_hz;
4805+
int idx;
4806+
4807+
ev = (struct wmi_pdev_bss_chan_info_event *)skb->data;
4808+
if (WARN_ON(skb->len < sizeof(*ev)))
4809+
return -EPROTO;
4810+
4811+
freq = __le32_to_cpu(ev->freq);
4812+
noise_floor = __le32_to_cpu(ev->noise_floor);
4813+
busy = __le64_to_cpu(ev->cycle_busy);
4814+
total = __le64_to_cpu(ev->cycle_total);
4815+
tx = __le64_to_cpu(ev->cycle_tx);
4816+
rx = __le64_to_cpu(ev->cycle_rx);
4817+
rx_bss = __le64_to_cpu(ev->cycle_rx_bss);
4818+
4819+
ath10k_dbg(ar, ATH10K_DBG_WMI,
4820+
"wmi event pdev bss chan info:\n freq: %d noise: %d cycle: busy %llu total %llu tx %llu rx %llu rx_bss %llu\n",
4821+
freq, noise_floor, busy, total, tx, rx, rx_bss);
4822+
4823+
spin_lock_bh(&ar->data_lock);
4824+
idx = freq_to_idx(ar, freq);
4825+
if (idx >= ARRAY_SIZE(ar->survey)) {
4826+
ath10k_warn(ar, "bss chan info: invalid frequency %d (idx %d out of bounds)\n",
4827+
freq, idx);
4828+
goto exit;
4829+
}
4830+
4831+
survey = &ar->survey[idx];
4832+
4833+
survey->noise = noise_floor;
4834+
survey->time = div_u64(total, cc_freq_hz);
4835+
survey->time_busy = div_u64(busy, cc_freq_hz);
4836+
survey->time_rx = div_u64(rx_bss, cc_freq_hz);
4837+
survey->time_tx = div_u64(tx, cc_freq_hz);
4838+
survey->filled |= (SURVEY_INFO_NOISE_DBM |
4839+
SURVEY_INFO_TIME |
4840+
SURVEY_INFO_TIME_BUSY |
4841+
SURVEY_INFO_TIME_RX |
4842+
SURVEY_INFO_TIME_TX);
4843+
exit:
4844+
spin_unlock_bh(&ar->data_lock);
4845+
complete(&ar->bss_survey_done);
4846+
return 0;
4847+
}
4848+
47954849
static void ath10k_wmi_op_rx(struct ath10k *ar, struct sk_buff *skb)
47964850
{
47974851
struct wmi_cmd_hdr *cmd_hdr;
@@ -5135,6 +5189,9 @@ static void ath10k_wmi_10_2_op_rx(struct ath10k *ar, struct sk_buff *skb)
51355189
case WMI_10_2_PDEV_TEMPERATURE_EVENTID:
51365190
ath10k_wmi_event_temperature(ar, skb);
51375191
break;
5192+
case WMI_10_2_PDEV_BSS_CHAN_INFO_EVENTID:
5193+
ath10k_wmi_event_pdev_bss_chan_info(ar, skb);
5194+
break;
51385195
case WMI_10_2_RTT_KEEPALIVE_EVENTID:
51395196
case WMI_10_2_GPIO_INPUT_EVENTID:
51405197
case WMI_10_2_PEER_RATECODE_LIST_EVENTID:
@@ -5212,6 +5269,7 @@ static void ath10k_wmi_10_4_op_rx(struct ath10k *ar, struct sk_buff *skb)
52125269
ath10k_wmi_event_vdev_stopped(ar, skb);
52135270
break;
52145271
case WMI_10_4_WOW_WAKEUP_HOST_EVENTID:
5272+
case WMI_10_4_PEER_RATECODE_LIST_EVENTID:
52155273
ath10k_dbg(ar, ATH10K_DBG_WMI,
52165274
"received event id %d not implemented\n", id);
52175275
break;
@@ -5221,6 +5279,9 @@ static void ath10k_wmi_10_4_op_rx(struct ath10k *ar, struct sk_buff *skb)
52215279
case WMI_10_4_PDEV_TEMPERATURE_EVENTID:
52225280
ath10k_wmi_event_temperature(ar, skb);
52235281
break;
5282+
case WMI_10_4_PDEV_BSS_CHAN_INFO_EVENTID:
5283+
ath10k_wmi_event_pdev_bss_chan_info(ar, skb);
5284+
break;
52245285
default:
52255286
ath10k_warn(ar, "Unknown eventid: %d\n", id);
52265287
break;
@@ -5606,6 +5667,9 @@ static struct sk_buff *ath10k_wmi_10_2_op_gen_init(struct ath10k *ar)
56065667
if (ath10k_peer_stats_enabled(ar))
56075668
features |= WMI_10_2_PEER_STATS;
56085669

5670+
if (test_bit(WMI_SERVICE_BSS_CHANNEL_INFO_64, ar->wmi.svc_map))
5671+
features |= WMI_10_2_BSS_CHAN_INFO;
5672+
56095673
cmd->resource_config.feature_mask = __cpu_to_le32(features);
56105674

56115675
memcpy(&cmd->resource_config.common, &config, sizeof(config));
@@ -6636,6 +6700,26 @@ ath10k_wmi_10_2_op_gen_pdev_get_temperature(struct ath10k *ar)
66366700
return skb;
66376701
}
66386702

6703+
static struct sk_buff *
6704+
ath10k_wmi_10_2_op_gen_pdev_bss_chan_info(struct ath10k *ar,
6705+
enum wmi_bss_survey_req_type type)
6706+
{
6707+
struct wmi_pdev_chan_info_req_cmd *cmd;
6708+
struct sk_buff *skb;
6709+
6710+
skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
6711+
if (!skb)
6712+
return ERR_PTR(-ENOMEM);
6713+
6714+
cmd = (struct wmi_pdev_chan_info_req_cmd *)skb->data;
6715+
cmd->type = __cpu_to_le32(type);
6716+
6717+
ath10k_dbg(ar, ATH10K_DBG_WMI,
6718+
"wmi pdev bss info request type %d\n", type);
6719+
6720+
return skb;
6721+
}
6722+
66396723
/* This function assumes the beacon is already DMA mapped */
66406724
static struct sk_buff *
66416725
ath10k_wmi_op_gen_beacon_dma(struct ath10k *ar, u32 vdev_id, const void *bcn,
@@ -7735,6 +7819,7 @@ static const struct wmi_ops wmi_10_2_4_ops = {
77357819
.gen_init = ath10k_wmi_10_2_op_gen_init,
77367820
.gen_peer_assoc = ath10k_wmi_10_2_op_gen_peer_assoc,
77377821
.gen_pdev_get_temperature = ath10k_wmi_10_2_op_gen_pdev_get_temperature,
7822+
.gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info,
77387823

77397824
/* shared with 10.1 */
77407825
.map_svc = wmi_10x_svc_map,
@@ -7861,6 +7946,7 @@ static const struct wmi_ops wmi_10_4_ops = {
78617946
.gen_request_stats = ath10k_wmi_op_gen_request_stats,
78627947
.gen_pdev_get_temperature = ath10k_wmi_10_2_op_gen_pdev_get_temperature,
78637948
.get_vdev_subtype = ath10k_wmi_10_4_op_get_vdev_subtype,
7949+
.gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info,
78647950
};
78657951

78667952
int ath10k_wmi_attach(struct ath10k *ar)

0 commit comments

Comments
 (0)