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

Proposed by Ondrej Kubik on 2018-05-23
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 2018-05-23 Disapprove on 2018-05-24
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.
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

Update scan failed

At least one of the branches involved have failed to scan. You can manually schedule a rescan if required.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
2index 2d6ccce..c55d6ef 100644
3--- a/drivers/net/wireless/ath/wcn36xx/main.c
4+++ b/drivers/net/wireless/ath/wcn36xx/main.c
5@@ -501,6 +501,7 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
6 } else {
7 wcn36xx_smd_set_bsskey(wcn,
8 vif_priv->encrypt_type,
9+ vif_priv->bss_index,
10 key_conf->keyidx,
11 key_conf->keylen,
12 key);
13@@ -518,10 +519,13 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
14 break;
15 case DISABLE_KEY:
16 if (!(IEEE80211_KEY_FLAG_PAIRWISE & key_conf->flags)) {
17+ if (vif_priv->bss_index != WCN36XX_HAL_BSS_INVALID_IDX)
18+ wcn36xx_smd_remove_bsskey(wcn,
19+ vif_priv->encrypt_type,
20+ vif_priv->bss_index,
21+ key_conf->keyidx);
22+
23 vif_priv->encrypt_type = WCN36XX_HAL_ED_NONE;
24- wcn36xx_smd_remove_bsskey(wcn,
25- vif_priv->encrypt_type,
26- key_conf->keyidx);
27 } else {
28 sta_priv->is_data_encrypted = false;
29 /* do not remove key if disassociated */
30diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
31index abeeb36..c42f407 100644
32--- a/drivers/net/wireless/ath/wcn36xx/smd.c
33+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
34@@ -1560,6 +1560,7 @@ out:
35
36 int wcn36xx_smd_set_bsskey(struct wcn36xx *wcn,
37 enum ani_ed_type enc_type,
38+ u8 bssidx,
39 u8 keyidx,
40 u8 keylen,
41 u8 *key)
42@@ -1569,7 +1570,7 @@ int wcn36xx_smd_set_bsskey(struct wcn36xx *wcn,
43
44 mutex_lock(&wcn->hal_mutex);
45 INIT_HAL_MSG(msg_body, WCN36XX_HAL_SET_BSSKEY_REQ);
46- msg_body.bss_idx = 0;
47+ msg_body.bss_idx = bssidx;
48 msg_body.enc_type = enc_type;
49 msg_body.num_keys = 1;
50 msg_body.keys[0].id = keyidx;
51@@ -1630,6 +1631,7 @@ out:
52
53 int wcn36xx_smd_remove_bsskey(struct wcn36xx *wcn,
54 enum ani_ed_type enc_type,
55+ u8 bssidx,
56 u8 keyidx)
57 {
58 struct wcn36xx_hal_remove_bss_key_req_msg msg_body;
59@@ -1637,7 +1639,7 @@ int wcn36xx_smd_remove_bsskey(struct wcn36xx *wcn,
60
61 mutex_lock(&wcn->hal_mutex);
62 INIT_HAL_MSG(msg_body, WCN36XX_HAL_RMV_BSSKEY_REQ);
63- msg_body.bss_idx = 0;
64+ msg_body.bss_idx = bssidx;
65 msg_body.enc_type = enc_type;
66 msg_body.key_id = keyidx;
67
68diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h
69index c1b76d7..6302588 100644
70--- a/drivers/net/wireless/ath/wcn36xx/smd.h
71+++ b/drivers/net/wireless/ath/wcn36xx/smd.h
72@@ -102,6 +102,7 @@ int wcn36xx_smd_set_stakey(struct wcn36xx *wcn,
73 u8 sta_index);
74 int wcn36xx_smd_set_bsskey(struct wcn36xx *wcn,
75 enum ani_ed_type enc_type,
76+ u8 bssidx,
77 u8 keyidx,
78 u8 keylen,
79 u8 *key);
80@@ -111,6 +112,7 @@ int wcn36xx_smd_remove_stakey(struct wcn36xx *wcn,
81 u8 sta_index);
82 int wcn36xx_smd_remove_bsskey(struct wcn36xx *wcn,
83 enum ani_ed_type enc_type,
84+ u8 bssidx,
85 u8 keyidx);
86 int wcn36xx_smd_enter_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif);
87 int wcn36xx_smd_exit_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif);

Subscribers

People subscribed via source and target branches