summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Kwaczynski <marek.kwaczynski@tieto.com>2012-02-29 15:14:50 +0100
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:06:42 +0200
commit561cefca24c66af926b3aa5be69ab99c10e9dfac (patch)
treeea4b4e1927a55539b692d53daaa470e638154933
parentc1024b0d885d5e0a1eb10c2b761d39a7def13e76 (diff)
cw1200: Added handling Protected Mgmt Policy
Protected Mgmnt Policy is needed to disable encryption for authentication frames by the firmware. ST-Ericsson ID: 364367 ST-Ericsson FOSS-OUT ID: NA Change-Id: Icd34af6ff9cc06866d25a7870125fb2f87e11bf4 Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/38322 Reviewed-by: Bartosz MARKOWSKI <bartosz.markowski@tieto.com>
-rw-r--r--drivers/staging/cw1200/sta.c7
-rw-r--r--drivers/staging/cw1200/wsm.h26
2 files changed, 32 insertions, 1 deletions
diff --git a/drivers/staging/cw1200/sta.c b/drivers/staging/cw1200/sta.c
index 9ea92f183c1..33856e6fc43 100644
--- a/drivers/staging/cw1200/sta.c
+++ b/drivers/staging/cw1200/sta.c
@@ -1208,6 +1208,7 @@ void cw1200_join_work(struct work_struct *work)
const u8 *ssidie;
const u8 *dtimie;
const struct ieee80211_tim_ie *tim = NULL;
+ struct wsm_protected_mgmt_policy mgmt_policy;
BUG_ON(queueId >= 4);
if (cw1200_queue_get_skb(queue, priv->pending_frame_id,
@@ -1310,6 +1311,12 @@ void cw1200_join_work(struct work_struct *work)
/* BlockACK policy will be updated when assoc is done */
WARN_ON(wsm_set_block_ack_policy(priv,
0, 0));
+
+ mgmt_policy.protectedMgmtEnable = 0;
+ mgmt_policy.unprotectedMgmtFramesAllowed = 1;
+ mgmt_policy.encryptionForAuthFrame = 1;
+ wsm_set_protected_mgmt_policy(priv, &mgmt_policy);
+
if (wsm_join(priv, &join)) {
memset(&priv->join_bssid[0],
0, sizeof(priv->join_bssid));
diff --git a/drivers/staging/cw1200/wsm.h b/drivers/staging/cw1200/wsm.h
index 61c1d5b8a02..0915b32bf96 100644
--- a/drivers/staging/cw1200/wsm.h
+++ b/drivers/staging/cw1200/wsm.h
@@ -495,7 +495,8 @@ struct cw1200_common;
/* 4.37 GroupTxSequenceCounter */
#define WSM_MIB_ID_GRP_SEQ_COUNTER 0x101F
-/* 1020 4.38 ProtectedMgmtPolicy */
+/* 4.38 ProtectedMgmtPolicy */
+#define WSM_MIB_ID_PROTECTED_MGMT_POLICY 0x1020
/* 4.39 SetHtProtection */
#define WSM_MID_ID_SET_HT_PROTECTION 0x1021
@@ -1428,6 +1429,29 @@ static inline int wsm_set_template_frame(struct cw1200_common *priv,
return ret;
}
+
+struct wsm_protected_mgmt_policy {
+ bool protectedMgmtEnable;
+ bool unprotectedMgmtFramesAllowed;
+ bool encryptionForAuthFrame;
+};
+
+static inline int wsm_set_protected_mgmt_policy(struct cw1200_common *priv,
+ struct wsm_protected_mgmt_policy *arg)
+{
+ __le32 val = 0;
+ int ret;
+ if (arg->protectedMgmtEnable)
+ val |= __cpu_to_le32(BIT(0));
+ if (arg->unprotectedMgmtFramesAllowed)
+ val |= __cpu_to_le32(BIT(1));
+ if (arg->encryptionForAuthFrame)
+ val |= __cpu_to_le32(BIT(2));
+ ret = wsm_write_mib(priv, WSM_MIB_ID_PROTECTED_MGMT_POLICY,
+ &val, sizeof(val));
+ return ret;
+}
+
static inline int wsm_set_block_ack_policy(struct cw1200_common *priv,
u8 blockAckTxTidPolicy,
u8 blockAckRxTidPolicy)