staging: rtl8192e: Cleanup checkpatch -f warnings and errors - Part XVII
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
@@ -25,7 +25,8 @@
|
||||
#include "rtl_pci.h"
|
||||
#include "rtl_core.h"
|
||||
|
||||
static void rtl8192_parse_pci_configuration(struct pci_dev *pdev, struct net_device *dev)
|
||||
static void rtl8192_parse_pci_configuration(struct pci_dev *pdev,
|
||||
struct net_device *dev)
|
||||
{
|
||||
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
|
||||
|
||||
@@ -37,7 +38,8 @@ static void rtl8192_parse_pci_configuration(struct pci_dev *pdev, struct net_dev
|
||||
pci_read_config_byte(priv->pdev, pos + PCI_EXP_LNKCTL, &LinkCtrlReg);
|
||||
priv->NdisAdapter.LinkCtrlReg = LinkCtrlReg;
|
||||
|
||||
RT_TRACE(COMP_INIT, "Link Control Register =%x\n", priv->NdisAdapter.LinkCtrlReg);
|
||||
RT_TRACE(COMP_INIT, "Link Control Register =%x\n",
|
||||
priv->NdisAdapter.LinkCtrlReg);
|
||||
|
||||
pci_read_config_byte(pdev, 0x98, &tmp);
|
||||
tmp |= BIT4;
|
||||
@@ -65,24 +67,27 @@ bool rtl8192_pci_findadapter(struct pci_dev *pdev, struct net_device *dev)
|
||||
if (DeviceID == 0x8172) {
|
||||
switch (RevisionID) {
|
||||
case HAL_HW_PCI_REVISION_ID_8192PCIE:
|
||||
printk("Adapter(8192 PCI-E) is found - DeviceID=%x\n", DeviceID);
|
||||
printk(KERN_INFO "Adapter(8192 PCI-E) is found - "
|
||||
"DeviceID=%x\n", DeviceID);
|
||||
priv->card_8192 = NIC_8192E;
|
||||
break;
|
||||
case HAL_HW_PCI_REVISION_ID_8192SE:
|
||||
printk("Adapter(8192SE) is found - DeviceID=%x\n", DeviceID);
|
||||
printk(KERN_INFO "Adapter(8192SE) is found - "
|
||||
"DeviceID=%x\n", DeviceID);
|
||||
priv->card_8192 = NIC_8192SE;
|
||||
break;
|
||||
default:
|
||||
printk("UNKNOWN nic type(%4x:%4x)\n", pdev->vendor, pdev->device);
|
||||
printk(KERN_INFO "UNKNOWN nic type(%4x:%4x)\n",
|
||||
pdev->vendor, pdev->device);
|
||||
priv->card_8192 = NIC_UNKNOWN;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (priv->ops->nic_type != priv->card_8192) {
|
||||
printk("Detect info(%x) and hardware info(%x) not match!\n",
|
||||
printk(KERN_INFO "Detect info(%x) and hardware info(%x) not match!\n",
|
||||
priv->ops->nic_type, priv->card_8192);
|
||||
printk("Please select proper driver before install!!!!\n");
|
||||
printk(KERN_INFO "Please select proper driver before install!!!!\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -69,7 +69,7 @@ struct mp_adapter {
|
||||
u16 PciBridgeDeviceId;
|
||||
u8 PciBridgePCIeHdrOffset;
|
||||
u8 PciBridgeLinkCtrlReg;
|
||||
};//,*pmp_adapter;
|
||||
};
|
||||
|
||||
struct rt_pci_capab_header {
|
||||
unsigned char CapabilityID;
|
||||
|
@@ -67,7 +67,8 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
|
||||
iwe.cmd = SIOCGIWAP;
|
||||
iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
|
||||
memcpy(iwe.u.ap_addr.sa_data, network->bssid, ETH_ALEN);
|
||||
start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_ADDR_LEN);
|
||||
start = iwe_stream_add_event_rsl(info, start, stop,
|
||||
&iwe, IW_EV_ADDR_LEN);
|
||||
/* Remaining entries will be displayed in the order we provide them */
|
||||
|
||||
/* Add the ESSID */
|
||||
@@ -75,25 +76,30 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
|
||||
iwe.u.data.flags = 1;
|
||||
if (network->ssid_len > 0) {
|
||||
iwe.u.data.length = min(network->ssid_len, (u8)32);
|
||||
start = iwe_stream_add_point_rsl(info, start, stop, &iwe, network->ssid);
|
||||
start = iwe_stream_add_point_rsl(info, start, stop, &iwe,
|
||||
network->ssid);
|
||||
} else if (network->hidden_ssid_len == 0) {
|
||||
iwe.u.data.length = sizeof("<hidden>");
|
||||
start = iwe_stream_add_point_rsl(info, start, stop, &iwe, "<hidden>");
|
||||
start = iwe_stream_add_point_rsl(info, start, stop,
|
||||
&iwe, "<hidden>");
|
||||
} else {
|
||||
iwe.u.data.length = min(network->hidden_ssid_len, (u8)32);
|
||||
start = iwe_stream_add_point_rsl(info, start, stop, &iwe, network->hidden_ssid);
|
||||
start = iwe_stream_add_point_rsl(info, start, stop, &iwe,
|
||||
network->hidden_ssid);
|
||||
}
|
||||
/* Add the protocol name */
|
||||
iwe.cmd = SIOCGIWNAME;
|
||||
for (i = 0; i < (sizeof(rtllib_modes)/sizeof(rtllib_modes[0])); i++) {
|
||||
if (network->mode&(1<<i)) {
|
||||
sprintf(pname,rtllib_modes[i].mode_string,rtllib_modes[i].mode_size);
|
||||
sprintf(pname, rtllib_modes[i].mode_string,
|
||||
rtllib_modes[i].mode_size);
|
||||
pname += rtllib_modes[i].mode_size;
|
||||
}
|
||||
}
|
||||
*pname = '\0';
|
||||
snprintf(iwe.u.name, IFNAMSIZ, "IEEE802.11%s", proto_name);
|
||||
start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_CHAR_LEN);
|
||||
start = iwe_stream_add_event_rsl(info, start, stop,
|
||||
&iwe, IW_EV_CHAR_LEN);
|
||||
/* Add mode */
|
||||
iwe.cmd = SIOCGIWMODE;
|
||||
if (network->capability &
|
||||
@@ -102,7 +108,8 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
|
||||
iwe.u.mode = IW_MODE_MASTER;
|
||||
else
|
||||
iwe.u.mode = IW_MODE_ADHOC;
|
||||
start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_UINT_LEN);
|
||||
start = iwe_stream_add_event_rsl(info, start, stop,
|
||||
&iwe, IW_EV_UINT_LEN);
|
||||
}
|
||||
|
||||
/* Add frequency/channel */
|
||||
@@ -112,7 +119,8 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
|
||||
iwe.u.freq.m = network->channel;
|
||||
iwe.u.freq.e = 0;
|
||||
iwe.u.freq.i = 0;
|
||||
start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_FREQ_LEN);
|
||||
start = iwe_stream_add_event_rsl(info, start, stop, &iwe,
|
||||
IW_EV_FREQ_LEN);
|
||||
|
||||
/* Add encryption capability */
|
||||
iwe.cmd = SIOCGIWENCODE;
|
||||
@@ -121,7 +129,8 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
|
||||
else
|
||||
iwe.u.data.flags = IW_ENCODE_DISABLED;
|
||||
iwe.u.data.length = 0;
|
||||
start = iwe_stream_add_point_rsl(info, start, stop, &iwe, network->ssid);
|
||||
start = iwe_stream_add_point_rsl(info, start, stop,
|
||||
&iwe, network->ssid);
|
||||
/* Add basic and extended rates */
|
||||
max_rate = 0;
|
||||
p = custom;
|
||||
@@ -146,21 +155,23 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
|
||||
max_rate = rate;
|
||||
}
|
||||
|
||||
if (network->mode >= IEEE_N_24G)
|
||||
{
|
||||
if (network->mode >= IEEE_N_24G) {
|
||||
struct ht_capab_ele *ht_cap = NULL;
|
||||
bool is40M = false, isShortGI = false;
|
||||
u8 max_mcs = 0;
|
||||
if (!memcmp(network->bssht.bdHTCapBuf, EWC11NHTCap, 4))
|
||||
ht_cap = (struct ht_capab_ele *)&network->bssht.bdHTCapBuf[4];
|
||||
ht_cap = (struct ht_capab_ele *)
|
||||
&network->bssht.bdHTCapBuf[4];
|
||||
else
|
||||
ht_cap = (struct ht_capab_ele *)&network->bssht.bdHTCapBuf[0];
|
||||
ht_cap = (struct ht_capab_ele *)
|
||||
&network->bssht.bdHTCapBuf[0];
|
||||
is40M = (ht_cap->ChlWidth) ? 1 : 0;
|
||||
isShortGI = (ht_cap->ChlWidth) ?
|
||||
((ht_cap->ShortGI40Mhz) ? 1 : 0) :
|
||||
((ht_cap->ShortGI20Mhz) ? 1 : 0);
|
||||
|
||||
max_mcs = HTGetHighestMCSRate(ieee, ht_cap->MCS, MCS_FILTER_ALL);
|
||||
max_mcs = HTGetHighestMCSRate(ieee, ht_cap->MCS,
|
||||
MCS_FILTER_ALL);
|
||||
rate = MCS_DATA_RATE[is40M][isShortGI][max_mcs & 0x7f];
|
||||
if (rate > max_rate)
|
||||
max_rate = rate;
|
||||
@@ -173,7 +184,8 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
|
||||
iwe.cmd = IWEVCUSTOM;
|
||||
iwe.u.data.length = p - custom;
|
||||
if (iwe.u.data.length)
|
||||
start = iwe_stream_add_point_rsl(info, start, stop, &iwe, custom);
|
||||
start = iwe_stream_add_point_rsl(info, start, stop,
|
||||
&iwe, custom);
|
||||
/* Add quality statistics */
|
||||
/* TODO: Fix these values... */
|
||||
iwe.cmd = IWEVQUAL;
|
||||
@@ -188,17 +200,18 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
|
||||
if (!(network->stats.mask & RTLLIB_STATMASK_SIGNAL))
|
||||
iwe.u.qual.updated |= IW_QUAL_QUAL_INVALID;
|
||||
iwe.u.qual.updated = 7;
|
||||
start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_QUAL_LEN);
|
||||
start = iwe_stream_add_event_rsl(info, start, stop, &iwe,
|
||||
IW_EV_QUAL_LEN);
|
||||
|
||||
iwe.cmd = IWEVCUSTOM;
|
||||
p = custom;
|
||||
iwe.u.data.length = p - custom;
|
||||
if (iwe.u.data.length)
|
||||
start = iwe_stream_add_point_rsl(info, start, stop, &iwe, custom);
|
||||
start = iwe_stream_add_point_rsl(info, start, stop,
|
||||
&iwe, custom);
|
||||
|
||||
memset(&iwe, 0, sizeof(iwe));
|
||||
if (network->wpa_ie_len)
|
||||
{
|
||||
if (network->wpa_ie_len) {
|
||||
char buf[MAX_WPA_IE_LEN];
|
||||
memcpy(buf, network->wpa_ie, network->wpa_ie_len);
|
||||
iwe.cmd = IWEVGENIE;
|
||||
@@ -206,8 +219,7 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
|
||||
start = iwe_stream_add_point_rsl(info, start, stop, &iwe, buf);
|
||||
}
|
||||
memset(&iwe, 0, sizeof(iwe));
|
||||
if (network->rsn_ie_len)
|
||||
{
|
||||
if (network->rsn_ie_len) {
|
||||
char buf[MAX_WPA_IE_LEN];
|
||||
memcpy(buf, network->rsn_ie, network->rsn_ie_len);
|
||||
iwe.cmd = IWEVGENIE;
|
||||
@@ -217,8 +229,7 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
|
||||
|
||||
/* add info for WZC */
|
||||
memset(&iwe, 0, sizeof(iwe));
|
||||
if (network->wzc_ie_len)
|
||||
{
|
||||
if (network->wzc_ie_len) {
|
||||
char buf[MAX_WZC_IE_LEN];
|
||||
memcpy(buf, network->wzc_ie, network->wzc_ie_len);
|
||||
iwe.cmd = IWEVGENIE;
|
||||
@@ -231,10 +242,12 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
|
||||
iwe.cmd = IWEVCUSTOM;
|
||||
p = custom;
|
||||
p += snprintf(p, MAX_CUSTOM_LEN - (p - custom),
|
||||
" Last beacon: %lums ago", (jiffies - network->last_scanned) / (HZ / 100));
|
||||
" Last beacon: %lums ago",
|
||||
(jiffies - network->last_scanned) / (HZ / 100));
|
||||
iwe.u.data.length = p - custom;
|
||||
if (iwe.u.data.length)
|
||||
start = iwe_stream_add_point_rsl(info, start, stop, &iwe, custom);
|
||||
start = iwe_stream_add_point_rsl(info, start, stop,
|
||||
&iwe, custom);
|
||||
|
||||
return start;
|
||||
}
|
||||
@@ -256,17 +269,16 @@ int rtllib_wx_get_scan(struct rtllib_device *ieee,
|
||||
|
||||
list_for_each_entry(network, &ieee->network_list, list) {
|
||||
i++;
|
||||
if ((stop-ev)<200)
|
||||
{
|
||||
if ((stop - ev) < 200) {
|
||||
err = -E2BIG;
|
||||
break;
|
||||
}
|
||||
if (ieee->scan_age == 0 ||
|
||||
time_after(network->last_scanned + ieee->scan_age, jiffies))
|
||||
ev = rtl819x_translate_scan(ieee, ev, stop, network, info);
|
||||
ev = rtl819x_translate_scan(ieee, ev, stop, network,
|
||||
info);
|
||||
else
|
||||
RTLLIB_DEBUG_SCAN(
|
||||
"Not showing network '%s ("
|
||||
RTLLIB_DEBUG_SCAN("Not showing network '%s ("
|
||||
MAC_FMT ")' due to age (%lums).\n",
|
||||
escape_essid(network->ssid,
|
||||
network->ssid_len),
|
||||
@@ -326,7 +338,8 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee,
|
||||
if (ieee->crypt[i] != NULL) {
|
||||
if (key_provided)
|
||||
break;
|
||||
rtllib_crypt_delayed_deinit(ieee, &ieee->crypt[i]);
|
||||
rtllib_crypt_delayed_deinit(ieee,
|
||||
&ieee->crypt[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,7 +419,7 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee,
|
||||
NULL, (*crypt)->priv);
|
||||
if (len == 0) {
|
||||
/* Set a default key of all 0 */
|
||||
printk("Setting key %d to all zero.\n",
|
||||
printk(KERN_INFO "Setting key %d to all zero.\n",
|
||||
key);
|
||||
|
||||
RTLLIB_DEBUG_WX("Setting key %d to all zero.\n",
|
||||
@@ -429,7 +442,8 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee,
|
||||
}
|
||||
done:
|
||||
ieee->open_wep = !(erq->flags & IW_ENCODE_RESTRICTED);
|
||||
ieee->auth_mode = ieee->open_wep ? WLAN_AUTH_OPEN : WLAN_AUTH_SHARED_KEY;
|
||||
ieee->auth_mode = ieee->open_wep ? WLAN_AUTH_OPEN :
|
||||
WLAN_AUTH_SHARED_KEY;
|
||||
sec.auth_mode = ieee->open_wep ? WLAN_AUTH_OPEN : WLAN_AUTH_SHARED_KEY;
|
||||
sec.flags |= SEC_AUTH_MODE;
|
||||
RTLLIB_DEBUG_WX("Auth: %s\n", sec.auth_mode == WLAN_AUTH_OPEN ?
|
||||
@@ -576,7 +590,7 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee,
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
printk("alg name:%s\n",alg);
|
||||
printk(KERN_INFO "alg name:%s\n", alg);
|
||||
|
||||
ops = rtllib_get_crypto_ops(alg);
|
||||
if (ops == NULL) {
|
||||
@@ -590,7 +604,7 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee,
|
||||
if (ops == NULL) {
|
||||
RTLLIB_DEBUG_WX("%s: unknown crypto alg %d\n",
|
||||
dev->name, ext->alg);
|
||||
printk("========>unknown crypto alg %d\n", ext->alg);
|
||||
printk(KERN_INFO "========>unknown crypto alg %d\n", ext->alg);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
@@ -622,7 +636,7 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee,
|
||||
(*crypt)->ops->set_key(ext->key, ext->key_len, ext->rx_seq,
|
||||
(*crypt)->priv) < 0) {
|
||||
RTLLIB_DEBUG_WX("%s: key setting failed\n", dev->name);
|
||||
printk("key setting failed\n");
|
||||
printk(KERN_INFO "key setting failed\n");
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
@@ -705,7 +719,8 @@ int rtllib_wx_get_encode_ext(struct rtllib_device *ieee,
|
||||
ext->alg = IW_ENCODE_ALG_CCMP;
|
||||
else
|
||||
return -EINVAL;
|
||||
ext->key_len = crypt->ops->get_key(ext->key, SCM_KEY_LEN, NULL, crypt->priv);
|
||||
ext->key_len = crypt->ops->get_key(ext->key, SCM_KEY_LEN,
|
||||
NULL, crypt->priv);
|
||||
encoding->flags |= IW_ENCODE_ENABLED;
|
||||
if (ext->key_len &&
|
||||
(ext->alg == IW_ENCODE_ALG_TKIP ||
|
||||
@@ -737,9 +752,9 @@ int rtllib_wx_set_mlme(struct rtllib_device *ieee,
|
||||
|
||||
case IW_MLME_DISASSOC:
|
||||
if (deauth == true)
|
||||
printk("disauth packet !\n");
|
||||
printk(KERN_INFO "disauth packet !\n");
|
||||
else
|
||||
printk("dis associate packet!\n");
|
||||
printk(KERN_INFO "dis associate packet!\n");
|
||||
|
||||
ieee->cannot_notify = true;
|
||||
|
||||
@@ -790,16 +805,13 @@ int rtllib_wx_set_auth(struct rtllib_device *ieee,
|
||||
if (data->value & IW_AUTH_ALG_SHARED_KEY) {
|
||||
ieee->open_wep = 0;
|
||||
ieee->auth_mode = 1;
|
||||
}
|
||||
else if (data->value & IW_AUTH_ALG_OPEN_SYSTEM){
|
||||
} else if (data->value & IW_AUTH_ALG_OPEN_SYSTEM) {
|
||||
ieee->open_wep = 1;
|
||||
ieee->auth_mode = 0;
|
||||
}
|
||||
else if (data->value & IW_AUTH_ALG_LEAP){
|
||||
} else if (data->value & IW_AUTH_ALG_LEAP) {
|
||||
ieee->open_wep = 1;
|
||||
ieee->auth_mode = 2;
|
||||
}
|
||||
else
|
||||
} else
|
||||
return -EINVAL;
|
||||
break;
|
||||
|
||||
@@ -824,15 +836,16 @@ int rtllib_wx_set_gen_ie(struct rtllib_device *ieee, u8 *ie, size_t len)
|
||||
u8 *buf;
|
||||
u8 eid, wps_oui[4] = {0x0, 0x50, 0xf2, 0x04};
|
||||
|
||||
if (len > MAX_WPA_IE_LEN || (len && ie == NULL)) {
|
||||
if (len > MAX_WPA_IE_LEN || (len && ie == NULL))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (len) {
|
||||
eid = ie[0];
|
||||
if ((eid == MFIE_TYPE_GENERIC) && (!memcmp(&ie[2], wps_oui, 4))) {
|
||||
if ((eid == MFIE_TYPE_GENERIC) && (!memcmp(&ie[2],
|
||||
wps_oui, 4))) {
|
||||
|
||||
ieee->wps_ie_len = (len < MAX_WZC_IE_LEN) ? (len):(MAX_WZC_IE_LEN);
|
||||
ieee->wps_ie_len = (len < MAX_WZC_IE_LEN) ? (len) :
|
||||
(MAX_WZC_IE_LEN);
|
||||
buf = kmalloc(ieee->wps_ie_len, GFP_KERNEL);
|
||||
if (buf == NULL)
|
||||
return -ENOMEM;
|
||||
@@ -842,13 +855,11 @@ int rtllib_wx_set_gen_ie(struct rtllib_device *ieee, u8 *ie, size_t len)
|
||||
}
|
||||
}
|
||||
ieee->wps_ie_len = 0;
|
||||
if (ieee->wps_ie)
|
||||
kfree(ieee->wps_ie);
|
||||
ieee->wps_ie = NULL;
|
||||
if (len) {
|
||||
if (len != ie[1]+2) {
|
||||
if (len != ie[1]+2)
|
||||
return -EINVAL;
|
||||
}
|
||||
buf = kmalloc(len, GFP_KERNEL);
|
||||
if (buf == NULL)
|
||||
return -ENOMEM;
|
||||
@@ -857,7 +868,6 @@ int rtllib_wx_set_gen_ie(struct rtllib_device *ieee, u8 *ie, size_t len)
|
||||
ieee->wpa_ie = buf;
|
||||
ieee->wpa_ie_len = len;
|
||||
} else {
|
||||
if (ieee->wpa_ie)
|
||||
kfree(ieee->wpa_ie);
|
||||
ieee->wpa_ie = NULL;
|
||||
ieee->wpa_ie_len = 0;
|
||||
|
Reference in New Issue
Block a user