ath10k: Allow setting coverage class
PATCH 1/1 ath10k: Allow setting coverage class
Unfortunately ath10k does not generally allow modifying the coverage class with the stock firmware and Qualcomm has so far refused to implement this feature so that it can be properly supported in ath10k. If we however know the registers that need to be modified for proper operation with a higher coverage class, then we can do these modifications from the driver.
This patch implements this hack for first generation cards which are based on a core that is similar to ath9k. The registers are modified in place and need to be re-written every time the firmware sets them. To achieve this the register status is verified after any event from the firmware.
The coverage class may not be modified temporarily right after the card re-initializes the registers. This is for example the case during scanning.
A warning will be generated if the hack is not supported on the card or unexpected values are hit. There is no error reporting for userspace applications though (this is a limitation in the mac80211 driver interface).
Thanks to Sebastian Gottschall <[email protected]> for initially working on a userspace support for this. This patch wouldn't have been possible without this documentation.
--- drivers/net/wireless/ath/ath10k/core.h | 10 ++ drivers/net/wireless/ath/ath10k/hw.c | 9 ++ drivers/net/wireless/ath/ath10k/hw.h | 28 +++++- drivers/net/wireless/ath/ath10k/mac.c | 10 ++ drivers/net/wireless/ath/ath10k/wmi-ops.h | 17 ++++ drivers/net/wireless/ath/ath10k/wmi.c | 151 ++++++++++++++++++++++++++++++ 6 files changed, 224 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/core.h +10 -0
@@ -935,6 +935,16 @@ struct ath10k {struct ath10k_thermal thermal;struct ath10k_wow wow; +/* protected by data_lock */ +struct { +s16 coverage_class; + +u32 reg_slottime_conf; +u32 reg_slottime_orig; +u32 reg_ack_cts_timeout_conf; +u32 reg_ack_cts_timeout_orig; + } fw_coverage; +/* must be last */ u8 drv_priv[0 ]__aligned(sizeof(void *)) ; };
drivers/net/wireless/ath/ath10k/hw.c +9 -0
@@ -22,6 +22,7 @@ const struct ath10k_hw_regs qca988x_regs = { .rtc_soc_base_address = 0x00004000, .rtc_wmac_base_address = 0x00005000, .soc_core_base_address = 0x00009000, + .wlan_mac_base_address = 0x00020000, .ce_wrapper_base_address = 0x00057000, .ce0_base_address = 0x00057400, .ce1_base_address = 0x00057800,
@@ -48,6 +49,7 @@ const struct ath10k_hw_regs qca6174_regs = { .rtc_soc_base_address = 0x00000800, .rtc_wmac_base_address = 0x00001000, .soc_core_base_address = 0x0003a000, + .wlan_mac_base_address = 0x00020000, .ce_wrapper_base_address = 0x00034000, .ce0_base_address = 0x00034400, .ce1_base_address = 0x00034800,
@@ -74,6 +76,7 @@ const struct ath10k_hw_regs qca99x0_regs = { .rtc_soc_base_address = 0x00080000, .rtc_wmac_base_address = 0x00000000, .soc_core_base_address = 0x00082000, + .wlan_mac_base_address = 0x00030000, .ce_wrapper_base_address = 0x0004d000, .ce0_base_address = 0x0004a000, .ce1_base_address = 0x0004a400,
@@ -109,6 +112,7 @@ const struct ath10k_hw_regs qca99x0_regs = {const struct ath10k_hw_regs qca4019_regs = { .rtc_soc_base_address =0x00080000 , .soc_core_base_address =0x00082000 , + .wlan_mac_base_address =0x00030000 , .ce_wrapper_base_address =0x0004d000 , .ce0_base_address =0x0004a000 , .ce1_base_address =0x0004a400 ,
@@ -139,6 +143,7 @@ const struct ath10k_hw_regs qca4019_regs = { };const struct ath10k_hw_values qca988x_values = { + .mac_core_rev =ATH10K_HW_MAC_CORE_ATH9K , .rtc_state_val_on =3 , .ce_count =8 , .msi_assign_ce_max =7 ,
@@ -148,6 +153,7 @@ const struct ath10k_hw_values qca988x_values = { };const struct ath10k_hw_values qca6174_values = { + .mac_core_rev =ATH10K_HW_MAC_CORE_ATH9K , .rtc_state_val_on =3 , .ce_count =8 , .msi_assign_ce_max =7 ,
@@ -157,6 +163,7 @@ const struct ath10k_hw_values qca6174_values = { };const struct ath10k_hw_values qca99x0_values = { + .mac_core_rev =ATH10K_HW_MAC_CORE_WAVE2 , .rtc_state_val_on =5 , .ce_count =12 , .msi_assign_ce_max =12 ,
@@ -166,6 +173,7 @@ const struct ath10k_hw_values qca99x0_values = { };const struct ath10k_hw_values qca9888_values = { + .mac_core_rev =ATH10K_HW_MAC_CORE_WAVE2 , .rtc_state_val_on =3 , .ce_count =12 , .msi_assign_ce_max =12 ,
@@ -175,6 +183,7 @@ const struct ath10k_hw_values qca9888_values = { };const struct ath10k_hw_values qca4019_values = { + .mac_core_rev =ATH10K_HW_MAC_CORE_WAVE2 , .ce_count =12 , .num_target_ce_config_wlan =10 , .ce_desc_meta_data_mask =0xFFF0 ,
drivers/net/wireless/ath/ath10k/hw.h +27 -1
@@ -230,6 +230,7 @@ struct ath10k_hw_regs {u32 rtc_soc_base_address;u32 rtc_wmac_base_address;u32 soc_core_base_address; +u32 wlan_mac_base_address;u32 ce_wrapper_base_address;u32 ce0_base_address;u32 ce1_base_address;
@@ -257,6 +258,12 @@ extern const struct ath10k_hw_regs qca6174_regs;extern const struct ath10k_hw_regs qca99x0_regs;extern const struct ath10k_hw_regs qca4019_regs; +enum ath10k_hw_mac_core_rev { +ATH10K_HW_MAC_CORE_UNKNOWN =0 , +ATH10K_HW_MAC_CORE_ATH9K , +ATH10K_HW_MAC_CORE_WAVE2 , +}; +struct ath10k_hw_values {u32 rtc_state_val_on;u8 ce_count;
@@ -264,6 +271,7 @@ struct ath10k_hw_values {u8 num_target_ce_config_wlan;u16 ce_desc_meta_data_mask;u8 ce_desc_meta_data_lsb; +enum ath10k_hw_mac_core_rev mac_core_rev; };extern const struct ath10k_hw_values qca988x_values;
@@ -545,7 +553,7 @@ enum ath10k_hw_cc_wraparound_type {#define WLAN_SI_BASE_ADDRESS 0x00010000#define WLAN_GPIO_BASE_ADDRESS 0x00014000#define WLAN_ANALOG_INTF_BASE_ADDRESS 0x0001c000 -#define WLAN_MAC_BASE_ADDRESS 0x00020000 +#define WLAN_MAC_BASE_ADDRESS ar->regs->wlan_mac_base_address#define EFUSE_BASE_ADDRESS 0x00030000#define FPGA_REG_BASE_ADDRESS 0x00039000#define WLAN_UART2_BASE_ADDRESS 0x00054c00
@@ -745,4 +753,22 @@ enum ath10k_hw_cc_wraparound_type {#define RTC_STATE_V_GET (x) (((x) & RTC_STATE_V_MASK) >> RTC_STATE_V_LSB) +/* Register definitions for ath10k cards that include a MAC which is based +* on ATH9k. This ath9k based MAC still has the same or at least similar +* registers. +* These registers are usually managed by the ath10k firmware. However by +* overriding them it is possible to support a few additional features; in this +* case setting the coverage class. +*/ +#define ATH9K_MAC_TIME_OUT 0x8014 +#define ATH9K_MAC_TIME_OUT_MAX 0x00003FFF +#define ATH9K_MAC_TIME_OUT_ACK 0x00003FFF +#define ATH9K_MAC_TIME_OUT_ACK_S 0 +#define ATH9K_MAC_TIME_OUT_CTS 0x3FFF0000 +#define ATH9K_MAC_TIME_OUT_CTS_S 16 + +#define ATH9K_MAC_IFS_SLOT 0x1070 +#define ATH9K_MAC_IFS_SLOT_M 0x0000FFFF +#define ATH9K_MAC_IFS_SLOT_RESV0 0xFFFF0000 +#endif /* _HW_H_ */
drivers/net/wireless/ath/ath10k/mac.c +10 -0
@@ -5372,6 +5372,15 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,mutex_unlock (&ar->conf_mutex); } +static void ath10k_set_coverage_class (struct ieee80211_hw *hw, +s16 value) +{ +struct ath10k *ar = hw->priv; + +if (ath10k_wmi_pdev_set_coverage_class (ar, value) == -EOPNOTSUPP ) +ath10k_warn (ar,"Modification of coverage class is not supported!\n" ); +} +static int ath10k_hw_scan (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_scan_request *hw_req)
@@ -7397,6 +7406,7 @@ static const struct ieee80211_ops ath10k_ops = { .remove_interface = ath10k_remove_interface, .configure_filter = ath10k_configure_filter, .bss_info_changed = ath10k_bss_info_changed, + .set_coverage_class = ath10k_set_coverage_class, .hw_scan = ath10k_hw_scan, .cancel_hw_scan = ath10k_cancel_hw_scan, .set_key = ath10k_set_key,
drivers/net/wireless/ath/ath10k/wmi-ops.h +17 -0
@@ -52,6 +52,8 @@ struct wmi_ops {int (*pull_wow_event)(struct ath10k *ar,struct sk_buff *skb,struct wmi_wow_ev_arg *arg);enum wmi_txbf_conf (*get_txbf_conf_scheme)(struct ath10k *ar); +void (*set_pdev_coverage_class)(struct ath10k *ar, +s16 value);struct sk_buff *(*gen_pdev_suspend)(struct ath10k *ar,u32 suspend_opt);struct sk_buff *(*gen_pdev_resume)(struct ath10k *ar);
@@ -1012,6 +1014,21 @@ ath10k_wmi_pdev_get_temperature(struct ath10k *ar) }static inline int +ath10k_wmi_pdev_set_coverage_class (struct ath10k *ar, +s16 value) +{ +if (!ar->wmi.ops->set_pdev_coverage_class) +return -EOPNOTSUPP ; + +if (value <0 ) + value =0 ; + + ar->wmi.ops->set_pdev_coverage_class (ar, value); + +return 0 ; +} + +static inline int ath10k_wmi_addba_clear_resp (struct ath10k *ar,u32 vdev_id,const u8 *mac) {struct sk_buff *skb;
drivers/net/wireless/ath/ath10k/wmi.c +151 -0
223 lines not on this page · raw message
Signature · 1 line
2.8.1
Quoted 10 lines · Benjamin Berg
Unfortunately ath10k does not generally allow modifying the coverage class with the stock firmware and Qualcomm has so far refused to implement this feature so that it can be properly supported in ath10k. If we however know the registers that need to be modified for proper operation with a higher coverage class, then we can do these modifications from the driver.
This patch implements this hack for first generation cards which are based on a core that is similar to ath9k. The registers are modified in place and need to be re-written every time the firmware sets them. To achieve this the register status is verified after any event from the firmware.
"After any event from firmware" would also need to include HTT events which your patch doesn't consider.
Quoted 7 lines
The coverage class may not be modified temporarily right after the card re-initializes the registers. This is for example the case during scanning.
A warning will be generated if the hack is not supported on the card or unexpected values are hit. There is no error reporting for userspace applications though (this is a limitation in the mac80211 driver interface).
With a recent change in ath10k the ieee80211_ops can be updated in ar->ops so you can NULL-ify .set_coverage_class before registering to mac80211. See how wake_tx_queue() is masked. You could use this to mask it for WAVE2 devices that haven't been verified.
[...]
drivers/net/wireless/ath/ath10k/hw.h extern const struct ath10k_hw_regs qca6174_regs; · line 263
Quoted 7 lines
drivers/net/wireless/ath/ath10k/hw.h +3
-0@@ -257,6 +258,12 @@ extern const struct ath10k_hw_regs qca6174_regs;extern const struct ath10k_hw_regs qca99x0_regs;extern const struct ath10k_hw_regs qca4019_regs; +enum ath10k_hw_mac_core_rev { +ATH10K_HW_MAC_CORE_UNKNOWN =0 , +ATH10K_HW_MAC_CORE_ATH9K ,
WAVE1 would be more appropriate.
Quoted 3 lines
drivers/net/wireless/ath/ath10k/hw.h +3
-0+ ATH10K_HW_MAC_CORE_WAVE2, +}; +
[...]
drivers/net/wireless/ath/ath10k/hw.h enum ath10k_hw_cc_wraparound_type { · line 772
Quoted 10 lines
drivers/net/wireless/ath/ath10k/hw.h +10
-0+#define ATH9K_MAC_TIME_OUT 0x8014 +#define ATH9K_MAC_TIME_OUT_MAX 0x00003FFF +#define ATH9K_MAC_TIME_OUT_ACK 0x00003FFF +#define ATH9K_MAC_TIME_OUT_ACK_S 0 +#define ATH9K_MAC_TIME_OUT_CTS 0x3FFF0000 +#define ATH9K_MAC_TIME_OUT_CTS_S 16 + +#define ATH9K_MAC_IFS_SLOT 0x1070 +#define ATH9K_MAC_IFS_SLOT_M 0x0000FFFF +#define ATH9K_MAC_IFS_SLOT_RESV0 0xFFFF0000
The prefix is wrong. It shouldn't be ATH9K.
Moreover FW refers to these register as PCU_ACK_CTS_TIMEOUT and PCU_GBL_IFS_SLOT.
drivers/net/wireless/ath/ath10k/mac.c static void ath10k_bss_info_changed(struct ieee80211_hw *hw, · line 5376
Quoted 12 lines
(quoted diff) +1
-0+ #endif /* _HW_H_ */drivers/net/wireless/ath/ath10k/mac.c +2
-0@@ -5372,6 +5372,15 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,mutex_unlock (&ar->conf_mutex); } +static void ath10k_set_coverage_class (struct ieee80211_hw *hw, +s16 value)
Wrong function prefix/name. Should be: ath10k_mac_op_set_coverage_class
drivers/net/wireless/ath/ath10k/mac.c static void ath10k_bss_info_changed(struct ieee80211_hw *hw, · line 5381
Quoted 5 lines
drivers/net/wireless/ath/ath10k/mac.c +5
-0+{ +struct ath10k *ar = hw->priv; + +if (ath10k_wmi_pdev_set_coverage_class (ar, value) == -EOPNOTSUPP ) +ath10k_warn (ar,"Modification of coverage class is not supported!\n" );
Warning doesn't match the style used in ath10k. "failed to set coverage class: not supported\n".
[...]
drivers/net/wireless/ath/ath10k/wmi-ops.h struct wmi_ops { · line 56
Quoted 10 lines
drivers/net/wireless/ath/ath10k/wmi-ops.h +2
-0@@ -52,6 +52,8 @@ struct wmi_ops {int (*pull_wow_event)(struct ath10k *ar,struct sk_buff *skb,struct wmi_wow_ev_arg *arg);enum wmi_txbf_conf (*get_txbf_conf_scheme)(struct ath10k *ar); +void (*set_pdev_coverage_class)(struct ath10k *ar, +s16 value);
WMI ops are used to generate and process events and command buffers. These ops are not supposed to have side-effects but "set_pdev_coverage_class" implies it does.
[...]
drivers/net/wireless/ath/ath10k/wmi-ops.h ath10k_wmi_op_pull_peer_kick_ev(struct ath10k *ar, struct sk_buff *skb, · line 3101
Quoted 8 lines
drivers/net/wireless/ath/ath10k/wmi-ops.h +2
-0/* MAIN WMI cmd track */ static struct wmi_cmd_map wmi_cmd_map = {@@ -3096,6 +3097,121 @@ ath10k_wmi_op_pull_peer_kick_ev(struct ath10k *ar, struct sk_buff *skb,return 0 ; } +static void +ath10k_ath9k_set_pdev_coverage_class (struct ath10k *ar,s16 value)
The prefix is wrong. "ath9k" should be used here.
ath10k_wmi_ is appropriate for stuff in wmi.c
[...]
drivers/net/wireless/ath/ath10k/wmi-ops.h ath10k_wmi_op_pull_peer_kick_ev(struct ath10k *ar, struct sk_buff *skb, · line 3105
Quoted 4 lines
drivers/net/wireless/ath/ath10k/wmi-ops.h +4
-0+/* Do some sanity checks on the slottime register. */ +if (unlikely (slottime_reg % counters_freq_mhz)) { +ath10k_warn (ar, +"Not adjusting coverage class timeouts, expected an integer microsecond slot time in HW register\n" );
Wrong message style.
drivers/net/wireless/ath/ath10k/wmi-ops.h ath10k_wmi_op_pull_peer_kick_ev(struct ath10k *ar, struct sk_buff *skb, · line 3114
Quoted 9 lines
drivers/net/wireless/ath/ath10k/wmi-ops.h +9
-0+ + goto store_regs; + } + + slottime = (slottime_reg &ATH9K_MAC_IFS_SLOT_M ) / counters_freq_mhz; +if (unlikely (slottime !=9 && slottime !=20 )) { +ath10k_warn (ar, +"Not adjusting coverage class timeouts, expected a slot time of 9 or 20us in HW register. It is %uus.\n" , + slottime);
Wrong message style.
[...]
drivers/net/wireless/ath/ath10k/wmi-ops.h ath10k_wmi_op_pull_peer_kick_ev(struct ath10k *ar, struct sk_buff *skb, · line 3124
Quoted 10 lines
drivers/net/wireless/ath/ath10k/wmi-ops.h +10
-0+ timeout_reg = (timeout_reg & ~ATH9K_MAC_TIME_OUT_ACK ) | timeout; + +/* Update cts timeout (upper halfword). */ + timeout = (timeout_reg &ATH9K_MAC_TIME_OUT_CTS ) + timeout = timeout >> ATH9K_MAC_TIME_OUT_CTS_S; + timeout +=3 * value * counters_freq_mhz; + timeout =min_t (u32, timeout,ATH9K_MAC_TIME_OUT_MAX ); + timeout = (timeout <<ATH9K_MAC_TIME_OUT_CTS_S ) + timeout = timeout & ATH9K_MAC_TIME_OUT_CTS; + timeout_reg = (timeout_reg & ~ATH9K_MAC_TIME_OUT_CTS ) | timeout;
I would really love to see Jakub's hw register helper macros get merged and used here..
drivers/net/wireless/ath/ath10k/wmi-ops.h ath10k_wmi_op_pull_peer_kick_ev(struct ath10k *ar, struct sk_buff *skb, · line 3127
Quoted 3 lines
drivers/net/wireless/ath/ath10k/wmi-ops.h +3
-0+ +ath10k_hif_write32 (ar,WLAN_MAC_BASE_ADDRESS +0x1070 , slottime_reg); +ath10k_hif_write32 (ar,WLAN_MAC_BASE_ADDRESS +0x8014 , timeout_reg);
So you're defining register offsets and then you're using literal values to address them?..
[...]
drivers/net/wireless/ath/ath10k/wmi-ops.h ath10k_wmi_op_pull_peer_kick_ev(struct ath10k *ar, struct sk_buff *skb, · line 3140
Quoted 13 lines
drivers/net/wireless/ath/ath10k/wmi-ops.h +13
-0+static void +ath10k_wmi_op_set_pdev_coverage_class (struct ath10k *ar,s16 value) +{ +switch (ar->hw_values->mac_core_rev) { +case ATH10K_HW_MAC_CORE_ATH9K : +ath10k_ath9k_set_pdev_coverage_class (ar, value); +break ; +default : +if (value !=-1 ) +ath10k_warn (ar,"Setting the coverage class is not supported for this chipset." ); +break ; + } +}
This is wrong in general. You aren't using WMI to submit coverage class configuration so it doesn't belong here (wmi.c and wmi-ops). You're poking HW registers directly actually.
The logic should be placed in mac.c and hw.c and abstracted away through hw_ops which are defined/populated per-hw in pci.c. Vasanth recently worked on something similar for rx descriptor handling (ar->hw_rx_desc_ops). I think it should be generalized to hw_ops and you should add the coverage-class stuff on top of that.
Michał
kbuild test robot
build botreproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree…
Hi,
[auto build test ERROR on ath6kl/ath-next]
[also build test ERROR on next-20160727]
[cannot apply to v4.7]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Benjamin-Berg/ath10k-Allow-setting-coverage-class/20160727-163809 base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next config: sparc64-allyesconfig (attached as .config) compiler: sparc64-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=sparc64
All errors (new ones prefixed by >>):
drivers/net/wireless/ath/ath10k/wmi.c: In function 'ath10k_ath9k_set_pdev_coverage_class':
>> drivers/net/wireless/ath/ath10k/wmi.c:3176:2: error: expected ';' before 'timeout'
timeout = timeout & ATH9K_MAC_TIME_OUT_ACK;
^
drivers/net/wireless/ath/ath10k/wmi.c:3181:2: error: expected ';' before 'timeout'
timeout = timeout >> ATH9K_MAC_TIME_OUT_CTS_S;
^
drivers/net/wireless/ath/ath10k/wmi.c:3185:2: error: expected ';' before 'timeout'
timeout = timeout & ATH9K_MAC_TIME_OUT_CTS;
^vim +3176 drivers/net/wireless/ath/ath10k/wmi.c
3170 /* Update ack timeout (lower halfword). */
3171 timeout = (timeout_reg & ATH9K_MAC_TIME_OUT_ACK);
3172 timeout = timeout >> ATH9K_MAC_TIME_OUT_ACK_S;
3173 timeout += 3 * value * counters_freq_mhz;
3174 timeout = min_t(u32, timeout, ATH9K_MAC_TIME_OUT_MAX);
3175 timeout = (timeout << ATH9K_MAC_TIME_OUT_ACK_S)
> 3176 timeout = timeout & ATH9K_MAC_TIME_OUT_ACK;
3177 timeout_reg = (timeout_reg & ~ATH9K_MAC_TIME_OUT_ACK) | timeout;
3178
3179 /* Update cts timeout (upper halfword). */
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Quoted 14 lines · Benjamin Berg
Unfortunately ath10k does not generally allow modifying the coverage class with the stock firmware and Qualcomm has so far refused to implement this feature so that it can be properly supported in ath10k. If we however know the registers that need to be modified for proper operation with a higher coverage class, then we can do these modifications from the driver.
This patch implements this hack for first generation cards which are based on a core that is similar to ath9k. The registers are modified in place and need to be re-written every time the firmware sets them. To achieve this the register status is verified after any event from the firmware.
The coverage class may not be modified temporarily right after the card re-initializes the registers. This is for example the case during scanning.
Quoted 8 lines
A warning will be generated if the hack is not supported on the card or unexpected values are hit. There is no error reporting for userspace applications though (this is a limitation in the mac80211 driver interface).
Thanks to Sebastian Gottschall <[email protected]> for initially working on a userspace support for this. This patch wouldn't have been possible without this documentation.
I would be concerned about the various resets firmware does to work around hardware hangs as well. I don't think any events are generated for these, unless you count the dbglog messages?
Thanks,
Ben
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
Quoted 21 lines · Ben Greear
Quoted 20 lines · Benjamin Berg
Unfortunately ath10k does not generally allow modifying the coverage class with the stock firmware and Qualcomm has so far refused to implement this feature so that it can be properly supported in ath10k. If we however know the registers that need to be modified for proper operation with a higher coverage class, then we can do these modifications from the driver.
This patch implements this hack for first generation cards which are based on a core that is similar to ath9k. The registers are modified in place and need to be re-written every time the firmware sets them. To achieve this the register status is verified after any event from the firmware.
The coverage class may not be modified temporarily right after the card re-initializes the registers. This is for example the case during scanning.
A warning will be generated if the hack is not supported on the card or unexpected values are hit. There is no error reporting for userspace applications though (this is a limitation in the mac80211 driver interface).
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Thanks to Sebastian Gottschall <[email protected]> for initially
working on a userspace support for this. This patch wouldn't have been possible without this documentation.
I would be concerned about the various resets firmware does to work around hardware hangs as well. I don't think any events are generated for these, unless you count the dbglog messages?
Yeah, I am aware of the fact that the firmware may do internal resets from time to time. The interesting question (and one for which I do not know the answer) is whether we get a wmi or other event under all conditions where the register may be rewritten due to a reset.
The current code will re-set the register value after any wmi event including debug messages. If this is not enough, then the only solution might be to periodically poll the register values instead of relying on a received event.
Benjamin
Quoted 35 lines · Benjamin Berg
Quoted 21 lines · Ben Greear
Quoted 20 lines · Benjamin Berg
Unfortunately ath10k does not generally allow modifying the coverage class with the stock firmware and Qualcomm has so far refused to implement this feature so that it can be properly supported in ath10k. If we however know the registers that need to be modified for proper operation with a higher coverage class, then we can do these modifications from the driver.
This patch implements this hack for first generation cards which are based on a core that is similar to ath9k. The registers are modified in place and need to be re-written every time the firmware sets them. To achieve this the register status is verified after any event from the firmware.
The coverage class may not be modified temporarily right after the card re-initializes the registers. This is for example the case during scanning.
A warning will be generated if the hack is not supported on the card or unexpected values are hit. There is no error reporting for userspace applications though (this is a limitation in the mac80211 driver interface).
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Thanks to Sebastian Gottschall <[email protected]> for initially
working on a userspace support for this. This patch wouldn't have been possible without this documentation.
I would be concerned about the various resets firmware does to work around hardware hangs as well. I don't think any events are generated for these, unless you count the dbglog messages?
Yeah, I am aware of the fact that the firmware may do internal resets from time to time. The interesting question (and one for which I do not know the answer) is whether we get a wmi or other event under all conditions where the register may be rewritten due to a reset.
Quoted 4 lines
The current code will re-set the register value after any wmi event including debug messages. If this is not enough, then the only solution might be to periodically poll the register values instead of relying on a received event.
You will get a dbglog event at least most of the time, so maybe that will be good enough.
Someone with src code and that cared could audit the code I guess, but then that person could also just implement the feature properly in the firmware to begin with...
Thanks,
Ben
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
if these sourcecodes would be just up to date with the binaries provided by qca. but qca doesnt seem to care that much about it. this is mainly also the reason why there are soo many long term stability issues with no resolution
Am 29.07.2016 um 17:09 schrieb Ben Greear:
Quoted 51 lines · Benjamin Berg
Quoted 35 lines · Ben Greear
Quoted 21 lines · Benjamin Berg
Quoted 20 lines
Unfortunately ath10k does not generally allow modifying the coverage class with the stock firmware and Qualcomm has so far refused to implement this feature so that it can be properly supported in ath10k. If we however know the registers that need to be modified for proper operation with a higher coverage class, then we can do these modifications from the driver.
This patch implements this hack for first generation cards which are based on a core that is similar to ath9k. The registers are modified in place and need to be re-written every time the firmware sets them. To achieve this the register status is verified after any event from the firmware.
The coverage class may not be modified temporarily right after the card re-initializes the registers. This is for example the case during scanning.
A warning will be generated if the hack is not supported on the card or unexpected values are hit. There is no error reporting for userspace applications though (this is a limitation in the mac80211 driver interface).
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Thanks to Sebastian Gottschall <[email protected]> for initially
working on a userspace support for this. This patch wouldn't have been possible without this documentation.
I would be concerned about the various resets firmware does to work around hardware hangs as well. I don't think any events are generated for these, unless you count the dbglog messages?
Yeah, I am aware of the fact that the firmware may do internal resets from time to time. The interesting question (and one for which I do not know the answer) is whether we get a wmi or other event under all conditions where the register may be rewritten due to a reset.
Quoted 4 lines
The current code will re-set the register value after any wmi event including debug messages. If this is not enough, then the only solution might be to periodically poll the register values instead of relying on a received event.
You will get a dbglog event at least most of the time, so maybe that will be good enough.
Someone with src code and that cared could audit the code I guess, but then that person could also just implement the feature properly in the firmware to begin with...
Thanks,
Ben
Signature · 11 lines
Mit freundlichen Grüssen / Regards Sebastian Gottschall / CTO NewMedia-NET GmbH - DD-WRT Firmensitz: Berliner Ring 101, 64625 Bensheim Registergericht: Amtsgericht Darmstadt, HRB 25473 Geschäftsführer: Peter Steinhäuser, Christian Scheele http://www.dd-wrt.com email: [email protected] Tel.: +496251-582650 / Fax: +496251-5826565
Quoted 1 line · Ben Greear
On 07/29/2016 07:52 AM, Benjamin Berg wrote:
[...]
Quoted 5 lines
Quoted 5 lines
Yeah, I am aware of the fact that the firmware may do internal resets from time to time. The interesting question (and one for which I do not know the answer) is whether we get a wmi or other event under all conditions where the register may be rewritten due to a reset.
Quoted 7 lines
Quoted 4 lines
The current code will re-set the register value after any wmi event including debug messages. If this is not enough, then the only solution might be to periodically poll the register values instead of relying on a received event.
You will get a dbglog event at least most of the time, so maybe that will be good enough.
But you need to remember you need to enable dbglog first to get these events. I guess when coverage class is set the driver could, internally, override dbglog mask so that these events are guaranteed to be reported for the purpose of properly refreshing registers on channel programming.
At that point I guess the update hook could be just placed in dbglog handler alone instead of all over wmi_rx variants.
Michał