diff options
Diffstat (limited to 'drivers/staging/rtl8723bs/os_dep/ioctl_linux.c')
-rw-r--r-- | drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 161 |
1 files changed, 58 insertions, 103 deletions
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c index 40a3157fb735..c81b30f1f1b0 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c @@ -13,7 +13,7 @@ #include <linux/jiffies.h> #include <linux/kernel.h> -#define RTL_IOCTL_WPA_SUPPLICANT (SIOCIWFIRSTPRIV+30) +#define RTL_IOCTL_WPA_SUPPLICANT (SIOCIWFIRSTPRIV + 30) static int wpa_set_auth_algs(struct net_device *dev, u32 value) { @@ -40,7 +40,6 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value) } return ret; - } static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, u32 param_len) @@ -80,7 +79,6 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, } if (strcmp(param->u.crypt.alg, "WEP") == 0) { - padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; padapter->securitypriv.dot11PrivacyAlgrthm = _WEP40_; padapter->securitypriv.dot118021XGrpPrivacy = _WEP40_; @@ -127,7 +125,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, goto exit; } - memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->key_material, pwep->key_length); + 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); } @@ -149,7 +147,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, psta->ieee8021x_blocked = false; if ((padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption2Enabled) || - (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { + (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm; } @@ -158,8 +156,8 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, if (strcmp(param->u.crypt.alg, "TKIP") == 0) { /* set mic key */ /* DEBUG_ERR(("\nset key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len)); */ - memcpy(psta->dot11tkiptxmickey.skey, &(param->u.crypt.key[16]), 8); - memcpy(psta->dot11tkiprxmickey.skey, &(param->u.crypt.key[24]), 8); + memcpy(psta->dot11tkiptxmickey.skey, ¶m->u.crypt.key[16], 8); + memcpy(psta->dot11tkiprxmickey.skey, ¶m->u.crypt.key[24], 8); padapter->securitypriv.busetkipkey = false; /* _set_timer(&padapter->securitypriv.tkip_timer, 50); */ @@ -171,8 +169,8 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, memcpy(padapter->securitypriv.dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); /* only TKIP group key need to install this */ if (param->u.crypt.key_len > 16) { - memcpy(padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[16]), 8); - memcpy(padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24]), 8); + memcpy(padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey, ¶m->u.crypt.key[16], 8); + memcpy(padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey, ¶m->u.crypt.key[24], 8); } padapter->securitypriv.binstallGrpkey = true; @@ -202,7 +200,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, pbcmc_sta->ieee8021x_blocked = false; if ((padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption2Enabled) || - (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { + (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { pbcmc_sta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm; } } @@ -317,18 +315,18 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie while (cnt < ielen) { eid = buf[cnt]; - if ((eid == WLAN_EID_VENDOR_SPECIFIC) && (!memcmp(&buf[cnt+2], wps_oui, 4))) { - padapter->securitypriv.wps_ie_len = ((buf[cnt+1]+2) < MAX_WPS_IE_LEN) ? (buf[cnt+1]+2):MAX_WPS_IE_LEN; + if ((eid == WLAN_EID_VENDOR_SPECIFIC) && (!memcmp(&buf[cnt + 2], wps_oui, 4))) { + padapter->securitypriv.wps_ie_len = ((buf[cnt + 1] + 2) < MAX_WPS_IE_LEN) ? (buf[cnt + 1] + 2) : MAX_WPS_IE_LEN; memcpy(padapter->securitypriv.wps_ie, &buf[cnt], padapter->securitypriv.wps_ie_len); set_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS); - cnt += buf[cnt+1]+2; + cnt += buf[cnt + 1] + 2; break; } else { - cnt += buf[cnt+1]+2; /* goto next */ + cnt += buf[cnt + 1] + 2; /* goto next */ } } } @@ -336,8 +334,8 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie /* TKIP and AES disallow multicast packets until installing group key */ if (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_ || - padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_ || - padapter->securitypriv.dot11PrivacyAlgrthm == _AES_) + padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_ || + padapter->securitypriv.dot11PrivacyAlgrthm == _AES_) /* WPS open need to enable multicast */ /* check_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS) == true) */ rtw_hal_set_hwreg(padapter, HW_VAR_OFF_RCR_AM, null_addr); @@ -361,7 +359,7 @@ static int wpa_set_param(struct net_device *dev, u8 name, u32 value) /* ret = ieee80211_wpa_enable(ieee, value); */ - switch ((value)&0xff) { + switch ((value) & 0xff) { case 1: /* WPA */ padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPAPSK; /* WPA_PSK */ padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption2Enabled; @@ -392,7 +390,6 @@ static int wpa_set_param(struct net_device *dev, u8 name, u32 value) * be set. */ break; - } case IEEE_PARAM_PRIVACY_INVOKED: @@ -426,17 +423,12 @@ static int wpa_set_param(struct net_device *dev, u8 name, u32 value) default: - - ret = -EOPNOTSUPP; - break; - } return ret; - } static int wpa_mlme(struct net_device *dev, u32 command, u32 reason) @@ -465,7 +457,6 @@ static int wpa_mlme(struct net_device *dev, u32 command, u32 reason) } return ret; - } static int wpa_supplicant_ioctl(struct net_device *dev, struct iw_point *p) @@ -488,7 +479,6 @@ static int wpa_supplicant_ioctl(struct net_device *dev, struct iw_point *p) } switch (param->cmd) { - case IEEE_CMD_SET_WPA_PARAM: ret = wpa_set_param(dev, param->u.wpa_param.name, param->u.wpa_param.value); break; @@ -509,7 +499,6 @@ static int wpa_supplicant_ioctl(struct net_device *dev, struct iw_point *p) default: ret = -EOPNOTSUPP; break; - } if (ret == 0 && copy_to_user(p->pointer, param, p->length)) @@ -529,7 +518,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, struct sta_info *psta = NULL, *pbcmc_sta = NULL; struct adapter *padapter = rtw_netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct security_priv *psecuritypriv = &(padapter->securitypriv); + struct security_priv *psecuritypriv = &padapter->securitypriv; struct sta_priv *pstapriv = &padapter->stapriv; char *txkey = padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey; char *rxkey = padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey; @@ -570,7 +559,6 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, goto exit; } - if (strcmp(param->u.crypt.alg, "WEP") == 0 && !psta) { wep_key_idx = param->u.crypt.idx; wep_key_len = param->u.crypt.key_len; @@ -580,7 +568,6 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, goto exit; } - 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, key_material); @@ -591,7 +578,6 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, pwep->key_length = wep_key_len; pwep->length = wep_total_len; - } pwep->key_index = wep_key_idx; @@ -609,10 +595,9 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, psecuritypriv->dot118021XGrpPrivacy = _WEP104_; } - psecuritypriv->dot11PrivacyKeyIndex = wep_key_idx; - memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->key_material, pwep->key_length); + memcpy(&psecuritypriv->dot11DefKey[wep_key_idx].skey[0], pwep->key_material, pwep->key_length); psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->key_length; @@ -621,7 +606,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, /* 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->key_material, pwep->key_length); + memcpy(&psecuritypriv->dot11DefKey[wep_key_idx].skey[0], pwep->key_material, pwep->key_length); psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->key_length; @@ -629,10 +614,8 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, } goto exit; - } - if (!psta && check_fwstate(pmlmepriv, WIFI_AP_STATE)) { /* group key */ if (param->u.crypt.set_tx == 1) { if (strcmp(param->u.crypt.alg, "WEP") == 0) { @@ -640,7 +623,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, psecuritypriv->dot118021XGrpPrivacy = _WEP40_; if (param->u.crypt.key_len == 13) - psecuritypriv->dot118021XGrpPrivacy = _WEP104_; + psecuritypriv->dot118021XGrpPrivacy = _WEP104_; } else if (strcmp(param->u.crypt.alg, "TKIP") == 0) { psecuritypriv->dot118021XGrpPrivacy = _TKIP_; @@ -649,13 +632,12 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ /* set mic key */ - memcpy(txkey, &(param->u.crypt.key[16]), 8); - memcpy(psecuritypriv->dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24]), 8); + memcpy(txkey, ¶m->u.crypt.key[16], 8); + memcpy(psecuritypriv->dot118021XGrprxmickey[param->u.crypt.idx].skey, ¶m->u.crypt.key[24], 8); psecuritypriv->busetkipkey = true; - } - else if (strcmp(param->u.crypt.alg, "CCMP") == 0) { + } else if (strcmp(param->u.crypt.alg, "CCMP") == 0) { psecuritypriv->dot118021XGrpPrivacy = _AES_; memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); @@ -679,7 +661,6 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, } goto exit; - } if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X && psta) { /* psk/802_1x */ @@ -696,13 +677,12 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ /* set mic key */ - memcpy(psta->dot11tkiptxmickey.skey, &(param->u.crypt.key[16]), 8); - memcpy(psta->dot11tkiprxmickey.skey, &(param->u.crypt.key[24]), 8); + memcpy(psta->dot11tkiptxmickey.skey, ¶m->u.crypt.key[16], 8); + memcpy(psta->dot11tkiprxmickey.skey, ¶m->u.crypt.key[24], 8); psecuritypriv->busetkipkey = true; } else if (strcmp(param->u.crypt.alg, "CCMP") == 0) { - psta->dot118021XPrivacy = _AES_; } else { psta->dot118021XPrivacy = _NO_PRIVACY_; @@ -726,8 +706,8 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ /* set mic key */ - memcpy(txkey, &(param->u.crypt.key[16]), 8); - memcpy(rxkey, &(param->u.crypt.key[24]), 8); + memcpy(txkey, ¶m->u.crypt.key[16], 8); + memcpy(rxkey, ¶m->u.crypt.key[24], 8); psecuritypriv->busetkipkey = true; @@ -760,14 +740,13 @@ exit: kfree(pwep); return ret; - } static int rtw_set_beacon(struct net_device *dev, struct ieee_param *param, int len) { int ret = 0; struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct sta_priv *pstapriv = &padapter->stapriv; unsigned char *pbuf = param->u.bcn_ie.buf; @@ -779,15 +758,12 @@ static int rtw_set_beacon(struct net_device *dev, struct ieee_param *param, int if ((pstapriv->max_num_sta > NUM_STA) || (pstapriv->max_num_sta <= 0)) pstapriv->max_num_sta = NUM_STA; - - if (rtw_check_beacon_data(padapter, pbuf, (len-12-2)) == _SUCCESS)/* 12 = param header, 2:no packed */ + if (rtw_check_beacon_data(padapter, pbuf, (len - 12 - 2)) == _SUCCESS)/* 12 = param header, 2:no packed */ ret = 0; else ret = -EINVAL; - return ret; - } static void rtw_hostapd_sta_flush(struct net_device *dev) @@ -808,10 +784,10 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param) int ret = 0; struct sta_info *psta = NULL; struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct sta_priv *pstapriv = &padapter->stapriv; - if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true) + if (check_fwstate(pmlmepriv, (_FW_LINKED | WIFI_AP_STATE)) != true) return -EINVAL; if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff && @@ -838,9 +814,8 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param) memcpy(psta->bssrateset, param->u.add_sta.tx_supp_rates, 16); - /* check wmm cap. */ - if (WLAN_STA_WME&flags) + if (WLAN_STA_WME & flags) psta->qos_option = 1; else psta->qos_option = 0; @@ -849,7 +824,7 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param) psta->qos_option = 0; /* chec 802.11n ht cap. */ - if (WLAN_STA_HT&flags) { + if (WLAN_STA_HT & flags) { psta->htpriv.ht_option = true; psta->qos_option = 1; memcpy((void *)&psta->htpriv.ht_cap, (void *)¶m->u.add_sta.ht_cap, sizeof(struct ieee80211_ht_cap)); @@ -857,18 +832,16 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param) psta->htpriv.ht_option = false; } - if (pmlmepriv->htpriv.ht_option == false) + if (!pmlmepriv->htpriv.ht_option) psta->htpriv.ht_option = false; update_sta_info_apmode(padapter, psta); - } else { ret = -ENOMEM; } return ret; - } static int rtw_del_sta(struct net_device *dev, struct ieee_param *param) @@ -876,10 +849,10 @@ static int rtw_del_sta(struct net_device *dev, struct ieee_param *param) int ret = 0; struct sta_info *psta = NULL; struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct sta_priv *pstapriv = &padapter->stapriv; - if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true) + if (check_fwstate(pmlmepriv, (_FW_LINKED | WIFI_AP_STATE)) != true) return -EINVAL; if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff && @@ -897,18 +870,15 @@ static int rtw_del_sta(struct net_device *dev, struct ieee_param *param) list_del_init(&psta->asoc_list); pstapriv->asoc_list_cnt--; updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING); - } spin_unlock_bh(&pstapriv->asoc_list_lock); associated_clients_update(padapter, updated); psta = NULL; - } return ret; - } static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *param, int len) @@ -916,12 +886,12 @@ static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *par int ret = 0; struct sta_info *psta = NULL; struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct sta_priv *pstapriv = &padapter->stapriv; struct ieee_param_ex *param_ex = (struct ieee_param_ex *)param; struct sta_data *psta_data = (struct sta_data *)param_ex->data; - if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true) + if (check_fwstate(pmlmepriv, (_FW_LINKED | WIFI_AP_STATE)) != true) return -EINVAL; if (param_ex->sta_addr[0] == 0xff && param_ex->sta_addr[1] == 0xff && @@ -963,13 +933,11 @@ static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *par psta_data->tx_bytes = psta->sta_stats.tx_bytes; psta_data->tx_drops = psta->sta_stats.tx_drops; - } else { ret = -1; } return ret; - } static int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param) @@ -977,10 +945,10 @@ static int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param) int ret = 0; struct sta_info *psta = NULL; struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct sta_priv *pstapriv = &padapter->stapriv; - if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true) + if (check_fwstate(pmlmepriv, (_FW_LINKED | WIFI_AP_STATE)) != true) return -EINVAL; if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff && @@ -997,7 +965,7 @@ static int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param) wpa_ie_len = psta->wpa_ie[1]; - copy_len = ((wpa_ie_len+2) > sizeof(psta->wpa_ie)) ? (sizeof(psta->wpa_ie)):(wpa_ie_len+2); + copy_len = ((wpa_ie_len + 2) > sizeof(psta->wpa_ie)) ? (sizeof(psta->wpa_ie)) : (wpa_ie_len + 2); param->u.wpa_ie.len = copy_len; @@ -1008,7 +976,6 @@ static int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param) } return ret; - } static int rtw_set_wps_beacon(struct net_device *dev, struct ieee_param *param, int len) @@ -1016,15 +983,14 @@ static int rtw_set_wps_beacon(struct net_device *dev, struct ieee_param *param, int ret = 0; unsigned char wps_oui[4] = {0x0, 0x50, 0xf2, 0x04}; struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; int ie_len; if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) return -EINVAL; - ie_len = len-12-2;/* 12 = param header, 2:no packed */ - + ie_len = len - 12 - 2;/* 12 = param header, 2:no packed */ kfree(pmlmepriv->wps_beacon_ie); pmlmepriv->wps_beacon_ie = NULL; @@ -1042,23 +1008,20 @@ static int rtw_set_wps_beacon(struct net_device *dev, struct ieee_param *param, pmlmeext->bstart_bss = true; } - return ret; - } static int rtw_set_wps_probe_resp(struct net_device *dev, struct ieee_param *param, int len) { int ret = 0; struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; int ie_len; if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) return -EINVAL; - ie_len = len-12-2;/* 12 = param header, 2:no packed */ - + ie_len = len - 12 - 2;/* 12 = param header, 2:no packed */ kfree(pmlmepriv->wps_probe_resp_ie); pmlmepriv->wps_probe_resp_ie = NULL; @@ -1072,23 +1035,20 @@ static int rtw_set_wps_probe_resp(struct net_device *dev, struct ieee_param *par memcpy(pmlmepriv->wps_probe_resp_ie, param->u.bcn_ie.buf, ie_len); } - return ret; - } static int rtw_set_wps_assoc_resp(struct net_device *dev, struct ieee_param *param, int len) { int ret = 0; struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; int ie_len; if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) return -EINVAL; - ie_len = len-12-2;/* 12 = param header, 2:no packed */ - + ie_len = len - 12 - 2;/* 12 = param header, 2:no packed */ kfree(pmlmepriv->wps_assoc_resp_ie); pmlmepriv->wps_assoc_resp_ie = NULL; @@ -1102,18 +1062,16 @@ static int rtw_set_wps_assoc_resp(struct net_device *dev, struct ieee_param *par memcpy(pmlmepriv->wps_assoc_resp_ie, param->u.bcn_ie.buf, ie_len); } - return ret; - } static int rtw_set_hidden_ssid(struct net_device *dev, struct ieee_param *param, int len) { int ret = 0; struct adapter *adapter = rtw_netdev_priv(dev); - struct mlme_priv *mlmepriv = &(adapter->mlmepriv); - struct mlme_ext_priv *mlmeext = &(adapter->mlmeextpriv); - struct mlme_ext_info *mlmeinfo = &(mlmeext->mlmext_info); + struct mlme_priv *mlmepriv = &adapter->mlmepriv; + struct mlme_ext_priv *mlmeext = &adapter->mlmeextpriv; + struct mlme_ext_info *mlmeinfo = &mlmeext->mlmext_info; int ie_len; u8 *ssid_ie; char ssid[NDIS_802_11_LENGTH_SSID + 1]; @@ -1128,14 +1086,14 @@ static int rtw_set_hidden_ssid(struct net_device *dev, struct ieee_param *param, mlmeinfo->hidden_ssid_mode = ignore_broadcast_ssid = param->u.bcn_ie.reserved[1]; - ie_len = len-12-2;/* 12 = param header, 2:no packed */ + ie_len = len - 12 - 2;/* 12 = param header, 2:no packed */ ssid_ie = rtw_get_ie(param->u.bcn_ie.buf, WLAN_EID_SSID, &ssid_len, ie_len); if (ssid_ie && ssid_len > 0 && ssid_len <= NDIS_802_11_LENGTH_SSID) { struct wlan_bssid_ex *pbss_network = &mlmepriv->cur_network.network; struct wlan_bssid_ex *pbss_network_ext = &mlmeinfo->network; - memcpy(ssid, ssid_ie+2, ssid_len); + memcpy(ssid, ssid_ie + 2, ssid_len); ssid[ssid_len] = 0x0; memcpy(pbss_network->ssid.ssid, (void *)ssid, ssid_len); @@ -1150,7 +1108,7 @@ static int rtw_set_hidden_ssid(struct net_device *dev, struct ieee_param *param, static int rtw_ioctl_acl_remove_sta(struct net_device *dev, struct ieee_param *param, int len) { struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) return -EINVAL; @@ -1163,13 +1121,12 @@ static int rtw_ioctl_acl_remove_sta(struct net_device *dev, struct ieee_param *p rtw_acl_remove_sta(padapter, param->sta_addr); return 0; - } static int rtw_ioctl_acl_add_sta(struct net_device *dev, struct ieee_param *param, int len) { struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) return -EINVAL; @@ -1181,14 +1138,13 @@ static int rtw_ioctl_acl_add_sta(struct net_device *dev, struct ieee_param *para } return rtw_acl_add_sta(padapter, param->sta_addr); - } static int rtw_ioctl_set_macaddr_acl(struct net_device *dev, struct ieee_param *param, int len) { int ret = 0; struct adapter *padapter = rtw_netdev_priv(dev); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) return -EINVAL; @@ -1205,9 +1161,9 @@ static int rtw_hostapd_ioctl(struct net_device *dev, struct iw_point *p) struct adapter *padapter = rtw_netdev_priv(dev); /* - * this function is expect to call in master mode, which allows no power saving - * so, we just check hw_init_completed - */ + * this function is expect to call in master mode, which allows no power saving + * so, we just check hw_init_completed + */ if (!padapter->hw_init_completed) return -EPERM; @@ -1312,7 +1268,6 @@ static int rtw_hostapd_ioctl(struct net_device *dev, struct iw_point *p) default: ret = -EOPNOTSUPP; break; - } if (ret == 0 && copy_to_user(p->pointer, param, p->length)) |