mirror of
https://github.com/torvalds/linux.git
synced 2024-12-26 12:52:30 +00:00
staging: rtl8187se: Delete commented code
Delete all commented code in ieee80211/ieee80211_wx.c that are not necessary. Signed-off-by: Ana Rey <anarey@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e73f0beb2d
commit
f6fd9e3c18
@ -62,17 +62,13 @@ static inline char *rtl818x_translate_scan(struct ieee80211_device *ieee,
|
||||
/* Add the ESSID */
|
||||
iwe.cmd = SIOCGIWESSID;
|
||||
iwe.u.data.flags = 1;
|
||||
//YJ,modified,080903,for hidden ap
|
||||
//if (network->flags & NETWORK_EMPTY_ESSID) {
|
||||
if (network->ssid_len == 0) {
|
||||
//YJ,modified,080903,end
|
||||
iwe.u.data.length = sizeof("<hidden>");
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, "<hidden>");
|
||||
} else {
|
||||
iwe.u.data.length = min(network->ssid_len, (u8)32);
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid);
|
||||
}
|
||||
//printk("ESSID: %s\n",network->ssid);
|
||||
/* Add the protocol name */
|
||||
iwe.cmd = SIOCGIWNAME;
|
||||
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11%s", ieee80211_modes[network->mode]);
|
||||
@ -92,8 +88,6 @@ static inline char *rtl818x_translate_scan(struct ieee80211_device *ieee,
|
||||
|
||||
/* Add frequency/channel */
|
||||
iwe.cmd = SIOCGIWFREQ;
|
||||
/* iwe.u.freq.m = ieee80211_frequency(network->channel, network->mode);
|
||||
iwe.u.freq.e = 3; */
|
||||
iwe.u.freq.m = network->channel;
|
||||
iwe.u.freq.e = 0;
|
||||
iwe.u.freq.i = 0;
|
||||
@ -148,7 +142,6 @@ static inline char *rtl818x_translate_scan(struct ieee80211_device *ieee,
|
||||
printk("========>signal:%d, rssi:%d\n", network->stats.signal,
|
||||
network->stats.rssi);
|
||||
iwe.cmd = IWEVQUAL;
|
||||
// printk("SIGNAL: %d,RSSI: %d,NOISE: %d\n",network->stats.signal,network->stats.rssi,network->stats.noise);
|
||||
iwe.u.qual.qual = network->stats.signalstrength;
|
||||
iwe.u.qual.level = network->stats.signal;
|
||||
iwe.u.qual.noise = network->stats.noise;
|
||||
@ -171,7 +164,6 @@ static inline char *rtl818x_translate_scan(struct ieee80211_device *ieee,
|
||||
|
||||
memset(&iwe, 0, sizeof(iwe));
|
||||
if (network->wpa_ie_len) {
|
||||
// printk("wpa_ie_len:%d\n", network->wpa_ie_len);
|
||||
char buf[MAX_WPA_IE_LEN];
|
||||
memcpy(buf, network->wpa_ie, network->wpa_ie_len);
|
||||
iwe.cmd = IWEVGENIE;
|
||||
@ -181,7 +173,6 @@ static inline char *rtl818x_translate_scan(struct ieee80211_device *ieee,
|
||||
|
||||
memset(&iwe, 0, sizeof(iwe));
|
||||
if (network->rsn_ie_len) {
|
||||
// printk("=====>rsn_ie_len:\n", network->rsn_ie_len);
|
||||
char buf[MAX_WPA_IE_LEN];
|
||||
memcpy(buf, network->rsn_ie, network->rsn_ie_len);
|
||||
iwe.cmd = IWEVGENIE;
|
||||
@ -210,8 +201,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
|
||||
unsigned long flags;
|
||||
int err = 0;
|
||||
char *ev = extra;
|
||||
char *stop = ev + wrqu->data.length;//IW_SCAN_MAX_DATA;
|
||||
//char *stop = ev + IW_SCAN_MAX_DATA;
|
||||
char *stop = ev + wrqu->data.length;
|
||||
int i = 0;
|
||||
|
||||
IEEE80211_DEBUG_WX("Getting scan\n");
|
||||
@ -306,8 +296,6 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
||||
|
||||
sec.enabled = 1;
|
||||
sec.flags |= SEC_ENABLED;
|
||||
|
||||
@ -362,7 +350,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
|
||||
* explicitly set */
|
||||
if (key == sec.active_key)
|
||||
sec.flags |= SEC_ACTIVE_KEY;
|
||||
ieee->tx_keyidx = key;//by wb 080312
|
||||
ieee->tx_keyidx = key;
|
||||
} else {
|
||||
len = (*crypt)->ops->get_key(sec.keys[key], WEP_KEY_LEN,
|
||||
NULL, (*crypt)->priv);
|
||||
@ -483,7 +471,6 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
|
||||
struct ieee80211_security sec = {
|
||||
.flags = 0,
|
||||
};
|
||||
//printk("======>encoding flag:%x,ext flag:%x, ext alg:%d\n", encoding->flags,ext->ext_flags, ext->alg);
|
||||
idx = encoding->flags & IW_ENCODE_INDEX;
|
||||
if (idx) {
|
||||
if (idx < 1 || idx > WEP_KEYS)
|
||||
@ -497,7 +484,6 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
|
||||
group_key = 1;
|
||||
} else {
|
||||
/* some Cisco APs use idx>0 for unicast in dynamic WEP */
|
||||
//printk("not group key, flags:%x, ext->alg:%d\n", ext->ext_flags, ext->alg);
|
||||
if (idx != 0 && ext->alg != IW_ENCODE_ALG_WEP)
|
||||
return -EINVAL;
|
||||
if (ieee->iw_mode == IW_MODE_INFRA)
|
||||
@ -506,7 +492,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
sec.flags |= SEC_ENABLED;// | SEC_ENCRYPT;
|
||||
sec.flags |= SEC_ENABLED;
|
||||
if ((encoding->flags & IW_ENCODE_DISABLED) ||
|
||||
ext->alg == IW_ENCODE_ALG_NONE) {
|
||||
if (*crypt)
|
||||
@ -518,16 +504,13 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
|
||||
|
||||
if (i == WEP_KEYS) {
|
||||
sec.enabled = 0;
|
||||
// sec.encrypt = 0;
|
||||
sec.level = SEC_LEVEL_0;
|
||||
sec.flags |= SEC_LEVEL;
|
||||
}
|
||||
//printk("disabled: flag:%x\n", encoding->flags);
|
||||
goto done;
|
||||
}
|
||||
|
||||
sec.enabled = 1;
|
||||
// sec.encrypt = 1;
|
||||
|
||||
switch (ext->alg) {
|
||||
case IW_ENCODE_ALG_WEP:
|
||||
@ -545,7 +528,6 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
// printk("8-09-08-9=====>%s, alg name:%s\n",__func__, alg);
|
||||
|
||||
ops = ieee80211_get_crypto_ops(alg);
|
||||
if (ops == NULL)
|
||||
@ -589,8 +571,6 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
|
||||
goto done;
|
||||
}
|
||||
#if 1
|
||||
//skip_host_crypt:
|
||||
//printk("skip_host_crypt:ext_flags:%x\n", ext->ext_flags);
|
||||
if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
|
||||
ieee->tx_keyidx = idx;
|
||||
sec.active_key = idx;
|
||||
@ -602,15 +582,12 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
|
||||
sec.key_sizes[idx] = ext->key_len;
|
||||
sec.flags |= (1 << idx);
|
||||
if (ext->alg == IW_ENCODE_ALG_WEP) {
|
||||
// sec.encode_alg[idx] = SEC_ALG_WEP;
|
||||
sec.flags |= SEC_LEVEL;
|
||||
sec.level = SEC_LEVEL_1;
|
||||
} else if (ext->alg == IW_ENCODE_ALG_TKIP) {
|
||||
// sec.encode_alg[idx] = SEC_ALG_TKIP;
|
||||
sec.flags |= SEC_LEVEL;
|
||||
sec.level = SEC_LEVEL_2;
|
||||
} else if (ext->alg == IW_ENCODE_ALG_CCMP) {
|
||||
// sec.encode_alg[idx] = SEC_ALG_CCMP;
|
||||
sec.flags |= SEC_LEVEL;
|
||||
sec.level = SEC_LEVEL_3;
|
||||
}
|
||||
@ -632,17 +609,16 @@ done:
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ieee80211_wx_set_mlme(struct ieee80211_device *ieee,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
struct iw_mlme *mlme = (struct iw_mlme *) extra;
|
||||
// printk("\ndkgadfslkdjgalskdf===============>%s(), cmd:%x\n", __func__, mlme->cmd);
|
||||
#if 1
|
||||
switch (mlme->cmd) {
|
||||
case IW_MLME_DEAUTH:
|
||||
case IW_MLME_DISASSOC:
|
||||
// printk("disassoc now\n");
|
||||
ieee80211_disassociate(ieee);
|
||||
break;
|
||||
default:
|
||||
@ -656,16 +632,9 @@ int ieee80211_wx_set_auth(struct ieee80211_device *ieee,
|
||||
struct iw_request_info *info,
|
||||
struct iw_param *data, char *extra)
|
||||
{
|
||||
/*
|
||||
struct ieee80211_security sec = {
|
||||
.flags = SEC_AUTH_MODE,
|
||||
}
|
||||
*/
|
||||
//printk("set auth:flag:%x, data value:%x\n", data->flags, data->value);
|
||||
switch (data->flags & IW_AUTH_INDEX) {
|
||||
case IW_AUTH_WPA_VERSION:
|
||||
/*need to support wpa2 here*/
|
||||
//printk("wpa version:%x\n", data->value);
|
||||
break;
|
||||
case IW_AUTH_CIPHER_PAIRWISE:
|
||||
case IW_AUTH_CIPHER_GROUP:
|
||||
@ -684,13 +653,11 @@ int ieee80211_wx_set_auth(struct ieee80211_device *ieee,
|
||||
|
||||
case IW_AUTH_80211_AUTH_ALG:
|
||||
ieee->open_wep = (data->value&IW_AUTH_ALG_OPEN_SYSTEM) ? 1 : 0;
|
||||
//printk("open_wep:%d\n", ieee->open_wep);
|
||||
break;
|
||||
|
||||
#if 1
|
||||
case IW_AUTH_WPA_ENABLED:
|
||||
ieee->wpa_enabled = (data->value) ? 1 : 0;
|
||||
//printk("enable wpa:%d\n", ieee->wpa_enabled);
|
||||
break;
|
||||
|
||||
#endif
|
||||
@ -732,7 +699,6 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len)
|
||||
ieee->wpa_ie = NULL;
|
||||
ieee->wpa_ie_len = 0;
|
||||
}
|
||||
// printk("<=====out %s()\n", __func__);
|
||||
|
||||
return 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user