2012-11-27 12:07:58

by YAMANE Toshiaki

[permalink] [raw]
Subject: [PATCH 1/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_softmac_wx.c

The following errors fixed.
- ERROR: space prohibited after that '&' (ctx:WxW)

Signed-off-by: YAMANE Toshiaki <[email protected]>
---
.../rtl8187se/ieee80211/ieee80211_softmac_wx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index 1ef8fd6..f38519e 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/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 = &wrqu->freq;
// printk("in %s\n",__func__);
down(&ieee->wx_sem);

@@ -86,7 +86,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 = &wrqu->freq;

if (ieee->current_network.channel == 0)
return -1;
--
1.7.9.5


2012-11-27 12:08:55

by YAMANE Toshiaki

[permalink] [raw]
Subject: [PATCH 2/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_softmac_wx.c

The following errors fixed.
- ERROR: space required before the open brace '{'
- ERROR: space required before the open parenthesis '('
- ERROR: space prohibited before that close parenthesis ')'
- ERROR: space required after that close brace '}'

Signed-off-by: YAMANE Toshiaki <[email protected]>
---
.../rtl8187se/ieee80211/ieee80211_softmac_wx.c | 73 ++++++++++----------
1 file changed, 35 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index f38519e..0b82c600 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
@@ -36,7 +36,7 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_request_info
// printk("in %s\n",__func__);
down(&ieee->wx_sem);

- if(ieee->iw_mode == IW_MODE_INFRA){
+ if (ieee->iw_mode == IW_MODE_INFRA) {
ret = -EOPNOTSUPP;
goto out;
}
@@ -57,18 +57,18 @@ 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 */


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);
@@ -143,12 +143,12 @@ int ieee80211_wx_set_wap(struct ieee80211_device *ieee,

down(&ieee->wx_sem);
/* use ifconfig hw ether */
- if (ieee->iw_mode == IW_MODE_MASTER){
+ if (ieee->iw_mode == IW_MODE_MASTER) {
ret = -1;
goto out;
}

- if (temp->sa_family != ARPHRD_ETHER){
+ if (temp->sa_family != ARPHRD_ETHER) {
ret = -EINVAL;
goto out;
}
@@ -218,7 +218,7 @@ int ieee80211_wx_set_rate(struct ieee80211_device *ieee,
u32 target_rate = wrqu->bitrate.value;

//added by lizhaoming for auto mode
- if(target_rate == -1){
+ if (target_rate == -1) {
ieee->rate = 110;
} else {
ieee->rate = target_rate/100000;
@@ -250,16 +250,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);
@@ -296,7 +296,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);

//YJ,add,080828, In prevent of lossing ping packet during scanning
@@ -314,7 +314,7 @@ int ieee80211_wx_set_scan(struct ieee80211_device *ieee, struct iw_request_info

down(&ieee->wx_sem);

- if (ieee->iw_mode == IW_MODE_MONITOR || !(ieee->proto_started)){
+ if (ieee->iw_mode == IW_MODE_MONITOR || !(ieee->proto_started)) {
ret = -1;
goto out;
}
@@ -323,7 +323,7 @@ int ieee80211_wx_set_scan(struct ieee80211_device *ieee, struct iw_request_info
//ieee80211_sta_ps_send_null_frame(ieee, true);
//YJ,add,080828,end

- if ( ieee->state == IEEE80211_LINKED){
+ if (ieee->state == IEEE80211_LINKED) {
queue_work(ieee->wq, &ieee->wx_sync_scan_wq);
/* intentionally forget to up sem */
return 0;
@@ -349,17 +349,17 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,

proto_started = ieee->proto_started;

- if (wrqu->essid.length > IW_ESSID_MAX_SIZE){
+ if (wrqu->essid.length > IW_ESSID_MAX_SIZE) {
ret= -E2BIG;
goto out;
}

- if (ieee->iw_mode == IW_MODE_MONITOR){
+ if (ieee->iw_mode == IW_MODE_MONITOR) {
ret= -1;
goto out;
}

- if(proto_started)
+ if (proto_started)
ieee80211_stop_protocol(ieee);

/* this is just to be sure that the GET wx callback
@@ -377,13 +377,12 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
//YJ,modified,080819,end

//YJ,add,080819,for hidden ap
- if(len == 0){
+ if (len == 0) {
memset(ieee->current_network.bssid, 0, ETH_ALEN);
ieee->current_network.capability = 0;
}
//YJ,add,080819,for hidden ap,end
- }
- else{
+ } else {
ieee->ssid_set = 0;
ieee->current_network.ssid[0] = '\0';
ieee->current_network.ssid_len = 0;
@@ -417,7 +416,7 @@ out:

down(&ieee->wx_sem);

- if(enable)
+ if (enable)
ieee->raw_tx = 1;
else
ieee->raw_tx = 0;
@@ -425,16 +424,15 @@ out:
printk(KERN_INFO"raw TX is %s\n",
ieee->raw_tx ? "enabled" : "disabled");

- if(ieee->iw_mode == IW_MODE_MONITOR)
- {
- if(prev == 0 && ieee->raw_tx){
+ if (ieee->iw_mode == IW_MODE_MONITOR) {
+ if (prev == 0 && ieee->raw_tx) {
if (ieee->data_hard_resume)
ieee->data_hard_resume(ieee->dev);

netif_carrier_on(ieee->dev);
}

- if(prev && ieee->raw_tx == 1)
+ if (prev && ieee->raw_tx == 1)
netif_carrier_off(ieee->dev);
}

@@ -448,17 +446,17 @@ int ieee80211_wx_get_name(struct ieee80211_device *ieee,
union iwreq_data *wrqu, char *extra)
{
strlcpy(wrqu->name, "802.11", IFNAMSIZ);
- if(ieee->modulation & IEEE80211_CCK_MODULATION){
+ if (ieee->modulation & IEEE80211_CCK_MODULATION) {
strlcat(wrqu->name, "b", IFNAMSIZ);
- if(ieee->modulation & IEEE80211_OFDM_MODULATION)
+ if (ieee->modulation & IEEE80211_OFDM_MODULATION)
strlcat(wrqu->name, "/g", IFNAMSIZ);
- }else if(ieee->modulation & IEEE80211_OFDM_MODULATION)
+ } else if (ieee->modulation & IEEE80211_OFDM_MODULATION)
strlcat(wrqu->name, "g", IFNAMSIZ);

- if((ieee->state == IEEE80211_LINKED) ||
+ if ((ieee->state == IEEE80211_LINKED) ||
(ieee->state == IEEE80211_LINKED_SCANNING))
strlcat(wrqu->name," link", IFNAMSIZ);
- else if(ieee->state != IEEE80211_NOLINK)
+ else if (ieee->state != IEEE80211_NOLINK)
strlcat(wrqu->name," .....", IFNAMSIZ);


@@ -473,11 +471,10 @@ int ieee80211_wx_set_power(struct ieee80211_device *ieee,
{
int ret = 0;

- if(
- (!ieee->sta_wake_up) ||
- (!ieee->ps_request_tx_ack) ||
- (!ieee->enter_sleep_state) ||
- (!ieee->ps_is_queue_empty)){
+ if ((!ieee->sta_wake_up) ||
+ (!ieee->ps_request_tx_ack) ||
+ (!ieee->enter_sleep_state) ||
+ (!ieee->ps_is_queue_empty)) {

printk("ERROR. PS mode tried to be use but driver missed a callback\n\n");

@@ -486,7 +483,7 @@ int ieee80211_wx_set_power(struct ieee80211_device *ieee,

down(&ieee->wx_sem);

- if (wrqu->power.disabled){
+ if (wrqu->power.disabled) {
ieee->ps = IEEE80211_PS_DISABLED;

goto exit;
@@ -537,7 +534,7 @@ int ieee80211_wx_get_power(struct ieee80211_device *ieee,

down(&ieee->wx_sem);

- if(ieee->ps == IEEE80211_PS_DISABLED){
+ if (ieee->ps == IEEE80211_PS_DISABLED) {
wrqu->power.disabled = 1;
goto exit;
}
--
1.7.9.5

2012-11-27 12:09:09

by YAMANE Toshiaki

[permalink] [raw]
Subject: [PATCH 3/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_softmac_wx.c

The following warnings fixed.
- WARNING: suspect code indent for conditional statements

Signed-off-by: YAMANE Toshiaki <[email protected]>
---
.../rtl8187se/ieee80211/ieee80211_softmac_wx.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index 0b82c600..63524ca 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
@@ -69,9 +69,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);
}
}

@@ -219,9 +218,9 @@ int ieee80211_wx_set_rate(struct ieee80211_device *ieee,

//added by lizhaoming for auto mode
if (target_rate == -1) {
- ieee->rate = 110;
+ ieee->rate = 110;
} else {
- ieee->rate = target_rate/100000;
+ ieee->rate = target_rate/100000;
}
//FIXME: we might want to limit rate also in management protocols.
return 0;
--
1.7.9.5

2012-11-27 12:09:25

by YAMANE Toshiaki

[permalink] [raw]
Subject: [PATCH 4/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_softmac_wx.c

The following errors fixed.
- ERROR: space prohibited after that ',' (ctx:WxW)

Signed-off-by: YAMANE Toshiaki <[email protected]>
---
.../rtl8187se/ieee80211/ieee80211_softmac_wx.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index 63524ca..f06ed35 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
@@ -174,9 +174,10 @@ out:
return ret;
}

- 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;
+ int len, ret = 0;
unsigned long flags;

if (ieee->iw_mode == IW_MODE_MONITOR)
@@ -199,7 +200,7 @@ out:
}
len = ieee->current_network.ssid_len;
wrqu->essid.length = len;
- strncpy(b,ieee->current_network.ssid,len);
+ strncpy(b, ieee->current_network.ssid, len);
wrqu->essid.flags = 1;

out:
@@ -338,7 +339,7 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
union iwreq_data *wrqu, char *extra)
{

- int ret=0,len;
+ int ret=0, len;
short proto_started;
unsigned long flags;

@@ -454,9 +455,9 @@ int ieee80211_wx_get_name(struct ieee80211_device *ieee,

if ((ieee->state == IEEE80211_LINKED) ||
(ieee->state == IEEE80211_LINKED_SCANNING))
- strlcat(wrqu->name," link", IFNAMSIZ);
+ strlcat(wrqu->name, " link", IFNAMSIZ);
else if (ieee->state != IEEE80211_NOLINK)
- strlcat(wrqu->name," .....", IFNAMSIZ);
+ strlcat(wrqu->name, " .....", IFNAMSIZ);


return 0;
@@ -508,7 +509,7 @@ int ieee80211_wx_set_power(struct ieee80211_device *ieee,
if (wrqu->power.flags & IW_POWER_TIMEOUT) {

ieee->ps_timeout = wrqu->power.value / 1000;
- printk("Timeout %d\n",ieee->ps_timeout);
+ printk("Timeout %d\n", ieee->ps_timeout);
}

if (wrqu->power.flags & IW_POWER_PERIOD) {
--
1.7.9.5

2012-11-27 12:09:38

by YAMANE Toshiaki

[permalink] [raw]
Subject: [PATCH 5/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_softmac_wx.c

The following wanings fixed.
- WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: YAMANE Toshiaki <[email protected]>
---
.../rtl8187se/ieee80211/ieee80211_softmac_wx.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index f06ed35..177ff58 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
@@ -218,11 +218,11 @@ int ieee80211_wx_set_rate(struct ieee80211_device *ieee,
u32 target_rate = wrqu->bitrate.value;

//added by lizhaoming for auto mode
- if (target_rate == -1) {
+ if (target_rate == -1)
ieee->rate = 110;
- } else {
+ else
ieee->rate = target_rate/100000;
- }
+
//FIXME: we might want to limit rate also in management protocols.
return 0;
}
@@ -250,12 +250,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;
--
1.7.9.5

2012-11-27 12:09:53

by YAMANE Toshiaki

[permalink] [raw]
Subject: [PATCH 6/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_softmac_wx.c

The following errors fixed.
- ERROR: spaces required around that '=' (ctx:VxV)

Signed-off-by: YAMANE Toshiaki <[email protected]>
---
.../rtl8187se/ieee80211/ieee80211_softmac_wx.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index 177ff58..97faad9 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
@@ -337,7 +337,7 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
union iwreq_data *wrqu, char *extra)
{

- int ret=0, len;
+ int ret = 0, len;
short proto_started;
unsigned long flags;

@@ -348,12 +348,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;
}

@@ -528,7 +528,7 @@ int ieee80211_wx_get_power(struct ieee80211_device *ieee,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
- int ret =0;
+ int ret = 0;

down(&ieee->wx_sem);

--
1.7.9.5

2012-11-27 12:10:08

by YAMANE Toshiaki

[permalink] [raw]
Subject: [PATCH 7/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_softmac_wx.c

The following wanings fixed.
- WARNING: please, no spaces at the start of a line

Signed-off-by: YAMANE Toshiaki <[email protected]>
---
.../rtl8187se/ieee80211/ieee80211_softmac_wx.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index 97faad9..c71fb63 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
@@ -174,7 +174,7 @@ out:
return ret;
}

- int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct iw_request_info *a,
+int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct iw_request_info *a,
union iwreq_data *wrqu, char *b)
{
int len, ret = 0;
@@ -395,7 +395,7 @@ out:
return ret;
}

- 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)
{

@@ -403,7 +403,7 @@ out:
return 0;
}

- 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)
{
--
1.7.9.5

2012-11-27 12:10:23

by YAMANE Toshiaki

[permalink] [raw]
Subject: [PATCH 8/8] staging/rtl8187se: Use netdev_ printks in ieee80211/ieee80211_softmac_wx.c

The following warning fixed.
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

Signed-off-by: YAMANE Toshiaki <[email protected]>
---
.../rtl8187se/ieee80211/ieee80211_softmac_wx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index c71fb63..d9add53 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
@@ -419,8 +419,8 @@ int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee,
else
ieee->raw_tx = 0;

- printk(KERN_INFO"raw TX is %s\n",
- ieee->raw_tx ? "enabled" : "disabled");
+ netdev_info(ieee->dev, "raw TX is %s\n",
+ ieee->raw_tx ? "enabled" : "disabled");

if (ieee->iw_mode == IW_MODE_MONITOR) {
if (prev == 0 && ieee->raw_tx) {
--
1.7.9.5