staging: vt6656: iwctl: Clean up braces on 'if' statements
Clean up braces on 'if' statements to (mostly) match coding style. A few other bits, like removing a few blank lines and such may have snug in. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
37f0777fb1
commit
8c3337fec4
1 changed files with 61 additions and 84 deletions
|
@ -150,12 +150,10 @@ int iwctl_siwscan(struct net_device *dev, struct iw_request_info *info,
|
|||
spin_unlock_irq(&pDevice->lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
else if (req->scan_type == IW_SCAN_TYPE_PASSIVE) { // passive scan
|
||||
} else if (req->scan_type == IW_SCAN_TYPE_PASSIVE) { // passive scan
|
||||
pMgmt->eScanType = WMAC_SCAN_PASSIVE;
|
||||
}
|
||||
}
|
||||
else { // active scan
|
||||
} else { // active scan
|
||||
pMgmt->eScanType = WMAC_SCAN_ACTIVE;
|
||||
}
|
||||
|
||||
|
@ -216,12 +214,10 @@ int iwctl_giwscan(struct net_device *dev, struct iw_request_info *info,
|
|||
// ADD mode
|
||||
memset(&iwe, 0, sizeof(iwe));
|
||||
iwe.cmd = SIOCGIWMODE;
|
||||
if (WLAN_GET_CAP_INFO_ESS(pBSS->wCapInfo)) {
|
||||
if (WLAN_GET_CAP_INFO_ESS(pBSS->wCapInfo))
|
||||
iwe.u.mode = IW_MODE_INFRA;
|
||||
}
|
||||
else {
|
||||
else
|
||||
iwe.u.mode = IW_MODE_ADHOC;
|
||||
}
|
||||
iwe.len = IW_EV_UINT_LEN;
|
||||
current_ev = iwe_stream_add_event(info, current_ev, end_buf, &iwe, IW_EV_UINT_LEN);
|
||||
// ADD frequency
|
||||
|
@ -248,13 +244,12 @@ int iwctl_giwscan(struct net_device *dev, struct iw_request_info *info,
|
|||
iwe.u.qual.level = ldBm;
|
||||
iwe.u.qual.noise = 0;
|
||||
|
||||
if (-ldBm<50){
|
||||
if (-ldBm<50)
|
||||
iwe.u.qual.qual = 100;
|
||||
}else if (-ldBm > 90) {
|
||||
else if (-ldBm > 90)
|
||||
iwe.u.qual.qual = 0;
|
||||
}else {
|
||||
else
|
||||
iwe.u.qual.qual = (40 - (-ldBm - 50)) * 100 / 40;
|
||||
}
|
||||
iwe.u.qual.updated = 7;
|
||||
|
||||
current_ev = iwe_stream_add_event(info, current_ev, end_buf, &iwe, IW_EV_QUAL_LEN);
|
||||
|
@ -262,11 +257,10 @@ int iwctl_giwscan(struct net_device *dev, struct iw_request_info *info,
|
|||
memset(&iwe, 0, sizeof(iwe));
|
||||
iwe.cmd = SIOCGIWENCODE;
|
||||
iwe.u.data.length = 0;
|
||||
if (WLAN_GET_CAP_INFO_PRIVACY(pBSS->wCapInfo)) {
|
||||
if (WLAN_GET_CAP_INFO_PRIVACY(pBSS->wCapInfo))
|
||||
iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY;
|
||||
}else {
|
||||
else
|
||||
iwe.u.data.flags = IW_ENCODE_DISABLED;
|
||||
}
|
||||
current_ev = iwe_stream_add_point(info, current_ev, end_buf, &iwe, pItemSSID->abySSID);
|
||||
|
||||
memset(&iwe, 0, sizeof(iwe));
|
||||
|
@ -329,8 +323,7 @@ int iwctl_siwfreq(struct net_device *dev, struct iw_request_info *info,
|
|||
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWFREQ \n");
|
||||
|
||||
// If setting by frequency, convert to a channel
|
||||
if ((wrq->e == 1) &&
|
||||
(wrq->m >= (int)2.412e8) &&
|
||||
if ((wrq->e == 1) && (wrq->m >= (int)2.412e8) &&
|
||||
(wrq->m <= (int)2.487e8)) {
|
||||
int f = wrq->m / 100000;
|
||||
int c = 0;
|
||||
|
@ -340,9 +333,9 @@ int iwctl_siwfreq(struct net_device *dev, struct iw_request_info *info,
|
|||
wrq->m = c + 1;
|
||||
}
|
||||
// Setting by channel number
|
||||
if ((wrq->m > 14) || (wrq->e > 0))
|
||||
if ((wrq->m > 14) || (wrq->e > 0)) {
|
||||
rc = -EOPNOTSUPP;
|
||||
else {
|
||||
} else {
|
||||
int channel = wrq->m;
|
||||
if ((channel < 1) || (channel > 14)) {
|
||||
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: New channel value of %d is invalid!\n", dev->name, wrq->m);
|
||||
|
@ -353,7 +346,6 @@ int iwctl_siwfreq(struct net_device *dev, struct iw_request_info *info,
|
|||
pDevice->uChannel = channel;
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -404,20 +396,18 @@ int iwctl_siwmode(struct net_device *dev, struct iw_request_info *info,
|
|||
case IW_MODE_ADHOC:
|
||||
if (pMgmt->eConfigMode != WMAC_CONFIG_IBSS_STA) {
|
||||
pMgmt->eConfigMode = WMAC_CONFIG_IBSS_STA;
|
||||
if (pDevice->flags & DEVICE_FLAGS_OPENED) {
|
||||
if (pDevice->flags & DEVICE_FLAGS_OPENED)
|
||||
pDevice->bCommit = TRUE;
|
||||
}
|
||||
}
|
||||
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "set mode to ad-hoc \n");
|
||||
break;
|
||||
case IW_MODE_AUTO:
|
||||
case IW_MODE_INFRA:
|
||||
if (pMgmt->eConfigMode != WMAC_CONFIG_ESS_STA) {
|
||||
pMgmt->eConfigMode = WMAC_CONFIG_ESS_STA;
|
||||
if (pDevice->flags & DEVICE_FLAGS_OPENED) {
|
||||
if (pDevice->flags & DEVICE_FLAGS_OPENED)
|
||||
pDevice->bCommit = TRUE;
|
||||
}
|
||||
}
|
||||
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "set mode to infrastructure \n");
|
||||
break;
|
||||
case IW_MODE_MASTER:
|
||||
|
@ -428,10 +418,9 @@ int iwctl_siwmode(struct net_device *dev, struct iw_request_info *info,
|
|||
|
||||
if (pMgmt->eConfigMode != WMAC_CONFIG_AP) {
|
||||
pMgmt->eConfigMode = WMAC_CONFIG_AP;
|
||||
if (pDevice->flags & DEVICE_FLAGS_OPENED) {
|
||||
if (pDevice->flags & DEVICE_FLAGS_OPENED)
|
||||
pDevice->bCommit = TRUE;
|
||||
}
|
||||
}
|
||||
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "set mode to Access Point \n");
|
||||
break;
|
||||
|
||||
|
@ -617,10 +606,9 @@ int iwctl_siwap(struct net_device *dev, struct iw_request_info *info,
|
|||
}
|
||||
}
|
||||
|
||||
if (pDevice->flags & DEVICE_FLAGS_OPENED) {
|
||||
if (pDevice->flags & DEVICE_FLAGS_OPENED)
|
||||
pDevice->bCommit = TRUE;
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -640,9 +628,8 @@ int iwctl_giwap(struct net_device *dev, struct iw_request_info *info,
|
|||
if ((pDevice->bLinkPass == FALSE) && (pMgmt->eCurrMode != WMAC_MODE_ESS_AP))
|
||||
memset(wrq->sa_data, 0, 6);
|
||||
|
||||
if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) {
|
||||
if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP)
|
||||
memcpy(wrq->sa_data, pMgmt->abyCurrBSSID, 6);
|
||||
}
|
||||
|
||||
wrq->sa_family = ARPHRD_ETHER;
|
||||
return 0;
|
||||
|
@ -731,9 +718,9 @@ int iwctl_siwessid(struct net_device *dev, struct iw_request_info *info,
|
|||
if (pItemSSID->abySSID[wrq->length - 1] == '\0') {
|
||||
if (wrq->length>0)
|
||||
pItemSSID->len = wrq->length - 1;
|
||||
}
|
||||
else
|
||||
} else {
|
||||
pItemSSID->len = wrq->length;
|
||||
}
|
||||
PRINT_K("set essid to %s \n", pItemSSID->abySSID);
|
||||
|
||||
// mike: need clear desiredBSSID
|
||||
|
@ -767,8 +754,7 @@ int iwctl_siwessid(struct net_device *dev, struct iw_request_info *info,
|
|||
bScheduleCommand((void *)pDevice,
|
||||
WLAN_CMD_SSID,
|
||||
pMgmt->abyDesireSSID);
|
||||
}
|
||||
else { // mike: to find out if that desired SSID is a
|
||||
} else { // mike: to find out if that desired SSID is a
|
||||
// hidden-ssid AP, by means of judging if there
|
||||
// are two same BSSID exist in list ?
|
||||
for (ii = 0; ii < MAX_BSS_NUM; ii++) {
|
||||
|
@ -797,9 +783,9 @@ int iwctl_siwessid(struct net_device *dev, struct iw_request_info *info,
|
|||
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "set essid = %s \n", pItemSSID->abySSID);
|
||||
}
|
||||
|
||||
if (pDevice->flags & DEVICE_FLAGS_OPENED) {
|
||||
if (pDevice->flags & DEVICE_FLAGS_OPENED)
|
||||
pDevice->bCommit = TRUE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -892,8 +878,7 @@ int iwctl_siwrate(struct net_device *dev, struct iw_request_info *info,
|
|||
pDevice->bFixRate = TRUE;
|
||||
if ((pDevice->byBBType == BB_TYPE_11B) && (brate > 3)) {
|
||||
pDevice->uConnectionRate = 3;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
pDevice->uConnectionRate = brate;
|
||||
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Fixed to Rate %d \n", pDevice->uConnectionRate);
|
||||
}
|
||||
|
@ -933,7 +918,6 @@ void iwctl_giwrate(struct net_device *dev, struct iw_request_info *info,
|
|||
if (pDevice->byBBType == BB_TYPE_11A)
|
||||
brate = 0x6C;
|
||||
}
|
||||
|
||||
if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) {
|
||||
if (pDevice->byBBType == BB_TYPE_11B)
|
||||
brate = 0x16;
|
||||
|
@ -1041,19 +1025,18 @@ int iwctl_siwretry(struct net_device *dev, struct iw_request_info *info,
|
|||
}
|
||||
|
||||
if (wrq->flags & IW_RETRY_LIMIT) {
|
||||
if (wrq->flags & IW_RETRY_MAX)
|
||||
if (wrq->flags & IW_RETRY_MAX) {
|
||||
pDevice->byLongRetryLimit = wrq->value;
|
||||
else if (wrq->flags & IW_RETRY_MIN)
|
||||
} else if (wrq->flags & IW_RETRY_MIN) {
|
||||
pDevice->byShortRetryLimit = wrq->value;
|
||||
else {
|
||||
} else {
|
||||
// No modifier : set both
|
||||
pDevice->byShortRetryLimit = wrq->value;
|
||||
pDevice->byLongRetryLimit = wrq->value;
|
||||
}
|
||||
}
|
||||
if (wrq->flags & IW_RETRY_LIFETIME) {
|
||||
if (wrq->flags & IW_RETRY_LIFETIME)
|
||||
pDevice->wMaxTransmitMSDULifetime = wrq->value;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -1118,20 +1101,17 @@ int iwctl_siwencode(struct net_device *dev, struct iw_request_info *info,
|
|||
|
||||
if (wrq->length == WLAN_WEP232_KEYLEN) {
|
||||
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Set 232 bit wep key\n");
|
||||
}
|
||||
else if (wrq->length == WLAN_WEP104_KEYLEN) {
|
||||
} else if (wrq->length == WLAN_WEP104_KEYLEN) {
|
||||
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Set 104 bit wep key\n");
|
||||
}
|
||||
else if (wrq->length == WLAN_WEP40_KEYLEN) {
|
||||
} else if (wrq->length == WLAN_WEP40_KEYLEN) {
|
||||
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Set 40 bit wep key, index= %d\n", (int)dwKeyIndex);
|
||||
}
|
||||
memset(pDevice->abyKey, 0, WLAN_WEP232_KEYLEN);
|
||||
memcpy(pDevice->abyKey, extra, wrq->length);
|
||||
|
||||
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"abyKey: ");
|
||||
for (ii = 0; ii < wrq->length; ii++) {
|
||||
for (ii = 0; ii < wrq->length; ii++)
|
||||
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%02x ", pDevice->abyKey[ii]);
|
||||
}
|
||||
|
||||
if (pDevice->flags & DEVICE_FLAGS_OPENED) {
|
||||
spin_lock_irq(&pDevice->lock);
|
||||
|
@ -1160,7 +1140,6 @@ int iwctl_siwencode(struct net_device *dev, struct iw_request_info *info,
|
|||
}
|
||||
// Read the flags
|
||||
if (wrq->flags & IW_ENCODE_DISABLED) {
|
||||
|
||||
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Disable WEP function\n");
|
||||
pMgmt->bShareKeyAlgorithm = FALSE;
|
||||
pDevice->bEncryptionEnable = FALSE;
|
||||
|
@ -1199,16 +1178,16 @@ int iwctl_giwencode(struct net_device *dev, struct iw_request_info *info,
|
|||
|
||||
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWENCODE\n");
|
||||
|
||||
if (index > WLAN_WEP_NKEYS) {
|
||||
if (index > WLAN_WEP_NKEYS)
|
||||
return -EINVAL;
|
||||
}
|
||||
if (index < 1) { // get default key
|
||||
if (pDevice->byKeyIndex < WLAN_WEP_NKEYS){
|
||||
if (pDevice->byKeyIndex < WLAN_WEP_NKEYS)
|
||||
index = pDevice->byKeyIndex;
|
||||
} else
|
||||
else
|
||||
index = 0;
|
||||
}else
|
||||
} else {
|
||||
index--;
|
||||
}
|
||||
|
||||
memset(abyKey, 0, WLAN_WEP232_KEYLEN);
|
||||
// Check encryption mode
|
||||
|
@ -1329,8 +1308,7 @@ int iwctl_giwsens(struct net_device *dev, struct iw_request_info *info,
|
|||
if (pDevice->bLinkPass == TRUE) {
|
||||
RFvRSSITodBm(pDevice, (BYTE)(pDevice->uCurrRSSI), &ldBm);
|
||||
wrq->value = ldBm;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
wrq->value = 0;
|
||||
}
|
||||
wrq->disabled = (wrq->value == 0);
|
||||
|
@ -1355,11 +1333,9 @@ int iwctl_siwauth(struct net_device *dev, struct iw_request_info *info,
|
|||
wpa_version = wrq->value;
|
||||
if (wrq->value == IW_AUTH_WPA_VERSION_DISABLED) {
|
||||
PRINT_K("iwctl_siwauth:set WPADEV to disable at 1??????\n");
|
||||
}
|
||||
else if (wrq->value == IW_AUTH_WPA_VERSION_WPA) {
|
||||
} else if (wrq->value == IW_AUTH_WPA_VERSION_WPA) {
|
||||
PRINT_K("iwctl_siwauth:set WPADEV to WPA1******\n");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
PRINT_K("iwctl_siwauth:set WPADEV to WPA2******\n");
|
||||
}
|
||||
break;
|
||||
|
@ -1375,8 +1351,9 @@ int iwctl_siwauth(struct net_device *dev, struct iw_request_info *info,
|
|||
pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled;
|
||||
} else if (pairwise == IW_AUTH_CIPHER_NONE) {
|
||||
// do nothing, einsn liu
|
||||
} else pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
|
||||
|
||||
} else {
|
||||
pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
|
||||
}
|
||||
break;
|
||||
case IW_AUTH_CIPHER_GROUP:
|
||||
PRINT_K("iwctl_siwauth:set GROUP=%d\n", wrq->value);
|
||||
|
@ -1401,7 +1378,8 @@ int iwctl_siwauth(struct net_device *dev, struct iw_request_info *info,
|
|||
pMgmt->eAuthenMode = WMAC_AUTH_WPANONE;
|
||||
} else if (wrq->value == IW_AUTH_KEY_MGMT_PSK)
|
||||
pMgmt->eAuthenMode = WMAC_AUTH_WPAPSK;
|
||||
else pMgmt->eAuthenMode = WMAC_AUTH_WPA;
|
||||
} else {
|
||||
pMgmt->eAuthenMode = WMAC_AUTH_WPA;
|
||||
}
|
||||
break;
|
||||
case IW_AUTH_TKIP_COUNTERMEASURES:
|
||||
|
@ -1410,11 +1388,10 @@ int iwctl_siwauth(struct net_device *dev, struct iw_request_info *info,
|
|||
break;
|
||||
case IW_AUTH_80211_AUTH_ALG:
|
||||
PRINT_K("iwctl_siwauth:set AUTH_ALG=%d\n", wrq->value);
|
||||
if (wrq->value==IW_AUTH_ALG_OPEN_SYSTEM){
|
||||
if (wrq->value == IW_AUTH_ALG_OPEN_SYSTEM)
|
||||
pMgmt->bShareKeyAlgorithm = FALSE;
|
||||
} else if (wrq->value==IW_AUTH_ALG_SHARED_KEY) {
|
||||
else if (wrq->value == IW_AUTH_ALG_SHARED_KEY)
|
||||
pMgmt->bShareKeyAlgorithm = TRUE;
|
||||
}
|
||||
break;
|
||||
case IW_AUTH_WPA_ENABLED:
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue