* [PATCH] libertas: separate libertas' Kconfig in it's own file
From: Holger Schurig @ 2009-10-06 14:31 UTC (permalink / raw)
To: linux-wireless; +Cc: John W Linville, Dan Williams
Also sorts all "source" lines in the wireless/Kconfig.
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Index: linux-wl/drivers/net/wireless/Kconfig
===================================================================
--- linux-wl.orig/drivers/net/wireless/Kconfig 2009-10-06 07:55:26.000000000 +0200
+++ linux-wl/drivers/net/wireless/Kconfig 2009-10-06 07:58:05.000000000 +0200
@@ -139,47 +139,6 @@ config PCMCIA_RAYCS
To compile this driver as a module, choose M here: the module will be
called ray_cs. If unsure, say N.
-config LIBERTAS
- tristate "Marvell 8xxx Libertas WLAN driver support"
- depends on WLAN_80211
- select WIRELESS_EXT
- select WEXT_SPY
- select LIB80211
- select FW_LOADER
- ---help---
- A library for Marvell Libertas 8xxx devices.
-
-config LIBERTAS_USB
- tristate "Marvell Libertas 8388 USB 802.11b/g cards"
- depends on LIBERTAS && USB
- ---help---
- A driver for Marvell Libertas 8388 USB devices.
-
-config LIBERTAS_CS
- tristate "Marvell Libertas 8385 CompactFlash 802.11b/g cards"
- depends on LIBERTAS && PCMCIA
- select FW_LOADER
- ---help---
- A driver for Marvell Libertas 8385 CompactFlash devices.
-
-config LIBERTAS_SDIO
- tristate "Marvell Libertas 8385/8686/8688 SDIO 802.11b/g cards"
- depends on LIBERTAS && MMC
- ---help---
- A driver for Marvell Libertas 8385/8686/8688 SDIO devices.
-
-config LIBERTAS_SPI
- tristate "Marvell Libertas 8686 SPI 802.11b/g cards"
- depends on LIBERTAS && SPI
- ---help---
- A driver for Marvell Libertas 8686 SPI devices.
-
-config LIBERTAS_DEBUG
- bool "Enable full debugging output in the Libertas module."
- depends on LIBERTAS
- ---help---
- Debugging support.
-
config LIBERTAS_THINFIRM
tristate "Marvell 8xxx Libertas WLAN driver support with thin firmware"
depends on WLAN_80211 && MAC80211
@@ -491,17 +450,18 @@ config MWL8K
To compile this driver as a module, choose M here: the module
will be called mwl8k. If unsure, say N.
-source "drivers/net/wireless/p54/Kconfig"
source "drivers/net/wireless/ath/Kconfig"
-source "drivers/net/wireless/ipw2x00/Kconfig"
-source "drivers/net/wireless/iwlwifi/Kconfig"
-source "drivers/net/wireless/hostap/Kconfig"
source "drivers/net/wireless/b43/Kconfig"
source "drivers/net/wireless/b43legacy/Kconfig"
-source "drivers/net/wireless/zd1211rw/Kconfig"
-source "drivers/net/wireless/rt2x00/Kconfig"
+source "drivers/net/wireless/hostap/Kconfig"
+source "drivers/net/wireless/ipw2x00/Kconfig"
+source "drivers/net/wireless/iwlwifi/Kconfig"
+source "drivers/net/wireless/iwmc3200wifi/Kconfig"
+source "drivers/net/wireless/libertas/Kconfig"
source "drivers/net/wireless/orinoco/Kconfig"
+source "drivers/net/wireless/p54/Kconfig"
+source "drivers/net/wireless/rt2x00/Kconfig"
source "drivers/net/wireless/wl12xx/Kconfig"
-source "drivers/net/wireless/iwmc3200wifi/Kconfig"
+source "drivers/net/wireless/zd1211rw/Kconfig"
endif # WLAN
Index: linux-wl/drivers/net/wireless/libertas/Makefile
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/Makefile 2009-10-06 07:55:26.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/Makefile 2009-10-06 07:58:25.000000000 +0200
@@ -1,5 +1,15 @@
-libertas-objs := main.o wext.o rx.o tx.o cmd.o cmdresp.o scan.o 11d.o \
- debugfs.o persistcfg.o ethtool.o assoc.o
+libertas-y += 11d.o
+libertas-y += assoc.o
+libertas-y += cmd.o
+libertas-y += cmdresp.o
+libertas-y += debugfs.o
+libertas-y += ethtool.o
+libertas-y += main.o
+libertas-y += persistcfg.o
+libertas-y += rx.o
+libertas-y += scan.o
+libertas-y += tx.o
+libertas-y += wext.o
usb8xxx-objs += if_usb.o
libertas_cs-objs += if_cs.o
Index: linux-wl/drivers/net/wireless/libertas/Kconfig
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-wl/drivers/net/wireless/libertas/Kconfig 2009-10-06 07:58:15.000000000 +0200
@@ -0,0 +1,40 @@
+config LIBERTAS
+ tristate "Marvell 8xxx Libertas WLAN driver support"
+ depends on WLAN_80211
+ select WIRELESS_EXT
+ select WEXT_SPY
+ select LIB80211
+ select FW_LOADER
+ ---help---
+ A library for Marvell Libertas 8xxx devices.
+
+config LIBERTAS_USB
+ tristate "Marvell Libertas 8388 USB 802.11b/g cards"
+ depends on LIBERTAS && USB
+ ---help---
+ A driver for Marvell Libertas 8388 USB devices.
+
+config LIBERTAS_CS
+ tristate "Marvell Libertas 8385 CompactFlash 802.11b/g cards"
+ depends on LIBERTAS && PCMCIA
+ select FW_LOADER
+ ---help---
+ A driver for Marvell Libertas 8385 CompactFlash devices.
+
+config LIBERTAS_SDIO
+ tristate "Marvell Libertas 8385/8686/8688 SDIO 802.11b/g cards"
+ depends on LIBERTAS && MMC
+ ---help---
+ A driver for Marvell Libertas 8385/8686/8688 SDIO devices.
+
+config LIBERTAS_SPI
+ tristate "Marvell Libertas 8686 SPI 802.11b/g cards"
+ depends on LIBERTAS && SPI
+ ---help---
+ A driver for Marvell Libertas 8686 SPI devices.
+
+config LIBERTAS_DEBUG
+ bool "Enable full debugging output in the Libertas module."
+ depends on LIBERTAS
+ ---help---
+ Debugging support.
--
http://www.holgerschurig.de
^ permalink raw reply
* [PATCH] libertas: first stab at cfg80211 support
From: Holger Schurig @ 2009-10-06 14:31 UTC (permalink / raw)
To: linux-wireless; +Cc: John W Linville, Dan Williams
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Index: linux-wl/drivers/net/wireless/libertas/defs.h
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/defs.h 2009-10-06 11:07:46.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/defs.h 2009-10-06 11:08:43.000000000 +0200
@@ -42,6 +42,7 @@
#define LBS_DEB_SDIO 0x00400000
#define LBS_DEB_SYSFS 0x00800000
#define LBS_DEB_SPI 0x01000000
+#define LBS_DEB_CFG80211 0x02000000
extern unsigned int lbs_debug;
@@ -86,6 +87,7 @@ do { if ((lbs_debug & (grp)) == (grp)) \
#define lbs_deb_sdio(fmt, args...) LBS_DEB_LL(LBS_DEB_SDIO, " sdio", fmt, ##args)
#define lbs_deb_sysfs(fmt, args...) LBS_DEB_LL(LBS_DEB_SYSFS, " sysfs", fmt, ##args)
#define lbs_deb_spi(fmt, args...) LBS_DEB_LL(LBS_DEB_SPI, " spi", fmt, ##args)
+#define lbs_deb_cfg80211(fmt, args...) LBS_DEB_LL(LBS_DEB_CFG80211, " cfg80211", fmt, ##args)
#define lbs_pr_info(format, args...) \
printk(KERN_INFO DRV_NAME": " format, ## args)
Index: linux-wl/drivers/net/wireless/libertas/dev.h
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/dev.h 2009-10-06 11:08:25.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/dev.h 2009-10-06 15:22:40.000000000 +0200
@@ -100,6 +100,7 @@ struct lbs_mesh_stats {
/** Private structure for the MV device */
struct lbs_private {
+ struct wireless_dev *wdev;
int mesh_open;
int mesh_fw_ver;
int infra_open;
Index: linux-wl/drivers/net/wireless/libertas/cfg.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-wl/drivers/net/wireless/libertas/cfg.h 2009-10-06 13:56:57.000000000 +0200
@@ -0,0 +1,16 @@
+#ifndef __LBS_CFG80211_H__
+#define __LBS_CFG80211_H__
+
+#include "dev.h"
+
+struct wireless_dev *lbs_cfg_alloc(struct device *dev);
+int lbs_cfg_register(struct lbs_private *priv);
+void lbs_cfg_free(struct lbs_private *priv);
+
+int lbs_send_specific_ssid_scan(struct lbs_private *priv, u8 *ssid,
+ u8 ssid_len);
+int lbs_scan_networks(struct lbs_private *priv, int full_scan);
+void lbs_cfg_scan_worker(struct work_struct *work);
+
+
+#endif
Index: linux-wl/drivers/net/wireless/libertas/cfg.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-wl/drivers/net/wireless/libertas/cfg.c 2009-10-06 15:23:34.000000000 +0200
@@ -0,0 +1,198 @@
+/*
+ * Implement cfg80211 ("iw") support.
+ *
+ * Copyright (C) 2009 M&N Solutions GmbH, 61191 Rosbach, Germany
+ * Holger Schurig <hs4233@mail.mn-solutions.de>
+ *
+ */
+
+#include <net/cfg80211.h>
+
+#include "cfg.h"
+#include "cmd.h"
+
+
+#define CHAN2G(_channel, _freq, _flags) { \
+ .band = IEEE80211_BAND_2GHZ, \
+ .center_freq = (_freq), \
+ .hw_value = (_channel), \
+ .flags = (_flags), \
+ .max_antenna_gain = 0, \
+ .max_power = 30, \
+}
+
+static struct ieee80211_channel lbs_2ghz_channels[] = {
+ CHAN2G(1, 2412, 0),
+ CHAN2G(2, 2417, 0),
+ CHAN2G(3, 2422, 0),
+ CHAN2G(4, 2427, 0),
+ CHAN2G(5, 2432, 0),
+ CHAN2G(6, 2437, 0),
+ CHAN2G(7, 2442, 0),
+ CHAN2G(8, 2447, 0),
+ CHAN2G(9, 2452, 0),
+ CHAN2G(10, 2457, 0),
+ CHAN2G(11, 2462, 0),
+ CHAN2G(12, 2467, 0),
+ CHAN2G(13, 2472, 0),
+ CHAN2G(14, 2484, 0),
+};
+
+#define RATETAB_ENT(_rate, _rateid, _flags) { \
+ .bitrate = (_rate), \
+ .hw_value = (_rateid), \
+ .flags = (_flags), \
+}
+
+
+static struct ieee80211_rate lbs_rates[] = {
+ RATETAB_ENT(10, 0x1, 0),
+ RATETAB_ENT(20, 0x2, 0),
+ RATETAB_ENT(55, 0x4, 0),
+ RATETAB_ENT(110, 0x8, 0),
+ RATETAB_ENT(60, 0x10, 0),
+ RATETAB_ENT(90, 0x20, 0),
+ RATETAB_ENT(120, 0x40, 0),
+ RATETAB_ENT(180, 0x80, 0),
+ RATETAB_ENT(240, 0x100, 0),
+ RATETAB_ENT(360, 0x200, 0),
+ RATETAB_ENT(480, 0x400, 0),
+ RATETAB_ENT(540, 0x800, 0),
+};
+
+static struct ieee80211_supported_band lbs_band_2ghz = {
+ .channels = lbs_2ghz_channels,
+ .n_channels = ARRAY_SIZE(lbs_2ghz_channels),
+ .bitrates = lbs_rates,
+ .n_bitrates = ARRAY_SIZE(lbs_rates),
+};
+
+
+static const u32 cipher_suites[] = {
+ WLAN_CIPHER_SUITE_WEP40,
+ WLAN_CIPHER_SUITE_WEP104,
+ WLAN_CIPHER_SUITE_TKIP,
+ WLAN_CIPHER_SUITE_CCMP,
+};
+
+
+
+static int lbs_cfg_set_channel(struct wiphy *wiphy,
+ struct ieee80211_channel *chan,
+ enum nl80211_channel_type channel_type)
+{
+ struct lbs_private *priv = wiphy_priv(wiphy);
+ int ret = -ENOTSUPP;
+
+ lbs_deb_enter_args(LBS_DEB_CFG80211, "freq %d, type %d", chan->center_freq, channel_type);
+
+ if (channel_type != NL80211_CHAN_NO_HT)
+ goto out;
+
+ ret = lbs_set_channel(priv, chan->hw_value);
+
+ out:
+ lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
+ return ret;
+}
+
+
+
+
+static struct cfg80211_ops lbs_cfg80211_ops = {
+ .set_channel = lbs_cfg_set_channel,
+};
+
+
+/*
+ * At this time lbs_private *priv doesn't even exist, so we just allocate
+ * memory and don't initialize the wiphy further. This is postponed until we
+ * can talk to the firmware and happens at registration time in
+ * lbs_cfg_wiphy_register().
+ */
+struct wireless_dev *lbs_cfg_alloc(struct device *dev)
+{
+ int ret = 0;
+ struct wireless_dev *wdev;
+
+ lbs_deb_enter(LBS_DEB_CFG80211);
+
+ wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL);
+ if (!wdev) {
+ dev_err(dev, "cannot allocate wireless device\n");
+ return ERR_PTR(-ENOMEM);
+ }
+
+ wdev->wiphy = wiphy_new(&lbs_cfg80211_ops, sizeof(struct lbs_private));
+ if (!wdev->wiphy) {
+ dev_err(dev, "cannot allocate wiphy\n");
+ ret = -ENOMEM;
+ goto err_wiphy_new;
+ }
+
+ lbs_deb_leave(LBS_DEB_CFG80211);
+ return wdev;
+
+ err_wiphy_new:
+ kfree(wdev);
+ lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
+ return ERR_PTR(ret);
+}
+
+
+/*
+ * This function get's called after lbs_setup_firmware() determined the
+ * firmware capabities. So we can setup the wiphy according to our
+ * hardware/firmware.
+ */
+int lbs_cfg_register(struct lbs_private *priv)
+{
+ struct wireless_dev *wdev = priv->wdev;
+ int ret;
+
+ lbs_deb_enter(LBS_DEB_CFG80211);
+
+ wdev->wiphy->max_scan_ssids = 1;
+ wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
+
+ /* TODO: BIT(NL80211_IFTYPE_ADHOC); */
+ wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
+
+ /* TODO: honor priv->regioncode */
+ wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &lbs_band_2ghz;
+
+ /*
+ * We could check priv->fwcapinfo && FW_CAPINFO_WPA, but I have
+ * never seen a firmware without WPA
+ */
+ wdev->wiphy->cipher_suites = cipher_suites;
+ wdev->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
+
+ ret = wiphy_register(wdev->wiphy);
+ if (ret < 0)
+ lbs_pr_err("cannot register wiphy device\n");
+
+ ret = register_netdev(priv->dev);
+ if (ret)
+ lbs_pr_err("cannot register network device\n");
+
+ lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
+ return ret;
+}
+
+
+void lbs_cfg_free(struct lbs_private *priv)
+{
+ struct wireless_dev *wdev = priv->wdev;
+
+ lbs_deb_enter(LBS_DEB_CFG80211);
+
+ if (!wdev)
+ return;
+
+ if (wdev->wiphy) {
+ wiphy_unregister(wdev->wiphy);
+ wiphy_free(wdev->wiphy);
+ }
+ kfree(wdev);
+}
Index: linux-wl/drivers/net/wireless/libertas/main.c
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/main.c 2009-10-06 11:08:25.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/main.c 2009-10-06 15:22:40.000000000 +0200
@@ -14,11 +14,13 @@
#include <linux/stddef.h>
#include <linux/ieee80211.h>
#include <net/iw_handler.h>
+#include <net/cfg80211.h>
#include "host.h"
#include "decl.h"
#include "dev.h"
#include "wext.h"
+#include "cfg.h"
#include "debugfs.h"
#include "scan.h"
#include "assoc.h"
@@ -1245,31 +1247,42 @@ static const struct net_device_ops lbs_n
*/
struct lbs_private *lbs_add_card(void *card, struct device *dmdev)
{
- struct net_device *dev = NULL;
+ struct net_device *dev;
+ struct wireless_dev *wdev;
struct lbs_private *priv = NULL;
lbs_deb_enter(LBS_DEB_MAIN);
/* Allocate an Ethernet device and register it */
- dev = alloc_etherdev(sizeof(struct lbs_private));
- if (!dev) {
- lbs_pr_err("init wlanX device failed\n");
+ wdev = lbs_cfg_alloc(dmdev);
+ if (IS_ERR(wdev)) {
+ lbs_pr_err("cfg80211 init failed\n");
goto done;
}
- priv = netdev_priv(dev);
- dev->ml_priv = priv;
+ /* TODO? */
+ wdev->iftype = NL80211_IFTYPE_STATION;
+ priv = wdev_priv(wdev);
+ priv->wdev = wdev;
if (lbs_init_adapter(priv)) {
lbs_pr_err("failed to initialize adapter structure.\n");
- goto err_init_adapter;
+ goto err_wdev;
}
+ //TODO? dev = alloc_netdev_mq(0, "wlan%d", ether_setup, IWM_TX_QUEUES);
+ dev = alloc_netdev(0, "wlan%d", ether_setup);
+ if (!dev) {
+ dev_err(dmdev, "no memory for network device instance\n");
+ goto err_adapter;
+ }
+
+ dev->netdev_ops = &lbs_netdev_ops;
+ dev->ieee80211_ptr = wdev;
+ dev->ml_priv = priv;
+ SET_NETDEV_DEV(dev, dmdev);
+ wdev->netdev = dev;
priv->dev = dev;
- priv->card = card;
- priv->mesh_open = 0;
- priv->infra_open = 0;
- /* Setup the OS Interface to our functions */
dev->netdev_ops = &lbs_netdev_ops;
dev->watchdog_timeo = 5 * HZ;
dev->ethtool_ops = &lbs_ethtool_ops;
@@ -1278,7 +1291,14 @@ struct lbs_private *lbs_add_card(void *c
#endif
dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
- SET_NETDEV_DEV(dev, dmdev);
+
+ // TODO: kzalloc + iwm_init_default_profile(iwm, iwm->umac_profile); ??
+
+
+ priv->card = card;
+ priv->mesh_open = 0;
+ priv->infra_open = 0;
+
priv->rtap_net_dev = NULL;
strcpy(dev->name, "wlan%d");
@@ -1288,7 +1308,7 @@ struct lbs_private *lbs_add_card(void *c
priv->main_thread = kthread_run(lbs_thread, dev, "lbs_main");
if (IS_ERR(priv->main_thread)) {
lbs_deb_thread("Error creating main thread.\n");
- goto err_init_adapter;
+ goto err_ndev;
}
priv->work_thread = create_singlethread_workqueue("lbs_worker");
@@ -1305,9 +1325,15 @@ struct lbs_private *lbs_add_card(void *c
goto done;
-err_init_adapter:
- lbs_free_adapter(priv);
+ err_ndev:
free_netdev(dev);
+
+ err_adapter:
+ lbs_free_adapter(priv);
+
+ err_wdev:
+ lbs_cfg_free(priv);
+
priv = NULL;
done:
@@ -1359,6 +1385,7 @@ void lbs_remove_card(struct lbs_private
kthread_stop(priv->main_thread);
lbs_free_adapter(priv);
+ lbs_cfg_free(priv);
priv->dev = NULL;
free_netdev(dev);
@@ -1383,8 +1410,8 @@ int lbs_start_card(struct lbs_private *p
/* init 802.11d */
lbs_init_11d(priv);
- if (register_netdev(dev)) {
- lbs_pr_err("cannot register ethX device\n");
+ if (lbs_cfg_register(priv)) {
+ lbs_pr_err("cannot register device\n");
goto done;
}
Index: linux-wl/drivers/net/wireless/libertas/Makefile
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/Makefile 2009-10-06 11:08:43.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/Makefile 2009-10-06 15:22:40.000000000 +0200
@@ -1,5 +1,6 @@
libertas-y += 11d.o
libertas-y += assoc.o
+libertas-y += cfg.o
libertas-y += cmd.o
libertas-y += cmdresp.o
libertas-y += debugfs.o
--
http://www.holgerschurig.de
^ permalink raw reply
* [WIP, RFC] libertas: allow scanning via "iw"
From: Holger Schurig @ 2009-10-06 14:33 UTC (permalink / raw)
To: linux-wireless
This adds support for "iw eth1 scan trigger" and "iw eth1 scan dump".
Do not apply!
---
There are some open points, all marked as TODO
* signal isn't reported in dBm or mBm. The scan response from
the firmware tells me some "RSSI" value.
* no real support for active/passive scanning yet
* no integration into the current code, e.g. no usage of the
scan results in assoc.c and other places. priv->networks is
completely unrelated (and should ultimatively go away)
* dummy lbs_scan_networks()
* dummy lbs_send_specific_ssid_scan()
* scan.c and scan.h are just disabled, not deleted
Besides all of this, the following is possible:
# iw eth1 scan trigger freq 2412 passive; sleep 0.5; iw eth1 scan dump
BSS 00:1b:d4:44:35:90 (on eth1)
TSF: 286400000 usec (0d, 00:04:46)
freq: 2412
beacon interval: 100
capability: ESS Privacy (0x0011)
signal: 57/100
SSID: MNWPA
Supported rates: 1.0* 2.0 5.5 11.0
DS Parameter set: channel 1
ERP: Use_Protection
WPA: * Version: 1
* Group cipher: TKIP
* Pairwise ciphers: TKIP
* Authentication suites: PSK
* Capabilities: 4-PTKSA-RC 4-GTKSA-RC (0x0028)
WMM: * Parameter version 1
* u-APSD
* BE: CW 31-1023, AIFSN 3
* BK: CW 31-1023, AIFSN 7
* VI: CW 15-31, AIFSN 2, TXOP 3008 usec
* VO: CW 7-15, AIFSN 2, TXOP 1504 usec
BSS 00:1b:53:11:dc:40 (on eth1)
TSF: 286410000 usec (0d, 00:04:46)
freq: 2412
beacon interval: 100
capability: ESS Privacy (0x0011)
signal: 64/100
SSID: MNWPA
Supported rates: 11.0*
DS Parameter set: channel 1
ERP: NonERP_Present Use_Protection Barker_Preamble_Mode
WMM: * Parameter version 1
* u-APSD
* BE: CW 31-1023, AIFSN 3
* BK: CW 31-1023, AIFSN 7
* VI: CW 15-31, AIFSN 2, TXOP 3008 usec
* VO: CW 7-15, AIFSN 2, TXOP 1504 usec
# iw eth1 scan trigger freq 2417 2462
# iw eth1 scan ssid MNWPA
Index: linux-wl/drivers/net/wireless/libertas/cfg.c
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/cfg.c 2009-10-06 15:23:34.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/cfg.c 2009-10-06 15:23:48.000000000 +0200
@@ -7,9 +7,34 @@
*/
#include <net/cfg80211.h>
+#include <asm/unaligned.h>
#include "cfg.h"
#include "cmd.h"
+#include "host.h"
+
+/*
+ * When scanning, the firmware doesn't send a nul packet with the power-safe
+ * bit on to the AP. So we cannot stay away from our current channel too
+ * long, otherwise we loose data. So take a "nap" while scanning every other
+ * while.
+ */
+#define LBS_SCAN_MAX_CHANNELS_BEFORE_NAP 4
+
+/* Memory needed to store a max sized channel List TLV for a firmware scan */
+#define CHAN_TLV_MAX_SIZE (sizeof(struct mrvl_ie_header) \
+ + (MRVDRV_MAX_CHANNELS_PER_SCAN \
+ * sizeof(struct chanscanparamset)))
+
+/* Memory needed to store a max number/size SSID TLV for a firmware scan */
+#define SSID_TLV_MAX_SIZE (1 * sizeof(struct mrvl_ie_ssid_param_set))
+
+/* Maximum memory needed for a cmd_ds_802_11_scan with all TLVs at max */
+#define MAX_SCAN_CFG_ALLOC (sizeof(struct cmd_ds_802_11_scan) \
+ + CHAN_TLV_MAX_SIZE + SSID_TLV_MAX_SIZE)
+
+/* Scan time specified in the channel TLV for each channel for active scans */
+#define MRVDRV_ACTIVE_SCAN_CHAN_TIME 100
#define CHAN2G(_channel, _freq, _flags) { \
@@ -77,6 +102,10 @@ static const u32 cipher_suites[] = {
+/***************************************************************************
+ * Set Channel
+ */
+
static int lbs_cfg_set_channel(struct wiphy *wiphy,
struct ieee80211_channel *chan,
enum nl80211_channel_type channel_type)
@@ -97,10 +126,374 @@ static int lbs_cfg_set_channel(struct wi
}
+/***************************************************************************
+ * Scanning
+ */
+
+static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy,
+ struct cmd_header *resp)
+{
+ struct cmd_ds_802_11_scan_rsp *scanresp = (void *)resp;
+ int bsssize;
+ u8 *pos;
+ uint16_t nr_sets;
+ u8 *tsfdesc;
+ int tsfsize;
+ int i;
+ int ret = -EILSEQ;
+
+ bsssize = get_unaligned_le16(&scanresp->bssdescriptsize);
+ nr_sets = le16_to_cpu(resp->size);
+
+ /* The general layout of the scan response is described in
+ * chapter 5.7.1. Basically we have common part, then
+ * one data section for each returned BSS, and then again
+ * one data section containing TSFs. Sample:
+ *
+ * cmd_ds_802_11_scan_rsp
+ * cmd_header
+ * pos_size
+ * nr_sets
+ * bssdesc 1
+ * bssid
+ * rssi
+ * intvl
+ * capa
+ * IEs
+ * bssdesc 2
+ * bssdesc n
+ * MrvlIEtypes_TsfFimestamp_t
+ * TSF for BSS 1
+ * TSF for BSS 2
+ * TSF for BSS n
+ */
+
+ pos = scanresp->bssdesc_and_tlvbuffer;
+
+ tsfdesc = pos + bsssize;
+ tsfsize = 4 + 8 * scanresp->nr_sets;
+
+ /* Validity check: we expect a Marvell-Local IE */
+ i = get_unaligned_le16(tsfdesc);
+ tsfdesc += 2;
+ if (i != 0x0113)
+ goto done;
+ /* Validity check: the IE holds TSF values with 8 bytes each,
+ * so the size in the IE must match the nr_sets value */
+ i = get_unaligned_le16(tsfdesc);
+ tsfdesc += 2;
+ if (i / 8 != scanresp->nr_sets)
+ goto done;
+
+ for (i = 0; i < scanresp->nr_sets; i++) {
+ u8 *bssid;
+ u8 *ie;
+ int left;
+ int ielen;
+ u8 rssi;
+ uint16_t intvl;
+ uint16_t capa;
+ int chan_no = -1;
+
+ int len = get_unaligned_le16(pos);
+ pos += 2;
+
+ /* BSSID */
+ bssid = pos;
+ pos += ETH_ALEN;
+ /* RSSI */
+ rssi = *pos++;
+ /* Packet time stamp */
+ pos += 8;
+ /* Beacon interval */
+ intvl = get_unaligned_le16(pos);
+ pos += 2;
+ /* Capabilities */
+ capa = get_unaligned_le16(pos);
+ pos += 2;
+
+ /* To find out the channel, we must parse the IEs */
+ ie = pos;
+ ielen = left = len - 6-1-8-2-2;
+ while (left >= 2) {
+ u8 id, elen;
+ id = *pos++;
+ elen = *pos++;
+ left -= 2;
+ if (elen > left || elen == 0)
+ goto done;
+ if (id == WLAN_EID_DS_PARAMS)
+ chan_no = *pos;
+ left -= elen;
+ pos += elen;
+ }
+
+ if (chan_no != -1) {
+ struct wiphy *wiphy = priv->wdev->wiphy;
+ int freq = ieee80211_channel_to_frequency(chan_no);
+ struct ieee80211_channel *channel =
+ ieee80211_get_channel(wiphy, freq);
+ if (channel ||
+ !channel->flags & IEEE80211_CHAN_DISABLED)
+ cfg80211_inform_bss(wiphy, channel,
+ bssid, le64_to_cpu(*(__le64 *)tsfdesc),
+ capa, intvl, ie, ielen, rssi,
+ GFP_KERNEL);
+ }
+
+ tsfdesc += 8;
+ }
+ ret = 0;
+
+ done:
+ lbs_deb_leave_args(LBS_DEB_SCAN, "ret %d", ret);
+ return ret;
+}
+
+
+/*
+ * Add SSID TLV of the form:
+ *
+ * TLV-ID SSID 00 00
+ * length 06 00
+ * ssid 4d 4e 54 45 53 54
+ */
+static int lbs_scan_add_ssid_tlv(struct lbs_private *priv, u8 *tlv)
+{
+ struct mrvl_ie_ssid_param_set *ssid_tlv = (void *)tlv;
+
+ ssid_tlv->header.type = cpu_to_le16(TLV_TYPE_SSID);
+ ssid_tlv->header.len = cpu_to_le16(priv->scan_req->ssids[0].ssid_len);
+ memcpy(ssid_tlv->ssid, priv->scan_req->ssids[0].ssid,
+ priv->scan_req->ssids[0].ssid_len);
+ return sizeof(ssid_tlv->header) + priv->scan_req->ssids[0].ssid_len;
+}
+
+
+/*
+ * Add CHANLIST TLV of the form:
+ *
+ * TLV-ID CHANLIST 01 01
+ * length 0e 00
+ * channel 00 01 00 00 00 64 00
+ * radio type 00
+ * channel 01
+ * scan type 00
+ * min scan time 00 00
+ * max scan time 64 00
+ * channel 2 00 02 00 00 00 64 00
+ *
+ * It adds the channel from priv->scan_channel to the TLV. Actual channel
+ * data comes from priv->wiphy->channels.
+ */
+static int lbs_scan_add_channel_tlv(struct lbs_private *priv, u8 *tlv,
+ int last_channel)
+{
+ int chanscanparamsize = sizeof(struct chanscanparamset) *
+ (last_channel - priv->scan_channel);
+
+ struct mrvl_ie_header *header = (void *) tlv;
+
+ header->type = cpu_to_le16(TLV_TYPE_CHANLIST);
+ header->len = cpu_to_le16(chanscanparamsize);
+ tlv += sizeof(struct mrvl_ie_header);
+
+ lbs_deb_scan("scan from %d to %d, size %d\n", priv->scan_channel,
+ last_channel, chanscanparamsize);
+ memset(tlv, 0, chanscanparamsize);
+
+ while (priv->scan_channel < last_channel) {
+ struct chanscanparamset *param = (void *) tlv;
+
+ param->radiotype = CMD_SCAN_RADIO_TYPE_BG;
+ param->channumber =
+ priv->scan_req->channels[priv->scan_channel]->hw_value;
+ /* TODO param->.chanscanmode.passivescan = 1; */
+ param->maxscantime = cpu_to_le16(MRVDRV_ACTIVE_SCAN_CHAN_TIME);
+ tlv += sizeof(struct chanscanparamset);
+ priv->scan_channel++;
+ }
+ return sizeof(struct mrvl_ie_header) + chanscanparamsize;
+}
+
+
+/*
+ * Add RATES TLV of the form
+ *
+ * TLV-ID RATES 01 00
+ * length 0e 00
+ * rates 82 84 8b 96 0c 12 18 24 30 48 60 6c
+ *
+ * The rates are in lbs_bg_rates[], but for the 802.11b
+ * rates the high bit is set. We add this TLV only because
+ * there's a firmware which otherwise doesn't report all
+ * APs in range.
+ */
+static int lbs_scan_add_rates_tlv(u8 *tlv)
+{
+ int i;
+ struct mrvl_ie_rates_param_set *rate_tlv = (void *)tlv;
+
+ rate_tlv->header.type = cpu_to_le16(TLV_TYPE_RATES);
+ tlv += sizeof(rate_tlv->header);
+ for (i = 0; i < ARRAY_SIZE(lbs_rates); i++) {
+ *tlv = lbs_rates[i].hw_value;
+ /* This code makes sure that the 802.11b rates (1 MBit/s, 2
+ MBit/s, 5.5 MBit/s and 11 MBit/s get's the high bit set.
+ Note that the values are MBit/s * 2, to mark them as
+ basic rates so that the firmware likes it better */
+ if (*tlv == 0x02 || *tlv == 0x04 ||
+ *tlv == 0x0b || *tlv == 0x16)
+ *tlv |= 0x80;
+ tlv++;
+ }
+ rate_tlv->header.len = cpu_to_le16(i);
+ return sizeof(rate_tlv->header) + i;
+}
+
+/*
+ * Assumes priv->scan_req is initialized and valid
+ * Assumes priv->scan_channel is initialized
+ */
+void lbs_cfg_scan_worker(struct work_struct *work)
+{
+ struct lbs_private *priv =
+ container_of(work, struct lbs_private, scan_work.work);
+ struct cmd_ds_802_11_scan *scan_cmd;
+ u8 *tlv; /* pointer into our current, growing TLV storage area */
+ int last_channel;
+
+ lbs_deb_enter(LBS_DEB_SCAN);
+
+ /* create the fixed part for scan command */
+ scan_cmd = kzalloc(MAX_SCAN_CFG_ALLOC, GFP_KERNEL);
+ if (scan_cmd == NULL)
+ goto out_no_scan_cmd;
+ tlv = scan_cmd->tlvbuffer;
+
+ netif_stop_queue(priv->dev);
+ netif_carrier_off(priv->dev);
+ if (priv->mesh_dev) {
+ netif_stop_queue(priv->mesh_dev);
+ netif_carrier_off(priv->mesh_dev);
+ }
+
+ scan_cmd->bsstype = CMD_BSS_TYPE_ANY;
+
+ /* add SSID TLV */
+ if (priv->scan_req->n_ssids)
+ tlv += lbs_scan_add_ssid_tlv(priv, tlv);
+
+ /* add channel TLVs */
+ last_channel = priv->scan_channel + LBS_SCAN_MAX_CHANNELS_BEFORE_NAP;
+ if (last_channel > priv->scan_req->n_channels)
+ last_channel = priv->scan_req->n_channels;
+ tlv += lbs_scan_add_channel_tlv(priv, tlv, last_channel);
+
+ /* add rates TLV */
+ tlv += lbs_scan_add_rates_tlv(tlv);
+
+ if (priv->scan_channel < priv->scan_req->n_channels) {
+ lbs_deb_scan("reschedule scan\n");
+ cancel_delayed_work(&priv->scan_work);
+ queue_delayed_work(priv->work_thread, &priv->scan_work,
+ msecs_to_jiffies(300));
+ }
+
+ /* This is the final data we are about to send */
+ scan_cmd->hdr.size = cpu_to_le16(tlv - (u8 *)scan_cmd);
+ lbs_deb_hex(LBS_DEB_SCAN, "SCAN_CMD", (void *)scan_cmd,
+ sizeof(*scan_cmd));
+ lbs_deb_hex(LBS_DEB_SCAN, "SCAN_TLV", scan_cmd->tlvbuffer,
+ tlv - scan_cmd->tlvbuffer);
+
+ __lbs_cmd(priv, CMD_802_11_SCAN, &scan_cmd->hdr,
+ le16_to_cpu(scan_cmd->hdr.size),
+ lbs_ret_scan, 0);
+
+ if (priv->scan_channel >= priv->scan_req->n_channels) {
+ /* Mark scan done */
+ cfg80211_scan_done(priv->scan_req, false);
+ priv->scan_req = NULL;
+ }
+
+ if (priv->connect_status == LBS_CONNECTED) {
+ netif_carrier_on(priv->dev);
+ if (!priv->tx_pending_len)
+ netif_wake_queue(priv->dev);
+ }
+ if (priv->mesh_dev && (priv->mesh_connect_status == LBS_CONNECTED)) {
+ netif_carrier_on(priv->mesh_dev);
+ if (!priv->tx_pending_len)
+ netif_wake_queue(priv->mesh_dev);
+ }
+ kfree(scan_cmd);
+
+ out_no_scan_cmd:
+ lbs_deb_leave(LBS_DEB_CFG80211);
+}
+
+
+static int lbs_cfg_scan(struct wiphy *wiphy,
+ struct net_device *dev,
+ struct cfg80211_scan_request *request)
+{
+ struct lbs_private *priv = wiphy_priv(wiphy);
+ int ret = 0;
+
+ lbs_deb_enter(LBS_DEB_CFG80211);
+
+ if (priv->scan_req || delayed_work_pending(&priv->scan_work)) {
+ /* old scan request not yet processed */
+ ret = -EAGAIN;
+ goto out;
+ }
+
+ lbs_deb_cfg80211("n_ssids %d, n_channels %d, ie_len %d\n",
+ request->n_ssids, request->n_channels, request->ie_len);
+
+ priv->scan_channel = 0;
+ queue_delayed_work(priv->work_thread, &priv->scan_work,
+ msecs_to_jiffies(50));
+
+ if (priv->surpriseremoved)
+ ret = -EIO;
+
+ priv->scan_req = request;
+
+ out:
+ lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
+ return ret;
+}
+
+
+int lbs_send_specific_ssid_scan(struct lbs_private *priv, u8 *ssid,
+ u8 ssid_len)
+{
+ lbs_deb_enter(LBS_DEB_SCAN);
+
+ /* TODO */
+ return -ENOTSUPP;
+}
+
+
+int lbs_scan_networks(struct lbs_private *priv, int full_scan)
+{
+ lbs_deb_enter(LBS_DEB_SCAN);
+
+ /* TODO */
+ return -ENOTSUPP;
+
+}
+
+/***************************************************************************
+ * Initialization
+ */
static struct cfg80211_ops lbs_cfg80211_ops = {
.set_channel = lbs_cfg_set_channel,
+ .scan = lbs_cfg_scan,
};
@@ -153,7 +546,8 @@ int lbs_cfg_register(struct lbs_private
lbs_deb_enter(LBS_DEB_CFG80211);
wdev->wiphy->max_scan_ssids = 1;
- wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
+ wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_UNSPEC;
+ /* TODO: convert to CFG80211_SIGNAL_TYPE_MBM; */
/* TODO: BIT(NL80211_IFTYPE_ADHOC); */
wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
Index: linux-wl/drivers/net/wireless/libertas/dev.h
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/dev.h 2009-10-06 15:22:40.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/dev.h 2009-10-06 15:23:48.000000000 +0200
@@ -10,6 +10,7 @@
#include <linux/wireless.h>
#include <linux/ethtool.h>
#include <linux/debugfs.h>
+#include <net/cfg80211.h>
#include "defs.h"
#include "hostcmd.h"
@@ -101,6 +102,7 @@ struct lbs_mesh_stats {
/** Private structure for the MV device */
struct lbs_private {
struct wireless_dev *wdev;
+ struct cfg80211_scan_request *scan_req;
int mesh_open;
int mesh_fw_ver;
int infra_open;
Index: linux-wl/drivers/net/wireless/libertas/wext.c
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/wext.c 2009-10-06 15:22:40.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/wext.c 2009-10-06 15:23:48.000000000 +0200
@@ -17,7 +17,6 @@
#include "defs.h"
#include "dev.h"
#include "wext.h"
-#include "scan.h"
#include "assoc.h"
#include "cmd.h"
@@ -2346,8 +2345,8 @@ static const iw_handler lbs_handler[] =
(iw_handler) lbs_get_wap, /* SIOCGIWAP */
(iw_handler) NULL, /* SIOCSIWMLME */
(iw_handler) NULL, /* SIOCGIWAPLIST - deprecated */
- (iw_handler) lbs_set_scan, /* SIOCSIWSCAN */
- (iw_handler) lbs_get_scan, /* SIOCGIWSCAN */
+ (iw_handler) NULL, /* SIOCSIWSCAN */
+ (iw_handler) NULL, /* SIOCGIWSCAN */
(iw_handler) lbs_set_essid, /* SIOCSIWESSID */
(iw_handler) lbs_get_essid, /* SIOCGIWESSID */
(iw_handler) lbs_set_nick, /* SIOCSIWNICKN */
@@ -2404,8 +2403,8 @@ static const iw_handler mesh_wlan_handle
(iw_handler) NULL, /* SIOCGIWAP */
(iw_handler) NULL, /* SIOCSIWMLME */
(iw_handler) NULL, /* SIOCGIWAPLIST - deprecated */
- (iw_handler) lbs_set_scan, /* SIOCSIWSCAN */
- (iw_handler) lbs_get_scan, /* SIOCGIWSCAN */
+ (iw_handler) NULL, /* SIOCSIWSCAN */
+ (iw_handler) NULL, /* SIOCGIWSCAN */
(iw_handler) lbs_mesh_set_essid,/* SIOCSIWESSID */
(iw_handler) lbs_mesh_get_essid,/* SIOCGIWESSID */
(iw_handler) NULL, /* SIOCSIWNICKN */
Index: linux-wl/drivers/net/wireless/libertas/Makefile
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/Makefile 2009-10-06 15:22:40.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/Makefile 2009-10-06 15:23:48.000000000 +0200
@@ -8,7 +8,8 @@ libertas-y += ethtool.o
libertas-y += main.o
libertas-y += persistcfg.o
libertas-y += rx.o
-libertas-y += scan.o
+# TODO
+#libertas-y += scan.o
libertas-y += tx.o
libertas-y += wext.o
Index: linux-wl/drivers/net/wireless/libertas/assoc.c
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/assoc.c 2009-10-06 15:22:40.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/assoc.c 2009-10-06 15:23:48.000000000 +0200
@@ -9,7 +9,7 @@
#include "assoc.h"
#include "decl.h"
#include "host.h"
-#include "scan.h"
+#include "cfg.h"
#include "cmd.h"
static const u8 bssid_any[ETH_ALEN] __attribute__ ((aligned (2))) =
@@ -495,6 +495,23 @@ done:
}
/**
+ * @brief Compare two SSIDs
+ *
+ * @param ssid1 A pointer to ssid to compare
+ * @param ssid2 A pointer to ssid to compare
+ *
+ * @return 0: ssid is same, otherwise is different
+ */
+static int lbs_ssid_cmp(uint8_t *ssid1, uint8_t ssid1_len, uint8_t *ssid2,
+ uint8_t ssid2_len)
+{
+ if (ssid1_len != ssid2_len)
+ return -1;
+
+ return memcmp(ssid1, ssid2, ssid1_len);
+}
+
+/**
* @brief Join an adhoc network found in a previous scan
*
* @param priv A pointer to struct lbs_private structure
Index: linux-wl/drivers/net/wireless/libertas/main.c
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/main.c 2009-10-06 15:22:40.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/main.c 2009-10-06 15:23:48.000000000 +0200
@@ -22,7 +22,7 @@
#include "wext.h"
#include "cfg.h"
#include "debugfs.h"
-#include "scan.h"
+#include "cfg.h"
#include "assoc.h"
#include "cmd.h"
@@ -1133,7 +1133,8 @@ static void lbs_sync_channel_worker(stru
lbs_deb_leave(LBS_DEB_MAIN);
}
-
+/* TODO */
+#define MAX_NETWORK_COUNT 128
static int lbs_init_adapter(struct lbs_private *priv)
{
size_t bufsize;
@@ -1313,7 +1314,7 @@ struct lbs_private *lbs_add_card(void *c
priv->work_thread = create_singlethread_workqueue("lbs_worker");
INIT_DELAYED_WORK(&priv->assoc_work, lbs_association_worker);
- INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker);
+ INIT_DELAYED_WORK(&priv->scan_work, lbs_cfg_scan_worker);
INIT_WORK(&priv->mcast_work, lbs_set_mcast_worker);
INIT_WORK(&priv->sync_channel, lbs_sync_channel_worker);
Index: linux-wl/drivers/net/wireless/libertas/persistcfg.c
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/persistcfg.c 2009-10-06 15:22:40.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/persistcfg.c 2009-10-06 15:23:48.000000000 +0200
@@ -11,7 +11,6 @@
#include "dev.h"
#include "wext.h"
#include "debugfs.h"
-#include "scan.h"
#include "assoc.h"
#include "cmd.h"
Index: linux-wl/drivers/net/wireless/libertas/scan.c
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/scan.c 2009-10-06 15:22:40.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/scan.c 2009-10-06 15:23:48.000000000 +0200
@@ -3,6 +3,8 @@
*
* IOCTL handlers as well as command preperation and response routines
* for sending scan commands to the firmware.
+ *
+ * TODO: remove this file
*/
#include <linux/types.h>
#include <linux/kernel.h>
@@ -90,23 +92,6 @@ static inline void clear_bss_descriptor(
memset(bss, 0, offsetof(struct bss_descriptor, list));
}
-/**
- * @brief Compare two SSIDs
- *
- * @param ssid1 A pointer to ssid to compare
- * @param ssid2 A pointer to ssid to compare
- *
- * @return 0: ssid is same, otherwise is different
- */
-int lbs_ssid_cmp(uint8_t *ssid1, uint8_t ssid1_len, uint8_t *ssid2,
- uint8_t ssid2_len)
-{
- if (ssid1_len != ssid2_len)
- return -1;
-
- return memcmp(ssid1, ssid2, ssid1_len);
-}
-
static inline int is_same_network(struct bss_descriptor *src,
struct bss_descriptor *dst)
{
Index: linux-wl/drivers/net/wireless/libertas/scan.h
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/scan.h 2009-10-06 15:22:40.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/scan.h 2009-10-06 15:23:48.000000000 +0200
@@ -1,3 +1,6 @@
+#error don't include scan.h
+/* TODO: remove this file */
+
/**
* Interface for the wlan network scan routines
*
--
http://www.holgerschurig.de
^ permalink raw reply
* Re: [PATCH 08/13] iwlwifi: device tracing
From: Stanislaw Gruszka @ 2009-10-06 14:48 UTC (permalink / raw)
To: Reinette Chatre; +Cc: linville, linux-wireless, ipw3945-devel, Johannes Berg
In-Reply-To: <1254516247-4085-9-git-send-email-reinette.chatre@intel.com>
On Fri, Oct 02, 2009 at 01:44:02PM -0700, Reinette Chatre wrote:
> From: Johannes Berg <johannes@sipsolutions.net>
>
> In order to have an easier way to debug issues, create
> trace events (using the ftrace framework) that will
> allow us to follow exactly what the driver is doing
> with the device.
Cool.
> The text format isn't all that useful, but the binary
> format can also be obtained easily via debugfs and
> then analysed on the fly or offline with debugging
> tools.
What particular tool is most useful here (Yes, I didn't read
Documentation/trace yet) ?
Shouldn't we also remove or at least rewrite IWL_DEBUG_{IO,TX,RX}
to simplify things and remove double functionality ?
> diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace.c b/drivers/net/wireless/iwlwifi/iwl-devtrace.c
> new file mode 100644
> index 0000000..4ef5aca
> --- /dev/null
> +++ b/drivers/net/wireless/iwlwifi/iwl-devtrace.c
> @@ -0,0 +1,13 @@
> +#include <linux/module.h>
> +
> +/* sparse doesn't like tracepoint macros */
> +#ifndef __CHECKER__
> +#define CREATE_TRACE_POINTS
> +#include "iwl-devtrace.h"
> +
> +EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_ioread32);
> +EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_iowrite32);
> +EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_rx);
Missed EXPORT_TRACEPOINT_SYMBOL(iwlwif_dev_tx) ?
> +EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_ucode_event);
> +EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_ucode_error);
> +#endif
Beside, shouldn't we have two trace point - one when sending data to device
second when getting ACK in rx queue ?
Stanislaw
^ permalink raw reply
* Re: [PATCH 08/13] iwlwifi: device tracing
From: Johannes Berg @ 2009-10-06 14:59 UTC (permalink / raw)
To: Stanislaw Gruszka
Cc: Reinette Chatre, linville, linux-wireless, ipw3945-devel
In-Reply-To: <20091006144801.GA3827@dhcp-lab-161.englab.brq.redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1033 bytes --]
On Tue, 2009-10-06 at 16:48 +0200, Stanislaw Gruszka wrote:
> > The text format isn't all that useful, but the binary
> > format can also be obtained easily via debugfs and
> > then analysed on the fly or offline with debugging
> > tools.
>
> What particular tool is most useful here (Yes, I didn't read
> Documentation/trace yet) ?
None really yet. Maybe trace-cmd.
> Shouldn't we also remove or at least rewrite IWL_DEBUG_{IO,TX,RX}
> to simplify things and remove double functionality ?
Maybe. But right now people are probably still using the printk
debugging.
> > +EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_ioread32);
> > +EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_iowrite32);
> > +EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_rx);
>
> Missed EXPORT_TRACEPOINT_SYMBOL(iwlwif_dev_tx) ?
No.
> Beside, shouldn't we have two trace point - one when sending data to device
> second when getting ACK in rx queue ?
Could be useful at some point, I guess. Besides, tracepoints can be
added at will.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [PATCH] mac80211: use kfree_skb() to free struct sk_buff pointers
From: Luis R. Rodriguez @ 2009-10-06 15:37 UTC (permalink / raw)
To: Roel Kluin; +Cc: Johannes Berg, linux-wireless, Andrew Morton
In-Reply-To: <4ACB4BA3.9090406@gmail.com>
On Tue, Oct 6, 2009 at 9:52 AM, Roel Kluin <roel.kluin@gmail.com> wrote:
> kfree_skb() should be used to free struct sk_buff pointers.
cc'ing stable would be good for this one it seems.
Luis
^ permalink raw reply
* Re: [.32-rc3] scheduler: iwlagn consistently high in "waiting for CPU"
From: Frans Pop @ 2009-10-06 15:49 UTC (permalink / raw)
To: Arjan van de Ven
Cc: Linux Kernel Mailing List, Ingo Molnar, Peter Zijlstra,
linux-wireless
In-Reply-To: <20091005072428.16ce40e4@infradead.org>
On Monday 05 October 2009, Arjan van de Ven wrote:
> On Mon, 5 Oct 2009 16:13:31 +0200 Frans Pop <elendil@planet.nl> wrote:
> > On Monday 05 October 2009, Frans Pop wrote:
> > > With .32-rc3 I'm getting occasional skips from amarok while playing
> > > music from an NFS share (3 today so far), something I've not had in
> > > a long time.
> > >
> > > The reason looks to be that latencytop consistently shows 'iwlagn'
> > > as the top affected process with "Scheduler: waiting for CPU".
> > > Values of 100-140 ms occur frequently, but I've also seen higher
> > > values (180, 207). I don't remember seeing iwlagn high in the list
> > > before, but I have not checked earlier kernels yet.
> > >
> > > Added to that 'phy0' also frequently shows high with values of
> > > 25-75 ms.
I've checked for 2.6.31.1 now and iwlagn is listed high there too when the
system is idle, but with normal values of 60-100 ms. And phy0 has normal
values of below 10 ms.
I've now rebooted with today's mainline git; phy0 now frequently shows with
values of around 100 ms too (i.e. higher than last time).
Both still go way down as soon as the system is given work to do.
> > If I give the system some work to do (like compiling a kernel), the
> > latencies on iwlagn and phy0 disappear (values < 5 ms).
> > Is this related to ondemand frequency scaling?
>
> shouldn't be.... but
>
> can you do a 5 second or so timechart recording of this?
> That will capture all scheduler delays as well as the P states etc....
With a 5 second sleep I was unable to get any significant latencies (I
started perf on a latencytop refresh and did a manual refresh as it
finished to see what happened during the perf run). The perf run does seem
to affect the latencies.
I've uploaded a chart for a 10s sleep during which I got latencies of 101ms
for iwlagn and 77ms for phy0: http://people.debian.org/~fjp/tmp/kernel/.
I've also uploaded the raw data as the colors in the chart looked off to me
(CPU bars were mostly black in Debian unstable's inkscape). I can't make
much from the chart TBH, but maybe you can.
Not sure what to do with this. For now I'd suggest to ignore it as it's all
a bit vague. Unless of course you feel the latencies are higher than they
should be.
I'll see if I get more skips and what latencies I get during them.
Cheers,
FJP
^ permalink raw reply
* Re: [ath9k-devel] [RFT 0/4] ath9k: fix oops during driver unload
From: Luis R. Rodriguez @ 2009-10-06 15:58 UTC (permalink / raw)
To: Vasanthakumar Thiagarajan
Cc: Vasanth Thiagarajan, ath9k-devel@lists.ath9k.org,
linux-wireless@vger.kernel.org, Luis Rodriguez
In-Reply-To: <20091006055222.GA26591@vasanth-laptop>
On Tue, Oct 6, 2009 at 1:52 AM, Vasanthakumar Thiagarajan
<vasanth@atheros.com> wrote:
> On Tue, Oct 06, 2009 at 09:23:17AM +0530, Luis Rodriguez wrote:
>> This should fix an oops reported by Vasanth.
>> Vasanth my rc3 poos out, can you let me know if this
>> fixes the issue you saw?
>>
>> Luis R. Rodriguez (4):
>> ath9k: move common->debug_mask setting to ath_init_softc()
>> ath9k: fix oops during unload -- initialize hw prior to debugfs
>> ath9k: add helper to un-init the hw properly
>> ath9k: rename ath_beaconq_setup() to ath9k_hw_beaconq_setup()
>>
>> drivers/net/wireless/ath/ath.h | 6 ++++
>> drivers/net/wireless/ath/ath9k/ath9k.h | 1 -
>> drivers/net/wireless/ath/ath9k/beacon.c | 12 -------
>> drivers/net/wireless/ath/ath9k/debug.c | 5 ---
>> drivers/net/wireless/ath/ath9k/hw.c | 11 ++++++-
>> drivers/net/wireless/ath/ath9k/mac.c | 13 ++++++++
>> drivers/net/wireless/ath/ath9k/mac.h | 1 +
>> drivers/net/wireless/ath/ath9k/main.c | 50 ++++++++++++++++++------------
>> 8 files changed, 60 insertions(+), 39 deletions(-)
>>
>
> The issue is not fixed completely, ah->common is used after ah is
> freed in ath_cleanup() which makes rmmod ath9k stuck in the middle.
Thanks I'll fix that as well.
Luis
^ permalink raw reply
* [PATCH] b43: do not stack-allocate pio rx/tx header buffers
From: Albert Herranz @ 2009-10-06 16:20 UTC (permalink / raw)
To: bcm43xx-dev, mb; +Cc: linux-wireless, Albert Herranz
The DMA-API debugging facility complains about b43 mapping memory from
stack for SDIO-based cards, as can be seen in the following two
stack traces.
Call Trace:
[d2ef7c60] [c01c55f0] check_for_stack+0xf4/0x10c (unreliable)
[d2ef7c80] [c01c6d10] debug_dma_map_sg+0xc4/0x134
[d2ef7cb0] [c0281e10] sdhci_prepare_data+0x200/0x590
[d2ef7ce0] [c0282288] sdhci_send_command+0xe8/0x320
[d2ef7d00] [c02825e0] sdhci_request+0x120/0x1b4
[d2ef7d20] [c0277ad4] mmc_wait_for_req+0x124/0x140
[d2ef7d50] [c027c2f0] mmc_io_rw_extended+0x188/0x214
[d2ef7e10] [c027d7c4] sdio_io_rw_ext_helper+0x104/0x224
[d2ef7e40] [c0296000] ssb_sdio_block_read+0xac/0x110
[d2ef7e60] [c0237f98] pio_rx_frame+0x1d0/0x43c
[d2ef7eb0] [c0238244] b43_pio_rx+0x40/0x90
[d2ef7ed0] [c0226124] b43_do_interrupt_thread+0x108/0x444
[d2ef7f30] [c0226504] b43_sdio_interrupt_handler+0x58/0x74
[d2ef7f40] [c0239110] b43_sdio_interrupt_dispatcher+0x4c/0x68
[d2ef7f60] [c027e1ac] sdio_irq_thread+0xf8/0x284
[d2ef7fb0] [c0054538] kthread+0x78/0x7c
[d2ef7ff0] [c00124ec] kernel_thread+0x4c/0x68
Call Trace:
[d3335c20] [c01c55f0] check_for_stack+0xf4/0x10c (unreliable)
[d3335c40] [c01c6d10] debug_dma_map_sg+0xc4/0x134
[d3335c70] [c0281e14] sdhci_prepare_data+0x200/0x590
[d3335ca0] [c028228c] sdhci_send_command+0xe8/0x320
[d3335cc0] [c02825e4] sdhci_request+0x120/0x1b4
[d3335ce0] [c0277ad8] mmc_wait_for_req+0x124/0x140
[d3335d10] [c027c2f4] mmc_io_rw_extended+0x188/0x214
[d3335dd0] [c027d86c] sdio_io_rw_ext_helper+0x1a8/0x224
[d3335e00] [c0295ef4] ssb_sdio_block_write+0xac/0x110
[d3335e20] [c0237a18] tx_write_4byte_queue+0x6c/0x138
[d3335e40] [c0238610] pio_tx_frame+0x1c4/0x224
[d3335ee0] [c0238718] b43_pio_tx+0xa8/0x1f4
[d3335f00] [c0220380] b43_tx_work+0x4c/0xe0
[d3335f20] [c004fa74] run_workqueue+0x120/0x1a4
[d3335f70] [c004fb44] worker_thread+0x4c/0xb0
[d3335fb0] [c0054538] kthread+0x78/0x7c
[d3335ff0] [c00124ec] kernel_thread+0x4c/0x68
Indeed, b43 currently allocates the PIO RX and TX header buffers
from stack. The solution here is to use heap-allocated buffers instead.
Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
---
drivers/net/wireless/b43/b43.h | 9 ++++++++
drivers/net/wireless/b43/pio.c | 42 +++++++++++++++++++++++++++------------
2 files changed, 38 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index fa1549a..b09dda1 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -550,6 +550,9 @@ struct b43_dma {
struct b43_pio_txqueue;
struct b43_pio_rxqueue;
+struct b43_rxhdr_fw4;
+struct b43_txhdr;
+
/* Data structures for PIO transmission, per 80211 core. */
struct b43_pio {
struct b43_pio_txqueue *tx_queue_AC_BK; /* Background */
@@ -559,6 +562,12 @@ struct b43_pio {
struct b43_pio_txqueue *tx_queue_mcast; /* Multicast */
struct b43_pio_rxqueue *rx_queue;
+
+ /*
+ * RX/TX header buffers used by the frame transmit functions.
+ */
+ struct b43_rxhdr_fw4 *rxhdr;
+ struct b43_txhdr *txhdr;
};
/* Context information for a noise calculation (Link Quality). */
diff --git a/drivers/net/wireless/b43/pio.c b/drivers/net/wireless/b43/pio.c
index e96091b..45aa6e2 100644
--- a/drivers/net/wireless/b43/pio.c
+++ b/drivers/net/wireless/b43/pio.c
@@ -241,6 +241,9 @@ void b43_pio_free(struct b43_wldev *dev)
destroy_queue_tx(pio, tx_queue_AC_VI);
destroy_queue_tx(pio, tx_queue_AC_BE);
destroy_queue_tx(pio, tx_queue_AC_BK);
+
+ kfree(pio->rxhdr);
+ kfree(pio->txhdr);
}
int b43_pio_init(struct b43_wldev *dev)
@@ -276,11 +279,23 @@ int b43_pio_init(struct b43_wldev *dev)
if (!pio->rx_queue)
goto err_destroy_mcast;
+ pio->rxhdr = kzalloc(sizeof(*pio->rxhdr), GFP_KERNEL);
+ if (!pio->rxhdr)
+ goto err_destroy_rx;
+
+ pio->txhdr = kzalloc(sizeof(*pio->txhdr), GFP_KERNEL);
+ if (!pio->txhdr)
+ goto err_destroy_rxhdr;
+
b43dbg(dev->wl, "PIO initialized\n");
err = 0;
out:
return err;
+err_destroy_rxhdr:
+ kfree(pio->rxhdr);
+err_destroy_rx:
+ destroy_queue_rx(pio, rx_queue);
err_destroy_mcast:
destroy_queue_tx(pio, tx_queue_mcast);
err_destroy_vo:
@@ -435,8 +450,9 @@ static void pio_tx_frame_4byte_queue(struct b43_pio_txpacket *pack,
static int pio_tx_frame(struct b43_pio_txqueue *q,
struct sk_buff *skb)
{
+ struct b43_wldev *dev = q->dev;
+ struct b43_pio *pio = &dev->pio;
struct b43_pio_txpacket *pack;
- struct b43_txhdr txhdr;
u16 cookie;
int err;
unsigned int hdrlen;
@@ -447,8 +463,8 @@ static int pio_tx_frame(struct b43_pio_txqueue *q,
struct b43_pio_txpacket, list);
cookie = generate_cookie(q, pack);
- hdrlen = b43_txhdr_size(q->dev);
- err = b43_generate_txhdr(q->dev, (u8 *)&txhdr, skb,
+ hdrlen = b43_txhdr_size(dev);
+ err = b43_generate_txhdr(dev, (u8 *)pio->txhdr, skb,
info, cookie);
if (err)
return err;
@@ -456,15 +472,15 @@ static int pio_tx_frame(struct b43_pio_txqueue *q,
if (info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) {
/* Tell the firmware about the cookie of the last
* mcast frame, so it can clear the more-data bit in it. */
- b43_shm_write16(q->dev, B43_SHM_SHARED,
+ b43_shm_write16(dev, B43_SHM_SHARED,
B43_SHM_SH_MCASTCOOKIE, cookie);
}
pack->skb = skb;
if (q->rev >= 8)
- pio_tx_frame_4byte_queue(pack, (const u8 *)&txhdr, hdrlen);
+ pio_tx_frame_4byte_queue(pack, (const u8 *)pio->txhdr, hdrlen);
else
- pio_tx_frame_2byte_queue(pack, (const u8 *)&txhdr, hdrlen);
+ pio_tx_frame_2byte_queue(pack, (const u8 *)pio->txhdr, hdrlen);
/* Remove it from the list of available packet slots.
* It will be put back when we receive the status report. */
@@ -604,14 +620,14 @@ void b43_pio_get_tx_stats(struct b43_wldev *dev,
static bool pio_rx_frame(struct b43_pio_rxqueue *q)
{
struct b43_wldev *dev = q->dev;
- struct b43_rxhdr_fw4 rxhdr;
+ struct b43_pio *pio = &dev->pio;
u16 len;
u32 macstat;
unsigned int i, padding;
struct sk_buff *skb;
const char *err_msg = NULL;
- memset(&rxhdr, 0, sizeof(rxhdr));
+ memset(pio->rxhdr, 0, sizeof(*pio->rxhdr));
/* Check if we have data and wait for it to get ready. */
if (q->rev >= 8) {
@@ -649,16 +665,16 @@ data_ready:
/* Get the preamble (RX header) */
if (q->rev >= 8) {
- ssb_block_read(dev->dev, &rxhdr, sizeof(rxhdr),
+ ssb_block_read(dev->dev, pio->rxhdr, sizeof(*pio->rxhdr),
q->mmio_base + B43_PIO8_RXDATA,
sizeof(u32));
} else {
- ssb_block_read(dev->dev, &rxhdr, sizeof(rxhdr),
+ ssb_block_read(dev->dev, pio->rxhdr, sizeof(*pio->rxhdr),
q->mmio_base + B43_PIO_RXDATA,
sizeof(u16));
}
/* Sanity checks. */
- len = le16_to_cpu(rxhdr.frame_len);
+ len = le16_to_cpu(pio->rxhdr->frame_len);
if (unlikely(len > 0x700)) {
err_msg = "len > 0x700";
goto rx_error;
@@ -668,7 +684,7 @@ data_ready:
goto rx_error;
}
- macstat = le32_to_cpu(rxhdr.mac_status);
+ macstat = le32_to_cpu(pio->rxhdr->mac_status);
if (macstat & B43_RX_MAC_FCSERR) {
if (!(q->dev->wl->filter_flags & FIF_FCSFAIL)) {
/* Drop frames with failed FCS. */
@@ -723,7 +739,7 @@ data_ready:
}
}
- b43_rx(q->dev, skb, &rxhdr);
+ b43_rx(q->dev, skb, pio->rxhdr);
return 1;
--
1.6.0.4
^ permalink raw reply related
* Re: question about cfg80211_inform_bss()
From: Dave @ 2009-10-06 17:42 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless
In-Reply-To: <200910061418.05039.hs4233@mail.mn-solutions.de>
Holger Schurig wrote:
> However, cfg80211_inform_bss() want's a channel. And it wants the
> IEs as well. A presume it scans those IEs, too. So do we need to
> parse the IEs twice?
That is what orinoco does.
It's slightly worse for non-WPA firmware on orinoco. They supply ssid
and supported rates in a structure, and don't give access to the
original IEs - so the driver has to reconstruct the approporiate IE as
best it can, so cfg80211 can export them (all in orinoco/scan.c).
Dave.
^ permalink raw reply
* Re: Linux wifi development board
From: Joerg Albert @ 2009-10-06 18:59 UTC (permalink / raw)
To: Ahmed A; +Cc: David Acker, linux-wireless
In-Reply-To: <4ACB42CB.7010403@roinet.com>
On 10/06/2009 03:14 PM, David Acker wrote:
> Ahmed A wrote:
>> Hello,
>>
>> I have been looking online for a Linux wifi development board. I have
>> come across a few from small companies (reasonably priced), but most
>> of those companies seem to be out of business. I would appreciate
>> suggestions from anyone that may have used one recently, or suggest a
>> link where I can more info some popular ones.
>>
>> I am mostly interested in doing some software development, prototyping
>> on the "application processor", not on the "baseband processor" (radio
>> part).
>>
>> If there is an alternate mailing list I can post my question, I would
>> appreciate that also.
>
> I have had good luck with boards from Gateworks,
> http://www.gateworks.com/ and radios from Ubiquiti, http://ubnt.com/ .
> All of it is supported by OpenWRT, although I believe that the gw2348-4
> (avila) has mainline support.
If Avila boards are a bit to pricey, you may consider getting an Ubiquity Routerstation (Pro) instead.
It ships with OpenWrt.
Anyhow, just check which devices have OpenWRT mainline support (http://www.openwrt.org) and choose one of them.
If you prefer x86 hardware and more standard distributions you may consider an Alix board
(http://www.pcengines.ch/alix.htm). I've got one here running Debian Lenny on a 8 GByte CompactFlash card.
Both Routerstation and Alix require additional miniPCI (or USB) WLAN cards.
Regards,
Joerg.
^ permalink raw reply
* Bleeding Edge b43 dated since 30 of september no longer working & today does not even compile.
From: Riffer @ 2009-10-06 18:52 UTC (permalink / raw)
To: linux-wireless
Hello!
The problem is described in the topic.
Symptons:
The driver gets loaded and all depending drivers too but the wireless
device does not come up (iwconfig shows nothing, "ADDRCONF(NETDEV_UP):"
does not follow in /var/log/messages after modprobing).
Any hints for me? Maybe a new functionality that has to be triggered?
I am using the bleeding drivers on a Compaq 615 Notebook having PCI ID
14e4:4315 (Broadcom) under Ubuntu 9.04 with kernel
2.6.30-02063006-generic AMD64.
Currently I am testing the bleeding edge driver nearly every day because
I am a very curious man :-) and my hope is to one day find the best
(fast and stable) wireless driver I can get for my notebook ;-)
The most stable driver at the moment (for me) is the archive from the
16th of september and as you can read here
http://forums.opensuse.org/2045067-post38.html bleeding edge had already
a failure that stopped working from 17th to 26th of september (for me)
where Larry pointed to a problem with cfg80211 (I am using WPA2).
Another problem is that the archive from today can not be compiled:
/home/riffer/bleeding/compat-wireless-2009-10-06/drivers/net/wireless/ath/main.o
In file included from
/home/riffer/bleeding/compat-wireless-2009-10-06/include/net/mac80211.h:22,
from
/home/riffer/bleeding/compat-wireless-2009-10-06/drivers/net/wireless/ath/ath.h:22,
from
/home/riffer/bleeding/compat-wireless-2009-10-06/drivers/net/wireless/ath/main.c:20:
/home/riffer/bleeding/compat-wireless-2009-10-06/include/net/cfg80211.h:1146:
Fehler: »ETHTOOL_BUSINFO_LEN« ist hier nicht deklariert (nicht in einer
Funktion)
(translation:
Error »ETHTOOL_BUSINFO_LEN« is not declared here (not in a function))
best regards
p.s.:
I am only a user and not a developer. If my posting to this mailing-list
is a mistake please tell me!!!
--
Riffer
^ permalink raw reply
* Re: Bleeding Edge b43 dated since 30 of september no longer working & today does not even compile.
From: Gábor Stefanik @ 2009-10-06 19:30 UTC (permalink / raw)
To: Riffer; +Cc: linux-wireless
In-Reply-To: <4ACB91E7.5010405@penny.prima.de>
On Tue, Oct 6, 2009 at 8:52 PM, Riffer <riffer@penny.prima.de> wrote:
> Hello!
>
> The problem is described in the topic.
>
> Symptons:
>
> The driver gets loaded and all depending drivers too but the wireless
> device does not come up (iwconfig shows nothing, "ADDRCONF(NETDEV_UP):"
> does not follow in /var/log/messages after modprobing).
>
> Any hints for me? Maybe a new functionality that has to be triggered?
>
> I am using the bleeding drivers on a Compaq 615 Notebook having PCI ID
> 14e4:4315 (Broadcom) under Ubuntu 9.04 with kernel
> 2.6.30-02063006-generic AMD64.
>
That's probably "wext: refactor".
Try connecting manually using iw (not iwconfig).
> Currently I am testing the bleeding edge driver nearly every day because
> I am a very curious man :-) and my hope is to one day find the best
> (fast and stable) wireless driver I can get for my notebook ;-)
>
> The most stable driver at the moment (for me) is the archive from the
> 16th of september and as you can read here
> http://forums.opensuse.org/2045067-post38.html bleeding edge had already
> a failure that stopped working from 17th to 26th of september (for me)
> where Larry pointed to a problem with cfg80211 (I am using WPA2).
>
> Another problem is that the archive from today can not be compiled:
>
> /home/riffer/bleeding/compat-wireless-2009-10-06/drivers/net/wireless/ath/main.o
> In file included from
> /home/riffer/bleeding/compat-wireless-2009-10-06/include/net/mac80211.h:22,
> from
> /home/riffer/bleeding/compat-wireless-2009-10-06/drivers/net/wireless/ath/ath.h:22,
> from
> /home/riffer/bleeding/compat-wireless-2009-10-06/drivers/net/wireless/ath/main.c:20:
> /home/riffer/bleeding/compat-wireless-2009-10-06/include/net/cfg80211.h:1146:
> Fehler: »ETHTOOL_BUSINFO_LEN« ist hier nicht deklariert (nicht in einer
> Funktion)
> (translation:
> Error »ETHTOOL_BUSINFO_LEN« is not declared here (not in a function))
>
> best regards
>
> p.s.:
> I am only a user and not a developer. If my posting to this mailing-list
> is a mistake please tell me!!!
> --
> Riffer
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
^ permalink raw reply
* [PATCH] mac80211: support ETHTOOL_GPERMADDR
From: John W. Linville @ 2009-10-06 20:29 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, John W. Linville
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
net/mac80211/iface.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index b8295cb..3004492 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -184,10 +184,12 @@ static int ieee80211_open(struct net_device *dev)
* No need to check netif_running since we do not allow
* it to start up with this invalid address.
*/
- if (compare_ether_addr(null_addr, ndev->dev_addr) == 0)
+ if (compare_ether_addr(null_addr, ndev->dev_addr) == 0) {
memcpy(ndev->dev_addr,
local->hw.wiphy->perm_addr,
ETH_ALEN);
+ memcpy(ndev->perm_addr, ndev->dev_addr, ETH_ALEN);
+ }
}
/*
@@ -788,6 +790,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
goto fail;
memcpy(ndev->dev_addr, local->hw.wiphy->perm_addr, ETH_ALEN);
+ memcpy(ndev->perm_addr, ndev->dev_addr, ETH_ALEN);
SET_NETDEV_DEV(ndev, wiphy_dev(local->hw.wiphy));
SET_NETDEV_DEVTYPE(ndev, &wiphy_type);
--
1.6.2.5
^ permalink raw reply related
* [PATCH -next] wireless: fix CFG80211_WEXT build problems
From: Randy Dunlap @ 2009-10-06 20:27 UTC (permalink / raw)
To: Stephen Rothwell, linville; +Cc: linux-next, LKML, linux-wireless
In-Reply-To: <20091006165220.b5cb1c44.sfr@canb.auug.org.au>
From: Randy Dunlap <randy.dunlap@oracle.com>
Fix CFG80211_WEXT build dependencies/errors:
ERROR: "cfg80211_wext_siwscan" [drivers/net/wireless/orinoco/orinoco.ko] undefined!
ERROR: "cfg80211_wext_siwmode" [drivers/net/wireless/orinoco/orinoco.ko] undefined!
ERROR: "cfg80211_wext_giwrange" [drivers/net/wireless/orinoco/orinoco.ko] undefined!
ERROR: "cfg80211_wext_giwmode" [drivers/net/wireless/orinoco/orinoco.ko] undefined!
ERROR: "cfg80211_wext_giwname" [drivers/net/wireless/orinoco/orinoco.ko] undefined!
ERROR: "cfg80211_wext_giwscan" [drivers/net/wireless/orinoco/orinoco.ko] undefined!
ERROR: "cfg80211_wext_giwname" [drivers/net/wireless/ipw2x00/ipw2200.ko] undefined!
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
drivers/net/wireless/ipw2x00/Kconfig | 2 +-
drivers/net/wireless/orinoco/Kconfig | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- linux-next-20091006.orig/drivers/net/wireless/ipw2x00/Kconfig
+++ linux-next-20091006/drivers/net/wireless/ipw2x00/Kconfig
@@ -65,7 +65,7 @@ config IPW2100_DEBUG
config IPW2200
tristate "Intel PRO/Wireless 2200BG and 2915ABG Network Connection"
- depends on PCI && WLAN_80211 && CFG80211
+ depends on PCI && WLAN_80211 && CFG80211 && CFG80211_WEXT
select WIRELESS_EXT
select WEXT_SPY
select WEXT_PRIV
--- linux-next-20091006.orig/drivers/net/wireless/orinoco/Kconfig
+++ linux-next-20091006/drivers/net/wireless/orinoco/Kconfig
@@ -1,7 +1,7 @@
config HERMES
tristate "Hermes chipset 802.11b support (Orinoco/Prism2/Symbol)"
depends on (PPC_PMAC || PCI || PCMCIA) && WLAN_80211
- depends on CFG80211
+ depends on CFG80211 && CFG80211_WEXT
select WIRELESS_EXT
select WEXT_SPY
select WEXT_PRIV
^ permalink raw reply
* Re: [PATCH] b43: do not stack-allocate pio rx/tx header buffers
From: Michael Buesch @ 2009-10-06 20:52 UTC (permalink / raw)
To: Albert Herranz; +Cc: bcm43xx-dev, linux-wireless
In-Reply-To: <1254846043-7121-1-git-send-email-albert_herranz@yahoo.es>
On Tuesday 06 October 2009 18:20:43 Albert Herranz wrote:
> The DMA-API debugging facility complains about b43 mapping memory from
> stack for SDIO-based cards, as can be seen in the following two
> stack traces.
>
> Call Trace:
> [d2ef7c60] [c01c55f0] check_for_stack+0xf4/0x10c (unreliable)
> [d2ef7c80] [c01c6d10] debug_dma_map_sg+0xc4/0x134
> [d2ef7cb0] [c0281e10] sdhci_prepare_data+0x200/0x590
> [d2ef7ce0] [c0282288] sdhci_send_command+0xe8/0x320
> [d2ef7d00] [c02825e0] sdhci_request+0x120/0x1b4
> [d2ef7d20] [c0277ad4] mmc_wait_for_req+0x124/0x140
> [d2ef7d50] [c027c2f0] mmc_io_rw_extended+0x188/0x214
> [d2ef7e10] [c027d7c4] sdio_io_rw_ext_helper+0x104/0x224
> [d2ef7e40] [c0296000] ssb_sdio_block_read+0xac/0x110
> [d2ef7e60] [c0237f98] pio_rx_frame+0x1d0/0x43c
> [d2ef7eb0] [c0238244] b43_pio_rx+0x40/0x90
> [d2ef7ed0] [c0226124] b43_do_interrupt_thread+0x108/0x444
> [d2ef7f30] [c0226504] b43_sdio_interrupt_handler+0x58/0x74
> [d2ef7f40] [c0239110] b43_sdio_interrupt_dispatcher+0x4c/0x68
> [d2ef7f60] [c027e1ac] sdio_irq_thread+0xf8/0x284
> [d2ef7fb0] [c0054538] kthread+0x78/0x7c
> [d2ef7ff0] [c00124ec] kernel_thread+0x4c/0x68
>
> Call Trace:
> [d3335c20] [c01c55f0] check_for_stack+0xf4/0x10c (unreliable)
> [d3335c40] [c01c6d10] debug_dma_map_sg+0xc4/0x134
> [d3335c70] [c0281e14] sdhci_prepare_data+0x200/0x590
> [d3335ca0] [c028228c] sdhci_send_command+0xe8/0x320
> [d3335cc0] [c02825e4] sdhci_request+0x120/0x1b4
> [d3335ce0] [c0277ad8] mmc_wait_for_req+0x124/0x140
> [d3335d10] [c027c2f4] mmc_io_rw_extended+0x188/0x214
> [d3335dd0] [c027d86c] sdio_io_rw_ext_helper+0x1a8/0x224
> [d3335e00] [c0295ef4] ssb_sdio_block_write+0xac/0x110
> [d3335e20] [c0237a18] tx_write_4byte_queue+0x6c/0x138
> [d3335e40] [c0238610] pio_tx_frame+0x1c4/0x224
> [d3335ee0] [c0238718] b43_pio_tx+0xa8/0x1f4
> [d3335f00] [c0220380] b43_tx_work+0x4c/0xe0
> [d3335f20] [c004fa74] run_workqueue+0x120/0x1a4
> [d3335f70] [c004fb44] worker_thread+0x4c/0xb0
> [d3335fb0] [c0054538] kthread+0x78/0x7c
> [d3335ff0] [c00124ec] kernel_thread+0x4c/0x68
>
> Indeed, b43 currently allocates the PIO RX and TX header buffers
> from stack. The solution here is to use heap-allocated buffers instead.
>
> Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
> ---
> drivers/net/wireless/b43/b43.h | 9 ++++++++
> drivers/net/wireless/b43/pio.c | 42 +++++++++++++++++++++++++++------------
> 2 files changed, 38 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
> index fa1549a..b09dda1 100644
> --- a/drivers/net/wireless/b43/b43.h
> +++ b/drivers/net/wireless/b43/b43.h
> @@ -550,6 +550,9 @@ struct b43_dma {
> struct b43_pio_txqueue;
> struct b43_pio_rxqueue;
>
> +struct b43_rxhdr_fw4;
> +struct b43_txhdr;
> +
> /* Data structures for PIO transmission, per 80211 core. */
> struct b43_pio {
> struct b43_pio_txqueue *tx_queue_AC_BK; /* Background */
> @@ -559,6 +562,12 @@ struct b43_pio {
> struct b43_pio_txqueue *tx_queue_mcast; /* Multicast */
>
> struct b43_pio_rxqueue *rx_queue;
> +
> + /*
> + * RX/TX header buffers used by the frame transmit functions.
> + */
> + struct b43_rxhdr_fw4 *rxhdr;
> + struct b43_txhdr *txhdr;
> };
Just embed it into struct b43_wl (surround it by #ifdef CONFIG_B43_PIO). No need
to kzalloc then and it saves some memory.
You also need to alloc 4 bytes for the tail buffer (that currently is on the stack, too).
--
Greetings, Michael.
^ permalink raw reply
* [PATCH 1/4] iwmc3200wifi: support ETHTOOL_GPERMADDR
From: John W. Linville @ 2009-10-06 21:07 UTC (permalink / raw)
To: linux-wireless; +Cc: John W. Linville
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
drivers/net/wireless/iwmc3200wifi/main.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/iwmc3200wifi/main.c b/drivers/net/wireless/iwmc3200wifi/main.c
index d668e47..170f337 100644
--- a/drivers/net/wireless/iwmc3200wifi/main.c
+++ b/drivers/net/wireless/iwmc3200wifi/main.c
@@ -637,6 +637,8 @@ static int __iwm_up(struct iwm_priv *iwm)
IWM_ERR(iwm, "MAC reading failed\n");
goto err_disable;
}
+ memcpy(iwm_to_ndev(iwm)->perm_addr, iwm_to_ndev(iwm)->dev_addr,
+ ETH_ALEN);
/* We can load the FWs */
ret = iwm_load_fw(iwm);
--
1.6.2.5
^ permalink raw reply related
* [PATCH 4/4] cfg80211: fix compile error from missing ethtool.h
From: John W. Linville @ 2009-10-06 21:07 UTC (permalink / raw)
To: linux-wireless; +Cc: John W. Linville
In-Reply-To: <1254863240-14780-1-git-send-email-linville@tuxdriver.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
include/net/cfg80211.h | 1 +
net/wireless/ethtool.h | 2 --
2 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 6f4862b..14915ea 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -18,6 +18,7 @@
#include <linux/nl80211.h>
#include <linux/if_ether.h>
#include <linux/ieee80211.h>
+#include <linux/ethtool.h>
#include <net/regulatory.h>
/* remove once we remove the wext stuff */
diff --git a/net/wireless/ethtool.h b/net/wireless/ethtool.h
index 70cbee1..695ecad 100644
--- a/net/wireless/ethtool.h
+++ b/net/wireless/ethtool.h
@@ -1,8 +1,6 @@
#ifndef __CFG80211_ETHTOOL__
#define __CFG80211_ETHTOOL__
-#include <linux/ethtool.h>
-
extern const struct ethtool_ops cfg80211_ethtool_ops;
#endif /* __CFG80211_ETHTOOL__ */
--
1.6.2.5
^ permalink raw reply related
* [PATCH 2/4] ipw2200: support ETHTOOL_GPERMADDR
From: John W. Linville @ 2009-10-06 21:07 UTC (permalink / raw)
To: linux-wireless; +Cc: John W. Linville
In-Reply-To: <1254863240-14780-1-git-send-email-linville@tuxdriver.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
drivers/net/wireless/ipw2x00/ipw2200.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 8d58e6e..61ef890 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -11275,6 +11275,7 @@ static int ipw_up(struct ipw_priv *priv)
if (!(priv->config & CFG_CUSTOM_MAC))
eeprom_parse_mac(priv, priv->mac_addr);
memcpy(priv->net_dev->dev_addr, priv->mac_addr, ETH_ALEN);
+ memcpy(priv->net_dev->perm_addr, priv->mac_addr, ETH_ALEN);
for (j = 0; j < ARRAY_SIZE(ipw_geos); j++) {
if (!memcmp(&priv->eeprom[EEPROM_COUNTRY_CODE],
--
1.6.2.5
^ permalink raw reply related
* [PATCH 3/4] orinoco: support ETHTOOL_GPERMADDR
From: John W. Linville @ 2009-10-06 21:07 UTC (permalink / raw)
To: linux-wireless; +Cc: John W. Linville
In-Reply-To: <1254863240-14780-1-git-send-email-linville@tuxdriver.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
drivers/net/wireless/orinoco/main.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c
index 7a32bcb..5fdc59c 100644
--- a/drivers/net/wireless/orinoco/main.c
+++ b/drivers/net/wireless/orinoco/main.c
@@ -2225,6 +2225,7 @@ int orinoco_if_add(struct orinoco_private *priv,
netif_carrier_off(dev);
memcpy(dev->dev_addr, wiphy->perm_addr, ETH_ALEN);
+ memcpy(dev->perm_addr, wiphy->perm_addr, ETH_ALEN);
dev->base_addr = base_addr;
dev->irq = irq;
--
1.6.2.5
^ permalink raw reply related
* Re: Bleeding Edge b43 dated since 30 of september no longer working & today does not even compile.
From: John W. Linville @ 2009-10-06 21:11 UTC (permalink / raw)
To: Riffer; +Cc: linux-wireless
In-Reply-To: <4ACB91E7.5010405@penny.prima.de>
On Tue, Oct 06, 2009 at 08:52:23PM +0200, Riffer wrote:
> Another problem is that the archive from today can not be compiled:
>
> /home/riffer/bleeding/compat-wireless-2009-10-06/drivers/net/wireless/ath/main.o
> In file included from
> /home/riffer/bleeding/compat-wireless-2009-10-06/include/net/mac80211.h:22,
> from
> /home/riffer/bleeding/compat-wireless-2009-10-06/drivers/net/wireless/ath/ath.h:22,
> from
> /home/riffer/bleeding/compat-wireless-2009-10-06/drivers/net/wireless/ath/main.c:20:
> /home/riffer/bleeding/compat-wireless-2009-10-06/include/net/cfg80211.h:1146:
> Fehler: »ETHTOOL_BUSINFO_LEN« ist hier nicht deklariert (nicht in einer
> Funktion)
> (translation:
> Error »ETHTOOL_BUSINFO_LEN« is not declared here (not in a function))
Odd that I didn't hit that, but whatever...does this fix it for you?
>From 463049630fa4c256025093ce94c66f9f4247b7c8 Mon Sep 17 00:00:00 2001
From: John W. Linville <linville@tuxdriver.com>
Date: Tue, 6 Oct 2009 16:55:28 -0400
Subject: [PATCH] cfg80211: fix compile error from missing ethtool.h
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
include/net/cfg80211.h | 1 +
net/wireless/ethtool.h | 2 --
2 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 6f4862b..14915ea 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -18,6 +18,7 @@
#include <linux/nl80211.h>
#include <linux/if_ether.h>
#include <linux/ieee80211.h>
+#include <linux/ethtool.h>
#include <net/regulatory.h>
/* remove once we remove the wext stuff */
diff --git a/net/wireless/ethtool.h b/net/wireless/ethtool.h
index 70cbee1..695ecad 100644
--- a/net/wireless/ethtool.h
+++ b/net/wireless/ethtool.h
@@ -1,8 +1,6 @@
#ifndef __CFG80211_ETHTOOL__
#define __CFG80211_ETHTOOL__
-#include <linux/ethtool.h>
-
extern const struct ethtool_ops cfg80211_ethtool_ops;
#endif /* __CFG80211_ETHTOOL__ */
--
1.6.2.5
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply related
* Re: [PATCH] b43: do not stack-allocate pio rx/tx header buffers
From: John W. Linville @ 2009-10-06 21:13 UTC (permalink / raw)
To: Michael Buesch; +Cc: Albert Herranz, linux-wireless, bcm43xx-dev
In-Reply-To: <200910062252.17565.mb@bu3sch.de>
On Tue, Oct 06, 2009 at 10:52:15PM +0200, Michael Buesch wrote:
> On Tuesday 06 October 2009 18:20:43 Albert Herranz wrote:
> > The DMA-API debugging facility complains about b43 mapping memory from
> > stack for SDIO-based cards, as can be seen in the following two
> > stack traces.
<snip>
> > Indeed, b43 currently allocates the PIO RX and TX header buffers
> > from stack. The solution here is to use heap-allocated buffers instead.
> >
> > Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
<snip>
> Just embed it into struct b43_wl (surround it by #ifdef CONFIG_B43_PIO). No need
> to kzalloc then and it saves some memory.
> You also need to alloc 4 bytes for the tail buffer (that currently is on the stack, too).
Please make the changes Michael requested and resubmit -- I'll happily
make the adjustments to wireless-testing, etc.
John
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply
* Re: b43: fix wldev use after free
From: Andrew Morton @ 2009-10-06 21:28 UTC (permalink / raw)
To: Dave Young; +Cc: mb, linville, bcm43xx-dev, linux-wireless, linux-kernel
In-Reply-To: <20091001084924.GA4170@darkstar>
On Thu, 1 Oct 2009 16:49:24 +0800
Dave Young <hidave.darkstar@gmail.com> wrote:
> when rmmod b43, I got following bug message
>
> [ 100.121798] BUG: unable to handle kernel paging request at 2f4066fa
> [ 100.123338] IP: [<f9e9dd57>] b43_unregister_led+0x6/0x1c [b43]
> [ 100.123338] *pde = 00000000
> [ 100.123338] Oops: 0000 [#1] SMP
> [ 100.123338] last sysfs file: /sys/devices/pci0000:00/0000:00:1c.1/0000:0c:00.0/ssb0:0/firmware/ssb0:0/loading
> [ 100.123338] Modules linked in: reiserfs kvm_intel kvm snd_hda_codec_intelhdmi firewire_ohci snd_hda_codec_idt firewire_core b43(-) snd_hda_intel mac80211 snd_hda_codec crc_itu_t cfg80211 snd_hwdep ohci1394 snd_pcm dell_laptop wmi ieee1394 rfkill snd_timer snd_page_alloc
> [ 100.123338]
> [ 100.123338] Pid: 1931, comm: rmmod Not tainted (2.6.31-mm1 #2) Latitude E5400
> [ 100.123338] EIP: 0060:[<f9e9dd57>] EFLAGS: 00010246 CPU: 0
> [ 100.123338] EIP is at b43_unregister_led+0x6/0x1c [b43]
> [ 100.123338] EAX: 2f4066fa EBX: 2f4066fa ECX: 00000006 EDX: 00000246
> [ 100.123338] ESI: f6a59000 EDI: f72030a8 EBP: f6373ec8 ESP: f6373ec4
> [ 100.123338] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
> [ 100.123338] Process rmmod (pid: 1931, ti=f6372000 task=f66e0000 task.ti=f6372000)
> [ 100.123338] Stack:
> [ 100.123338] 2f406576 f6373ed4 f9e9dd7f f674cda0 f6373ee8 f9e8816e f72030a8 f9ea4b18
> [ 100.123338] <0> f9ea4b18 f6373ef4 c04bbd57 f7297000 f6373f04 c03f2563 f7297000 f7297034
> [ 100.123338] <0> f6373f18 c03f2609 f9ea4b18 00000000 c07742fc f6373f2c c03f1aac 00000000
> [ 100.123338] Call Trace:
> [ 100.123338] [<f9e9dd7f>] ? b43_leds_unregister+0x12/0x36 [b43]
> [ 100.123338] [<f9e8816e>] ? b43_remove+0x79/0x87 [b43]
> [ 100.123338] [<c04bbd57>] ? ssb_device_remove+0x1d/0x29
> [ 100.123338] [<c03f2563>] ? __device_release_driver+0x59/0x98
> [ 100.123338] [<c03f2609>] ? driver_detach+0x67/0x85
> [ 100.123338] [<c03f1aac>] ? bus_remove_driver+0x63/0x7f
> [ 100.123338] [<c03f2a04>] ? driver_unregister+0x4d/0x54
> [ 100.123338] [<c04bb828>] ? ssb_driver_unregister+0xb/0xd
> [ 100.123338] [<f9e9f876>] ? b43_exit+0xd/0x19 [b43]
> [ 100.123338] [<c025124b>] ? sys_delete_module+0x17c/0x1e0
> [ 100.123338] [<c054c654>] ? do_page_fault+0x29d/0x2a5
> [ 100.123338] [<c02032d6>] ? restore_all_notrace+0x0/0x18
> [ 100.123338] [<c054c3b7>] ? do_page_fault+0x0/0x2a5
> [ 100.123338] [<c020329d>] ? syscall_call+0x7/0xb
> [ 100.123338] Code: 0f b6 93 d8 03 00 00 e8 16 ff ff ff 0f b6 8b 39 03 00 00 89 f0 0f b6 93 38 03 00 00 e8 01 ff ff ff 5b 5e 5d c3 55 89 e5 53 89 c3 <83> 38 00 74 0e 8d 40 04 e8 de cc 60 c6 c7 03 00 00 00 00 5b 5d
> [ 100.123338] EIP: [<f9e9dd57>] b43_unregister_led+0x6/0x1c [b43] SS:ESP 0068:f6373ec4
> [ 100.123338] CR2: 000000002f4066fa
> [ 100.953375] ---[ end trace d100c06b1451fbd8 ]---
>
> in b43_remove, b43_one_core_detach free the wldev,
> thus following callback which reference wldev will oops.
>
> fix it by call b43_leds_unregister before b43_one_core_detach
> if it is the last one in wl->devlist
>
It appears that a different fix was added to linux-next yesterday:
commit 15b1803a33016745c672b74b699aaf99cf8dc0d4
Author: Michael Buesch <mb@bu3sch.de>
AuthorDate: Thu Oct 1 15:54:32 2009 +0200
Commit: John W. Linville <linville@tuxdriver.com>
CommitDate: Mon Oct 5 17:03:16 2009 -0400
b43: Don't use struct wldev after detach.
Don't use struct wldev after detach. This fixes an oops on access.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
diff --git a/drivers/net/wireless/b43/leds.c b/drivers/net/wireless/b43/leds.c
index fbe3d4f..1e8dba4 100644
--- a/drivers/net/wireless/b43/leds.c
+++ b/drivers/net/wireless/b43/leds.c
@@ -348,9 +348,9 @@ void b43_leds_register(struct b43_wldev *dev)
}
}
-void b43_leds_unregister(struct b43_wldev *dev)
+void b43_leds_unregister(struct b43_wl *wl)
{
- struct b43_leds *leds = &dev->wl->leds;
+ struct b43_leds *leds = &wl->leds;
b43_unregister_led(&leds->led_tx);
b43_unregister_led(&leds->led_rx);
diff --git a/drivers/net/wireless/b43/leds.h b/drivers/net/wireless/b43/leds.h
index 9592e4c..4c56187 100644
--- a/drivers/net/wireless/b43/leds.h
+++ b/drivers/net/wireless/b43/leds.h
@@ -60,7 +60,7 @@ enum b43_led_behaviour {
};
void b43_leds_register(struct b43_wldev *dev);
-void b43_leds_unregister(struct b43_wldev *dev);
+void b43_leds_unregister(struct b43_wl *wl);
void b43_leds_init(struct b43_wldev *dev);
void b43_leds_exit(struct b43_wldev *dev);
void b43_leds_stop(struct b43_wldev *dev);
@@ -76,7 +76,7 @@ struct b43_leds {
static inline void b43_leds_register(struct b43_wldev *dev)
{
}
-static inline void b43_leds_unregister(struct b43_wldev *dev)
+static inline void b43_leds_unregister(struct b43_wl *wl)
{
}
static inline void b43_leds_init(struct b43_wldev *dev)
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 9b907a3..130dcd5 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4997,7 +4997,7 @@ static void b43_remove(struct ssb_device *dev)
if (list_empty(&wl->devlist)) {
b43_rng_exit(wl);
- b43_leds_unregister(wldev);
+ b43_leds_unregister(wl);
/* Last core on the chip unregistered.
* We can destroy common struct b43_wl.
*/
^ permalink raw reply related
* Re: [PATCH -next] wireless: fix CFG80211_WEXT build problems
From: Johannes Berg @ 2009-10-06 21:33 UTC (permalink / raw)
To: Randy Dunlap; +Cc: Stephen Rothwell, linville, linux-next, LKML, linux-wireless
In-Reply-To: <20091006132729.8b4f9345.rdunlap@xenotime.net>
[-- Attachment #1: Type: text/plain, Size: 1554 bytes --]
On Tue, 2009-10-06 at 13:27 -0700, Randy Dunlap wrote:
> From: Randy Dunlap <randy.dunlap@oracle.com>
>
> Fix CFG80211_WEXT build dependencies/errors:
>
> ERROR: "cfg80211_wext_siwscan" [drivers/net/wireless/orinoco/orinoco.ko] undefined!
> ERROR: "cfg80211_wext_siwmode" [drivers/net/wireless/orinoco/orinoco.ko] undefined!
> ERROR: "cfg80211_wext_giwrange" [drivers/net/wireless/orinoco/orinoco.ko] undefined!
> ERROR: "cfg80211_wext_giwmode" [drivers/net/wireless/orinoco/orinoco.ko] undefined!
> ERROR: "cfg80211_wext_giwname" [drivers/net/wireless/orinoco/orinoco.ko] undefined!
> ERROR: "cfg80211_wext_giwscan" [drivers/net/wireless/orinoco/orinoco.ko] undefined!
> ERROR: "cfg80211_wext_giwname" [drivers/net/wireless/ipw2x00/ipw2200.ko] undefined!
>
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> ---
> drivers/net/wireless/ipw2x00/Kconfig | 2 +-
> drivers/net/wireless/orinoco/Kconfig | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> --- linux-next-20091006.orig/drivers/net/wireless/ipw2x00/Kconfig
> +++ linux-next-20091006/drivers/net/wireless/ipw2x00/Kconfig
> @@ -65,7 +65,7 @@ config IPW2100_DEBUG
>
> config IPW2200
> tristate "Intel PRO/Wireless 2200BG and 2915ABG Network Connection"
> - depends on PCI && WLAN_80211 && CFG80211
> + depends on PCI && WLAN_80211 && CFG80211 && CFG80211_WEXT
Interesting approach, thanks. I completely forgot about the
half-converted drivers. The alternative would be to ifdef the code
blobs, but I'm happy with this.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: b43: fix wldev use after free
From: Michael Buesch @ 2009-10-06 21:35 UTC (permalink / raw)
To: Andrew Morton
Cc: Dave Young, linville, bcm43xx-dev, linux-wireless, linux-kernel
In-Reply-To: <20091006142822.55d5120c.akpm@linux-foundation.org>
On Tuesday 06 October 2009 23:28:22 Andrew Morton wrote:
> > fix it by call b43_leds_unregister before b43_one_core_detach
> > if it is the last one in wl->devlist
> >
>
> It appears that a different fix was added to linux-next yesterday:
Yes, this one is better, because it doesn't really change the code. It just removes
one unnecessary pointer usage.
--
Greetings, Michael.
^ 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