aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/rtl8712/rtl871x_ioctl_linux.c')
-rw-r--r--drivers/staging/rtl8712/rtl871x_ioctl_linux.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index 363b82e3e7c6..df6ae855f3c1 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -211,11 +211,10 @@ static char *translate_scan(struct _adapter *padapter,
char *start, char *stop)
{
struct iw_event iwe;
- struct ieee80211_ht_cap *pht_capie;
char *current_val;
s8 *p;
u32 i = 0, ht_ielen = 0;
- u16 cap, ht_cap = false, mcs_rate;
+ u16 cap, ht_cap = false;
u8 rssi;
if ((pnetwork->network.Configuration.DSConfig < 1) ||
@@ -239,11 +238,8 @@ static char *translate_scan(struct _adapter *padapter,
/* parsing HT_CAP_IE */
p = r8712_get_ie(&pnetwork->network.IEs[12], _HT_CAPABILITY_IE_,
&ht_ielen, pnetwork->network.IELength - 12);
- if (p && ht_ielen > 0) {
+ if (p && ht_ielen > 0)
ht_cap = true;
- pht_capie = (struct ieee80211_ht_cap *)(p + 2);
- memcpy(&mcs_rate, pht_capie->supp_mcs_set, 2);
- }
/* Add the protocol name */
iwe.cmd = SIOCGIWNAME;
if (r8712_is_cckratesonly_included(pnetwork->network.rates)) {
@@ -268,8 +264,8 @@ static char *translate_scan(struct _adapter *padapter,
memcpy((u8 *)&cap, r8712_get_capability_from_ie(pnetwork->network.IEs),
2);
le16_to_cpus(&cap);
- if (cap & (WLAN_CAPABILITY_IBSS | WLAN_CAPABILITY_BSS)) {
- if (cap & WLAN_CAPABILITY_BSS)
+ if (cap & (WLAN_CAPABILITY_IBSS | WLAN_CAPABILITY_ESS)) {
+ if (cap & WLAN_CAPABILITY_ESS)
iwe.u.mode = (u32)IW_MODE_MASTER;
else
iwe.u.mode = (u32)IW_MODE_ADHOC;
@@ -410,7 +406,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
return -ENOMEM;
pwep->KeyLength = wep_key_len;
pwep->Length = wep_key_len +
- FIELD_OFFSET(struct NDIS_802_11_WEP, KeyMaterial);
+ offsetof(struct NDIS_802_11_WEP, KeyMaterial);
if (wep_key_len == 13) {
padapter->securitypriv.PrivacyAlgrthm = _WEP104_;
padapter->securitypriv.XGrpPrivacy = _WEP104_;
@@ -1395,7 +1391,7 @@ static int r8711_wx_get_rate(struct net_device *dev,
struct _adapter *padapter = netdev_priv(dev);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;
- struct ieee80211_ht_cap *pht_capie;
+ struct rtl_ieee80211_ht_cap *pht_capie;
unsigned char rf_type = padapter->registrypriv.rf_config;
int i;
u8 *p;
@@ -1411,10 +1407,10 @@ static int r8711_wx_get_rate(struct net_device *dev,
pcur_bss->IELength - 12);
if (p && ht_ielen > 0) {
ht_cap = true;
- pht_capie = (struct ieee80211_ht_cap *)(p + 2);
+ pht_capie = (struct rtl_ieee80211_ht_cap *)(p + 2);
memcpy(&mcs_rate, pht_capie->supp_mcs_set, 2);
bw_40MHz = (le16_to_cpu(pht_capie->cap_info) &
- IEEE80211_HT_CAP_SUP_WIDTH) ? 1 : 0;
+ IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1 : 0;
short_GI = (le16_to_cpu(pht_capie->cap_info) &
(IEEE80211_HT_CAP_SGI_20 |
IEEE80211_HT_CAP_SGI_40)) ? 1 : 0;
@@ -1558,7 +1554,7 @@ static int r8711_wx_set_enc(struct net_device *dev,
if (erq->length > 0) {
wep.KeyLength = erq->length <= 5 ? 5 : 13;
wep.Length = wep.KeyLength +
- FIELD_OFFSET(struct NDIS_802_11_WEP, KeyMaterial);
+ offsetof(struct NDIS_802_11_WEP, KeyMaterial);
} else {
wep.KeyLength = 0;
if (keyindex_provided == 1) { /* set key_id only, no given