Merge ~ondrak/ubuntu/+source/linux/+git/xenial:wcn36xx-fix into ~ubuntu-kernel/ubuntu/+source/linux/+git/xenial:snapdragon

Proposed by Ondrej Kubik
Status: Needs review
Proposed branch: ~ondrak/ubuntu/+source/linux/+git/xenial:wcn36xx-fix
Merge into: ~ubuntu-kernel/ubuntu/+source/linux/+git/xenial:snapdragon
Diff against target: 87 lines (+13/-5)
3 files modified
drivers/net/wireless/ath/wcn36xx/main.c (+7/-3)
drivers/net/wireless/ath/wcn36xx/smd.c (+4/-2)
drivers/net/wireless/ath/wcn36xx/smd.h (+2/-0)
Reviewer Review Type Date Requested Status
Paolo Pisati (community) Disapprove
Review via email: mp+346751@code.launchpad.net

Commit message

UBUNTU: wcn36xx: pass correct BSS index when deleting BSS keys

BugLink: https://bugs.launchpad.net/vienna/+bug/1772611
BugLink: https://bugs.96boards.org/show_bug.cgi?id=319

Patch link: https://patchwork.kernel.org/patch/10338447/

The firmware message to delete BSS keys expects a BSS index to be passed.
This field is currently hard-coded to 0. Fix this by passing in the index
we received from the firmware when the BSS was configured.

The encryption type in that message also needs to be set to what was used
when the key was set, so the assignment of vif_priv->encrypt_type is now
done after the firmware command was sent. This reportedly fixes the
following error in AP mode:

  wcn36xx: ERROR hal_remove_bsskey response failed err=6

Also, AFAIU, when a BSS is deleted, the firmware apparently drops all the
keys associated with it. Trying to remove the key explicitly afterwards
will hence lead to the following message:

  wcn36xx: ERROR hal_remove_bsskey response failed err=16

This is now suppressed with an extra check for the BSS index validity.

To post a comment you must log in.
Revision history for this message
Paolo Pisati (p-pisati) wrote :

I don't have write access to the kernel repository, only the stable team has it: resend it to the ubuntu kernel ml for review.

review: Disapprove

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index 2d6ccce..c55d6ef 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -501,6 +501,7 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
501 } else {501 } else {
502 wcn36xx_smd_set_bsskey(wcn,502 wcn36xx_smd_set_bsskey(wcn,
503 vif_priv->encrypt_type,503 vif_priv->encrypt_type,
504 vif_priv->bss_index,
504 key_conf->keyidx,505 key_conf->keyidx,
505 key_conf->keylen,506 key_conf->keylen,
506 key);507 key);
@@ -518,10 +519,13 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
518 break;519 break;
519 case DISABLE_KEY:520 case DISABLE_KEY:
520 if (!(IEEE80211_KEY_FLAG_PAIRWISE & key_conf->flags)) {521 if (!(IEEE80211_KEY_FLAG_PAIRWISE & key_conf->flags)) {
522 if (vif_priv->bss_index != WCN36XX_HAL_BSS_INVALID_IDX)
523 wcn36xx_smd_remove_bsskey(wcn,
524 vif_priv->encrypt_type,
525 vif_priv->bss_index,
526 key_conf->keyidx);
527
521 vif_priv->encrypt_type = WCN36XX_HAL_ED_NONE;528 vif_priv->encrypt_type = WCN36XX_HAL_ED_NONE;
522 wcn36xx_smd_remove_bsskey(wcn,
523 vif_priv->encrypt_type,
524 key_conf->keyidx);
525 } else {529 } else {
526 sta_priv->is_data_encrypted = false;530 sta_priv->is_data_encrypted = false;
527 /* do not remove key if disassociated */531 /* do not remove key if disassociated */
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index abeeb36..c42f407 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1560,6 +1560,7 @@ out:
15601560
1561int wcn36xx_smd_set_bsskey(struct wcn36xx *wcn,1561int wcn36xx_smd_set_bsskey(struct wcn36xx *wcn,
1562 enum ani_ed_type enc_type,1562 enum ani_ed_type enc_type,
1563 u8 bssidx,
1563 u8 keyidx,1564 u8 keyidx,
1564 u8 keylen,1565 u8 keylen,
1565 u8 *key)1566 u8 *key)
@@ -1569,7 +1570,7 @@ int wcn36xx_smd_set_bsskey(struct wcn36xx *wcn,
15691570
1570 mutex_lock(&wcn->hal_mutex);1571 mutex_lock(&wcn->hal_mutex);
1571 INIT_HAL_MSG(msg_body, WCN36XX_HAL_SET_BSSKEY_REQ);1572 INIT_HAL_MSG(msg_body, WCN36XX_HAL_SET_BSSKEY_REQ);
1572 msg_body.bss_idx = 0;1573 msg_body.bss_idx = bssidx;
1573 msg_body.enc_type = enc_type;1574 msg_body.enc_type = enc_type;
1574 msg_body.num_keys = 1;1575 msg_body.num_keys = 1;
1575 msg_body.keys[0].id = keyidx;1576 msg_body.keys[0].id = keyidx;
@@ -1630,6 +1631,7 @@ out:
16301631
1631int wcn36xx_smd_remove_bsskey(struct wcn36xx *wcn,1632int wcn36xx_smd_remove_bsskey(struct wcn36xx *wcn,
1632 enum ani_ed_type enc_type,1633 enum ani_ed_type enc_type,
1634 u8 bssidx,
1633 u8 keyidx)1635 u8 keyidx)
1634{1636{
1635 struct wcn36xx_hal_remove_bss_key_req_msg msg_body;1637 struct wcn36xx_hal_remove_bss_key_req_msg msg_body;
@@ -1637,7 +1639,7 @@ int wcn36xx_smd_remove_bsskey(struct wcn36xx *wcn,
16371639
1638 mutex_lock(&wcn->hal_mutex);1640 mutex_lock(&wcn->hal_mutex);
1639 INIT_HAL_MSG(msg_body, WCN36XX_HAL_RMV_BSSKEY_REQ);1641 INIT_HAL_MSG(msg_body, WCN36XX_HAL_RMV_BSSKEY_REQ);
1640 msg_body.bss_idx = 0;1642 msg_body.bss_idx = bssidx;
1641 msg_body.enc_type = enc_type;1643 msg_body.enc_type = enc_type;
1642 msg_body.key_id = keyidx;1644 msg_body.key_id = keyidx;
16431645
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h
index c1b76d7..6302588 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.h
+++ b/drivers/net/wireless/ath/wcn36xx/smd.h
@@ -102,6 +102,7 @@ int wcn36xx_smd_set_stakey(struct wcn36xx *wcn,
102 u8 sta_index);102 u8 sta_index);
103int wcn36xx_smd_set_bsskey(struct wcn36xx *wcn,103int wcn36xx_smd_set_bsskey(struct wcn36xx *wcn,
104 enum ani_ed_type enc_type,104 enum ani_ed_type enc_type,
105 u8 bssidx,
105 u8 keyidx,106 u8 keyidx,
106 u8 keylen,107 u8 keylen,
107 u8 *key);108 u8 *key);
@@ -111,6 +112,7 @@ int wcn36xx_smd_remove_stakey(struct wcn36xx *wcn,
111 u8 sta_index);112 u8 sta_index);
112int wcn36xx_smd_remove_bsskey(struct wcn36xx *wcn,113int wcn36xx_smd_remove_bsskey(struct wcn36xx *wcn,
113 enum ani_ed_type enc_type,114 enum ani_ed_type enc_type,
115 u8 bssidx,
114 u8 keyidx);116 u8 keyidx);
115int wcn36xx_smd_enter_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif);117int wcn36xx_smd_enter_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif);
116int wcn36xx_smd_exit_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif);118int wcn36xx_smd_exit_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif);

Subscribers

People subscribed via source and target branches