OSDN Git Service

staging: rtl8723au: Use ieee80211.h defines for IV/ICV len values
authorJes Sorensen <Jes.Sorensen@redhat.com>
Sun, 25 May 2014 20:43:02 +0000 (22:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 May 2014 22:14:38 +0000 (15:14 -0700)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_mlme_ext.c
drivers/staging/rtl8723au/core/rtw_recv.c
drivers/staging/rtl8723au/core/rtw_xmit.c

index b78e453..b0f218b 100644 (file)
@@ -3085,7 +3085,7 @@ static void issue_auth(struct rtw_adapter *padapter, struct sta_info *psta,
                                                     (unsigned char *)&val32,
                                                     &pattrib->pktlen);
 
-                       pattrib->iv_len = 4;
+                       pattrib->iv_len = IEEE80211_WEP_IV_LEN;
                }
 
                pframe = rtw_set_fixed_ie23a(pframe, _AUTH_ALGM_NUM_,
@@ -3121,7 +3121,7 @@ static void issue_auth(struct rtw_adapter *padapter, struct sta_info *psta,
 
                        pattrib->encrypt = WLAN_CIPHER_SUITE_WEP40;
 
-                       pattrib->icv_len = 4;
+                       pattrib->icv_len = IEEE80211_WEP_ICV_LEN;
 
                        pattrib->pktlen += pattrib->icv_len;
                }
index 3275287..24fa288 100644 (file)
@@ -1410,16 +1410,16 @@ static int validate_recv_data_frame(struct rtw_adapter *adapter,
                {
                case WLAN_CIPHER_SUITE_WEP40:
                case WLAN_CIPHER_SUITE_WEP104:
-                       pattrib->iv_len = 4;
-                       pattrib->icv_len = 4;
+                       pattrib->iv_len = IEEE80211_WEP_IV_LEN;
+                       pattrib->icv_len = IEEE80211_WEP_ICV_LEN;
                        break;
                case WLAN_CIPHER_SUITE_TKIP:
-                       pattrib->iv_len = 8;
-                       pattrib->icv_len = 4;
+                       pattrib->iv_len = IEEE80211_TKIP_IV_LEN;
+                       pattrib->icv_len = IEEE80211_TKIP_ICV_LEN;
                        break;
                case WLAN_CIPHER_SUITE_CCMP:
-                       pattrib->iv_len = 8;
-                       pattrib->icv_len = 8;
+                       pattrib->iv_len = IEEE80211_CCMP_HDR_LEN;
+                       pattrib->icv_len = IEEE80211_CCMP_MIC_LEN;
                        break;
                default:
                        pattrib->iv_len = 0;
index 3869386..0c66d35 100644 (file)
@@ -597,13 +597,13 @@ static int update_attrib(struct rtw_adapter *padapter,
        switch (pattrib->encrypt) {
        case WLAN_CIPHER_SUITE_WEP40:
        case WLAN_CIPHER_SUITE_WEP104:
-               pattrib->iv_len = 4;
-               pattrib->icv_len = 4;
+               pattrib->iv_len = IEEE80211_WEP_IV_LEN;
+               pattrib->icv_len = IEEE80211_WEP_ICV_LEN;
                break;
 
        case WLAN_CIPHER_SUITE_TKIP:
-               pattrib->iv_len = 8;
-               pattrib->icv_len = 4;
+               pattrib->iv_len = IEEE80211_TKIP_IV_LEN;
+               pattrib->icv_len = IEEE80211_TKIP_ICV_LEN;
 
                if (!padapter->securitypriv.busetkipkey) {
                        RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_,
@@ -619,8 +619,8 @@ static int update_attrib(struct rtw_adapter *padapter,
                RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_,
                         ("pattrib->encrypt =%d (WLAN_CIPHER_SUITE_CCMP)\n",
                          pattrib->encrypt));
-               pattrib->iv_len = 8;
-               pattrib->icv_len = 8;
+               pattrib->iv_len = IEEE80211_CCMP_HDR_LEN;
+               pattrib->icv_len = IEEE80211_CCMP_MIC_LEN;
                break;
 
        default: