All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] mwifiex: endian bug in mwifiex_drv_change_adhoc_chan()
@ 2012-03-01  7:22 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2012-03-01  7:22 UTC (permalink / raw)
  To: Bing Zhao; +Cc: John W. Linville, linux-wireless, kernel-janitors

In mwifiex_drv_change_adhoc_chan() we pass channel to
mwifiex_bss_ioctl_ibss_channel() which sets the high 16 bits.  This
works on little endian systems but not on big endian ones.  I've changed
mwifiex_drv_change_adhoc_chan() to use a 16 bit variable.  This matches
the other functions in the file.

I considered changing mwifiex_change_adhoc_chan() as well but it turns
out that the function isn't implemented so I just removed the
definition.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 52810b1..60a6919 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -909,10 +909,9 @@ int mwifiex_request_scan(struct mwifiex_private *priv,
 			 struct mwifiex_802_11_ssid *req_ssid);
 int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv,
 				struct mwifiex_user_scan_cfg *scan_req);
-int mwifiex_change_adhoc_chan(struct mwifiex_private *priv, int channel);
 int mwifiex_set_radio(struct mwifiex_private *priv, u8 option);
 
-int mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel);
+int mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, u16 channel);
 
 int mwifiex_set_encode(struct mwifiex_private *priv, const u8 *key,
 		       int key_len, u8 key_index, int disable);
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index b0fbf5d..652d299 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -599,7 +599,7 @@ static int mwifiex_bss_ioctl_ibss_channel(struct mwifiex_private *priv,
  *          - Start/Join the IBSS
  */
 int
-mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel)
+mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, u16 channel)
 {
 	int ret;
 	struct mwifiex_bss_info bss_info;
@@ -636,7 +636,7 @@ mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel)
 	ret = mwifiex_deauthenticate(priv, ssid_bssid.bssid);
 
 	ret = mwifiex_bss_ioctl_ibss_channel(priv, HostCmd_ACT_GEN_SET,
-					     (u16 *) &channel);
+					     &channel);
 
 	/* Do specific SSID scanning */
 	if (mwifiex_request_scan(priv, &bss_info.ssid)) {

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [patch] mwifiex: endian bug in mwifiex_drv_change_adhoc_chan()
@ 2012-03-01  7:22 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2012-03-01  7:22 UTC (permalink / raw)
  To: Bing Zhao; +Cc: John W. Linville, linux-wireless, kernel-janitors

In mwifiex_drv_change_adhoc_chan() we pass channel to
mwifiex_bss_ioctl_ibss_channel() which sets the high 16 bits.  This
works on little endian systems but not on big endian ones.  I've changed
mwifiex_drv_change_adhoc_chan() to use a 16 bit variable.  This matches
the other functions in the file.

I considered changing mwifiex_change_adhoc_chan() as well but it turns
out that the function isn't implemented so I just removed the
definition.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 52810b1..60a6919 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -909,10 +909,9 @@ int mwifiex_request_scan(struct mwifiex_private *priv,
 			 struct mwifiex_802_11_ssid *req_ssid);
 int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv,
 				struct mwifiex_user_scan_cfg *scan_req);
-int mwifiex_change_adhoc_chan(struct mwifiex_private *priv, int channel);
 int mwifiex_set_radio(struct mwifiex_private *priv, u8 option);
 
-int mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel);
+int mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, u16 channel);
 
 int mwifiex_set_encode(struct mwifiex_private *priv, const u8 *key,
 		       int key_len, u8 key_index, int disable);
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index b0fbf5d..652d299 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -599,7 +599,7 @@ static int mwifiex_bss_ioctl_ibss_channel(struct mwifiex_private *priv,
  *          - Start/Join the IBSS
  */
 int
-mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel)
+mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, u16 channel)
 {
 	int ret;
 	struct mwifiex_bss_info bss_info;
@@ -636,7 +636,7 @@ mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel)
 	ret = mwifiex_deauthenticate(priv, ssid_bssid.bssid);
 
 	ret = mwifiex_bss_ioctl_ibss_channel(priv, HostCmd_ACT_GEN_SET,
-					     (u16 *) &channel);
+					     &channel);
 
 	/* Do specific SSID scanning */
 	if (mwifiex_request_scan(priv, &bss_info.ssid)) {

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [patch] mwifiex: endian bug in mwifiex_drv_change_adhoc_chan()
  2012-03-01  7:22 ` Dan Carpenter
@ 2012-03-01 19:45   ` Bing Zhao
  -1 siblings, 0 replies; 4+ messages in thread
From: Bing Zhao @ 2012-03-01 19:45 UTC (permalink / raw)
  To: Dan Carpenter, John W. Linville; +Cc: linux-wireless, kernel-janitors

Hi Dan,

Thanks for your patch.
It looks correct.


Hi John,

There is a conflict between this patch and a patch I submitted previously.

mwifiex: remove unnecessary struct mwifiex_802_11_ssid

If you are going to take my patch series (except for the one 6/6, NACKed by Johannes), either Dan or myself can rebase this patch.

I have ACKed Dan's patch under the s-o-b line below, in case you want to merge his patch first.

Thanks,
Bing

> Subject: [patch] mwifiex: endian bug in mwifiex_drv_change_adhoc_chan()
> 
> In mwifiex_drv_change_adhoc_chan() we pass channel to
> mwifiex_bss_ioctl_ibss_channel() which sets the high 16 bits.  This
> works on little endian systems but not on big endian ones.  I've changed
> mwifiex_drv_change_adhoc_chan() to use a 16 bit variable.  This matches
> the other functions in the file.
> 
> I considered changing mwifiex_change_adhoc_chan() as well but it turns
> out that the function isn't implemented so I just removed the
> definition.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Bing Zhao <bzhao@marvell.com>

> 
> diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
> index 52810b1..60a6919 100644
> --- a/drivers/net/wireless/mwifiex/main.h
> +++ b/drivers/net/wireless/mwifiex/main.h
> @@ -909,10 +909,9 @@ int mwifiex_request_scan(struct mwifiex_private *priv,
>  			 struct mwifiex_802_11_ssid *req_ssid);
>  int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv,
>  				struct mwifiex_user_scan_cfg *scan_req);
> -int mwifiex_change_adhoc_chan(struct mwifiex_private *priv, int channel);
>  int mwifiex_set_radio(struct mwifiex_private *priv, u8 option);
> 
> -int mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel);
> +int mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, u16 channel);
> 
>  int mwifiex_set_encode(struct mwifiex_private *priv, const u8 *key,
>  		       int key_len, u8 key_index, int disable);
> diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
> index b0fbf5d..652d299 100644
> --- a/drivers/net/wireless/mwifiex/sta_ioctl.c
> +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
> @@ -599,7 +599,7 @@ static int mwifiex_bss_ioctl_ibss_channel(struct mwifiex_private *priv,
>   *          - Start/Join the IBSS
>   */
>  int
> -mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel)
> +mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, u16 channel)
>  {
>  	int ret;
>  	struct mwifiex_bss_info bss_info;
> @@ -636,7 +636,7 @@ mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel)
>  	ret = mwifiex_deauthenticate(priv, ssid_bssid.bssid);
> 
>  	ret = mwifiex_bss_ioctl_ibss_channel(priv, HostCmd_ACT_GEN_SET,
> -					     (u16 *) &channel);
> +					     &channel);
> 
>  	/* Do specific SSID scanning */
>  	if (mwifiex_request_scan(priv, &bss_info.ssid)) {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [patch] mwifiex: endian bug in mwifiex_drv_change_adhoc_chan()
@ 2012-03-01 19:45   ` Bing Zhao
  0 siblings, 0 replies; 4+ messages in thread
From: Bing Zhao @ 2012-03-01 19:45 UTC (permalink / raw)
  To: Dan Carpenter, John W. Linville; +Cc: linux-wireless, kernel-janitors

Hi Dan,

Thanks for your patch.
It looks correct.


Hi John,

There is a conflict between this patch and a patch I submitted previously.

mwifiex: remove unnecessary struct mwifiex_802_11_ssid

If you are going to take my patch series (except for the one 6/6, NACKed by Johannes), either Dan or myself can rebase this patch.

I have ACKed Dan's patch under the s-o-b line below, in case you want to merge his patch first.

Thanks,
Bing

> Subject: [patch] mwifiex: endian bug in mwifiex_drv_change_adhoc_chan()
> 
> In mwifiex_drv_change_adhoc_chan() we pass channel to
> mwifiex_bss_ioctl_ibss_channel() which sets the high 16 bits.  This
> works on little endian systems but not on big endian ones.  I've changed
> mwifiex_drv_change_adhoc_chan() to use a 16 bit variable.  This matches
> the other functions in the file.
> 
> I considered changing mwifiex_change_adhoc_chan() as well but it turns
> out that the function isn't implemented so I just removed the
> definition.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Bing Zhao <bzhao@marvell.com>

> 
> diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
> index 52810b1..60a6919 100644
> --- a/drivers/net/wireless/mwifiex/main.h
> +++ b/drivers/net/wireless/mwifiex/main.h
> @@ -909,10 +909,9 @@ int mwifiex_request_scan(struct mwifiex_private *priv,
>  			 struct mwifiex_802_11_ssid *req_ssid);
>  int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv,
>  				struct mwifiex_user_scan_cfg *scan_req);
> -int mwifiex_change_adhoc_chan(struct mwifiex_private *priv, int channel);
>  int mwifiex_set_radio(struct mwifiex_private *priv, u8 option);
> 
> -int mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel);
> +int mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, u16 channel);
> 
>  int mwifiex_set_encode(struct mwifiex_private *priv, const u8 *key,
>  		       int key_len, u8 key_index, int disable);
> diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
> index b0fbf5d..652d299 100644
> --- a/drivers/net/wireless/mwifiex/sta_ioctl.c
> +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
> @@ -599,7 +599,7 @@ static int mwifiex_bss_ioctl_ibss_channel(struct mwifiex_private *priv,
>   *          - Start/Join the IBSS
>   */
>  int
> -mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel)
> +mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, u16 channel)
>  {
>  	int ret;
>  	struct mwifiex_bss_info bss_info;
> @@ -636,7 +636,7 @@ mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, int channel)
>  	ret = mwifiex_deauthenticate(priv, ssid_bssid.bssid);
> 
>  	ret = mwifiex_bss_ioctl_ibss_channel(priv, HostCmd_ACT_GEN_SET,
> -					     (u16 *) &channel);
> +					     &channel);
> 
>  	/* Do specific SSID scanning */
>  	if (mwifiex_request_scan(priv, &bss_info.ssid)) {

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-01 19:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-01  7:22 [patch] mwifiex: endian bug in mwifiex_drv_change_adhoc_chan() Dan Carpenter
2012-03-01  7:22 ` Dan Carpenter
2012-03-01 19:45 ` Bing Zhao
2012-03-01 19:45   ` Bing Zhao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.