ath10k: Support 32 stations.
PATCH 1/2 ath10k: Support 32 stations.
From: Ben Greear <[email protected]>
Implement 64-bit vdev map to support larger numbers of virtual devices. Support up to 32 stations (actual limit will be determined when loading firmware, as different firmwares have different limits)
Enable larger limits when using Candela Technologies firmware.
--- drivers/net/wireless/ath/ath10k/core.c | 8 +++- drivers/net/wireless/ath/ath10k/core.h | 5 ++- drivers/net/wireless/ath/ath10k/hw.h | 6 +++ drivers/net/wireless/ath/ath10k/mac.c | 68 +++++++++++++++++++++++++++------- drivers/net/wireless/ath/ath10k/wmi.c | 23 +++++++++--- 5 files changed, 90 insertions(+), 20 deletions(-)
drivers/net/wireless/ath/ath10k/core.c +7 -1
@@ -833,7 +833,13 @@ int ath10k_core_start(struct ath10k *ar)if (status) goto err_disconnect_htc; - ar->free_vdev_map = (1 <<TARGET_NUM_VDEVS ) -1 ; +if (test_bit (ATH10K_FW_FEATURE_WMI_10X_CT , ar->fw_features)) + ar->free_vdev_map = (1LL <<TARGET_10X_NUM_VDEVS_CT ) -1 ; +else if (test_bit (ATH10K_FW_FEATURE_WMI_10X , ar->fw_features)) + ar->free_vdev_map = (1LL <<TARGET_10X_NUM_VDEVS ) -1 ; +else + ar->free_vdev_map = (1LL <<TARGET_NUM_VDEVS ) -1 ; +INIT_LIST_HEAD (&ar->arvifs);if (!test_bit (ATH10K_FLAG_FIRST_BOOT_DONE , &ar->dev_flags))
drivers/net/wireless/ath/ath10k/core.h +4 -1
@@ -314,6 +314,9 @@ enum ath10k_fw_features {/* Firmware does not support P2P */ ATH10K_FW_FEATURE_NO_P2P =3 , +/* Firmware from Candela Technologies, enables more VIFs, etc */ +ATH10K_FW_FEATURE_WMI_10X_CT =4 , +/* keep last */ ATH10K_FW_FEATURE_COUNT, };
@@ -412,7 +415,7 @@ struct ath10k {/* valid during scan; needed for mgmt rx during scan */ struct ieee80211_channel *scan_channel; -int free_vdev_map; +unsigned long long free_vdev_map;int monitor_vdev_id;bool monitor_enabled;bool monitor_present;
drivers/net/wireless/ath/ath10k/hw.h +6 -0
@@ -116,6 +116,12 @@ enum ath10k_mcast2ucast_mode {#define TARGET_10X_AST_SKID_LIMIT 16#define TARGET_10X_NUM_PEERS (128 + (TARGET_10X_NUM_VDEVS))#define TARGET_10X_NUM_PEERS_MAX 128 + +/* Over-rides for Candela Technologies firmware */ +#define TARGET_10X_NUM_VDEVS_CT 32 +#define TARGET_10X_NUM_PEERS_CT (32 + (TARGET_10X_NUM_VDEVS_CT)) +#define TARGET_10X_AST_SKID_LIMIT_CT (TARGET_10X_NUM_PEERS_CT * TARGET_10X_NUM_PEER_AST) +#define TARGET_10X_NUM_OFFLOAD_PEERS 0#define TARGET_10X_NUM_OFFLOAD_REORDER_BUFS 0#define TARGET_10X_NUM_PEER_KEYS 2
drivers/net/wireless/ath/ath10k/mac.c +55 -13
143 lines not on this page · raw message
drivers/net/wireless/ath/ath10k/wmi.c +18 -5
@@ -1928,6 +1928,13 @@ static void ath10k_wmi_10x_service_ready_event_rx(struct ath10k *ar,u32 num_units, req_id, unit_size, num_mem_reqs, num_unit_info, i;int ret;struct wmi_service_ready_event_10x *ev = (void *)skb->data; +int my_num_peers =TARGET_10X_NUM_PEERS ; +int my_num_vdevs =TARGET_10X_NUM_VDEVS ; + +if (test_bit (ATH10K_FW_FEATURE_WMI_10X_CT , ar->fw_features)) { + my_num_peers =TARGET_10X_NUM_PEERS_CT ; + my_num_vdevs =TARGET_10X_NUM_VDEVS_CT ; + }if (skb->len <sizeof (*ev)) { ath10k_warn("Service ready event was %d B but expected %zu B. Wrong firmware version?\n",
@@ -1990,9 +1997,9 @@ static void ath10k_wmi_10x_service_ready_event_rx(struct ath10k *ar,* peers, 1 extra for self peer on target */ /* this needs to be tied, host and target * can get out of sync */ - num_units =TARGET_10X_NUM_PEERS +1 ; + num_units = my_num_peers +1 ; else if (num_unit_info & NUM_UNITS_IS_NUM_VDEVS) - num_units =TARGET_10X_NUM_VDEVS +1 ; + num_units = my_num_vdevs +1 ; ath10k_dbg(ATH10K_DBG_WMI, "wmi mem_req_id %d num_units %d num_unit_info %d unit size %d actual units %d\n",
@@ -2562,11 +2569,17 @@ static int ath10k_wmi_10x_cmd_init(struct ath10k *ar)u32 len, val;int i; - config.num_vdevs =__cpu_to_le32 (TARGET_10X_NUM_VDEVS ); - config.num_peers =__cpu_to_le32 (TARGET_10X_NUM_PEERS ); +if (test_bit (ATH10K_FW_FEATURE_WMI_10X_CT , ar->fw_features)) { + config.num_vdevs =__cpu_to_le32 (TARGET_10X_NUM_VDEVS_CT ); + config.num_peers =__cpu_to_le32 (TARGET_10X_NUM_PEERS_CT ); + config.ast_skid_limit =__cpu_to_le32 (TARGET_10X_AST_SKID_LIMIT_CT ); + }else { + config.num_vdevs =__cpu_to_le32 (TARGET_10X_NUM_VDEVS ); + config.num_peers =__cpu_to_le32 (TARGET_10X_NUM_PEERS ); + config.ast_skid_limit =__cpu_to_le32 (TARGET_10X_AST_SKID_LIMIT ); + } config.num_peer_keys =__cpu_to_le32 (TARGET_10X_NUM_PEER_KEYS ); config.num_tids =__cpu_to_le32 (TARGET_10X_NUM_TIDS ); - config.ast_skid_limit =__cpu_to_le32 (TARGET_10X_AST_SKID_LIMIT ); config.tx_chain_mask =__cpu_to_le32 (TARGET_10X_TX_CHAIN_MASK ); config.rx_chain_mask =__cpu_to_le32 (TARGET_10X_RX_CHAIN_MASK ); config.rx_timeout_pri_vo =__cpu_to_le32 (TARGET_10X_RX_TIMEOUT_LO_PRI );
Signature · 7 lines
1.7.11.7 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
PATCH 2/2 ath10k: Support rx-software-crypt mode.
From: Ben Greear <[email protected]>
With appropriate firmware (probably only CT firmware at this time) this allows enabling rx-software-crypt mode. This tells the firmware to not decrypt any packets received, but do encrypt (as needed) any packets on transmit. This is implemented to get around hardware issues that preclude using two stations to connect to the same AP while using encryption.
--- drivers/net/wireless/ath/ath10k/htt_rx.c | 39 ++++++++++++++++++++++++++++---- drivers/net/wireless/ath/ath10k/mac.c | 12 ++++++++++ drivers/net/wireless/ath/ath10k/mac.h | 2 ++ drivers/net/wireless/ath/ath10k/txrx.c | 13 +++++++---- drivers/net/wireless/ath/ath10k/wmi.c | 9 +++++++- drivers/net/wireless/ath/ath10k/wmi.h | 15 ++++++++++++ 6 files changed, 80 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +35 -4
@@ -21,6 +21,7 @@#include "txrx.h" #include "debug.h" #include "trace.h" +#include "mac.h" #include <linux/log2.h>
@@ -954,12 +955,42 @@ static void ath10k_htt_rx_handler(struct ath10k_htt *htt,if (status !=HTT_RX_IND_MPDU_STATUS_OK && status !=HTT_RX_IND_MPDU_STATUS_TKIP_MIC_ERR && !htt->ar->monitor_enabled) { -ath10k_dbg (ATH10K_DBG_HTT , -"htt rx ignoring frame w/ status %d\n" , - status); +if (status ==HTT_RX_IND_MPDU_STATUS_ERR_DUP ) { +/* Saw this during some attempts at +* having multiple stations connected +* to same AP. The CT firmware should +* fix this. +*/ +ath10k_dbg (ATH10K_DBG_HTT , +"htt rx: status DUP\n" ); + }else if (status ==HTT_RX_IND_MPDU_STATUS_ERR_INV_PEER ) { +/* This often happens when in nohwcrypt mode, +* ignore. +*/ +if (ath10k_modparam_nohwcrypt) + goto continue_on; +ath10k_dbg (ATH10K_DBG_HTT , +"htt rx: status INVALID_PEER\n" ); + }else if (status ==HTT_RX_IND_MPDU_STATUS_ERR_FCS ) { +/* This is seen when using sw-rx-crypt +* (CT firmware only, other firmware +* will not do sw-rx-crypt at all)) +* Ignore this if we are in rx-sw-crypt +* mode. +*/ +if (ath10k_modparam_nohwcrypt) + goto continue_on; +ath10k_dbg (ATH10K_DBG_HTT , +"htt rx: status ERR_FCS\n" ); + }else { +ath10k_dbg (ATH10K_DBG_HTT , +"htt rx ignoring frame w/ status %d\n" , + status); + }ath10k_htt_rx_free_msdu_chain (msdu_head);continue ; } +continue_on:if (test_bit (ATH10K_CAC_RUNNING , &htt->ar->dev_flags)) {ath10k_warn ("htt rx: CAC running\n" );
@@ -979,7 +1010,7 @@ static void ath10k_htt_rx_handler(struct ath10k_htt *htt, info.fcs_err =ath10k_htt_rx_has_fcs_err (msdu_head); info.mic_err =ath10k_htt_rx_has_mic_err (msdu_head); -if (info.fcs_err) +if (info.fcs_err && !ath10k_modparam_nohwcrypt)ath10k_warn ("htt rx has FCS err\n" );if (info.mic_err)
drivers/net/wireless/ath/ath10k/mac.c +12 -0
@@ -19,6 +19,7 @@#include <net/mac80211.h> #include <linux/etherdevice.h> +#include <linux/module.h> #include "hif.h" #include "core.h"
@@ -27,6 +28,13 @@#include "htt.h" #include "txrx.h" +/* 0: Full hardware crypt +* 1: Tx hardware crypt, but expect rx software crypt (use native wifi tx type) +*/ +int ath10k_modparam_nohwcrypt; +module_param_named (nohwcrypt, ath10k_modparam_nohwcrypt, int,0444 ); +MODULE_PARM_DESC (nohwcrypt,"Disable hardware rx decrypt feature" ); +/**********/ /* Crypto */ /**********/
@@ -77,6 +85,8 @@ static int ath10k_send_key(struct ath10k_vif *arvif,if (cmd ==DISABLE_KEY ) { arg.key_cipher =WMI_CIPHER_NONE ; arg.key_data =NULL ; + }else if (ath10k_modparam_nohwcrypt) { + key->flags |=IEEE80211_KEY_FLAG_SW_RX_CRYPT ; }return ath10k_wmi_vdev_install_key (arvif->ar, &arg);
@@ -2792,6 +2802,8 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,mutex_lock (&ar->conf_mutex); + key->flags &= ~IEEE80211_KEY_FLAG_SW_RX_CRYPT ; +if (sta) peer_addr = sta->addr;else if (arvif->vdev_type ==WMI_VDEV_TYPE_STA )
drivers/net/wireless/ath/ath10k/mac.h +2 -0
@@ -21,6 +21,8 @@#include <net/mac80211.h> #include "core.h" +extern int ath10k_modparam_nohwcrypt; +struct ath10k_generic_iter {struct ath10k *ar;int ret;
drivers/net/wireless/ath/ath10k/txrx.c +8 -5
@@ -224,11 +224,14 @@ void ath10k_process_rx(struct ath10k *ar, struct htt_rx_info *info)memset (status,0 ,sizeof (*status));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 (!ath10k_modparam_nohwcrypt) { + 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->mic_err)
drivers/net/wireless/ath/ath10k/wmi.c +8 -1
@@ -2586,7 +2586,14 @@ static int ath10k_wmi_10x_cmd_init(struct ath10k *ar) config.rx_timeout_pri_vi =__cpu_to_le32 (TARGET_10X_RX_TIMEOUT_LO_PRI ); config.rx_timeout_pri_be =__cpu_to_le32 (TARGET_10X_RX_TIMEOUT_LO_PRI ); config.rx_timeout_pri_bk =__cpu_to_le32 (TARGET_10X_RX_TIMEOUT_HI_PRI ); - config.rx_decap_mode =__cpu_to_le32 (TARGET_10X_RX_DECAP_MODE ); +if (ath10k_modparam_nohwcrypt) +/* This will disable rx decryption in hardware, enable raw +* rx mode, and native-wifi tx mode. Requires 'CT' firmware. +*/ + config.rx_decap_mode =__cpu_to_le32 (ATH10K_HW_TXRX_RAW | + ATH10k_USE_SW_RX_CRYPT); +else + config.rx_decap_mode =__cpu_to_le32 (TARGET_10X_RX_DECAP_MODE ); config.scan_max_pending_reqs =__cpu_to_le32 (TARGET_10X_SCAN_MAX_PENDING_REQS );
drivers/net/wireless/ath/ath10k/wmi.h +15 -0
@@ -1447,7 +1447,22 @@ struct wmi_resource_config_10x {* MAC can decap to RAW (no decap), native wifi or Ethernet types * THis setting also determines the default TX behavior, however TX * behavior can be modified on a per VAP basis during VAP init +* +* NOTE: Stealing some of this field for flags, only usable when +* running "CT" firmware. +* first byte: rx_decap_mode +* second byte: reserved +*/ +#define ATH10K_RX_DECAP_MODE_MASK 0xff +/* Use software rx crypt. This disables rx checksumming +* and may turn off some firmware/hardware optimizations for +* normal use case. BUT, it does allow us to run multiple +* stations connected to the same AP. This flag causes +* rx encapsulation to be 'raw', and tx mode to be native-wifi. +* You should probably not enable this unless you need to +* connect multiple stations to same AP. */ +#define ATH10k_USE_SW_RX_CRYPT 0x10000__le32 rx_decap_mode;/* what is the maximum scan requests than can be queued */
Signature · 7 lines
1.7.11.7 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Re: [PATCH 2/2] ath10k: Support rx-software-crypt mode.
Quoted 9 lines · On 01/22/2014 04:41 PM, [email protected] wrote:
From: Ben Greear <[email protected]>
With appropriate firmware (probably only CT firmware at this time) this allows enabling rx-software-crypt mode. This tells the firmware to not decrypt any packets received, but do encrypt (as needed) any packets on transmit. This is implemented to get around hardware issues that preclude using two stations to connect to the same AP while using encryption.
I should mention: This depends on a mac80211 patch I sent to the linux-wireless mailing list. It defines and uses the key flag used below...
Thanks,
Ben
Quoted 21 lines
/**********/
/* Crypto */
/**********/drivers/net/wireless/ath/ath10k/mac.c +4
-0@@ -77,6 +85,8 @@ static int ath10k_send_key(struct ath10k_vif *arvif,if (cmd ==DISABLE_KEY ) { arg.key_cipher =WMI_CIPHER_NONE ; arg.key_data =NULL ; + }else if (ath10k_modparam_nohwcrypt) { + key->flags |=IEEE80211_KEY_FLAG_SW_RX_CRYPT ; }return ath10k_wmi_vdev_install_key (arvif->ar, &arg);@@ -2792,6 +2802,8 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,mutex_lock (&ar->conf_mutex); + key->flags &= ~IEEE80211_KEY_FLAG_SW_RX_CRYPT ; +if (sta) peer_addr = sta->addr;else if (arvif->vdev_type ==WMI_VDEV_TYPE_STA )
Signature · 8 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Quoted 11 lines · [email protected] writes:
From: Ben Greear <[email protected]>
Implement 64-bit vdev map to support larger numbers of virtual devices. Support up to 32 stations (actual limit will be determined when loading firmware, as different firmwares have different limits)
Enable larger limits when using Candela Technologies firmware.
Signed-off-by Ben Greear <[email protected]>
We are currently maintaining two different firmware branches which adds extra effort to the developers. To be honest I'm not exactly thrilled to start supporting a third one. Can't you maintain these out-of-tree, at least for the time being?
Signature · 6 lines
Kalle Valo _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k