Skip to content

Commit

Permalink
mwifiex: endian bug in mwifiex_drv_change_adhoc_chan()
Browse files Browse the repository at this point in the history
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Dan Carpenter authored and John W. Linville committed Mar 5, 2012
1 parent 62ebeed commit 380aeef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions drivers/net/wireless/mwifiex/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -909,10 +909,9 @@ int mwifiex_request_scan(struct mwifiex_private *priv,
struct cfg80211_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);
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/mwifiex/sta_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,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;
Expand Down Expand Up @@ -646,7 +646,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)) {
Expand Down

0 comments on commit 380aeef

Please sign in to comment.