[PATCH 0/3] Staging: rtl8192u: Remove do-nothing functions

2015-10-03 Thread mike dupuis
This is a series of patches to remove three functions that do no
processing in staging/rtl8192u/ieee80211/.

Before:
drivers/staging/rtl8192u/$ grep _null\( *.c
drivers/staging/rtl8192u/$

drivers/staging/rtl8192u/ieee80211/$ grep _null\( *.c
ieee80211_crypt_ccmp.c:void ieee80211_ccmp_null(void)
ieee80211_crypt_tkip.c:void ieee80211_tkip_null(void)
ieee80211_crypt_wep.c:void ieee80211_wep_null(void)
ieee80211_module.c: ieee80211_tkip_null();
ieee80211_module.c: ieee80211_wep_null();
ieee80211_module.c: ieee80211_ccmp_null();
drivers/staging/rtl8192u/ieee80211/$

After:
drivers/staging/rtl8192u/$ grep _null\( *.c
drivers/staging/rtl8192u/$

drivers/staging/rtl8192u/ieee80211/$ grep _null\( *.c
drivers/staging/rtl8192u/ieee80211/$

Mike Dupuis (3):
  Staging: rtl8192u: remove ieee80211_tkip_null()
  Staging: rtl8192u: remove ieee80211_wep_null()
  Staging: rtl8192u: remove ieee80211_ccmp_null()

 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 6 --
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c  | 4 
 drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 5 -
 3 files changed, 15 deletions(-)

-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/3] Staging: rtl8192u: remove ieee80211_wep_null()

2015-10-03 Thread mike dupuis
This is a patch to remove the function ieee80211_wep_null().
This function does nothing and can therefore be safely removed.

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c | 4 
 drivers/staging/rtl8192u/ieee80211/ieee80211_module.c| 1 -
 2 files changed, 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c
index 681611d..4c2fb84 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c
@@ -273,7 +273,3 @@ void __exit ieee80211_crypto_wep_exit(void)
 {
ieee80211_unregister_crypto_ops(_crypt_wep);
 }
-
-void ieee80211_wep_null(void)
-{
-}
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
index d5faf2f..61edd57 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
@@ -176,7 +176,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
}
 
 /* These function were added to load crypte module autoly */
-   ieee80211_wep_null();
ieee80211_ccmp_null();
 
return dev;
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/3] Staging: rtl8192u: remove ieee80211_ccmp_null()

2015-10-03 Thread mike dupuis
This is a patch to remove the function ieee80211_ccmp_null().
This function does nothing and can therefore be safely removed.

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
index 61edd57..af22ee5 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
@@ -175,9 +175,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
  ieee->last_packet_time[i] = 0;
}
 
-/* These function were added to load crypte module autoly */
-   ieee80211_ccmp_null();
-
return dev;
 
  failed:
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/3] Staging: rtl8192u: remove ieee80211_tkip_null()

2015-10-03 Thread mike dupuis
This is a patch to remove the function ieee80211_tkip_null().
This function does nothing, and can therefore be safely removed.

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 6 --
 drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 1 -
 2 files changed, 7 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
index 1f80c52..72d4fc6 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
@@ -769,9 +769,3 @@ void __exit ieee80211_crypto_tkip_exit(void)
 {
ieee80211_unregister_crypto_ops(_crypt_tkip);
 }
-
-void ieee80211_tkip_null(void)
-{
-//printk(">%s()\n", __func__);
-   return;
-}
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
index 425b2dd..d5faf2f 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
@@ -176,7 +176,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
}
 
 /* These function were added to load crypte module autoly */
-   ieee80211_tkip_null();
ieee80211_wep_null();
ieee80211_ccmp_null();
 
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/5] Staging: rtl8192u: missing blank lines after declarations

2015-10-01 Thread mike dupuis
This is a patch to add missing lines after variable decalarations
in two functions in ieee80211_crypt_ccmp.c

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
index 71e8ad5..0404654 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
@@ -104,6 +104,7 @@ static void ieee80211_ccmp_deinit(void *priv)
 static inline void xor_block(u8 *b, u8 *a, size_t len)
 {
int i;
+
for (i = 0; i < len; i++)
b[i] ^= a[i];
 }
@@ -426,6 +427,7 @@ static int ieee80211_ccmp_get_key(void *key, int len, u8 
*seq, void *priv)
 static char *ieee80211_ccmp_print_stats(char *p, void *priv)
 {
struct ieee80211_ccmp_data *ccmp = priv;
+
p += sprintf(p, "key[%d] alg=CCMP key_set=%d tx_pn=%pm rx_pn=%pm 
format_errors=%d replays=%d decrypt_errors=%d\n",
 ccmp->key_idx, ccmp->key_set,
 ccmp->tx_pn, ccmp->rx_pn,
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/5] Staging: rtl8192u: quoted strings split across lines

2015-10-01 Thread mike dupuis
This is a patch to fix up instances where quoted strings are split
across multiple lines in several instances in ieee80211_crypt_ccmp.c

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 .../rtl8192u/ieee80211/ieee80211_crypt_ccmp.c  | 27 +-
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
index a661416..71e8ad5 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
@@ -73,8 +73,7 @@ static void *ieee80211_ccmp_init(int key_idx)
 
priv->tfm = (void *)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
if (IS_ERR(priv->tfm)) {
-   printk(KERN_DEBUG "ieee80211_crypt_ccmp: could not allocate "
-  "crypto API aes\n");
+   printk(KERN_DEBUG "ieee80211_crypt_ccmp: could not allocate 
crypto API aes\n");
priv->tfm = NULL;
goto fail;
}
@@ -284,23 +283,22 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, 
int hdr_len, void *priv)
keyidx = pos[3];
if (!(keyidx & (1 << 5))) {
if (net_ratelimit()) {
-   printk(KERN_DEBUG "CCMP: received packet without ExtIV"
-  " flag from %pM\n", hdr->addr2);
+   printk(KERN_DEBUG "CCMP: received packet without ExtIV 
flag from %pM\n",
+   hdr->addr2);
}
key->dot11RSNAStatsCCMPFormatErrors++;
return -2;
}
keyidx >>= 6;
if (key->key_idx != keyidx) {
-   printk(KERN_DEBUG "CCMP: RX tkey->key_idx=%d frame "
-  "keyidx=%d priv=%p\n", key->key_idx, keyidx, priv);
+   printk(KERN_DEBUG "CCMP: RX tkey->key_idx=%d frame keyidx=%d 
priv=%p\n",
+   key->key_idx, keyidx, priv);
return -6;
}
if (!key->key_set) {
if (net_ratelimit()) {
-   printk(KERN_DEBUG "CCMP: received packet from %pM"
-  " with keyid=%d that does not have a configured"
-  " key\n", hdr->addr2, keyidx);
+   printk(KERN_DEBUG "CCMP: received packet from %pM with 
keyid=%d that does not have a configured key\n",
+   hdr->addr2, keyidx);
}
return -3;
}
@@ -315,8 +313,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
 
if (memcmp(pn, key->rx_pn, CCMP_PN_LEN) <= 0) {
if (net_ratelimit()) {
-   printk(KERN_DEBUG "CCMP: replay detected: STA=%pM"
-  " previous PN %pm received PN %pm\n",
+   printk(KERN_DEBUG "CCMP: replay detected: STA=%pM 
previous PN %pm received PN %pm\n",
   hdr->addr2, key->rx_pn, pn);
}
key->dot11RSNAStatsCCMPReplays++;
@@ -353,8 +350,8 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
 
if (memcmp(mic, a, CCMP_MIC_LEN) != 0) {
if (net_ratelimit()) {
-   printk(KERN_DEBUG "CCMP: decrypt failed: STA="
-   "%pM\n", hdr->addr2);
+   printk(KERN_DEBUG "CCMP: decrypt failed: 
STA=%pM\n",
+   hdr->addr2);
}
key->dot11RSNAStatsCCMPDecryptErrors++;
return -5;
@@ -429,9 +426,7 @@ static int ieee80211_ccmp_get_key(void *key, int len, u8 
*seq, void *priv)
 static char *ieee80211_ccmp_print_stats(char *p, void *priv)
 {
struct ieee80211_ccmp_data *ccmp = priv;
-   p += sprintf(p, "key[%d] alg=CCMP key_set=%d "
-"tx_pn=%pm rx_pn=%pm "
-"format_errors=%d replays=%d decrypt_errors=%d\n",
+   p += sprintf(p, "key[%d] alg=CCMP key_set=%d tx_pn=%pm rx_pn=%pm 
format_errors=%d replays=%d decrypt_errors=%d\n",
 ccmp->key_idx, ccmp->key_set,
 ccmp->tx_pn, ccmp->rx_pn,
 ccmp->dot11RSNAStatsCCMPFormatErrors,
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/5] Staging: rtl8192u: checkpatch.pl issues

2015-10-01 Thread mike dupuis
This is a series of patches to correct several checkpatch.pl warnings
and errors in ieee80211_crypt_ccmp.c.

Checkpatch.pl before/after summary:
before: total: 2 errors, 23 warnings, 23 checks, 474 lines checked
after:  total: 0 errors, 10 warnings, 27 checks, 469 lines checked

Mike Dupuis (5):
  Staging: rtl8192u: quoted strings split across lines
  Staging: rtl8192u: missing blank lines after declarations
  Staging: rtl8192u: Fix block comment formatting
  Staging: rtl8192u: Correct open brace placement
  Staging: rtl8192u: Remove spaces at the start of lines

 .../rtl8192u/ieee80211/ieee80211_crypt_ccmp.c  | 47 ++
 1 file changed, 21 insertions(+), 26 deletions(-)

-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/5] Staging: rtl8192u: Fix block comment formatting

2015-10-01 Thread mike dupuis
This is a patch to correct block comment formatting in two
instances in ieee80211_crypt_ccmp.c

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
index 0404654..ca5139a 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
@@ -125,10 +125,9 @@ static void ccmp_init_blocks(struct crypto_tfm *tfm,
fc = le16_to_cpu(hdr->frame_ctl);
a4_included = ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) ==
   (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS));
-   /*
-   qc_included = ((WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) &&
-  (WLAN_FC_GET_STYPE(fc) & 0x08));
-   */
+   /* qc_included = ((WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) &&
+* (WLAN_FC_GET_STYPE(fc) & 0x08));
+*/
/* fixed by David :2006.9.6 */
qc_included = (WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) &&
   (WLAN_FC_GET_STYPE(fc) & 0x80);
@@ -146,7 +145,8 @@ static void ccmp_init_blocks(struct crypto_tfm *tfm,
 * Flag (Include authentication header, M=3 (8-octet MIC),
 *   L=1 (2-octet Dlen))
 * Nonce: 0x00 | A2 | PN
-* Dlen */
+* Dlen
+*/
b0[0] = 0x59;
b0[1] = qc;
memcpy(b0 + 2, hdr->addr2, ETH_ALEN);
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 5/5] Staging: rtl8192u: Remove spaces at the start of lines

2015-10-01 Thread mike dupuis
This is a patch to correct indentation in one instance in
ieee80211_crypt_ccmp.c

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
index c8aaab3..27ce481 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
@@ -71,7 +71,7 @@ static void *ieee80211_ccmp_init(int key_idx)
goto fail;
priv->key_idx = key_idx;
 
-   priv->tfm = (void *)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
+   priv->tfm = (void *)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
if (IS_ERR(priv->tfm)) {
printk(KERN_DEBUG "ieee80211_crypt_ccmp: could not allocate 
crypto API aes\n");
priv->tfm = NULL;
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/6] Staging: rtl8192u: move open braces to previous lines

2015-09-24 Thread mike dupuis
This is a patch to move opening braces to the lines on which their
corresponding if-statements exist in ieee80211_softmac_wx.c.

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index c0f6d7c..a1548d0 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -247,8 +247,7 @@ int ieee80211_wx_set_rts(struct ieee80211_device *ieee,
 {
if (wrqu->rts.disabled || !wrqu->rts.fixed)
ieee->rts = DEFAULT_RTS_THRESHOLD;
-   else
-   {
+   else {
if (wrqu->rts.value < MIN_RTS_THRESHOLD ||
wrqu->rts.value > MAX_RTS_THRESHOLD)
return -EINVAL;
@@ -345,8 +344,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
ieee->state = IEEE80211_LINKED;
ieee->link_change(ieee->dev);
/* To prevent the immediately calling watch_dog after scan. */
-   if 
(ieee->LinkDetectInfo.NumRecvBcnInPeriod==0||ieee->LinkDetectInfo.NumRecvDataInPeriod==0)
-   {
+   if 
(ieee->LinkDetectInfo.NumRecvBcnInPeriod==0||ieee->LinkDetectInfo.NumRecvDataInPeriod==0)
 {
ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1;
ieee->LinkDetectInfo.NumRecvDataInPeriod= 1;
}
@@ -468,8 +466,7 @@ int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee,
printk(KERN_INFO"raw TX is %s\n",
  ieee->raw_tx ? "enabled" : "disabled");
 
-   if (ieee->iw_mode == IW_MODE_MONITOR)
-   {
+   if (ieee->iw_mode == IW_MODE_MONITOR) {
if (prev == 0 && ieee->raw_tx) {
if (ieee->data_hard_resume)
ieee->data_hard_resume(ieee->dev);
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/6] Staging: rtl8192u: add spaces around == and || operators

2015-09-24 Thread mike dupuis
This is a patch to add missing spaces around == and || operators in one
instance in ieee80211_softmac_wx.c.

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index a1548d0..a5ca2e3 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -344,7 +344,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
ieee->state = IEEE80211_LINKED;
ieee->link_change(ieee->dev);
/* To prevent the immediately calling watch_dog after scan. */
-   if 
(ieee->LinkDetectInfo.NumRecvBcnInPeriod==0||ieee->LinkDetectInfo.NumRecvDataInPeriod==0)
 {
+   if (ieee->LinkDetectInfo.NumRecvBcnInPeriod == 0 || 
ieee->LinkDetectInfo.NumRecvDataInPeriod == 0) {
ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1;
ieee->LinkDetectInfo.NumRecvDataInPeriod= 1;
}
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 6/6] Staging: rtl819u: Fix brace styling issues

2015-09-24 Thread mike dupuis
This is a patch to correct two flavors of brace styling issues in
ieee80211_softmac_wx.c.

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 94beffe..aad288a 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -279,12 +279,10 @@ int ieee80211_wx_set_mode(struct ieee80211_device *ieee, 
struct iw_request_info
if (wrqu->mode == ieee->iw_mode)
goto out;
 
-   if (wrqu->mode == IW_MODE_MONITOR) {
-
+   if (wrqu->mode == IW_MODE_MONITOR)
ieee->dev->type = ARPHRD_IEEE80211;
-   } else {
+   else
ieee->dev->type = ARPHRD_ETHER;
-   }
 
if (!ieee->proto_started) {
ieee->iw_mode = wrqu->mode;
@@ -422,8 +420,7 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
strncpy(ieee->current_network.ssid, extra, len+1);
ieee->current_network.ssid_len = len+1;
ieee->ssid_set = 1;
-   }
-   else {
+   } else {
ieee->ssid_set = 0;
ieee->current_network.ssid[0] = '\0';
ieee->current_network.ssid_len = 0;
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/6] Staging: rtl8192u: add missing blank lines after declarations

2015-09-24 Thread mike dupuis
This is a patch to add blank lines after declaration ins several
instances in iee80211_softmac_wx.c.

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 5964863..c0f6d7c 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -232,6 +232,7 @@ int ieee80211_wx_get_rate(struct ieee80211_device *ieee,
 union iwreq_data *wrqu, char *extra)
 {
u32 tmp_rate;
+
tmp_rate = TxCountToDataRate(ieee, 
ieee->softmac_stats.CurrentShowTxate);
 
wrqu->bitrate.value = tmp_rate * 50;
@@ -307,6 +308,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
HT_EXTCHNL_OFFSET chan_offset=0;
HT_CHANNEL_WIDTH bandwidth=0;
int b40M = 0;
+
chan = ieee->current_network.channel;
netif_carrier_off(ieee->dev);
 
@@ -517,6 +519,7 @@ int ieee80211_wx_set_power(struct ieee80211_device *ieee,
 union iwreq_data *wrqu, char *extra)
 {
int ret = 0;
+
down(>wx_sem);
 
if (wrqu->power.disabled) {
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/6] Staging: rtl8192u: space required after ','

2015-09-24 Thread mike dupuis
This is a fix to add spaces after commas in ieee80211_softmac_wx.c.

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 702671a..5964863 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -178,7 +178,7 @@ out:
 }
 EXPORT_SYMBOL(ieee80211_wx_set_wap);
 
-int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct 
iw_request_info *a,union iwreq_data *wrqu,char *b)
+int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct 
iw_request_info *a, union iwreq_data *wrqu, char *b)
 {
int len, ret = 0;
unsigned long flags;
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/6] Staging: rtl8192u: checkpatch.pl fixes

2015-09-24 Thread mike dupuis
This series of patches addresses several checkpatch.pl issues in
ieee80211_softmac_wx.c.
Before: total: 14 errors, 24 warnings, 59 checks, 602 lines checked
After:  total:  0 errors, 20 warnings, 59 checks, 599 lines checked

Mike Dupuis (6):
  Staging: rtl8192u: space required after ','
  Staging: rtl8192u: add missing blank lines after declarations
  Staging: rtl8192u: move open braces to previous lines
  Staging: rtl8192u: add spaces around == and || operators
  Staging: rtl8192u: spaces required around = operator
  Staging: rtl819u: Fix brace styling issues

 .../rtl8192u/ieee80211/ieee80211_softmac_wx.c  | 33 ++
 1 file changed, 15 insertions(+), 18 deletions(-)

-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 5/6] Staging: rtl8192u: spaces required around = operator

2015-09-24 Thread mike dupuis
This is a patch to add spaces around = operators in several instances
in ieee80211_softmac_wx.c

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index a5ca2e3..94beffe 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -304,8 +304,8 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
 {
struct ieee80211_device *ieee = container_of(work, struct 
ieee80211_device, wx_sync_scan_wq);
short chan;
-   HT_EXTCHNL_OFFSET chan_offset=0;
-   HT_CHANNEL_WIDTH bandwidth=0;
+   HT_EXTCHNL_OFFSET chan_offset = 0;
+   HT_CHANNEL_WIDTH bandwidth = 0;
int b40M = 0;
 
chan = ieee->current_network.channel;
@@ -346,7 +346,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
/* To prevent the immediately calling watch_dog after scan. */
if (ieee->LinkDetectInfo.NumRecvBcnInPeriod == 0 || 
ieee->LinkDetectInfo.NumRecvDataInPeriod == 0) {
ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1;
-   ieee->LinkDetectInfo.NumRecvDataInPeriod= 1;
+   ieee->LinkDetectInfo.NumRecvDataInPeriod = 1;
}
if (ieee->data_hard_resume)
ieee->data_hard_resume(ieee->dev);
@@ -398,12 +398,12 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
proto_started = ieee->proto_started;
 
if (wrqu->essid.length > IW_ESSID_MAX_SIZE) {
-   ret= -E2BIG;
+   ret = -E2BIG;
goto out;
}
 
if (ieee->iw_mode == IW_MODE_MONITOR) {
-   ret= -1;
+   ret = -1;
goto out;
}
 
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/4] Staging: rtl8192u: suspect code indent for conditional statment

2015-09-14 Thread mike dupuis
From: Mike Dupuis <mike.dupui...@gmail.com>

This is a patch to correct an improperly indented block of code in
ieee80211_softmac_wx.c

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index be3f61a..aa1209f 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -72,9 +72,8 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
 
if (ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == 
IW_MODE_MASTER)
if (ieee->state == IEEE80211_LINKED) {
-
-   ieee80211_stop_send_beacons(ieee);
-   ieee80211_start_send_beacons(ieee);
+   ieee80211_stop_send_beacons(ieee);
+   ieee80211_start_send_beacons(ieee);
}
}
 
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/4] Staging: rtl8192u: do not use C99 // comments

2015-09-14 Thread mike dupuis
From: Mike Dupuis <mike.dupui...@gmail.com>

This is a patch to convert C99-style comments to C89-style comments in
ieee80211_softmac_wx.c.

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 .../rtl8192u/ieee80211/ieee80211_softmac_wx.c  | 28 +++---
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index aa1209f..5f384b4 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -92,11 +92,11 @@ int ieee80211_wx_get_freq(struct ieee80211_device *ieee,
 
if (ieee->current_network.channel == 0)
return -1;
-   //NM 0.7.0 will not accept channel any more.
+   /* NM 0.7.0 will not accept channel any more. */
fwrq->m = ieee80211_wlan_frequencies[ieee->current_network.channel-1] * 
10;
fwrq->e = 1;
-// fwrq->m = ieee->current_network.channel;
-// fwrq->e = 0;
+   /* fwrq->m = ieee->current_network.channel; */
+   /* fwrq->e = 0; */
 
return 0;
 }
@@ -140,7 +140,7 @@ int ieee80211_wx_set_wap(struct ieee80211_device *ieee,
int ret = 0;
unsigned long flags;
 
-   short ifup = ieee->proto_started;//dev->flags & IFF_UP;
+   short ifup = ieee->proto_started; /* dev->flags & IFF_UP; */
struct sockaddr *temp = (struct sockaddr *)awrq;
 
ieee->sync_scan_hurryup = 1;
@@ -222,7 +222,7 @@ int ieee80211_wx_set_rate(struct ieee80211_device *ieee,
u32 target_rate = wrqu->bitrate.value;
 
ieee->rate = target_rate/10;
-   //FIXME: we might want to limit rate also in management protocols.
+   /* FIXME: we might want to limit rate also in management protocols. */
return 0;
 }
 EXPORT_SYMBOL(ieee80211_wx_set_rate);
@@ -343,7 +343,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
ieee->InitialGainHandler(ieee->dev, IG_Restore);
ieee->state = IEEE80211_LINKED;
ieee->link_change(ieee->dev);
-   // To prevent the immediately calling watch_dog after scan.
+   /* To prevent the immediately calling watch_dog after scan. */
if 
(ieee->LinkDetectInfo.NumRecvBcnInPeriod==0||ieee->LinkDetectInfo.NumRecvDataInPeriod==0)
{
ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1;
@@ -419,7 +419,7 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
spin_lock_irqsave(>lock, flags);
 
if (wrqu->essid.flags && wrqu->essid.length) {
-   //first flush current network.ssid
+   /* first flush current network.ssid */
len = ((wrqu->essid.length-1) < IW_ESSID_MAX_SIZE) ? 
(wrqu->essid.length-1) : IW_ESSID_MAX_SIZE;
strncpy(ieee->current_network.ssid, extra, len+1);
ieee->current_network.ssid_len = len+1;
@@ -526,15 +526,15 @@ int ieee80211_wx_set_power(struct ieee80211_device *ieee,
goto exit;
}
if (wrqu->power.flags & IW_POWER_TIMEOUT) {
-   //ieee->ps_period = wrqu->power.value / 1000;
+   /* ieee->ps_period = wrqu->power.value / 1000; */
ieee->ps_timeout = wrqu->power.value / 1000;
}
 
if (wrqu->power.flags & IW_POWER_PERIOD) {
 
-   //ieee->ps_timeout = wrqu->power.value / 1000;
+   /* ieee->ps_timeout = wrqu->power.value / 1000; */
ieee->ps_period = wrqu->power.value / 1000;
-   //wrq->value / 1024;
+   /* wrq->value / 1024; */
 
}
switch (wrqu->power.flags & IW_POWER_MODE) {
@@ -549,7 +549,7 @@ int ieee80211_wx_set_power(struct ieee80211_device *ieee,
break;
 
case IW_POWER_ON:
-   //  ieee->ps = IEEE80211_PS_DISABLED;
+   /* ieee->ps = IEEE80211_PS_DISABLED; */
break;
 
default:
@@ -582,11 +582,11 @@ int ieee80211_wx_get_power(struct ieee80211_device *ieee,
wrqu->power.flags = IW_POWER_TIMEOUT;
wrqu->power.value = ieee->ps_timeout * 1000;
} else {
-// ret = -EOPNOTSUPP;
-// goto exit;
+   /* ret = -EOPNOTSUPP; */
+   /* goto exit; */
wrqu->power.flags = IW_POWER_PERIOD;
wrqu->power.value = ieee->ps_period * 1000;
-//ieee->current_network.dtim_period * ieee->current_network.beacon_interval * 
1024;
+   /* ieee->current_network.dtim_period * 
ieee->current_network.beacon_interval * 1024; */
}
 
if ((ieee->ps & (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST)) == 
(IEEE80211_PS_MBCAST | IEEE8021

[PATCH 1/4] Staging: rtl8192u: space required before open parentheses

2015-09-14 Thread mike dupuis
From: Mike Dupuis <mike.dupui...@gmail.com>

This is a patch to add spaces where required before open parentheses in
ieee80211_softmac_wx.c

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 3662925..be3f61a 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -70,8 +70,8 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
ieee->current_network.channel = fwrq->m;
ieee->set_chan(ieee->dev, ieee->current_network.channel);
 
-   if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == 
IW_MODE_MASTER)
-   if(ieee->state == IEEE80211_LINKED) {
+   if (ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == 
IW_MODE_MASTER)
+   if (ieee->state == IEEE80211_LINKED) {
 
ieee80211_stop_send_beacons(ieee);
ieee80211_start_send_beacons(ieee);
@@ -353,7 +353,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
if (ieee->data_hard_resume)
ieee->data_hard_resume(ieee->dev);
 
-   if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER)
+   if (ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER)
ieee80211_start_send_beacons(ieee);
 
netif_carrier_on(ieee->dev);
@@ -410,7 +410,7 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
goto out;
}
 
-   if(proto_started)
+   if (proto_started)
ieee80211_stop_protocol(ieee);
 
 
@@ -461,7 +461,7 @@ EXPORT_SYMBOL(ieee80211_wx_get_mode);
 
down(>wx_sem);
 
-   if(enable)
+   if (enable)
ieee->raw_tx = 1;
else
ieee->raw_tx = 0;
@@ -478,7 +478,7 @@ EXPORT_SYMBOL(ieee80211_wx_get_mode);
netif_carrier_on(ieee->dev);
}
 
-   if(prev && ieee->raw_tx == 1)
+   if (prev && ieee->raw_tx == 1)
netif_carrier_off(ieee->dev);
}
 
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/4] Staging: rtl8192u: fix checkpatch.pl issues

2015-09-14 Thread mike dupuis
From: Mike Dupuis <mike.dupui...@gmail.com>

This is a series of patches to fix several checkpatch.pl issues in
ieee80211_softmac_wx.c.

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>

Checkpatch.pl output before:
total: 34 errors, 29 warnings, 605 lines checked

Checkpatch.pl output after:
total: 14 errors, 24 warnings, 604 lines checked

mike dupuis (4):
  Staging: rtl8192u: space required before open parentheses
  Staging: rtl8192u: suspect code indent for conditional statment
  Staging: rtl8192u: do not use C99 // comments
  Staging: rlt8192u: Remove spaces at the start of lines

 .../rtl8192u/ieee80211/ieee80211_softmac_wx.c  | 53 +++---
 1 file changed, 26 insertions(+), 27 deletions(-)

-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/4] Staging: rlt8192u: Remove spaces at the start of lines

2015-09-14 Thread mike dupuis
From: Mike Dupuis <mike.dupui...@gmail.com>

This is a patch to remove spaces at the start of lines in
ieee80211_softmac_wx.c.

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 5f384b4..3e72d33 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -178,7 +178,7 @@ out:
 }
 EXPORT_SYMBOL(ieee80211_wx_set_wap);
 
- int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct 
iw_request_info *a,union iwreq_data *wrqu,char *b)
+int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct 
iw_request_info *a,union iwreq_data *wrqu,char *b)
 {
int len, ret = 0;
unsigned long flags;
@@ -440,7 +440,7 @@ out:
 }
 EXPORT_SYMBOL(ieee80211_wx_set_essid);
 
- int ieee80211_wx_get_mode(struct ieee80211_device *ieee, struct 
iw_request_info *a,
+int ieee80211_wx_get_mode(struct ieee80211_device *ieee, struct 
iw_request_info *a,
 union iwreq_data *wrqu, char *b)
 {
 
@@ -449,7 +449,7 @@ EXPORT_SYMBOL(ieee80211_wx_set_essid);
 }
 EXPORT_SYMBOL(ieee80211_wx_get_mode);
 
- int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee,
+int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee,
   struct iw_request_info *info,
   union iwreq_data *wrqu, char *extra)
 {
@@ -589,7 +589,7 @@ int ieee80211_wx_get_power(struct ieee80211_device *ieee,
/* ieee->current_network.dtim_period * 
ieee->current_network.beacon_interval * 1024; */
}
 
-   if ((ieee->ps & (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST)) == 
(IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST))
+   if ((ieee->ps & (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST)) == 
(IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST))
wrqu->power.flags |= IW_POWER_ALL_R;
else if (ieee->ps & IEEE80211_PS_MBCAST)
wrqu->power.flags |= IW_POWER_MULTICAST_R;
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/4] Staging: rtl8192u: Space not allowed after

2015-09-10 Thread mike dupuis
This is a change to ieee80211_softmac_wx.c to remove spaces after unary
& operators.

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 3e502520..80130a5d 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -32,7 +32,7 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
 union iwreq_data *wrqu, char *b)
 {
int ret;
-   struct iw_freq *fwrq = & wrqu->freq;
+   struct iw_freq *fwrq = >freq;
 
down(>wx_sem);
 
@@ -89,7 +89,7 @@ int ieee80211_wx_get_freq(struct ieee80211_device *ieee,
 struct iw_request_info *a,
 union iwreq_data *wrqu, char *b)
 {
-   struct iw_freq *fwrq = & wrqu->freq;
+   struct iw_freq *fwrq = >freq;
 
if (ieee->current_network.channel == 0)
return -1;
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/4] Staging: rtl8192u: space required before open braces

2015-09-10 Thread mike dupuis
This is a change to add spaces before open braces to
ieee80211_softmac_wx.c.

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 .../staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c  | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 80130a5d..57acab2 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -57,7 +57,7 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
}
}
 
-   if (fwrq->e > 0 || fwrq->m > 14 || fwrq->m < 1 ){
+   if (fwrq->e > 0 || fwrq->m > 14 || fwrq->m < 1 ) {
ret = -EOPNOTSUPP;
goto out;
 
@@ -71,7 +71,7 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
ieee->set_chan(ieee->dev, ieee->current_network.channel);
 
if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == 
IW_MODE_MASTER)
-   if(ieee->state == IEEE80211_LINKED){
+   if(ieee->state == IEEE80211_LINKED) {
 
ieee80211_stop_send_beacons(ieee);
ieee80211_start_send_beacons(ieee);
@@ -191,14 +191,14 @@ EXPORT_SYMBOL(ieee80211_wx_set_wap);
spin_lock_irqsave(>lock, flags);
 
if (ieee->current_network.ssid[0] == '\0' ||
-   ieee->current_network.ssid_len == 0){
+   ieee->current_network.ssid_len == 0) {
ret = -1;
goto out;
}
 
if (ieee->state != IEEE80211_LINKED &&
ieee->state != IEEE80211_LINKED_SCANNING &&
-   ieee->ssid_set == 0){
+   ieee->ssid_set == 0) {
ret = -1;
goto out;
}
@@ -280,16 +280,16 @@ int ieee80211_wx_set_mode(struct ieee80211_device *ieee, 
struct iw_request_info
if (wrqu->mode == ieee->iw_mode)
goto out;
 
-   if (wrqu->mode == IW_MODE_MONITOR){
+   if (wrqu->mode == IW_MODE_MONITOR) {
 
ieee->dev->type = ARPHRD_IEEE80211;
-   }else{
+   }else {
ieee->dev->type = ARPHRD_ETHER;
}
 
-   if (!ieee->proto_started){
+   if (!ieee->proto_started) {
ieee->iw_mode = wrqu->mode;
-   }else{
+   }else {
ieee80211_stop_protocol(ieee);
ieee->iw_mode = wrqu->mode;
ieee80211_start_protocol(ieee);
@@ -426,7 +426,7 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
ieee->current_network.ssid_len = len+1;
ieee->ssid_set = 1;
}
-   else{
+   else {
ieee->ssid_set = 0;
ieee->current_network.ssid[0] = '\0';
ieee->current_network.ssid_len = 0;
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/4] Staging: rtl8192u: space prohibited before close parenthesis

2015-09-10 Thread mike dupuis
This is a style change to remove whitespace before close parentheses in
ieee80211_softmac_wx.c

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 45d710e..3662925 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -57,7 +57,7 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
}
}
 
-   if (fwrq->e > 0 || fwrq->m > 14 || fwrq->m < 1 ) {
+   if (fwrq->e > 0 || fwrq->m > 14 || fwrq->m < 1) {
ret = -EOPNOTSUPP;
goto out;
 
@@ -345,7 +345,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
ieee->state = IEEE80211_LINKED;
ieee->link_change(ieee->dev);
// To prevent the immediately calling watch_dog after scan.
-   if 
(ieee->LinkDetectInfo.NumRecvBcnInPeriod==0||ieee->LinkDetectInfo.NumRecvDataInPeriod==0
 )
+   if 
(ieee->LinkDetectInfo.NumRecvBcnInPeriod==0||ieee->LinkDetectInfo.NumRecvDataInPeriod==0)
{
ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1;
ieee->LinkDetectInfo.NumRecvDataInPeriod= 1;
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/4] Staging: rtl8192u: space required after close braces

2015-09-10 Thread mike dupuis
This is a style change to insert spaces before closed braces in
ieee80211_softmac_wx.c

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 57acab2..45d710e 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -61,7 +61,7 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
ret = -EOPNOTSUPP;
goto out;
 
-   }else { /* Set the channel */
+   } else { /* Set the channel */
 
if (!(GET_DOT11D_INFO(ieee)->channel_map)[fwrq->m]) {
ret = -EINVAL;
@@ -283,13 +283,13 @@ int ieee80211_wx_set_mode(struct ieee80211_device *ieee, 
struct iw_request_info
if (wrqu->mode == IW_MODE_MONITOR) {
 
ieee->dev->type = ARPHRD_IEEE80211;
-   }else {
+   } else {
ieee->dev->type = ARPHRD_ETHER;
}
 
if (!ieee->proto_started) {
ieee->iw_mode = wrqu->mode;
-   }else {
+   } else {
ieee80211_stop_protocol(ieee);
ieee->iw_mode = wrqu->mode;
ieee80211_start_protocol(ieee);
-- 
2.1.4


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/15] Staging: rtl8192u: do not use C99 comments in ieee80211_softmac_wx.c

2015-09-05 Thread Mike Dupuis
This is a patch to the ieee80211_softmac_wx.c file that replaces C99 comments 
with C89 comments as identified by checkpatch.pl

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 .../rtl8192u/ieee80211/ieee80211_softmac_wx.c  | 28 +++---
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index d029fc3..53e3213 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -92,11 +92,11 @@ int ieee80211_wx_get_freq(struct ieee80211_device *ieee,
 
if (ieee->current_network.channel == 0)
return -1;
-   //NM 0.7.0 will not accept channel any more.
+   /* NM 0.7.0 will not accept channel any more. */
fwrq->m = ieee80211_wlan_frequencies[ieee->current_network.channel-1] * 
10;
fwrq->e = 1;
-// fwrq->m = ieee->current_network.channel;
-// fwrq->e = 0;
+   /* fwrq->m = ieee->current_network.channel; */
+   /* fwrq->e = 0; */
 
return 0;
 }
@@ -140,7 +140,7 @@ int ieee80211_wx_set_wap(struct ieee80211_device *ieee,
int ret = 0;
unsigned long flags;
 
-   short ifup = ieee->proto_started;//dev->flags & IFF_UP;
+   short ifup = ieee->proto_started; /* dev->flags & IFF_UP; */
struct sockaddr *temp = (struct sockaddr *)awrq;
 
ieee->sync_scan_hurryup = 1;
@@ -222,7 +222,7 @@ int ieee80211_wx_set_rate(struct ieee80211_device *ieee,
u32 target_rate = wrqu->bitrate.value;
 
ieee->rate = target_rate/10;
-   //FIXME: we might want to limit rate also in management protocols.
+   /* FIXME: we might want to limit rate also in management protocols. */
return 0;
 }
 EXPORT_SYMBOL(ieee80211_wx_set_rate);
@@ -343,7 +343,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
ieee->InitialGainHandler(ieee->dev, IG_Restore);
ieee->state = IEEE80211_LINKED;
ieee->link_change(ieee->dev);
-   // To prevent the immediately calling watch_dog after scan.
+   /* To prevent the immediately calling watch_dog after scan. */
if 
(ieee->LinkDetectInfo.NumRecvBcnInPeriod==0||ieee->LinkDetectInfo.NumRecvDataInPeriod==0)
{
ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1;
@@ -419,7 +419,7 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
spin_lock_irqsave(>lock, flags);
 
if (wrqu->essid.flags && wrqu->essid.length) {
-   //first flush current network.ssid
+   /* first flush current network.ssid */
len = ((wrqu->essid.length-1) < IW_ESSID_MAX_SIZE) ? 
(wrqu->essid.length-1) : IW_ESSID_MAX_SIZE;
strncpy(ieee->current_network.ssid, extra, len+1);
ieee->current_network.ssid_len = len+1;
@@ -526,15 +526,15 @@ int ieee80211_wx_set_power(struct ieee80211_device *ieee,
goto exit;
}
if (wrqu->power.flags & IW_POWER_TIMEOUT) {
-   //ieee->ps_period = wrqu->power.value / 1000;
+   /* ieee->ps_period = wrqu->power.value / 1000; */
ieee->ps_timeout = wrqu->power.value / 1000;
}
 
if (wrqu->power.flags & IW_POWER_PERIOD) {
 
-   //ieee->ps_timeout = wrqu->power.value / 1000;
+   /* ieee->ps_timeout = wrqu->power.value / 1000; */
ieee->ps_period = wrqu->power.value / 1000;
-   //wrq->value / 1024;
+   /* wrq->value / 1024; */
 
}
switch (wrqu->power.flags & IW_POWER_MODE) {
@@ -549,7 +549,7 @@ int ieee80211_wx_set_power(struct ieee80211_device *ieee,
break;
 
case IW_POWER_ON:
-   //  ieee->ps = IEEE80211_PS_DISABLED;
+   /* ieee->ps = IEEE80211_PS_DISABLED; */
break;
 
default:
@@ -582,11 +582,11 @@ int ieee80211_wx_get_power(struct ieee80211_device *ieee,
wrqu->power.flags = IW_POWER_TIMEOUT;
wrqu->power.value = ieee->ps_timeout * 1000;
} else {
-// ret = -EOPNOTSUPP;
-// goto exit;
+   /* ret = -EOPNOTSUPP; */
+   /* goto exit; */
wrqu->power.flags = IW_POWER_PERIOD;
wrqu->power.value = ieee->ps_period * 1000;
-//ieee->current_network.dtim_period * ieee->current_network.beacon_interval * 
1024;
+   /* ieee->current_network.dtim_period * 
ieee->current_network.beacon_interval * 1024; */
}
 
if ((ieee->ps & (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST)) == 
(IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST))
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/15] Staging: rtl8192u: remove spaces at the start of lines in ieee80211_softmac_wx.c

2015-09-05 Thread Mike Dupuis
This is a patch to the ieee_softmac_wx.c file that removes unnecessary spaces 
at the start of lines as identified by checkpatch.pl

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 53e3213..167cca1 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -178,7 +178,7 @@ out:
 }
 EXPORT_SYMBOL(ieee80211_wx_set_wap);
 
- int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct 
iw_request_info *a,union iwreq_data *wrqu,char *b)
+int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct 
iw_request_info *a,union iwreq_data *wrqu,char *b)
 {
int len, ret = 0;
unsigned long flags;
@@ -440,7 +440,7 @@ out:
 }
 EXPORT_SYMBOL(ieee80211_wx_set_essid);
 
- int ieee80211_wx_get_mode(struct ieee80211_device *ieee, struct 
iw_request_info *a,
+int ieee80211_wx_get_mode(struct ieee80211_device *ieee, struct 
iw_request_info *a,
 union iwreq_data *wrqu, char *b)
 {
 
@@ -449,7 +449,7 @@ EXPORT_SYMBOL(ieee80211_wx_set_essid);
 }
 EXPORT_SYMBOL(ieee80211_wx_get_mode);
 
- int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee,
+int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee,
   struct iw_request_info *info,
   union iwreq_data *wrqu, char *extra)
 {
@@ -589,7 +589,7 @@ int ieee80211_wx_get_power(struct ieee80211_device *ieee,
/* ieee->current_network.dtim_period * 
ieee->current_network.beacon_interval * 1024; */
}
 
-   if ((ieee->ps & (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST)) == 
(IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST))
+   if ((ieee->ps & (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST)) == 
(IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST))
wrqu->power.flags |= IW_POWER_ALL_R;
else if (ieee->ps & IEEE80211_PS_MBCAST)
wrqu->power.flags |= IW_POWER_MULTICAST_R;
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/15] Staging: rtl8192u: remove unnecessary braces around conditionals in ieee80211_softmac_wx.c

2015-09-05 Thread Mike Dupuis
This is a patch to the ieee80211_softmac_wx.c file that removes unnecessary 
braces around conditional statements as identified by checkpatch.pl

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 6044870..d9a46b2 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -279,12 +279,10 @@ int ieee80211_wx_set_mode(struct ieee80211_device *ieee, 
struct iw_request_info
if (wrqu->mode == ieee->iw_mode)
goto out;
 
-   if (wrqu->mode == IW_MODE_MONITOR) {
-
+   if (wrqu->mode == IW_MODE_MONITOR)
ieee->dev->type = ARPHRD_IEEE80211;
-   } else{
+   else
ieee->dev->type = ARPHRD_ETHER;
-   }
 
if (!ieee->proto_started){
ieee->iw_mode = wrqu->mode;
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/15] Staging: rtl8192u: add spaces after commas in ieee80211_softmac_wx.c

2015-09-05 Thread Mike Dupuis
This is a patch to the ieee80211_softmac_wx.c file that adds spaces after 
commas as identified by checkpatch.pl

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 167cca1..a52bd9d 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -178,7 +178,7 @@ out:
 }
 EXPORT_SYMBOL(ieee80211_wx_set_wap);
 
-int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct 
iw_request_info *a,union iwreq_data *wrqu,char *b)
+int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct 
iw_request_info *a, union iwreq_data *wrqu, char *b)
 {
int len, ret = 0;
unsigned long flags;
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/15] Staging: rtl8192u: open braces should appear on the appropriate line in ieee80211_softmac_wx.c

2015-09-05 Thread Mike Dupuis
This is a patch to the ieee80211_softmac_wx.c file that corrects instances 
where open braces appear on the incorrect line as identified by checkpatch.pl

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index a52bd9d..6044870 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -232,6 +232,7 @@ int ieee80211_wx_get_rate(struct ieee80211_device *ieee,
 union iwreq_data *wrqu, char *extra)
 {
u32 tmp_rate;
+
tmp_rate = TxCountToDataRate(ieee, 
ieee->softmac_stats.CurrentShowTxate);
 
wrqu->bitrate.value = tmp_rate * 50;
@@ -246,8 +247,7 @@ int ieee80211_wx_set_rts(struct ieee80211_device *ieee,
 {
if (wrqu->rts.disabled || !wrqu->rts.fixed)
ieee->rts = DEFAULT_RTS_THRESHOLD;
-   else
-   {
+   else {
if (wrqu->rts.value < MIN_RTS_THRESHOLD ||
wrqu->rts.value > MAX_RTS_THRESHOLD)
return -EINVAL;
@@ -308,6 +308,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
HT_CHANNEL_WIDTH bandwidth=0;
int b40M = 0;
static int count;
+
chan = ieee->current_network.channel;
netif_carrier_off(ieee->dev);
 
@@ -344,8 +345,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
ieee->state = IEEE80211_LINKED;
ieee->link_change(ieee->dev);
/* To prevent the immediately calling watch_dog after scan. */
-   if 
(ieee->LinkDetectInfo.NumRecvBcnInPeriod==0||ieee->LinkDetectInfo.NumRecvDataInPeriod==0)
-   {
+   if 
(ieee->LinkDetectInfo.NumRecvBcnInPeriod==0||ieee->LinkDetectInfo.NumRecvDataInPeriod==0)
 {
ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1;
ieee->LinkDetectInfo.NumRecvDataInPeriod= 1;
}
@@ -468,8 +468,7 @@ int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee,
printk(KERN_INFO"raw TX is %s\n",
  ieee->raw_tx ? "enabled" : "disabled");
 
-   if (ieee->iw_mode == IW_MODE_MONITOR)
-   {
+   if (ieee->iw_mode == IW_MODE_MONITOR) {
if (prev == 0 && ieee->raw_tx) {
if (ieee->data_hard_resume)
ieee->data_hard_resume(ieee->dev);
@@ -519,6 +518,7 @@ int ieee80211_wx_set_power(struct ieee80211_device *ieee,
 union iwreq_data *wrqu, char *extra)
 {
int ret = 0;
+
down(>wx_sem);
 
if (wrqu->power.disabled) {
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/15] Staging: rtl8192u: fix space before close parenthesis style issues in ieee80211_softmac_wx.c

2015-09-05 Thread Mike Dupuis
This is a patch to the ieee80211_softmac_wx.c file that removes superfluous 
spaces before closed parentheses as identified by checkpatch.pl

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index cca2277..82efe7e 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -57,7 +57,7 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
}
}
 
-   if (fwrq->e > 0 || fwrq->m > 14 || fwrq->m < 1 ) {
+   if (fwrq->e > 0 || fwrq->m > 14 || fwrq->m < 1) {
ret = -EOPNOTSUPP;
goto out;
 
@@ -345,7 +345,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
ieee->state = IEEE80211_LINKED;
ieee->link_change(ieee->dev);
// To prevent the immediately calling watch_dog after scan.
-   if 
(ieee->LinkDetectInfo.NumRecvBcnInPeriod==0||ieee->LinkDetectInfo.NumRecvDataInPeriod==0
 )
+   if 
(ieee->LinkDetectInfo.NumRecvBcnInPeriod==0||ieee->LinkDetectInfo.NumRecvDataInPeriod==0)
{
ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1;
ieee->LinkDetectInfo.NumRecvDataInPeriod= 1;
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 02/15] Staging: rtl8291u: fix space-before-brace coding style issues in ieee80211_softmac_wx.c

2015-09-05 Thread Mike Dupuis
This is a patch to the ieee80211_softmac_wx.c file that fixes up issues where 
absent spaces beofre braces were found by checkpatch.pl

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 80130a5d..cca2277 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -57,7 +57,7 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
}
}
 
-   if (fwrq->e > 0 || fwrq->m > 14 || fwrq->m < 1 ){
+   if (fwrq->e > 0 || fwrq->m > 14 || fwrq->m < 1 ) {
ret = -EOPNOTSUPP;
goto out;
 
@@ -71,7 +71,7 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
ieee->set_chan(ieee->dev, ieee->current_network.channel);
 
if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == 
IW_MODE_MASTER)
-   if(ieee->state == IEEE80211_LINKED){
+   if(ieee->state == IEEE80211_LINKED) {
 
ieee80211_stop_send_beacons(ieee);
ieee80211_start_send_beacons(ieee);
@@ -280,7 +280,7 @@ int ieee80211_wx_set_mode(struct ieee80211_device *ieee, 
struct iw_request_info
if (wrqu->mode == ieee->iw_mode)
goto out;
 
-   if (wrqu->mode == IW_MODE_MONITOR){
+   if (wrqu->mode == IW_MODE_MONITOR) {
 
ieee->dev->type = ARPHRD_IEEE80211;
}else{
@@ -289,7 +289,7 @@ int ieee80211_wx_set_mode(struct ieee80211_device *ieee, 
struct iw_request_info
 
if (!ieee->proto_started){
ieee->iw_mode = wrqu->mode;
-   }else{
+   }else {
ieee80211_stop_protocol(ieee);
ieee->iw_mode = wrqu->mode;
ieee80211_start_protocol(ieee);
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/15] Staging: rtl8192u: fix ampersand coding style issues in ieee80211_softmac_wx.c

2015-09-05 Thread Mike Dupuis
This is a patch to the ieee80211_softmac_wx.c file that fixes up unary & errors 
found by checkpatch.pl.

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 3e502520..80130a5d 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -32,7 +32,7 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
 union iwreq_data *wrqu, char *b)
 {
int ret;
-   struct iw_freq *fwrq = & wrqu->freq;
+   struct iw_freq *fwrq = >freq;
 
down(>wx_sem);
 
@@ -89,7 +89,7 @@ int ieee80211_wx_get_freq(struct ieee80211_device *ieee,
 struct iw_request_info *a,
 union iwreq_data *wrqu, char *b)
 {
-   struct iw_freq *fwrq = & wrqu->freq;
+   struct iw_freq *fwrq = >freq;
 
if (ieee->current_network.channel == 0)
return -1;
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/15] Staging: rtl8192u: fix close brace spacing issues in ieee80211_softmac_wx.c

2015-09-05 Thread Mike Dupuis
This is a patch to the ieee80211_softmac_wx.c file that adds spaces after 
closed braces as identified by checkpatch.pl

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 82efe7e..492681b 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -61,7 +61,7 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
ret = -EOPNOTSUPP;
goto out;
 
-   }else { /* Set the channel */
+   } else { /* Set the channel */
 
if (!(GET_DOT11D_INFO(ieee)->channel_map)[fwrq->m]) {
ret = -EINVAL;
@@ -283,13 +283,13 @@ int ieee80211_wx_set_mode(struct ieee80211_device *ieee, 
struct iw_request_info
if (wrqu->mode == IW_MODE_MONITOR) {
 
ieee->dev->type = ARPHRD_IEEE80211;
-   }else{
+   } else{
ieee->dev->type = ARPHRD_ETHER;
}
 
if (!ieee->proto_started){
ieee->iw_mode = wrqu->mode;
-   }else {
+   } else {
ieee80211_stop_protocol(ieee);
ieee->iw_mode = wrqu->mode;
ieee80211_start_protocol(ieee);
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/15] Staging: rtl8192u: fix missing spaces before open parentheses in ieee80211_softmac_wx.c

2015-09-05 Thread Mike Dupuis
This is a patch to the ieee80211_softmac_wx.c file that fixes up missing spaces 
before open parentheses as identified by checkpatch.pl.

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 492681b..22de045 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -70,8 +70,8 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
ieee->current_network.channel = fwrq->m;
ieee->set_chan(ieee->dev, ieee->current_network.channel);
 
-   if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == 
IW_MODE_MASTER)
-   if(ieee->state == IEEE80211_LINKED) {
+   if (ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == 
IW_MODE_MASTER)
+   if (ieee->state == IEEE80211_LINKED) {
 
ieee80211_stop_send_beacons(ieee);
ieee80211_start_send_beacons(ieee);
@@ -353,7 +353,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
if (ieee->data_hard_resume)
ieee->data_hard_resume(ieee->dev);
 
-   if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER)
+   if (ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER)
ieee80211_start_send_beacons(ieee);
 
netif_carrier_on(ieee->dev);
@@ -410,7 +410,7 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
goto out;
}
 
-   if(proto_started)
+   if (proto_started)
ieee80211_stop_protocol(ieee);
 
 
@@ -461,7 +461,7 @@ EXPORT_SYMBOL(ieee80211_wx_get_mode);
 
down(>wx_sem);
 
-   if(enable)
+   if (enable)
ieee->raw_tx = 1;
else
ieee->raw_tx = 0;
@@ -478,7 +478,7 @@ EXPORT_SYMBOL(ieee80211_wx_get_mode);
netif_carrier_on(ieee->dev);
}
 
-   if(prev && ieee->raw_tx == 1)
+   if (prev && ieee->raw_tx == 1)
netif_carrier_off(ieee->dev);
}
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/15] Staging: rtl8192u: fix indentation for conditional statements in ieee80211_softmac_wx.c

2015-09-05 Thread Mike Dupuis
This is a patch to the ieee80211_softmac_wx.c file that fixes up an indentation 
issue identified by checkpatch.pl

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 22de045..d029fc3 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -72,9 +72,8 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
 
if (ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == 
IW_MODE_MASTER)
if (ieee->state == IEEE80211_LINKED) {
-
-   ieee80211_stop_send_beacons(ieee);
-   ieee80211_start_send_beacons(ieee);
+   ieee80211_stop_send_beacons(ieee);
+   ieee80211_start_send_beacons(ieee);
}
}
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 13/15] Staging: rtl8192u: add spaces around == and || operators in ieee80211_softmac_wx.c

2015-09-05 Thread Mike Dupuis
This is a patch to ieee80211_softmac_wx.c to add missing spacing around == and 
|| operators as identified by checkpatch.pl

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 5f45963..0b38e34 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -343,7 +343,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
ieee->state = IEEE80211_LINKED;
ieee->link_change(ieee->dev);
/* To prevent the immediately calling watch_dog after scan. */
-   if 
(ieee->LinkDetectInfo.NumRecvBcnInPeriod==0||ieee->LinkDetectInfo.NumRecvDataInPeriod==0)
 {
+   if (ieee->LinkDetectInfo.NumRecvBcnInPeriod == 0 || 
ieee->LinkDetectInfo.NumRecvDataInPeriod == 0) {
ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1;
ieee->LinkDetectInfo.NumRecvDataInPeriod = 1;
}
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 14/15] Staging: rtl8192u: fix brace placement issues in ieee80211_softmac_wx.c

2015-09-05 Thread Mike Dupuis
This is a patch to fix up some brace placement issues in ieee80211_softmac_wx.c

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 0b38e34..cec5325 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -422,8 +422,7 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
strncpy(ieee->current_network.ssid, extra, len+1);
ieee->current_network.ssid_len = len+1;
ieee->ssid_set = 1;
-   }
-   else{
+   } else {
ieee->ssid_set = 0;
ieee->current_network.ssid[0] = '\0';
ieee->current_network.ssid_len = 0;
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 15/15] Staging: rtl8192u: add space before { in ieee80211_softmac_wx.c

2015-09-05 Thread Mike Dupuis
This is a patch to ieee80211_softmac_wx.c that adds space before an open
brace as identified by checkpatch.pl. This was overlooked in a previous
patch.

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index cec5325..9745a24 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -284,7 +284,7 @@ int ieee80211_wx_set_mode(struct ieee80211_device *ieee, 
struct iw_request_info
else
ieee->dev->type = ARPHRD_ETHER;
 
-   if (!ieee->proto_started){
+   if (!ieee->proto_started) {
ieee->iw_mode = wrqu->mode;
} else {
ieee80211_stop_protocol(ieee);
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 12/15] Staging: rt8192u: add spaces around assignment operators in ieee80211_softmac_wx.c

2015-09-05 Thread Mike Dupuis
This is a patch to add spaces around assignment operators as identifed by 
checkpatch.pl

Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index d9a46b2..5f45963 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -302,8 +302,8 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
 {
struct ieee80211_device *ieee = container_of(work, struct 
ieee80211_device, wx_sync_scan_wq);
short chan;
-   HT_EXTCHNL_OFFSET chan_offset=0;
-   HT_CHANNEL_WIDTH bandwidth=0;
+   HT_EXTCHNL_OFFSET chan_offset = 0;
+   HT_CHANNEL_WIDTH bandwidth = 0;
int b40M = 0;
static int count;
 
@@ -345,7 +345,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
/* To prevent the immediately calling watch_dog after scan. */
if 
(ieee->LinkDetectInfo.NumRecvBcnInPeriod==0||ieee->LinkDetectInfo.NumRecvDataInPeriod==0)
 {
ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1;
-   ieee->LinkDetectInfo.NumRecvDataInPeriod= 1;
+   ieee->LinkDetectInfo.NumRecvDataInPeriod = 1;
}
if (ieee->data_hard_resume)
ieee->data_hard_resume(ieee->dev);
@@ -398,12 +398,12 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
proto_started = ieee->proto_started;
 
if (wrqu->essid.length > IW_ESSID_MAX_SIZE) {
-   ret= -E2BIG;
+   ret = -E2BIG;
goto out;
}
 
if (ieee->iw_mode == IW_MODE_MONITOR) {
-   ret= -1;
+   ret = -1;
goto out;
}
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl18192u: fix style issues in ieee80211_softmac_wx.c

2015-09-04 Thread Mike Dupuis
This is a patch to the ieee80211_softmac_wx.c file that corrects several
 checkpatch.pl warnings and errors.
Signed-off-by: Mike Dupuis <mike.dupui...@gmail.com>

---
 .../rtl8192u/ieee80211/ieee80211_softmac_wx.c  |  114 ++--
 1 file changed, 54 insertions(+), 60 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 3e502520..a8acd17 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -28,11 +28,11 @@ const long ieee80211_wlan_frequencies[] = {
 };
 EXPORT_SYMBOL(ieee80211_wlan_frequencies);
 
-int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct 
iw_request_info *a,
-union iwreq_data *wrqu, char *b)
+int ieee80211_wx_set_freq(struct ieee80211_device *ieee,
+   struct iw_request_info *a, union iwreq_data *wrqu, char *b)
 {
int ret;
-   struct iw_freq *fwrq = & wrqu->freq;
+   struct iw_freq *fwrq = >freq;
 
down(>wx_sem);
 
@@ -57,11 +57,11 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
}
}
 
-   if (fwrq->e > 0 || fwrq->m > 14 || fwrq->m < 1 ){
+   if (fwrq->e > 0 || fwrq->m > 14 || fwrq->m < 1) {
ret = -EOPNOTSUPP;
goto out;
 
-   }else { /* Set the channel */
+   } else { /* Set the channel */
 
if (!(GET_DOT11D_INFO(ieee)->channel_map)[fwrq->m]) {
ret = -EINVAL;
@@ -70,11 +70,10 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
ieee->current_network.channel = fwrq->m;
ieee->set_chan(ieee->dev, ieee->current_network.channel);
 
-   if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == 
IW_MODE_MASTER)
-   if(ieee->state == IEEE80211_LINKED){
-
-   ieee80211_stop_send_beacons(ieee);
-   ieee80211_start_send_beacons(ieee);
+   if (ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == 
IW_MODE_MASTER)
+   if (ieee->state == IEEE80211_LINKED) {
+   ieee80211_stop_send_beacons(ieee);
+   ieee80211_start_send_beacons(ieee);
}
}
 
@@ -89,15 +88,15 @@ int ieee80211_wx_get_freq(struct ieee80211_device *ieee,
 struct iw_request_info *a,
 union iwreq_data *wrqu, char *b)
 {
-   struct iw_freq *fwrq = & wrqu->freq;
+   struct iw_freq *fwrq = >freq;
 
if (ieee->current_network.channel == 0)
return -1;
-   //NM 0.7.0 will not accept channel any more.
+   /* NM 0.7.0 will not accept channel any more. */
fwrq->m = ieee80211_wlan_frequencies[ieee->current_network.channel-1] * 
10;
fwrq->e = 1;
-// fwrq->m = ieee->current_network.channel;
-// fwrq->e = 0;
+/* fwrq->m = ieee->current_network.channel; */
+/* fwrq->e = 0; */
 
return 0;
 }
@@ -141,7 +140,7 @@ int ieee80211_wx_set_wap(struct ieee80211_device *ieee,
int ret = 0;
unsigned long flags;
 
-   short ifup = ieee->proto_started;//dev->flags & IFF_UP;
+   short ifup = ieee->proto_started; /* dev->flags & IFF_UP; */
struct sockaddr *temp = (struct sockaddr *)awrq;
 
ieee->sync_scan_hurryup = 1;
@@ -179,7 +178,8 @@ out:
 }
 EXPORT_SYMBOL(ieee80211_wx_set_wap);
 
- int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct 
iw_request_info *a,union iwreq_data *wrqu,char *b)
+int ieee80211_wx_get_essid(struct ieee80211_device *ieee,
+   struct iw_request_info *a, union iwreq_data *wrqu, char *b)
 {
int len, ret = 0;
unsigned long flags;
@@ -223,7 +223,7 @@ int ieee80211_wx_set_rate(struct ieee80211_device *ieee,
u32 target_rate = wrqu->bitrate.value;
 
ieee->rate = target_rate/10;
-   //FIXME: we might want to limit rate also in management protocols.
+   /* FIXME: we might want to limit rate also in management protocols. */
return 0;
 }
 EXPORT_SYMBOL(ieee80211_wx_set_rate);
@@ -233,6 +233,7 @@ int ieee80211_wx_get_rate(struct ieee80211_device *ieee,
 union iwreq_data *wrqu, char *extra)
 {
u32 tmp_rate;
+
tmp_rate = TxCountToDataRate(ieee, 
ieee->softmac_stats.CurrentShowTxate);
 
wrqu->bitrate.value = tmp_rate * 50;
@@ -247,8 +248,7 @@ int ieee80211_wx_set_rts(struct ieee80211_device *ieee,
 {
if (wrqu->rts.disabled || !wrqu->rts.fixed)
ieee->rts = DEFAULT_RTS_THRESHOLD;
-   else
-   {
+