Commit 0996cf9c authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: rtl8723au: rtw_cfg80211_{ap_}set_encryption(): Add set_tx argument

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fd381874
...@@ -500,6 +500,7 @@ static int set_wep_key(struct rtw_adapter *padapter, const u8 *key, u16 keylen, ...@@ -500,6 +500,7 @@ static int set_wep_key(struct rtw_adapter *padapter, const u8 *key, u16 keylen,
} }
static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index,
int set_tx,
struct ieee_param *param, struct ieee_param *param,
u32 param_len, u32 param_len,
struct key_params *keyparms) struct key_params *keyparms)
...@@ -591,7 +592,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, ...@@ -591,7 +592,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index,
} }
if (!psta) { /* group key */ if (!psta) { /* group key */
if (param->u.crypt.set_tx == 0) { /* group key */ if (set_tx == 0) { /* group key */
if (keyparms->cipher == WLAN_CIPHER_SUITE_WEP40 || if (keyparms->cipher == WLAN_CIPHER_SUITE_WEP40 ||
keyparms->cipher == WLAN_CIPHER_SUITE_WEP104) { keyparms->cipher == WLAN_CIPHER_SUITE_WEP104) {
DBG_8723A("%s, set group_key, WEP\n", __func__); DBG_8723A("%s, set group_key, WEP\n", __func__);
...@@ -672,7 +673,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, ...@@ -672,7 +673,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index,
if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X && psta) { if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X && psta) {
/* psk/802_1x */ /* psk/802_1x */
if (param->u.crypt.set_tx == 1) { if (set_tx == 1) {
/* pairwise key */ /* pairwise key */
memcpy(psta->dot118021x_UncstKey.skey, memcpy(psta->dot118021x_UncstKey.skey,
keyparms->key, (key_len > 16 ? 16 : key_len)); keyparms->key, (key_len > 16 ? 16 : key_len));
...@@ -791,6 +792,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, ...@@ -791,6 +792,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index,
#endif #endif
static int rtw_cfg80211_set_encryption(struct net_device *dev, u8 key_index, static int rtw_cfg80211_set_encryption(struct net_device *dev, u8 key_index,
int set_tx,
struct ieee_param *param, u32 param_len, struct ieee_param *param, u32 param_len,
struct key_params *keyparms) struct key_params *keyparms)
{ {
...@@ -890,10 +892,10 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, u8 key_index, ...@@ -890,10 +892,10 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, u8 key_index,
dot11PrivacyAlgrthm; dot11PrivacyAlgrthm;
} }
if (param->u.crypt.set_tx == 1) { if (set_tx == 1) {
/* pairwise key */ /* pairwise key */
DBG_8723A("%s, : param->u.crypt.set_tx" DBG_8723A("%s, : set_tx == 1\n",
" == 1\n", __func__); __func__);
memcpy(psta->dot118021x_UncstKey.skey, memcpy(psta->dot118021x_UncstKey.skey,
keyparms->key, keyparms->key,
...@@ -977,7 +979,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, ...@@ -977,7 +979,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
char *alg_name; char *alg_name;
u32 param_len; u32 param_len;
struct ieee_param *param; struct ieee_param *param;
int ret = 0; int set_tx, ret = 0;
struct wireless_dev *rtw_wdev = wiphy_to_wdev(wiphy); struct wireless_dev *rtw_wdev = wiphy_to_wdev(wiphy);
struct rtw_adapter *padapter = wiphy_to_adapter(wiphy); struct rtw_adapter *padapter = wiphy_to_adapter(wiphy);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
...@@ -1022,11 +1024,10 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, ...@@ -1022,11 +1024,10 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
strncpy((char *)param->u.crypt.alg, alg_name, IEEE_CRYPT_ALG_NAME_LEN); strncpy((char *)param->u.crypt.alg, alg_name, IEEE_CRYPT_ALG_NAME_LEN);
if (!mac_addr || is_broadcast_ether_addr(mac_addr)) { if (!mac_addr || is_broadcast_ether_addr(mac_addr))
param->u.crypt.set_tx = 0; /* for wpa/wpa2 group key */ set_tx = 0; /* for wpa/wpa2 group key */
} else { else
param->u.crypt.set_tx = 1; /* for wpa/wpa2 pairwise key */ set_tx = 1; /* for wpa/wpa2 pairwise key */
}
/* param->u.crypt.idx = key_index - 1; */ /* param->u.crypt.idx = key_index - 1; */
param->u.crypt.idx = key_index; param->u.crypt.idx = key_index;
...@@ -1041,15 +1042,15 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, ...@@ -1041,15 +1042,15 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
} }
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
ret = rtw_cfg80211_set_encryption(ndev, key_index, param, ret = rtw_cfg80211_set_encryption(ndev, key_index, set_tx,
param_len, params); param, param_len, params);
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
#ifdef CONFIG_8723AU_AP_MODE #ifdef CONFIG_8723AU_AP_MODE
if (mac_addr) if (mac_addr)
ether_addr_copy(param->sta_addr, mac_addr); ether_addr_copy(param->sta_addr, mac_addr);
ret = rtw_cfg80211_ap_set_encryption(ndev, key_index, param, ret = rtw_cfg80211_ap_set_encryption(ndev, key_index, set_tx,
param_len, params); param, param_len, params);
#endif #endif
} else { } else {
DBG_8723A("error! fw_state = 0x%x, iftype =%d\n", DBG_8723A("error! fw_state = 0x%x, iftype =%d\n",
......
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