Commit f133717e authored by Fabio Aiuto's avatar Fabio Aiuto Committed by Greg Kroah-Hartman

staging: rtl8723bs: fix camel case in struct ndis_802_11_wep

fix camel case in struct ndis_802_11_wep all over the driver.
Signed-off-by: default avatarFabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/d3a1407e1bcb07d423dfa0c9bd33021a59bc0b61.1626874164.git.fabioaiuto83@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2ddaf7cf
......@@ -494,14 +494,14 @@ u8 rtw_set_802_11_add_wep(struct adapter *padapter, struct ndis_802_11_wep *wep)
struct security_priv *psecuritypriv = &(padapter->securitypriv);
u8 ret = _SUCCESS;
keyid = wep->KeyIndex & 0x3fffffff;
keyid = wep->key_index & 0x3fffffff;
if (keyid >= 4) {
ret = false;
goto exit;
}
switch (wep->KeyLength) {
switch (wep->key_length) {
case 5:
psecuritypriv->dot11PrivacyAlgrthm = _WEP40_;
break;
......@@ -513,9 +513,9 @@ u8 rtw_set_802_11_add_wep(struct adapter *padapter, struct ndis_802_11_wep *wep)
break;
}
memcpy(&(psecuritypriv->dot11DefKey[keyid].skey[0]), &(wep->KeyMaterial), wep->KeyLength);
memcpy(&(psecuritypriv->dot11DefKey[keyid].skey[0]), &(wep->key_material), wep->key_length);
psecuritypriv->dot11DefKeylen[keyid] = wep->KeyLength;
psecuritypriv->dot11DefKeylen[keyid] = wep->key_length;
psecuritypriv->dot11PrivacyKeyIndex = keyid;
......
......@@ -110,10 +110,10 @@ enum {
/* Key mapping keys require a BSSID */
struct ndis_802_11_wep {
u32 Length; /* Length of this structure */
u32 KeyIndex; /* 0 is the per-client key, 1-N are the global keys */
u32 KeyLength; /* length of key in bytes */
u8 KeyMaterial[16];/* variable length depending on above field */
u32 length; /* Length of this structure */
u32 key_index; /* 0 is the per-client key, 1-N are the global keys */
u32 key_length; /* length of key in bytes */
u8 key_material[16];/* variable length depending on above field */
};
/* mask for authentication/integrity fields */
......
......@@ -1874,7 +1874,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
if (wep_key_len > 0) {
wep_key_len = wep_key_len <= 5 ? 5 : 13;
wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial);
wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, key_material);
pwep = rtw_malloc(wep_total_len);
if (pwep == NULL) {
ret = -ENOMEM;
......@@ -1883,8 +1883,8 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
memset(pwep, 0, wep_total_len);
pwep->KeyLength = wep_key_len;
pwep->Length = wep_total_len;
pwep->key_length = wep_key_len;
pwep->length = wep_total_len;
if (wep_key_len == 13) {
padapter->securitypriv.dot11PrivacyAlgrthm = _WEP104_;
......@@ -1895,10 +1895,10 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
goto exit;
}
pwep->KeyIndex = wep_key_idx;
pwep->KeyIndex |= 0x80000000;
pwep->key_index = wep_key_idx;
pwep->key_index |= 0x80000000;
memcpy(pwep->KeyMaterial, (void *)sme->key, pwep->KeyLength);
memcpy(pwep->key_material, (void *)sme->key, pwep->key_length);
if (rtw_set_802_11_add_wep(padapter, pwep) == (u8)_FAIL)
ret = -EOPNOTSUPP;
......
......@@ -411,15 +411,15 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
if (wep_key_len > 0) {
wep_key_len = wep_key_len <= 5 ? 5 : 13;
wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial);
wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, key_material);
pwep = kzalloc(wep_total_len, GFP_KERNEL);
if (!pwep) {
ret = -ENOMEM;
goto exit;
}
pwep->KeyLength = wep_key_len;
pwep->Length = wep_total_len;
pwep->key_length = wep_key_len;
pwep->length = wep_total_len;
if (wep_key_len == 13) {
padapter->securitypriv.dot11PrivacyAlgrthm = _WEP104_;
......@@ -430,10 +430,10 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
goto exit;
}
pwep->KeyIndex = wep_key_idx;
pwep->KeyIndex |= 0x80000000;
pwep->key_index = wep_key_idx;
pwep->key_index |= 0x80000000;
memcpy(pwep->KeyMaterial, param->u.crypt.key, pwep->KeyLength);
memcpy(pwep->key_material, param->u.crypt.key, pwep->key_length);
if (param->u.crypt.set_tx) {
if (rtw_set_802_11_add_wep(padapter, pwep) == (u8)_FAIL)
......@@ -447,8 +447,8 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
goto exit;
}
memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->KeyMaterial, pwep->KeyLength);
psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->KeyLength;
memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->key_material, pwep->key_length);
psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->key_length;
rtw_set_key(padapter, psecuritypriv, wep_key_idx, 0, true);
}
......@@ -1667,15 +1667,15 @@ static int rtw_wx_set_enc(struct net_device *dev,
padapter->securitypriv.ndisauthtype = authmode;
}
wep.KeyIndex = key;
wep.key_index = key;
if (erq->length > 0) {
wep.KeyLength = erq->length <= 5 ? 5 : 13;
wep.key_length = erq->length <= 5 ? 5 : 13;
wep.Length = wep.KeyLength + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial);
wep.length = wep.key_length + FIELD_OFFSET(struct ndis_802_11_wep, key_material);
} else {
wep.KeyLength = 0;
wep.key_length = 0;
if (keyindex_provided == 1) { /* set key_id only, no given KeyMaterial(erq->length == 0). */
if (keyindex_provided == 1) { /* set key_id only, no given key_material(erq->length == 0). */
padapter->securitypriv.dot11PrivacyKeyIndex = key;
switch (padapter->securitypriv.dot11DefKeylen[key]) {
......@@ -1696,9 +1696,9 @@ static int rtw_wx_set_enc(struct net_device *dev,
}
wep.KeyIndex |= 0x80000000;
wep.key_index |= 0x80000000;
memcpy(wep.KeyMaterial, keybuf, wep.KeyLength);
memcpy(wep.key_material, keybuf, wep.key_length);
if (rtw_set_802_11_add_wep(padapter, &wep) == false) {
if (rf_on == pwrpriv->rf_pwrstate)
......@@ -2974,19 +2974,19 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param,
if (wep_key_len > 0) {
wep_key_len = wep_key_len <= 5 ? 5 : 13;
wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial);
wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, key_material);
pwep = kzalloc(wep_total_len, GFP_KERNEL);
if (!pwep)
goto exit;
pwep->KeyLength = wep_key_len;
pwep->Length = wep_total_len;
pwep->key_length = wep_key_len;
pwep->length = wep_total_len;
}
pwep->KeyIndex = wep_key_idx;
pwep->key_index = wep_key_idx;
memcpy(pwep->KeyMaterial, param->u.crypt.key, pwep->KeyLength);
memcpy(pwep->key_material, param->u.crypt.key, pwep->key_length);
if (param->u.crypt.set_tx) {
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Auto;
......@@ -2994,7 +2994,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param,
psecuritypriv->dot11PrivacyAlgrthm = _WEP40_;
psecuritypriv->dot118021XGrpPrivacy = _WEP40_;
if (pwep->KeyLength == 13) {
if (pwep->key_length == 13) {
psecuritypriv->dot11PrivacyAlgrthm = _WEP104_;
psecuritypriv->dot118021XGrpPrivacy = _WEP104_;
}
......@@ -3002,20 +3002,20 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param,
psecuritypriv->dot11PrivacyKeyIndex = wep_key_idx;
memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->KeyMaterial, pwep->KeyLength);
memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->key_material, pwep->key_length);
psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->KeyLength;
psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->key_length;
rtw_ap_set_wep_key(padapter, pwep->KeyMaterial, pwep->KeyLength, wep_key_idx, 1);
rtw_ap_set_wep_key(padapter, pwep->key_material, pwep->key_length, wep_key_idx, 1);
} else {
/* don't update "psecuritypriv->dot11PrivacyAlgrthm" and */
/* psecuritypriv->dot11PrivacyKeyIndex =keyid", but can rtw_set_key to cam */
memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->KeyMaterial, pwep->KeyLength);
memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->key_material, pwep->key_length);
psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->KeyLength;
psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->key_length;
rtw_ap_set_wep_key(padapter, pwep->KeyMaterial, pwep->KeyLength, wep_key_idx, 0);
rtw_ap_set_wep_key(padapter, pwep->key_material, pwep->key_length, wep_key_idx, 0);
}
goto exit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment