Re: [ath9k-devel] [PATCH v3 0/6] ath10k: pci cleanup
Michal Kazior michal.kaz...@tieto.com writes: This gets rid of the ugly device/target resetting retries. It also tries to simplify pci probing logic. v3: rebased on top of latest master branch Michal Kazior (6): ath10k: fix pci_set_drvpriv ordering ath10k: refactor pci interrupt functions ath10k: remove pci probe retrying ath10k: remove ath10k_pci_configure() ath10k: remove ath10k_pci_probe_device() ath10k: simplify pci target reset Thanks, applied. I had conflicts in patches 3 and 5, please check them carefully. Still sha1 ids didn't work and I had to manually fix the conflicts. -- Kalle Valo ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
Re: [ath9k-devel] [PATCH v3 1/6] ath10k: fix pci_set_drvpriv ordering
Michal Kazior michal.kaz...@tieto.com writes: Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/pci.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 2e4e85b..14197ec 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c I have been trying to understand why 3-way merge doesn't work with your patches, but I just don't get it. The object id seems to be valid as this works for me: $ git show 2e4e85b | head -3 /* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2013 Qualcomm Atheros, Inc. So does git-am fail when parsing the email or what? Next I tried to compare your and Bartosz' emails and I didn't find anything which would explain the problem. The only difference I was able to find was that Bartosz uses git 1.7.10 and you use 1.7.9.5, but that shouldn't make any difference as the patch looks ok otherwise. FWIW, I use git 1.7.9.5 from Ubuntu 12.04 64 bit. Quite a problem we have :/ -- Kalle Valo ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
Re: [ath9k-devel] [PATCH v3 1/6] ath10k: fix pci_set_drvpriv ordering
On 26/04/13 08:45, Kalle Valo wrote: Michal Kazior michal.kaz...@tieto.com writes: Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/pci.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 2e4e85b..14197ec 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c I have been trying to understand why 3-way merge doesn't work with your patches, but I just don't get it. The object id seems to be valid as this works for me: $ git show 2e4e85b | head -3 /* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2013 Qualcomm Atheros, Inc. So does git-am fail when parsing the email or what? Next I tried to compare your and Bartosz' emails and I didn't find anything which would explain the problem. The only difference I was able to find was that Bartosz uses git 1.7.10 and you use 1.7.9.5, but that shouldn't make any difference as the patch looks ok otherwise. FWIW, I use git 1.7.9.5 from Ubuntu 12.04 64 bit. Quite a problem we have :/ Perhaps this has something to do with newline style? \n vs \r\n ? -- Pozdrawiam / Best regards, Michal Kazior. ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] ath10k.git updated to 3.9.0-rc8-wl-ath10k
Hi, I just merged latest wireless-testing to ath10k.git. The mac80211 channel API had changed and I had to change ath10k accordingly, please review my changes. diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index f64c2fc..9cb63cc 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -238,15 +238,15 @@ static int ath10k_vdev_start(struct ath10k_vif *arvif) { struct ath10k *ar = arvif-ar; struct ieee80211_conf *conf = ar-hw-conf; - struct ieee80211_channel *channel = conf-channel; + struct ieee80211_channel *channel = conf-chandef.chan; struct wmi_vdev_start_request_arg arg = { .vdev_id = arvif-vdev_id, .channel = { .freq = channel-center_freq, - .band_center_freq1 = band_center_freq(conf-channel, - conf-channel_type), - .mode = chan_to_phymode(conf-channel, - conf-channel_type), + .band_center_freq1 = band_center_freq(channel, + cfg80211_get_chandef_type(conf-chandef)), + .mode = chan_to_phymode(channel, + cfg80211_get_chandef_type(conf-chandef)), .min_power = channel-max_power * 3, .max_power = channel-max_power * 4, .max_reg_power = channel-max_reg_power * 4, @@ -316,18 +316,17 @@ unlock: static int ath10k_monitor_start(struct ath10k *ar, int vdev_id) { - struct ieee80211_channel *channel = ar-hw-conf.channel; - struct ieee80211_conf *conf = ar-hw-conf; + struct ieee80211_channel *channel = ar-hw-conf.chandef.chan; struct wmi_vdev_start_request_arg arg = { .vdev_id = vdev_id, .channel = { .freq = channel-center_freq, - .band_center_freq1 = band_center_freq(conf-channel, - conf-channel_type), + .band_center_freq1 = band_center_freq(channel, + cfg80211_get_chandef_type(ar-hw-conf.chandef)), /* TODO setup this dynamically, what in case we don't have any vifs? */ - .mode = chan_to_phymode(conf-channel, - conf-channel_type), + .mode = chan_to_phymode(channel, + cfg80211_get_chandef_type(ar-hw-conf.chandef)), .min_power = channel-max_power * 3, .max_power = channel-max_power * 4, .max_reg_power = channel-max_reg_power * 4, @@ -622,7 +621,7 @@ static void ath10k_peer_assoc_h_crypto(struct ath10k *ar, const u8 *rsnie = NULL; const u8 *wpaie = NULL; - bss = cfg80211_get_bss(ar-hw-wiphy, ar-hw-conf.channel, + bss = cfg80211_get_bss(ar-hw-wiphy, ar-hw-conf.chandef.chan, info-bssid, NULL, 0, 0, 0); if (bss) { const struct cfg80211_bss_ies *ies; @@ -662,8 +661,8 @@ static void ath10k_peer_assoc_h_rates(struct ath10k *ar, u32 ratemask; int i; - sband = ar-hw-wiphy-bands[ar-hw-conf.channel-band]; - ratemask = sta-supp_rates[ar-hw-conf.channel-band]; + sband = ar-hw-wiphy-bands[ar-hw-conf.chandef.chan-band]; + ratemask = sta-supp_rates[ar-hw-conf.chandef.chan-band]; rates = sband-bitrates; rateset-num_rates = 0; @@ -776,7 +775,7 @@ static void ath10k_peer_assoc_h_phymode(struct ath10k *ar, { enum wmi_phy_mode phymode = MODE_UNKNOWN; - switch (ar-hw-conf.channel-band) { + switch (ar-hw-conf.chandef.chan-band) { case IEEE80211_BAND_2GHZ: if (sta-ht_cap.ht_supported) { if (sta-bandwidth == IEEE80211_STA_RX_BW_40) @@ -1324,8 +1323,8 @@ static int ath10k_config(struct ieee80211_hw *hw, u32 changed) if (changed IEEE80211_CONF_CHANGE_CHANNEL) { ath10k_dbg(ATH10K_DBG_MAC, Config channel %d mhz\n, - conf-channel-center_freq); - rcu_assign_pointer(ar-rx_channel, conf-channel); + conf-chandef.chan-center_freq); + rcu_assign_pointer(ar-rx_channel, conf-chandef.chan); } if (changed IEEE80211_CONF_CHANGE_PS) { ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
Re: [ath9k-devel] [PATCH 2/2] ath10k: don't advertise we want monitor vif
Hi, Sujith Manoharan suj...@msujith.org writes: Michal Kazior wrote: Considering how stable monitor mode is perhaps we should start monitor vdev only when there's the monitor vif present? (right now we can start it without the vdev). If so then we drop this patch. And we probably also should forbid packet injection, at least until FW gets this sorted out. Well, the requirement is that we *need* a VDEV for monitor mode and this is precisely this flag is for. So I don't quite see how removing it fixes anything ? So what's the conclusion? What should we do with this patchset? -- Kalle Valo ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
Re: [ath9k-devel] ath10k.git updated to 3.9.0-rc8-wl-ath10k
On 26/04/13 09:34, Kalle Valo wrote: Hi, I just merged latest wireless-testing to ath10k.git. The mac80211 channel API had changed and I had to change ath10k accordingly, please review my changes. Looks good for me. -Bartosz ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 1/6] ath10k: fix code style and add comments to tx code
Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/htt_tx.c |4 drivers/net/wireless/ath/ath10k/txrx.c |4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c index 9f7ee9e..edbe4f4 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -271,6 +271,8 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) memcpy(cmd-mgmt_tx.hdr, msdu-data, min((int)msdu-len, HTT_MGMT_FRM_HDR_DOWNLOAD_LEN)); + /* refcount is decremented by HTC and HTT completions until it reaches +* zero and is freed */ skb_cb = ATH10K_SKB_CB(txdesc); skb_cb-htt.msdu_id = msdu_id; skb_cb-htt.refcount = 2; @@ -403,6 +405,8 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) memcpy(cmd-data_tx.prefetch, msdu-data, prefetch_len); + /* refcount is decremented by HTC and HTT completions until it reaches +* zero and is freed */ skb_cb = ATH10K_SKB_CB(txdesc); skb_cb-htt.msdu_id = msdu_id; skb_cb-htt.refcount = 2; diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c index ab5eb3b..dd51d38 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -55,7 +55,9 @@ void ath10k_txrx_tx_unref(struct ath10k_htt *htt, struct sk_buff *txdesc) if (ATH10K_SKB_CB(txdesc)-htt.refcount == 0) return; - if (--ATH10K_SKB_CB(txdesc)-htt.refcount 0) + ATH10K_SKB_CB(txdesc)-htt.refcount--; + + if (ATH10K_SKB_CB(txdesc)-htt.refcount 0) return; if (txfrag) { -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 2/6] ath10k: tweak ath10k_pci_diag_read_mem() prototype
It reads not well defined data thus void pointer seems a better match here. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/pci.c |9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index e7874b2..278db71 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -98,7 +98,7 @@ static const struct ce_pipe_config target_ce_config_wlan[] = { * Caller must guarantee proper alignment, when applicable, and single user * at any moment. */ -static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, u8 *data, +static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data, int nbytes) { struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); @@ -248,8 +248,7 @@ static int ath10k_pci_diag_read_access(struct ath10k *ar, u32 address, u32 *data { /* Assume range doesn't cross this boundary */ if (address = DRAM_BASE_ADDRESS) - return ath10k_pci_diag_read_mem(ar, address, (u8 *)data, - sizeof(u32)); + return ath10k_pci_diag_read_mem(ar, address, data, sizeof(u32)); else { ath10k_pci_wake(ar); *data = ath10k_pci_read32(ar, address); @@ -692,7 +691,7 @@ static void ath10k_pci_hif_dump_area(struct ath10k *ar) host_addr = host_interest_item_address(HI_ITEM(hi_failure_state)); if (ath10k_pci_diag_read_mem(ar, host_addr, -(u8 *) reg_dump_area, sizeof(u32)) != 0) { +reg_dump_area, sizeof(u32)) != 0) { ath10k_warn(could not read hi_failure_state\n); return; } @@ -700,7 +699,7 @@ static void ath10k_pci_hif_dump_area(struct ath10k *ar) ath10k_err(target register Dump Location: 0x%08X\n, reg_dump_area); if (ath10k_pci_diag_read_mem(ar, reg_dump_area, -(u8 *) reg_dump_values[0], +reg_dump_values[0], REG_DUMP_COUNT_QCA988X * sizeof(u32)) != 0) { ath10k_err(could not dump FW Dump Area\n); return; -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 4/6] ath10k: drop unnecessary else branch
Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/pci.c | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index ddef94e..c3c91a0 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -249,12 +249,11 @@ static int ath10k_pci_diag_read_access(struct ath10k *ar, u32 address, u32 *data /* Assume range doesn't cross this boundary */ if (address = DRAM_BASE_ADDRESS) return ath10k_pci_diag_read_mem(ar, address, data, sizeof(u32)); - else { - ath10k_pci_wake(ar); - *data = ath10k_pci_read32(ar, address); - ath10k_pci_sleep(ar); - return 0; - } + + ath10k_pci_wake(ar); + *data = ath10k_pci_read32(ar, address); + ath10k_pci_sleep(ar); + return 0; } static int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address, @@ -393,17 +392,14 @@ static int ath10k_pci_diag_write_access(struct ath10k *ar, u32 address, u32 data) { /* Assume range doesn't cross this boundary */ - if (address = DRAM_BASE_ADDRESS) { - u32 data_buf = data; - return ath10k_pci_diag_write_mem(ar, address, data_buf, + if (address = DRAM_BASE_ADDRESS) + return ath10k_pci_diag_write_mem(ar, address, data, sizeof(u32)); - } else { - ath10k_pci_wake(ar); - ath10k_pci_write32(ar, address, data); - ath10k_pci_sleep(ar); - return 0; - } + ath10k_pci_wake(ar); + ath10k_pci_write32(ar, address, data); + ath10k_pci_sleep(ar); + return 0; } static bool ath10k_pci_target_is_awake(struct ath10k *ar) -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 3/6] ath10k: tweak ath10k_pci_diag_write_mem() prototype
It doesn't modify the data argument thus const. It also is more suitable to use void pointer here since the payload type is not well defined. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/pci.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 278db71..ddef94e 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -257,8 +257,8 @@ static int ath10k_pci_diag_read_access(struct ath10k *ar, u32 address, u32 *data } } -static int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address, u8 *data, -int nbytes) +static int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address, +const void *data, int nbytes) { struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); int ret = 0; @@ -395,8 +395,8 @@ static int ath10k_pci_diag_write_access(struct ath10k *ar, u32 address, /* Assume range doesn't cross this boundary */ if (address = DRAM_BASE_ADDRESS) { u32 data_buf = data; - return ath10k_pci_diag_write_mem(ar, address, (u8 *) data_buf, - sizeof(u32)); + return ath10k_pci_diag_write_mem(ar, address, data_buf, +sizeof(u32)); } else { ath10k_pci_wake(ar); ath10k_pci_write32(ar, address, data); @@ -1503,7 +1503,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) } ret = ath10k_pci_diag_write_mem(ar, pipe_cfg_targ_addr, -(u8 *) target_ce_config_wlan, +target_ce_config_wlan, sizeof(target_ce_config_wlan)); if (ret != 0) { @@ -1526,7 +1526,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) } ret = ath10k_pci_diag_write_mem(ar, svc_to_pipe_map, -(u8 *) target_service_to_ce_map_wlan, +target_service_to_ce_map_wlan, sizeof(target_service_to_ce_map_wlan)); if (ret != 0) { ath10k_err(Failed to write svc/pipe map: %d\n, ret); @@ -1545,7 +1545,7 @@ static int ath10k_pci_init_config(struct ath10k *ar) ret = ath10k_pci_diag_write_mem(ar, pcie_state_targ_addr + offsetof(struct pcie_state, config_flags), -(u8 *) pcie_config_flags, +pcie_config_flags, sizeof(pcie_config_flags)); if (ret != 0) { ath10k_err(Failed to write pcie config_flags: %d\n, ret); -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 6/6] ath10k: cleanup ath10k_pci_stop_intr()
Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/pci.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index d521270..31881f9 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -1937,18 +1937,16 @@ exit: static void ath10k_pci_stop_intr(struct ath10k *ar) { - int i; struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); + int i; - if (ar_pci-num_msi_intrs 0) { - /* MSI interrupt(s) */ - for (i = 0; i ar_pci-num_msi_intrs; i++) - free_irq(ar_pci-pdev-irq + i, ar); - ar_pci-num_msi_intrs = 0; + /* There's at least one interrupt irregardless whether its legacy INTR +* or MSI or MSI-X */ + for (i = 0; i min(1, ar_pci-num_msi_intrs); i++) + free_irq(ar_pci-pdev-irq + i, ar); + + if (ar_pci-num_msi_intrs 0) pci_disable_msi(ar_pci-pdev); - } else - /* Legacy PCI line interrupt */ - free_irq(ar_pci-pdev-irq, ar); } static int ath10k_pci_reset_target(struct ath10k *ar) -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 5/6] ath10k: drop unnecessary else branch
ath10k_pci_{sleep,wake} do refcounting and the awake sections can be nested. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/pci.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index c3c91a0..d521270 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -1650,7 +1650,6 @@ static void ath10k_pci_fw_interrupt_handler(struct ath10k *ar) if (fw_indicator FW_IND_EVENT_PENDING) { /* ACK: clear Target-side pending event */ ath10k_pci_write32(ar, fw_indicator_address, fw_indicator ~FW_IND_EVENT_PENDING); - ath10k_pci_sleep(ar); if (ar_pci-started) ath10k_pci_hif_dump_area(ar); @@ -1661,9 +1660,9 @@ static void ath10k_pci_fw_interrupt_handler(struct ath10k *ar) */ ath10k_warn(early firmware event indicated\n); } - } else { - ath10k_pci_sleep(ar); } + + ath10k_pci_sleep(ar); } static const struct ath10k_hif_ops ath10k_pci_hif_ops = { -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 0/6] ath10k: coding style cleanup
Michal Kazior (6): ath10k: fix code style and add comments to tx code ath10k: tweak ath10k_pci_diag_read_mem() prototype ath10k: tweak ath10k_pci_diag_write_mem() prototype ath10k: drop unnecessary else branch ath10k: drop unnecessary else branch ath10k: cleanup ath10k_pci_stop_intr() drivers/net/wireless/ath/ath10k/htt_tx.c |4 ++ drivers/net/wireless/ath/ath10k/pci.c| 68 +- drivers/net/wireless/ath/ath10k/txrx.c |4 +- 3 files changed, 37 insertions(+), 39 deletions(-) -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 0/2] ath10k: fw download refactor
This kills off ath10k_file enum and splits FW loading more sanely hopefully. Michal Kazior (2): ath10k: split UART prints setup ath10k: cleanup firmware downloading routines drivers/net/wireless/ath/ath10k/core.c | 393 ++-- 1 file changed, 220 insertions(+), 173 deletions(-) -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 2/2] ath10k: cleanup firmware downloading routines
Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/core.c | 358 +--- 1 file changed, 190 insertions(+), 168 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index bf6db39..6b83d29 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -37,12 +37,6 @@ MODULE_PARM_DESC(debug_mask, Debugging mask); MODULE_PARM_DESC(uart_print, Uart target debugging); MODULE_PARM_DESC(ath10k_p2p, Enable ath10k P2P support); -enum ath10k_file { - ATH10K_FILE_OTP, - ATH10K_FILE_FIRMWARE, - ATH10K_FILE_BOARD_DATA, -}; - static const struct ath10k_hw_params ath10k_hw_params_list[] = { { .id = QCA988X_HW_1_0_VERSION, @@ -183,188 +177,213 @@ static int ath10k_init_configure_target(struct ath10k *ar) return 0; } -static int ath10k_init_transfer_bin_file(struct ath10k *ar, -enum ath10k_file file, -u32 address, bool compressed) +static const struct firmware *ath10k_fetch_fw_file(struct ath10k *ar, + const char *dir, + const char *file) { - int status = 0; char filename[100]; - const struct firmware *fw_entry; - u32 fw_entry_size; - u8 *temp_eeprom = NULL, *fw_buf = NULL; - - switch (file) { - default: - ath10k_err(%s: unknown file type\n, __func__); - return -1; - - case ATH10K_FILE_OTP: - if (!ar-hw_params.fw.otp) { - ath10k_err(%s: OTP file not defined\n, __func__); - return -ENOENT; - } - snprintf(filename, sizeof(filename), %s/%s, -ar-hw_params.fw.dir, ar-hw_params.fw.otp); - break; - - case ATH10K_FILE_FIRMWARE: - if (!ar-hw_params.fw.fw) { - ath10k_err(%s: FW file not defined\n, __func__); - return -ENOENT; - } - snprintf(filename, sizeof(filename), %s/%s, -ar-hw_params.fw.dir, ar-hw_params.fw.fw); - break; - - case ATH10K_FILE_BOARD_DATA: - if (!ar-hw_params.fw.board) { - ath10k_err(%s: board file not defined\n, __func__); - return -ENOENT; - } - snprintf(filename, sizeof(filename), %s/%s, -ar-hw_params.fw.dir, ar-hw_params.fw.board); - break; - - } - - if (request_firmware(fw_entry, filename, ar-dev) != 0) { - if (file == ATH10K_FILE_OTP) - return -ENOENT; - - ath10k_err(%s: failed to get %s\n, __func__, filename); - return -1; - } - - fw_entry_size = fw_entry-size; - fw_buf = (u8 *)fw_entry-data; - - if (file == ATH10K_FILE_BOARD_DATA fw_entry-data) { - u32 board_ext_address; - - temp_eeprom = kmalloc(fw_entry_size, GFP_ATOMIC); - if (!temp_eeprom) { - ath10k_err(%s: memory allocation failed\n, __func__); - status = -ENOMEM; - goto exit_fw; - } - - memcpy(temp_eeprom, fw_buf, fw_entry_size); - - /* Determine where in Target RAM to write Board Data */ - ath10k_bmi_read32(ar, hi_board_ext_data, board_ext_address); - - ath10k_dbg(ATH10K_DBG_CORE, - ath10k: Board extended Data download addr: 0x%x\n, - board_ext_address); - - /* -* Check whether the target has allocated memory for extended -* board data and file contains extended board data -*/ - if (board_ext_address (fw_entry_size == (QCA988X_BOARD_DATA_SZ + QCA988X_BOARD_EXT_DATA_SZ))) { - status = ath10k_bmi_write_memory(ar, board_ext_address, -(u8 *)(((unsigned long)temp_eeprom) + QCA988X_BOARD_DATA_SZ), - QCA988X_BOARD_EXT_DATA_SZ); - - if (status != 0) { - ath10k_err(ath10k: BMI operation failed\n); - goto exit_buf; - } - - /* -* Record the fact that extended board Data IS -* initialized -*/ - ath10k_bmi_write32(ar, hi_board_ext_data_config, - (QCA988X_BOARD_EXT_DATA_SZ 16) | 1); - - fw_entry_size =
[ath9k-devel] [PATCH] ath10k: fix (void *) casts in wmi submodule
Signed-off-by: Bartosz Markowski bartosz.markow...@tieto.com --- drivers/net/wireless/ath/ath10k/wmi.c | 42 - 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 8d542e5..5272f18 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -313,7 +313,7 @@ static inline u8 get_rate_idx(u32 rate, enum ieee80211_band band) static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb) { - struct wmi_mgmt_rx_event *event = (void *)skb-data; + struct wmi_mgmt_rx_event *event = (struct wmi_mgmt_rx_event *)skb-data; struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); struct ieee80211_hdr *hdr; u32 rx_status; @@ -396,7 +396,7 @@ static void ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb) static void ath10k_wmi_event_update_stats(struct ath10k *ar, struct sk_buff *skb) { - struct wmi_stats_event *ev = (void *)skb-data; + struct wmi_stats_event *ev = (struct wmi_stats_event *)skb-data; ath10k_dbg(ATH10K_DBG_WMI, WMI_UPDATE_STATS_EVENTID\n); @@ -405,7 +405,7 @@ static void ath10k_wmi_event_update_stats(struct ath10k *ar, struct sk_buff *skb static void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar, struct sk_buff *skb) { - struct wmi_vdev_start_response_event *ev = (void *)skb-data; + struct wmi_vdev_start_response_event *ev = (struct wmi_vdev_start_response_event *)skb-data; ath10k_dbg(ATH10K_DBG_WMI, WMI_VDEV_START_RESP_EVENTID\n); @@ -463,7 +463,7 @@ static void ath10k_wmi_event_peer_sta_kickout(struct ath10k *ar, struct sk_buff static void ath10k_wmi_update_tim(struct ath10k *ar, struct ath10k_vif *arvif, struct sk_buff *bcn, struct wmi_bcn_info *bcn_info) { - struct ieee80211_hdr *hdr = (void *)bcn-data; + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)bcn-data; struct ieee80211_tim_ie *tim; u8 *ies, *ie; u8 ie_len, pvm_len; @@ -646,7 +646,7 @@ cleanup: static void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb) { - struct wmi_host_swba_event *ev = (void *)skb-data; + struct wmi_host_swba_event *ev = (struct wmi_host_swba_event *)skb-data; u32 map = __le32_to_cpu(ev-vdev_map); int i = -1; struct wmi_bcn_info *bcn_info; @@ -883,7 +883,7 @@ static void ath10k_wmi_service_ready_event_rx(struct ath10k *ar, struct sk_buff static int ath10k_wmi_ready_event_rx(struct ath10k *ar, struct sk_buff *skb) { - struct wmi_ready_event *ev = (void *)skb-data; + struct wmi_ready_event *ev = (struct wmi_ready_event *)skb-data; if (WARN_ON(skb-len sizeof(*ev))) return -EINVAL; @@ -1138,7 +1138,7 @@ int ath10k_wmi_pdev_set_regdomain(struct ath10k *ar) if (!skb) return -ENOMEM; - cmd = (void *)skb-data; + cmd = (struct wmi_pdev_set_regdomain_cmd *)skb-data; /* FIXME: do not use hardcoded values */ /* TODO: provide correct values for reg domain */ @@ -1163,7 +1163,7 @@ int ath10k_wmi_pdev_set_channel(struct ath10k *ar, const struct wmi_channel_arg if (!skb) return -ENOMEM; - cmd = (void *)skb-data; + cmd = (struct wmi_set_channel_cmd *)skb-data; cmd-chan.mhz = __cpu_to_le32(arg-freq); cmd-chan.band_center_freq1 = __cpu_to_le32(arg-freq); cmd-chan.mode = arg-mode; @@ -1189,7 +1189,7 @@ int ath10k_wmi_pdev_suspend_target(struct ath10k *ar) if (!skb) return -ENOMEM; - cmd = (void *)skb-data; + 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); @@ -1218,7 +1218,7 @@ int ath10k_wmi_pdev_set_param(struct ath10k *ar, enum wmi_pdev_param id, if (!skb) return -ENOMEM; - cmd = (void *)skb-data; + cmd = (struct wmi_pdev_set_param_cmd *)skb-data; cmd-param_id= __cpu_to_le32(id); cmd-param_value = __cpu_to_le32(value); @@ -1354,7 +1354,7 @@ int ath10k_wmi_start_scan(struct ath10k *ar, scan_req_id = WMI_HOST_SCAN_REQUESTOR_ID_PREFIX; scan_req_id |= arg-scan_req_id; - cmd = (void *)skb-data; + cmd = (struct wmi_start_scan_cmd *)skb-data; cmd-scan_id= __cpu_to_le32(scan_id); cmd-scan_req_id= __cpu_to_le32(scan_req_id); cmd-vdev_id= __cpu_to_le32(arg-vdev_id); @@ -1503,7 +1503,7 @@ int ath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id, if (!skb) return -ENOMEM; - cmd = (void *)skb-data; + cmd = (struct wmi_vdev_create_cmd *)skb-data; cmd-vdev_id =
[ath9k-devel] [PATCH 0/7] ath10k: htt rx fixes
This patchset addresses issues with fragmented (802.11b) frames. Michal Kazior (7): ath10k: zero htt_rx_info struct in frag rx handler ath10k: do not pop more than one frame in frag rx handler ath10k: add safety check after popping a frame in frag rx ath10k: move ath10k_htt_rx_free_msdu_chain() ath10k: drop all msdus in case of htt rx failure ath10k: fix tkip fragment rx ath10k: strip protected flag drivers/net/wireless/ath/ath10k/htt_rx.c | 54 ++ drivers/net/wireless/ath/ath10k/txrx.c |7 +++- 2 files changed, 38 insertions(+), 23 deletions(-) -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 1/7] ath10k: zero htt_rx_info struct in frag rx handler
The struct was filled with garbage and ended up having fcs_err set to true. This caused mac to drop fragmented frames. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/htt_rx.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 055b88d..55c8083 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -877,7 +877,7 @@ static void ath10k_htt_rx_frag_handler(struct ath10k_htt *htt, struct sk_buff *msdu_head, *msdu_tail; struct htt_rx_desc *rxd; enum rx_msdu_decap_format fmt; - struct htt_rx_info info; + struct htt_rx_info info = {}; int msdu_chaining; bool tkip_mic_err; bool decrypt_err; -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 2/7] ath10k: do not pop more than one frame in frag rx handler
This led us to popping frames too early, before FW actually filled in frames. This was not an issue earlier. Perhaps the MSDU FW descriptor is now different. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/htt_rx.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 55c8083..6d619e1 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -888,7 +888,6 @@ static void ath10k_htt_rx_frag_handler(struct ath10k_htt *htt, fw_desc_len = __le16_to_cpu(frag-fw_rx_desc_bytes); fw_desc = (u8 *)frag-fw_msdu_rx_desc; -more: msdu_head = NULL; msdu_tail = NULL; msdu_chaining = ath10k_htt_rx_amsdu_pop(htt, fw_desc, fw_desc_len, @@ -966,8 +965,7 @@ more: end: if (fw_desc_len 0) { ath10k_dbg(ATH10K_DBG_HTT, - expecting more fragmented rx in one indication\n); - goto more; + expecting more fragmented rx in one indication %d\n, fw_desc_len); } } -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 3/7] ath10k: add safety check after popping a frame in frag rx
If HTT RX went haywire we dereferenced buggy pointers that led to system crash. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/htt_rx.c |5 + 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 6d619e1..fe2d27b 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -895,6 +895,11 @@ static void ath10k_htt_rx_frag_handler(struct ath10k_htt *htt, ath10k_dbg(ATH10K_DBG_HTT_DUMP, htt rx frag ahead\n); + if (!msdu_head) { + ath10k_warn(htt rx frag no data\n); + return; + } + if (msdu_chaining || msdu_head != msdu_tail) { ath10k_warn(aggregation with fragmentation?!\n); ath10k_htt_rx_free_msdu_chain(msdu_head); -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 5/7] ath10k: drop all msdus in case of htt rx failure
It's a lot safer to simply drop everything. It's broken anyway so why bother. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/htt_rx.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 5afe42a..37784f6 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -292,9 +292,9 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt, */ if (!(__le32_to_cpu(rx_desc-attention.flags) RX_ATTENTION_FLAGS_MSDU_DONE)) { - if (*head_msdu == msdu) - *head_msdu = NULL; - dev_kfree_skb_any(msdu); + ath10k_htt_rx_free_msdu_chain(*head_msdu); + *head_msdu = NULL; + msdu = NULL; ath10k_err(htt rx stopped. cannot recover\n); htt-rx_confused = true; break; -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 4/7] ath10k: move ath10k_htt_rx_free_msdu_chain()
This makes it possible to call the function more different places now. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/htt_rx.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index fe2d27b..5afe42a 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -235,6 +235,17 @@ static inline struct sk_buff *ath10k_htt_rx_netbuf_pop(struct ath10k_htt *htt) return msdu; } +static void ath10k_htt_rx_free_msdu_chain(struct sk_buff *skb) +{ + struct sk_buff *next; + + while (skb) { + next = skb-next; + dev_kfree_skb_any(skb); + skb = next; + } +} + static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt, u8 **fw_desc, int *fw_desc_len, struct sk_buff **head_msdu, @@ -545,17 +556,6 @@ static bool ath10k_htt_rx_hdr_is_amsdu(struct ieee80211_hdr *hdr) return false; } -static void ath10k_htt_rx_free_msdu_chain(struct sk_buff *skb) -{ - struct sk_buff *next; - - while (skb) { - next = skb-next; - dev_kfree_skb_any(skb); - skb = next; - } -} - static int ath10k_htt_rx_amsdu(struct ath10k_htt *htt, struct htt_rx_info *info) { -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 6/7] ath10k: fix tkip fragment rx
TKIP fragmented frames contains different data at the tail depending on the more flags. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/htt_rx.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 37784f6..0b20879 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -518,9 +518,8 @@ static int ath10k_htt_rx_crypto_tail_len(enum htt_rx_mpdu_encrypt_type type) case HTT_RX_MPDU_ENCRYPT_WAPI: return 0; case HTT_RX_MPDU_ENCRYPT_TKIP_WITHOUT_MIC: - return 4; case HTT_RX_MPDU_ENCRYPT_TKIP_WPA: - return 4 + 8; + return 4; case HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2: return 8; } @@ -878,6 +877,7 @@ static void ath10k_htt_rx_frag_handler(struct ath10k_htt *htt, struct htt_rx_desc *rxd; enum rx_msdu_decap_format fmt; struct htt_rx_info info = {}; + struct ieee80211_hdr *hdr; int msdu_chaining; bool tkip_mic_err; bool decrypt_err; @@ -908,6 +908,7 @@ static void ath10k_htt_rx_frag_handler(struct ath10k_htt *htt, /* FIXME: implement signal strength */ + hdr = (struct ieee80211_hdr *)msdu_head-data; rxd = (void *)msdu_head-data - sizeof(*rxd); tkip_mic_err = !!(__le32_to_cpu(rxd-attention.flags) RX_ATTENTION_FLAGS_TKIP_MIC_ERR); @@ -939,7 +940,6 @@ static void ath10k_htt_rx_frag_handler(struct ath10k_htt *htt, } if (info.encrypt_type != HTT_RX_MPDU_ENCRYPT_NONE) { - struct ieee80211_hdr *hdr = (void *)info.skb-data; int hdrlen = ieee80211_hdrlen(hdr-frame_control); int paramlen = ath10k_htt_rx_crypto_param_len(info.encrypt_type); @@ -948,13 +948,20 @@ static void ath10k_htt_rx_frag_handler(struct ath10k_htt *htt, (void *)info.skb-data, hdrlen); skb_pull(info.skb, paramlen); + hdr = (struct ieee80211_hdr *)info.skb-data; } /* remove trailing FCS */ trim = 4; - /* remove crypto trailer; we use rx desc for mic failure */ + + /* remove crypto trailer */ trim += ath10k_htt_rx_crypto_tail_len(info.encrypt_type); + /* last fragment of TKIP frags has MIC */ + if (!ieee80211_has_morefrags(hdr-frame_control) + info.encrypt_type == HTT_RX_MPDU_ENCRYPT_TKIP_WPA) + trim += 8; + if (trim info.skb-len) { ath10k_warn(htt rx fragment: trailer longer than the frame itself? drop\n); dev_kfree_skb_any(info.skb); -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 7/7] ath10k: strip protected flag
We already do decryption and all crypto verification in HW. mac80211 tries to verify CCMP for fragmented rx and fails without this patch. This fixes fragmented rx on CCMP networks. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/txrx.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c index ab5eb3b..a54ad8f 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -238,13 +238,18 @@ void ath10k_process_rx(struct ath10k *ar, struct htt_rx_info *info) { struct ieee80211_rx_status *status; struct ieee80211_channel *ch; + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)info-skb-data; status = IEEE80211_SKB_RXCB(info-skb); memset(status, 0, sizeof(*status)); - if (info-encrypt_type != HTT_RX_MPDU_ENCRYPT_NONE) + if (info-encrypt_type != HTT_RX_MPDU_ENCRYPT_NONE) { status-flag |= RX_FLAG_DECRYPTED | RX_FLAG_IV_STRIPPED | RX_FLAG_MMIC_STRIPPED; + hdr-frame_control = __cpu_to_le16( + __le16_to_cpu(hdr-frame_control) + ~IEEE80211_FCTL_PROTECTED); + } if (info-status == HTT_RX_IND_MPDU_STATUS_TKIP_MIC_ERR) status-flag |= RX_FLAG_MMIC_ERROR; -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 0/5] ath10k: fix checkpatch warnings 20130426
Trying to get the number of checkpatch warnings smaller. --- Kalle Valo (5): ath10k: fix checkpatch warnings in mac.c ath10k: fix some checkpatch warnings in wmi.c ath10k: fix some checkpatch warnings in pci.c ath10k: fix some checkpatch errors in ce.c ath10k: fix some checkpatch errors in wmi.h drivers/net/wireless/ath/ath10k/ce.c | 80 +++-- drivers/net/wireless/ath/ath10k/mac.c | 103 +- drivers/net/wireless/ath/ath10k/pci.c | 89 --- drivers/net/wireless/ath/ath10k/wmi.c | 100 ++--- drivers/net/wireless/ath/ath10k/wmi.h | 155 - 5 files changed, 347 insertions(+), 180 deletions(-) ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 1/5] ath10k: fix checkpatch warnings in mac.c
Signed-off-by: Kalle Valo kv...@qca.qualcomm.com --- drivers/net/wireless/ath/ath10k/mac.c | 103 +++-- 1 file changed, 60 insertions(+), 43 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 5b433ee..4eab40f 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -155,12 +155,14 @@ static int ath10k_clear_peer_keys(struct ath10k_vif *arvif, if (peer-keys[i] == NULL) continue; - ret = ath10k_install_key(arvif, peer-keys[i], DISABLE_KEY, addr); + ret = ath10k_install_key(arvif, peer-keys[i], +DISABLE_KEY, addr); if (ret first_errno == 0) first_errno = ret; if (ret) - ath10k_warn(could not remove peer wep key %d (%d)\n, i, ret); + ath10k_warn(could not remove peer wep key %d (%d)\n, + i, ret); peer-keys[i] = NULL; } @@ -618,9 +620,8 @@ static void ath10k_control_ibss(struct ath10k_vif *arvif, if (!info-ibss_joined) { ret = ath10k_peer_delete(arvif-ar, arvif-vdev_id, self_peer); if (ret) - ath10k_warn(Failed to delete IBSS self peer:%pM - for VDEV:%d ret:%d\n, self_peer, - arvif-vdev_id, ret); + ath10k_warn(Failed to delete IBSS self peer:%pM for VDEV:%d ret:%d\n, + self_peer, arvif-vdev_id, ret); if (is_zero_ether_addr(arvif-u.ibss.bssid)) return; @@ -628,9 +629,8 @@ static void ath10k_control_ibss(struct ath10k_vif *arvif, ret = ath10k_peer_delete(arvif-ar, arvif-vdev_id, arvif-u.ibss.bssid); if (ret) { - ath10k_warn(Failed to delete IBSS BSSID peer:%pM - for VDEV:%d ret:%d\n, arvif-u.ibss.bssid, -arvif-vdev_id, ret); + ath10k_warn(Failed to delete IBSS BSSID peer:%pM for VDEV:%d ret:%d\n, + arvif-u.ibss.bssid, arvif-vdev_id, ret); return; } @@ -641,8 +641,8 @@ static void ath10k_control_ibss(struct ath10k_vif *arvif, ret = ath10k_peer_create(arvif-ar, arvif-vdev_id, self_peer); if (ret) { - ath10k_warn(Failed to create IBSS self peer:%pM for VDEV:%d - ret:%d\n, self_peer, arvif-vdev_id, ret); + ath10k_warn(Failed to create IBSS self peer:%pM for VDEV:%d ret:%d\n, + self_peer, arvif-vdev_id, ret); return; } @@ -657,7 +657,8 @@ static void ath10k_control_ibss(struct ath10k_vif *arvif, /* * Review this when mac80211 gains per-interface powersave support. */ -static void ath10k_config_ps_iter(void *data, u8 *mac, struct ieee80211_vif *vif) +static void ath10k_config_ps_iter(void *data, u8 *mac, + struct ieee80211_vif *vif) { struct ath10k_generic_iter *ar_iter = data; struct ieee80211_conf *conf = ar_iter-ar-hw-conf; @@ -972,7 +973,8 @@ static void ath10k_bss_assoc(struct ieee80211_hw *hw, rcu_read_unlock(); - ret = ath10k_wmi_vdev_up(ar, arvif-vdev_id, bss_conf-aid, bss_conf-bssid); + ret = ath10k_wmi_vdev_up(ar, arvif-vdev_id, bss_conf-aid, +bss_conf-bssid); if (ret) ath10k_warn(VDEV: %d up failed: ret %d\n, arvif-vdev_id, ret); @@ -1075,7 +1077,8 @@ static void ath10k_update_channel_list(struct ath10k *ar) continue; for (i = 0; i bands[band]-n_channels; i++) { - if (bands[band]-channels[i].flags IEEE80211_CHAN_DISABLED) + if (bands[band]-channels[i].flags + IEEE80211_CHAN_DISABLED) continue; arg.n_channels++; @@ -1102,23 +1105,22 @@ static void ath10k_update_channel_list(struct ath10k *ar) ch-allow_ht = true; ch-allow_ibss = !(channel-flags IEEE80211_CHAN_NO_IBSS); - ch-ht40plus = !(channel-flags IEEE80211_CHAN_NO_HT40PLUS); - ch-passive= !!(channel-flags IEEE80211_CHAN_PASSIVE_SCAN); + ch-ht40plus = !(channel-flags IEEE80211_CHAN_NO_HT40PLUS); + ch-passive = !!(channel-flags IEEE80211_CHAN_PASSIVE_SCAN); - ch-freq = channel-center_freq; - ch-min_power
[ath9k-devel] [PATCH 2/5] ath10k: fix some checkpatch warnings in wmi.c
Signed-off-by: Kalle Valo kv...@qca.qualcomm.com --- drivers/net/wireless/ath/ath10k/wmi.c | 100 ++--- 1 file changed, 66 insertions(+), 34 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 8d542e5..b8ed038 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -367,7 +367,8 @@ static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb) ath10k_dbg(ATH10K_DBG_WMI, event mgmt rx freq %d band %d snr %d, rate_idx %d\n, - status-freq, status-band, status-signal, status-rate_idx); + status-freq, status-band, status-signal, + status-rate_idx); /* * packets from HTC come aligned to 4byte boundaries @@ -394,7 +395,8 @@ static void ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb) ath10k_dbg(ATH10K_DBG_WMI, WMI_DEBUG_MESG_EVENTID\n); } -static void ath10k_wmi_event_update_stats(struct ath10k *ar, struct sk_buff *skb) +static void ath10k_wmi_event_update_stats(struct ath10k *ar, + struct sk_buff *skb) { struct wmi_stats_event *ev = (void *)skb-data; @@ -403,7 +405,8 @@ static void ath10k_wmi_event_update_stats(struct ath10k *ar, struct sk_buff *skb ath10k_debug_read_target_stats(ar, ev); } -static void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar, struct sk_buff *skb) +static void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar, +struct sk_buff *skb) { struct wmi_vdev_start_response_event *ev = (void *)skb-data; @@ -415,23 +418,27 @@ static void ath10k_wmi_event_vdev_start_resp(struct ath10k *ar, struct sk_buff * complete(ar-vdev_setup_done); } -static void ath10k_wmi_event_vdev_standby_req(struct ath10k *ar, struct sk_buff *skb) +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) +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_event_vdev_stopped(struct ath10k *ar, struct sk_buff *skb) +static void ath10k_wmi_event_vdev_stopped(struct ath10k *ar, + struct sk_buff *skb) { ath10k_dbg(ATH10K_DBG_WMI, WMI_VDEV_STOPPED_EVENTID\n); complete(ar-vdev_setup_done); } -static void ath10k_wmi_event_peer_sta_kickout(struct ath10k *ar, struct sk_buff *skb) +static void ath10k_wmi_event_peer_sta_kickout(struct ath10k *ar, + struct sk_buff *skb) { ath10k_dbg(ATH10K_DBG_WMI, WMI_PEER_STA_KICKOUT_EVENTID\n); } @@ -460,8 +467,10 @@ static void ath10k_wmi_event_peer_sta_kickout(struct ath10k *ar, struct sk_buff * is unicast buffered for stations with aid 7 and fill it * in ourselves. */ -static void ath10k_wmi_update_tim(struct ath10k *ar, struct ath10k_vif *arvif, - struct sk_buff *bcn, struct wmi_bcn_info *bcn_info) +static void ath10k_wmi_update_tim(struct ath10k *ar, + struct ath10k_vif *arvif, + struct sk_buff *bcn, + struct wmi_bcn_info *bcn_info) { struct ieee80211_hdr *hdr = (void *)bcn-data; struct ieee80211_tim_ie *tim; @@ -723,7 +732,8 @@ static void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb) } } -static void ath10k_wmi_event_tbttoffset_update(struct ath10k *ar, struct sk_buff *skb) +static void ath10k_wmi_event_tbttoffset_update(struct ath10k *ar, + struct sk_buff *skb) { ath10k_dbg(ATH10K_DBG_WMI, WMI_TBTTOFFSET_UPDATE_EVENTID\n); } @@ -755,7 +765,8 @@ static void ath10k_wmi_event_pdev_qvit(struct ath10k *ar, struct sk_buff *skb) ath10k_dbg(ATH10K_DBG_WMI, WMI_PDEV_QVIT_EVENTID\n); } -static void ath10k_wmi_event_wlan_profile_data(struct ath10k *ar, struct sk_buff *skb) +static void ath10k_wmi_event_wlan_profile_data(struct ath10k *ar, + struct sk_buff *skb) { ath10k_dbg(ATH10K_DBG_WMI, WMI_WLAN_PROFILE_DATA_EVENTID\n); } @@ -772,27 +783,32 @@ static void ath10k_wmi_event_tsf_measurement_report(struct ath10k *ar, ath10k_dbg(ATH10K_DBG_WMI, WMI_TSF_MEASUREMENT_REPORT_EVENTID\n); } -static void ath10k_wmi_event_rtt_error_report(struct ath10k *ar, struct sk_buff *skb) +static void ath10k_wmi_event_rtt_error_report(struct ath10k *ar, +
[ath9k-devel] [PATCH 3/5] ath10k: fix some checkpatch warnings in pci.c
Signed-off-by: Kalle Valo kv...@qca.qualcomm.com --- drivers/net/wireless/ath/ath10k/pci.c | 89 ++--- 1 file changed, 58 insertions(+), 31 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index e7874b2..72051fd 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -45,7 +45,8 @@ static DEFINE_PCI_DEVICE_TABLE(ath10k_pci_id_table) = { {0} }; -static int ath10k_pci_diag_read_access(struct ath10k *ar, u32 address, u32 *data); +static int ath10k_pci_diag_read_access(struct ath10k *ar, u32 address, + u32 *data); static void ath10k_pci_process_ce(struct ath10k *ar); static int ath10k_pci_post_recv_buffers(struct ath10k *ar); @@ -231,20 +232,24 @@ done: if (ret == 0) { /* Copy data from allocated DMA buf to caller's buf */ WARN_ON_ONCE(orig_nbytes 3); - for (i = 0; i orig_nbytes / sizeof(__le32); i++) - ((u32 *)data)[i] = __le32_to_cpu(((__le32 *)data_buf)[i]); + for (i = 0; i orig_nbytes / sizeof(__le32); i++) { + ((u32 *)data)[i] = + __le32_to_cpu(((__le32 *)data_buf)[i]); + } } else - ath10k_dbg(ATH10K_DBG_PCI, %s failure (0x%x)\n, __func__, address); + ath10k_dbg(ATH10K_DBG_PCI, %s failure (0x%x)\n, + __func__, address); if (data_buf) pci_free_consistent(ar_pci-pdev, orig_nbytes, -data_buf, ce_data_base); + data_buf, ce_data_base); return ret; } /* Read 4-byte aligned data from Target memory or register */ -static int ath10k_pci_diag_read_access(struct ath10k *ar, u32 address, u32 *data) +static int ath10k_pci_diag_read_access(struct ath10k *ar, u32 address, + u32 *data) { /* Assume range doesn't cross this boundary */ if (address = DRAM_BASE_ADDRESS) @@ -324,13 +329,15 @@ static int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address, u8 *data, * Request CE to send caller-supplied data that * was copied to bounce buffer to Target(!) address. */ - ret = ath10k_ce_send(ce_diag, NULL, (u32) ce_data, nbytes, 0, 0); + ret = ath10k_ce_send(ce_diag, NULL, (u32) ce_data, +nbytes, 0, 0); if (ret != 0) goto done; i = 0; while (ath10k_ce_completed_send_next(ce_diag, NULL, buf, -completed_nbytes, id) != 0) { +completed_nbytes, +id) != 0) { mdelay(1); if (i++ DIAG_ACCESS_CE_TIMEOUT_MS) { @@ -437,7 +444,8 @@ void ath10k_do_pci_wake(struct ath10k *ar) if (atomic_read(ar_pci-keep_awake_count) == 0) { /* Force AWAKE */ iowrite32(PCIE_SOC_WAKE_V_MASK, - pci_addr + PCIE_LOCAL_BASE_ADDRESS + PCIE_SOC_WAKE_ADDRESS); + pci_addr + PCIE_LOCAL_BASE_ADDRESS + + PCIE_SOC_WAKE_ADDRESS); } atomic_inc(ar_pci-keep_awake_count); @@ -451,7 +459,8 @@ void ath10k_do_pci_wake(struct ath10k *ar) } if (tot_delay PCIE_WAKE_TIMEOUT) - ath10k_warn(keep_awake_count %d\n, atomic_read(ar_pci-keep_awake_count)); + ath10k_warn(keep_awake_count %d\n, + atomic_read(ar_pci-keep_awake_count)); udelay(curr_delay); tot_delay += curr_delay; @@ -470,7 +479,8 @@ void ath10k_do_pci_sleep(struct ath10k *ar) /* Allow sleep */ ar_pci-verified_awake = false; iowrite32(PCIE_SOC_WAKE_RESET, - pci_addr + PCIE_LOCAL_BASE_ADDRESS + PCIE_SOC_WAKE_ADDRESS); + pci_addr + PCIE_LOCAL_BASE_ADDRESS + + PCIE_SOC_WAKE_ADDRESS); } } @@ -854,7 +864,8 @@ static void ath10k_pci_cleanup_ce(struct ath10k *ar) pipe_info = ar_pci-pipe_info[pipe_num]; spin_lock_bh(pipe_info-pipe_lock); - list_for_each_entry_safe(compl, tmp, pipe_info-compl_free, list) { + list_for_each_entry_safe(compl, tmp, +pipe_info-compl_free, list) { list_del(compl-list); kfree(compl); } @@ -909,10 +920,9 @@ static void ath10k_pci_process_ce(struct ath10k *ar)
[ath9k-devel] [PATCH 4/5] ath10k: fix some checkpatch errors in ce.c
Signed-off-by: Kalle Valo kv...@qca.qualcomm.com --- drivers/net/wireless/ath/ath10k/ce.c | 80 ++ 1 file changed, 52 insertions(+), 28 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c index 44c8947..75d1fea 100644 --- a/drivers/net/wireless/ath/ath10k/ce.c +++ b/drivers/net/wireless/ath/ath10k/ce.c @@ -121,7 +121,7 @@ static inline u32 ath10k_ce_src_ring_read_index_get(struct ath10k *ar, return ath10k_pci_read32(ar, ce_ctrl_addr + CURRENT_SRRI_ADDRESS); } -static inline void ath10k_ce_src_ring_base_addr_set(struct ath10k * ar, +static inline void ath10k_ce_src_ring_base_addr_set(struct ath10k *ar, u32 ce_ctrl_addr, unsigned int addr) { @@ -139,10 +139,12 @@ static inline void ath10k_ce_src_ring_dmax_set(struct ath10k *ar, u32 ce_ctrl_addr, unsigned int n) { - u32 ctrl1_addr = ath10k_pci_read32((ar), (ce_ctrl_addr) + CE_CTRL1_ADDRESS); + u32 ctrl1_addr = ath10k_pci_read32((ar), + (ce_ctrl_addr) + CE_CTRL1_ADDRESS); ath10k_pci_write32(ar, ce_ctrl_addr + CE_CTRL1_ADDRESS, - (ctrl1_addr ~CE_CTRL1_DMAX_LENGTH_MASK) | CE_CTRL1_DMAX_LENGTH_SET(n)); + (ctrl1_addr ~CE_CTRL1_DMAX_LENGTH_MASK) | + CE_CTRL1_DMAX_LENGTH_SET(n)); } static inline void ath10k_ce_src_ring_byte_swap_set(struct ath10k *ar, @@ -153,7 +155,8 @@ static inline void ath10k_ce_src_ring_byte_swap_set(struct ath10k *ar, u32 ctrl1_addr = ath10k_pci_read32(ar, ce_ctrl_addr + CE_CTRL1_ADDRESS); ath10k_pci_write32(ar, ce_ctrl_addr + CE_CTRL1_ADDRESS, - (ctrl1_addr ~CE_CTRL1_SRC_RING_BYTE_SWAP_EN_MASK) | CE_CTRL1_SRC_RING_BYTE_SWAP_EN_SET(n)); + (ctrl1_addr ~CE_CTRL1_SRC_RING_BYTE_SWAP_EN_MASK) | + CE_CTRL1_SRC_RING_BYTE_SWAP_EN_SET(n)); } static inline void ath10k_ce_dest_ring_byte_swap_set(struct ath10k *ar, @@ -163,7 +166,8 @@ static inline void ath10k_ce_dest_ring_byte_swap_set(struct ath10k *ar, u32 ctrl1_addr = ath10k_pci_read32(ar, ce_ctrl_addr + CE_CTRL1_ADDRESS); ath10k_pci_write32(ar, ce_ctrl_addr + CE_CTRL1_ADDRESS, - (ctrl1_addr ~CE_CTRL1_DST_RING_BYTE_SWAP_EN_MASK) | CE_CTRL1_DST_RING_BYTE_SWAP_EN_SET(n)); + (ctrl1_addr ~CE_CTRL1_DST_RING_BYTE_SWAP_EN_MASK) | + CE_CTRL1_DST_RING_BYTE_SWAP_EN_SET(n)); } static inline u32 ath10k_ce_dest_ring_read_index_get(struct ath10k *ar, @@ -190,46 +194,55 @@ static inline void ath10k_ce_src_ring_highmark_set(struct ath10k *ar, u32 ce_ctrl_addr, unsigned int n) { - u32 watermark_addr = ath10k_pci_read32(ar, ce_ctrl_addr + SRC_WATERMARK_ADDRESS); + u32 watermark_addr = ath10k_pci_read32(ar, + ce_ctrl_addr + SRC_WATERMARK_ADDRESS); ath10k_pci_write32(ar, ce_ctrl_addr + SRC_WATERMARK_ADDRESS, - (watermark_addr ~SRC_WATERMARK_HIGH_MASK) | SRC_WATERMARK_HIGH_SET(n)); + (watermark_addr ~SRC_WATERMARK_HIGH_MASK) | + SRC_WATERMARK_HIGH_SET(n)); } static inline void ath10k_ce_src_ring_lowmark_set(struct ath10k *ar, u32 ce_ctrl_addr, unsigned int n) { - u32 watermark_addr = ath10k_pci_read32(ar, ce_ctrl_addr + SRC_WATERMARK_ADDRESS); + u32 watermark_addr = ath10k_pci_read32(ar, + ce_ctrl_addr + SRC_WATERMARK_ADDRESS); ath10k_pci_write32(ar, ce_ctrl_addr + SRC_WATERMARK_ADDRESS, - (watermark_addr ~SRC_WATERMARK_LOW_MASK) | SRC_WATERMARK_LOW_SET(n)); + (watermark_addr ~SRC_WATERMARK_LOW_MASK) | + SRC_WATERMARK_LOW_SET(n)); } static inline void ath10k_ce_dest_ring_highmark_set(struct ath10k *ar, u32 ce_ctrl_addr, unsigned int n) { - u32 watermark_addr = ath10k_pci_read32(ar, ce_ctrl_addr + DST_WATERMARK_ADDRESS); + u32 watermark_addr = ath10k_pci_read32(ar, + ce_ctrl_addr + DST_WATERMARK_ADDRESS); ath10k_pci_write32(ar, ce_ctrl_addr + DST_WATERMARK_ADDRESS, - (watermark_addr ~DST_WATERMARK_HIGH_MASK) | DST_WATERMARK_HIGH_SET(n)); + (watermark_addr
[ath9k-devel] [PATCH 5/5] ath10k: fix some checkpatch errors in wmi.h
Signed-off-by: Kalle Valo kv...@qca.qualcomm.com --- drivers/net/wireless/ath/ath10k/wmi.h | 155 - 1 file changed, 111 insertions(+), 44 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index 9946a51..0f09ace 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -188,8 +188,8 @@ struct wmi_mac_addr { */ enum wmi_cmd_group { /* 0 to 2 are reserved */ - WMI_GRP_START=0x3, - WMI_GRP_SCAN=WMI_GRP_START, + WMI_GRP_START = 0x3, + WMI_GRP_SCAN = WMI_GRP_START, WMI_GRP_PDEV, WMI_GRP_VDEV, WMI_GRP_PEER, @@ -223,7 +223,7 @@ enum wmi_cmd_group { /* Command IDs and commande events. */ enum wmi_cmd_id { - WMI_INIT_CMDID=0x1, + WMI_INIT_CMDID = 0x1, /* Scan specific commands */ WMI_START_SCAN_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_SCAN), @@ -318,7 +318,8 @@ enum wmi_cmd_id { WMI_AP_PS_PEER_UAPSD_COEX_CMDID, /* Rate-control specific commands */ - WMI_PEER_RATE_RETRY_SCHED_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_RATE_CTRL), + WMI_PEER_RATE_RETRY_SCHED_CMDID = + WMI_CMD_GRP_START_ID(WMI_GRP_RATE_CTRL), /* WLAN Profiling commands. */ WMI_WLAN_PROFILE_TRIGGER_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_PROFILE), @@ -384,7 +385,7 @@ enum wmi_cmd_id { }; enum wmi_event_id { - WMI_SERVICE_READY_EVENTID=0x1, + WMI_SERVICE_READY_EVENTID = 0x1, WMI_READY_EVENTID, /* Scan specific events */ @@ -527,7 +528,9 @@ enum wmi_channel_change_cause { #define WMI_CHAN_FLAG_DFS(1 10) #define WMI_CHAN_FLAG_ALLOW_HT (1 11) #define WMI_CHAN_FLAG_ALLOW_VHT (1 12) -#define WMI_CHANNEL_CHANGE_CAUSE_CSA (1 13) /* Indicate reason for channel switch */ + +/* Indicate reason for channel switch */ +#define WMI_CHANNEL_CHANGE_CAUSE_CSA (1 13) #define WMI_MAX_SPATIAL_STREAM 3 @@ -745,10 +748,11 @@ struct wmi_resource_config { __le32 num_peers; /* -* In offload mode target supports features like WOW, chatter and other -* protocol offloads. In order to support them some functionalities like -* reorder buffering, PN checking need to be done in target. This determines -* maximum number of peers suported by target in offload mode +* In offload mode target supports features like WOW, chatter and +* other protocol offloads. In order to support them some +* functionalities like reorder buffering, PN checking need to be +* done in target. This determines maximum number of peers suported +* by target in offload mode */ __le32 num_offload_peers; @@ -1639,52 +1643,109 @@ struct wmi_pdev_set_wmm_params_arg { }; struct wal_dbg_tx_stats { - __le32 comp_queued; /* Num HTT cookies queued to dispatch list */ - __le32 comp_delivered; /* Num HTT cookies dispatched */ - __le32 msdu_enqued; /* Num MSDU queued to WAL */ - __le32 mpdu_enqued; /* Num MPDU queue to WAL */ - __le32 wmm_drop; /* Num MSDUs dropped by WMM limit */ - __le32 local_enqued; /* Num Local frames queued */ - __le32 local_freed; /* Num Local frames done */ - __le32 hw_queued; /* Num queued to HW */ - __le32 hw_reaped; /* Num PPDU reaped from HW */ - __le32 underrun; /* Num underruns */ - __le32 tx_abort; /* Num PPDUs cleaned up in TX abort */ - __le32 mpdus_requed; /* Num MPDUs requed by SW */ - __le32 tx_ko; /* excessive retries */ - __le32 data_rc; /* data hw rate code */ - __le32 self_triggers; /* Scheduler self triggers */ - __le32 sw_retry_failure; /* frames dropped due to excessive sw retries */ - __le32 illgl_rate_phy_err; /* illegal rate phy errors */ - __le32 pdev_cont_xretry; /* wal pdev continous xretry */ - __le32 pdev_tx_timeout; /* wal pdev continous xretry */ - __le32 pdev_resets; /* wal pdev resets */ + /* Num HTT cookies queued to dispatch list */ + __le32 comp_queued; + + /* Num HTT cookies dispatched */ + __le32 comp_delivered; + + /* Num MSDU queued to WAL */ + __le32 msdu_enqued; + + /* Num MPDU queue to WAL */ + __le32 mpdu_enqued; + + /* Num MSDUs dropped by WMM limit */ + __le32 wmm_drop; + + /* Num Local frames queued */ + __le32 local_enqued; + + /* Num Local frames done */ + __le32 local_freed; + + /* Num queued to HW */ + __le32 hw_queued; + + /* Num PPDU reaped from HW */ + __le32 hw_reaped; + + /* Num underruns */ + __le32 underrun; + + /* Num PPDUs cleaned up in TX abort */ + __le32 tx_abort; + + /* Num MPDUs requed by SW */ + __le32 mpdus_requed; + + /* excessive retries */ + __le32 tx_ko; + + /* data hw rate code */ + __le32 data_rc; + +
[ath9k-devel] [PATCH 0/2] ath10k: ce cleanup
Trivial cleanup. Michal Kazior (2): ath10k: use ALIGN() kernel macros ath10k: use void pointer instead of char pointer drivers/net/wireless/ath/ath10k/ce.c | 50 +++--- drivers/net/wireless/ath/ath10k/ce.h |2 +- 2 files changed, 17 insertions(+), 35 deletions(-) -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 1/2] ath10k: use ALIGN() kernel macros
Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/ce.c | 50 +++--- 1 file changed, 16 insertions(+), 34 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c index 44c8947..352cf43 100644 --- a/drivers/net/wireless/ath/ath10k/ce.c +++ b/drivers/net/wireless/ath/ath10k/ce.c @@ -946,24 +946,14 @@ static int ath10k_ce_init_src_ring(struct ath10k *ar, pci_alloc_consistent(ar_pci-pdev, (nentries * sizeof(struct ce_desc) + CE_DESC_RING_ALIGN), base_addr); - src_ring-base_addr_ce_space_unaligned = base_addr; - if (src_ring-base_addr_ce_space_unaligned - (CE_DESC_RING_ALIGN - 1)) { - src_ring-base_addr_ce_space = - (src_ring-base_addr_ce_space_unaligned + -CE_DESC_RING_ALIGN - 1) ~(CE_DESC_RING_ALIGN - 1); - - src_ring-base_addr_owner_space = - (void *)(((size_t) src_ring-base_addr_owner_space_unaligned + - CE_DESC_RING_ALIGN - 1) ~(CE_DESC_RING_ALIGN - 1)); - } else { - src_ring-base_addr_ce_space = - src_ring-base_addr_ce_space_unaligned; - src_ring-base_addr_owner_space = - src_ring-base_addr_owner_space_unaligned; - } + src_ring-base_addr_owner_space = PTR_ALIGN( + src_ring-base_addr_owner_space_unaligned, + CE_DESC_RING_ALIGN); + src_ring-base_addr_ce_space = ALIGN( + src_ring-base_addr_ce_space_unaligned, + CE_DESC_RING_ALIGN); /* * Also allocate a shadow src ring in regular @@ -972,9 +962,10 @@ static int ath10k_ce_init_src_ring(struct ath10k *ar, src_ring-shadow_base_unaligned = kmalloc((nentries * sizeof(struct ce_desc) + CE_DESC_RING_ALIGN), GFP_KERNEL); - src_ring-shadow_base = (struct ce_desc *) - (((size_t) src_ring-shadow_base_unaligned + - CE_DESC_RING_ALIGN - 1) ~(CE_DESC_RING_ALIGN - 1)); + + src_ring-shadow_base = PTR_ALIGN( + src_ring-shadow_base_unaligned, + CE_DESC_RING_ALIGN); ath10k_pci_wake(ar); ath10k_ce_src_ring_base_addr_set(ar, ctrl_addr, src_ring-base_addr_ce_space); @@ -1042,21 +1033,12 @@ static int ath10k_ce_init_dest_ring(struct ath10k *ar, memset(dest_ring-base_addr_owner_space_unaligned, 0, nentries * sizeof(struct ce_desc) + CE_DESC_RING_ALIGN); - if (dest_ring-base_addr_ce_space_unaligned - (CE_DESC_RING_ALIGN - 1)) { - dest_ring-base_addr_ce_space = - (dest_ring-base_addr_ce_space_unaligned + -CE_DESC_RING_ALIGN - 1) ~(CE_DESC_RING_ALIGN - 1); - - dest_ring-base_addr_owner_space = - (void *)(((size_t) dest_ring-base_addr_owner_space_unaligned + - CE_DESC_RING_ALIGN - 1) ~(CE_DESC_RING_ALIGN - 1)); - } else { - dest_ring-base_addr_ce_space = - dest_ring-base_addr_ce_space_unaligned; - dest_ring-base_addr_owner_space = - dest_ring-base_addr_owner_space_unaligned; - } + dest_ring-base_addr_owner_space = PTR_ALIGN( + dest_ring-base_addr_owner_space_unaligned, + CE_DESC_RING_ALIGN); + dest_ring-base_addr_ce_space = ALIGN( + dest_ring-base_addr_ce_space_unaligned, + CE_DESC_RING_ALIGN); ath10k_pci_wake(ar); ath10k_ce_dest_ring_base_addr_set(ar, ctrl_addr, -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH 2/2] ath10k: use void pointer instead of char pointer
Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/ce.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/ce.h b/drivers/net/wireless/ath/ath10k/ce.h index 555f7bc..11948a6 100644 --- a/drivers/net/wireless/ath/ath10k/ce.h +++ b/drivers/net/wireless/ath/ath10k/ce.h @@ -111,7 +111,7 @@ struct ce_ring_state { * Start of shadow copy of descriptors, within regular memory. * Aligned to descriptor-size boundary. */ - char *shadow_base_unaligned; + void *shadow_base_unaligned; struct ce_desc *shadow_base; void **per_transfer_context; -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] Missing packet info with little endian ath9k
Hi all! I'm doing a project of mine. It's about guiding a robot in my living room using wifi. At first I tried to use two raspberry pi with a wifi dongle (ath9k-htc) and libpcap to capture wifi packets and read the rssi from my robot mac address. It works fine. But then I thought in using OpenWRT. Since I was able to get my hands on two cheap TP-LINK MR-3220 (ath9k) I recompiled the code to run on mips. The thing is all the info I gather from the packets are like misaligned. For example, if I print the mac address's for each packet I get : 11:96:77:3c:38:e7, d8:d8:b2:94:58:98, 35:8e:ad:e4:a0:4a where the mac from the robot is 38:e7:d8:d8:b2:94! And the rest of the bits in the collected packets are also off.. So, the code prints everything fine in the Raspberry Pi (RSSI, type and subtype of frames, etc), why not in openwrt?! My headers go like this: #define EXTRACT_LE_16BITS(p) ((u_int16_t)((u_int16_t) * ((const u_int8_t *)(p) + 1) 8 | (u_int16_t)*((const u_int8_t *)(p) + 0))) struct sniff_80211 { u_int16_t control[2];//32bit u_int16_t duration; u_char add1[6]; u_char add2[6]; u_char add3[6]; u_int16_t seq; }; typedef struct _mac_header { unsigned char fc[2]; unsigned char id[2]; unsigned char add1[6]; unsigned char add2[6]; unsigned char add3[6]; unsigned char sc[2]; }mac_header; struct frame_control { unsigned protocol :2; unsigned type :2; unsigned subtype :4; unsigned to_ds :1; unsigned from_ds :1; unsigned more_frag :1; unsigned retry :1; unsigned pwr_mgt :1; unsigned more_data :1; unsigned wep :1; unsigned order :1; }; My logic is this: pcap_open_live(device-name, 1024, 1, 500, errbuf) For each captured packet with libpcap: pcap_next_ex(adhandle, header, data) Do: struct ath_rx_radiotap_header *first = (struct ath_rx_radiotap_header*) (data); int radio_len3 = get_unaligned_le16(first-wr_ihdr.it_len); cout radio_len3 endl; mac_header *p = (mac_header*) (data + radio_len); struct frame_control *c = (struct frame_control*) p-fc; cout ether_ntoa((struct ether_addr *) p-add1) ether_ntoa((struct ether_addr *) p-add2) ether_ntoa((struct ether_addr *) p-add3) first-wr_antenna c-type c-subtype endl; This prints (with, for example a filter of type data, subtype qos-data): 13 - radiotap header length 38:e7:d8:d8:b2:94 f8:d1:11:96:77:3c 58:98:35:8e:ad:e4 � 0 8 - (this is addr1, addr2, addr3, rssi, type, subtype of captured packet) 13 38:e7:d8:d8:b2:94 f8:d1:11:96:77:3c 58:98:35:8e:ad:e4 � 0 8 34 f8:d1:11:96:77:3c 38:e7:d8:d8:b2:94 58:98:35:8e:ad:e4 � 0 8 34 f8:d1:11:96:77:3c 38:e7:d8:d8:b2:94 58:98:35:8e:ad:e4 � 0 8 13 38:e7:d8:d8:b2:94 f8:d1:11:96:77:3c 58:98:35:8e:ad:e4 � 0 8 13 38:e7:d8:d8:b2:94 f8:d1:11:96:77:3c 58:98:35:8e:ad:e4 � 0 8 34 f8:d1:11:96:77:3c 38:e7:d8:d8:b2:94 58:98:35:8e:ad:e4 � 0 8 What could be wrong in openwrt that isn't on the raspberry pi?! Is it the little endian of raspberry vs the big endian of the uplink ? If so how can I get the info I want? (rssi, type and subtype of packet)? Thanks for any help! I've been scratching my head for days now.. PS: maybe this question doesn't belong here, but I can't get help anywhere else.. Again, thanks in advance. ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH] ath10k: fix pci feature bitmap
The array size evaluated to zero. This caused hw v1 workaround to fail. Signed-off-by: Michal Kazior michal.kaz...@tieto.com --- drivers/net/wireless/ath/ath10k/pci.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h index 1cf7f17..49f2d1b 100644 --- a/drivers/net/wireless/ath/ath10k/pci.h +++ b/drivers/net/wireless/ath/ath10k/pci.h @@ -190,7 +190,7 @@ struct ath10k_pci { void __iomem *mem; int cacheline_sz; - unsigned long features[ATH10K_PCI_FEATURE_COUNT / sizeof(unsigned long)]; + DECLARE_BITMAP(features, ATH10K_PCI_FEATURE_COUNT); /* * Number of MSI interrupts granted, 0 -- using legacy PCI line -- 1.7.9.5 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH] ath10k: Use IBSS SSID provided by mac80211.
IBSS ssid is provided by mac80211, use it in vdev start. Signed-off-by: Marek Puzyniak marek.puzyn...@tieto.com --- drivers/net/wireless/ath/ath10k/mac.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 5b433ee..2469295 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -396,9 +396,8 @@ static int ath10k_vdev_start(struct ath10k_vif *arvif) arg.ssid_len = arvif-u.ap.ssid_len; arg.hidden_ssid = arvif-u.ap.hidden_ssid; } else if (arvif-vdev_type == WMI_VDEV_TYPE_IBSS) { - /* TODO: IBSS ssid and ssid_len is needed from mac80211 -* small patch in mac80211 is needed -*/ + arg.ssid = arvif-vif-bss_conf.ssid; + arg.ssid_len = arvif-vif-bss_conf.ssid_len; } ret = ath10k_wmi_vdev_start(ar, arg); @@ -1823,7 +1822,8 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw, arvif-dtim_period, arvif-vdev_id); } - if (changed BSS_CHANGED_SSID) { + if (changed BSS_CHANGED_SSID + vif-type == NL80211_IFTYPE_AP) { arvif-u.ap.ssid_len = info-ssid_len; if (info-ssid_len) memcpy(arvif-u.ap.ssid, info-ssid, info-ssid_len); -- 1.7.0.4 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
Re: [ath9k-devel] Missing packet info with little endian ath9k
You probably need some __attribute__((packed)) on the structs ? http://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html 2013/4/26 Luis Correia lfpcorr...@gmail.com Hi all! I'm doing a project of mine. It's about guiding a robot in my living room using wifi. At first I tried to use two raspberry pi with a wifi dongle (ath9k-htc) and libpcap to capture wifi packets and read the rssi from my robot mac address. It works fine. But then I thought in using OpenWRT. Since I was able to get my hands on two cheap TP-LINK MR-3220 (ath9k) I recompiled the code to run on mips. The thing is all the info I gather from the packets are like misaligned. For example, if I print the mac address's for each packet I get : 11:96:77:3c:38:e7, d8:d8:b2:94:58:98, 35:8e:ad:e4:a0:4a where the mac from the robot is 38:e7:d8:d8:b2:94! And the rest of the bits in the collected packets are also off.. So, the code prints everything fine in the Raspberry Pi (RSSI, type and subtype of frames, etc), why not in openwrt?! My headers go like this: #define EXTRACT_LE_16BITS(p) ((u_int16_t)((u_int16_t) * ((const u_int8_t *)(p) + 1) 8 | (u_int16_t)*((const u_int8_t *)(p) + 0))) struct sniff_80211 { u_int16_t control[2];//32bit u_int16_t duration; u_char add1[6]; u_char add2[6]; u_char add3[6]; u_int16_t seq; }; typedef struct _mac_header { unsigned char fc[2]; unsigned char id[2]; unsigned char add1[6]; unsigned char add2[6]; unsigned char add3[6]; unsigned char sc[2]; }mac_header; struct frame_control { unsigned protocol :2; unsigned type :2; unsigned subtype :4; unsigned to_ds :1; unsigned from_ds :1; unsigned more_frag :1; unsigned retry :1; unsigned pwr_mgt :1; unsigned more_data :1; unsigned wep :1; unsigned order :1; }; My logic is this: pcap_open_live(device-name, 1024, 1, 500, errbuf) For each captured packet with libpcap: pcap_next_ex(adhandle, header, data) Do: struct ath_rx_radiotap_header *first = (struct ath_rx_radiotap_header*) (data); int radio_len3 = get_unaligned_le16(first-wr_ihdr.it_len); cout radio_len3 endl; mac_header *p = (mac_header*) (data + radio_len); struct frame_control *c = (struct frame_control*) p-fc; cout ether_ntoa((struct ether_addr *) p-add1) ether_ntoa((struct ether_addr *) p-add2) ether_ntoa((struct ether_addr *) p-add3) first-wr_antenna c-type c-subtype endl; This prints (with, for example a filter of type data, subtype qos-data): 13 - radiotap header length 38:e7:d8:d8:b2:94 f8:d1:11:96:77:3c 58:98:35:8e:ad:e4 � 0 8 - (this is addr1, addr2, addr3, rssi, type, subtype of captured packet) 13 38:e7:d8:d8:b2:94 f8:d1:11:96:77:3c 58:98:35:8e:ad:e4 � 0 8 34 f8:d1:11:96:77:3c 38:e7:d8:d8:b2:94 58:98:35:8e:ad:e4 � 0 8 34 f8:d1:11:96:77:3c 38:e7:d8:d8:b2:94 58:98:35:8e:ad:e4 � 0 8 13 38:e7:d8:d8:b2:94 f8:d1:11:96:77:3c 58:98:35:8e:ad:e4 � 0 8 13 38:e7:d8:d8:b2:94 f8:d1:11:96:77:3c 58:98:35:8e:ad:e4 � 0 8 34 f8:d1:11:96:77:3c 38:e7:d8:d8:b2:94 58:98:35:8e:ad:e4 � 0 8 What could be wrong in openwrt that isn't on the raspberry pi?! Is it the little endian of raspberry vs the big endian of the uplink ? If so how can I get the info I want? (rssi, type and subtype of packet)? Thanks for any help! I've been scratching my head for days now.. PS: maybe this question doesn't belong here, but I can't get help anywhere else.. Again, thanks in advance. ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
Re: [ath9k-devel] varying RSSI values with ath9k_htc drivers for TL-WN721N USB wifi adapter.
On Friday 26 April 2013 01:39 AM, Adrian Chadd wrote: Have you actually verified that the output power of those devices is actually constant? Adrian On 25 April 2013 07:08, Harshal Vora hars...@amideeptech.com wrote: Hi, I are trying to achieve approximate location detection (room level granularity) based on RSSI. I am using TP-LINK TL-WN721N USB wifi adapter which require ath9k_htc drivers. Operating system: Ubuntu 12:04 LTS. The RSSI values recorded vary a lot, even when the transmitter (iPhone 5 and sony xPeria and other phones) and the receiver are left untouched at the same location. There is a difference of almost 15 to 20 dbm in the readings. Sometimes it is in the range of -40 to -50dbm .. sometimes -50 to -60dbm Also sometimes the RSSI values are always between -75 to -85 dbm no matter how short or long the distance is between the two devices. I am using airmon-ng to set the device in monitor mode and tshark to sniff. I have tried with the drivers that come with ubuntu 12.04, with compat-wireless 3.6.8-1 as well as compat-drivers 3.8.3-2 The todo list on http://wireless.kernel.org/en/users/Drivers/ath9k_htc#TODO mentions Low RSSI issue for UB91/94. Should this be a concern? Regards, ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel Hi, I have a MAC laptop which has inbuilt broadcom BCM 4331 chipset running on b43 drivers. I put the iPhone in charging and it is always unlocked and on the wifi settings page which displays available networks. From what I understand, iPhone goes in power saver mode only when locked. The readings on bcm4331 are much stable as compared to the wn721n usb adapter. On broadcom, the dbm values differ mostly by 3-4 dbm and sometimes I see a spike with a difference of 7-8dbm. On the other hand the dbm values using ath9k_htc drivers differ by 10-15dbm. I have also tested with a locked iPhone to get similar results. In another setup, I connected one wn721n chipset to hackberry and another to my laptop. Again I took two sets of readings with transmitter as wn721n on hackberry and receiver as bcm4331 in the first run and receiver as wn721n on my mac in the second run. Again similar observaions as the experiment with iPhone as transmitter. How can I measure the output transmission power? I deployed the ath9k_htc drivers in debug mode with value 0x. But cannot get any relevant information from debugfs. When I do ifconfig, it says power management off. When I run sudo iwconfig dev txpower value, it returns an error. I have taken a lot of different sets of readings for ath9k_htc, and relatively the readings are correct. i.e. the dbm values will change as the distance between the transmitter and receiver changes. But sometimes the dbm values remain in a particular range say -75dbm to -85dbm no matter how near or far the transmitter is from the receiver. Regards, ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
Re: [ath9k-devel] varying RSSI values with ath9k_htc drivers for TL-WN721N USB wifi adapter.
This issue totally destroyed deployment of DNUA-93F (AR9271) USB Wifi in a similar application. Now use Realtek with very stable results. But there is history. See https://patchwork.kernel.org/patch/2177921/ and attached. Trevor -Original Message- From: ath9k-devel-boun...@lists.ath9k.org [mailto:ath9k-devel-boun...@lists.ath9k.org] On Behalf Of Harshal Vora Sent: 26 April 2013 11:43 To: Adrian Chadd Cc: ath9k-devel@lists.ath9k.org Subject: Re: [ath9k-devel] varying RSSI values with ath9k_htc drivers for TL-WN721N USB wifi adapter. On Friday 26 April 2013 01:39 AM, Adrian Chadd wrote: Have you actually verified that the output power of those devices is actually constant? Adrian On 25 April 2013 07:08, Harshal Vora hars...@amideeptech.com wrote: Hi, I are trying to achieve approximate location detection (room level granularity) based on RSSI. I am using TP-LINK TL-WN721N USB wifi adapter which require ath9k_htc drivers. Operating system: Ubuntu 12:04 LTS. The RSSI values recorded vary a lot, even when the transmitter (iPhone 5 and sony xPeria and other phones) and the receiver are left untouched at the same location. There is a difference of almost 15 to 20 dbm in the readings. Sometimes it is in the range of -40 to -50dbm .. sometimes -50 to -60dbm Also sometimes the RSSI values are always between -75 to -85 dbm no matter how short or long the distance is between the two devices. I am using airmon-ng to set the device in monitor mode and tshark to sniff. I have tried with the drivers that come with ubuntu 12.04, with compat-wireless 3.6.8-1 as well as compat-drivers 3.8.3-2 The todo list on http://wireless.kernel.org/en/users/Drivers/ath9k_htc#TODO mentions Low RSSI issue for UB91/94. Should this be a concern? Regards, ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel Hi, I have a MAC laptop which has inbuilt broadcom BCM 4331 chipset running on b43 drivers. I put the iPhone in charging and it is always unlocked and on the wifi settings page which displays available networks. From what I understand, iPhone goes in power saver mode only when locked. The readings on bcm4331 are much stable as compared to the wn721n usb adapter. On broadcom, the dbm values differ mostly by 3-4 dbm and sometimes I see a spike with a difference of 7-8dbm. On the other hand the dbm values using ath9k_htc drivers differ by 10-15dbm. I have also tested with a locked iPhone to get similar results. In another setup, I connected one wn721n chipset to hackberry and another to my laptop. Again I took two sets of readings with transmitter as wn721n on hackberry and receiver as bcm4331 in the first run and receiver as wn721n on my mac in the second run. Again similar observaions as the experiment with iPhone as transmitter. How can I measure the output transmission power? I deployed the ath9k_htc drivers in debug mode with value 0x. But cannot get any relevant information from debugfs. When I do ifconfig, it says power management off. When I run sudo iwconfig dev txpower value, it returns an error. I have taken a lot of different sets of readings for ath9k_htc, and relatively the readings are correct. i.e. the dbm values will change as the distance between the transmitter and receiver changes. But sometimes the dbm values remain in a particular range say -75dbm to -85dbm no matter how near or far the transmitter is from the receiver. Regards, ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel ---BeginMessage--- add an if-guard, otherwise iw(8) reports weird signal strengths. The behaviour was fine before this commit: 7c277349ecbd66e19fad3d949fa6ef6c131a3b62 Therefore, this patch is a partially revert of it. In my testsetup, I have two access points: 00:12:XX within one meter physically range c0:c1:XX ~15m, two (thin) walls w/o patch: 00:12:XX -82.00 dBm c0:c1:XX -84.00 dBm with patch: 00:12:XX -45.00 dBm c0:c1:XX -63.00 dBm Tested with TP-Link TL-WN722N Reported-by: Markus Krainz mar...@indoo.rs Tested-by: Markus Krainz mar...@indoo.rs Signed-off-by: Bernhard Urban lew...@gmail.com --- drivers/net/wireless/ath/ath9k/htc.h |1 + drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 29 +++-- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index b30596f..602e19b 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h @@ -22,6 +22,7 @@ #include linux/firmware.h #include linux/skbuff.h #include linux/netdevice.h +#include linux/etherdevice.h #include linux/leds.h #include linux/slab.h #include net/mac80211.h diff
Re: [ath9k-devel] varying RSSI values with ath9k_htc drivers for TL-WN721N USB wifi adapter.
There's some driver work that Felix and others did or are talking about, which tidy up the RSSI measurement. There's also the antenna diversity behaviour; depending upon which antenna is used, there's a few dB difference (same as the AR9285.) I'm sorry, I can't work on it any more than that. I can point out what the AR9285 RX descriptor contents are relating to antenna configuration; that way someone can add that to ath9k and possibly link antenna selection / configuration to the RSSI differences. But I can't do the legwork, sorry. Adrian On 26 April 2013 06:56, Trevor Cullen t...@innovelec.co.uk wrote: This issue totally destroyed deployment of DNUA-93F (AR9271) USB Wifi in a similar application. Now use Realtek with very stable results. But there is history. See https://patchwork.kernel.org/patch/2177921/ and attached. Trevor -Original Message- From: ath9k-devel-boun...@lists.ath9k.org [mailto:ath9k-devel-boun...@lists.ath9k.org] On Behalf Of Harshal Vora Sent: 26 April 2013 11:43 To: Adrian Chadd Cc: ath9k-devel@lists.ath9k.org Subject: Re: [ath9k-devel] varying RSSI values with ath9k_htc drivers for TL-WN721N USB wifi adapter. On Friday 26 April 2013 01:39 AM, Adrian Chadd wrote: Have you actually verified that the output power of those devices is actually constant? Adrian On 25 April 2013 07:08, Harshal Vora hars...@amideeptech.com wrote: Hi, I are trying to achieve approximate location detection (room level granularity) based on RSSI. I am using TP-LINK TL-WN721N USB wifi adapter which require ath9k_htc drivers. Operating system: Ubuntu 12:04 LTS. The RSSI values recorded vary a lot, even when the transmitter (iPhone 5 and sony xPeria and other phones) and the receiver are left untouched at the same location. There is a difference of almost 15 to 20 dbm in the readings. Sometimes it is in the range of -40 to -50dbm .. sometimes -50 to -60dbm Also sometimes the RSSI values are always between -75 to -85 dbm no matter how short or long the distance is between the two devices. I am using airmon-ng to set the device in monitor mode and tshark to sniff. I have tried with the drivers that come with ubuntu 12.04, with compat-wireless 3.6.8-1 as well as compat-drivers 3.8.3-2 The todo list on http://wireless.kernel.org/en/users/Drivers/ath9k_htc#TODO mentions Low RSSI issue for UB91/94. Should this be a concern? Regards, ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel Hi, I have a MAC laptop which has inbuilt broadcom BCM 4331 chipset running on b43 drivers. I put the iPhone in charging and it is always unlocked and on the wifi settings page which displays available networks. From what I understand, iPhone goes in power saver mode only when locked. The readings on bcm4331 are much stable as compared to the wn721n usb adapter. On broadcom, the dbm values differ mostly by 3-4 dbm and sometimes I see a spike with a difference of 7-8dbm. On the other hand the dbm values using ath9k_htc drivers differ by 10-15dbm. I have also tested with a locked iPhone to get similar results. In another setup, I connected one wn721n chipset to hackberry and another to my laptop. Again I took two sets of readings with transmitter as wn721n on hackberry and receiver as bcm4331 in the first run and receiver as wn721n on my mac in the second run. Again similar observaions as the experiment with iPhone as transmitter. How can I measure the output transmission power? I deployed the ath9k_htc drivers in debug mode with value 0x. But cannot get any relevant information from debugfs. When I do ifconfig, it says power management off. When I run sudo iwconfig dev txpower value, it returns an error. I have taken a lot of different sets of readings for ath9k_htc, and relatively the readings are correct. i.e. the dbm values will change as the distance between the transmitter and receiver changes. But sometimes the dbm values remain in a particular range say -75dbm to -85dbm no matter how near or far the transmitter is from the receiver. Regards, ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH] ath9k_htc: add STBC TX support
current firmware will enable STBC_TX, only if other peer support it. This patch provide ht_peer_caps to firmware. FW versions 1.3, 1.4 should be able to work with it. Tested on ar7010+ar9280 and ar7010+ar9287. Signed-off-by: Oleksij Rempel li...@rempel-privat.de --- drivers/net/wireless/ath/ath9k/htc.h | 2 ++ drivers/net/wireless/ath/ath9k/htc_drv_init.c | 3 +++ drivers/net/wireless/ath/ath9k/htc_drv_main.c | 4 3 files changed, 9 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index d3b099d..db4a793 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h @@ -142,6 +142,8 @@ struct ath9k_htc_target_aggr { #define WLAN_RC_40_FLAG 0x02 #define WLAN_RC_SGI_FLAG 0x04 #define WLAN_RC_HT_FLAG 0x08 +#define WLAN_RC_TX_STBC_FLAG 0x20 /* TX STBC */ +#define WLAN_RC_RX_STBC_FLAG 0xC0 /* RX STBC ,2 bits */ struct ath9k_htc_rateset { u8 rs_nrates; diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index a47f5e0..c79c5ac 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c @@ -517,6 +517,9 @@ static void setup_ht_cap(struct ath9k_htc_priv *priv, ath_dbg(common, CONFIG, TX streams %d, RX streams: %d\n, tx_streams, rx_streams); + if (tx_streams = 2) + ht_info-cap |= IEEE80211_HT_CAP_TX_STBC; + if (tx_streams != rx_streams) { ht_info-mcs.tx_params |= IEEE80211_HT_MCS_TX_RX_DIFF; ht_info-mcs.tx_params |= ((tx_streams - 1) diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index 0743a47..af08b4a 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c @@ -623,6 +623,10 @@ static void ath9k_htc_setup_rate(struct ath9k_htc_priv *priv, trate-rates.ht_rates.rs_nrates = j; caps = WLAN_RC_HT_FLAG; + if (sta-ht_cap.cap IEEE80211_HT_CAP_RX_STBC) + caps |= WLAN_RC_RX_STBC_FLAG; + if (sta-ht_cap.cap IEEE80211_HT_CAP_TX_STBC) + caps |= WLAN_RC_TX_STBC_FLAG; if (sta-ht_cap.mcs.rx_mask[1]) caps |= WLAN_RC_DS_FLAG; if ((sta-ht_cap.cap IEEE80211_HT_CAP_SUP_WIDTH_20_40) -- 1.8.1.2 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] [PATCH] ath9k_htc: add STBC TX support
current firmware will enable STBC_TX, only if other peer support it. This patch provide ht_peer_caps to firmware. FW versions 1.3, 1.4 should be able to work with it. Tested on ar7010+ar9280 and ar7010+ar9287. Signed-off-by: Oleksij Rempel li...@rempel-privat.de --- drivers/net/wireless/ath/ath9k/htc.h | 2 ++ drivers/net/wireless/ath/ath9k/htc_drv_init.c | 3 +++ drivers/net/wireless/ath/ath9k/htc_drv_main.c | 4 3 files changed, 9 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index d3b099d..db4a793 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h @@ -142,6 +142,8 @@ struct ath9k_htc_target_aggr { #define WLAN_RC_40_FLAG 0x02 #define WLAN_RC_SGI_FLAG 0x04 #define WLAN_RC_HT_FLAG 0x08 +#define WLAN_RC_TX_STBC_FLAG 0x20 /* TX STBC */ +#define WLAN_RC_RX_STBC_FLAG 0xC0 /* RX STBC ,2 bits */ struct ath9k_htc_rateset { u8 rs_nrates; diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index a47f5e0..c79c5ac 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c @@ -517,6 +517,9 @@ static void setup_ht_cap(struct ath9k_htc_priv *priv, ath_dbg(common, CONFIG, TX streams %d, RX streams: %d\n, tx_streams, rx_streams); + if (tx_streams = 2) + ht_info-cap |= IEEE80211_HT_CAP_TX_STBC; + if (tx_streams != rx_streams) { ht_info-mcs.tx_params |= IEEE80211_HT_MCS_TX_RX_DIFF; ht_info-mcs.tx_params |= ((tx_streams - 1) diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index 0743a47..af08b4a 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c @@ -623,6 +623,10 @@ static void ath9k_htc_setup_rate(struct ath9k_htc_priv *priv, trate-rates.ht_rates.rs_nrates = j; caps = WLAN_RC_HT_FLAG; + if (sta-ht_cap.cap IEEE80211_HT_CAP_RX_STBC) + caps |= WLAN_RC_RX_STBC_FLAG; + if (sta-ht_cap.cap IEEE80211_HT_CAP_TX_STBC) + caps |= WLAN_RC_TX_STBC_FLAG; if (sta-ht_cap.mcs.rx_mask[1]) caps |= WLAN_RC_DS_FLAG; if ((sta-ht_cap.cap IEEE80211_HT_CAP_SUP_WIDTH_20_40) -- 1.8.1.2 ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel
[ath9k-devel] 3.9.0-rc8+ (hacked) splat.
Was running around 200 stations against a VAP on this system, and then changed the channel from 1 to 36 (by restarting hostapd with new config). Looks like null-pointer de-ref... Anyone seen anything similar? [17789.100382] ath: wiphy0: keyreset: keycache entry 228 out of range [17789.107940] ath: wiphy0: keyreset: keycache entry 228 out of range [17789.115530] ath: wiphy0: keyreset: keycache entry 228 out of range [17789.122708] BUG: unable to handle kernel NULL pointer dereference at 03c4 [17789.123477] IP: [f8bbff21] ath_tx_process_buffer+0x121/0xaa0 [ath9k] [17789.123477] *pdpt = 2e017001 *pde = [17789.123477] Oops: [#1] PREEMPT SMP [17789.123477] Modules linked in: iptable_raw xt_CT bridge nf_conntrack_ipv4 nf] [17789.123477] Pid: 15, comm: ksoftirqd/1 Tainted: GWC 3.9.0-rc8+ #18. [17789.123477] EIP: 0060:[f8bbff21] EFLAGS: 00010206 CPU: 1 [17789.123477] EIP is at ath_tx_process_buffer+0x121/0xaa0 [ath9k] [17789.123477] EAX: EBX: f39bbd8c ECX: EDX: 0384 [17789.123477] ESI: f39b1680 EDI: 0390 EBP: f5cebe44 ESP: f5cebd78 [17789.123477] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 [17789.123477] CR0: 8005003b CR2: 03c4 CR3: 30b46000 CR4: 07e0 [17789.123477] DR0: DR1: DR2: DR3: [17789.123477] DR6: 0ff0 DR7: 0400 [17789.123477] Process ksoftirqd/1 (pid: 15, ti=f5cea000 task=f5cb4ce0 task.ti=) [17789.123477] Stack: [17789.123477] f5c01480 f6750ac0 f5cebda4 c0549559 c08c0ddd c08c0ddd f6750ac0 0 [17789.123477] f1756700 f1756700 033c f5cebdb0 c08c0ddd 0001 f5cebdc0 0 [17789.123477] 0384 0003 f39bbd8c 0390 0100be8c 0 [17789.123477] Call Trace: [17789.123477] [c0549559] ? kmem_cache_free+0xe9/0x120 [17789.123477] [c08c0ddd] ? __kfree_skb+0x3d/0x90 [17789.123477] [c08c0ddd] ? __kfree_skb+0x3d/0x90 [17789.123477] [c08c0ddd] ? __kfree_skb+0x3d/0x90 [17789.123477] [f8bc0d2e] ? ath_txq_unlock_complete+0x7e/0x90 [ath9k] [17789.123477] [f8bc0ee1] ath_tx_edma_tasklet+0x1a1/0x2a0 [ath9k] [17789.123477] [f8bbb06f] ath9k_tasklet+0x10f/0x170 [ath9k] [17789.123477] [c04590d3] tasklet_action+0xa3/0xb0 [17789.123477] [c045948a] __do_softirq+0xaa/0x230 [17789.123477] [c09c0b33] ? common_interrupt+0x33/0x38 [17789.123477] [c045963d] run_ksoftirqd+0x2d/0x50 [17789.123477] [c0479f11] smpboot_thread_fn+0x141/0x260 [17789.123477] [c04721a4] kthread+0xa4/0xb0 [17789.123477] [c0479dd0] ? smpboot_park_threads+0x70/0x70 [17789.123477] [c0470303] ? parse_args+0x3/0x460 [17789.123477] [c09c05b7] ret_from_kernel_thread+0x1b/0x28 [17789.123477] [c0472100] ? kthread_freezable_should_stop+0x50/0x50 [17789.123477] Code: 66 81 e2 00 03 66 81 fa 00 03 0f 45 c7 0f b6 00 83 e0 0f 0f [17789.123477] EIP: [f8bbff21] ath_tx_process_buffer+0x121/0xaa0 [ath9k] SS:E8 [17789.123477] CR2: 03c4 [17789.574609] ---[ end trace 7e9b62ed3d3df574 ]--- -- Ben Greear gree...@candelatech.com Candela Technologies Inc http://www.candelatech.com ___ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel