}
if (val == IW_MAX_FREQUENCIES)
- break;
+ break;
}
range->num_frequency = val;
range->num_channels = val;
struct ieee80211_device *ieee = priv->ieee80211;
int ret = 0;
- if (!priv->up) return -ENETDOWN;
+ if (!priv->up)
+ return -ENETDOWN;
if (priv->ieee80211->LinkDetectInfo.bBusyTraffic == true)
return -EAGAIN;
- if (wrqu->data.flags & IW_SCAN_THIS_ESSID)
- {
+ if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
struct iw_scan_req *req = (struct iw_scan_req *)b;
- if (req->essid_len)
- {
+ if (req->essid_len) {
//printk("==**&*&*&**===>scan set ssid:%s\n", req->essid);
ieee->current_network.ssid_len = req->essid_len;
memcpy(ieee->current_network.ssid, req->essid, req->essid_len);
priv->ieee80211->scanning = 0;
ieee80211_softmac_scan_syncro(priv->ieee80211);
ret = 0;
+ } else {
+ ret = ieee80211_wx_set_scan(priv->ieee80211, a, wrqu, b);
}
- else
- ret = ieee80211_wx_set_scan(priv->ieee80211, a, wrqu, b);
up(&priv->wx_sem);
return ret;
}
int ret;
struct r8192_priv *priv = ieee80211_priv(dev);
- if (!priv->up) return -ENETDOWN;
+ if (!priv->up)
+ return -ENETDOWN;
down(&priv->wx_sem);
{0x00, 0x00, 0x00, 0x00, 0x00, 0x03} };
int i;
- if (!priv->up) return -ENETDOWN;
+ if (!priv->up)
+ return -ENETDOWN;
down(&priv->wx_sem);
for (i = 0; i < 4; i++) {
hwkey[i] |= key[4*i+0]&mask;
- if (i == 1 && (4*i+1) == wrqu->encoding.length) mask = 0x00;
- if (i == 3 && (4*i+1) == wrqu->encoding.length) mask = 0x00;
+ if (i == 1 && (4*i+1) == wrqu->encoding.length)
+ mask = 0x00;
+ if (i == 3 && (4*i+1) == wrqu->encoding.length)
+ mask = 0x00;
hwkey[i] |= (key[4*i+1]&mask)<<8;
hwkey[i] |= (key[4*i+2]&mask)<<16;
hwkey[i] |= (key[4*i+3]&mask)<<24;
#define CONF_WEP104 0x14
switch (wrqu->encoding.flags & IW_ENCODE_INDEX) {
- case 0: key_idx = ieee->tx_keyidx; break;
- case 1: key_idx = 0; break;
- case 2: key_idx = 1; break;
- case 3: key_idx = 2; break;
- case 4: key_idx = 3; break;
- default: break;
+ case 0:
+ key_idx = ieee->tx_keyidx;
+ break;
+ case 1:
+ key_idx = 0;
+ break;
+ case 2:
+ key_idx = 1;
+ break;
+ case 3:
+ key_idx = 2;
+ break;
+ case 4:
+ key_idx = 3;
+ break;
+ default:
+ break;
}
if (wrqu->encoding.length == 0x5) {
0, //DefaultKey
hwkey); //KeyContent
+ } else {
+ printk("wrong type in WEP, not WEP40 and WEP104\n");
}
- else printk("wrong type in WEP, not WEP40 and WEP104\n");
}
}
-static int r8192_wx_set_scan_type(struct net_device *dev, struct iw_request_info *aa, union
- iwreq_data *wrqu, char *p){
+static int r8192_wx_set_scan_type(struct net_device *dev, struct iw_request_info *aa,
+ union iwreq_data *wrqu, char *p){
struct r8192_priv *priv = ieee80211_priv(dev);
int *parms = (int *)p;
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
struct iw_point *encoding = &wrqu->encoding;
u8 idx = 0, alg = 0, group = 0;
- if ((encoding->flags & IW_ENCODE_DISABLED) ||
- ext->alg == IW_ENCODE_ALG_NONE) //none is not allowed to use hwsec WB 2008.07.01
+ if ((encoding->flags & IW_ENCODE_DISABLED) || ext->alg == IW_ENCODE_ALG_NONE)
+ //none is not allowed to use hwsec WB 2008.07.01
goto end_hw_sec;
- alg = (ext->alg == IW_ENCODE_ALG_CCMP)?KEY_TYPE_CCMP:ext->alg; // as IW_ENCODE_ALG_CCMP is defined to be 3 and KEY_TYPE_CCMP is defined to 4;
+ // as IW_ENCODE_ALG_CCMP is defined to be 3 and KEY_TYPE_CCMP is defined to 4;
+ alg = (ext->alg == IW_ENCODE_ALG_CCMP)?KEY_TYPE_CCMP:ext->alg;
idx = encoding->flags & IW_ENCODE_INDEX;
if (idx)
idx--;
group = ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY;
- if ((!group) || (IW_MODE_ADHOC == ieee->iw_mode) || (alg == KEY_TYPE_WEP40))
- {
+ if ((!group) || (IW_MODE_ADHOC == ieee->iw_mode) || (alg == KEY_TYPE_WEP40)) {
if ((ext->key_len == 13) && (alg == KEY_TYPE_WEP40))
alg = KEY_TYPE_WEP104;
ieee->pairwise_key_type = alg;
}
memcpy((u8 *)key, ext->key, 16); //we only get 16 bytes key.why? WB 2008.7.1
- if ((alg & KEY_TYPE_WEP40) && (ieee->auth_mode != 2))
- {
+ if ((alg & KEY_TYPE_WEP40) && (ieee->auth_mode != 2)) {
setKey(dev,
idx,//EntryNo
zero, //MacAddr
0, //DefaultKey
key); //KeyContent
- }
- else if (group)
- {
+ } else if (group) {
ieee->group_key_type = alg;
setKey(dev,
idx,//EntryNo
broadcast_addr, //MacAddr
0, //DefaultKey
key); //KeyContent
- }
- else //pairwise key
- {
+ } else {//pairwise key
setKey(dev,
4,//EntryNo
idx, //KeyIndex
}
-static iw_handler r8192_wx_handlers[] =
-{
+static iw_handler r8192_wx_handlers[] = {
NULL, /* SIOCSIWCOMMIT */
r8192_wx_get_name, /* SIOCGIWNAME */
dummy, /* SIOCSIWNWID */
int tmp_level = 0;
int tmp_qual = 0;
int tmp_noise = 0;
- if (ieee->state < IEEE80211_LINKED)
- {
+ if (ieee->state < IEEE80211_LINKED) {
wstats->qual.qual = 0;
wstats->qual.level = 0;
wstats->qual.noise = 0;