diff options
| author | Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | 2012-02-29 09:24:54 -0500 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2012-03-05 15:23:16 -0500 |
| commit | f808e4ad05704d4ba0082fbb27640294c6fa4eae (patch) | |
| tree | 75ad554227015fa52ea45ffc1b7e9527a2a23851 | |
| parent | e4e02da2ef01deb36aa80fce6ee0bc3e9725ffe8 (diff) | |
rndis_wlan: fix le16/le32_to_cpu mix up with config.beacon_period
'beacon_period' in 'struct ndis_80211_conf' is __le32 instead of __le16 so
le32_to_cpu must be used instead of le16_to_cpu.
Also correct 'beacon_interval' variables used for passing this value forward
from u16 to u32 and rename those variables 'beacon_period' This is to avoid
confusion because 'beacon_interval' is defined as __le16 at other structure,
'struct ndis_80211_fixed_ies'.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
| -rw-r--r-- | drivers/net/wireless/rndis_wlan.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index ce138d846193..c831c1f2bd07 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
| @@ -1350,7 +1350,7 @@ static int set_channel(struct usbnet *usbdev, int channel) | |||
| 1350 | } | 1350 | } |
| 1351 | 1351 | ||
| 1352 | static struct ieee80211_channel *get_current_channel(struct usbnet *usbdev, | 1352 | static struct ieee80211_channel *get_current_channel(struct usbnet *usbdev, |
| 1353 | u16 *beacon_interval) | 1353 | u32 *beacon_period) |
| 1354 | { | 1354 | { |
| 1355 | struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); | 1355 | struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); |
| 1356 | struct ieee80211_channel *channel; | 1356 | struct ieee80211_channel *channel; |
| @@ -1370,8 +1370,8 @@ static struct ieee80211_channel *get_current_channel(struct usbnet *usbdev, | |||
| 1370 | if (!channel) | 1370 | if (!channel) |
| 1371 | return NULL; | 1371 | return NULL; |
| 1372 | 1372 | ||
| 1373 | if (beacon_interval) | 1373 | if (beacon_period) |
| 1374 | *beacon_interval = le16_to_cpu(config.beacon_period); | 1374 | *beacon_period = le32_to_cpu(config.beacon_period); |
| 1375 | return channel; | 1375 | return channel; |
| 1376 | } | 1376 | } |
| 1377 | 1377 | ||
| @@ -2683,7 +2683,7 @@ static void rndis_wlan_craft_connected_bss(struct usbnet *usbdev, u8 *bssid, | |||
| 2683 | s32 signal; | 2683 | s32 signal; |
| 2684 | u64 timestamp; | 2684 | u64 timestamp; |
| 2685 | u16 capability; | 2685 | u16 capability; |
| 2686 | u16 beacon_interval = 0; | 2686 | u32 beacon_period = 0; |
| 2687 | __le32 rssi; | 2687 | __le32 rssi; |
| 2688 | u8 ie_buf[34]; | 2688 | u8 ie_buf[34]; |
| 2689 | int len, ret, ie_len; | 2689 | int len, ret, ie_len; |
| @@ -2708,7 +2708,7 @@ static void rndis_wlan_craft_connected_bss(struct usbnet *usbdev, u8 *bssid, | |||
| 2708 | } | 2708 | } |
| 2709 | 2709 | ||
| 2710 | /* Get channel and beacon interval */ | 2710 | /* Get channel and beacon interval */ |
| 2711 | channel = get_current_channel(usbdev, &beacon_interval); | 2711 | channel = get_current_channel(usbdev, &beacon_period); |
| 2712 | if (!channel) { | 2712 | if (!channel) { |
| 2713 | netdev_warn(usbdev->net, "%s(): could not get channel.\n", | 2713 | netdev_warn(usbdev->net, "%s(): could not get channel.\n", |
| 2714 | __func__); | 2714 | __func__); |
| @@ -2738,11 +2738,11 @@ static void rndis_wlan_craft_connected_bss(struct usbnet *usbdev, u8 *bssid, | |||
| 2738 | netdev_dbg(usbdev->net, "%s(): channel:%d(freq), bssid:[%pM], tsf:%d, " | 2738 | netdev_dbg(usbdev->net, "%s(): channel:%d(freq), bssid:[%pM], tsf:%d, " |
| 2739 | "capa:%x, beacon int:%d, resp_ie(len:%d, essid:'%.32s'), " | 2739 | "capa:%x, beacon int:%d, resp_ie(len:%d, essid:'%.32s'), " |
| 2740 | "signal:%d\n", __func__, (channel ? channel->center_freq : -1), | 2740 | "signal:%d\n", __func__, (channel ? channel->center_freq : -1), |
| 2741 | bssid, (u32)timestamp, capability, beacon_interval, ie_len, | 2741 | bssid, (u32)timestamp, capability, beacon_period, ie_len, |
| 2742 | ssid.essid, signal); | 2742 | ssid.essid, signal); |
| 2743 | 2743 | ||
| 2744 | bss = cfg80211_inform_bss(priv->wdev.wiphy, channel, bssid, | 2744 | bss = cfg80211_inform_bss(priv->wdev.wiphy, channel, bssid, |
| 2745 | timestamp, capability, beacon_interval, ie_buf, ie_len, | 2745 | timestamp, capability, beacon_period, ie_buf, ie_len, |
| 2746 | signal, GFP_KERNEL); | 2746 | signal, GFP_KERNEL); |
| 2747 | cfg80211_put_bss(bss); | 2747 | cfg80211_put_bss(bss); |
| 2748 | } | 2748 | } |
