* [PATCH 4/5] mwl8k: prevent crash in ->configure_filter() if no interface was added
@ 2009-08-03 19:58 Lennert Buytenhek
2009-08-03 20:03 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Lennert Buytenhek @ 2009-08-03 19:58 UTC (permalink / raw)
To: linville, linux-wireless; +Cc: nico
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Acked-by: Nicolas Pitre <nico@marvell.com>
---
drivers/net/wireless/mwl8k.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index a92752e..4890f8f 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -261,7 +261,7 @@ struct mwl8k_vif {
*/
};
-#define MWL8K_VIF(_vif) (struct mwl8k_vif *)(&((_vif)->drv_priv))
+#define MWL8K_VIF(_vif) ((struct mwl8k_vif *)&((_vif)->drv_priv))
static const struct ieee80211_channel mwl8k_channels[] = {
{ .center_freq = 2412, .hw_value = 1, },
@@ -3228,15 +3228,19 @@ static int mwl8k_configure_filter_wt(struct work_struct *wt)
struct dev_addr_list *mclist = worker->mclist;
struct mwl8k_priv *priv = hw->priv;
- struct mwl8k_vif *mv_vif;
int rc = 0;
if (changed_flags & FIF_BCN_PRBRESP_PROMISC) {
if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
rc = mwl8k_cmd_set_pre_scan(hw);
else {
- mv_vif = MWL8K_VIF(priv->vif);
- rc = mwl8k_cmd_set_post_scan(hw, mv_vif->bssid);
+ u8 *bssid;
+
+ bssid = "\x00\x00\x00\x00\x00\x00";
+ if (priv->vif != NULL)
+ bssid = MWL8K_VIF(priv->vif)->bssid;
+
+ rc = mwl8k_cmd_set_post_scan(hw, bssid);
}
}
--
1.5.6.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 4/5] mwl8k: prevent crash in ->configure_filter() if no interface was added
2009-08-03 19:58 [PATCH 4/5] mwl8k: prevent crash in ->configure_filter() if no interface was added Lennert Buytenhek
@ 2009-08-03 20:03 ` Johannes Berg
2009-08-03 23:46 ` Lennert Buytenhek
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2009-08-03 20:03 UTC (permalink / raw)
To: Lennert Buytenhek; +Cc: linville, linux-wireless, nico
[-- Attachment #1: Type: text/plain, Size: 372 bytes --]
On Mon, 2009-08-03 at 21:58 +0200, Lennert Buytenhek wrote:
> if (changed_flags & FIF_BCN_PRBRESP_PROMISC) {
> if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
> rc = mwl8k_cmd_set_pre_scan(hw);
> else {
> - mv_vif = MWL8K_VIF(priv->vif);
> - rc = mwl8k_cmd_set_post_scan(hw, mv_vif->bssid);
Btw, there are pre- and post-scan hooks now.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 4/5] mwl8k: prevent crash in ->configure_filter() if no interface was added
2009-08-03 20:03 ` Johannes Berg
@ 2009-08-03 23:46 ` Lennert Buytenhek
2009-08-04 6:37 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Lennert Buytenhek @ 2009-08-03 23:46 UTC (permalink / raw)
To: Johannes Berg; +Cc: linville, linux-wireless, nico
On Mon, Aug 03, 2009 at 10:03:10PM +0200, Johannes Berg wrote:
> > if (changed_flags & FIF_BCN_PRBRESP_PROMISC) {
> > if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
> > rc = mwl8k_cmd_set_pre_scan(hw);
> > else {
> > - mv_vif = MWL8K_VIF(priv->vif);
> > - rc = mwl8k_cmd_set_post_scan(hw, mv_vif->bssid);
>
> Btw, there are pre- and post-scan hooks now.
These hardware commands are slightly misnamed -- they are called
PRE_SCAN/POST_SCAN, but what they do is program the receive filter.
It seems appropriate to keep that in ->configure_filter() ?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 4/5] mwl8k: prevent crash in ->configure_filter() if no interface was added
2009-08-03 23:46 ` Lennert Buytenhek
@ 2009-08-04 6:37 ` Johannes Berg
0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2009-08-04 6:37 UTC (permalink / raw)
To: Lennert Buytenhek; +Cc: linville, linux-wireless, nico
[-- Attachment #1: Type: text/plain, Size: 1045 bytes --]
On Tue, 2009-08-04 at 01:46 +0200, Lennert Buytenhek wrote:
> On Mon, Aug 03, 2009 at 10:03:10PM +0200, Johannes Berg wrote:
>
> > > if (changed_flags & FIF_BCN_PRBRESP_PROMISC) {
> > > if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
> > > rc = mwl8k_cmd_set_pre_scan(hw);
> > > else {
> > > - mv_vif = MWL8K_VIF(priv->vif);
> > > - rc = mwl8k_cmd_set_post_scan(hw, mv_vif->bssid);
> >
> > Btw, there are pre- and post-scan hooks now.
>
> These hardware commands are slightly misnamed -- they are called
> PRE_SCAN/POST_SCAN, but what they do is program the receive filter.
> It seems appropriate to keep that in ->configure_filter() ?
I guess it depends how they configure the filter. :)
If they really do the beacon/probe response filter thing then yes. For
b43, for instance, they also disable CFP updates etc. so aren't just
that. And you can get FIF_BCN_PRBRESP_PROMISC even while _not_ scanning,
due to monitor interfaces, so it really depends what they do (no CFP
disabling wanted then).
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-08-04 6:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-03 19:58 [PATCH 4/5] mwl8k: prevent crash in ->configure_filter() if no interface was added Lennert Buytenhek
2009-08-03 20:03 ` Johannes Berg
2009-08-03 23:46 ` Lennert Buytenhek
2009-08-04 6:37 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).