[PATCH 09/11] wcn36xx: add WEP implementation
Eugene Krasnikov
k.eugene.e at gmail.com
Thu Aug 22 04:46:02 EDT 2013
With this patch WEP is supported;
Signed-off-by: Eugene Krasnikov <k.eugene.e at gmail.com>
---
main.c | 21 ++++++++++++++++++++-
smd.c | 1 -
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/main.c b/main.c
index 73321ea..5e19e95 100644
--- a/main.c
+++ b/main.c
@@ -333,7 +333,7 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
struct ieee80211_key_conf *key_conf)
{
struct wcn36xx *wcn = hw->priv;
- struct wcn36xx_sta *sta_priv = (struct wcn36xx_sta *)sta->drv_priv;
+ struct wcn36xx_sta *sta_priv = NULL;
int ret = 0;
u8 key[WLAN_MAX_KEY_LEN];
@@ -344,8 +344,15 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
wcn36xx_dbg_dump(WCN36XX_DBG_MAC, "KEY: ",
key_conf->key,
key_conf->keylen);
+ sta_priv = sta ? (struct wcn36xx_sta *)sta->drv_priv : wcn->sta;
switch (key_conf->cipher) {
+ case WLAN_CIPHER_SUITE_WEP40:
+ wcn->encrypt_type = WCN36XX_HAL_ED_WEP40;
+ break;
+ case WLAN_CIPHER_SUITE_WEP104:
+ wcn->encrypt_type = WCN36XX_HAL_ED_WEP40;
+ break;
case WLAN_CIPHER_SUITE_CCMP:
wcn->encrypt_type = WCN36XX_HAL_ED_CCMP;
break;
@@ -398,6 +405,16 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
key_conf->keyidx,
key_conf->keylen,
key);
+ if ((WLAN_CIPHER_SUITE_WEP40 == key_conf->cipher) ||
+ (WLAN_CIPHER_SUITE_WEP104 == key_conf->cipher)) {
+ sta_priv->is_data_encrypted = true;
+ wcn36xx_smd_set_stakey(wcn,
+ wcn->encrypt_type,
+ key_conf->keyidx,
+ key_conf->keylen,
+ key,
+ get_sta_index(vif, sta_priv));
+ }
}
break;
case DISABLE_KEY:
@@ -830,6 +847,8 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn)
int ret = 0;
static const u32 cipher_suites[] = {
+ WLAN_CIPHER_SUITE_WEP40,
+ WLAN_CIPHER_SUITE_WEP104,
WLAN_CIPHER_SUITE_TKIP,
WLAN_CIPHER_SUITE_CCMP,
};
diff --git a/smd.c b/smd.c
index d4e2ed3..def40cd 100644
--- a/smd.c
+++ b/smd.c
@@ -967,7 +967,6 @@ static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn,
if (wcn->sta) {
wcn->sta->bss_sta_index = params->bss_sta_index;
wcn->sta->bss_dpu_desc_index = params->dpu_desc_index;
- wcn->sta = NULL;
}
wcn->current_vif->ucast_dpu_signature = params->ucast_dpu_signature;
--
1.8.2.2
More information about the wcn36xx
mailing list