ath11k: Add Mesh mode support
cover ath11k: Add Mesh mode support
Hi,
Posting initial patches to bring Mesh support to ath11k. There are known issues which is also captured in first patch.
Known issues:
- Depends on firmware fix to allow other BSS frames
- Failed to complete path negotiation in secured mode
- Target assert while shutting down interface in secured mode
-Rajkumar
Rajkumar Manoharan (3):
ath11k: enable mesh mode
ath11k: allow 4 address transmission for mesh packet
ath11k: remove addition check for PMF
drivers/net/wireless/ath/ath11k/dp_tx.c | 3 +++ drivers/net/wireless/ath/ath11k/mac.c | 19 ++++++++++++++++++- drivers/net/wireless/ath/ath11k/wmi.c | 21 ++++++++++----------- drivers/net/wireless/ath/ath11k/wmi.h | 11 +++++++---- 4 files changed, 38 insertions(+), 16 deletions(-)
Signature · 7 lines
1.9.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 1/3 ath11k: enable mesh mode
Allow Meshpoint configuration from ath11k and advertise MP support to mac80211. Firmware supports mesh type from WLAN.HK.2.1.0.1-00113-QCAHKSWPL_SILICONZ-1 onwards. As of now, only open auth mesh networking is working.
Known issues:
- Depends on firmware fix to allow other BSS frames
- Failed to complete path negotiation in secured mode
- Target assert while shutting down interface in secured mode
--- drivers/net/wireless/ath/ath11k/mac.c | 10 +++++++++- drivers/net/wireless/ath/ath11k/wmi.h | 11 +++++++---- 2 files changed, 16 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +9 -1
@@ -2579,6 +2579,7 @@ static int ath11k_sta_state(struct ieee80211_hw *hw, }else if (old_state ==IEEE80211_STA_AUTH && new_state ==IEEE80211_STA_ASSOC && (vif->type ==NL80211_IFTYPE_AP || + vif->type ==NL80211_IFTYPE_MESH_POINT || vif->type ==NL80211_IFTYPE_ADHOC )) { ret =ath11k_station_assoc (ar, vif, sta, false);if (ret)
@@ -2591,6 +2592,7 @@ static int ath11k_sta_state(struct ieee80211_hw *hw, }else if (old_state ==IEEE80211_STA_ASSOC && new_state ==IEEE80211_STA_AUTH && (vif->type ==NL80211_IFTYPE_AP || + vif->type ==NL80211_IFTYPE_MESH_POINT || vif->type ==NL80211_IFTYPE_ADHOC )) { ret =ath11k_station_disassoc (ar, vif, sta);if (ret)
@@ -3436,6 +3438,8 @@ static int ath11k_add_interface(struct ieee80211_hw *hw,case NL80211_IFTYPE_STATION : arvif->vdev_type =WMI_VDEV_TYPE_STA ;break ; +case NL80211_IFTYPE_MESH_POINT : + arvif->vdev_subtype =WMI_VDEV_SUBTYPE_MESH_11S ;case NL80211_IFTYPE_AP : arvif->vdev_type =WMI_VDEV_TYPE_AP ;break ;
@@ -4702,6 +4706,9 @@ static int ath11k_get_survey(struct ieee80211_hw *hw, int idx, { .max = 16, .types = BIT(NL80211_IFTYPE_AP) +#ifdef CONFIG_MAC80211_MESH + | BIT(NL80211_IFTYPE_MESH_POINT) +#endif }, };
@@ -4820,7 +4827,8 @@ static int ath11k_mac_register(struct ath11k *ar) ar->hw->wiphy->available_antennas_tx = cap->tx_chain_mask; ar->hw->wiphy->interface_modes =BIT (NL80211_IFTYPE_STATION ) | -BIT (NL80211_IFTYPE_AP ); +BIT (NL80211_IFTYPE_AP ) | +BIT (NL80211_IFTYPE_MESH_POINT );ieee80211_hw_set (ar->hw,SIGNAL_DBM );ieee80211_hw_set (ar->hw,SUPPORTS_PS );
drivers/net/wireless/ath/ath11k/wmi.h +7 -4
@@ -4720,10 +4720,13 @@ enum wmi_vdev_type { };enum wmi_vdev_subtype { -WMI_VDEV_SUBTYPE_NONE =0 , -WMI_VDEV_SUBTYPE_P2P_DEVICE =1 , -WMI_VDEV_SUBTYPE_P2P_CLIENT =2 , -WMI_VDEV_SUBTYPE_P2P_GO =3 , +WMI_VDEV_SUBTYPE_NONE , +WMI_VDEV_SUBTYPE_P2P_DEVICE , +WMI_VDEV_SUBTYPE_P2P_CLIENT , +WMI_VDEV_SUBTYPE_P2P_GO , +WMI_VDEV_SUBTYPE_PROXY_STA , +WMI_VDEV_SUBTYPE_MESH_NON_11S , +WMI_VDEV_SUBTYPE_MESH_11S , };enum wmi_sta_powersave_param {
Signature · 7 lines
1.9.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH 1/3] ath11k: enable mesh mode
Quoted 37 lines · Rajkumar Manoharan
Allow Meshpoint configuration from ath11k and advertise MP support to mac80211. Firmware supports mesh type from WLAN.HK.2.1.0.1-00113-QCAHKSWPL_SILICONZ-1 onwards. As of now, only open auth mesh networking is working.
Known issues:
- Depends on firmware fix to allow other BSS frames
- Failed to complete path negotiation in secured mode
- Target assert while shutting down interface in secured modeSigned-off-by Rajkumar Manoharan <[email protected]>--- drivers/net/wireless/ath/ath11k/mac.c | 10 +++++++++- drivers/net/wireless/ath/ath11k/wmi.h | 11 +++++++---- 2 files changed, 16 insertions(+), 5 deletions(-)drivers/net/wireless/ath/ath11k/mac.c +2
-0@@ -2579,6 +2579,7 @@ static int ath11k_sta_state(struct ieee80211_hw *hw, }else if (old_state ==IEEE80211_STA_AUTH && new_state ==IEEE80211_STA_ASSOC && (vif->type ==NL80211_IFTYPE_AP || + vif->type ==NL80211_IFTYPE_MESH_POINT || vif->type ==NL80211_IFTYPE_ADHOC )) { ret =ath11k_station_assoc (ar, vif, sta, false);if (ret)@@ -2591,6 +2592,7 @@ static int ath11k_sta_state(struct ieee80211_hw *hw, }else if (old_state ==IEEE80211_STA_ASSOC && new_state ==IEEE80211_STA_AUTH && (vif->type ==NL80211_IFTYPE_AP || + vif->type ==NL80211_IFTYPE_MESH_POINT || vif->type ==NL80211_IFTYPE_ADHOC )) { ret =ath11k_station_disassoc (ar, vif, sta);if (ret)
drivers/net/wireless/ath/ath11k/mac.c static int ath11k_add_interface(struct ieee80211_hw *hw, · line 3442
Quoted 5 lines
drivers/net/wireless/ath/ath11k/mac.c +2
-0@@ -3436,6 +3438,8 @@ static int ath11k_add_interface(struct ieee80211_hw *hw,case NL80211_IFTYPE_STATION : arvif->vdev_type =WMI_VDEV_TYPE_STA ;break ; +case NL80211_IFTYPE_MESH_POINT : + arvif->vdev_subtype =WMI_VDEV_SUBTYPE_MESH_11S ;
there should be a comment here that the drop is intentional
John
Quoted 35 lines
drivers/net/wireless/ath/ath11k/mac.c +5
-1case NL80211_IFTYPE_AP : arvif->vdev_type =WMI_VDEV_TYPE_AP ;break ;@@ -4702,6 +4706,9 @@ static int ath11k_get_survey(struct ieee80211_hw *hw, int idx, { .max = 16, .types = BIT(NL80211_IFTYPE_AP) +#ifdef CONFIG_MAC80211_MESH + | BIT(NL80211_IFTYPE_MESH_POINT) +#endif }, };@@ -4820,7 +4827,8 @@ static int ath11k_mac_register(struct ath11k *ar) ar->hw->wiphy->available_antennas_tx = cap->tx_chain_mask; ar->hw->wiphy->interface_modes =BIT (NL80211_IFTYPE_STATION ) | -BIT (NL80211_IFTYPE_AP ); +BIT (NL80211_IFTYPE_AP ) | +BIT (NL80211_IFTYPE_MESH_POINT );ieee80211_hw_set (ar->hw,SIGNAL_DBM );ieee80211_hw_set (ar->hw,SUPPORTS_PS );drivers/net/wireless/ath/ath11k/wmi.h +0
-4@@ -4720,10 +4720,13 @@ enum wmi_vdev_type { };enum wmi_vdev_subtype { -WMI_VDEV_SUBTYPE_NONE =0 , -WMI_VDEV_SUBTYPE_P2P_DEVICE =1 , -WMI_VDEV_SUBTYPE_P2P_CLIENT =2 , -WMI_VDEV_SUBTYPE_P2P_GO =3 ,
drivers/net/wireless/ath/ath11k/wmi.h enum wmi_vdev_type { · line 4732
Quoted 10 lines
drivers/net/wireless/ath/ath11k/wmi.h +7
-0+WMI_VDEV_SUBTYPE_NONE , +WMI_VDEV_SUBTYPE_P2P_DEVICE , +WMI_VDEV_SUBTYPE_P2P_CLIENT , +WMI_VDEV_SUBTYPE_P2P_GO , +WMI_VDEV_SUBTYPE_PROXY_STA , +WMI_VDEV_SUBTYPE_MESH_NON_11S , + WMI_VDEV_SUBTYPE_MESH_11S, }; enum wmi_sta_powersave_param {
_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH 1/3] ath11k: enable mesh mode
Quoted 12 lines · John Crispin
drivers/net/wireless/ath/ath11k/mac.c static int ath11k_add_interface(struct · line 3443
Quoted 7 lines · Rajkumar Manoharan
drivers/net/wireless/ath/ath11k/mac.c +2
-0@@ -3436,6 +3438,8 @@ static int ath11k_add_interface(structieee80211_hw *hw, case NL80211_IFTYPE_STATION: arvif->vdev_type = WMI_VDEV_TYPE_STA;break ; +case NL80211_IFTYPE_MESH_POINT : + arvif->vdev_subtype =WMI_VDEV_SUBTYPE_MESH_11S ;there should be a comment here that the drop is intentional
Hmm.. Agree to have fall through comment.
-Rajkumar
_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 2/3 ath11k: allow 4 address transmission for mesh packet
In reply to Rajkumar ManoharanInform the target to use 4 adressses in 802.11 header for mesh data by marking the peer is capable of operating in 4 address format. Also ensure to inform TCL ring that mesh header is pesent in payload. This will be useful for enabling HW checksumming form mesh packets.
--- drivers/net/wireless/ath/ath11k/dp_tx.c | 3 +++ drivers/net/wireless/ath/ath11k/mac.c | 11 +++++++++++ 2 files changed, 14 insertions(+)
drivers/net/wireless/ath/ath11k/dp_tx.c +3 -0
@@ -131,7 +131,10 @@ int ath11k_dp_tx(struct ath11k *ar, struct ath11k_vif *arvif,FIELD_PREP (HAL_TCL_DATA_CMD_INFO1_TCP6_CKSUM_EN ,1 ); } +if (ieee80211_vif_is_mesh (arvif->vif)) + ti.flags1 |=FIELD_PREP (HAL_TCL_DATA_CMD_INFO2_MESH_ENABLE ,1 ); ti.flags1 |=FIELD_PREP (HAL_TCL_DATA_CMD_INFO2_TID_OVERWRITE ,1 ); + ti.tid =ath11k_dp_get_tid (skb);switch (ti.encap_type) {
drivers/net/wireless/ath/ath11k/mac.c +11 -0
@@ -2550,6 +2550,17 @@ static int ath11k_sta_state(struct ieee80211_hw *hw, goto exit; } +if (ieee80211_vif_is_mesh (vif)) { + ret =ath11k_wmi_set_peer_param (ar, sta->addr, + arvif->vdev_id, +WMI_PEER_USE_4ADDR ,1 ); +if (ret) { +ath11k_warn (ar->ab,"failed to STA %pM 4addr capability: %d\n" , + sta->addr, ret); + goto exit; + } + } + ret =ath11k_dp_peer_setup (ar, arvif->vdev_id, sta->addr);if (ret) { ath11k_warn(ar->ab, "failed to setup dp for peer %pM on vdev %i (%d)\n",
Signature · 7 lines
1.9.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH 2/3] ath11k: allow 4 address transmission for mesh packet
Quoted 5 lines · Rajkumar Manoharan
drivers/net/wireless/ath/ath11k/mac.c +0
-0
drivers/net/wireless/ath/ath11k/mac.c static int ath11k_sta_state(struct ieee80211_hw *hw, · line 2559
Quoted 10 lines
drivers/net/wireless/ath/ath11k/mac.c +7
-0@@ -2550,6 +2550,17 @@ static int ath11k_sta_state(struct ieee80211_hw *hw, goto exit; } +if (ieee80211_vif_is_mesh (vif)) { + ret =ath11k_wmi_set_peer_param (ar, sta->addr, + arvif->vdev_id, +WMI_PEER_USE_4ADDR ,1 ); +if (ret) { +ath11k_warn (ar->ab,"failed to STA %pM 4addr capability: %d\n" , + sta->addr, ret);
Hi,
looks like the indentation is bad here
John
_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH 2/3] ath11k: allow 4 address transmission for mesh packet
Quoted 19 lines · John Crispin
Quoted 5 lines · Rajkumar Manoharan
drivers/net/wireless/ath/ath11k/mac.c +0
-0drivers/net/wireless/ath/ath11k/mac.c static int ath11k_sta_state(struct ieee80211_hw · line 2559
Quoted 10 lines
drivers/net/wireless/ath/ath11k/mac.c +6
-0@@ -2550,6 +2550,17 @@ static int ath11k_sta_state(struct ieee80211_hw *hw, goto exit; } + if (ieee80211_vif_is_mesh(vif)) { + ret =ath11k_wmi_set_peer_param (ar, sta->addr, + arvif->vdev_id, +WMI_PEER_USE_4ADDR ,1 ); +if (ret) { +ath11k_warn (ar->ab,"failed to STA %pM 4addr capability: %d\n" , + sta->addr, ret);Hi,
Quoted 2 lines
looks like the indentation is bad here
John,
I don't see the indentation issue from patch and no warning in checkpatch.
-Rajkumar
_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 3/3 ath11k: remove unnecessary check for PMF
In reply to Rajkumar ManoharanFirmware delivers mesh group action frame as encrypted payload. To allow software decryption for these group action frames, rx status should not be marked as RX_FLAG_DECRYPTED and protected bit in frame control should not be cleared. Existing robust management check is enough to handle RX_FLAG_DECRYPTED. Hence removing unnecessary protected frame validation.
--- drivers/net/wireless/ath/ath11k/wmi.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-)
drivers/net/wireless/ath/ath11k/wmi.c +10 -11
@@ -5196,18 +5196,17 @@ void ath11k_mgmt_rx_event(struct ath11k_base *ab, struct sk_buff *skb)*/ status->flag |=RX_FLAG_SKIP_MONITOR ; -if (ieee80211_has_protected (hdr->frame_control)) { -/* In case of PMF, FW delivers decrypted frames -* with Protected Bit set. Don't clear that. -*/ -if (!ieee80211_is_robust_mgmt_frame (skb)) { - status->flag |=RX_FLAG_DECRYPTED ; +/* In case of PMF, FW delivers decrypted frames with Protected Bit set. +* Don't clear that. FW also delivers broadcast management frames +* (ex: group privacy action frames in mesh) as encrypted payload. +*/ +if (!ieee80211_is_robust_mgmt_frame (skb)) { + status->flag |=RX_FLAG_DECRYPTED ; - status->flag |=RX_FLAG_IV_STRIPPED | -RX_FLAG_MMIC_STRIPPED ; - hdr->frame_control =__cpu_to_le16 (fc & - ~IEEE80211_FCTL_PROTECTED ); - } + status->flag |=RX_FLAG_IV_STRIPPED | +RX_FLAG_MMIC_STRIPPED ; + hdr->frame_control =__cpu_to_le16 (fc & + ~IEEE80211_FCTL_PROTECTED ); }/* TODO: Pending handle beacon implementation
Signature · 7 lines
1.9.1 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k