Patchwork [RFC,1/2] hostapd: Derive frequency for BSSes other than the first

login
register
mail settings
Submitter Yogesh Ashok Powar
Date Jan. 12, 2012, 10:32 a.m.
Message ID <20120112103218.GA19229@hertz.marvell.com>
Download mbox | patch
Permalink /patch/135615/
State Superseded
Headers show

Comments

Yogesh Ashok Powar - Jan. 12, 2012, 10:32 a.m.
Commit e4fb21676972952b5434e8c2a049e239d457abe6 moved frequency
storage from driver struct to bss struct and is assigned in
wpa_driver_nl80211_set_freq. As this wpa_driver_nl80211_set_freq
is triggered only on the first_bss, bss->freq for other BSSes is
never being set to the correct value. This sends MLME frames
on frequency zero (initialized value of freq) for BSSes other than the first.

To fix this deriving frequency value from first_bss.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
---
 src/drivers/driver_nl80211.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Johannes Berg - Jan. 12, 2012, 10:39 a.m.
On Thu, 2012-01-12 at 16:02 +0530, Yogesh Ashok Powar wrote:
> Commit e4fb21676972952b5434e8c2a049e239d457abe6 moved frequency
> storage from driver struct to bss struct and is assigned in
> wpa_driver_nl80211_set_freq. As this wpa_driver_nl80211_set_freq
> is triggered only on the first_bss, bss->freq for other BSSes is
> never being set to the correct value. This sends MLME frames
> on frequency zero (initialized value of freq) for BSSes other than the first.
> 
> To fix this deriving frequency value from first_bss.
> 
> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
> ---
>  src/drivers/driver_nl80211.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> index 6af8cc9..194a752 100644
> --- a/src/drivers/driver_nl80211.c
> +++ b/src/drivers/driver_nl80211.c
> @@ -5136,7 +5136,7 @@ static int wpa_driver_nl80211_send_frame(struct i802_bss *bss,
>  		return wpa_driver_nl80211_send_mntr(drv, data, len,
>  						    encrypt, noack);
>  
> -	return nl80211_send_frame_cmd(bss, bss->freq, 0, data, len,
> +	return nl80211_send_frame_cmd(bss, drv->first_bss.freq, 0, data, len,

Hmm, shouldn't we rather set the right freq in
wpa_driver_nl80211_if_add()?

johannes

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 6af8cc9..194a752 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -5136,7 +5136,7 @@  static int wpa_driver_nl80211_send_frame(struct i802_bss *bss,
 		return wpa_driver_nl80211_send_mntr(drv, data, len,
 						    encrypt, noack);
 
-	return nl80211_send_frame_cmd(bss, bss->freq, 0, data, len,
+	return nl80211_send_frame_cmd(bss, drv->first_bss.freq, 0, data, len,
 				      &cookie, 0, noack, 0);
 }
 
@@ -5167,7 +5167,7 @@  static int wpa_driver_nl80211_send_mlme(void *priv, const u8 *data,
 	}
 
 	if (drv->device_ap_sme && is_ap_interface(drv->nlmode)) {
-		return nl80211_send_frame_cmd(bss, bss->freq, 0,
+		return nl80211_send_frame_cmd(bss, drv->first_bss.freq, 0,
 					      data, data_len, NULL,
 					      0, noack, 0);
 	}