summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8712
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/rtl8712')
-rw-r--r--drivers/staging/rtl8712/ieee80211.c5
-rw-r--r--drivers/staging/rtl8712/mlme_linux.c10
-rw-r--r--drivers/staging/rtl8712/os_intfs.c14
-rw-r--r--drivers/staging/rtl8712/rtl8712_led.c2
-rw-r--r--drivers/staging/rtl8712/rtl8712_recv.c11
-rw-r--r--drivers/staging/rtl8712/rtl871x_cmd.h2
-rw-r--r--drivers/staging/rtl8712/rtl871x_event.h8
-rw-r--r--drivers/staging/rtl8712/rtl871x_io.h14
-rw-r--r--drivers/staging/rtl8712/rtl871x_ioctl_linux.c143
-rw-r--r--drivers/staging/rtl8712/rtl871x_ioctl_rtl.c10
-rw-r--r--drivers/staging/rtl8712/rtl871x_mlme.h16
-rw-r--r--drivers/staging/rtl8712/rtl871x_mp_ioctl.h191
-rw-r--r--drivers/staging/rtl8712/rtl871x_pwrctrl.h10
-rw-r--r--drivers/staging/rtl8712/rtl871x_recv.h12
-rw-r--r--drivers/staging/rtl8712/rtl871x_xmit.c11
-rw-r--r--drivers/staging/rtl8712/wifi.h12
-rw-r--r--drivers/staging/rtl8712/wlan_bssdef.h6
17 files changed, 242 insertions, 235 deletions
diff --git a/drivers/staging/rtl8712/ieee80211.c b/drivers/staging/rtl8712/ieee80211.c
index d84da2b..f35121e 100644
--- a/drivers/staging/rtl8712/ieee80211.c
+++ b/drivers/staging/rtl8712/ieee80211.c
@@ -288,8 +288,9 @@ int r8712_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher,
/* No WPA IE - fail silently */
return _FAIL;
}
- if ((*wpa_ie != _WPA_IE_ID_) || (*(wpa_ie + 1) != (u8)(wpa_ie_len - 2))
- || (memcmp(wpa_ie + 2, (void *)WPA_OUI_TYPE, WPA_SELECTOR_LEN)))
+ if ((*wpa_ie != _WPA_IE_ID_) ||
+ (*(wpa_ie + 1) != (u8)(wpa_ie_len - 2)) ||
+ (memcmp(wpa_ie + 2, (void *)WPA_OUI_TYPE, WPA_SELECTOR_LEN)))
return _FAIL;
pos = wpa_ie;
pos += 8;
diff --git a/drivers/staging/rtl8712/mlme_linux.c b/drivers/staging/rtl8712/mlme_linux.c
index 999c16d..2037265 100644
--- a/drivers/staging/rtl8712/mlme_linux.c
+++ b/drivers/staging/rtl8712/mlme_linux.c
@@ -110,12 +110,12 @@ void r8712_os_indicate_disconnect(struct _adapter *adapter)
* disconnect with AP for 60 seconds.
*/
- memcpy(&backupPMKIDList[0], &adapter->securitypriv.
- PMKIDList[0], sizeof(struct RT_PMKID_LIST) *
- NUM_PMKID_CACHE);
+ memcpy(&backupPMKIDList[0],
+ &adapter->securitypriv.PMKIDList[0],
+ sizeof(struct RT_PMKID_LIST) * NUM_PMKID_CACHE);
backupPMKIDIndex = adapter->securitypriv.PMKIDIndex;
- backupTKIPCountermeasure = adapter->securitypriv.
- btkip_countermeasure;
+ backupTKIPCountermeasure =
+ adapter->securitypriv.btkip_countermeasure;
memset((unsigned char *)&adapter->securitypriv, 0,
sizeof(struct security_priv));
setup_timer(&adapter->securitypriv.tkip_timer,
diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c
index cbe4de0..8836b31 100644
--- a/drivers/staging/rtl8712/os_intfs.c
+++ b/drivers/staging/rtl8712/os_intfs.c
@@ -13,10 +13,6 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
* Modifications for inclusion into the Linux staging tree are
* Copyright(c) 2010 Larry Finger. All rights reserved.
*
@@ -168,7 +164,7 @@ static void loadparam(struct _adapter *padapter, struct net_device *pnetdev)
registry_par->ampdu_enable = (u8)ampdu_enable;
registry_par->rf_config = (u8)rf_config;
registry_par->low_power = (u8)low_power;
- registry_par->wifi_test = (u8) wifi_test;
+ registry_par->wifi_test = (u8)wifi_test;
r8712_initmac = initmac;
}
@@ -185,8 +181,8 @@ static int r871x_net_set_mac_address(struct net_device *pnetdev, void *p)
static struct net_device_stats *r871x_net_get_stats(struct net_device *pnetdev)
{
struct _adapter *padapter = netdev_priv(pnetdev);
- struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
- struct recv_priv *precvpriv = &(padapter->recvpriv);
+ struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
+ struct recv_priv *precvpriv = &padapter->recvpriv;
padapter->stats.tx_packets = pxmitpriv->tx_pkts;
padapter->stats.rx_packets = precvpriv->rx_pkts;
@@ -392,7 +388,7 @@ static int netdev_open(struct net_device *pnetdev)
if (!r8712_initmac)
/* Use the mac address stored in the Efuse */
memcpy(pnetdev->dev_addr,
- padapter->eeprompriv.mac_addr, ETH_ALEN);
+ padapter->eeprompriv.mac_addr, ETH_ALEN);
else {
/* We have to inform f/w to use user-supplied MAC
* address.
@@ -409,7 +405,7 @@ static int netdev_open(struct net_device *pnetdev)
* users specify.
*/
memcpy(padapter->eeprompriv.mac_addr,
- pnetdev->dev_addr, ETH_ALEN);
+ pnetdev->dev_addr, ETH_ALEN);
}
if (start_drv_threads(padapter) != _SUCCESS)
goto netdev_open_error;
diff --git a/drivers/staging/rtl8712/rtl8712_led.c b/drivers/staging/rtl8712/rtl8712_led.c
index 317aeee..da1d4a6 100644
--- a/drivers/staging/rtl8712/rtl8712_led.c
+++ b/drivers/staging/rtl8712/rtl8712_led.c
@@ -1734,7 +1734,7 @@ static void SwLedControlMode6(struct _adapter *padapter,
case LED_CTL_LINK: /*solid blue*/
case LED_CTL_SITE_SURVEY:
if (IS_LED_WPS_BLINKING(pLed))
- return;
+ return;
pLed->CurrLedState = LED_STATE_ON;
pLed->BlinkingLedState = LED_STATE_ON;
pLed->bLedBlinkInProgress = false;
diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c
index 20fe45a..266ffef 100644
--- a/drivers/staging/rtl8712/rtl8712_recv.c
+++ b/drivers/staging/rtl8712/rtl8712_recv.c
@@ -444,9 +444,9 @@ void r8712_rxcmd_event_hdl(struct _adapter *padapter, void *prxcmdbuf)
u16 cmd_len, drvinfo_sz;
struct recv_stat *prxstat;
- poffset = (u8 *)prxcmdbuf;
+ poffset = prxcmdbuf;
voffset = *(__le32 *)poffset;
- prxstat = (struct recv_stat *)prxcmdbuf;
+ prxstat = prxcmdbuf;
drvinfo_sz = (le32_to_cpu(prxstat->rxdw0) & 0x000f0000) >> 16;
drvinfo_sz <<= 3;
poffset += RXDESC_SIZE + drvinfo_sz;
@@ -634,8 +634,7 @@ _err_exit:
void r8712_reordering_ctrl_timeout_handler(void *pcontext)
{
unsigned long irql;
- struct recv_reorder_ctrl *preorder_ctrl =
- (struct recv_reorder_ctrl *)pcontext;
+ struct recv_reorder_ctrl *preorder_ctrl = pcontext;
struct _adapter *padapter = preorder_ctrl->padapter;
struct __queue *ppending_recvframe_queue =
&preorder_ctrl->pending_recvframe_queue;
@@ -976,7 +975,7 @@ int recv_func(struct _adapter *padapter, void *pcontext)
struct __queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
- prframe = (union recv_frame *)pcontext;
+ prframe = pcontext;
orig_prframe = prframe;
pattrib = &prframe->u.hdr.attrib;
if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
@@ -1124,7 +1123,7 @@ _exit_recvbuf2recvframe:
static void recv_tasklet(void *priv)
{
struct sk_buff *pskb;
- struct _adapter *padapter = (struct _adapter *)priv;
+ struct _adapter *padapter = priv;
struct recv_priv *precvpriv = &padapter->recvpriv;
while (NULL != (pskb = skb_dequeue(&precvpriv->rx_skb_queue))) {
diff --git a/drivers/staging/rtl8712/rtl871x_cmd.h b/drivers/staging/rtl8712/rtl871x_cmd.h
index 4734ca8..24da2cc 100644
--- a/drivers/staging/rtl8712/rtl871x_cmd.h
+++ b/drivers/staging/rtl8712/rtl871x_cmd.h
@@ -144,7 +144,7 @@ struct disconnect_parm {
* #define IW_MODE_REPEAT 4 // Wireless Repeater (forwarder)
* #define IW_MODE_SECOND 5 // Secondary master/repeater (backup)
* #define IW_MODE_MONITOR 6 // Passive monitor (listen only)
-*/
+ */
struct setopmode_parm {
u8 mode;
u8 rsvd[3];
diff --git a/drivers/staging/rtl8712/rtl871x_event.h b/drivers/staging/rtl8712/rtl871x_event.h
index 5db8620..5171379 100644
--- a/drivers/staging/rtl8712/rtl871x_event.h
+++ b/drivers/staging/rtl8712/rtl871x_event.h
@@ -34,7 +34,7 @@
/*
* Used to report a bss has been scanned
-*/
+ */
struct survey_event {
struct wlan_bssid_ex bss;
};
@@ -42,7 +42,7 @@ struct survey_event {
/*
* Used to report that the requested site survey has been done.
* bss_cnt indicates the number of bss that has been reported.
-*/
+ */
struct surveydone_event {
unsigned int bss_cnt;
@@ -54,7 +54,7 @@ struct surveydone_event {
* -1: authentication fail
* -2: association fail
* > 0: TID
-*/
+ */
struct joinbss_event {
struct wlan_network network;
};
@@ -62,7 +62,7 @@ struct joinbss_event {
/*
* Used to report a given STA has joinned the created BSS.
* It is used in AP/Ad-HoC(M) mode.
-*/
+ */
struct stassoc_event {
unsigned char macaddr[6];
unsigned char rsvd[2];
diff --git a/drivers/staging/rtl8712/rtl871x_io.h b/drivers/staging/rtl8712/rtl871x_io.h
index 26dd24c..dd054d7 100644
--- a/drivers/staging/rtl8712/rtl871x_io.h
+++ b/drivers/staging/rtl8712/rtl871x_io.h
@@ -49,9 +49,9 @@
#define _IO_CMDMASK_ (0x1F80)
/*
- For prompt mode accessing, caller shall free io_req
- Otherwise, io_handler will free io_req
-*/
+ * For prompt mode accessing, caller shall free io_req
+ * Otherwise, io_handler will free io_req
+ */
/* IO STATUS TYPE */
#define _IO_ERR_ BIT(2)
#define _IO_SUCCESS_ BIT(1)
@@ -69,8 +69,8 @@
#define IO_WR16_ASYNC (_IO_WRITE_ | _IO_HW_)
#define IO_WR8_ASYNC (_IO_WRITE_ | _IO_BYTE_)
/*
- Only Sync. burst accessing is provided.
-*/
+ * Only Sync. burst accessing is provided.
+ */
#define IO_WR_BURST(x) (IO_WRITE_ | _IO_SYNC_ | _IO_BURST_ | \
((x) & _IOSZ_MASK_))
#define IO_RD_BURST(x) (_IO_SYNC_ | _IO_BURST_ | ((x) & _IOSZ_MASK_))
@@ -218,8 +218,8 @@ struct reg_protocol_wt {
};
/*
-Below is the data structure used by _io_handler
-*/
+ * Below is the data structure used by _io_handler
+ */
struct io_queue {
spinlock_t lock;
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index f4167f1..e30a5be 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -100,10 +100,10 @@ static inline void handle_pairwise_key(struct sta_info *psta,
memcpy(psta->x_UncstKey.skey, param->u.crypt.key,
(param->u.crypt. key_len > 16 ? 16 : param->u.crypt.key_len));
if (strcmp(param->u.crypt.alg, "TKIP") == 0) { /* set mic key */
- memcpy(psta->tkiptxmickey. skey, &(param->u.crypt.
- key[16]), 8);
- memcpy(psta->tkiprxmickey. skey, &(param->u.crypt.
- key[24]), 8);
+ memcpy(psta->tkiptxmickey. skey,
+ &(param->u.crypt.key[16]), 8);
+ memcpy(psta->tkiprxmickey. skey,
+ &(param->u.crypt.key[24]), 8);
padapter->securitypriv. busetkipkey = false;
mod_timer(&padapter->securitypriv.tkip_timer,
jiffies + msecs_to_jiffies(50));
@@ -378,13 +378,12 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
if (param_len != (u32)((u8 *) param->u.crypt.key - (u8 *)param) +
param->u.crypt.key_len)
return -EINVAL;
- if (is_broadcast_ether_addr(param->sta_addr)) {
- if (param->u.crypt.idx >= WEP_KEYS) {
- /* for large key indices, set the default (0) */
- param->u.crypt.idx = 0;
- }
- } else {
+ if (!is_broadcast_ether_addr(param->sta_addr))
return -EINVAL;
+
+ if (param->u.crypt.idx >= WEP_KEYS) {
+ /* for large key indices, set the default (0) */
+ param->u.crypt.idx = 0;
}
if (strcmp(param->u.crypt.alg, "WEP") == 0) {
netdev_info(dev, "r8712u: %s: crypt.alg = WEP\n", __func__);
@@ -396,23 +395,19 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
wep_key_len = param->u.crypt.key_len;
if (wep_key_idx >= WEP_KEYS)
wep_key_idx = 0;
- if (wep_key_len > 0) {
- wep_key_len = wep_key_len <= 5 ? 5 : 13;
- pwep = kzalloc(sizeof(*pwep), GFP_ATOMIC);
- if (!pwep)
- return -ENOMEM;
- pwep->KeyLength = wep_key_len;
- pwep->Length = wep_key_len +
- FIELD_OFFSET(struct NDIS_802_11_WEP,
- KeyMaterial);
- if (wep_key_len == 13) {
- padapter->securitypriv.PrivacyAlgrthm =
- _WEP104_;
- padapter->securitypriv.XGrpPrivacy =
- _WEP104_;
- }
- } else {
+ if (wep_key_len <= 0)
return -EINVAL;
+
+ wep_key_len = wep_key_len <= 5 ? 5 : 13;
+ pwep = kzalloc(sizeof(*pwep), GFP_ATOMIC);
+ if (!pwep)
+ return -ENOMEM;
+ pwep->KeyLength = wep_key_len;
+ pwep->Length = wep_key_len +
+ FIELD_OFFSET(struct NDIS_802_11_WEP, KeyMaterial);
+ if (wep_key_len == 13) {
+ padapter->securitypriv.PrivacyAlgrthm = _WEP104_;
+ padapter->securitypriv.XGrpPrivacy = _WEP104_;
}
pwep->KeyIndex = wep_key_idx;
pwep->KeyIndex |= 0x80000000;
@@ -700,14 +695,14 @@ static int r8711_wx_get_freq(struct net_device *dev,
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;
- if (check_fwstate(pmlmepriv, _FW_LINKED)) {
- wrqu->freq.m = ieee80211_wlan_frequencies[
- pcur_bss->Configuration.DSConfig - 1] * 100000;
- wrqu->freq.e = 1;
- wrqu->freq.i = pcur_bss->Configuration.DSConfig;
- } else {
+ if (!check_fwstate(pmlmepriv, _FW_LINKED))
return -ENOLINK;
- }
+
+ wrqu->freq.m = ieee80211_wlan_frequencies[
+ pcur_bss->Configuration.DSConfig - 1] * 100000;
+ wrqu->freq.e = 1;
+ wrqu->freq.i = pcur_bss->Configuration.DSConfig;
+
return 0;
}
@@ -1411,44 +1406,41 @@ static int r8711_wx_get_rate(struct net_device *dev,
u16 mcs_rate = 0;
i = 0;
- if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE)) {
- p = r8712_get_ie(&pcur_bss->IEs[12],
- _HT_CAPABILITY_IE_, &ht_ielen,
- pcur_bss->IELength - 12);
- if (p && ht_ielen > 0) {
- ht_cap = true;
- pht_capie = (struct ieee80211_ht_cap *)(p + 2);
- memcpy(&mcs_rate, pht_capie->supp_mcs_set, 2);
- bw_40MHz = (le16_to_cpu(pht_capie->cap_info) &
- IEEE80211_HT_CAP_SUP_WIDTH) ? 1 : 0;
- short_GI = (le16_to_cpu(pht_capie->cap_info) &
- (IEEE80211_HT_CAP_SGI_20 |
- IEEE80211_HT_CAP_SGI_40)) ? 1 : 0;
- }
- while ((pcur_bss->rates[i] != 0) &&
- (pcur_bss->rates[i] != 0xFF)) {
- rate = pcur_bss->rates[i] & 0x7F;
- if (rate > max_rate)
- max_rate = rate;
- wrqu->bitrate.fixed = 0; /* no auto select */
- wrqu->bitrate.value = rate * 500000;
- i++;
- }
- if (ht_cap) {
- if (mcs_rate & 0x8000 /* MCS15 */
- &&
- rf_type == RTL8712_RF_2T2R)
- max_rate = (bw_40MHz) ? ((short_GI) ? 300 :
- 270) : ((short_GI) ? 144 : 130);
- else /* default MCS7 */
- max_rate = (bw_40MHz) ? ((short_GI) ? 150 :
- 135) : ((short_GI) ? 72 : 65);
- max_rate *= 2; /* Mbps/2 */
- }
- wrqu->bitrate.value = max_rate * 500000;
- } else {
+ if (!check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE))
return -ENOLINK;
- }
+ p = r8712_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, &ht_ielen,
+ pcur_bss->IELength - 12);
+ if (p && ht_ielen > 0) {
+ ht_cap = true;
+ pht_capie = (struct ieee80211_ht_cap *)(p + 2);
+ memcpy(&mcs_rate, pht_capie->supp_mcs_set, 2);
+ bw_40MHz = (le16_to_cpu(pht_capie->cap_info) &
+ IEEE80211_HT_CAP_SUP_WIDTH) ? 1 : 0;
+ short_GI = (le16_to_cpu(pht_capie->cap_info) &
+ (IEEE80211_HT_CAP_SGI_20 |
+ IEEE80211_HT_CAP_SGI_40)) ? 1 : 0;
+ }
+ while ((pcur_bss->rates[i] != 0) &&
+ (pcur_bss->rates[i] != 0xFF)) {
+ rate = pcur_bss->rates[i] & 0x7F;
+ if (rate > max_rate)
+ max_rate = rate;
+ wrqu->bitrate.fixed = 0; /* no auto select */
+ wrqu->bitrate.value = rate * 500000;
+ i++;
+ }
+ if (ht_cap) {
+ if (mcs_rate & 0x8000 /* MCS15 */
+ &&
+ rf_type == RTL8712_RF_2T2R)
+ max_rate = (bw_40MHz) ? ((short_GI) ? 300 : 270) :
+ ((short_GI) ? 144 : 130);
+ else /* default MCS7 */
+ max_rate = (bw_40MHz) ? ((short_GI) ? 150 : 135) :
+ ((short_GI) ? 72 : 65);
+ max_rate *= 2; /* Mbps/2 */
+ }
+ wrqu->bitrate.value = max_rate * 500000;
return 0;
}
@@ -1973,13 +1965,12 @@ static int r871x_get_ap_info(struct net_device *dev,
break;
}
pdata->flags = 0;
- if (pdata->length >= 32) {
- if (copy_from_user(data, pdata->pointer, 32))
- return -EINVAL;
- data[32] = 0;
- } else {
+ if (pdata->length < 32)
return -EINVAL;
- }
+ if (copy_from_user(data, pdata->pointer, 32))
+ return -EINVAL;
+ data[32] = 0;
+
spin_lock_irqsave(&(pmlmepriv->scanned_queue.lock), irqL);
phead = &queue->queue;
plist = phead->next;
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_rtl.c b/drivers/staging/rtl8712/rtl871x_ioctl_rtl.c
index c7f2e51..ca769f7 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_rtl.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_rtl.c
@@ -282,8 +282,7 @@ uint oid_rt_get_total_rx_bytes_hdl(struct oid_par_priv
if (poid_par_priv->information_buf_len >= sizeof(u32)) {
*(u32 *)poid_par_priv->information_buf =
padapter->recvpriv.rx_bytes;
- *poid_par_priv->bytes_rw = poid_par_priv->
- information_buf_len;
+ *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
} else {
return RNDIS_STATUS_INVALID_LENGTH;
}
@@ -325,8 +324,7 @@ uint oid_rt_get_channel_hdl(struct oid_par_priv *poid_par_priv)
check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))
pnic_Config = &pmlmepriv->cur_network.network.Configuration;
else
- pnic_Config = &padapter->registrypriv.dev_network.
- Configuration;
+ pnic_Config = &padapter->registrypriv.dev_network.Configuration;
channelnum = pnic_Config->DSConfig;
*(u32 *)poid_par_priv->information_buf = channelnum;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
@@ -483,8 +481,8 @@ uint oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv *poid_par_priv)
*/
if (!r8712_getrfreg_cmd(Adapter,
*(unsigned char *)poid_par_priv->information_buf,
- (unsigned char *)&Adapter->mppriv.workparam.
- io_value))
+ (unsigned char *)&Adapter->mppriv.workparam.io_value
+ ))
status = RNDIS_STATUS_NOT_ACCEPTED;
}
} else {
diff --git a/drivers/staging/rtl8712/rtl871x_mlme.h b/drivers/staging/rtl8712/rtl871x_mlme.h
index 53a2323..b21f281 100644
--- a/drivers/staging/rtl8712/rtl871x_mlme.h
+++ b/drivers/staging/rtl8712/rtl871x_mlme.h
@@ -68,14 +68,14 @@
#define _FW_UNDER_SURVEY WIFI_SITE_MONITOR
/*
-there are several "locks" in mlme_priv,
-since mlme_priv is a shared resource between many threads,
-like ISR/Call-Back functions, the OID handlers, and even timer functions.
-Each _queue has its own locks, already.
-Other items are protected by mlme_priv.lock.
-To avoid possible dead lock, any thread trying to modify mlme_priv
-SHALL not lock up more than one lock at a time!
-*/
+ * there are several "locks" in mlme_priv,
+ * since mlme_priv is a shared resource between many threads,
+ * like ISR/Call-Back functions, the OID handlers, and even timer functions.
+ * Each _queue has its own locks, already.
+ * Other items are protected by mlme_priv.lock.
+ * To avoid possible dead lock, any thread trying to modify mlme_priv
+ * SHALL not lock up more than one lock at a time!
+ */
#define traffic_threshold 10
#define traffic_scan_period 500
diff --git a/drivers/staging/rtl8712/rtl871x_mp_ioctl.h b/drivers/staging/rtl8712/rtl871x_mp_ioctl.h
index 1102451..741006f 100644
--- a/drivers/staging/rtl8712/rtl871x_mp_ioctl.h
+++ b/drivers/staging/rtl8712/rtl871x_mp_ioctl.h
@@ -150,103 +150,126 @@ uint oid_rt_get_power_mode_hdl(
#ifdef _RTL871X_MP_IOCTL_C_ /* CAUTION!!! */
/* This ifdef _MUST_ be left in!! */
static const struct oid_obj_priv oid_rtl_seg_81_80_00[] = {
- {1, oid_null_function}, /*0x00 OID_RT_PRO_RESET_DUT */
- {1, oid_rt_pro_set_data_rate_hdl}, /*0x01*/
- {1, oid_rt_pro_start_test_hdl}, /*0x02*/
- {1, oid_rt_pro_stop_test_hdl}, /*0x03*/
- {1, oid_null_function}, /*0x04 OID_RT_PRO_SET_PREAMBLE*/
- {1, oid_null_function}, /*0x05 OID_RT_PRO_SET_SCRAMBLER*/
- {1, oid_null_function}, /*0x06 OID_RT_PRO_SET_FILTER_BB*/
- {1, oid_null_function}, /*0x07
- * OID_RT_PRO_SET_MANUAL_DIVERS_BB
- */
- {1, oid_rt_pro_set_channel_direct_call_hdl}, /*0x08*/
- {1, oid_null_function}, /*0x09
- * OID_RT_PRO_SET_SLEEP_MODE_DIRECT_CALL
- */
- {1, oid_null_function}, /*0x0A
- * OID_RT_PRO_SET_WAKE_MODE_DIRECT_CALL
- */
- {1, oid_rt_pro_set_continuous_tx_hdl}, /*0x0B
- * OID_RT_PRO_SET_TX_CONTINUOUS_DIRECT_CALL
- */
- {1, oid_rt_pro_set_single_carrier_tx_hdl}, /*0x0C
- * OID_RT_PRO_SET_SINGLE_CARRIER_TX_CONTINUOUS
- */
- {1, oid_null_function}, /*0x0D
- * OID_RT_PRO_SET_TX_ANTENNA_BB
- */
- {1, oid_rt_pro_set_antenna_bb_hdl}, /*0x0E*/
- {1, oid_null_function}, /*0x0F OID_RT_PRO_SET_CR_SCRAMBLER*/
- {1, oid_null_function}, /*0x10 OID_RT_PRO_SET_CR_NEW_FILTER*/
- {1, oid_rt_pro_set_tx_power_control_hdl}, /*0x11
- * OID_RT_PRO_SET_TX_POWER_CONTROL
- */
- {1, oid_null_function}, /*0x12 OID_RT_PRO_SET_CR_TX_CONFIG*/
- {1, oid_null_function}, /*0x13
- * OID_RT_PRO_GET_TX_POWER_CONTROL
- */
- {1, oid_null_function}, /*0x14
- * OID_RT_PRO_GET_CR_SIGNAL_QUALITY
- */
- {1, oid_null_function}, /*0x15 OID_RT_PRO_SET_CR_SETPOINT*/
- {1, oid_null_function}, /*0x16 OID_RT_PRO_SET_INTEGRATOR*/
- {1, oid_null_function}, /*0x17 OID_RT_PRO_SET_SIGNAL_QUALITY*/
- {1, oid_null_function}, /*0x18 OID_RT_PRO_GET_INTEGRATOR*/
- {1, oid_null_function}, /*0x19 OID_RT_PRO_GET_SIGNAL_QUALITY*/
- {1, oid_null_function}, /*0x1A OID_RT_PRO_QUERY_EEPROM_TYPE*/
- {1, oid_null_function}, /*0x1B OID_RT_PRO_WRITE_MAC_ADDRESS*/
- {1, oid_null_function}, /*0x1C OID_RT_PRO_READ_MAC_ADDRESS*/
- {1, oid_null_function}, /*0x1D OID_RT_PRO_WRITE_CIS_DATA*/
- {1, oid_null_function}, /*0x1E OID_RT_PRO_READ_CIS_DATA*/
- {1, oid_null_function} /*0x1F OID_RT_PRO_WRITE_POWER_CONTROL*/
+ /* 0x00 OID_RT_PRO_RESET_DUT */
+ {1, oid_null_function},
+ /* 0x01 */
+ {1, oid_rt_pro_set_data_rate_hdl},
+ /* 0x02 */
+ {1, oid_rt_pro_start_test_hdl},
+ /* 0x03 */
+ {1, oid_rt_pro_stop_test_hdl},
+ /* 0x04 OID_RT_PRO_SET_PREAMBLE */
+ {1, oid_null_function},
+ /* 0x05 OID_RT_PRO_SET_SCRAMBLER */
+ {1, oid_null_function},
+ /* 0x06 OID_RT_PRO_SET_FILTER_BB */
+ {1, oid_null_function},
+ /* 0x07 OID_RT_PRO_SET_MANUAL_DIVERS_BB */
+ {1, oid_null_function},
+ /* 0x08 */
+ {1, oid_rt_pro_set_channel_direct_call_hdl},
+ /* 0x09 OID_RT_PRO_SET_SLEEP_MODE_DIRECT_CALL */
+ {1, oid_null_function},
+ /* 0x0A OID_RT_PRO_SET_WAKE_MODE_DIRECT_CALL */
+ {1, oid_null_function},
+ /* 0x0B OID_RT_PRO_SET_TX_CONTINUOUS_DIRECT_CALL */
+ {1, oid_rt_pro_set_continuous_tx_hdl},
+ /* 0x0C OID_RT_PRO_SET_SINGLE_CARRIER_TX_CONTINUOUS */
+ {1, oid_rt_pro_set_single_carrier_tx_hdl},
+ /* 0x0D OID_RT_PRO_SET_TX_ANTENNA_BB */
+ {1, oid_null_function},
+ /* 0x0E */
+ {1, oid_rt_pro_set_antenna_bb_hdl},
+ /* 0x0F OID_RT_PRO_SET_CR_SCRAMBLER */
+ {1, oid_null_function},
+ /* 0x10 OID_RT_PRO_SET_CR_NEW_FILTER */
+ {1, oid_null_function},
+ /* 0x11 OID_RT_PRO_SET_TX_POWER_CONTROL */
+ {1, oid_rt_pro_set_tx_power_control_hdl},
+ /* 0x12 OID_RT_PRO_SET_CR_TX_CONFIG */
+ {1, oid_null_function},
+ /* 0x13 OID_RT_PRO_GET_TX_POWER_CONTROL */
+ {1, oid_null_function},
+ /* 0x14 OID_RT_PRO_GET_CR_SIGNAL_QUALITY */
+ {1, oid_null_function},
+ /* 0x15 OID_RT_PRO_SET_CR_SETPOINT */
+ {1, oid_null_function},
+ /* 0x16 OID_RT_PRO_SET_INTEGRATOR */
+ {1, oid_null_function},
+ /* 0x17 OID_RT_PRO_SET_SIGNAL_QUALITY */
+ {1, oid_null_function},
+ /* 0x18 OID_RT_PRO_GET_INTEGRATOR */
+ {1, oid_null_function},
+ /* 0x19 OID_RT_PRO_GET_SIGNAL_QUALITY */
+ {1, oid_null_function},
+ /* 0x1A OID_RT_PRO_QUERY_EEPROM_TYPE */
+ {1, oid_null_function},
+ /* 0x1B OID_RT_PRO_WRITE_MAC_ADDRESS */
+ {1, oid_null_function},
+ /* 0x1C OID_RT_PRO_READ_MAC_ADDRESS */
+ {1, oid_null_function},
+ /* 0x1D OID_RT_PRO_WRITE_CIS_DATA */
+ {1, oid_null_function},
+ /* 0x1E OID_RT_PRO_READ_CIS_DATA */
+ {1, oid_null_function},
+ /* 0x1F OID_RT_PRO_WRITE_POWER_CONTROL */
+ {1, oid_null_function}
};
static const struct oid_obj_priv oid_rtl_seg_81_80_20[] = {
- {1, oid_null_function}, /*0x20 OID_RT_PRO_READ_POWER_CONTROL*/
- {1, oid_null_function}, /*0x21 OID_RT_PRO_WRITE_EEPROM*/
- {1, oid_null_function}, /*0x22 OID_RT_PRO_READ_EEPROM*/
- {1, oid_rt_pro_reset_tx_packet_sent_hdl}, /*0x23*/
- {1, oid_rt_pro_query_tx_packet_sent_hdl}, /*0x24*/
- {1, oid_rt_pro_reset_rx_packet_received_hdl}, /*0x25*/
- {1, oid_rt_pro_query_rx_packet_received_hdl}, /*0x26*/
- {1, oid_rt_pro_query_rx_packet_crc32_error_hdl},/*0x27*/
- {1, oid_null_function}, /*0x28
- *OID_RT_PRO_QUERY_CURRENT_ADDRESS
- */
- {1, oid_null_function}, /*0x29
- *OID_RT_PRO_QUERY_PERMANENT_ADDRESS
- */
- {1, oid_null_function}, /*0x2A
- *OID_RT_PRO_SET_PHILIPS_RF_PARAMETERS
- */
- {1, oid_rt_pro_set_carrier_suppression_tx_hdl},/*0x2B
- *OID_RT_PRO_SET_CARRIER_SUPPRESSION_TX
- */
- {1, oid_null_function}, /*0x2C OID_RT_PRO_RECEIVE_PACKET*/
- {1, oid_null_function}, /*0x2D OID_RT_PRO_WRITE_EEPROM_BYTE*/
- {1, oid_null_function}, /*0x2E OID_RT_PRO_READ_EEPROM_BYTE*/
- {1, oid_rt_pro_set_modulation_hdl} /*0x2F*/
+ /* 0x20 OID_RT_PRO_READ_POWER_CONTROL */
+ {1, oid_null_function},
+ /* 0x21 OID_RT_PRO_WRITE_EEPROM */
+ {1, oid_null_function},
+ /* 0x22 OID_RT_PRO_READ_EEPROM */
+ {1, oid_null_function},
+ /* 0x23 */
+ {1, oid_rt_pro_reset_tx_packet_sent_hdl},
+ /* 0x24 */
+ {1, oid_rt_pro_query_tx_packet_sent_hdl},
+ /* 0x25 */
+ {1, oid_rt_pro_reset_rx_packet_received_hdl},
+ /* 0x26 */
+ {1, oid_rt_pro_query_rx_packet_received_hdl},
+ /* 0x27 */
+ {1, oid_rt_pro_query_rx_packet_crc32_error_hdl},
+ /* 0x28 OID_RT_PRO_QUERY_CURRENT_ADDRESS */
+ {1, oid_null_function},
+ /* 0x29 OID_RT_PRO_QUERY_PERMANENT_ADDRESS */
+ {1, oid_null_function},
+ /* 0x2A OID_RT_PRO_SET_PHILIPS_RF_PARAMETERS */
+ {1, oid_null_function},
+ /* 0x2B OID_RT_PRO_SET_CARRIER_SUPPRESSION_TX */
+ {1, oid_rt_pro_set_carrier_suppression_tx_hdl},
+ /* 0x2C OID_RT_PRO_RECEIVE_PACKET */
+ {1, oid_null_function},
+ /* 0x2D OID_RT_PRO_WRITE_EEPROM_BYTE */
+ {1, oid_null_function},
+ /* 0x2E OID_RT_PRO_READ_EEPROM_BYTE */
+ {1, oid_null_function},
+ /* 0x2F */
+ {1, oid_rt_pro_set_modulation_hdl}
};
static const struct oid_obj_priv oid_rtl_seg_81_80_40[] = {
- {1, oid_null_function}, /*0x40*/
- {1, oid_null_function}, /*0x41*/
- {1, oid_null_function}, /*0x42*/
- {1, oid_rt_pro_set_single_tone_tx_hdl}, /*0x43*/
- {1, oid_null_function}, /*0x44*/
- {1, oid_null_function} /*0x45*/
+ {1, oid_null_function}, /* 0x40 */
+ {1, oid_null_function}, /* 0x41 */
+ {1, oid_null_function}, /* 0x42 */
+ {1, oid_rt_pro_set_single_tone_tx_hdl}, /* 0x43 */
+ {1, oid_null_function}, /* 0x44 */
+ {1, oid_null_function} /* 0x45 */
};
static const struct oid_obj_priv oid_rtl_seg_81_80_80[] = {
- {1, oid_null_function}, /*0x80 OID_RT_DRIVER_OPTION*/
- {1, oid_null_function}, /*0x81 OID_RT_RF_OFF*/
- {1, oid_null_function} /*0x82 OID_RT_AUTH_STATUS*/
+ {1, oid_null_function}, /* 0x80 OID_RT_DRIVER_OPTION */
+ {1, oid_null_function}, /* 0x81 OID_RT_RF_OFF */
+ {1, oid_null_function} /* 0x82 OID_RT_AUTH_STATUS */
};
static const struct oid_obj_priv oid_rtl_seg_81_85[] = {
- {1, oid_rt_wireless_mode_hdl} /*0x00 OID_RT_WIRELESS_MODE*/
+ /* 0x00 OID_RT_WIRELESS_MODE */
+ {1, oid_rt_wireless_mode_hdl}
};
#else /* _RTL871X_MP_IOCTL_C_ */
diff --git a/drivers/staging/rtl8712/rtl871x_pwrctrl.h b/drivers/staging/rtl8712/rtl871x_pwrctrl.h
index c82fdf8..bd2c3a2 100644
--- a/drivers/staging/rtl8712/rtl871x_pwrctrl.h
+++ b/drivers/staging/rtl8712/rtl871x_pwrctrl.h
@@ -48,11 +48,11 @@ enum Power_Mgnt {
};
/*
- BIT[2:0] = HW state
- BIT[3] = Protocol PS state, 0: register active state,
- 1: register sleep state
- BIT[4] = sub-state
-*/
+ * BIT[2:0] = HW state
+ * BIT[3] = Protocol PS state, 0: register active state,
+ * 1: register sleep state
+ * BIT[4] = sub-state
+ */
#define PS_DPS BIT(0)
#define PS_LCLK (PS_DPS)
diff --git a/drivers/staging/rtl8712/rtl871x_recv.h b/drivers/staging/rtl8712/rtl871x_recv.h
index f419943..9de06c5 100644
--- a/drivers/staging/rtl8712/rtl871x_recv.h
+++ b/drivers/staging/rtl8712/rtl871x_recv.h
@@ -74,12 +74,12 @@ struct rx_pkt_attrib {
};
/*
-accesser of recv_priv: recv_entry(dispatch / passive level);
-recv_thread(passive) ; returnpkt(dispatch)
-; halt(passive) ;
-
-using enter_critical section to protect
-*/
+ * accesser of recv_priv: recv_entry(dispatch / passive level);
+ * recv_thread(passive) ; returnpkt(dispatch)
+ * ; halt(passive) ;
+ *
+ * using enter_critical section to protect
+ */
struct recv_priv {
spinlock_t lock;
struct __queue free_recv_queue;
diff --git a/drivers/staging/rtl8712/rtl871x_xmit.c b/drivers/staging/rtl8712/rtl871x_xmit.c
index de88819..eda2aee 100644
--- a/drivers/staging/rtl8712/rtl871x_xmit.c
+++ b/drivers/staging/rtl8712/rtl871x_xmit.c
@@ -213,8 +213,9 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
if (padapter->pwrctrlpriv.pwr_mode !=
padapter->registrypriv.power_mgnt) {
del_timer_sync(&pmlmepriv->dhcp_timer);
- r8712_set_ps_mode(padapter, padapter->registrypriv.
- power_mgnt, padapter->registrypriv.smart_ps);
+ r8712_set_ps_mode(padapter,
+ padapter->registrypriv.power_mgnt,
+ padapter->registrypriv.smart_ps);
}
}
}
@@ -416,15 +417,13 @@ static sint xmitframe_addmic(struct _adapter *padapter,
&pframe[10], 6);
}
if (pqospriv->qos_option == 1)
- priority[0] = (u8)pxmitframe->
- attrib.priority;
+ priority[0] = (u8)pxmitframe->attrib.priority;
r8712_secmicappend(&micdata, &priority[0], 4);
payload = pframe;
for (curfragnum = 0; curfragnum < pattrib->nr_frags;
curfragnum++) {
payload = (u8 *)RND4((addr_t)(payload));
- payload = payload + pattrib->
- hdrlen + pattrib->iv_len;
+ payload += pattrib->hdrlen + pattrib->iv_len;
if ((curfragnum + 1) == pattrib->nr_frags) {
length = pattrib->last_txcmdsz -
pattrib->hdrlen -
diff --git a/drivers/staging/rtl8712/wifi.h b/drivers/staging/rtl8712/wifi.h
index 74dfc9b..556367b 100644
--- a/drivers/staging/rtl8712/wifi.h
+++ b/drivers/staging/rtl8712/wifi.h
@@ -370,7 +370,7 @@ static inline unsigned char *get_hdr_bssid(unsigned char *pframe)
/*-----------------------------------------------------------------------------
- Below is for the security related definition
+ * Below is for the security related definition
*-----------------------------------------------------------------------------
*/
#define _RESERVED_FRAME_TYPE_ 0
@@ -415,7 +415,7 @@ static inline unsigned char *get_hdr_bssid(unsigned char *pframe)
/* ---------------------------------------------------------------------------
- Below is the fixed elements...
+ * Below is the fixed elements...
* ---------------------------------------------------------------------------
*/
#define _AUTH_ALGM_NUM_ 2
@@ -444,14 +444,14 @@ static inline unsigned char *get_hdr_bssid(unsigned char *pframe)
#define cap_ShortPremble BIT(5)
/*-----------------------------------------------------------------------------
- Below is the definition for 802.11i / 802.1x
+ * Below is the definition for 802.11i / 802.1x
*------------------------------------------------------------------------------
*/
#define _IEEE8021X_MGT_ 1 /*WPA */
#define _IEEE8021X_PSK_ 2 /* WPA with pre-shared key */
/*-----------------------------------------------------------------------------
- Below is the definition for WMM
+ * Below is the definition for WMM
*------------------------------------------------------------------------------
*/
#define _WMM_IE_Length_ 7 /* for WMM STA */
@@ -459,7 +459,7 @@ static inline unsigned char *get_hdr_bssid(unsigned char *pframe)
/*-----------------------------------------------------------------------------
- Below is the definition for 802.11n
+ * Below is the definition for 802.11n
*------------------------------------------------------------------------------
*/
@@ -498,7 +498,7 @@ struct ieee80211_bar {
#define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004
- /**
+/*
* struct ieee80211_ht_cap - HT capabilities
*
* This structure refers to "HT capabilities element" as
diff --git a/drivers/staging/rtl8712/wlan_bssdef.h b/drivers/staging/rtl8712/wlan_bssdef.h
index c0654ae..9dc9ce5 100644
--- a/drivers/staging/rtl8712/wlan_bssdef.h
+++ b/drivers/staging/rtl8712/wlan_bssdef.h
@@ -53,9 +53,9 @@ struct NDIS_802_11_CONFIGURATION_FH {
};
/*
- FW will only save the channel number in DSConfig.
- ODI Handler will convert the channel number to freq. number.
-*/
+ * FW will only save the channel number in DSConfig.
+ * ODI Handler will convert the channel number to freq. number.
+ */
struct NDIS_802_11_CONFIGURATION {
u32 Length; /* Length of structure */
u32 BeaconPeriod; /* units are Kusec */
OpenPOWER on IntegriCloud