From: "Alina Friedrichsen" <x-alina@gmx.net>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: openwrt-devel@lists.openwrt.org, linux-wireless@vger.kernel.org,
berlin@berlin.freifunk.net
Subject: Re: mac80211 (ath9k, ath5k, etc.) set BSSID Patch
Date: Wed, 31 Dec 2008 00:07:51 +0100 [thread overview]
Message-ID: <20081230230751.163100@gmx.net> (raw)
In-Reply-To: <1230676811.3850.22.camel@johannes>
[-- Attachment #1: Type: text/plain, Size: 899 bytes --]
Hi Johannes!
> I disagree, even if the function doesn't use the proper types
> pervasively, we shouldn't be adding old-style stuff.
Okay, I can use bool to if you want, too.
> What Jouni pointed out still stands, you should separate the bugfix and
> the 'disregard ibss join' feature into two patches.
As I say, the "the 'disregard ibss join' feature" is already implemented only not complete. If you want a driver, that do in some situations merges and some others don't, you can easily remove the line 1663. But I think it would nice, if the main driver implement it properly, not half.
For now we can only use the madwifi and an awful hacked proprietary 2.4er kernel broadcom driver for it. It would nice to have a clean free software implementation for it.
Regards
Alina
--
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
[-- Attachment #2: mac80211-setbssid-2.patch --]
[-- Type: text/x-patch, Size: 1995 bytes --]
diff -urN compat-wireless-2008-12-29.orig/net/mac80211/mlme.c compat-wireless-2008-12-29/net/mac80211/mlme.c
--- compat-wireless-2008-12-29.orig/net/mac80211/mlme.c 2008-12-29 06:14:35.000000000 +0100
+++ compat-wireless-2008-12-29/net/mac80211/mlme.c 2008-12-30 23:08:08.000000000 +0100
@@ -1660,6 +1660,7 @@
/* check if we need to merge IBSS */
if (sdata->vif.type == NL80211_IFTYPE_ADHOC && beacon &&
+ (!(sdata->u.sta.flags & IEEE80211_STA_BSSID_SET)) &&
bss->capability & WLAN_CAPABILITY_IBSS &&
bss->freq == local->oper_channel->center_freq &&
elems->ssid_len == sdata->u.sta.ssid_len &&
@@ -1705,7 +1706,8 @@
(unsigned long long)(rx_timestamp - beacon_timestamp),
jiffies);
#endif /* CONFIG_MAC80211_IBSS_DEBUG */
- if (beacon_timestamp > rx_timestamp) {
+ if (beacon_timestamp > rx_timestamp &&
+ memcmp(sdata->u.sta.bssid, mgmt->bssid, ETH_ALEN) != 0) {
#ifdef CONFIG_MAC80211_IBSS_DEBUG
printk(KERN_DEBUG "%s: beacon TSF higher than "
"local TSF - IBSS merge with BSSID %s\n",
@@ -2031,6 +2033,9 @@
if (ieee80211_sta_active_ibss(sdata))
return;
+ if (sdata->u.sta.flags & IEEE80211_STA_BSSID_SET)
+ return;
+
printk(KERN_DEBUG "%s: No active IBSS STAs - trying to scan for other "
"IBSS networks with same SSID (merge)\n", sdata->dev->name);
ieee80211_request_scan(sdata, ifsta->ssid, ifsta->ssid_len);
@@ -2576,11 +2581,16 @@
{
struct ieee80211_if_sta *ifsta;
int res;
+ bool valid;
ifsta = &sdata->u.sta;
+ valid = is_valid_ether_addr(bssid);
if (memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0) {
- memcpy(ifsta->bssid, bssid, ETH_ALEN);
+ if(valid)
+ memcpy(ifsta->bssid, bssid, ETH_ALEN);
+ else
+ memset(ifsta->bssid, 0, ETH_ALEN);
res = 0;
/*
* Hack! See also ieee80211_sta_set_ssid.
@@ -2594,7 +2604,7 @@
}
}
- if (is_valid_ether_addr(bssid))
+ if (valid)
ifsta->flags |= IEEE80211_STA_BSSID_SET;
else
ifsta->flags &= ~IEEE80211_STA_BSSID_SET;
next prev parent reply other threads:[~2008-12-30 23:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-30 2:56 mac80211 (ath9k, ath5k, etc.) set BSSID Patch Alina Friedrichsen
2008-12-30 10:39 ` Johannes Berg
2008-12-30 22:36 ` Alina Friedrichsen
2008-12-30 22:40 ` Johannes Berg
2008-12-30 23:07 ` Alina Friedrichsen [this message]
2009-01-01 22:41 ` mac80211 (ath9k, ath5k, etc.) set fixed BSSID + channel Patch Alina Friedrichsen
2009-01-02 14:29 ` Johannes Berg
2008-12-30 11:37 ` mac80211 (ath9k, ath5k, etc.) set BSSID Patch Jouni Malinen
2008-12-30 16:15 ` Alina Friedrichsen
2008-12-30 16:56 ` Jouni Malinen
2008-12-30 21:20 ` Alina Friedrichsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081230230751.163100@gmx.net \
--to=x-alina@gmx.net \
--cc=berlin@berlin.freifunk.net \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=openwrt-devel@lists.openwrt.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).