* [PATCH] p54: generate channel list dynamically
From: Christian Lamparter @ 2009-07-10 23:22 UTC (permalink / raw)
To: wireless; +Cc: John W. Linville
This patch enhances the eeprom parser to generate customized
channel list for every device.
Signed-off-by: Christian Lamparter <chunkeey@web.de>
---
diff --git a/drivers/net/wireless/p54/eeprom.c b/drivers/net/wireless/p54/eeprom.c
index a2a044e..549ef2d 100644
--- a/drivers/net/wireless/p54/eeprom.c
+++ b/drivers/net/wireless/p54/eeprom.c
@@ -19,6 +19,7 @@
#include <linux/init.h>
#include <linux/firmware.h>
#include <linux/etherdevice.h>
+#include <linux/sort.h>
#include <net/mac80211.h>
@@ -41,30 +42,6 @@ static struct ieee80211_rate p54_bgrates[] = {
{ .bitrate = 540, .hw_value = 11, },
};
-static struct ieee80211_channel p54_bgchannels[] = {
- { .center_freq = 2412, .hw_value = 1, },
- { .center_freq = 2417, .hw_value = 2, },
- { .center_freq = 2422, .hw_value = 3, },
- { .center_freq = 2427, .hw_value = 4, },
- { .center_freq = 2432, .hw_value = 5, },
- { .center_freq = 2437, .hw_value = 6, },
- { .center_freq = 2442, .hw_value = 7, },
- { .center_freq = 2447, .hw_value = 8, },
- { .center_freq = 2452, .hw_value = 9, },
- { .center_freq = 2457, .hw_value = 10, },
- { .center_freq = 2462, .hw_value = 11, },
- { .center_freq = 2467, .hw_value = 12, },
- { .center_freq = 2472, .hw_value = 13, },
- { .center_freq = 2484, .hw_value = 14, },
-};
-
-static struct ieee80211_supported_band band_2GHz = {
- .channels = p54_bgchannels,
- .n_channels = ARRAY_SIZE(p54_bgchannels),
- .bitrates = p54_bgrates,
- .n_bitrates = ARRAY_SIZE(p54_bgrates),
-};
-
static struct ieee80211_rate p54_arates[] = {
{ .bitrate = 60, .hw_value = 4, },
{ .bitrate = 90, .hw_value = 5, },
@@ -76,51 +53,257 @@ static struct ieee80211_rate p54_arates[] = {
{ .bitrate = 540, .hw_value = 11, },
};
-static struct ieee80211_channel p54_achannels[] = {
- { .center_freq = 4920 },
- { .center_freq = 4940 },
- { .center_freq = 4960 },
- { .center_freq = 4980 },
- { .center_freq = 5040 },
- { .center_freq = 5060 },
- { .center_freq = 5080 },
- { .center_freq = 5170 },
- { .center_freq = 5180 },
- { .center_freq = 5190 },
- { .center_freq = 5200 },
- { .center_freq = 5210 },
- { .center_freq = 5220 },
- { .center_freq = 5230 },
- { .center_freq = 5240 },
- { .center_freq = 5260 },
- { .center_freq = 5280 },
- { .center_freq = 5300 },
- { .center_freq = 5320 },
- { .center_freq = 5500 },
- { .center_freq = 5520 },
- { .center_freq = 5540 },
- { .center_freq = 5560 },
- { .center_freq = 5580 },
- { .center_freq = 5600 },
- { .center_freq = 5620 },
- { .center_freq = 5640 },
- { .center_freq = 5660 },
- { .center_freq = 5680 },
- { .center_freq = 5700 },
- { .center_freq = 5745 },
- { .center_freq = 5765 },
- { .center_freq = 5785 },
- { .center_freq = 5805 },
- { .center_freq = 5825 },
+#define CHAN_HAS_CAL BIT(0)
+#define CHAN_HAS_LIMIT BIT(1)
+#define CHAN_HAS_CURVE BIT(2)
+#define CHAN_HAS_ALL (CHAN_HAS_CAL | CHAN_HAS_LIMIT | CHAN_HAS_CURVE)
+
+struct p54_channel_entry {
+ u16 freq;
+ u16 data;
+ int index;
+ enum ieee80211_band band;
};
-static struct ieee80211_supported_band band_5GHz = {
- .channels = p54_achannels,
- .n_channels = ARRAY_SIZE(p54_achannels),
- .bitrates = p54_arates,
- .n_bitrates = ARRAY_SIZE(p54_arates),
+struct p54_channel_list {
+ struct p54_channel_entry *channels;
+ size_t entries;
+ size_t max_entries;
+ size_t band_channel_num[IEEE80211_NUM_BANDS];
};
+static int p54_get_band_from_freq(u16 freq)
+{
+ /* FIXME: sync these values with the 802.11 spec */
+
+ if ((freq >= 2412) && (freq <= 2484))
+ return IEEE80211_BAND_2GHZ;
+
+ if ((freq >= 4920) && (freq <= 5825))
+ return IEEE80211_BAND_5GHZ;
+
+ return -1;
+}
+
+static int p54_compare_channels(const void *_a,
+ const void *_b)
+{
+ const struct p54_channel_entry *a = _a;
+ const struct p54_channel_entry *b = _b;
+
+ return a->index - b->index;
+}
+
+static int p54_fill_band_bitrates(struct ieee80211_hw *dev,
+ struct ieee80211_supported_band *band_entry,
+ enum ieee80211_band band)
+{
+ /* TODO: generate rate array dynamically */
+
+ switch (band) {
+ case IEEE80211_BAND_2GHZ:
+ band_entry->bitrates = p54_bgrates;
+ band_entry->n_bitrates = ARRAY_SIZE(p54_bgrates);
+ break;
+ case IEEE80211_BAND_5GHZ:
+ band_entry->bitrates = p54_arates;
+ band_entry->n_bitrates = ARRAY_SIZE(p54_arates);
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+static int p54_generate_band(struct ieee80211_hw *dev,
+ struct p54_channel_list *list,
+ enum ieee80211_band band)
+{
+ struct p54_common *priv = dev->priv;
+ struct ieee80211_supported_band *tmp, *old;
+ unsigned int i, j;
+ int ret = -ENOMEM;
+
+ if ((!list->entries) || (!list->band_channel_num[band]))
+ return 0;
+
+ tmp = kzalloc(sizeof(*tmp), GFP_KERNEL);
+ if (!tmp)
+ goto err_out;
+
+ tmp->channels = kzalloc(sizeof(struct ieee80211_channel) *
+ list->band_channel_num[band], GFP_KERNEL);
+ if (!tmp->channels)
+ goto err_out;
+
+ ret = p54_fill_band_bitrates(dev, tmp, band);
+ if (ret)
+ goto err_out;
+
+ for (i = 0, j = 0; (j < list->band_channel_num[band]) &&
+ (i < list->entries); i++) {
+
+ if (list->channels[i].band != band)
+ continue;
+
+ if (list->channels[i].data != CHAN_HAS_ALL) {
+ printk(KERN_ERR "%s:%s%s%s is/are missing for "
+ "channel:%d [%d MHz].\n",
+ wiphy_name(dev->wiphy),
+ (list->channels[i].data & CHAN_HAS_CAL ? "" :
+ " [iqauto calibration data]"),
+ (list->channels[i].data & CHAN_HAS_LIMIT ? "" :
+ " [output power limits]"),
+ (list->channels[i].data & CHAN_HAS_CURVE ? "" :
+ " [curve data]"),
+ list->channels[i].index, list->channels[i].freq);
+ }
+
+ tmp->channels[j].band = list->channels[i].band;
+ tmp->channels[j].center_freq = list->channels[i].freq;
+ j++;
+ }
+
+ tmp->n_channels = list->band_channel_num[band];
+ old = priv->band_table[band];
+ priv->band_table[band] = tmp;
+ if (old) {
+ kfree(old->channels);
+ kfree(old);
+ }
+
+ return 0;
+
+err_out:
+ if (tmp) {
+ kfree(tmp->channels);
+ kfree(tmp);
+ }
+
+ return ret;
+}
+
+static void p54_update_channel_param(struct p54_channel_list *list,
+ u16 freq, u16 data)
+{
+ int band, i;
+
+ /*
+ * usually all lists in the eeprom are mostly sorted.
+ * so it's very likely that the entry we are looking for
+ * is right at the end of the list
+ */
+ for (i = list->entries; i >= 0; i--) {
+ if (freq == list->channels[i].freq) {
+ list->channels[i].data |= data;
+ break;
+ }
+ }
+
+ if ((i < 0) && (list->entries < list->max_entries)) {
+ /* entry does not exist yet. Initialize a new one. */
+ band = p54_get_band_from_freq(freq);
+
+ /*
+ * filter out frequencies which don't belong into
+ * any supported band.
+ */
+ if (band < 0)
+ return ;
+
+ i = list->entries++;
+ list->band_channel_num[band]++;
+
+ list->channels[i].freq = freq;
+ list->channels[i].data = data;
+ list->channels[i].band = band;
+ list->channels[i].index = ieee80211_frequency_to_channel(freq);
+ /* TODO: parse output_limit and fill max_power */
+ }
+}
+
+static int p54_generate_channel_lists(struct ieee80211_hw *dev)
+{
+ struct p54_common *priv = dev->priv;
+ struct p54_channel_list *list;
+ unsigned int i, j, max_channel_num;
+ int ret = -ENOMEM;
+ u16 freq;
+
+ if ((priv->iq_autocal_len != priv->curve_data->entries) ||
+ (priv->iq_autocal_len != priv->output_limit->entries))
+ printk(KERN_ERR "%s: EEPROM is damaged... you may not be able"
+ "to use all channels with this device.\n",
+ wiphy_name(dev->wiphy));
+
+ max_channel_num = max_t(unsigned int, priv->output_limit->entries,
+ priv->iq_autocal_len);
+ max_channel_num = max_t(unsigned int, max_channel_num,
+ priv->curve_data->entries);
+
+ list = kzalloc(sizeof(*list), GFP_KERNEL);
+ if (!list)
+ goto free;
+
+ list->max_entries = max_channel_num;
+ list->channels = kzalloc(sizeof(struct p54_channel_entry) *
+ max_channel_num, GFP_KERNEL);
+ if (!list->channels)
+ goto free;
+
+ for (i = 0; i < max_channel_num; i++) {
+ if (i < priv->iq_autocal_len) {
+ freq = le16_to_cpu(priv->iq_autocal[i].freq);
+ p54_update_channel_param(list, freq, CHAN_HAS_CAL);
+ }
+
+ if (i < priv->output_limit->entries) {
+ freq = le16_to_cpup((__le16 *) (i *
+ priv->output_limit->entry_size +
+ priv->output_limit->offset +
+ priv->output_limit->data));
+
+ p54_update_channel_param(list, freq, CHAN_HAS_LIMIT);
+ }
+
+ if (i < priv->curve_data->entries) {
+ freq = le16_to_cpup((__le16 *) (i *
+ priv->curve_data->entry_size +
+ priv->curve_data->offset +
+ priv->curve_data->data));
+
+ p54_update_channel_param(list, freq, CHAN_HAS_CURVE);
+ }
+ }
+
+ /* sort the list by the channel index */
+ sort(list->channels, list->entries, sizeof(struct p54_channel_entry),
+ p54_compare_channels, NULL);
+
+ for (i = 0, j = 0; i < IEEE80211_NUM_BANDS; i++) {
+ if (list->band_channel_num[i]) {
+ ret = p54_generate_band(dev, list, i);
+ if (ret)
+ goto free;
+
+ j++;
+ }
+ }
+ if (j == 0) {
+ /* no useable band available. */
+ ret = -EINVAL;
+ }
+
+free:
+ if (list) {
+ kfree(list->channels);
+ kfree(list);
+ }
+
+ return ret;
+}
+
static int p54_convert_rev0(struct ieee80211_hw *dev,
struct pda_pa_curve_data *curve_data)
{
@@ -487,13 +670,19 @@ int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
goto err;
}
+ err = p54_generate_channel_lists(dev);
+ if (err)
+ goto err;
+
priv->rxhw = synth & PDR_SYNTH_FRONTEND_MASK;
if (priv->rxhw == PDR_SYNTH_FRONTEND_XBOW)
p54_init_xbow_synth(priv);
if (!(synth & PDR_SYNTH_24_GHZ_DISABLED))
- dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &band_2GHz;
+ dev->wiphy->bands[IEEE80211_BAND_2GHZ] =
+ priv->band_table[IEEE80211_BAND_2GHZ];
if (!(synth & PDR_SYNTH_5_GHZ_DISABLED))
- dev->wiphy->bands[IEEE80211_BAND_5GHZ] = &band_5GHz;
+ dev->wiphy->bands[IEEE80211_BAND_5GHZ] =
+ priv->band_table[IEEE80211_BAND_5GHZ];
if ((synth & PDR_SYNTH_RX_DIV_MASK) == PDR_SYNTH_RX_DIV_SUPPORTED)
priv->rx_diversity_mask = 3;
if ((synth & PDR_SYNTH_TX_DIV_MASK) == PDR_SYNTH_TX_DIV_SUPPORTED)
diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c
index c9a0545..f19add2 100644
--- a/drivers/net/wireless/p54/main.c
+++ b/drivers/net/wireless/p54/main.c
@@ -598,6 +598,10 @@ EXPORT_SYMBOL_GPL(p54_register_common);
void p54_free_common(struct ieee80211_hw *dev)
{
struct p54_common *priv = dev->priv;
+ unsigned int i;
+
+ for (i = 0; i < IEEE80211_NUM_BANDS; i++)
+ kfree(priv->band_table[i]);
kfree(priv->iq_autocal);
kfree(priv->output_limit);
diff --git a/drivers/net/wireless/p54/p54.h b/drivers/net/wireless/p54/p54.h
index 6772ed5..584b156 100644
--- a/drivers/net/wireless/p54/p54.h
+++ b/drivers/net/wireless/p54/p54.h
@@ -198,6 +198,7 @@ struct p54_common {
struct p54_cal_database *curve_data;
struct p54_cal_database *output_limit;
struct p54_rssi_linear_approximation rssical_db[IEEE80211_NUM_BANDS];
+ struct ieee80211_supported_band *band_table[IEEE80211_NUM_BANDS];
/* BBP/MAC state */
u8 mac_addr[ETH_ALEN];
^ permalink raw reply related
* Re: ieee80211_tx_status() on injected packets
From: Johannes Berg @ 2009-07-10 22:56 UTC (permalink / raw)
To: Pavel Roskin; +Cc: linux-wireless
In-Reply-To: <1247265159.6399.31.camel@mj>
[-- Attachment #1: Type: text/plain, Size: 1492 bytes --]
On Fri, 2009-07-10 at 18:32 -0400, Pavel Roskin wrote:
> /* Original radiotap header, but the length should be 0e, not 18 */
> 00 00 18 00 03 00 00 00 00 02 6c 09 a0 00
Heh.
> /* mac80211 treats this as part of the radiotap header */
> 08 03 00 00 01 0c cc 00 00 00
> /* frame control */
> 00 11
> /* duration */
> 6b 39
> /* addr1 */
> 40 19 11 04 28 00
> /* addr2 */
> 00 00 10 00 00 00
> /* addr3 - incomplete */
> 00 00 00 00
> /* sequence control - beyond the skb end */
>
> I'm using rt73usb to inject. ieee80211_tx_status() is scheduled by
> ieee80211_tx_status_irqsafe(), which is called in rt2x00dev.c.
>
> If we allow to inject malformed packets, we shouldn't assume them to be
> valid 802.11 packets unless we can verify it. And even then, maybe it's
> better to bypass ieee80211_tx_status() for injected packets, as it can
> influence statistics and rate control algorithms in unpredictable ways.
Yeah, we should verify the length. I don't think we can skip the
processing since these packets might actually be sent by hostapd which
wants the processing -- if you fuck up your connection by injecting
random junk that seems to be your own fault, but I agree we should fix
the bug.
It would probably be useful to take the code in ieee80211_tx_status up
to (but not including) the skb_orphan() call, stick it into a separate
function and call it only when at least the frame the header is valid
(i.e. skb->len >= hdrlen).
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* ieee80211_tx_status() on injected packets
From: Pavel Roskin @ 2009-07-10 22:32 UTC (permalink / raw)
To: linux-wireless
Hello!
I've been testing mac80211 with kmemcheck. By injecting specially
crafted packets, I could trigger a warning in ieee80211_tx_status() on
this line:
frag = le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG;
It turns out hdr->seq_ctrl is beyond the end of the skb. Adding printk
confirms it:
hdr=0xffff88012aa04868, &hdr->seq_ctrl=0xffff88012aa0487e,
skb->data=0xffff88012aa04868, skb->data + skb->len=0xffff88012aa0487c
The packets that produce the warning have the radiotap header length
increased by 10.
Here's the annotated dump of the packet:
/* Original radiotap header, but the length should be 0e, not 18 */
00 00 18 00 03 00 00 00 00 02 6c 09 a0 00
/* mac80211 treats this as part of the radiotap header */
08 03 00 00 01 0c cc 00 00 00
/* frame control */
00 11
/* duration */
6b 39
/* addr1 */
40 19 11 04 28 00
/* addr2 */
00 00 10 00 00 00
/* addr3 - incomplete */
00 00 00 00
/* sequence control - beyond the skb end */
I'm using rt73usb to inject. ieee80211_tx_status() is scheduled by
ieee80211_tx_status_irqsafe(), which is called in rt2x00dev.c.
If we allow to inject malformed packets, we shouldn't assume them to be
valid 802.11 packets unless we can verify it. And even then, maybe it's
better to bypass ieee80211_tx_status() for injected packets, as it can
influence statistics and rate control algorithms in unpredictable ways.
--
Regards,
Pavel Roskin
^ permalink raw reply
* [PATCH] cfg80211: fix more bugs in mlme handling
From: Johannes Berg @ 2009-07-10 22:17 UTC (permalink / raw)
To: John Linville; +Cc: Jouni Malinen, linux-wireless
The "what-was-I-thinking-if-anything" patch. Clearly,
if cfg80211_send_disassoc() does wdev_lock() and then
calls __cfg80211_send_disassoc(), the latter shouldn't
lock again. And the sme_state test is ... no further
comments.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/wireless/mlme.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
--- wireless-testing.orig/net/wireless/mlme.c 2009-07-11 00:13:50.000000000 +0200
+++ wireless-testing/net/wireless/mlme.c 2009-07-11 00:14:15.000000000 +0200
@@ -178,12 +178,12 @@ static void __cfg80211_send_disassoc(str
bool from_ap;
bool done = false;
- wdev_lock(wdev);
+ ASSERT_WDEV_LOCK(wdev);
nl80211_send_disassoc(rdev, dev, buf, len, GFP_KERNEL);
- if (!wdev->sme_state == CFG80211_SME_CONNECTED)
- goto out;
+ if (wdev->sme_state != CFG80211_SME_CONNECTED)
+ return;
if (wdev->current_bss &&
memcmp(wdev->current_bss, bssid, ETH_ALEN) == 0) {
@@ -205,8 +205,6 @@ static void __cfg80211_send_disassoc(str
from_ap = memcmp(mgmt->da, dev->dev_addr, ETH_ALEN) == 0;
__cfg80211_disconnected(dev, NULL, 0, reason_code, from_ap);
- out:
- wdev_unlock(wdev);
}
void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len,
^ permalink raw reply
* Re: [PATCH 2.6.31] rfkill: allow toggling soft state in sysfs again
From: Johannes Berg @ 2009-07-10 21:55 UTC (permalink / raw)
To: Darren Salt
Cc: John Linville, Thiemo Nagel, Corentin Chary, debian-eeepc-devel,
acpi4asus-user, linux-wireless, linux-kernel
In-Reply-To: <507E47A184%linux@youmustbejoking.demon.co.uk>
[-- Attachment #1: Type: text/plain, Size: 1315 bytes --]
On Fri, 2009-07-10 at 22:09 +0100, Darren Salt wrote:
> I demand that Johannes Berg may or may not have written...
>
> > Apparently there actually _are_ tools that try to set this in sysfs even
> > though it wasn't supposed to be used this way without claiming first.
>
> Then it should have been documented as such. I don't see anything about this
> in Documentation/rfkill.txt (as found in 2.6.30), other than a vague
> statement that "Kernel handles events", which isn't exactly helpful :-\
Oh, it's not just that rfkill was horrible, the documentation matched :)
All the SHOUTING in it about what you must and must not do but nothing
actually helpful :)
> > *shrug*, I don't like it, but whatever...
>
> I do. It means that we have a nice simple text-based interface for use in
> scripts (for now), and a binary interface which is better suited to the likes
> of desktop applications.
Indeed, and as long as you expect to only use soft toggle... problem is
that you won't know whether it's soft-toggled or not while it's
hard-blocked (off)!
> > Please test & report.
>
> With the patch applied, Bluetooth toggling is working again, so you get to
> add this:
>
> Tested-By: Darren Salt <linux@youmustbejoking.demon.co.uk>
Ok, John, please pick up the patch.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [PATCH 2.6.31] rfkill: allow toggling soft state in sysfs again
From: Darren Salt @ 2009-07-10 21:09 UTC (permalink / raw)
To: Johannes Berg
Cc: John Linville, Thiemo Nagel, Corentin Chary, debian-eeepc-devel,
acpi4asus-user, linux-wireless, linux-kernel
In-Reply-To: <1247254899.21972.9.camel@johannes.local>
I demand that Johannes Berg may or may not have written...
> Apparently there actually _are_ tools that try to set this in sysfs even
> though it wasn't supposed to be used this way without claiming first.
Then it should have been documented as such. I don't see anything about this
in Documentation/rfkill.txt (as found in 2.6.30), other than a vague
statement that "Kernel handles events", which isn't exactly helpful :-\
> Guess what: now that I've cleaned it all up it doesn't matter and we can
> simply allow setting the soft-block state in sysfs.
:-)
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> ---
> *shrug*, I don't like it, but whatever...
I do. It means that we have a nice simple text-based interface for use in
scripts (for now), and a binary interface which is better suited to the likes
of desktop applications.
> Please test & report.
With the patch applied, Bluetooth toggling is working again, so you get to
add this:
Tested-By: Darren Salt <linux@youmustbejoking.demon.co.uk>
[snip]
--
| Darren Salt | linux at youmustbejoking | nr. Ashington, | Doon
| using Debian GNU/Linux | or ds ,demon,co,uk | Northumberland | Army
| + Output *more* particulate pollutants. BUFFER AGAINST GLOBAL WARMING.
For sale: one complete set of hen's teeth.
^ permalink raw reply
* [ANN] iw: v0.9.15
From: wireless @ 2009-07-10 20:53 UTC (permalink / raw)
To: linux-wireless
A new release of iw (v0.9.15) is available at:
http://wireless.kernel.org/download/iw/iw-0.9.15.tar.bz2
SHA1 sum: aa17e4e6d47f934adaa60562695ee0f09216e894
Here is the short log of the changes included in this
release:
Johannes Berg - bump version to 0.9.15
Johannes Berg - print BSS status
Johannes Berg - fix a reason string
Johannes Berg - make connect able to wait
Johannes Berg - remove netns stuff from nl80211.h -- not so soon
Johannes Berg - make it possible to pass WEP keys to connect/join
Johannes Berg - Merge branch 'master' into connect
Johannes Berg - update to experimental nl80211.h
Johannes Berg - fix phy0 autodetection
Johannes Berg - Merge branch 'master' into connect
Johannes Berg - add warning about scripts
Johannes Berg - Merge branch 'master' into connect
Johannes Berg - autodetect interface/phy
Johannes Berg - fix connect help
Johannes Berg - Merge branch 'master' into connect
Johannes Berg - fix version script to include header and not write file twice
Johannes Berg - connect events
Johannes Berg - fix version script to include header and not write file twice
Johannes Berg - note that the bitrates are non-HT
Johannes Berg - update nl80211.h
Johannes Berg - note that the bitrates are non-HT
Johannes Berg - update nl80211.h
Johannes Berg - connect API test
Johannes Berg - print event on scan start
Johannes Berg - fix assoc/auth event parsing
Johannes Berg - "AP setup locked" is a u8 (bool)
Johannes Berg - print scan info on event
Johannes Berg - update nl80211.h
Johannes Berg - sync nl80211.h
Karl Hiramoto - iw/Makefile use pkg-config if passed from environmental var.
^ permalink raw reply
* Re: pull request: wireless-next-2.6 2009-07-10
From: David Miller @ 2009-07-10 20:51 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, netdev
In-Reply-To: <20090710194822.GH2825@tuxdriver.com>
From: "John W. Linville" <linville@tuxdriver.com>
Date: Fri, 10 Jul 2009 15:48:22 -0400
> Here is the usual tsunami of wireless stuff at this stage of the
> development cycle for the next release. Included are the usual
> driver updates (including movement of orinoco towards cfg80211)
> and many mac80211 improvements.
>
> Please let me know if there are problems!
Pulled and pushed back out to kernel.org, thanks!
^ permalink raw reply
* [PATCH] mac80211: fix injection in monitor mode
From: Pavel Roskin @ 2009-07-10 20:42 UTC (permalink / raw)
To: linux-wireless, John W Linville
The location of the 802.11 header is calculated incorrectly due to a
wrong placement of parentheses. Found by kmemcheck.
Signed-off-by: Pavel Roskin <proski@gnu.org>
---
net/mac80211/tx.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 969a4b2..b7e981c 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1407,7 +1407,7 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata,
monitor_iface = UNKNOWN_ADDRESS;
len_rthdr = ieee80211_get_radiotap_len(skb->data);
- hdr = (struct ieee80211_hdr *)skb->data + len_rthdr;
+ hdr = (struct ieee80211_hdr *)(skb->data + len_rthdr);
hdrlen = ieee80211_hdrlen(hdr->frame_control);
/* check the header is complete in the frame */
^ permalink raw reply related
* detecting excessive TX errors?
From: Andrey Yurovsky @ 2009-07-10 20:37 UTC (permalink / raw)
To: linux-wireless
The mesh code provides mesh_plink_broken(), which needs to be called
when we detect excessive TX retries / errors, which indicate that the
current plink is no longer usable. That function will then send a
mesh Path Error as needed. The old rc80211_pid_algo called this but
Minstrel does not, and there are other RC algorithms as well. Is
there a generic and more correct place for us to detect a broken path
and call this function that fits in to the current design? Thanks,
-Andrey
^ permalink raw reply
* [RFT] mac80211: do not use irq locks where not necessary
From: Johannes Berg @ 2009-07-10 20:36 UTC (permalink / raw)
To: linux-wireless
Except for places where we take locks that we need in
functions exported to drivers (which might call them
in interrupt context) we don't need to ever disable
IRQs in mac80211, just softirqs.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
This patch works fine here, and would seem to be correct based on the
description ;) but so far I've only tried with ar9170 (USB) I think.
net/mac80211/key.c | 33 +++++++++---------------
net/mac80211/pm.c | 5 +--
net/mac80211/rc80211_pid_debugfs.c | 15 ++++-------
net/mac80211/sta_info.c | 49 ++++++++++++++-----------------------
net/mac80211/sta_info.h | 33 +++++++++---------------
net/mac80211/tx.c | 11 +++-----
net/mac80211/util.c | 9 +++---
7 files changed, 59 insertions(+), 96 deletions(-)
--- wireless-testing.orig/net/mac80211/key.c 2009-07-10 22:07:58.000000000 +0200
+++ wireless-testing/net/mac80211/key.c 2009-07-10 22:10:31.000000000 +0200
@@ -211,11 +211,9 @@ static void __ieee80211_set_default_key(
void ieee80211_set_default_key(struct ieee80211_sub_if_data *sdata, int idx)
{
- unsigned long flags;
-
- spin_lock_irqsave(&sdata->local->key_lock, flags);
+ spin_lock_bh(&sdata->local->key_lock);
__ieee80211_set_default_key(sdata, idx);
- spin_unlock_irqrestore(&sdata->local->key_lock, flags);
+ spin_unlock_bh(&sdata->local->key_lock);
}
static void
@@ -236,11 +234,9 @@ __ieee80211_set_default_mgmt_key(struct
void ieee80211_set_default_mgmt_key(struct ieee80211_sub_if_data *sdata,
int idx)
{
- unsigned long flags;
-
- spin_lock_irqsave(&sdata->local->key_lock, flags);
+ spin_lock_bh(&sdata->local->key_lock);
__ieee80211_set_default_mgmt_key(sdata, idx);
- spin_unlock_irqrestore(&sdata->local->key_lock, flags);
+ spin_unlock_bh(&sdata->local->key_lock);
}
@@ -386,7 +382,6 @@ void ieee80211_key_link(struct ieee80211
struct sta_info *sta)
{
struct ieee80211_key *old_key;
- unsigned long flags;
int idx;
BUG_ON(!sdata);
@@ -430,7 +425,7 @@ void ieee80211_key_link(struct ieee80211
}
}
- spin_lock_irqsave(&sdata->local->key_lock, flags);
+ spin_lock_bh(&sdata->local->key_lock);
if (sta)
old_key = sta->key;
@@ -446,7 +441,7 @@ void ieee80211_key_link(struct ieee80211
if (netif_running(sdata->dev))
add_todo(key, KEY_FLAG_TODO_HWACCEL_ADD);
- spin_unlock_irqrestore(&sdata->local->key_lock, flags);
+ spin_unlock_bh(&sdata->local->key_lock);
}
static void __ieee80211_key_free(struct ieee80211_key *key)
@@ -463,8 +458,6 @@ static void __ieee80211_key_free(struct
void ieee80211_key_free(struct ieee80211_key *key)
{
- unsigned long flags;
-
if (!key)
return;
@@ -477,9 +470,9 @@ void ieee80211_key_free(struct ieee80211
return;
}
- spin_lock_irqsave(&key->sdata->local->key_lock, flags);
+ spin_lock_bh(&key->sdata->local->key_lock);
__ieee80211_key_free(key);
- spin_unlock_irqrestore(&key->sdata->local->key_lock, flags);
+ spin_unlock_bh(&key->sdata->local->key_lock);
}
/*
@@ -493,14 +486,13 @@ static void ieee80211_todo_for_each_key(
u32 todo_flags)
{
struct ieee80211_key *key;
- unsigned long flags;
might_sleep();
- spin_lock_irqsave(&sdata->local->key_lock, flags);
+ spin_lock_bh(&sdata->local->key_lock);
list_for_each_entry(key, &sdata->key_list, list)
add_todo(key, todo_flags);
- spin_unlock_irqrestore(&sdata->local->key_lock, flags);
+ spin_unlock_bh(&sdata->local->key_lock);
ieee80211_key_todo();
}
@@ -608,17 +600,16 @@ void ieee80211_key_todo(void)
void ieee80211_free_keys(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_key *key, *tmp;
- unsigned long flags;
ieee80211_key_lock();
ieee80211_debugfs_key_remove_default(sdata);
ieee80211_debugfs_key_remove_mgmt_default(sdata);
- spin_lock_irqsave(&sdata->local->key_lock, flags);
+ spin_lock_bh(&sdata->local->key_lock);
list_for_each_entry_safe(key, tmp, &sdata->key_list, list)
__ieee80211_key_free(key);
- spin_unlock_irqrestore(&sdata->local->key_lock, flags);
+ spin_unlock_bh(&sdata->local->key_lock);
__ieee80211_key_todo();
--- wireless-testing.orig/net/mac80211/pm.c 2009-07-10 22:07:58.000000000 +0200
+++ wireless-testing/net/mac80211/pm.c 2009-07-10 22:10:31.000000000 +0200
@@ -12,7 +12,6 @@ int __ieee80211_suspend(struct ieee80211
struct ieee80211_sub_if_data *sdata;
struct ieee80211_if_init_conf conf;
struct sta_info *sta;
- unsigned long flags;
ieee80211_scan_cancel(local);
@@ -65,7 +64,7 @@ int __ieee80211_suspend(struct ieee80211
}
/* remove STAs */
- spin_lock_irqsave(&local->sta_lock, flags);
+ spin_lock_bh(&local->sta_lock);
list_for_each_entry(sta, &local->sta_list, list) {
if (local->ops->sta_notify) {
sdata = sta->sdata;
@@ -80,7 +79,7 @@ int __ieee80211_suspend(struct ieee80211
mesh_plink_quiesce(sta);
}
- spin_unlock_irqrestore(&local->sta_lock, flags);
+ spin_unlock_bh(&local->sta_lock);
/* remove all interfaces */
list_for_each_entry(sdata, &local->interfaces, list) {
--- wireless-testing.orig/net/mac80211/rc80211_pid_debugfs.c 2009-07-10 22:07:58.000000000 +0200
+++ wireless-testing/net/mac80211/rc80211_pid_debugfs.c 2009-07-10 22:10:31.000000000 +0200
@@ -22,9 +22,8 @@ static void rate_control_pid_event(struc
union rc_pid_event_data *data)
{
struct rc_pid_event *ev;
- unsigned long status;
- spin_lock_irqsave(&buf->lock, status);
+ spin_lock_bh(&buf->lock);
ev = &(buf->ring[buf->next_entry]);
buf->next_entry = (buf->next_entry + 1) % RC_PID_EVENT_RING_SIZE;
@@ -33,7 +32,7 @@ static void rate_control_pid_event(struc
ev->type = type;
ev->data = *data;
- spin_unlock_irqrestore(&buf->lock, status);
+ spin_unlock_bh(&buf->lock);
wake_up_all(&buf->waitqueue);
}
@@ -86,19 +85,18 @@ static int rate_control_pid_events_open(
struct rc_pid_sta_info *sinfo = inode->i_private;
struct rc_pid_event_buffer *events = &sinfo->events;
struct rc_pid_events_file_info *file_info;
- unsigned long status;
/* Allocate a state struct */
file_info = kmalloc(sizeof(*file_info), GFP_KERNEL);
if (file_info == NULL)
return -ENOMEM;
- spin_lock_irqsave(&events->lock, status);
+ spin_lock_bh(&events->lock);
file_info->next_entry = events->next_entry;
file_info->events = events;
- spin_unlock_irqrestore(&events->lock, status);
+ spin_unlock_bh(&events->lock);
file->private_data = file_info;
@@ -136,7 +134,6 @@ static ssize_t rate_control_pid_events_r
char pb[RC_PID_PRINT_BUF_SIZE];
int ret;
int p;
- unsigned long status;
/* Check if there is something to read. */
if (events->next_entry == file_info->next_entry) {
@@ -153,7 +150,7 @@ static ssize_t rate_control_pid_events_r
/* Write out one event per call. I don't care whether it's a little
* inefficient, this is debugging code anyway. */
- spin_lock_irqsave(&events->lock, status);
+ spin_lock_bh(&events->lock);
/* Get an event */
ev = &(events->ring[file_info->next_entry]);
@@ -188,7 +185,7 @@ static ssize_t rate_control_pid_events_r
}
p += snprintf(pb + p, length - p, "\n");
- spin_unlock_irqrestore(&events->lock, status);
+ spin_unlock_bh(&events->lock);
if (copy_to_user(buf, pb, p))
return -EFAULT;
--- wireless-testing.orig/net/mac80211/sta_info.c 2009-07-10 22:07:58.000000000 +0200
+++ wireless-testing/net/mac80211/sta_info.c 2009-07-10 22:10:31.000000000 +0200
@@ -322,7 +322,6 @@ int sta_info_insert(struct sta_info *sta
{
struct ieee80211_local *local = sta->local;
struct ieee80211_sub_if_data *sdata = sta->sdata;
- unsigned long flags;
int err = 0;
/*
@@ -341,10 +340,10 @@ int sta_info_insert(struct sta_info *sta
goto out_free;
}
- spin_lock_irqsave(&local->sta_lock, flags);
+ spin_lock_bh(&local->sta_lock);
/* check if STA exists already */
if (sta_info_get(local, sta->sta.addr)) {
- spin_unlock_irqrestore(&local->sta_lock, flags);
+ spin_unlock_bh(&local->sta_lock);
err = -EEXIST;
goto out_free;
}
@@ -367,7 +366,7 @@ int sta_info_insert(struct sta_info *sta
wiphy_name(local->hw.wiphy), sta->sta.addr);
#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
- spin_unlock_irqrestore(&local->sta_lock, flags);
+ spin_unlock_bh(&local->sta_lock);
#ifdef CONFIG_MAC80211_DEBUGFS
/*
@@ -424,13 +423,11 @@ static void __sta_info_set_tim_bit(struc
void sta_info_set_tim_bit(struct sta_info *sta)
{
- unsigned long flags;
-
BUG_ON(!sta->sdata->bss);
- spin_lock_irqsave(&sta->local->sta_lock, flags);
+ spin_lock_bh(&sta->local->sta_lock);
__sta_info_set_tim_bit(sta->sdata->bss, sta);
- spin_unlock_irqrestore(&sta->local->sta_lock, flags);
+ spin_unlock_bh(&sta->local->sta_lock);
}
static void __sta_info_clear_tim_bit(struct ieee80211_if_ap *bss,
@@ -449,13 +446,11 @@ static void __sta_info_clear_tim_bit(str
void sta_info_clear_tim_bit(struct sta_info *sta)
{
- unsigned long flags;
-
BUG_ON(!sta->sdata->bss);
- spin_lock_irqsave(&sta->local->sta_lock, flags);
+ spin_lock_bh(&sta->local->sta_lock);
__sta_info_clear_tim_bit(sta->sdata->bss, sta);
- spin_unlock_irqrestore(&sta->local->sta_lock, flags);
+ spin_unlock_bh(&sta->local->sta_lock);
}
static void __sta_info_unlink(struct sta_info **sta)
@@ -546,11 +541,10 @@ static void __sta_info_unlink(struct sta
void sta_info_unlink(struct sta_info **sta)
{
struct ieee80211_local *local = (*sta)->local;
- unsigned long flags;
- spin_lock_irqsave(&local->sta_lock, flags);
+ spin_lock_bh(&local->sta_lock);
__sta_info_unlink(sta);
- spin_unlock_irqrestore(&local->sta_lock, flags);
+ spin_unlock_bh(&local->sta_lock);
}
static int sta_info_buffer_expired(struct sta_info *sta,
@@ -577,7 +571,6 @@ static int sta_info_buffer_expired(struc
static void sta_info_cleanup_expire_buffered(struct ieee80211_local *local,
struct sta_info *sta)
{
- unsigned long flags;
struct sk_buff *skb;
struct ieee80211_sub_if_data *sdata;
@@ -585,13 +578,13 @@ static void sta_info_cleanup_expire_buff
return;
for (;;) {
- spin_lock_irqsave(&sta->ps_tx_buf.lock, flags);
+ spin_lock_bh(&sta->ps_tx_buf.lock);
skb = skb_peek(&sta->ps_tx_buf);
if (sta_info_buffer_expired(sta, skb))
skb = __skb_dequeue(&sta->ps_tx_buf);
else
skb = NULL;
- spin_unlock_irqrestore(&sta->ps_tx_buf.lock, flags);
+ spin_unlock_bh(&sta->ps_tx_buf.lock);
if (!skb)
break;
@@ -646,15 +639,14 @@ static void __sta_info_pin(struct sta_in
static struct sta_info *__sta_info_unpin(struct sta_info *sta)
{
struct sta_info *ret = NULL;
- unsigned long flags;
- spin_lock_irqsave(&sta->local->sta_lock, flags);
+ spin_lock_bh(&sta->local->sta_lock);
WARN_ON(sta->pin_status != STA_INFO_PIN_STAT_DESTROY &&
sta->pin_status != STA_INFO_PIN_STAT_PINNED);
if (sta->pin_status == STA_INFO_PIN_STAT_DESTROY)
ret = sta;
sta->pin_status = STA_INFO_PIN_STAT_NORMAL;
- spin_unlock_irqrestore(&sta->local->sta_lock, flags);
+ spin_unlock_bh(&sta->local->sta_lock);
return ret;
}
@@ -664,14 +656,13 @@ static void sta_info_debugfs_add_work(st
struct ieee80211_local *local =
container_of(work, struct ieee80211_local, sta_debugfs_add);
struct sta_info *sta, *tmp;
- unsigned long flags;
/* We need to keep the RTNL across the whole pinned status. */
rtnl_lock();
while (1) {
sta = NULL;
- spin_lock_irqsave(&local->sta_lock, flags);
+ spin_lock_bh(&local->sta_lock);
list_for_each_entry(tmp, &local->sta_list, list) {
/*
* debugfs.add_has_run will be set by
@@ -684,7 +675,7 @@ static void sta_info_debugfs_add_work(st
break;
}
}
- spin_unlock_irqrestore(&local->sta_lock, flags);
+ spin_unlock_bh(&local->sta_lock);
if (!sta)
break;
@@ -750,11 +741,10 @@ int sta_info_flush(struct ieee80211_loca
struct sta_info *sta, *tmp;
LIST_HEAD(tmp_list);
int ret = 0;
- unsigned long flags;
might_sleep();
- spin_lock_irqsave(&local->sta_lock, flags);
+ spin_lock_bh(&local->sta_lock);
list_for_each_entry_safe(sta, tmp, &local->sta_list, list) {
if (!sdata || sdata == sta->sdata) {
__sta_info_unlink(&sta);
@@ -764,7 +754,7 @@ int sta_info_flush(struct ieee80211_loca
}
}
}
- spin_unlock_irqrestore(&local->sta_lock, flags);
+ spin_unlock_bh(&local->sta_lock);
list_for_each_entry_safe(sta, tmp, &tmp_list, list)
sta_info_destroy(sta);
@@ -778,9 +768,8 @@ void ieee80211_sta_expire(struct ieee802
struct ieee80211_local *local = sdata->local;
struct sta_info *sta, *tmp;
LIST_HEAD(tmp_list);
- unsigned long flags;
- spin_lock_irqsave(&local->sta_lock, flags);
+ spin_lock_bh(&local->sta_lock);
list_for_each_entry_safe(sta, tmp, &local->sta_list, list)
if (time_after(jiffies, sta->last_rx + exp_time)) {
#ifdef CONFIG_MAC80211_IBSS_DEBUG
@@ -791,7 +780,7 @@ void ieee80211_sta_expire(struct ieee802
if (sta)
list_add(&sta->list, &tmp_list);
}
- spin_unlock_irqrestore(&local->sta_lock, flags);
+ spin_unlock_bh(&local->sta_lock);
list_for_each_entry_safe(sta, tmp, &tmp_list, list)
sta_info_destroy(sta);
--- wireless-testing.orig/net/mac80211/sta_info.h 2009-07-10 22:07:58.000000000 +0200
+++ wireless-testing/net/mac80211/sta_info.h 2009-07-10 22:10:31.000000000 +0200
@@ -343,41 +343,34 @@ static inline enum plink_state sta_plink
static inline void set_sta_flags(struct sta_info *sta, const u32 flags)
{
- unsigned long irqfl;
-
- spin_lock_irqsave(&sta->flaglock, irqfl);
+ spin_lock_bh(&sta->flaglock);
sta->flags |= flags;
- spin_unlock_irqrestore(&sta->flaglock, irqfl);
+ spin_unlock_bh(&sta->flaglock);
}
static inline void clear_sta_flags(struct sta_info *sta, const u32 flags)
{
- unsigned long irqfl;
-
- spin_lock_irqsave(&sta->flaglock, irqfl);
+ spin_lock_bh(&sta->flaglock);
sta->flags &= ~flags;
- spin_unlock_irqrestore(&sta->flaglock, irqfl);
+ spin_unlock_bh(&sta->flaglock);
}
static inline void set_and_clear_sta_flags(struct sta_info *sta,
const u32 set, const u32 clear)
{
- unsigned long irqfl;
-
- spin_lock_irqsave(&sta->flaglock, irqfl);
+ spin_lock_bh(&sta->flaglock);
sta->flags |= set;
sta->flags &= ~clear;
- spin_unlock_irqrestore(&sta->flaglock, irqfl);
+ spin_unlock_bh(&sta->flaglock);
}
static inline u32 test_sta_flags(struct sta_info *sta, const u32 flags)
{
u32 ret;
- unsigned long irqfl;
- spin_lock_irqsave(&sta->flaglock, irqfl);
+ spin_lock_bh(&sta->flaglock);
ret = sta->flags & flags;
- spin_unlock_irqrestore(&sta->flaglock, irqfl);
+ spin_unlock_bh(&sta->flaglock);
return ret;
}
@@ -386,12 +379,11 @@ static inline u32 test_and_clear_sta_fla
const u32 flags)
{
u32 ret;
- unsigned long irqfl;
- spin_lock_irqsave(&sta->flaglock, irqfl);
+ spin_lock_bh(&sta->flaglock);
ret = sta->flags & flags;
sta->flags &= ~flags;
- spin_unlock_irqrestore(&sta->flaglock, irqfl);
+ spin_unlock_bh(&sta->flaglock);
return ret;
}
@@ -399,11 +391,10 @@ static inline u32 test_and_clear_sta_fla
static inline u32 get_sta_flags(struct sta_info *sta)
{
u32 ret;
- unsigned long irqfl;
- spin_lock_irqsave(&sta->flaglock, irqfl);
+ spin_lock_bh(&sta->flaglock);
ret = sta->flags;
- spin_unlock_irqrestore(&sta->flaglock, irqfl);
+ spin_unlock_bh(&sta->flaglock);
return ret;
}
--- wireless-testing.orig/net/mac80211/tx.c 2009-07-10 22:09:46.000000000 +0200
+++ wireless-testing/net/mac80211/tx.c 2009-07-10 22:10:31.000000000 +0200
@@ -1045,13 +1045,12 @@ ieee80211_tx_prepare(struct ieee80211_su
if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) &&
(local->hw.flags & IEEE80211_HW_AMPDU_AGGREGATION)) {
- unsigned long flags;
struct tid_ampdu_tx *tid_tx;
qc = ieee80211_get_qos_ctl(hdr);
tid = *qc & IEEE80211_QOS_CTL_TID_MASK;
- spin_lock_irqsave(&tx->sta->lock, flags);
+ spin_lock_bh(&tx->sta->lock);
/*
* XXX: This spinlock could be fairly expensive, but see the
* comment in agg-tx.c:ieee80211_agg_tx_operational().
@@ -1075,7 +1074,7 @@ ieee80211_tx_prepare(struct ieee80211_su
info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
__skb_queue_tail(&tid_tx->pending, skb);
}
- spin_unlock_irqrestore(&tx->sta->lock, flags);
+ spin_unlock_bh(&tx->sta->lock);
if (unlikely(queued))
return TX_QUEUED;
@@ -2028,11 +2027,9 @@ struct sk_buff *ieee80211_beacon_get(str
if (local->tim_in_locked_section) {
ieee80211_beacon_add_tim(ap, skb, beacon);
} else {
- unsigned long flags;
-
- spin_lock_irqsave(&local->sta_lock, flags);
+ spin_lock_bh(&local->sta_lock);
ieee80211_beacon_add_tim(ap, skb, beacon);
- spin_unlock_irqrestore(&local->sta_lock, flags);
+ spin_unlock_bh(&local->sta_lock);
}
if (beacon->tail)
--- wireless-testing.orig/net/mac80211/util.c 2009-07-10 22:09:46.000000000 +0200
+++ wireless-testing/net/mac80211/util.c 2009-07-10 22:10:31.000000000 +0200
@@ -960,7 +960,6 @@ int ieee80211_reconfig(struct ieee80211_
struct ieee80211_sub_if_data *sdata;
struct ieee80211_if_init_conf conf;
struct sta_info *sta;
- unsigned long flags;
int res;
bool from_suspend = local->suspended;
@@ -991,7 +990,7 @@ int ieee80211_reconfig(struct ieee80211_
/* add STAs back */
if (local->ops->sta_notify) {
- spin_lock_irqsave(&local->sta_lock, flags);
+ spin_lock_bh(&local->sta_lock);
list_for_each_entry(sta, &local->sta_list, list) {
sdata = sta->sdata;
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
@@ -1002,7 +1001,7 @@ int ieee80211_reconfig(struct ieee80211_
drv_sta_notify(local, &sdata->vif, STA_NOTIFY_ADD,
&sta->sta);
}
- spin_unlock_irqrestore(&local->sta_lock, flags);
+ spin_unlock_bh(&local->sta_lock);
}
/* Clear Suspend state so that ADDBA requests can be processed */
@@ -1092,10 +1091,10 @@ int ieee80211_reconfig(struct ieee80211_
add_timer(&local->sta_cleanup);
- spin_lock_irqsave(&local->sta_lock, flags);
+ spin_lock_bh(&local->sta_lock);
list_for_each_entry(sta, &local->sta_list, list)
mesh_plink_restart(sta);
- spin_unlock_irqrestore(&local->sta_lock, flags);
+ spin_unlock_bh(&local->sta_lock);
#else
WARN_ON(1);
#endif
^ permalink raw reply
* pull request: wireless-next-2.6 2009-07-10
From: John W. Linville @ 2009-07-10 19:48 UTC (permalink / raw)
To: davem; +Cc: linux-wireless, netdev
Dave,
Here is the usual tsunami of wireless stuff at this stage of the
development cycle for the next release. Included are the usual
driver updates (including movement of orinoco towards cfg80211)
and many mac80211 improvements.
Please let me know if there are problems!
Thanks,
John
---
Individual patches are available here:
http://www.kernel.org/pub/linux/kernel/people/linville/wireless-next-2.6/
---
The following changes since commit e5a8a896f5180f2950695d2d0b79db348d200ca4:
David S. Miller (1):
Merge branch 'master' of master.kernel.org:/.../davem/net-2.6
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6.git master
Andrey Yurovsky (4):
libertas: remove ps_supported flag, use fwcapinfo
libertas: copy WPA keys to priv when associating
libertas: correct card cleanup order in SPI driver
libertas: fix card cleanup order in SDIO driver
Ari Kauppi (2):
wl12xx: Fix incorrect warning message.
wl12xx: Fix CMD_TEST regression via netlink.
Bob Copeland (7):
ath5k: cleanup ath5k_hw struct
ath5k: enable hardware LEDs
ath5k: send buffered frames after the beacon
ath5k: rework beacon configuration
ath: remove unnecessary return in ath_regd_get_band_ctl
ath5k: do not release irq across suspend/resume
ath5k: write PCU registers on initial reset
Christian Lamparter (14):
ar9170usb: module link in sysfs
p54: redo rx_status into skb->cb
p54: Move eeprom code
p54: Move eeprom header
p54: Move firmware code
p54: Move LED code
p54: Move LMAC interface definitions
p54: Move mac80211 glue code
p54: Move TX/RX code
p54: Modify p54 files for new organization
p54: two endian fixes
p54spi: remove dead code and definitions
p54usb: fix stalls caused by urb allocation failures
p54: fix queue stall due to underrun
David Kilroy (24):
cfg80211: add wrapper function to get wiphy from priv pointer
cfg80211: Advertise ciphers via WE according to driver capability
cfg80211: allow drivers that can't scan for specific ssids
cfg80211: set WE encoding size based on available ciphers
cfg80211: infer WPA and WPA2 support from TKIP and CCMP
orinoco: Move firmware capability determination into hw.c
orinoco: Move card reading code into hw.c
orinoco: Move FID allocation to hw.c
orinoco: use dev_err in early initialisation routines
orinoco: firmware helpers should use dev_err and friends
orinoco: Replace net_device with orinoco_private in driver interfaces
orinoco: initialise independently of netdev
orinoco: Change set_tkip to use orinoco_private instead of hermes_t
orinoco: initiate cfg80211 conversion
orinoco: make firmware download less verbose
orinoco: move netdev interface creation to main driver
airport: store irq in card private structure
orinoco: Handle suspend/restore in core driver
orinoco: provide generic commit function
orinoco: convert mode setting to cfg80211
orinoco: convert scanning to cfg80211
orinoco: convert giwrange to cfg80211
orinoco: remove WE nickname support
orinoco: fix printk format specifier for size_t arguments
Gabor Juhos (2):
ath9k: remove unnecessary clearing of SC_OP_WAIT_{BEACON,CAB} flags
ath9k: remove ath_rx_ps_back_to_sleep helper
Helmut Schaa (1):
mac80211: shorten the passive dwell time for sw scans
Hin-Tak Leung (1):
zd1211rw: sort vid/pid pairs by numerical value
Ivo van Doorn (1):
rt2x00: use wiphy rfkill interface
Jiri Slaby (2):
ath5k: remove permissions from debugfs files
ath9k: remove permissions from debugfs files
Joe Perches (2):
drivers/net/wireless: Use PCI_VDEVICE
drivers/net/wireless/ath/ath9k: Remove unnecessary semicolons
Johannes Berg (54):
cfg80211: pass netdev to change_virtual_intf
cfg80211: issue netlink notification when scan starts
rt2x00: remove skb->do_not_encrypt usage
mac80211: push rx status into skb->cb
mac80211: improve per-sta debugfs
cfg80211: prohibit scanning the same channel more than once
mac80211_hwsim: clean up the skb before passing it back
cfg80211: send wext MLME-MICHAELMICFAILURE.indication
wext: allow returning NULL stats
mac80211: fix todo lock
wext: default to y
cfg80211: move break statement to correct place
nl80211: clean up function definitions
cfg80211: use proper allocation flags
cfg80211: remove wireless_dev->bssid
mac80211: tell SME about real auth state
wext: constify extra argument to wireless_send_event
cfg80211: introduce nl80211 testmode command
mac80211: remove an unused function declaration
wireless: define AKM suites
cfg80211: emulate connect with auth/assoc
cfg80211: managed mode wext compatibility
cfg80211: implement iwpower
cfg80211: implement IWAP for WDS
cfg80211: implement IWRATE
cfg80211: implement get_wireless_stats
mac80211: re-add HT disabling
mac80211: remove auth algorithm retry
mac80211: remove dead code, clean up
cfg80211: send events for userspace SME
cfg80211: reset auth algorithm
cfg80211: assimilate and export ieee80211_bss_get_ie
cfg80211: keep track of BSSes
cfg80211: refuse authenticating to same BSSID twice
nl80211: limit to one pairwise cipher for associate()
cfg80211: fix giwrange
iwlwifi: make software queue assignment more efficient
iwlwifi: scan requested channels only
iwlwifi: fix aggregation limit
rfkill: prep for rfkill API changes
cfg80211: let SME control reassociation vs. association
mac80211: remove dead code from mlme
mac80211: rework MLME for multiple authentications
mac80211: refactor the WEP code to be directly usable
cfg80211: fix netdev down problem
cfg80211: dont use union for wext
cfg80211: mlme API must be able to sleep
cfg80211: warn again on spurious deauth
cfg80211: properly name driver locking
cfg80211: fix MFP bug, sparse warnings
cfg80211: fix locking
cfg80211: clean up naming once and for all
cfg80211: disallow configuring unsupported interfaces
hwsim: make testmode_cmd static
John W. Linville (1):
mac80211_hwsim: fix-up build damage from removal of skb->dst
Jussi Kivilinna (3):
rndis_wlan: convert get/set frag/rts to cfg80211
usbnet: Add stop function pointer to 'struct rndis_data'.
rndis_wlan: convert set/get txpower to cfg80211
Juuso Oikarinen (4):
wl12xx: removed chipset interrupt source configuration from fw wakeup
wl12xx: Moved wl1251 TX path implementation into chip specific files
wl12xx: Add support for block reading from a fixed register address
wl12xx: Use chipset specific join commands
Kalle Valo (20):
wl12xx: cmd and acx interface rework
wl12xx: reserver buffer for read32()/write32() in struct wl12xx
wl12xx: fix error handling in wl12xx_probe()
wl12xx: reserve buffer for partition command in struct wl12xx
wl12xx: allocate buffer spi read/write command buffer kzalloc()
wl12xx: allocate buffer the spi busy word from struct wl12xx
wl12xx: use wl12xx_mem_read32() to read the rx counter
wl12xx: fix rx descriptor use
wl12xx: protect wl12xx_op_set_rts_threshold()
wl12xx: optimise elp wakeup and sleep calls
wl12xx: check if elp wakeup failed
wl12xx: enable ELP mode
wl12xx: rename wl1251.c wl1251_ops.c
wl12xx: rename driver to wl1251
wl1251: remove wl1271_setup()
wl1251: add wl1251 prefix to all 1251 files
wl1251: rename wl12xx.h to wl1251.h
wl12xx: remove unused wl12xx_hw_init_mem_config()
wl1251: use wl1251 prefix everywhere
wl1251: fix a checkpatch warning
Luciano Coelho (6):
wl12xx: add wl12xx_spi_reg_read() and wl12xx_spi_reg_write() functions
wl12xx: moved firmware version reading routine to chip-specific functions
wl12xx: add support for new WL1271 chip revision
wl12xx: add support for fixed address in wl12xx_spi_read
wl12xx: pass the wake up condition when configuring the wake up event
wl1251: change psm enabled/disabled info to debug
Luis R. Rodriguez (1):
ath9k: differentiate quality reporting between legacy and HT configurations
Mohamed Abbas (1):
iwlwifi: Check HW ready before prepare card.
Reinette Chatre (3):
iwlagn: re-enable PS support for iwlagn
iwlwifi: add utility to print buffer when error occurs
iwlwifi: always print buffer when error condition occurs
Roel Kluin (1):
wireless: remove redundant tests on unsigned
Samuel Ortiz (6):
iwmc3200wifi: invalidate keys when changing the BSSID
iwmc3200wifi: handling wifi_if_ntfy responses
iwmc3200wifi: cfg80211 key hooks implemetation
iwmc3200wifi: cache keys when interface is down
cfg80211: connect/disconnect API
cfg80211: check for current_bss from giwrate
Senthil Balasubramanian (4):
ath9k: remove unnecessary STATION mode check.
ath9k: stop ani when the STA gets disconnected.
ath9k: race condition in SCANNING state check during ANI calibration
ath9k: Handle different TX and RX streams properly.
Tomas Winkler (2):
iwlwifi: drop sw_crypto from hw_params.
iwlwifi: unify iwl_setup_rxon_timing
Vasanthakumar Thiagarajan (4):
ath9k: Nuke unneccesary helper function to see if aggr is active
ath9k: Remove unnecessary count for addba attempt
ath9k: downgrade ASSERT() in ath_clone_txbuf()
ath9k: Make sure we configure a non-zero beacon interval
Vidhya Govindan (1):
wl12xx: Assign value to rx msdu lifetime variable
Wey-Yi Guy (3):
iwlwifi: modify sensitivity value for 5150
iwlwifi: no need to refer to max_nrg_cck range value
iwlwifi: remove disable_tx_power for device > 4965
Zhu Yi (5):
iwmc3200wifi: change coexist periodic calibration flag
iwmc3200wifi: rfkill cleanup
iwmc3200wifi: replace netif_rx with netif_rx_ni
iwmc3200wifi: simplify calibration map
iwmc3200wifi: remove B0 hardware support
drivers/net/usb/usbnet.c | 14 +
drivers/net/wireless/adm8211.c | 3 +-
drivers/net/wireless/at76c50x-usb.c | 3 +-
drivers/net/wireless/ath/ar9170/main.c | 6 +-
drivers/net/wireless/ath/ar9170/usb.c | 2 +-
drivers/net/wireless/ath/ath5k/ath5k.h | 21 +-
drivers/net/wireless/ath/ath5k/attach.c | 3 +
drivers/net/wireless/ath/ath5k/base.c | 130 +-
drivers/net/wireless/ath/ath5k/base.h | 10 +-
drivers/net/wireless/ath/ath5k/debug.c | 8 +-
drivers/net/wireless/ath/ath5k/phy.c | 7 +-
drivers/net/wireless/ath/ath5k/qcu.c | 1 -
drivers/net/wireless/ath/ath5k/reset.c | 1 -
drivers/net/wireless/ath/ath9k/ath9k.h | 2 +-
drivers/net/wireless/ath/ath9k/beacon.c | 15 +-
drivers/net/wireless/ath/ath9k/debug.c | 10 +-
drivers/net/wireless/ath/ath9k/eeprom.c | 2 -
drivers/net/wireless/ath/ath9k/hw.c | 2 +-
drivers/net/wireless/ath/ath9k/main.c | 62 +-
drivers/net/wireless/ath/ath9k/recv.c | 67 +-
drivers/net/wireless/ath/ath9k/xmit.c | 33 +-
drivers/net/wireless/ath/regd.c | 2 -
drivers/net/wireless/b43/xmit.c | 3 +-
drivers/net/wireless/b43legacy/xmit.c | 3 +-
drivers/net/wireless/ipw2x00/ipw2200.c | 10 +-
drivers/net/wireless/iwlwifi/iwl-3945.c | 6 +-
drivers/net/wireless/iwlwifi/iwl-4965.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-5000.c | 29 +-
drivers/net/wireless/iwlwifi/iwl-agn.c | 74 +-
drivers/net/wireless/iwlwifi/iwl-calib.c | 7 +-
drivers/net/wireless/iwlwifi/iwl-commands.h | 4 +-
drivers/net/wireless/iwlwifi/iwl-core.c | 63 +-
drivers/net/wireless/iwlwifi/iwl-core.h | 3 +-
drivers/net/wireless/iwlwifi/iwl-debug.h | 6 +
drivers/net/wireless/iwlwifi/iwl-debugfs.c | 9 +-
drivers/net/wireless/iwlwifi/iwl-dev.h | 2 +-
drivers/net/wireless/iwlwifi/iwl-rx.c | 5 +-
drivers/net/wireless/iwlwifi/iwl-scan.c | 31 +-
drivers/net/wireless/iwlwifi/iwl-tx.c | 16 +-
drivers/net/wireless/iwlwifi/iwl3945-base.c | 88 +-
drivers/net/wireless/iwmc3200wifi/cfg80211.c | 235 ++-
drivers/net/wireless/iwmc3200wifi/commands.c | 116 +-
drivers/net/wireless/iwmc3200wifi/commands.h | 7 +-
drivers/net/wireless/iwmc3200wifi/eeprom.c | 4 -
drivers/net/wireless/iwmc3200wifi/fw.c | 21 +-
drivers/net/wireless/iwmc3200wifi/iwm.h | 32 +-
drivers/net/wireless/iwmc3200wifi/lmac.h | 4 +
drivers/net/wireless/iwmc3200wifi/main.c | 38 +-
drivers/net/wireless/iwmc3200wifi/netdev.c | 27 +-
drivers/net/wireless/iwmc3200wifi/rx.c | 36 +-
drivers/net/wireless/iwmc3200wifi/sdio.c | 6 +-
drivers/net/wireless/iwmc3200wifi/umac.h | 2 +
drivers/net/wireless/iwmc3200wifi/wext.c | 352 +---
drivers/net/wireless/libertas/assoc.c | 6 +
drivers/net/wireless/libertas/dev.h | 1 -
drivers/net/wireless/libertas/if_cs.c | 3 -
drivers/net/wireless/libertas/if_sdio.c | 5 +-
drivers/net/wireless/libertas/if_spi.c | 8 +-
drivers/net/wireless/libertas/if_usb.c | 3 +-
drivers/net/wireless/libertas/wext.c | 2 +-
drivers/net/wireless/libertas_tf/main.c | 3 +-
drivers/net/wireless/mac80211_hwsim.c | 81 +-
drivers/net/wireless/mwl8k.c | 3 +-
drivers/net/wireless/orinoco/Kconfig | 1 +
drivers/net/wireless/orinoco/Makefile | 2 +-
drivers/net/wireless/orinoco/airport.c | 98 +-
drivers/net/wireless/orinoco/cfg.c | 162 ++
drivers/net/wireless/orinoco/cfg.h | 15 +
drivers/net/wireless/orinoco/fw.c | 41 +-
drivers/net/wireless/orinoco/hermes.c | 2 +-
drivers/net/wireless/orinoco/hermes.h | 2 +-
drivers/net/wireless/orinoco/hermes_dld.c | 50 +-
drivers/net/wireless/orinoco/hw.c | 668 +++++-
drivers/net/wireless/orinoco/hw.h | 11 +-
drivers/net/wireless/orinoco/main.c | 1133 +++------
drivers/net/wireless/orinoco/main.h | 3 +-
drivers/net/wireless/orinoco/orinoco.h | 49 +-
drivers/net/wireless/orinoco/orinoco_cs.c | 96 +-
drivers/net/wireless/orinoco/orinoco_nortel.c | 38 +-
drivers/net/wireless/orinoco/orinoco_pci.c | 38 +-
drivers/net/wireless/orinoco/orinoco_pci.h | 57 +-
drivers/net/wireless/orinoco/orinoco_plx.c | 38 +-
drivers/net/wireless/orinoco/orinoco_tmd.c | 38 +-
drivers/net/wireless/orinoco/scan.c | 291 ++--
drivers/net/wireless/orinoco/scan.h | 21 +-
drivers/net/wireless/orinoco/spectrum_cs.c | 96 +-
drivers/net/wireless/orinoco/wext.c | 878 +------
drivers/net/wireless/p54/Makefile | 3 +
drivers/net/wireless/p54/eeprom.c | 564 ++++
drivers/net/wireless/p54/eeprom.h | 226 ++
drivers/net/wireless/p54/fwio.c | 698 +++++
drivers/net/wireless/p54/led.c | 163 ++
drivers/net/wireless/p54/lmac.h | 551 ++++
drivers/net/wireless/p54/main.c | 607 +++++
drivers/net/wireless/p54/p54.h | 148 +-
drivers/net/wireless/p54/p54common.c | 2688 --------------------
drivers/net/wireless/p54/p54common.h | 644 -----
drivers/net/wireless/p54/p54pci.c | 9 +-
drivers/net/wireless/p54/p54spi.c | 50 +-
drivers/net/wireless/p54/p54usb.c | 42 +-
drivers/net/wireless/p54/txrx.c | 826 ++++++
drivers/net/wireless/prism54/islpci_hotplug.c | 4 +-
drivers/net/wireless/rndis_wlan.c | 298 ++--
drivers/net/wireless/rt2x00/Kconfig | 8 -
drivers/net/wireless/rt2x00/Makefile | 1 -
drivers/net/wireless/rt2x00/rt2400pci.c | 7 +-
drivers/net/wireless/rt2x00/rt2500pci.c | 7 +-
drivers/net/wireless/rt2x00/rt2500usb.c | 7 +-
drivers/net/wireless/rt2x00/rt2800usb.c | 7 +-
drivers/net/wireless/rt2x00/rt2x00.h | 13 +-
drivers/net/wireless/rt2x00/rt2x00crypto.c | 6 +-
drivers/net/wireless/rt2x00/rt2x00dev.c | 5 +-
drivers/net/wireless/rt2x00/rt2x00lib.h | 21 +-
drivers/net/wireless/rt2x00/rt2x00mac.c | 12 +-
drivers/net/wireless/rt2x00/rt2x00rfkill.c | 127 -
drivers/net/wireless/rt2x00/rt61pci.c | 7 +-
drivers/net/wireless/rt2x00/rt73usb.c | 7 +-
drivers/net/wireless/rtl818x/rtl8180_dev.c | 5 +-
drivers/net/wireless/rtl818x/rtl8187_dev.c | 3 +-
drivers/net/wireless/wl12xx/Kconfig | 17 +-
drivers/net/wireless/wl12xx/Makefile | 9 +-
drivers/net/wireless/wl12xx/acx.c | 689 -----
drivers/net/wireless/wl12xx/cmd.c | 353 ---
drivers/net/wireless/wl12xx/reg.h | 1 -
drivers/net/wireless/wl12xx/wl1251.h | 479 +++-
drivers/net/wireless/wl12xx/wl1251_acx.c | 840 ++++++
.../net/wireless/wl12xx/{acx.h => wl1251_acx.h} | 199 +--
.../net/wireless/wl12xx/{boot.c => wl1251_boot.c} | 114 +-
.../net/wireless/wl12xx/{boot.h => wl1251_boot.h} | 12 +-
drivers/net/wireless/wl12xx/wl1251_cmd.c | 428 ++++
.../net/wireless/wl12xx/{cmd.h => wl1251_cmd.h} | 194 ++-
.../wl12xx/{debugfs.c => wl1251_debugfs.c} | 60 +-
.../wl12xx/{debugfs.h => wl1251_debugfs.h} | 16 +-
.../wireless/wl12xx/{event.c => wl1251_event.c} | 54 +-
.../wireless/wl12xx/{event.h => wl1251_event.h} | 12 +-
.../net/wireless/wl12xx/{init.c => wl1251_init.c} | 78 +-
.../net/wireless/wl12xx/{init.h => wl1251_init.h} | 27 +-
.../net/wireless/wl12xx/{main.c => wl1251_main.c} | 638 +++--
drivers/net/wireless/wl12xx/wl1251_netlink.c | 679 +++++
.../wl12xx/{debugfs.h => wl1251_netlink.h} | 15 +-
.../net/wireless/wl12xx/{wl1251.c => wl1251_ops.c} | 297 ++-
drivers/net/wireless/wl12xx/wl1251_ops.h | 165 ++
drivers/net/wireless/wl12xx/{ps.c => wl1251_ps.c} | 64 +-
drivers/net/wireless/wl12xx/{ps.h => wl1251_ps.h} | 18 +-
drivers/net/wireless/wl12xx/{rx.c => wl1251_rx.c} | 90 +-
drivers/net/wireless/wl12xx/{rx.h => wl1251_rx.h} | 22 +-
.../net/wireless/wl12xx/{spi.c => wl1251_spi.c} | 179 +-
.../net/wireless/wl12xx/{spi.h => wl1251_spi.h} | 62 +-
drivers/net/wireless/wl12xx/{tx.c => wl1251_tx.c} | 124 +-
drivers/net/wireless/wl12xx/{tx.h => wl1251_tx.h} | 21 +-
drivers/net/wireless/wl12xx/wl12xx.h | 409 ---
drivers/net/wireless/zd1211rw/zd_mac.c | 3 +-
drivers/net/wireless/zd1211rw/zd_usb.c | 73 +-
drivers/staging/agnx/xmit.c | 3 +-
drivers/staging/stlc45xx/stlc45xx.c | 3 +-
drivers/staging/winbond/wb35rx.c | 3 +-
include/linux/ieee80211.h | 4 +
include/linux/nl80211.h | 96 +
include/linux/rfkill.h | 14 +
include/linux/usb/usbnet.h | 3 +
include/net/cfg80211.h | 460 +++-
include/net/iw_handler.h | 2 +-
include/net/mac80211.h | 34 +-
net/mac80211/Kconfig | 16 -
net/mac80211/cfg.c | 216 +-
net/mac80211/debugfs_netdev.c | 46 -
net/mac80211/debugfs_sta.c | 98 +-
net/mac80211/event.c | 23 +-
net/mac80211/ibss.c | 6 +-
net/mac80211/ieee80211_i.h | 148 +-
net/mac80211/iface.c | 30 +-
net/mac80211/key.c | 28 +-
net/mac80211/main.c | 5 +-
net/mac80211/mesh.c | 6 +-
net/mac80211/mesh.h | 3 +-
net/mac80211/mlme.c | 1637 +++++-------
net/mac80211/rx.c | 103 +-
net/mac80211/scan.c | 29 +-
net/mac80211/sta_info.h | 17 +
net/mac80211/wep.c | 52 +-
net/mac80211/wep.h | 4 -
net/mac80211/wext.c | 450 +---
net/mac80211/wpa.c | 3 +-
net/rfkill/core.c | 10 +-
net/wireless/Kconfig | 43 +-
net/wireless/Makefile | 4 +-
net/wireless/core.c | 385 ++-
net/wireless/core.h | 184 ++-
net/wireless/debugfs.c | 14 +-
net/wireless/debugfs.h | 8 +-
net/wireless/ibss.c | 158 +-
net/wireless/mlme.c | 581 ++++-
net/wireless/nl80211.c | 1110 ++++++---
net/wireless/nl80211.h | 71 +-
net/wireless/reg.c | 48 +-
net/wireless/scan.c | 75 +-
net/wireless/sme.c | 792 ++++++
net/wireless/util.c | 21 +
net/wireless/wext-compat.c | 496 ++++-
net/wireless/wext-sme.c | 380 +++
net/wireless/wext.c | 11 +-
201 files changed, 15590 insertions(+), 12136 deletions(-)
create mode 100644 drivers/net/wireless/orinoco/cfg.c
create mode 100644 drivers/net/wireless/orinoco/cfg.h
create mode 100644 drivers/net/wireless/p54/eeprom.c
create mode 100644 drivers/net/wireless/p54/eeprom.h
create mode 100644 drivers/net/wireless/p54/fwio.c
create mode 100644 drivers/net/wireless/p54/led.c
create mode 100644 drivers/net/wireless/p54/lmac.h
create mode 100644 drivers/net/wireless/p54/main.c
delete mode 100644 drivers/net/wireless/p54/p54common.c
delete mode 100644 drivers/net/wireless/p54/p54common.h
create mode 100644 drivers/net/wireless/p54/txrx.c
delete mode 100644 drivers/net/wireless/rt2x00/rt2x00rfkill.c
delete mode 100644 drivers/net/wireless/wl12xx/acx.c
delete mode 100644 drivers/net/wireless/wl12xx/cmd.c
create mode 100644 drivers/net/wireless/wl12xx/wl1251_acx.c
rename drivers/net/wireless/wl12xx/{acx.h => wl1251_acx.h} (86%)
rename drivers/net/wireless/wl12xx/{boot.c => wl1251_boot.c} (67%)
rename drivers/net/wireless/wl12xx/{boot.h => wl1251_boot.h} (78%)
create mode 100644 drivers/net/wireless/wl12xx/wl1251_cmd.c
rename drivers/net/wireless/wl12xx/{cmd.h => wl1251_cmd.h} (60%)
rename drivers/net/wireless/wl12xx/{debugfs.c => wl1251_debugfs.c} (92%)
copy drivers/net/wireless/wl12xx/{debugfs.h => wl1251_debugfs.h} (74%)
rename drivers/net/wireless/wl12xx/{event.c => wl1251_event.c} (59%)
rename drivers/net/wireless/wl12xx/{event.h => wl1251_event.h} (94%)
rename drivers/net/wireless/wl12xx/{init.c => wl1251_init.c} (55%)
rename drivers/net/wireless/wl12xx/{init.h => wl1251_init.h} (55%)
rename drivers/net/wireless/wl12xx/{main.c => wl1251_main.c} (60%)
create mode 100644 drivers/net/wireless/wl12xx/wl1251_netlink.c
rename drivers/net/wireless/wl12xx/{debugfs.h => wl1251_netlink.h} (73%)
rename drivers/net/wireless/wl12xx/{wl1251.c => wl1251_ops.c} (66%)
create mode 100644 drivers/net/wireless/wl12xx/wl1251_ops.h
rename drivers/net/wireless/wl12xx/{ps.c => wl1251_ps.c} (55%)
rename drivers/net/wireless/wl12xx/{ps.h => wl1251_ps.h} (72%)
rename drivers/net/wireless/wl12xx/{rx.c => wl1251_rx.c} (68%)
rename drivers/net/wireless/wl12xx/{rx.h => wl1251_rx.h} (89%)
rename drivers/net/wireless/wl12xx/{spi.c => wl1251_spi.c} (63%)
rename drivers/net/wireless/wl12xx/{spi.h => wl1251_spi.h} (61%)
rename drivers/net/wireless/wl12xx/{tx.c => wl1251_tx.c} (79%)
rename drivers/net/wireless/wl12xx/{tx.h => wl1251_tx.h} (93%)
delete mode 100644 drivers/net/wireless/wl12xx/wl12xx.h
create mode 100644 net/wireless/sme.c
create mode 100644 net/wireless/wext-sme.c
Omnibus patch available here:
http://www.kernel.org/pub/linux/kernel/people/linville/wireless-next-2.6-2009-07-10.patch.bz2
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
¡Viva Honduras Libre!
^ permalink raw reply
* [PATCH 4/4] net: move and export get_net_ns_by_pid
From: Johannes Berg @ 2009-07-10 19:51 UTC (permalink / raw)
To: netdev; +Cc: linux-wireless, tgraf, Eric W. Biederman
In-Reply-To: <20090710195131.504091075@sipsolutions.net>
The function get_net_ns_by_pid(), to get a network
namespace from a pid_t, will be required in cfg80211
as well. Therefore, let's move it to net_namespace.c
and export it. We can't make it a static inline in
the !NETNS case because it needs to verify that the
given pid even exists (and return -ESRCH).
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
include/net/net_namespace.h | 2 ++
net/core/net_namespace.c | 21 +++++++++++++++++++++
net/core/rtnetlink.c | 21 +--------------------
3 files changed, 24 insertions(+), 20 deletions(-)
--- wireless-testing.orig/include/net/net_namespace.h 2009-07-07 12:18:30.000000000 +0200
+++ wireless-testing/include/net/net_namespace.h 2009-07-07 12:25:42.000000000 +0200
@@ -111,6 +111,8 @@ static inline struct net *copy_net_ns(un
extern struct list_head net_namespace_list;
+extern struct net *get_net_ns_by_pid(pid_t pid);
+
#ifdef CONFIG_NET_NS
extern void __put_net(struct net *net);
--- wireless-testing.orig/net/core/net_namespace.c 2009-07-07 12:18:19.000000000 +0200
+++ wireless-testing/net/core/net_namespace.c 2009-07-07 12:25:42.000000000 +0200
@@ -7,6 +7,7 @@
#include <linux/sched.h>
#include <linux/idr.h>
#include <linux/rculist.h>
+#include <linux/nsproxy.h>
#include <net/net_namespace.h>
#include <net/netns/generic.h>
@@ -201,6 +202,26 @@ struct net *copy_net_ns(unsigned long fl
}
#endif
+struct net *get_net_ns_by_pid(pid_t pid)
+{
+ struct task_struct *tsk;
+ struct net *net;
+
+ /* Lookup the network namespace */
+ net = ERR_PTR(-ESRCH);
+ rcu_read_lock();
+ tsk = find_task_by_vpid(pid);
+ if (tsk) {
+ struct nsproxy *nsproxy;
+ nsproxy = task_nsproxy(tsk);
+ if (nsproxy)
+ net = get_net(nsproxy->net_ns);
+ }
+ rcu_read_unlock();
+ return net;
+}
+EXPORT_SYMBOL_GPL(get_net_ns_by_pid);
+
static int __init net_ns_init(void)
{
struct net_generic *ng;
--- wireless-testing.orig/net/core/rtnetlink.c 2009-07-07 12:15:29.000000000 +0200
+++ wireless-testing/net/core/rtnetlink.c 2009-07-07 12:25:42.000000000 +0200
@@ -35,7 +35,6 @@
#include <linux/security.h>
#include <linux/mutex.h>
#include <linux/if_addr.h>
-#include <linux/nsproxy.h>
#include <asm/uaccess.h>
#include <asm/system.h>
@@ -52,6 +51,7 @@
#include <net/pkt_sched.h>
#include <net/fib_rules.h>
#include <net/rtnetlink.h>
+#include <net/net_namespace.h>
struct rtnl_link
{
@@ -725,25 +725,6 @@ static const struct nla_policy ifla_info
[IFLA_INFO_DATA] = { .type = NLA_NESTED },
};
-static struct net *get_net_ns_by_pid(pid_t pid)
-{
- struct task_struct *tsk;
- struct net *net;
-
- /* Lookup the network namespace */
- net = ERR_PTR(-ESRCH);
- rcu_read_lock();
- tsk = find_task_by_vpid(pid);
- if (tsk) {
- struct nsproxy *nsproxy;
- nsproxy = task_nsproxy(tsk);
- if (nsproxy)
- net = get_net(nsproxy->net_ns);
- }
- rcu_read_unlock();
- return net;
-}
-
static int validate_linkmsg(struct net_device *dev, struct nlattr *tb[])
{
if (dev) {
--
^ permalink raw reply
* [PATCH 3/4] genetlink: make netns aware
From: Johannes Berg @ 2009-07-10 19:51 UTC (permalink / raw)
To: netdev; +Cc: linux-wireless, tgraf, Eric W. Biederman
In-Reply-To: <20090710195131.504091075@sipsolutions.net>
This makes generic netlink network namespace aware. No
generic netlink families except for the controller family
are made namespace aware, they need to be checked one by
one and then set the family->netnsok member to true.
A new function genlmsg_multicast_netns() is introduced to
allow sending a multicast message in a given namespace,
for example when it applies to an object that lives in
that namespace, a new function genlmsg_multicast_allns()
to send a message to all network namespaces (for objects
that do not have an associated netns).
The function genlmsg_multicast() is changed to multicast
the message in just init_net, which is currently correct
for all generic netlink families since they only work in
init_net right now. Some will later want to work in all
net namespaces because they do not care about the netns
at all -- those will have to be converted to use one of
the new functions genlmsg_multicast_allns() or
genlmsg_multicast_netns() whenever they are made netns
aware in some way.
After this patch families can easily decide whether or
not they should be available in all net namespaces. Many
genl families us it for objects not related to networking
and should therefore be available in all namespaces, but
that will have to be done on a per family basis.
Note that this doesn't touch on the checkpoint/restart
problem where network namespaces could be used, genl
families and multicast groups are numbered globally and
I see no easy way of changing that, especially since it
must be possible to multicast to all network namespaces
for those families that do not care about netns.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
fs/dlm/netlink.c | 2
include/net/genetlink.h | 66 +++++++++++++-
include/net/net_namespace.h | 2
kernel/taskstats.c | 10 +-
net/irda/irnetlink.c | 2
net/netfilter/ipvs/ip_vs_ctl.c | 2
net/netlink/genetlink.c | 186 ++++++++++++++++++++++++++++++++---------
net/tipc/netlink.c | 2
net/wireless/nl80211.c | 14 +--
9 files changed, 223 insertions(+), 63 deletions(-)
--- wireless-testing.orig/include/net/genetlink.h 2009-07-08 14:11:56.000000000 +0200
+++ wireless-testing/include/net/genetlink.h 2009-07-08 15:01:54.000000000 +0200
@@ -3,6 +3,7 @@
#include <linux/genetlink.h>
#include <net/netlink.h>
+#include <net/net_namespace.h>
/**
* struct genl_multicast_group - generic netlink multicast group
@@ -27,6 +28,8 @@ struct genl_multicast_group
* @name: name of family
* @version: protocol version
* @maxattr: maximum number of attributes supported
+ * @netnsok: set to true if the family can handle network
+ * namespaces and should be presented in all of them
* @attrbuf: buffer to store parsed attributes
* @ops_list: list of all assigned operations
* @family_list: family list
@@ -39,6 +42,7 @@ struct genl_family
char name[GENL_NAMSIZ];
unsigned int version;
unsigned int maxattr;
+ bool netnsok;
struct nlattr ** attrbuf; /* private */
struct list_head ops_list; /* private */
struct list_head family_list; /* private */
@@ -62,8 +66,32 @@ struct genl_info
struct genlmsghdr * genlhdr;
void * userhdr;
struct nlattr ** attrs;
+#ifdef CONFIG_NET_NS
+ struct net * _net;
+#endif
};
+#ifdef CONFIG_NET_NS
+static inline struct net *genl_info_net(struct genl_info *info)
+{
+ return info->_net;
+}
+
+static inline void genl_info_net_set(struct genl_info *info, struct net *net)
+{
+ info->_net = net;
+}
+#else
+static inline struct net *genl_info_net(struct genl_info *info)
+{
+ return &init_net;
+}
+
+static inline void genl_info_net_set(struct genl_info *info, struct net *net)
+{
+}
+#endif
+
/**
* struct genl_ops - generic netlink operations
* @cmd: command identifier
@@ -98,8 +126,6 @@ extern int genl_register_mc_group(struct
extern void genl_unregister_mc_group(struct genl_family *family,
struct genl_multicast_group *grp);
-extern struct sock *genl_sock;
-
/**
* genlmsg_put - Add generic netlink header to netlink message
* @skb: socket buffer holding the message
@@ -170,7 +196,21 @@ static inline void genlmsg_cancel(struct
}
/**
- * genlmsg_multicast - multicast a netlink message
+ * genlmsg_multicast_netns - multicast a netlink message to a specific netns
+ * @net: the net namespace
+ * @skb: netlink message as socket buffer
+ * @pid: own netlink pid to avoid sending to yourself
+ * @group: multicast group id
+ * @flags: allocation flags
+ */
+static inline int genlmsg_multicast_netns(struct net *net, struct sk_buff *skb,
+ u32 pid, unsigned int group, gfp_t flags)
+{
+ return nlmsg_multicast(net->genl_sock, skb, pid, group, flags);
+}
+
+/**
+ * genlmsg_multicast - multicast a netlink message to the default netns
* @skb: netlink message as socket buffer
* @pid: own netlink pid to avoid sending to yourself
* @group: multicast group id
@@ -179,17 +219,29 @@ static inline void genlmsg_cancel(struct
static inline int genlmsg_multicast(struct sk_buff *skb, u32 pid,
unsigned int group, gfp_t flags)
{
- return nlmsg_multicast(genl_sock, skb, pid, group, flags);
+ return genlmsg_multicast_netns(&init_net, skb, pid, group, flags);
}
/**
+ * genlmsg_multicast_allns - multicast a netlink message to all net namespaces
+ * @skb: netlink message as socket buffer
+ * @pid: own netlink pid to avoid sending to yourself
+ * @group: multicast group id
+ * @flags: allocation flags
+ *
+ * This function must hold the RTNL or rcu_read_lock().
+ */
+int genlmsg_multicast_allns(struct sk_buff *skb, u32 pid,
+ unsigned int group, gfp_t flags);
+
+/**
* genlmsg_unicast - unicast a netlink message
* @skb: netlink message as socket buffer
* @pid: netlink pid of the destination socket
*/
-static inline int genlmsg_unicast(struct sk_buff *skb, u32 pid)
+static inline int genlmsg_unicast(struct net *net, struct sk_buff *skb, u32 pid)
{
- return nlmsg_unicast(genl_sock, skb, pid);
+ return nlmsg_unicast(net->genl_sock, skb, pid);
}
/**
@@ -199,7 +251,7 @@ static inline int genlmsg_unicast(struct
*/
static inline int genlmsg_reply(struct sk_buff *skb, struct genl_info *info)
{
- return genlmsg_unicast(skb, info->snd_pid);
+ return genlmsg_unicast(genl_info_net(info), skb, info->snd_pid);
}
/**
--- wireless-testing.orig/net/netlink/genetlink.c 2009-07-08 14:11:55.000000000 +0200
+++ wireless-testing/net/netlink/genetlink.c 2009-07-08 15:01:54.000000000 +0200
@@ -18,8 +18,6 @@
#include <net/sock.h>
#include <net/genetlink.h>
-struct sock *genl_sock = NULL;
-
static DEFINE_MUTEX(genl_mutex); /* serialization of message processing */
static inline void genl_lock(void)
@@ -175,10 +173,31 @@ int genl_register_mc_group(struct genl_f
mc_groups_longs++;
}
- err = netlink_change_ngroups(genl_sock,
- mc_groups_longs * BITS_PER_LONG);
- if (err)
- goto out;
+ if (family->netnsok) {
+ struct net *net;
+
+ rcu_read_lock();
+ for_each_net_rcu(net) {
+ err = netlink_change_ngroups(net->genl_sock,
+ mc_groups_longs * BITS_PER_LONG);
+ if (err) {
+ /*
+ * No need to roll back, can only fail if
+ * memory allocation fails and then the
+ * number of _possible_ groups has been
+ * increased on some sockets which is ok.
+ */
+ rcu_read_unlock();
+ goto out;
+ }
+ }
+ rcu_read_unlock();
+ } else {
+ err = netlink_change_ngroups(init_net.genl_sock,
+ mc_groups_longs * BITS_PER_LONG);
+ if (err)
+ goto out;
+ }
grp->id = id;
set_bit(id, mc_groups);
@@ -195,8 +214,14 @@ EXPORT_SYMBOL(genl_register_mc_group);
static void __genl_unregister_mc_group(struct genl_family *family,
struct genl_multicast_group *grp)
{
+ struct net *net;
BUG_ON(grp->family != family);
- netlink_clear_multicast_users(genl_sock, grp->id);
+
+ rcu_read_lock();
+ for_each_net_rcu(net)
+ netlink_clear_multicast_users(net->genl_sock, grp->id);
+ rcu_read_unlock();
+
clear_bit(grp->id, mc_groups);
list_del(&grp->list);
genl_ctrl_event(CTRL_CMD_DELMCAST_GRP, grp);
@@ -467,6 +492,7 @@ static int genl_rcv_msg(struct sk_buff *
{
struct genl_ops *ops;
struct genl_family *family;
+ struct net *net = sock_net(skb->sk);
struct genl_info info;
struct genlmsghdr *hdr = nlmsg_data(nlh);
int hdrlen, err;
@@ -475,6 +501,10 @@ static int genl_rcv_msg(struct sk_buff *
if (family == NULL)
return -ENOENT;
+ /* this family doesn't exist in this netns */
+ if (!family->netnsok && !net_eq(net, &init_net))
+ return -ENOENT;
+
hdrlen = GENL_HDRLEN + family->hdrsize;
if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
return -EINVAL;
@@ -492,7 +522,7 @@ static int genl_rcv_msg(struct sk_buff *
return -EOPNOTSUPP;
genl_unlock();
- err = netlink_dump_start(genl_sock, skb, nlh,
+ err = netlink_dump_start(net->genl_sock, skb, nlh,
ops->dumpit, ops->done);
genl_lock();
return err;
@@ -514,6 +544,7 @@ static int genl_rcv_msg(struct sk_buff *
info.genlhdr = nlmsg_data(nlh);
info.userhdr = nlmsg_data(nlh) + GENL_HDRLEN;
info.attrs = family->attrbuf;
+ genl_info_net_set(&info, net);
return ops->doit(skb, &info);
}
@@ -534,6 +565,7 @@ static struct genl_family genl_ctrl = {
.name = "nlctrl",
.version = 0x2,
.maxattr = CTRL_ATTR_MAX,
+ .netnsok = true,
};
static int ctrl_fill_info(struct genl_family *family, u32 pid, u32 seq,
@@ -650,6 +682,7 @@ static int ctrl_dumpfamily(struct sk_buf
int i, n = 0;
struct genl_family *rt;
+ struct net *net = sock_net(skb->sk);
int chains_to_skip = cb->args[0];
int fams_to_skip = cb->args[1];
@@ -658,6 +691,8 @@ static int ctrl_dumpfamily(struct sk_buf
continue;
n = 0;
list_for_each_entry(rt, genl_family_chain(i), family_list) {
+ if (!rt->netnsok && !net_eq(net, &init_net))
+ continue;
if (++n < fams_to_skip)
continue;
if (ctrl_fill_info(rt, NETLINK_CB(cb->skb).pid,
@@ -729,6 +764,7 @@ static int ctrl_getfamily(struct sk_buff
if (info->attrs[CTRL_ATTR_FAMILY_ID]) {
u16 id = nla_get_u16(info->attrs[CTRL_ATTR_FAMILY_ID]);
res = genl_family_find_byid(id);
+ err = -ENOENT;
}
if (info->attrs[CTRL_ATTR_FAMILY_NAME]) {
@@ -736,49 +772,61 @@ static int ctrl_getfamily(struct sk_buff
name = nla_data(info->attrs[CTRL_ATTR_FAMILY_NAME]);
res = genl_family_find_byname(name);
+ err = -ENOENT;
}
- if (res == NULL) {
- err = -ENOENT;
- goto errout;
+ if (res == NULL)
+ return err;
+
+ if (!res->netnsok && !net_eq(genl_info_net(info), &init_net)) {
+ /* family doesn't exist here */
+ return -ENOENT;
}
msg = ctrl_build_family_msg(res, info->snd_pid, info->snd_seq,
CTRL_CMD_NEWFAMILY);
- if (IS_ERR(msg)) {
- err = PTR_ERR(msg);
- goto errout;
- }
+ if (IS_ERR(msg))
+ return PTR_ERR(msg);
- err = genlmsg_reply(msg, info);
-errout:
- return err;
+ return genlmsg_reply(msg, info);
}
static int genl_ctrl_event(int event, void *data)
{
struct sk_buff *msg;
+ struct genl_family *family;
+ struct genl_multicast_group *grp;
- if (genl_sock == NULL)
+ /* genl is still initialising */
+ if (!init_net.genl_sock)
return 0;
switch (event) {
case CTRL_CMD_NEWFAMILY:
case CTRL_CMD_DELFAMILY:
- msg = ctrl_build_family_msg(data, 0, 0, event);
- if (IS_ERR(msg))
- return PTR_ERR(msg);
-
- genlmsg_multicast(msg, 0, GENL_ID_CTRL, GFP_KERNEL);
+ family = data;
+ msg = ctrl_build_family_msg(family, 0, 0, event);
break;
case CTRL_CMD_NEWMCAST_GRP:
case CTRL_CMD_DELMCAST_GRP:
+ grp = data;
+ family = grp->family;
msg = ctrl_build_mcgrp_msg(data, 0, 0, event);
- if (IS_ERR(msg))
- return PTR_ERR(msg);
-
- genlmsg_multicast(msg, 0, GENL_ID_CTRL, GFP_KERNEL);
break;
+ default:
+ return -EINVAL;
+ }
+
+ if (IS_ERR(msg))
+ return PTR_ERR(msg);
+
+ if (!family->netnsok) {
+ genlmsg_multicast_netns(&init_net, msg, 0,
+ GENL_ID_CTRL, GFP_KERNEL);
+ } else {
+ rcu_read_lock();
+ genlmsg_multicast_allns(msg, 0, GENL_ID_CTRL, GFP_ATOMIC);
+ rcu_read_unlock();
}
return 0;
@@ -795,6 +843,33 @@ static struct genl_multicast_group notif
.name = "notify",
};
+static int __net_init genl_pernet_init(struct net *net)
+{
+ /* we'll bump the group number right afterwards */
+ net->genl_sock = netlink_kernel_create(net, NETLINK_GENERIC, 0,
+ genl_rcv, &genl_mutex,
+ THIS_MODULE);
+
+ if (!net->genl_sock && net_eq(net, &init_net))
+ panic("GENL: Cannot initialize generic netlink\n");
+
+ if (!net->genl_sock)
+ return -ENOMEM;
+
+ return 0;
+}
+
+static void __net_exit genl_pernet_exit(struct net *net)
+{
+ netlink_kernel_release(net->genl_sock);
+ net->genl_sock = NULL;
+}
+
+static struct pernet_operations genl_pernet_ops = {
+ .init = genl_pernet_init,
+ .exit = genl_pernet_exit,
+};
+
static int __init genl_init(void)
{
int i, err;
@@ -804,36 +879,67 @@ static int __init genl_init(void)
err = genl_register_family(&genl_ctrl);
if (err < 0)
- goto errout;
+ goto problem;
err = genl_register_ops(&genl_ctrl, &genl_ctrl_ops);
if (err < 0)
- goto errout_register;
+ goto problem;
netlink_set_nonroot(NETLINK_GENERIC, NL_NONROOT_RECV);
- /* we'll bump the group number right afterwards */
- genl_sock = netlink_kernel_create(&init_net, NETLINK_GENERIC, 0,
- genl_rcv, &genl_mutex, THIS_MODULE);
- if (genl_sock == NULL)
- panic("GENL: Cannot initialize generic netlink\n");
+ err = register_pernet_subsys(&genl_pernet_ops);
+ if (err)
+ goto problem;
err = genl_register_mc_group(&genl_ctrl, ¬ify_grp);
if (err < 0)
- goto errout_register;
+ goto problem;
return 0;
-errout_register:
- genl_unregister_family(&genl_ctrl);
-errout:
+problem:
panic("GENL: Cannot register controller: %d\n", err);
}
subsys_initcall(genl_init);
-EXPORT_SYMBOL(genl_sock);
EXPORT_SYMBOL(genl_register_ops);
EXPORT_SYMBOL(genl_unregister_ops);
EXPORT_SYMBOL(genl_register_family);
EXPORT_SYMBOL(genl_unregister_family);
+
+static int genlmsg_mcast(struct sk_buff *skb, u32 pid, unsigned long group,
+ gfp_t flags)
+{
+ struct sk_buff *tmp;
+ struct net *net, *prev = NULL;
+ int err;
+
+ for_each_net_rcu(net) {
+ if (prev) {
+ tmp = skb_clone(skb, flags);
+ if (!tmp) {
+ err = -ENOMEM;
+ goto error;
+ }
+ err = nlmsg_multicast(prev->genl_sock, tmp,
+ pid, group, flags);
+ if (err)
+ goto error;
+ }
+
+ prev = net;
+ }
+
+ return nlmsg_multicast(prev->genl_sock, skb, pid, group, flags);
+ error:
+ kfree_skb(skb);
+ return err;
+}
+
+int genlmsg_multicast_allns(struct sk_buff *skb, u32 pid, unsigned int group,
+ gfp_t flags)
+{
+ return genlmsg_mcast(skb, pid, group, flags);
+}
+EXPORT_SYMBOL(genlmsg_multicast_allns);
--- wireless-testing.orig/fs/dlm/netlink.c 2009-07-08 14:11:55.000000000 +0200
+++ wireless-testing/fs/dlm/netlink.c 2009-07-08 15:01:54.000000000 +0200
@@ -63,7 +63,7 @@ static int send_data(struct sk_buff *skb
return rv;
}
- return genlmsg_unicast(skb, listener_nlpid);
+ return genlmsg_unicast(&init_net, skb, listener_nlpid);
}
static int user_cmd(struct sk_buff *skb, struct genl_info *info)
--- wireless-testing.orig/kernel/taskstats.c 2009-07-08 14:11:56.000000000 +0200
+++ wireless-testing/kernel/taskstats.c 2009-07-08 15:01:54.000000000 +0200
@@ -108,7 +108,7 @@ static int prepare_reply(struct genl_inf
/*
* Send taskstats data in @skb to listener with nl_pid @pid
*/
-static int send_reply(struct sk_buff *skb, pid_t pid)
+static int send_reply(struct sk_buff *skb, struct genl_info *info)
{
struct genlmsghdr *genlhdr = nlmsg_data(nlmsg_hdr(skb));
void *reply = genlmsg_data(genlhdr);
@@ -120,7 +120,7 @@ static int send_reply(struct sk_buff *sk
return rc;
}
- return genlmsg_unicast(skb, pid);
+ return genlmsg_reply(skb, info);
}
/*
@@ -150,7 +150,7 @@ static void send_cpu_listeners(struct sk
if (!skb_next)
break;
}
- rc = genlmsg_unicast(skb_cur, s->pid);
+ rc = genlmsg_unicast(&init_net, skb_cur, s->pid);
if (rc == -ECONNREFUSED) {
s->valid = 0;
delcount++;
@@ -418,7 +418,7 @@ static int cgroupstats_user_cmd(struct s
goto err;
}
- rc = send_reply(rep_skb, info->snd_pid);
+ rc = send_reply(rep_skb, info);
err:
fput_light(file, fput_needed);
@@ -487,7 +487,7 @@ free_return_rc:
} else
goto err;
- return send_reply(rep_skb, info->snd_pid);
+ return send_reply(rep_skb, info);
err:
nlmsg_free(rep_skb);
return rc;
--- wireless-testing.orig/net/irda/irnetlink.c 2009-07-08 14:11:55.000000000 +0200
+++ wireless-testing/net/irda/irnetlink.c 2009-07-08 15:01:54.000000000 +0200
@@ -115,7 +115,7 @@ static int irda_nl_get_mode(struct sk_bu
genlmsg_end(msg, hdr);
- return genlmsg_unicast(msg, info->snd_pid);
+ return genlmsg_reply(msg, info);
err_out:
nlmsg_free(msg);
--- wireless-testing.orig/net/netfilter/ipvs/ip_vs_ctl.c 2009-07-08 14:11:55.000000000 +0200
+++ wireless-testing/net/netfilter/ipvs/ip_vs_ctl.c 2009-07-08 15:01:55.000000000 +0200
@@ -3231,7 +3231,7 @@ static int ip_vs_genl_get_cmd(struct sk_
}
genlmsg_end(msg, reply);
- ret = genlmsg_unicast(msg, info->snd_pid);
+ ret = genlmsg_reply(msg, info);
goto out;
nla_put_failure:
--- wireless-testing.orig/net/tipc/netlink.c 2009-07-08 14:11:55.000000000 +0200
+++ wireless-testing/net/tipc/netlink.c 2009-07-08 15:01:55.000000000 +0200
@@ -62,7 +62,7 @@ static int handle_cmd(struct sk_buff *sk
rep_nlh = nlmsg_hdr(rep_buf);
memcpy(rep_nlh, req_nlh, hdr_space);
rep_nlh->nlmsg_len = rep_buf->len;
- genlmsg_unicast(rep_buf, NETLINK_CB(skb).pid);
+ genlmsg_unicast(&init_net, rep_buf, NETLINK_CB(skb).pid);
}
return 0;
--- wireless-testing.orig/net/wireless/nl80211.c 2009-07-08 14:12:35.000000000 +0200
+++ wireless-testing/net/wireless/nl80211.c 2009-07-08 15:01:55.000000000 +0200
@@ -596,7 +596,7 @@ static int nl80211_get_wiphy(struct sk_b
cfg80211_unlock_rdev(dev);
- return genlmsg_unicast(msg, info->snd_pid);
+ return genlmsg_reply(msg, info);
out_free:
nlmsg_free(msg);
@@ -922,7 +922,7 @@ static int nl80211_get_interface(struct
dev_put(netdev);
cfg80211_unlock_rdev(dev);
- return genlmsg_unicast(msg, info->snd_pid);
+ return genlmsg_reply(msg, info);
out_free:
nlmsg_free(msg);
@@ -1236,7 +1236,7 @@ static int nl80211_get_key(struct sk_buf
goto nla_put_failure;
genlmsg_end(msg, hdr);
- err = genlmsg_unicast(msg, info->snd_pid);
+ err = genlmsg_reply(msg, info);
goto out;
nla_put_failure:
@@ -1811,7 +1811,7 @@ static int nl80211_get_station(struct sk
dev, mac_addr, &sinfo) < 0)
goto out_free;
- err = genlmsg_unicast(msg, info->snd_pid);
+ err = genlmsg_reply(msg, info);
goto out;
out_free:
@@ -2280,7 +2280,7 @@ static int nl80211_get_mpath(struct sk_b
dev, dst, next_hop, &pinfo) < 0)
goto out_free;
- err = genlmsg_unicast(msg, info->snd_pid);
+ err = genlmsg_reply(msg, info);
goto out;
out_free:
@@ -2629,7 +2629,7 @@ static int nl80211_get_mesh_params(struc
cur_params.dot11MeshHWMPnetDiameterTraversalTime);
nla_nest_end(msg, pinfoattr);
genlmsg_end(msg, hdr);
- err = genlmsg_unicast(msg, info->snd_pid);
+ err = genlmsg_reply(msg, info);
goto out;
nla_put_failure:
@@ -2817,7 +2817,7 @@ static int nl80211_get_reg(struct sk_buf
nla_nest_end(msg, nl_reg_rules);
genlmsg_end(msg, hdr);
- err = genlmsg_unicast(msg, info->snd_pid);
+ err = genlmsg_reply(msg, info);
goto out;
nla_put_failure:
--- wireless-testing.orig/include/net/net_namespace.h 2009-07-08 15:01:53.000000000 +0200
+++ wireless-testing/include/net/net_namespace.h 2009-07-08 15:01:55.000000000 +0200
@@ -26,6 +26,7 @@ struct net_device;
struct sock;
struct ctl_table_header;
struct net_generic;
+struct sock;
struct net {
atomic_t count; /* To decided when the network
@@ -57,6 +58,7 @@ struct net {
spinlock_t rules_mod_lock;
struct sock *rtnl; /* rtnetlink socket */
+ struct sock *genl_sock;
struct netns_core core;
struct netns_mib mib;
--
^ permalink raw reply
* [PATCH 2/4] net: make namespace iteration possible under RCU
From: Johannes Berg @ 2009-07-10 19:51 UTC (permalink / raw)
To: netdev; +Cc: linux-wireless, tgraf, Eric W. Biederman
In-Reply-To: <20090710195131.504091075@sipsolutions.net>
All we need to take care of is using proper RCU list
add/del primitives and inserting a synchronize_rcu()
at one place to make sure the exit notifiers are run
after everybody has stopped iterating the list.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
include/net/net_namespace.h | 3 +++
net/core/net_namespace.c | 14 +++++++++++---
2 files changed, 14 insertions(+), 3 deletions(-)
--- wireless-testing.orig/include/net/net_namespace.h 2009-07-07 04:14:39.000000000 +0200
+++ wireless-testing/include/net/net_namespace.h 2009-07-07 12:17:17.000000000 +0200
@@ -211,6 +211,9 @@ static inline struct net *read_pnet(stru
#define for_each_net(VAR) \
list_for_each_entry(VAR, &net_namespace_list, list)
+#define for_each_net_rcu(VAR) \
+ list_for_each_entry_rcu(VAR, &net_namespace_list, list)
+
#ifdef CONFIG_NET_NS
#define __net_init
#define __net_exit
--- wireless-testing.orig/net/core/net_namespace.c 2009-07-07 03:43:35.000000000 +0200
+++ wireless-testing/net/core/net_namespace.c 2009-07-07 12:18:19.000000000 +0200
@@ -6,6 +6,7 @@
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/idr.h>
+#include <linux/rculist.h>
#include <net/net_namespace.h>
#include <net/netns/generic.h>
@@ -127,7 +128,7 @@ static struct net *net_create(void)
rv = setup_net(net);
if (rv == 0) {
rtnl_lock();
- list_add_tail(&net->list, &net_namespace_list);
+ list_add_tail_rcu(&net->list, &net_namespace_list);
rtnl_unlock();
}
mutex_unlock(&net_mutex);
@@ -156,9 +157,16 @@ static void cleanup_net(struct work_stru
/* Don't let anyone else find us. */
rtnl_lock();
- list_del(&net->list);
+ list_del_rcu(&net->list);
rtnl_unlock();
+ /*
+ * Another CPU might be rcu-iterating the list, wait for it.
+ * This needs to be before calling the exit() notifiers, so
+ * the rcu_barrier() below isn't sufficient alone.
+ */
+ synchronize_rcu();
+
/* Run all of the network namespace exit methods */
list_for_each_entry_reverse(ops, &pernet_list, list) {
if (ops->exit)
@@ -219,7 +227,7 @@ static int __init net_ns_init(void)
panic("Could not setup the initial network namespace");
rtnl_lock();
- list_add_tail(&init_net.list, &net_namespace_list);
+ list_add_tail_rcu(&init_net.list, &net_namespace_list);
rtnl_unlock();
mutex_unlock(&net_mutex);
--
^ permalink raw reply
* [PATCH 1/4] netlink: use call_rcu for netlink_change_ngroups
From: Johannes Berg @ 2009-07-10 19:51 UTC (permalink / raw)
To: netdev; +Cc: linux-wireless, tgraf, Eric W. Biederman
In-Reply-To: <20090710195131.504091075@sipsolutions.net>
For the network namespace work in generic netlink I need
to be able to call this function under rcu_read_lock(),
otherwise the locking becomes a nightmare and more locks
would be needed. Instead, just embed a struct rcu_head
(actually a struct listeners_rcu_head that also carries
the pointer to the memory block) into the listeners
memory so we can use call_rcu() instead of synchronising
and then freeing. No rcu_barrier() is needed since this
code cannot be modular.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/netlink/af_netlink.c | 34 ++++++++++++++++++++++++++++++----
1 file changed, 30 insertions(+), 4 deletions(-)
--- wireless-testing.orig/net/netlink/af_netlink.c 2009-07-10 20:36:53.000000000 +0200
+++ wireless-testing/net/netlink/af_netlink.c 2009-07-10 20:51:40.000000000 +0200
@@ -83,6 +83,11 @@ struct netlink_sock {
struct module *module;
};
+struct listeners_rcu_head {
+ struct rcu_head rcu_head;
+ void *ptr;
+};
+
#define NETLINK_KERNEL_SOCKET 0x1
#define NETLINK_RECV_PKTINFO 0x2
#define NETLINK_BROADCAST_SEND_ERROR 0x4
@@ -1487,7 +1492,8 @@ netlink_kernel_create(struct net *net, i
if (groups < 32)
groups = 32;
- listeners = kzalloc(NLGRPSZ(groups), GFP_KERNEL);
+ listeners = kzalloc(NLGRPSZ(groups) + sizeof(struct listeners_rcu_head),
+ GFP_KERNEL);
if (!listeners)
goto out_sock_release;
@@ -1535,6 +1541,14 @@ netlink_kernel_release(struct sock *sk)
EXPORT_SYMBOL(netlink_kernel_release);
+static void netlink_free_old_listeners(struct rcu_head *rcu_head)
+{
+ struct listeners_rcu_head *lrh;
+
+ lrh = container_of(rcu_head, struct listeners_rcu_head, rcu_head);
+ kfree(lrh->ptr);
+}
+
/**
* netlink_change_ngroups - change number of multicast groups
*
@@ -1550,6 +1564,7 @@ EXPORT_SYMBOL(netlink_kernel_release);
int netlink_change_ngroups(struct sock *sk, unsigned int groups)
{
unsigned long *listeners, *old = NULL;
+ struct listeners_rcu_head *old_rcu_head;
struct netlink_table *tbl = &nl_table[sk->sk_protocol];
int err = 0;
@@ -1558,7 +1573,9 @@ int netlink_change_ngroups(struct sock *
netlink_table_grab();
if (NLGRPSZ(tbl->groups) < NLGRPSZ(groups)) {
- listeners = kzalloc(NLGRPSZ(groups), GFP_ATOMIC);
+ listeners = kzalloc(NLGRPSZ(groups) +
+ sizeof(struct listeners_rcu_head),
+ GFP_ATOMIC);
if (!listeners) {
err = -ENOMEM;
goto out_ungrab;
@@ -1566,13 +1583,22 @@ int netlink_change_ngroups(struct sock *
old = tbl->listeners;
memcpy(listeners, old, NLGRPSZ(tbl->groups));
rcu_assign_pointer(tbl->listeners, listeners);
+ /*
+ * Free the old memory after an RCU grace period so we
+ * don't leak it. We use call_rcu() here in order to be
+ * able to call this function from atomic contexts. The
+ * allocation of this memory will have reserved enough
+ * space for struct listeners_rcu_head at the end.
+ */
+ old_rcu_head = (void *)(tbl->listeners +
+ NLGRPLONGS(tbl->groups));
+ old_rcu_head->ptr = old;
+ call_rcu(&old_rcu_head->rcu_head, netlink_free_old_listeners);
}
tbl->groups = groups;
out_ungrab:
netlink_table_ungrab();
- synchronize_rcu();
- kfree(old);
return err;
}
--
^ permalink raw reply
* [PATCH 0/4] generic netlink namespace awareness
From: Johannes Berg @ 2009-07-10 19:51 UTC (permalink / raw)
To: netdev; +Cc: linux-wireless, tgraf, Eric W. Biederman
This patch series makes generic netlink network namespace
aware, in some way, paving the way for making wireless
completely netns aware (which I will submit to John's tree).
The required changes are basically some preparations in
core netlink, a change to make it possible to iterate net
namespaces under just RCU (which may be useful elsewhere in
the future), the actual genetlink patch and finally also
exporting get_net_ns_by_pid() which wireless will need.
The last patch (for get_net_ns_by_pid) could go through
the wireless tree as well, but I've put it in here since
it touches core code. The others probably shouldn't go
through the wireless tree since they touch more than that.
The first patch in this series fixes the last remaining
problem I had with the generic netlink one, the patches
are actually unchanged from the previous submission other
than adding patch 1 in front.
johannes
^ permalink raw reply
* [PATCH 2.6.31] rfkill: allow toggling soft state in sysfs again
From: Johannes Berg @ 2009-07-10 19:41 UTC (permalink / raw)
To: John Linville
Cc: Thiemo Nagel, Corentin Chary, debian-eeepc-devel, acpi4asus-user,
linux-wireless, linux-kernel, Darren Salt
In-Reply-To: <507E3B9268%linux@youmustbejoking.demon.co.uk>
Apparently there actually _are_ tools that try to set
this in sysfs even though it wasn't supposed to be used
this way without claiming first. Guess what: now that
I've cleaned it all up it doesn't matter and we can
simply allow setting the soft-block state in sysfs.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
*shrug*, I don't like it, but whatever...
Please test & report.
net/rfkill/core.c | 27 +++++++++++++++++++--------
1 file changed, 19 insertions(+), 8 deletions(-)
--- wireless-testing.orig/net/rfkill/core.c 2009-07-10 21:29:10.000000000 +0200
+++ wireless-testing/net/rfkill/core.c 2009-07-10 21:36:31.000000000 +0200
@@ -648,15 +648,26 @@ static ssize_t rfkill_state_store(struct
struct device_attribute *attr,
const char *buf, size_t count)
{
- /*
- * The intention was that userspace can only take control over
- * a given device when/if rfkill-input doesn't control it due
- * to user_claim. Since user_claim is currently unsupported,
- * we never support changing the state from userspace -- this
- * can be implemented again later.
- */
+ struct rfkill *rfkill = to_rfkill(dev);
+ unsigned long state;
+ int err;
+
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+
+ err = strict_strtoul(buf, 0, &state);
+ if (err)
+ return err;
+
+ if (state != RFKILL_USER_STATE_SOFT_BLOCKED &&
+ state != RFKILL_USER_STATE_UNBLOCKED)
+ return -EINVAL;
+
+ mutex_lock(&rfkill_global_mutex);
+ rfkill_set_block(rfkill, state == RFKILL_USER_STATE_SOFT_BLOCKED);
+ mutex_unlock(&rfkill_global_mutex);
- return -EPERM;
+ return err ?: count;
}
static ssize_t rfkill_claim_show(struct device *dev,
^ permalink raw reply
* [2.6.31-rc2] Writing to /sys/class/rfkill/*/state fails
From: Darren Salt @ 2009-07-10 18:57 UTC (permalink / raw)
To: Thiemo Nagel
Cc: Corentin Chary, Johannes Berg, debian-eeepc-devel, acpi4asus-user,
linux-wireless, linux-kernel
In-Reply-To: <4A575119.9070505@ph.tum.de>
[full quoting for linux-{kernel,wireless} & the perpetrator]
I demand that Thiemo Nagel may or may not have written...
> Corentin Chary wrote:
>> On Fri, Jul 10, 2009 at 3:35 PM, Thiemo Nagel<thiemo.nagel@ph.tum.de>
>> wrote:
>>> Corentin Chary wrote:
>>>> On Fri, Jul 10, 2009 at 12:23 PM, Thiemo
>>>> Nagel<thiemo.nagel@ph.tum.de> wrote:
>>>>> I just tested the new GSM rfkill in 2.6.31-rc2 and I get the following
>>>>> on my EeePC 1000HGO:
>>>>> eee:/# cat /sys/class/rfkill/rfkill2/name
>>>>> eeepc-wwan3g
>>>>> eee:/# echo 0 > /sys/class/rfkill/rfkill2/state
>>>>> bash: echo: write error: Operation not permitted
>>>>> What could be the reason for that?
>>>> Reading the kernel source I can find:
>>>> /*
>>>> * The intention was that userspace can only take control over
>>>> * a given device when/if rfkill-input doesn't control it due
>>>> * to user_claim. Since user_claim is currently unsupported,
>>>> * we never support changing the state from userspace -- this
>>>> * can be implemented again later.
>>>> */
>>>> It seems that rfkill should be controlled by /dev/rfkill (cf
>>>> Documentation/rfkill.txt).
>>>> Maybe network-manager can control that .. But I'm not sure.
>>>> Maybe you should CC the wireless mailing list.
>>> Thanks for the quick reply. The interesting thing is, that the direct
>>> access works well for eeepc-wlan and eeepc-bluetooth rfkills. I've CC'd
>>> debian-eeepc-devel, maybe they know something.
>> Are you sure that it works with newer kernels ?
>> This commit should have broken it for all rfkill.
>> commit 19d337dff95cbf76edd3ad95c0cee2732c3e1ec5
>> Author: Johannes Berg <johannes@sipsolutions.net>
>> Date: Tue Jun 2 13:01:37 2009 +0200
> You're right, all rfkills work with 2.6.30, but none works with 2.6.31-rc2.
This is the first that I've heard of this. I'd not noticed since I've not
needed Bluetooth on my 901 recently.
> For the debian-eeepc folks: 2.6.31-rc2 breaks bluetooth toggling using
> eeepc-acpi-scripts, but WLAN toggling still works.
FSVO "works" (http://bugzilla.kernel.org/show_bug.cgi?id=13390), but that's a
different problem.
I consider this a regression. It breaks an interface which, though flawed, is
ideally suited for scripting use and which eeepc-acpi-scripts uses in shell
scripts.
/dev/rfkill is not useful in shell scripts.
Trying to read from it to determine the current state (and only the current
state) results in the shell effectively hanging, and parsing is less than
trivial. So either we continue to use .../state or eeepc-acpi-scripts needs a
complete rewrite of the ACPI event-handling scripts in something other than
sh (probably perl) and would need a daemon instead of having scripts launched
from acpid (well, that or they'd need a helper binary or two).
Writing to it is doable, though slightly interesting. "echo 1 >/..." is
ideal.
We can't just drop support for older kernels ‒ at least, not yet – though
fortunately, prior to this breakage, all that we had to cope with were
changed file names; the content can be treated identically. We don't have to
deal with hard-blocked states, which helps...
--
| Darren Salt | linux at youmustbejoking | nr. Ashington, | Doon
| using Debian GNU/Linux | or ds ,demon,co,uk | Northumberland | Army
| + Buy local produce. Try to walk or cycle. TRANSPORT CAUSES GLOBAL WARMING.
Passwords are implemented as a result of insecurity.
^ permalink raw reply
* Re: [2.6.31-rc2] Writing to /sys/class/rfkill/*/state fails
From: Marcel Holtmann @ 2009-07-10 19:37 UTC (permalink / raw)
To: Corentin Chary
Cc: Thiemo Nagel, Johannes Berg, debian-eeepc-devel, acpi4asus-user,
linux-wireless, linux-kernel
In-Reply-To: <71cd59b00907101234w772dc141kff52c7393e698e17@mail.gmail.com>
Hi Corentin,
> > I demand that Thiemo Nagel may or may not have written...
> >
> >> Corentin Chary wrote:
> >>> On Fri, Jul 10, 2009 at 3:35 PM, Thiemo Nagel<thiemo.nagel@ph.tum.de>
> >>> wrote:
> >>>> Corentin Chary wrote:
> >>>>> On Fri, Jul 10, 2009 at 12:23 PM, Thiemo
> >>>>> Nagel<thiemo.nagel@ph.tum.de> wrote:
> >>>>>> I just tested the new GSM rfkill in 2.6.31-rc2 and I get the following
> >>>>>> on my EeePC 1000HGO:
> >>>>>> eee:/# cat /sys/class/rfkill/rfkill2/name
> >>>>>> eeepc-wwan3g
> >>>>>> eee:/# echo 0 > /sys/class/rfkill/rfkill2/state
> >>>>>> bash: echo: write error: Operation not permitted
> >>>>>> What could be the reason for that?
> >>>>> Reading the kernel source I can find:
> >>>>> /*
> >>>>> * The intention was that userspace can only take control over
> >>>>> * a given device when/if rfkill-input doesn't control it due
> >>>>> * to user_claim. Since user_claim is currently unsupported,
> >>>>> * we never support changing the state from userspace -- this
> >>>>> * can be implemented again later.
> >>>>> */
> >>>>> It seems that rfkill should be controlled by /dev/rfkill (cf
> >>>>> Documentation/rfkill.txt).
> >>>>> Maybe network-manager can control that .. But I'm not sure.
> >>>>> Maybe you should CC the wireless mailing list.
> >>>> Thanks for the quick reply. The interesting thing is, that the direct
> >>>> access works well for eeepc-wlan and eeepc-bluetooth rfkills. I've CC'd
> >>>> debian-eeepc-devel, maybe they know something.
> >>> Are you sure that it works with newer kernels ?
> >>> This commit should have broken it for all rfkill.
> >>> commit 19d337dff95cbf76edd3ad95c0cee2732c3e1ec5
> >>> Author: Johannes Berg <johannes@sipsolutions.net>
> >>> Date: Tue Jun 2 13:01:37 2009 +0200
> >
> >> You're right, all rfkills work with 2.6.30, but none works with 2.6.31-rc2.
> >
> > This is the first that I've heard of this. I'd not noticed since I've not
> > needed Bluetooth on my 901 recently.
> >
> >> For the debian-eeepc folks: 2.6.31-rc2 breaks bluetooth toggling using
> >> eeepc-acpi-scripts, but WLAN toggling still works.
> >
> > FSVO "works" (http://bugzilla.kernel.org/show_bug.cgi?id=13390), but that's a
> > different problem.
> >
> > I consider this a regression. It breaks an interface which, though flawed, is
> > ideally suited for scripting use and which eeepc-acpi-scripts uses in shell
> > scripts.
> >
> > /dev/rfkill is not useful in shell scripts.
>
> Maybe it would be possible with an rfkill command line tool (in C) ?
> Is there such a tool somewhere ?
yes there is:
http://git.sipsolutions.net/?p=rfkill.git
Regards
Marcel
^ permalink raw reply
* Re: [2.6.31-rc2] Writing to /sys/class/rfkill/*/state fails
From: Corentin Chary @ 2009-07-10 19:34 UTC (permalink / raw)
To: Thiemo Nagel, Corentin Chary, Johannes Berg, debian-eeepc-devel,
acpi4asus-user, linux-wireless, linux-kernel
In-Reply-To: <507E3B9268%linux@youmustbejoking.demon.co.uk>
On Fri, Jul 10, 2009 at 8:57 PM, Darren
Salt<linux@youmustbejoking.demon.co.uk> wrote:
> [full quoting for linux-{kernel,wireless} & the perpetrator]
>
> I demand that Thiemo Nagel may or may not have written...
>
>> Corentin Chary wrote:
>>> On Fri, Jul 10, 2009 at 3:35 PM, Thiemo Nagel<thiemo.nagel@ph.tum.de>
>>> wrote:
>>>> Corentin Chary wrote:
>>>>> On Fri, Jul 10, 2009 at 12:23 PM, Thiemo
>>>>> Nagel<thiemo.nagel@ph.tum.de> wrote:
>>>>>> I just tested the new GSM rfkill in 2.6.31-rc2 and I get the following
>>>>>> on my EeePC 1000HGO:
>>>>>> eee:/# cat /sys/class/rfkill/rfkill2/name
>>>>>> eeepc-wwan3g
>>>>>> eee:/# echo 0 > /sys/class/rfkill/rfkill2/state
>>>>>> bash: echo: write error: Operation not permitted
>>>>>> What could be the reason for that?
>>>>> Reading the kernel source I can find:
>>>>> /*
>>>>> * The intention was that userspace can only take control over
>>>>> * a given device when/if rfkill-input doesn't control it due
>>>>> * to user_claim. Since user_claim is currently unsupported,
>>>>> * we never support changing the state from userspace -- this
>>>>> * can be implemented again later.
>>>>> */
>>>>> It seems that rfkill should be controlled by /dev/rfkill (cf
>>>>> Documentation/rfkill.txt).
>>>>> Maybe network-manager can control that .. But I'm not sure.
>>>>> Maybe you should CC the wireless mailing list.
>>>> Thanks for the quick reply. The interesting thing is, that the direct
>>>> access works well for eeepc-wlan and eeepc-bluetooth rfkills. I've CC'd
>>>> debian-eeepc-devel, maybe they know something.
>>> Are you sure that it works with newer kernels ?
>>> This commit should have broken it for all rfkill.
>>> commit 19d337dff95cbf76edd3ad95c0cee2732c3e1ec5
>>> Author: Johannes Berg <johannes@sipsolutions.net>
>>> Date: Tue Jun 2 13:01:37 2009 +0200
>
>> You're right, all rfkills work with 2.6.30, but none works with 2.6.31-rc2.
>
> This is the first that I've heard of this. I'd not noticed since I've not
> needed Bluetooth on my 901 recently.
>
>> For the debian-eeepc folks: 2.6.31-rc2 breaks bluetooth toggling using
>> eeepc-acpi-scripts, but WLAN toggling still works.
>
> FSVO "works" (http://bugzilla.kernel.org/show_bug.cgi?id=13390), but that's a
> different problem.
>
> I consider this a regression. It breaks an interface which, though flawed, is
> ideally suited for scripting use and which eeepc-acpi-scripts uses in shell
> scripts.
>
> /dev/rfkill is not useful in shell scripts.
Maybe it would be possible with an rfkill command line tool (in C) ?
Is there such a tool somewhere ?
--
Corentin Chary
http://xf.iksaif.net - http://uffs.org
^ permalink raw reply
* Re: [PATCH v5] mac80211: Fix regression in mesh forwarding path.
From: Andrey Yurovsky @ 2009-07-10 19:04 UTC (permalink / raw)
To: John W. Linville; +Cc: javier, linux-wireless, devel, johannes
In-Reply-To: <20090710185150.GF2825@tuxdriver.com>
On Fri, Jul 10, 2009 at 11:51 AM, John W.
Linville<linville@tuxdriver.com> wrote:
> On Tue, Jul 07, 2009 at 10:55:03AM -0700, javier@cozybit.com wrote:
>> From: Javier Cardona <javier@cozybit.com>
>>
>> The removal of the master netdev broke the mesh forwarding path. This patch
>> fixes it by using the new internal 'pending' queue.
>>
>> As a result of this change, mesh forwarding no longer does the inefficient
>> 802.11 -> 802.3 -> 802.11 conversion that was done before.
>>
>> [Changes since v1]
>> Suggested by Johannes:
>> - Select queue before adding to mpath queue
>> - ieee80211_add_pending_skb -> ieee80211_add_pending_skbs
>> - Remove unnecessary header wme.h
>>
>> Signed-off-by: Javier Cardona <javier@cozybit.com>
>> Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
>> Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
>
> What tree are you basing this on?
wireless-testing, the latest (re-spun) version applied on top of
commit 5ac0fb5e5044cb578fb352dc65def1a46a2a21aa
^ permalink raw reply
* Re: [PATCH v5] mac80211: Fix regression in mesh forwarding path.
From: John W. Linville @ 2009-07-10 18:51 UTC (permalink / raw)
To: javier; +Cc: linux-wireless, devel, johannes, Andrey Yurovsky
In-Reply-To: <1246989303-19462-1-git-send-email-javier@cozybit.com>
On Tue, Jul 07, 2009 at 10:55:03AM -0700, javier@cozybit.com wrote:
> From: Javier Cardona <javier@cozybit.com>
>
> The removal of the master netdev broke the mesh forwarding path. This patch
> fixes it by using the new internal 'pending' queue.
>
> As a result of this change, mesh forwarding no longer does the inefficient
> 802.11 -> 802.3 -> 802.11 conversion that was done before.
>
> [Changes since v1]
> Suggested by Johannes:
> - Select queue before adding to mpath queue
> - ieee80211_add_pending_skb -> ieee80211_add_pending_skbs
> - Remove unnecessary header wme.h
>
> Signed-off-by: Javier Cardona <javier@cozybit.com>
> Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
> Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
What tree are you basing this on?
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
¡Viva Honduras Libre!
^ permalink raw reply
* [PATCH] rt2x00: Implement set_tim callback for all drivers
From: Ivo van Doorn @ 2009-07-10 18:42 UTC (permalink / raw)
To: John Linville; +Cc: Stefan Steuerwald, users, linux-wireless
From: Stefan Steuerwald <salsasepp@googlemail.com>
Implement set_tim callback for all rt2x00 drivers, this makes the
device wake up powersaving stations properly while in AP mode.
The only way to update the beacon is by simply calling mac80211 and
requesting the new beacon. This means the set_tim() event is mostly the
same as a beacon_done() event which was already defined in rt2x00lib.
Signed-off-by: Stefan Steuerwald <salsasepp@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index d8035e3..30185ad 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1561,6 +1561,7 @@ static const struct ieee80211_ops rt2400pci_mac80211_ops = {
.remove_interface = rt2x00mac_remove_interface,
.config = rt2x00mac_config,
.configure_filter = rt2x00mac_configure_filter,
+ .set_tim = rt2x00mac_set_tim,
.get_stats = rt2x00mac_get_stats,
.bss_info_changed = rt2x00mac_bss_info_changed,
.conf_tx = rt2400pci_conf_tx,
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index c123e28..3b31715 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1860,6 +1860,7 @@ static const struct ieee80211_ops rt2500pci_mac80211_ops = {
.remove_interface = rt2x00mac_remove_interface,
.config = rt2x00mac_config,
.configure_filter = rt2x00mac_configure_filter,
+ .set_tim = rt2x00mac_set_tim,
.get_stats = rt2x00mac_get_stats,
.bss_info_changed = rt2x00mac_bss_info_changed,
.conf_tx = rt2x00mac_conf_tx,
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 795706d..27e80d0 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1894,6 +1894,7 @@ static const struct ieee80211_ops rt2500usb_mac80211_ops = {
.remove_interface = rt2x00mac_remove_interface,
.config = rt2x00mac_config,
.configure_filter = rt2x00mac_configure_filter,
+ .set_tim = rt2x00mac_set_tim,
.set_key = rt2x00mac_set_key,
.get_stats = rt2x00mac_get_stats,
.bss_info_changed = rt2x00mac_bss_info_changed,
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 372c632..5a675a6 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -3053,6 +3053,7 @@ static const struct ieee80211_ops rt2800pci_mac80211_ops = {
.remove_interface = rt2x00mac_remove_interface,
.config = rt2x00mac_config,
.configure_filter = rt2x00mac_configure_filter,
+ .set_tim = rt2x00mac_set_tim,
.set_key = rt2x00mac_set_key,
.get_stats = rt2x00mac_get_stats,
.get_tkip_seq = rt2800pci_get_tkip_seq,
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index a204e66..66e001c 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -2786,6 +2786,7 @@ static const struct ieee80211_ops rt2800usb_mac80211_ops = {
.remove_interface = rt2x00mac_remove_interface,
.config = rt2x00mac_config,
.configure_filter = rt2x00mac_configure_filter,
+ .set_tim = rt2x00mac_set_tim,
.set_key = rt2x00mac_set_key,
.get_stats = rt2x00mac_get_stats,
.get_tkip_seq = rt2800usb_get_tkip_seq,
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index de3f13a..8a2a425 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -969,6 +969,8 @@ void rt2x00mac_configure_filter(struct ieee80211_hw *hw,
unsigned int changed_flags,
unsigned int *total_flags,
int mc_count, struct dev_addr_list *mc_list);
+int rt2x00mac_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
+ bool set);
#ifdef CONFIG_RT2X00_LIB_CRYPTO
int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
struct ieee80211_vif *vif, struct ieee80211_sta *sta,
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index b7e0ddd..3425984 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -454,6 +454,16 @@ static void memcpy_tkip(struct rt2x00lib_crypto *crypto, u8 *key, u8 key_len)
sizeof(crypto->rx_mic));
}
+int rt2x00mac_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
+ bool set)
+{
+ struct rt2x00_dev *rt2x00dev = hw->priv;
+
+ rt2x00lib_beacondone(rt2x00dev);
+ return 0;
+}
+EXPORT_SYMBOL_GPL(rt2x00mac_set_tim);
+
int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
struct ieee80211_vif *vif, struct ieee80211_sta *sta,
struct ieee80211_key_conf *key)
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 8a49d99..b435c14 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2716,6 +2716,7 @@ static const struct ieee80211_ops rt61pci_mac80211_ops = {
.remove_interface = rt2x00mac_remove_interface,
.config = rt2x00mac_config,
.configure_filter = rt2x00mac_configure_filter,
+ .set_tim = rt2x00mac_set_tim,
.set_key = rt2x00mac_set_key,
.get_stats = rt2x00mac_get_stats,
.bss_info_changed = rt2x00mac_bss_info_changed,
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index ad2898c..4f9b177 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2241,6 +2241,7 @@ static const struct ieee80211_ops rt73usb_mac80211_ops = {
.remove_interface = rt2x00mac_remove_interface,
.config = rt2x00mac_config,
.configure_filter = rt2x00mac_configure_filter,
+ .set_tim = rt2x00mac_set_tim,
.set_key = rt2x00mac_set_key,
.get_stats = rt2x00mac_get_stats,
.bss_info_changed = rt2x00mac_bss_info_changed,
^ permalink raw reply related
* Re: [PATCH/RFC] mac80211_hwsim: report fixed signal strength
From: Jouni Malinen @ 2009-07-10 18:13 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, Jouni Malinen, linux-wireless
In-Reply-To: <1247237819.29747.3.camel@johannes.local>
On Fri, Jul 10, 2009 at 04:56:59PM +0200, Johannes Berg wrote:
> There's no reason to think that hwsim has any
> actual signal strength, but for testing it is
> very useful to have it report _some_ value to
> the stack so I can see if the value ends up
> being reported correctly
> Anyone have any objections? I'm not sure -- but it's still useful at
> least for me testing the upper layers.
At some point, we might even get to simulating (e.g., by a user space
app) signal strength more properly, but for now, this looks fine to me.
--
Jouni Malinen PGP id EFC895FA
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox