staging: rtl8723au: Use WLAN_CIPHER_SUITE_* to mark crypto type

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jes Sorensen 2014-05-21 09:37:34 +02:00 committed by Greg Kroah-Hartman
parent 07a4b1b1bc
commit 9e3d6df2df
19 changed files with 177 additions and 174 deletions

View file

@ -679,7 +679,10 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf)
if (pmlmepriv->cur_network.join_res != true) { if (pmlmepriv->cur_network.join_res != true) {
/* setting only at first time */ /* setting only at first time */
/* WEP Key will be set before this function, do not clear CAM. */ /* WEP Key will be set before this function, do not clear CAM. */
if ((psecuritypriv->dot11PrivacyAlgrthm != _WEP40_) && (psecuritypriv->dot11PrivacyAlgrthm != _WEP104_)) if (psecuritypriv->dot11PrivacyAlgrthm !=
WLAN_CIPHER_SUITE_WEP40 &&
psecuritypriv->dot11PrivacyAlgrthm !=
WLAN_CIPHER_SUITE_WEP104)
flush_all_cam_entry23a(padapter); /* clear CAM */ flush_all_cam_entry23a(padapter); /* clear CAM */
} }
@ -897,8 +900,8 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf,
/* wpa2 */ /* wpa2 */
group_cipher = 0; pairwise_cipher = 0; group_cipher = 0; pairwise_cipher = 0;
psecuritypriv->wpa2_group_cipher = _NO_PRIVACY_; psecuritypriv->wpa2_group_cipher = 0;
psecuritypriv->wpa2_pairwise_cipher = _NO_PRIVACY_; psecuritypriv->wpa2_pairwise_cipher = 0;
p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len, p = rtw_get_ie23a(ie + _BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len,
(pbss_network->IELength - _BEACON_IE_OFFSET_)); (pbss_network->IELength - _BEACON_IE_OFFSET_));
if (p && ie_len > 0) { if (p && ie_len > 0) {
@ -918,8 +921,8 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf,
ie_len = 0; ie_len = 0;
group_cipher = 0; group_cipher = 0;
pairwise_cipher = 0; pairwise_cipher = 0;
psecuritypriv->wpa_group_cipher = _NO_PRIVACY_; psecuritypriv->wpa_group_cipher = 0;
psecuritypriv->wpa_pairwise_cipher = _NO_PRIVACY_; psecuritypriv->wpa_pairwise_cipher = 0;
for (p = ie + _BEACON_IE_OFFSET_; ;p += (ie_len + 2)) { for (p = ie + _BEACON_IE_OFFSET_; ;p += (ie_len + 2)) {
p = rtw_get_ie23a(p, WLAN_EID_VENDOR_SPECIFIC, &ie_len, p = rtw_get_ie23a(p, WLAN_EID_VENDOR_SPECIFIC, &ie_len,
(pbss_network->IELength - _BEACON_IE_OFFSET_ - (pbss_network->IELength - _BEACON_IE_OFFSET_ -
@ -1887,16 +1890,20 @@ void rtw_ap_restore_network(struct rtw_adapter *padapter)
start_bss_network(padapter, (u8*)&mlmepriv->cur_network.network); start_bss_network(padapter, (u8*)&mlmepriv->cur_network.network);
if ((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) || if (padapter->securitypriv.dot11PrivacyAlgrthm ==
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) WLAN_CIPHER_SUITE_TKIP ||
{ padapter->securitypriv.dot11PrivacyAlgrthm ==
WLAN_CIPHER_SUITE_CCMP) {
/* restore group key, WEP keys is restored in ips_leave23a() */ /* restore group key, WEP keys is restored in ips_leave23a() */
rtw_set_key23a(padapter, psecuritypriv, psecuritypriv->dot118021XGrpKeyid, 0); rtw_set_key23a(padapter, psecuritypriv,
psecuritypriv->dot118021XGrpKeyid, 0);
} }
/* per sta pairwise key and settings */ /* per sta pairwise key and settings */
if ((padapter->securitypriv.dot11PrivacyAlgrthm != _TKIP_) && if (padapter->securitypriv.dot11PrivacyAlgrthm !=
(padapter->securitypriv.dot11PrivacyAlgrthm != _AES_)) { WLAN_CIPHER_SUITE_TKIP &&
padapter->securitypriv.dot11PrivacyAlgrthm !=
WLAN_CIPHER_SUITE_CCMP) {
return; return;
} }

View file

@ -587,13 +587,14 @@ int rtw_joinbss_cmd23a(struct rtw_adapter *padapter,
phtpriv->ht_option = false; phtpriv->ht_option = false;
if (pregistrypriv->ht_enable) { if (pregistrypriv->ht_enable) {
u32 algo = padapter->securitypriv.dot11PrivacyAlgrthm;
/* Added by Albert 2010/06/23 */ /* Added by Albert 2010/06/23 */
/* For the WEP mode, we will use the bg mode to do /* For the WEP mode, we will use the bg mode to do
the connection to avoid some IOT issue. */ the connection to avoid some IOT issue. */
/* Especially for Realtek 8192u SoftAP. */ /* Especially for Realtek 8192u SoftAP. */
if ((padapter->securitypriv.dot11PrivacyAlgrthm != _WEP40_) && if (algo != WLAN_CIPHER_SUITE_WEP40 &&
(padapter->securitypriv.dot11PrivacyAlgrthm != _WEP104_) && algo != WLAN_CIPHER_SUITE_WEP104 &&
(padapter->securitypriv.dot11PrivacyAlgrthm != _TKIP_)) { algo != WLAN_CIPHER_SUITE_TKIP) {
/* rtw_restructure_ht_ie23a */ /* rtw_restructure_ht_ie23a */
rtw_restructure_ht_ie23a(padapter, rtw_restructure_ht_ie23a(padapter,
&pnetwork->network.IEs[0], &pnetwork->network.IEs[0],
@ -807,7 +808,7 @@ int rtw_clearstakey_cmd23a(struct rtw_adapter *padapter, u8 *psta, u8 entry,
ether_addr_copy(psetstakey_para->addr, sta->hwaddr); ether_addr_copy(psetstakey_para->addr, sta->hwaddr);
psetstakey_para->algorithm = _NO_PRIVACY_; psetstakey_para->algorithm = 0;
psetstakey_para->id = entry; psetstakey_para->id = entry;

View file

@ -382,17 +382,17 @@ int rtw_set_802_11_add_wep23a(struct rtw_adapter* padapter,
switch (wep->KeyLength) switch (wep->KeyLength)
{ {
case 5: case 5:
psecuritypriv->dot11PrivacyAlgrthm = _WEP40_; psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP40;
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
("MgntActrtw_set_802_11_add_wep23a:wep->KeyLength = 5\n")); ("MgntActrtw_set_802_11_add_wep23a:wep->KeyLength = 5\n"));
break; break;
case 13: case 13:
psecuritypriv->dot11PrivacyAlgrthm = _WEP104_; psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP104;
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
("MgntActrtw_set_802_11_add_wep23a:wep->KeyLength = 13\n")); ("MgntActrtw_set_802_11_add_wep23a:wep->KeyLength = 13\n"));
break; break;
default: default:
psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_; psecuritypriv->dot11PrivacyAlgrthm = 0;
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
("MgntActrtw_set_802_11_add_wep23a:wep->KeyLength!= 5 " ("MgntActrtw_set_802_11_add_wep23a:wep->KeyLength!= 5 "
"or 13\n")); "or 13\n"));

View file

@ -340,10 +340,10 @@ int rtw_is_same_ibss23a(struct rtw_adapter *adapter,
int ret = true; int ret = true;
struct security_priv *psecuritypriv = &adapter->securitypriv; struct security_priv *psecuritypriv = &adapter->securitypriv;
if (psecuritypriv->dot11PrivacyAlgrthm != _NO_PRIVACY_ && if (psecuritypriv->dot11PrivacyAlgrthm != 0 &&
pnetwork->network.Privacy == 0) pnetwork->network.Privacy == 0)
ret = false; ret = false;
else if (psecuritypriv->dot11PrivacyAlgrthm == _NO_PRIVACY_ && else if (psecuritypriv->dot11PrivacyAlgrthm == 0 &&
pnetwork->network.Privacy == 1) pnetwork->network.Privacy == 1)
ret = false; ret = false;
else else
@ -1911,23 +1911,23 @@ int rtw_set_key23a(struct rtw_adapter *adapter,
"keyid = (u8)keyid =%d\n", psetkeyparm->algorithm, keyid)); "keyid = (u8)keyid =%d\n", psetkeyparm->algorithm, keyid));
switch (psetkeyparm->algorithm) { switch (psetkeyparm->algorithm) {
case _WEP40_: case WLAN_CIPHER_SUITE_WEP40:
keylen = 5; keylen = 5;
memcpy(&psetkeyparm->key[0], memcpy(&psetkeyparm->key[0],
&psecuritypriv->dot11DefKey[keyid].skey[0], keylen); &psecuritypriv->dot11DefKey[keyid].skey[0], keylen);
break; break;
case _WEP104_: case WLAN_CIPHER_SUITE_WEP104:
keylen = 13; keylen = 13;
memcpy(&psetkeyparm->key[0], memcpy(&psetkeyparm->key[0],
&psecuritypriv->dot11DefKey[keyid].skey[0], keylen); &psecuritypriv->dot11DefKey[keyid].skey[0], keylen);
break; break;
case _TKIP_: case WLAN_CIPHER_SUITE_TKIP:
keylen = 16; keylen = 16;
memcpy(&psetkeyparm->key, memcpy(&psetkeyparm->key,
&psecuritypriv->dot118021XGrpKey[keyid], keylen); &psecuritypriv->dot118021XGrpKey[keyid], keylen);
psetkeyparm->grpkey = 1; psetkeyparm->grpkey = 1;
break; break;
case _AES_: case WLAN_CIPHER_SUITE_CCMP:
keylen = 16; keylen = 16;
memcpy(&psetkeyparm->key, memcpy(&psetkeyparm->key,
&psecuritypriv->dot118021XGrpKey[keyid], keylen); &psecuritypriv->dot118021XGrpKey[keyid], keylen);
@ -2250,7 +2250,8 @@ unsigned int rtw_restructure_ht_ie23a(struct rtw_adapter *padapter, u8 *in_ie,
&max_rx_ampdu_factor); &max_rx_ampdu_factor);
ht_capie.ampdu_params_info = max_rx_ampdu_factor & 0x03; ht_capie.ampdu_params_info = max_rx_ampdu_factor & 0x03;
if (padapter->securitypriv.dot11PrivacyAlgrthm == _AES_) if (padapter->securitypriv.dot11PrivacyAlgrthm ==
WLAN_CIPHER_SUITE_CCMP)
ht_capie.ampdu_params_info |= ht_capie.ampdu_params_info |=
(IEEE80211_HT_AMPDU_PARM_DENSITY& (0x07 << 2)); (IEEE80211_HT_AMPDU_PARM_DENSITY& (0x07 << 2));
else else

View file

@ -336,7 +336,7 @@ static void init_mlme_ext_priv23a_value(struct rtw_adapter* padapter)
pmlmeinfo->key_index = 0; pmlmeinfo->key_index = 0;
pmlmeinfo->iv = 0; pmlmeinfo->iv = 0;
pmlmeinfo->enc_algo = _NO_PRIVACY_; pmlmeinfo->enc_algo = 0;
pmlmeinfo->authModeToggle = 0; pmlmeinfo->authModeToggle = 0;
memset(pmlmeinfo->chg_txt, 0, 128); memset(pmlmeinfo->chg_txt, 0, 128);
@ -883,8 +883,8 @@ OnAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
DBG_8723A("auth alg =%x, seq =%X\n", algorithm, seq); DBG_8723A("auth alg =%x, seq =%X\n", algorithm, seq);
if (auth_mode == 2 && if (auth_mode == 2 &&
psecuritypriv->dot11PrivacyAlgrthm != _WEP40_ && psecuritypriv->dot11PrivacyAlgrthm != WLAN_CIPHER_SUITE_WEP40 &&
psecuritypriv->dot11PrivacyAlgrthm != _WEP104_) psecuritypriv->dot11PrivacyAlgrthm != WLAN_CIPHER_SUITE_WEP104)
auth_mode = 0; auth_mode = 0;
/* rx a shared-key auth but shared not enabled, or */ /* rx a shared-key auth but shared not enabled, or */
@ -2305,7 +2305,7 @@ void update_mgntframe_attrib23a(struct rtw_adapter *padapter,
else else
pattrib->raid = 5;/* a/g mode */ pattrib->raid = 5;/* a/g mode */
pattrib->encrypt = _NO_PRIVACY_; pattrib->encrypt = 0;
pattrib->bswenc = false; pattrib->bswenc = false;
pattrib->qos_en = false; pattrib->qos_en = false;
@ -3098,7 +3098,7 @@ void issue_auth23a(struct rtw_adapter *padapter, struct sta_info *psta,
pattrib->hdrlen = sizeof(struct ieee80211_hdr_3addr); pattrib->hdrlen = sizeof(struct ieee80211_hdr_3addr);
pattrib->encrypt = _WEP40_; pattrib->encrypt = WLAN_CIPHER_SUITE_WEP40;
pattrib->icv_len = 4; pattrib->icv_len = 4;
@ -6282,7 +6282,7 @@ int set_stakey_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
struct sta_info *psta; struct sta_info *psta;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
if (pparm->algorithm == _NO_PRIVACY_) /* clear cam entry */ if (pparm->algorithm == 0) /* clear cam entry */
{ {
clear_cam_entry23a(padapter, pparm->id); clear_cam_entry23a(padapter, pparm->id);
return H2C_SUCCESS_RSP; return H2C_SUCCESS_RSP;
@ -6323,8 +6323,7 @@ int set_stakey_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
/* below for sta mode */ /* below for sta mode */
if (pparm->algorithm == _NO_PRIVACY_) /* clear cam entry */ if (pparm->algorithm == 0) { /* clear cam entry */
{
clear_cam_entry23a(padapter, pparm->id); clear_cam_entry23a(padapter, pparm->id);
return H2C_SUCCESS; return H2C_SUCCESS;
} }

View file

@ -79,8 +79,10 @@ int ips_leave23a(struct rtw_adapter * padapter)
DBG_8723A_LEVEL(_drv_always_, "nolinked power save leave\n"); DBG_8723A_LEVEL(_drv_always_, "nolinked power save leave\n");
if (psecuritypriv->dot11PrivacyAlgrthm == _WEP40_ || if (psecuritypriv->dot11PrivacyAlgrthm ==
psecuritypriv->dot11PrivacyAlgrthm == _WEP104_) { WLAN_CIPHER_SUITE_WEP40 ||
psecuritypriv->dot11PrivacyAlgrthm ==
WLAN_CIPHER_SUITE_WEP104) {
DBG_8723A("==>%s, channel(%d), processing(%x)\n", DBG_8723A("==>%s, channel(%d), processing(%x)\n",
__func__, padapter->mlmeextpriv.cur_channel, __func__, padapter->mlmeextpriv.cur_channel,
pwrpriv->bips_processing); pwrpriv->bips_processing);

View file

@ -296,9 +296,9 @@ int recvframe_chkmic(struct rtw_adapter *adapter,
stainfo = rtw_get_stainfo23a(&adapter->stapriv, &prxattrib->ta[0]); stainfo = rtw_get_stainfo23a(&adapter->stapriv, &prxattrib->ta[0]);
if (prxattrib->encrypt == _TKIP_) { if (prxattrib->encrypt == WLAN_CIPHER_SUITE_TKIP) {
RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, RT_TRACE(_module_rtl871x_recv_c_, _drv_info_,
("\n recvframe_chkmic:prxattrib->encrypt == _TKIP_\n")); ("\n recvframe_chkmic:prxattrib->encrypt == WLAN_CIPHER_SUITE_TKIP\n"));
RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, RT_TRACE(_module_rtl871x_recv_c_, _drv_info_,
("\n recvframe_chkmic:da = 0x%02x:0x%02x:0x%02x:0x%02x:" ("\n recvframe_chkmic:da = 0x%02x:0x%02x:0x%02x:0x%02x:"
"0x%02x:0x%02x\n", prxattrib->ra[0], "0x%02x:0x%02x\n", prxattrib->ra[0],
@ -491,13 +491,13 @@ struct recv_frame *decryptor(struct rtw_adapter *padapter,
prxattrib->key_index); prxattrib->key_index);
switch (prxattrib->encrypt) { switch (prxattrib->encrypt) {
case _WEP40_: case WLAN_CIPHER_SUITE_WEP40:
case _WEP104_: case WLAN_CIPHER_SUITE_WEP104:
prxattrib->key_index = prxattrib->key_index =
psecuritypriv->dot11PrivacyKeyIndex; psecuritypriv->dot11PrivacyKeyIndex;
break; break;
case _TKIP_: case WLAN_CIPHER_SUITE_TKIP:
case _AES_: case WLAN_CIPHER_SUITE_CCMP:
default: default:
prxattrib->key_index = prxattrib->key_index =
psecuritypriv->dot118021XGrpKeyid; psecuritypriv->dot118021XGrpKeyid;
@ -509,14 +509,14 @@ struct recv_frame *decryptor(struct rtw_adapter *padapter,
if ((prxattrib->encrypt > 0) && ((prxattrib->bdecrypted == 0))) { if ((prxattrib->encrypt > 0) && ((prxattrib->bdecrypted == 0))) {
psecuritypriv->hw_decrypted = 0; psecuritypriv->hw_decrypted = 0;
switch (prxattrib->encrypt) { switch (prxattrib->encrypt) {
case _WEP40_: case WLAN_CIPHER_SUITE_WEP40:
case _WEP104_: case WLAN_CIPHER_SUITE_WEP104:
rtw_wep_decrypt23a(padapter, precv_frame); rtw_wep_decrypt23a(padapter, precv_frame);
break; break;
case _TKIP_: case WLAN_CIPHER_SUITE_TKIP:
res = rtw_tkip_decrypt23a(padapter, precv_frame); res = rtw_tkip_decrypt23a(padapter, precv_frame);
break; break;
case _AES_: case WLAN_CIPHER_SUITE_CCMP:
res = rtw_aes_decrypt23a(padapter, precv_frame); res = rtw_aes_decrypt23a(padapter, precv_frame);
break; break;
default: default:
@ -524,7 +524,7 @@ struct recv_frame *decryptor(struct rtw_adapter *padapter,
} }
} else if (prxattrib->bdecrypted == 1 && prxattrib->encrypt > 0 && } else if (prxattrib->bdecrypted == 1 && prxattrib->encrypt > 0 &&
(psecuritypriv->busetkipkey == 1 || (psecuritypriv->busetkipkey == 1 ||
prxattrib->encrypt != _TKIP_)) { prxattrib->encrypt != WLAN_CIPHER_SUITE_TKIP)) {
psecuritypriv->hw_decrypted = 1; psecuritypriv->hw_decrypted = 1;
} }
@ -1408,16 +1408,16 @@ static int validate_recv_data_frame(struct rtw_adapter *adapter,
switch (pattrib->encrypt) switch (pattrib->encrypt)
{ {
case _WEP40_: case WLAN_CIPHER_SUITE_WEP40:
case _WEP104_: case WLAN_CIPHER_SUITE_WEP104:
pattrib->iv_len = 4; pattrib->iv_len = 4;
pattrib->icv_len = 4; pattrib->icv_len = 4;
break; break;
case _TKIP_: case WLAN_CIPHER_SUITE_TKIP:
pattrib->iv_len = 8; pattrib->iv_len = 8;
pattrib->icv_len = 4; pattrib->icv_len = 4;
break; break;
case _AES_: case WLAN_CIPHER_SUITE_CCMP:
pattrib->iv_len = 8; pattrib->iv_len = 8;
pattrib->icv_len = 8; pattrib->icv_len = 8;
break; break;

View file

@ -170,7 +170,8 @@ void rtw_wep_encrypt23a(struct rtw_adapter *padapter,
pframe = pxmitframe->buf_addr + hw_hdr_offset; pframe = pxmitframe->buf_addr + hw_hdr_offset;
/* start to encrypt each fragment */ /* start to encrypt each fragment */
if ((pattrib->encrypt != _WEP40_) && (pattrib->encrypt != _WEP104_)) if (pattrib->encrypt != WLAN_CIPHER_SUITE_WEP40 &&
pattrib->encrypt != WLAN_CIPHER_SUITE_WEP104)
return; return;
index = psecuritypriv->dot11PrivacyKeyIndex; index = psecuritypriv->dot11PrivacyKeyIndex;
@ -225,7 +226,8 @@ void rtw_wep_decrypt23a(struct rtw_adapter *padapter,
pframe = skb->data; pframe = skb->data;
/* start to decrypt recvframe */ /* start to decrypt recvframe */
if ((prxattrib->encrypt != _WEP40_) && (prxattrib->encrypt != _WEP104_)) if (prxattrib->encrypt != WLAN_CIPHER_SUITE_WEP40 &&
prxattrib->encrypt != WLAN_CIPHER_SUITE_WEP104)
return; return;
iv = pframe + prxattrib->hdrlen; iv = pframe + prxattrib->hdrlen;
@ -637,14 +639,10 @@ int rtw_tkip_encrypt23a(struct rtw_adapter *padapter,
pframe = pxmitframe->buf_addr + hw_hdr_offset; pframe = pxmitframe->buf_addr + hw_hdr_offset;
/* 4 start to encrypt each fragment */ /* 4 start to encrypt each fragment */
if (pattrib->encrypt == _TKIP_) { if (pattrib->encrypt == WLAN_CIPHER_SUITE_TKIP) {
if (pattrib->psta) if (pattrib->psta)
{
stainfo = pattrib->psta; stainfo = pattrib->psta;
} else {
else
{
DBG_8723A("%s, call rtw_get_stainfo()\n", __func__); DBG_8723A("%s, call rtw_get_stainfo()\n", __func__);
stainfo = rtw_get_stainfo23a(&padapter->stapriv, stainfo = rtw_get_stainfo23a(&padapter->stapriv,
&pattrib->ra[0]); &pattrib->ra[0]);
@ -737,7 +735,7 @@ int rtw_tkip_decrypt23a(struct rtw_adapter *padapter,
pframe = skb->data; pframe = skb->data;
/* 4 start to decrypt recvframe */ /* 4 start to decrypt recvframe */
if (prxattrib->encrypt == _TKIP_) { if (prxattrib->encrypt == WLAN_CIPHER_SUITE_TKIP) {
stainfo = rtw_get_stainfo23a(&padapter->stapriv, stainfo = rtw_get_stainfo23a(&padapter->stapriv,
&prxattrib->ta[0]); &prxattrib->ta[0]);
@ -1323,7 +1321,7 @@ int rtw_aes_encrypt23a(struct rtw_adapter *padapter,
pframe = pxmitframe->buf_addr + hw_hdr_offset; pframe = pxmitframe->buf_addr + hw_hdr_offset;
/* 4 start to encrypt each fragment */ /* 4 start to encrypt each fragment */
if (pattrib->encrypt != _AES_) if (pattrib->encrypt != WLAN_CIPHER_SUITE_CCMP)
return _FAIL; return _FAIL;
if (pattrib->psta) { if (pattrib->psta) {
@ -1598,7 +1596,7 @@ int rtw_aes_decrypt23a(struct rtw_adapter *padapter,
pframe = skb->data; pframe = skb->data;
/* 4 start to encrypt each fragment */ /* 4 start to encrypt each fragment */
if (prxattrib->encrypt != _AES_) if (prxattrib->encrypt != WLAN_CIPHER_SUITE_CCMP)
return _FAIL; return _FAIL;
stainfo = rtw_get_stainfo23a(&padapter->stapriv, &prxattrib->ta[0]); stainfo = rtw_get_stainfo23a(&padapter->stapriv, &prxattrib->ta[0]);

View file

@ -105,8 +105,10 @@ static void sreset_restore_security_station(struct rtw_adapter *padapter)
rtl8723a_set_sec_cfg(padapter, val8); rtl8723a_set_sec_cfg(padapter, val8);
if ((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) || if (padapter->securitypriv.dot11PrivacyAlgrthm ==
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) { WLAN_CIPHER_SUITE_TKIP ||
padapter->securitypriv.dot11PrivacyAlgrthm ==
WLAN_CIPHER_SUITE_CCMP) {
psta = rtw_get_stainfo23a(pstapriv, get_bssid(mlmepriv)); psta = rtw_get_stainfo23a(pstapriv, get_bssid(mlmepriv));
if (psta == NULL) { if (psta == NULL) {
/* DEBUG_ERR(("Set wpa_set_encryption: Obtain Sta_info fail\n")); */ /* DEBUG_ERR(("Set wpa_set_encryption: Obtain Sta_info fail\n")); */

View file

@ -296,9 +296,10 @@ static void update_attrib_vcs_info(struct rtw_adapter *padapter, struct xmit_fra
} else { } else {
while (true) { while (true) {
/* IOT action */ /* IOT action */
if ((pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_ATHEROS) && if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_ATHEROS &&
(pattrib->ampdu_en) && pattrib->ampdu_en &&
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) { padapter->securitypriv.dot11PrivacyAlgrthm ==
WLAN_CIPHER_SUITE_CCMP) {
pattrib->vcs_mode = CTS_TO_SELF; pattrib->vcs_mode = CTS_TO_SELF;
break; break;
} }
@ -594,13 +595,13 @@ static int update_attrib(struct rtw_adapter *padapter,
} }
switch (pattrib->encrypt) { switch (pattrib->encrypt) {
case _WEP40_: case WLAN_CIPHER_SUITE_WEP40:
case _WEP104_: case WLAN_CIPHER_SUITE_WEP104:
pattrib->iv_len = 4; pattrib->iv_len = 4;
pattrib->icv_len = 4; pattrib->icv_len = 4;
break; break;
case _TKIP_: case WLAN_CIPHER_SUITE_TKIP:
pattrib->iv_len = 8; pattrib->iv_len = 8;
pattrib->icv_len = 4; pattrib->icv_len = 4;
@ -614,9 +615,10 @@ static int update_attrib(struct rtw_adapter *padapter,
} }
break; break;
case _AES_: case WLAN_CIPHER_SUITE_CCMP:
RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_,
("pattrib->encrypt =%d (_AES_)\n", pattrib->encrypt)); ("pattrib->encrypt =%d (WLAN_CIPHER_SUITE_CCMP)\n",
pattrib->encrypt));
pattrib->iv_len = 8; pattrib->iv_len = 8;
pattrib->icv_len = 8; pattrib->icv_len = 8;
break; break;
@ -680,7 +682,7 @@ static int xmitframe_addmic(struct rtw_adapter *padapter,
hw_hdr_offset = TXDESC_OFFSET; hw_hdr_offset = TXDESC_OFFSET;
if (pattrib->encrypt == _TKIP_) { if (pattrib->encrypt == WLAN_CIPHER_SUITE_TKIP) {
/* encode mic code */ /* encode mic code */
if (stainfo) { if (stainfo) {
u8 null_key[16]={0x0, 0x0, 0x0, 0x0, u8 null_key[16]={0x0, 0x0, 0x0, 0x0,
@ -834,14 +836,14 @@ static int xmitframe_swencrypt(struct rtw_adapter *padapter,
RT_TRACE(_module_rtl871x_xmit_c_, _drv_alert_, RT_TRACE(_module_rtl871x_xmit_c_, _drv_alert_,
("### xmitframe_swencrypt\n")); ("### xmitframe_swencrypt\n"));
switch (pattrib->encrypt) { switch (pattrib->encrypt) {
case _WEP40_: case WLAN_CIPHER_SUITE_WEP40:
case _WEP104_: case WLAN_CIPHER_SUITE_WEP104:
rtw_wep_encrypt23a(padapter, pxmitframe); rtw_wep_encrypt23a(padapter, pxmitframe);
break; break;
case _TKIP_: case WLAN_CIPHER_SUITE_TKIP:
rtw_tkip_encrypt23a(padapter, pxmitframe); rtw_tkip_encrypt23a(padapter, pxmitframe);
break; break;
case _AES_: case WLAN_CIPHER_SUITE_CCMP:
rtw_aes_encrypt23a(padapter, pxmitframe); rtw_aes_encrypt23a(padapter, pxmitframe);
break; break;
default: default:
@ -1052,7 +1054,7 @@ u32 rtw_calculate_wlan_pkt_size_by_attribue23a(struct pkt_attrib *pattrib)
len = pattrib->hdrlen + pattrib->iv_len; /* WLAN Header and IV */ len = pattrib->hdrlen + pattrib->iv_len; /* WLAN Header and IV */
len += SNAP_SIZE + sizeof(u16); /* LLC */ len += SNAP_SIZE + sizeof(u16); /* LLC */
len += pattrib->pktlen; len += pattrib->pktlen;
if (pattrib->encrypt == _TKIP_) len += 8; /* MIC */ if (pattrib->encrypt == WLAN_CIPHER_SUITE_TKIP) len += 8; /* MIC */
len += ((pattrib->bswenc) ? pattrib->icv_len : 0); /* ICV */ len += ((pattrib->bswenc) ? pattrib->icv_len : 0); /* ICV */
return len; return len;
@ -1144,12 +1146,12 @@ int rtw_xmitframe_coalesce23a(struct rtw_adapter *padapter, struct sk_buff *skb,
if (pattrib->iv_len) { if (pattrib->iv_len) {
if (psta) { if (psta) {
switch (pattrib->encrypt) { switch (pattrib->encrypt) {
case _WEP40_: case WLAN_CIPHER_SUITE_WEP40:
case _WEP104_: case WLAN_CIPHER_SUITE_WEP104:
WEP_IV(pattrib->iv, psta->dot11txpn, WEP_IV(pattrib->iv, psta->dot11txpn,
pattrib->key_idx); pattrib->key_idx);
break; break;
case _TKIP_: case WLAN_CIPHER_SUITE_TKIP:
if (bmcst) if (bmcst)
TKIP_IV(pattrib->iv, TKIP_IV(pattrib->iv,
psta->dot11txpn, psta->dot11txpn,
@ -1158,7 +1160,7 @@ int rtw_xmitframe_coalesce23a(struct rtw_adapter *padapter, struct sk_buff *skb,
TKIP_IV(pattrib->iv, TKIP_IV(pattrib->iv,
psta->dot11txpn, 0); psta->dot11txpn, 0);
break; break;
case _AES_: case WLAN_CIPHER_SUITE_CCMP:
if (bmcst) if (bmcst)
AES_IV(pattrib->iv, AES_IV(pattrib->iv,
psta->dot11txpn, psta->dot11txpn,

View file

@ -419,15 +419,14 @@ rtl8723a_set_ampdu_min_space(struct rtw_adapter *padapter, u8 MinSpacingToSet)
if (MinSpacingToSet <= 7) { if (MinSpacingToSet <= 7) {
switch (padapter->securitypriv.dot11PrivacyAlgrthm) { switch (padapter->securitypriv.dot11PrivacyAlgrthm) {
case _NO_PRIVACY_: case 0:
case _AES_: case WLAN_CIPHER_SUITE_CCMP:
SecMinSpace = 0; SecMinSpace = 0;
break; break;
case _WEP40_: case WLAN_CIPHER_SUITE_WEP40:
case _WEP104_: case WLAN_CIPHER_SUITE_WEP104:
case _TKIP_: case WLAN_CIPHER_SUITE_TKIP:
case _TKIP_WTMIC_:
SecMinSpace = 6; SecMinSpace = 6;
break; break;
default: default:

View file

@ -2081,18 +2081,17 @@ static void fill_txdesc_sectype(struct pkt_attrib *pattrib,
if ((pattrib->encrypt > 0) && !pattrib->bswenc) { if ((pattrib->encrypt > 0) && !pattrib->bswenc) {
switch (pattrib->encrypt) { switch (pattrib->encrypt) {
/* SEC_TYPE */ /* SEC_TYPE */
case _WEP40_: case WLAN_CIPHER_SUITE_WEP40:
case _WEP104_: case WLAN_CIPHER_SUITE_WEP104:
case _TKIP_: case WLAN_CIPHER_SUITE_TKIP:
case _TKIP_WTMIC_:
ptxdesc->sectype = 1; ptxdesc->sectype = 1;
break; break;
case _AES_: case WLAN_CIPHER_SUITE_CCMP:
ptxdesc->sectype = 3; ptxdesc->sectype = 3;
break; break;
case _NO_PRIVACY_: case 0:
default: default:
break; break;
} }

View file

@ -73,19 +73,18 @@ static void fill_txdesc_sectype(struct pkt_attrib *pattrib, struct tx_desc *ptxd
if ((pattrib->encrypt > 0) && !pattrib->bswenc) { if ((pattrib->encrypt > 0) && !pattrib->bswenc) {
switch (pattrib->encrypt) { switch (pattrib->encrypt) {
/* SEC_TYPE */ /* SEC_TYPE */
case _WEP40_: case WLAN_CIPHER_SUITE_WEP40:
case _WEP104_: case WLAN_CIPHER_SUITE_WEP104:
ptxdesc->txdw1 |= cpu_to_le32((0x01<<22)&0x00c00000); ptxdesc->txdw1 |= cpu_to_le32((0x01<<22)&0x00c00000);
break; break;
case _TKIP_: case WLAN_CIPHER_SUITE_TKIP:
case _TKIP_WTMIC_:
/* ptxdesc->txdw1 |= cpu_to_le32((0x02<<22)&0x00c00000); */ /* ptxdesc->txdw1 |= cpu_to_le32((0x02<<22)&0x00c00000); */
ptxdesc->txdw1 |= cpu_to_le32((0x01<<22)&0x00c00000); ptxdesc->txdw1 |= cpu_to_le32((0x01<<22)&0x00c00000);
break; break;
case _AES_: case WLAN_CIPHER_SUITE_CCMP:
ptxdesc->txdw1 |= cpu_to_le32((0x03<<22)&0x00c00000); ptxdesc->txdw1 |= cpu_to_le32((0x03<<22)&0x00c00000);
break; break;
case _NO_PRIVACY_: case 0:
default: default:
break; break;
} }

View file

@ -111,7 +111,7 @@ struct rx_pkt_attrib {
u8 privacy; /* in frame_ctrl field */ u8 privacy; /* in frame_ctrl field */
u8 bdecrypted; u8 bdecrypted;
/* when 0 indicate no encrypt. when non-zero, indicate the algorith */ /* when 0 indicate no encrypt. when non-zero, indicate the algorith */
u8 encrypt; u32 encrypt;
u8 iv_len; u8 iv_len;
u8 icv_len; u8 icv_len;
u8 crc_err; u8 crc_err;

View file

@ -19,14 +19,8 @@
#include <drv_types.h> #include <drv_types.h>
#define _NO_PRIVACY_ 0x0 #define is_wep_enc(alg) (alg == WLAN_CIPHER_SUITE_WEP40 || \
#define _WEP40_ 0x1 alg == WLAN_CIPHER_SUITE_WEP104)
#define _TKIP_ 0x2
#define _TKIP_WTMIC_ 0x3
#define _AES_ 0x4
#define _WEP104_ 0x5
#define is_wep_enc(alg) (((alg) == _WEP40_) || ((alg) == _WEP104_))
#define _WPA2_IE_ID_ 0x30 #define _WPA2_IE_ID_ 0x30

View file

@ -124,8 +124,8 @@ struct pkt_attrib {
u16 hdrlen; /* the WLAN Header Len */ u16 hdrlen; /* the WLAN Header Len */
u32 pktlen; /* the original 802.3 pkt raw_data len */ u32 pktlen; /* the original 802.3 pkt raw_data len */
u32 last_txcmdsz; u32 last_txcmdsz;
u32 encrypt; /* when 0 indicate no encrypt. */
u8 nr_frags; u8 nr_frags;
u8 encrypt; /* when 0 indicate no encrypt. */
u8 iv_len; u8 iv_len;
u8 icv_len; u8 icv_len;
u8 iv[18]; u8 iv[18];

View file

@ -506,15 +506,14 @@ static int set_group_key(struct rtw_adapter *padapter, u8 *key, u32 alg,
psetkeyparm->set_tx = 1; psetkeyparm->set_tx = 1;
switch (alg) { switch (alg) {
case _WEP40_: case WLAN_CIPHER_SUITE_WEP40:
keylen = 5; keylen = 5;
break; break;
case _WEP104_: case WLAN_CIPHER_SUITE_WEP104:
keylen = 13; keylen = 13;
break; break;
case _TKIP_: case WLAN_CIPHER_SUITE_TKIP:
case _TKIP_WTMIC_: case WLAN_CIPHER_SUITE_CCMP:
case _AES_:
default: default:
keylen = 16; keylen = 16;
} }
@ -536,17 +535,17 @@ exit:
static int set_wep_key(struct rtw_adapter *padapter, u8 *key, u8 keylen, static int set_wep_key(struct rtw_adapter *padapter, u8 *key, u8 keylen,
u8 keyid) u8 keyid)
{ {
u8 alg; u32 alg;
switch (keylen) { switch (keylen) {
case 5: case 5:
alg = _WEP40_; alg = WLAN_CIPHER_SUITE_WEP40;
break; break;
case 13: case 13:
alg = _WEP104_; alg = WLAN_CIPHER_SUITE_WEP104;
break; break;
default: default:
alg = _NO_PRIVACY_; alg = 0;
} }
return set_group_key(padapter, key, alg, keyid); return set_group_key(padapter, key, alg, keyid);
@ -626,12 +625,12 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev,
psecuritypriv->ndisencryptstatus = psecuritypriv->ndisencryptstatus =
Ndis802_11Encryption1Enabled; Ndis802_11Encryption1Enabled;
psecuritypriv->dot11PrivacyAlgrthm = _WEP40_; psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP40;
psecuritypriv->dot118021XGrpPrivacy = _WEP40_; psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP40;
if (wep_key_len == 13) { if (wep_key_len == 13) {
psecuritypriv->dot11PrivacyAlgrthm = _WEP104_; psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP104;
psecuritypriv->dot118021XGrpPrivacy = _WEP104_; psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP104;
} }
psecuritypriv->dot11PrivacyKeyIndex = wep_key_idx; psecuritypriv->dot11PrivacyKeyIndex = wep_key_idx;
@ -660,17 +659,17 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev,
(param->u.crypt.key_len > (param->u.crypt.key_len >
16 ? 16 : param->u.crypt.key_len)); 16 ? 16 : param->u.crypt.key_len));
psecuritypriv->dot118021XGrpPrivacy = _WEP40_; psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP40;
if (param->u.crypt.key_len == 13) { if (param->u.crypt.key_len == 13) {
psecuritypriv->dot118021XGrpPrivacy = psecuritypriv->dot118021XGrpPrivacy =
_WEP104_; WLAN_CIPHER_SUITE_WEP104;
} }
} else if (strcmp(param->u.crypt.alg, "TKIP") == 0) { } else if (strcmp(param->u.crypt.alg, "TKIP") == 0) {
DBG_8723A("%s, set group_key, TKIP\n", DBG_8723A("%s, set group_key, TKIP\n",
__func__); __func__);
psecuritypriv->dot118021XGrpPrivacy = _TKIP_; psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_TKIP;
memcpy(psecuritypriv-> memcpy(psecuritypriv->
dot118021XGrpKey[param->u.crypt.idx]. dot118021XGrpKey[param->u.crypt.idx].
@ -695,7 +694,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev,
DBG_8723A("%s, set group_key, CCMP\n", DBG_8723A("%s, set group_key, CCMP\n",
__func__); __func__);
psecuritypriv->dot118021XGrpPrivacy = _AES_; psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_CCMP;
memcpy(psecuritypriv-> memcpy(psecuritypriv->
dot118021XGrpKey[param->u.crypt.idx]. dot118021XGrpKey[param->u.crypt.idx].
@ -707,7 +706,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev,
__func__); __func__);
psecuritypriv->dot118021XGrpPrivacy = psecuritypriv->dot118021XGrpPrivacy =
_NO_PRIVACY_; 0;
} }
psecuritypriv->dot118021XGrpKeyid = param->u.crypt.idx; psecuritypriv->dot118021XGrpKeyid = param->u.crypt.idx;
@ -749,16 +748,16 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev,
DBG_8723A("%s, set pairwise key, WEP\n", DBG_8723A("%s, set pairwise key, WEP\n",
__func__); __func__);
psta->dot118021XPrivacy = _WEP40_; psta->dot118021XPrivacy = WLAN_CIPHER_SUITE_WEP40;
if (param->u.crypt.key_len == 13) { if (param->u.crypt.key_len == 13) {
psta->dot118021XPrivacy = psta->dot118021XPrivacy =
_WEP104_; WLAN_CIPHER_SUITE_WEP104;
} }
} else if (!strcmp(param->u.crypt.alg, "TKIP")) { } else if (!strcmp(param->u.crypt.alg, "TKIP")) {
DBG_8723A("%s, set pairwise key, " DBG_8723A("%s, set pairwise key, "
"TKIP\n", __func__); "TKIP\n", __func__);
psta->dot118021XPrivacy = _TKIP_; psta->dot118021XPrivacy = WLAN_CIPHER_SUITE_TKIP;
/* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */
/* set mic key */ /* set mic key */
@ -774,12 +773,12 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev,
DBG_8723A("%s, set pairwise key, " DBG_8723A("%s, set pairwise key, "
"CCMP\n", __func__); "CCMP\n", __func__);
psta->dot118021XPrivacy = _AES_; psta->dot118021XPrivacy = WLAN_CIPHER_SUITE_CCMP;
} else { } else {
DBG_8723A("%s, set pairwise key, " DBG_8723A("%s, set pairwise key, "
"none\n", __func__); "none\n", __func__);
psta->dot118021XPrivacy = _NO_PRIVACY_; psta->dot118021XPrivacy = 0;
} }
set_pairwise_key(padapter, psta); set_pairwise_key(padapter, psta);
@ -798,15 +797,15 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev,
key_len)); key_len));
psecuritypriv->dot118021XGrpPrivacy = psecuritypriv->dot118021XGrpPrivacy =
_WEP40_; WLAN_CIPHER_SUITE_WEP40;
if (param->u.crypt.key_len == 13) { if (param->u.crypt.key_len == 13) {
psecuritypriv-> psecuritypriv->
dot118021XGrpPrivacy = dot118021XGrpPrivacy =
_WEP104_; WLAN_CIPHER_SUITE_WEP104;
} }
} else if (!strcmp(param->u.crypt.alg, "TKIP")) { } else if (!strcmp(param->u.crypt.alg, "TKIP")) {
psecuritypriv->dot118021XGrpPrivacy = psecuritypriv->dot118021XGrpPrivacy =
_TKIP_; WLAN_CIPHER_SUITE_TKIP;
memcpy(psecuritypriv-> memcpy(psecuritypriv->
dot118021XGrpKey[param->u.crypt. dot118021XGrpKey[param->u.crypt.
@ -835,7 +834,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev,
} else if (!strcmp(param->u.crypt.alg, "CCMP")) { } else if (!strcmp(param->u.crypt.alg, "CCMP")) {
psecuritypriv->dot118021XGrpPrivacy = psecuritypriv->dot118021XGrpPrivacy =
_AES_; WLAN_CIPHER_SUITE_CCMP;
memcpy(psecuritypriv-> memcpy(psecuritypriv->
dot118021XGrpKey[param->u.crypt. dot118021XGrpKey[param->u.crypt.
@ -846,7 +845,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev,
key_len)); key_len));
} else { } else {
psecuritypriv->dot118021XGrpPrivacy = psecuritypriv->dot118021XGrpPrivacy =
_NO_PRIVACY_; 0;
} }
psecuritypriv->dot118021XGrpKeyid = psecuritypriv->dot118021XGrpKeyid =
@ -932,12 +931,12 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev,
psecuritypriv->ndisencryptstatus = psecuritypriv->ndisencryptstatus =
Ndis802_11Encryption1Enabled; Ndis802_11Encryption1Enabled;
psecuritypriv->dot11PrivacyAlgrthm = _WEP40_; psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP40;
psecuritypriv->dot118021XGrpPrivacy = _WEP40_; psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP40;
if (wep_key_len == 13) { if (wep_key_len == 13) {
psecuritypriv->dot11PrivacyAlgrthm = _WEP104_; psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP104;
psecuritypriv->dot118021XGrpPrivacy = _WEP104_; psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP104;
} }
psecuritypriv->dot11PrivacyKeyIndex = wep_key_idx; psecuritypriv->dot11PrivacyKeyIndex = wep_key_idx;
@ -1203,18 +1202,18 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
__func__, ndev->name, key_index, unicast, multicast); __func__, ndev->name, key_index, unicast, multicast);
if ((key_index < WEP_KEYS) && if ((key_index < WEP_KEYS) &&
((psecuritypriv->dot11PrivacyAlgrthm == _WEP40_) || ((psecuritypriv->dot11PrivacyAlgrthm == WLAN_CIPHER_SUITE_WEP40) ||
(psecuritypriv->dot11PrivacyAlgrthm == _WEP104_))) { (psecuritypriv->dot11PrivacyAlgrthm == WLAN_CIPHER_SUITE_WEP104))) {
/* set wep default key */ /* set wep default key */
psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled; psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled;
psecuritypriv->dot11PrivacyKeyIndex = key_index; psecuritypriv->dot11PrivacyKeyIndex = key_index;
psecuritypriv->dot11PrivacyAlgrthm = _WEP40_; psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP40;
psecuritypriv->dot118021XGrpPrivacy = _WEP40_; psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP40;
if (psecuritypriv->dot11DefKeylen[key_index] == 13) { if (psecuritypriv->dot11DefKeylen[key_index] == 13) {
psecuritypriv->dot11PrivacyAlgrthm = _WEP104_; psecuritypriv->dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP104;
psecuritypriv->dot118021XGrpPrivacy = _WEP104_; psecuritypriv->dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP104;
} }
/* set the flag to represent that wep default key /* set the flag to represent that wep default key
@ -1705,30 +1704,30 @@ static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv,
DBG_8723A("%s, ucast =%d, cipher = 0x%x\n", __func__, ucast, cipher); DBG_8723A("%s, ucast =%d, cipher = 0x%x\n", __func__, ucast, cipher);
if (!cipher) { if (!cipher) {
*profile_cipher = _NO_PRIVACY_; *profile_cipher = 0;
psecuritypriv->ndisencryptstatus = ndisencryptstatus; psecuritypriv->ndisencryptstatus = ndisencryptstatus;
return 0; return 0;
} }
switch (cipher) { switch (cipher) {
case IW_AUTH_CIPHER_NONE: case IW_AUTH_CIPHER_NONE:
*profile_cipher = _NO_PRIVACY_; *profile_cipher = 0;
ndisencryptstatus = Ndis802_11EncryptionDisabled; ndisencryptstatus = Ndis802_11EncryptionDisabled;
break; break;
case WLAN_CIPHER_SUITE_WEP40: case WLAN_CIPHER_SUITE_WEP40:
*profile_cipher = _WEP40_; *profile_cipher = WLAN_CIPHER_SUITE_WEP40;
ndisencryptstatus = Ndis802_11Encryption1Enabled; ndisencryptstatus = Ndis802_11Encryption1Enabled;
break; break;
case WLAN_CIPHER_SUITE_WEP104: case WLAN_CIPHER_SUITE_WEP104:
*profile_cipher = _WEP104_; *profile_cipher = WLAN_CIPHER_SUITE_WEP104;
ndisencryptstatus = Ndis802_11Encryption1Enabled; ndisencryptstatus = Ndis802_11Encryption1Enabled;
break; break;
case WLAN_CIPHER_SUITE_TKIP: case WLAN_CIPHER_SUITE_TKIP:
*profile_cipher = _TKIP_; *profile_cipher = WLAN_CIPHER_SUITE_TKIP;
ndisencryptstatus = Ndis802_11Encryption2Enabled; ndisencryptstatus = Ndis802_11Encryption2Enabled;
break; break;
case WLAN_CIPHER_SUITE_CCMP: case WLAN_CIPHER_SUITE_CCMP:
*profile_cipher = _AES_; *profile_cipher = WLAN_CIPHER_SUITE_CCMP;
ndisencryptstatus = Ndis802_11Encryption3Enabled; ndisencryptstatus = Ndis802_11Encryption3Enabled;
break; break;
default: default:
@ -1838,27 +1837,27 @@ static int rtw_cfg80211_set_wpa_ie(struct rtw_adapter *padapter, const u8 *pie,
switch (group_cipher) { switch (group_cipher) {
case WPA_CIPHER_NONE: case WPA_CIPHER_NONE:
padapter->securitypriv.dot118021XGrpPrivacy = _NO_PRIVACY_; padapter->securitypriv.dot118021XGrpPrivacy = 0;
padapter->securitypriv.ndisencryptstatus = padapter->securitypriv.ndisencryptstatus =
Ndis802_11EncryptionDisabled; Ndis802_11EncryptionDisabled;
break; break;
case WPA_CIPHER_WEP40: case WPA_CIPHER_WEP40:
padapter->securitypriv.dot118021XGrpPrivacy = _WEP40_; padapter->securitypriv.dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP40;
padapter->securitypriv.ndisencryptstatus = padapter->securitypriv.ndisencryptstatus =
Ndis802_11Encryption1Enabled; Ndis802_11Encryption1Enabled;
break; break;
case WPA_CIPHER_TKIP: case WPA_CIPHER_TKIP:
padapter->securitypriv.dot118021XGrpPrivacy = _TKIP_; padapter->securitypriv.dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_TKIP;
padapter->securitypriv.ndisencryptstatus = padapter->securitypriv.ndisencryptstatus =
Ndis802_11Encryption2Enabled; Ndis802_11Encryption2Enabled;
break; break;
case WPA_CIPHER_CCMP: case WPA_CIPHER_CCMP:
padapter->securitypriv.dot118021XGrpPrivacy = _AES_; padapter->securitypriv.dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_CCMP;
padapter->securitypriv.ndisencryptstatus = padapter->securitypriv.ndisencryptstatus =
Ndis802_11Encryption3Enabled; Ndis802_11Encryption3Enabled;
break; break;
case WPA_CIPHER_WEP104: case WPA_CIPHER_WEP104:
padapter->securitypriv.dot118021XGrpPrivacy = _WEP104_; padapter->securitypriv.dot118021XGrpPrivacy = WLAN_CIPHER_SUITE_WEP104;
padapter->securitypriv.ndisencryptstatus = padapter->securitypriv.ndisencryptstatus =
Ndis802_11Encryption1Enabled; Ndis802_11Encryption1Enabled;
break; break;
@ -1866,27 +1865,27 @@ static int rtw_cfg80211_set_wpa_ie(struct rtw_adapter *padapter, const u8 *pie,
switch (pairwise_cipher) { switch (pairwise_cipher) {
case WPA_CIPHER_NONE: case WPA_CIPHER_NONE:
padapter->securitypriv.dot11PrivacyAlgrthm = _NO_PRIVACY_; padapter->securitypriv.dot11PrivacyAlgrthm = 0;
padapter->securitypriv.ndisencryptstatus = padapter->securitypriv.ndisencryptstatus =
Ndis802_11EncryptionDisabled; Ndis802_11EncryptionDisabled;
break; break;
case WPA_CIPHER_WEP40: case WPA_CIPHER_WEP40:
padapter->securitypriv.dot11PrivacyAlgrthm = _WEP40_; padapter->securitypriv.dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP40;
padapter->securitypriv.ndisencryptstatus = padapter->securitypriv.ndisencryptstatus =
Ndis802_11Encryption1Enabled; Ndis802_11Encryption1Enabled;
break; break;
case WPA_CIPHER_TKIP: case WPA_CIPHER_TKIP:
padapter->securitypriv.dot11PrivacyAlgrthm = _TKIP_; padapter->securitypriv.dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_TKIP;
padapter->securitypriv.ndisencryptstatus = padapter->securitypriv.ndisencryptstatus =
Ndis802_11Encryption2Enabled; Ndis802_11Encryption2Enabled;
break; break;
case WPA_CIPHER_CCMP: case WPA_CIPHER_CCMP:
padapter->securitypriv.dot11PrivacyAlgrthm = _AES_; padapter->securitypriv.dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_CCMP;
padapter->securitypriv.ndisencryptstatus = padapter->securitypriv.ndisencryptstatus =
Ndis802_11Encryption3Enabled; Ndis802_11Encryption3Enabled;
break; break;
case WPA_CIPHER_WEP104: case WPA_CIPHER_WEP104:
padapter->securitypriv.dot11PrivacyAlgrthm = _WEP104_; padapter->securitypriv.dot11PrivacyAlgrthm = WLAN_CIPHER_SUITE_WEP104;
padapter->securitypriv.ndisencryptstatus = padapter->securitypriv.ndisencryptstatus =
Ndis802_11Encryption1Enabled; Ndis802_11Encryption1Enabled;
break; break;
@ -1911,9 +1910,10 @@ static int rtw_cfg80211_set_wpa_ie(struct rtw_adapter *padapter, const u8 *pie,
} }
/* TKIP and AES disallow multicast packets until installing group key */ /* TKIP and AES disallow multicast packets until installing group key */
if (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_ || if (padapter->securitypriv.dot11PrivacyAlgrthm ==
padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_ || WLAN_CIPHER_SUITE_TKIP ||
padapter->securitypriv.dot11PrivacyAlgrthm == _AES_) padapter->securitypriv.dot11PrivacyAlgrthm ==
WLAN_CIPHER_SUITE_CCMP)
/* WPS open need to enable multicast */ /* WPS open need to enable multicast */
/* check_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS) == true)*/ /* check_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS) == true)*/
rtl8723a_off_rcr_am(padapter); rtl8723a_off_rcr_am(padapter);
@ -2068,8 +2068,8 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
} }
psecuritypriv->ndisencryptstatus = Ndis802_11EncryptionDisabled; psecuritypriv->ndisencryptstatus = Ndis802_11EncryptionDisabled;
psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_; psecuritypriv->dot11PrivacyAlgrthm = 0;
psecuritypriv->dot118021XGrpPrivacy = _NO_PRIVACY_; psecuritypriv->dot118021XGrpPrivacy = 0;
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open;
psecuritypriv->ndisauthtype = Ndis802_11AuthModeOpen; psecuritypriv->ndisauthtype = Ndis802_11AuthModeOpen;
@ -2135,9 +2135,9 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
if (wep_key_len == 13) { if (wep_key_len == 13) {
padapter->securitypriv.dot11PrivacyAlgrthm = padapter->securitypriv.dot11PrivacyAlgrthm =
_WEP104_; WLAN_CIPHER_SUITE_WEP104;
padapter->securitypriv.dot118021XGrpPrivacy = padapter->securitypriv.dot118021XGrpPrivacy =
_WEP104_; WLAN_CIPHER_SUITE_WEP104;
} }
} else { } else {
ret = -EINVAL; ret = -EINVAL;

View file

@ -60,10 +60,10 @@ void rtw_reset_securitypriv23a(struct rtw_adapter *adapter)
/* open system */ /* open system */
psec_priv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; psec_priv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open;
psec_priv->dot11PrivacyAlgrthm = _NO_PRIVACY_; psec_priv->dot11PrivacyAlgrthm = 0;
psec_priv->dot11PrivacyKeyIndex = 0; psec_priv->dot11PrivacyKeyIndex = 0;
psec_priv->dot118021XGrpPrivacy = _NO_PRIVACY_; psec_priv->dot118021XGrpPrivacy = 0;
psec_priv->dot118021XGrpKeyid = 1; psec_priv->dot118021XGrpKeyid = 1;
psec_priv->ndisauthtype = Ndis802_11AuthModeOpen; psec_priv->ndisauthtype = Ndis802_11AuthModeOpen;

View file

@ -405,11 +405,11 @@ static int rtw_init_default_value(struct rtw_adapter *padapter)
/* open system */ /* open system */
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open;
psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_; psecuritypriv->dot11PrivacyAlgrthm = 0;
psecuritypriv->dot11PrivacyKeyIndex = 0; psecuritypriv->dot11PrivacyKeyIndex = 0;
psecuritypriv->dot118021XGrpPrivacy = _NO_PRIVACY_; psecuritypriv->dot118021XGrpPrivacy = 0;
psecuritypriv->dot118021XGrpKeyid = 1; psecuritypriv->dot118021XGrpKeyid = 1;
psecuritypriv->ndisauthtype = Ndis802_11AuthModeOpen; psecuritypriv->ndisauthtype = Ndis802_11AuthModeOpen;