* [PATCH] libipw: initiate cfg80211 API conversion
From: John W. Linville @ 2009-08-25 18:12 UTC (permalink / raw)
To: linux-wireless; +Cc: John W. Linville
Initiate the conversion of libipw to the new cfg80211 configuration API.
For now, leave CONFIG_IPW2200_PROMISCUOUS stuff alone. Eventually
migrate it to cfg80211 when the add/del/change_virtual_intf methods
are implemented.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
drivers/net/wireless/ipw2x00/ipw2100.c | 6 +-
drivers/net/wireless/ipw2x00/ipw2200.c | 141 +++++++++++++++++++++-----
drivers/net/wireless/ipw2x00/libipw.h | 8 +-
drivers/net/wireless/ipw2x00/libipw_module.c | 42 +++++++-
4 files changed, 161 insertions(+), 36 deletions(-)
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 8caa07a..7745738 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -6029,7 +6029,7 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
struct ipw2100_priv *priv;
struct net_device *dev;
- dev = alloc_ieee80211(sizeof(struct ipw2100_priv));
+ dev = alloc_ieee80211(sizeof(struct ipw2100_priv), 0);
if (!dev)
return NULL;
priv = libipw_priv(dev);
@@ -6342,7 +6342,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
sysfs_remove_group(&pci_dev->dev.kobj,
&ipw2100_attribute_group);
- free_ieee80211(dev);
+ free_ieee80211(dev, 0);
pci_set_drvdata(pci_dev, NULL);
}
@@ -6400,7 +6400,7 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev)
if (dev->base_addr)
iounmap((void __iomem *)dev->base_addr);
- free_ieee80211(dev);
+ free_ieee80211(dev, 0);
}
pci_release_regions(pci_dev);
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 0ccec9f..3f8372d 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -103,6 +103,25 @@ static int antenna = CFG_SYS_ANTENNA_BOTH;
static int rtap_iface = 0; /* def: 0 -- do not create rtap interface */
#endif
+static struct ieee80211_rate ipw2200_rates[] = {
+ { .bitrate = 10 },
+ { .bitrate = 20, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
+ { .bitrate = 55, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
+ { .bitrate = 110, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
+ { .bitrate = 60 },
+ { .bitrate = 90 },
+ { .bitrate = 120 },
+ { .bitrate = 180 },
+ { .bitrate = 240 },
+ { .bitrate = 360 },
+ { .bitrate = 480 },
+ { .bitrate = 540 }
+};
+
+#define ipw2200_a_rates (ipw2200_rates + 4)
+#define ipw2200_num_a_rates 8
+#define ipw2200_bg_rates (ipw2200_rates + 0)
+#define ipw2200_num_bg_rates 12
#ifdef CONFIG_IPW2200_QOS
static int qos_enable = 0;
@@ -8640,24 +8659,6 @@ static int ipw_sw_reset(struct ipw_priv *priv, int option)
*
*/
-static int ipw_wx_get_name(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- struct ipw_priv *priv = libipw_priv(dev);
- mutex_lock(&priv->mutex);
- if (priv->status & STATUS_RF_KILL_MASK)
- strcpy(wrqu->name, "radio off");
- else if (!(priv->status & STATUS_ASSOCIATED))
- strcpy(wrqu->name, "unassociated");
- else
- snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11%c",
- ipw_modes[priv->assoc_request.ieee_mode]);
- IPW_DEBUG_WX("Name: %s\n", wrqu->name);
- mutex_unlock(&priv->mutex);
- return 0;
-}
-
static int ipw_set_channel(struct ipw_priv *priv, u8 channel)
{
if (channel == 0) {
@@ -9957,7 +9958,7 @@ static int ipw_wx_sw_reset(struct net_device *dev,
/* Rebase the WE IOCTLs to zero for the handler array */
#define IW_IOCTL(x) [(x)-SIOCSIWCOMMIT]
static iw_handler ipw_wx_handlers[] = {
- IW_IOCTL(SIOCGIWNAME) = ipw_wx_get_name,
+ IW_IOCTL(SIOCGIWNAME) = (iw_handler) cfg80211_wext_giwname,
IW_IOCTL(SIOCSIWFREQ) = ipw_wx_set_freq,
IW_IOCTL(SIOCGIWFREQ) = ipw_wx_get_freq,
IW_IOCTL(SIOCSIWMODE) = ipw_wx_set_mode,
@@ -11401,16 +11402,100 @@ static void ipw_bg_down(struct work_struct *work)
/* Called by register_netdev() */
static int ipw_net_init(struct net_device *dev)
{
+ int i, rc = 0;
struct ipw_priv *priv = libipw_priv(dev);
+ const struct libipw_geo *geo = libipw_get_geo(priv->ieee);
+ struct wireless_dev *wdev = &priv->ieee->wdev;
mutex_lock(&priv->mutex);
if (ipw_up(priv)) {
- mutex_unlock(&priv->mutex);
- return -EIO;
+ rc = -EIO;
+ goto out;
}
+ memcpy(wdev->wiphy->perm_addr, priv->mac_addr, ETH_ALEN);
+
+ /* fill-out priv->ieee->bg_band */
+ if (geo->bg_channels) {
+ struct ieee80211_supported_band *bg_band = &priv->ieee->bg_band;
+
+ bg_band->band = IEEE80211_BAND_2GHZ;
+ bg_band->n_channels = geo->bg_channels;
+ bg_band->channels =
+ kzalloc(geo->bg_channels *
+ sizeof(struct ieee80211_channel), GFP_KERNEL);
+ /* translate geo->bg to bg_band.channels */
+ for (i = 0; i < geo->bg_channels; i++) {
+ bg_band->channels[i].band = IEEE80211_BAND_2GHZ;
+ bg_band->channels[i].center_freq = geo->bg[i].freq;
+ bg_band->channels[i].hw_value = geo->bg[i].channel;
+ bg_band->channels[i].max_power = geo->bg[i].max_power;
+ if (geo->bg[i].flags & LIBIPW_CH_PASSIVE_ONLY)
+ bg_band->channels[i].flags |=
+ IEEE80211_CHAN_PASSIVE_SCAN;
+ if (geo->bg[i].flags & LIBIPW_CH_NO_IBSS)
+ bg_band->channels[i].flags |=
+ IEEE80211_CHAN_NO_IBSS;
+ if (geo->bg[i].flags & LIBIPW_CH_RADAR_DETECT)
+ bg_band->channels[i].flags |=
+ IEEE80211_CHAN_RADAR;
+ /* No equivalent for LIBIPW_CH_80211H_RULES,
+ LIBIPW_CH_UNIFORM_SPREADING, or
+ LIBIPW_CH_B_ONLY... */
+ }
+ /* point at bitrate info */
+ bg_band->bitrates = ipw2200_bg_rates;
+ bg_band->n_bitrates = ipw2200_num_bg_rates;
+
+ wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = bg_band;
+ }
+
+ /* fill-out priv->ieee->a_band */
+ if (geo->a_channels) {
+ struct ieee80211_supported_band *a_band = &priv->ieee->a_band;
+
+ a_band->band = IEEE80211_BAND_5GHZ;
+ a_band->n_channels = geo->a_channels;
+ a_band->channels =
+ kzalloc(geo->a_channels *
+ sizeof(struct ieee80211_channel), GFP_KERNEL);
+ /* translate geo->bg to a_band.channels */
+ for (i = 0; i < geo->a_channels; i++) {
+ a_band->channels[i].band = IEEE80211_BAND_2GHZ;
+ a_band->channels[i].center_freq = geo->a[i].freq;
+ a_band->channels[i].hw_value = geo->a[i].channel;
+ a_band->channels[i].max_power = geo->a[i].max_power;
+ if (geo->a[i].flags & LIBIPW_CH_PASSIVE_ONLY)
+ a_band->channels[i].flags |=
+ IEEE80211_CHAN_PASSIVE_SCAN;
+ if (geo->a[i].flags & LIBIPW_CH_NO_IBSS)
+ a_band->channels[i].flags |=
+ IEEE80211_CHAN_NO_IBSS;
+ if (geo->a[i].flags & LIBIPW_CH_RADAR_DETECT)
+ a_band->channels[i].flags |=
+ IEEE80211_CHAN_RADAR;
+ /* No equivalent for LIBIPW_CH_80211H_RULES,
+ LIBIPW_CH_UNIFORM_SPREADING, or
+ LIBIPW_CH_B_ONLY... */
+ }
+ /* point at bitrate info */
+ a_band->bitrates = ipw2200_a_rates;
+ a_band->n_bitrates = ipw2200_num_a_rates;
+
+ wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = a_band;
+ }
+
+ set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev);
+
+ /* With that information in place, we can now register the wiphy... */
+ if (wiphy_register(wdev->wiphy)) {
+ rc = -EIO;
+ goto out;
+ }
+
+out:
mutex_unlock(&priv->mutex);
- return 0;
+ return rc;
}
/* PCI driver stuff */
@@ -11540,7 +11625,7 @@ static int ipw_prom_alloc(struct ipw_priv *priv)
if (priv->prom_net_dev)
return -EPERM;
- priv->prom_net_dev = alloc_ieee80211(sizeof(struct ipw_prom_priv));
+ priv->prom_net_dev = alloc_ieee80211(sizeof(struct ipw_prom_priv), 1);
if (priv->prom_net_dev == NULL)
return -ENOMEM;
@@ -11559,7 +11644,7 @@ static int ipw_prom_alloc(struct ipw_priv *priv)
rc = register_netdev(priv->prom_net_dev);
if (rc) {
- free_ieee80211(priv->prom_net_dev);
+ free_ieee80211(priv->prom_net_dev, 1);
priv->prom_net_dev = NULL;
return rc;
}
@@ -11573,7 +11658,7 @@ static void ipw_prom_free(struct ipw_priv *priv)
return;
unregister_netdev(priv->prom_net_dev);
- free_ieee80211(priv->prom_net_dev);
+ free_ieee80211(priv->prom_net_dev, 1);
priv->prom_net_dev = NULL;
}
@@ -11601,7 +11686,7 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev,
struct ipw_priv *priv;
int i;
- net_dev = alloc_ieee80211(sizeof(struct ipw_priv));
+ net_dev = alloc_ieee80211(sizeof(struct ipw_priv), 0);
if (net_dev == NULL) {
err = -ENOMEM;
goto out;
@@ -11749,7 +11834,7 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev,
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
out_free_ieee80211:
- free_ieee80211(priv->net_dev);
+ free_ieee80211(priv->net_dev, 0);
out:
return err;
}
@@ -11816,7 +11901,7 @@ static void __devexit ipw_pci_remove(struct pci_dev *pdev)
pci_release_regions(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
- free_ieee80211(priv->net_dev);
+ free_ieee80211(priv->net_dev, 0);
free_firmware();
}
diff --git a/drivers/net/wireless/ipw2x00/libipw.h b/drivers/net/wireless/ipw2x00/libipw.h
index cefb942..8f91d34 100644
--- a/drivers/net/wireless/ipw2x00/libipw.h
+++ b/drivers/net/wireless/ipw2x00/libipw.h
@@ -31,6 +31,7 @@
#include <linux/ieee80211.h>
#include <net/lib80211.h>
+#include <net/cfg80211.h>
#define LIBIPW_VERSION "git-1.1.13"
@@ -783,12 +784,15 @@ struct libipw_geo {
struct libipw_device {
struct net_device *dev;
+ struct wireless_dev wdev;
struct libipw_security sec;
/* Bookkeeping structures */
struct libipw_stats ieee_stats;
struct libipw_geo geo;
+ struct ieee80211_supported_band bg_band;
+ struct ieee80211_supported_band a_band;
/* Probe / Beacon management */
struct list_head network_free_list;
@@ -1014,8 +1018,8 @@ static inline int libipw_is_cck_rate(u8 rate)
}
/* ieee80211.c */
-extern void free_ieee80211(struct net_device *dev);
-extern struct net_device *alloc_ieee80211(int sizeof_priv);
+extern void free_ieee80211(struct net_device *dev, int monitor);
+extern struct net_device *alloc_ieee80211(int sizeof_priv, int monitor);
extern int libipw_change_mtu(struct net_device *dev, int new_mtu);
extern void libipw_networks_age(struct libipw_device *ieee,
diff --git a/drivers/net/wireless/ipw2x00/libipw_module.c b/drivers/net/wireless/ipw2x00/libipw_module.c
index eb2b608..a0e9f6a 100644
--- a/drivers/net/wireless/ipw2x00/libipw_module.c
+++ b/drivers/net/wireless/ipw2x00/libipw_module.c
@@ -62,6 +62,9 @@ MODULE_DESCRIPTION(DRV_DESCRIPTION);
MODULE_AUTHOR(DRV_COPYRIGHT);
MODULE_LICENSE("GPL");
+struct cfg80211_ops libipw_config_ops = { };
+void *libipw_wiphy_privid = &libipw_wiphy_privid;
+
static int libipw_networks_allocate(struct libipw_device *ieee)
{
if (ieee->networks)
@@ -140,7 +143,7 @@ int libipw_change_mtu(struct net_device *dev, int new_mtu)
}
EXPORT_SYMBOL(libipw_change_mtu);
-struct net_device *alloc_ieee80211(int sizeof_priv)
+struct net_device *alloc_ieee80211(int sizeof_priv, int monitor)
{
struct libipw_device *ieee;
struct net_device *dev;
@@ -157,10 +160,31 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
ieee->dev = dev;
+ if (!monitor) {
+ ieee->wdev.wiphy = wiphy_new(&libipw_config_ops, 0);
+ if (!ieee->wdev.wiphy) {
+ LIBIPW_ERROR("Unable to allocate wiphy.\n");
+ goto failed_free_netdev;
+ }
+
+ ieee->dev->ieee80211_ptr = &ieee->wdev;
+ ieee->wdev.iftype = NL80211_IFTYPE_STATION;
+
+ /* Fill-out wiphy structure bits we know... Not enough info
+ here to call set_wiphy_dev or set MAC address or channel info
+ -- have to do that in ->ndo_init... */
+ ieee->wdev.wiphy->privid = libipw_wiphy_privid;
+
+ ieee->wdev.wiphy->max_scan_ssids = 1;
+ ieee->wdev.wiphy->max_scan_ie_len = 0;
+ ieee->wdev.wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION)
+ | BIT(NL80211_IFTYPE_ADHOC);
+ }
+
err = libipw_networks_allocate(ieee);
if (err) {
LIBIPW_ERROR("Unable to allocate beacon storage: %d\n", err);
- goto failed_free_netdev;
+ goto failed_free_wiphy;
}
libipw_networks_initialize(ieee);
@@ -193,19 +217,31 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
return dev;
+failed_free_wiphy:
+ if (!monitor)
+ wiphy_free(ieee->wdev.wiphy);
failed_free_netdev:
free_netdev(dev);
failed:
return NULL;
}
-void free_ieee80211(struct net_device *dev)
+void free_ieee80211(struct net_device *dev, int monitor)
{
struct libipw_device *ieee = netdev_priv(dev);
lib80211_crypt_info_free(&ieee->crypt_info);
libipw_networks_free(ieee);
+
+ /* free cfg80211 resources */
+ if (!monitor) {
+ wiphy_unregister(ieee->wdev.wiphy);
+ kfree(ieee->a_band.channels);
+ kfree(ieee->bg_band.channels);
+ wiphy_free(ieee->wdev.wiphy);
+ }
+
free_netdev(dev);
}
--
1.6.2.5
^ permalink raw reply related
* B44 not being installed
From: Gregy @ 2009-08-25 17:02 UTC (permalink / raw)
To: linux-wireless
Hello, I would like to report something that looks like a bug to me.
compat-wireless 2009-08-25
kernel 2.6.31-rc4
With stock config.mk b44 is enabled and should be compiled and
installed with make && make install
I fact it is not compiled and installed -> after I load new ssb wired
network stops working
Could you please look into it?
Thanks
^ permalink raw reply
* [PATCH] mac80211: Check pending scan request after having processed mgd work
From: Jouni Malinen @ 2009-08-25 14:44 UTC (permalink / raw)
To: Johannes Berg, John W. Linville; +Cc: linux-wireless
When the queued management work items are processed in
ieee80211_sta_work() an item could be removed. This could change the
anybusy from true to false, so we better check whether we can start a
new scan only after having processed the pending work first.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/mlme.c | 28 ++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)
--- uml.orig/net/mac80211/mlme.c 2009-08-25 17:29:08.000000000 +0300
+++ uml/net/mac80211/mlme.c 2009-08-25 17:32:04.000000000 +0300
@@ -2123,25 +2123,9 @@ static void ieee80211_sta_work(struct wo
}
}
- list_for_each_entry(wk, &ifmgd->work_list, list) {
- if (wk->state != IEEE80211_MGD_STATE_IDLE) {
- anybusy = true;
- break;
- }
- }
ieee80211_recalc_idle(local);
- if (!anybusy) {
- mutex_unlock(&ifmgd->mtx);
-
- if (test_and_clear_bit(IEEE80211_STA_REQ_SCAN, &ifmgd->request))
- ieee80211_queue_delayed_work(&local->hw,
- &local->scan_work,
- round_jiffies_relative(0));
- return;
- }
-
list_for_each_entry_safe(wk, tmp, &ifmgd->work_list, list) {
if (time_is_after_jiffies(wk->timeout)) {
/*
@@ -2187,6 +2171,18 @@ static void ieee80211_sta_work(struct wo
}
}
+ list_for_each_entry(wk, &ifmgd->work_list, list) {
+ if (wk->state != IEEE80211_MGD_STATE_IDLE) {
+ anybusy = true;
+ break;
+ }
+ }
+ if (!anybusy &&
+ test_and_clear_bit(IEEE80211_STA_REQ_SCAN, &ifmgd->request))
+ ieee80211_queue_delayed_work(&local->hw,
+ &local->scan_work,
+ round_jiffies_relative(0));
+
mutex_unlock(&ifmgd->mtx);
list_for_each_entry_safe(wk, tmp, &free_work, list) {
--
Jouni Malinen PGP id EFC895FA
^ permalink raw reply
* Re: [PATCH] b43: LP-PHY: Fix and simplify Qdiv roundup
From: Bob Copeland @ 2009-08-25 15:09 UTC (permalink / raw)
To: Gábor Stefanik
Cc: John Linville, Michael Buesch, Larry Finger, Mark Huijgen,
Broadcom Wireless, linux-wireless
In-Reply-To: <1251211217-7816-1-git-send-email-netrolller.3d@gmail.com>
2009/8/25 Gábor Stefanik <netrolller.3d@gmail.com>:
> The Qdiv roundup routine is essentially a fixed-point
> division algorithm, using only integer math.
> However, the version in the specs had a major error
> that has been recently fixed (a missing quotient++).
>
> Replace Qdiv roundup with a rewritten, simplified version.
Hi!
> @@ -1042,20 +1042,14 @@ static u32 lpphy_qdiv_roundup(u32 dividend, u32 divisor, u8 precision)
> quotient = dividend / divisor;
> remainder = dividend % divisor;
>
> - rbit = divisor & 0x1;
> - roundup = (divisor >> 1) + rbit;
> -
> while (precision != 0) {
> - tmp = remainder - roundup;
> quotient <<= 1;
> - if (remainder >= roundup)
> - remainder = (tmp << 1) + rbit;
> - else
> - remainder <<= 1;
> + quotient |= (remainder << 1) / divisor;
> + remainder = (remainder << 1) % divisor;
> precision--;
> }
Unless precision is 0, this just added a bunch of divides into
the inner loop, which might be a big surprise to anyone expecting
this to be fast...
--
Bob Copeland %% www.bobcopeland.com
^ permalink raw reply
* [PATCH] b43: LP-PHY: Fix and simplify Qdiv roundup
From: Gábor Stefanik @ 2009-08-25 14:40 UTC (permalink / raw)
To: John Linville, Michael Buesch, Larry Finger, Mark Huijgen
Cc: Broadcom Wireless, linux-wireless
The Qdiv roundup routine is essentially a fixed-point
division algorithm, using only integer math.
However, the version in the specs had a major error
that has been recently fixed (a missing quotient++).
Replace Qdiv roundup with a rewritten, simplified version.
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
---
drivers/net/wireless/b43/phy_lp.c | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index 7e70c07..d0280d5 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -1034,7 +1034,7 @@ static int lpphy_loopback(struct b43_wldev *dev)
static u32 lpphy_qdiv_roundup(u32 dividend, u32 divisor, u8 precision)
{
- u32 quotient, remainder, rbit, roundup, tmp;
+ u32 quotient, remainder;
if (divisor == 0)
return 0;
@@ -1042,20 +1042,14 @@ static u32 lpphy_qdiv_roundup(u32 dividend, u32 divisor, u8 precision)
quotient = dividend / divisor;
remainder = dividend % divisor;
- rbit = divisor & 0x1;
- roundup = (divisor >> 1) + rbit;
-
while (precision != 0) {
- tmp = remainder - roundup;
quotient <<= 1;
- if (remainder >= roundup)
- remainder = (tmp << 1) + rbit;
- else
- remainder <<= 1;
+ quotient |= (remainder << 1) / divisor;
+ remainder = (remainder << 1) % divisor;
precision--;
}
- if (remainder >= roundup)
+ if (remainder << 1 >= divisor)
quotient++;
return quotient;
--
1.5.6
^ permalink raw reply related
* [PATCH] mac80211: fix scan cancel on ifdown
From: Johannes Berg @ 2009-08-25 14:33 UTC (permalink / raw)
To: John Linville; +Cc: Jouni Malinen, linux-wireless
When an interface is taken down while a scan is
pending -- i.e. a scan request was accepted but
not yet acted upon due to other work being in
progress -- we currently do not properly cancel
that scan and end up getting stuck. Fix this by
doing better checks when an interface is taken
down.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/iface.c | 26 ++------------------------
net/mac80211/scan.c | 9 ++++++---
2 files changed, 8 insertions(+), 27 deletions(-)
--- wireless-testing.orig/net/mac80211/iface.c 2009-08-25 14:39:06.000000000 +0200
+++ wireless-testing/net/mac80211/iface.c 2009-08-25 14:39:42.000000000 +0200
@@ -497,30 +497,8 @@ static int ieee80211_stop(struct net_dev
}
/* fall through */
default:
- if (local->scan_sdata == sdata) {
- if (!local->ops->hw_scan)
- cancel_delayed_work_sync(&local->scan_work);
- /*
- * The software scan can no longer run now, so we can
- * clear out the scan_sdata reference. However, the
- * hardware scan may still be running. The complete
- * function must be prepared to handle a NULL value.
- */
- local->scan_sdata = NULL;
- /*
- * The memory barrier guarantees that another CPU
- * that is hardware-scanning will now see the fact
- * that this interface is gone.
- */
- smp_mb();
- /*
- * If software scanning, complete the scan but since
- * the scan_sdata is NULL already don't send out a
- * scan event to userspace -- the scan is incomplete.
- */
- if (test_bit(SCAN_SW_SCANNING, &local->scanning))
- ieee80211_scan_completed(&local->hw, true);
- }
+ if (local->scan_sdata == sdata)
+ ieee80211_scan_cancel(local);
/*
* Disable beaconing for AP and mesh, IBSS can't
--- wireless-testing.orig/net/mac80211/scan.c 2009-08-25 14:37:44.000000000 +0200
+++ wireless-testing/net/mac80211/scan.c 2009-08-25 15:50:07.000000000 +0200
@@ -280,6 +280,7 @@ void ieee80211_scan_completed(struct iee
if (local->scan_req != local->int_scan_req)
cfg80211_scan_done(local->scan_req, aborted);
local->scan_req = NULL;
+ local->scan_sdata = NULL;
was_hw_scan = test_bit(SCAN_HW_SCANNING, &local->scanning);
local->scanning = 0;
@@ -660,6 +661,7 @@ void ieee80211_scan_work(struct work_str
int rc;
local->scan_req = NULL;
+ local->scan_sdata = NULL;
rc = __ieee80211_start_scan(sdata, req);
mutex_unlock(&local->scan_mtx);
@@ -742,7 +744,7 @@ int ieee80211_request_internal_scan(stru
void ieee80211_scan_cancel(struct ieee80211_local *local)
{
- bool swscan;
+ bool abortscan;
cancel_delayed_work_sync(&local->scan_work);
@@ -751,9 +753,10 @@ void ieee80211_scan_cancel(struct ieee80
* queued -- mostly at suspend under RTNL.
*/
mutex_lock(&local->scan_mtx);
- swscan = test_bit(SCAN_SW_SCANNING, &local->scanning);
+ abortscan = test_bit(SCAN_SW_SCANNING, &local->scanning) ||
+ (!local->scanning && local->scan_req);
mutex_unlock(&local->scan_mtx);
- if (swscan)
+ if (abortscan)
ieee80211_scan_completed(&local->hw, true);
}
^ permalink raw reply
* [PATCH] b43: LP-PHY: Fix a few typos in the RC calibration code
From: Gábor Stefanik @ 2009-08-25 14:17 UTC (permalink / raw)
To: John Linville, Michael Buesch, Larry Finger, Mark Huijgen
Cc: Broadcom Wireless, linux-wireless
The RC calibration code has some typos - fix them.
Also, make the default channel 7, as channel 1 is still
broken (only channels 7 and 8, and occasionally 9 work).
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
---
drivers/net/wireless/b43/phy_lp.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index 2d3a5d8..7e70c07 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -44,7 +44,7 @@ static inline u16 channel2freq_lp(u8 channel)
static unsigned int b43_lpphy_op_get_default_chan(struct b43_wldev *dev)
{
if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
- return 1;
+ return 7; //FIXME temporary - channel 1 is broken
return 36;
}
@@ -705,7 +705,7 @@ static void lpphy_set_rc_cap(struct b43_wldev *dev)
u8 rc_cap = (lpphy->rc_cap & 0x1F) >> 1;
if (dev->phy.rev == 1) //FIXME check channel 14!
- rc_cap = max_t(u8, rc_cap + 5, 15);
+ rc_cap = min_t(u8, rc_cap + 5, 15);
b43_radio_write(dev, B2062_N_RXBB_CALIB2,
max_t(u8, lpphy->rc_cap - 4, 0x80));
@@ -1008,6 +1008,7 @@ static int lpphy_loopback(struct b43_wldev *dev)
b43_phy_maskset(dev, B43_LPPHY_RF_OVERRIDE_VAL_0, 0xFFFC, 0x3);
b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_0, 0x3);
+ b43_phy_set(dev, B43_LPPHY_AFE_CTL_OVR, 1);
b43_phy_mask(dev, B43_LPPHY_AFE_CTL_OVRVAL, 0xFFFE);
b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_0, 0x800);
b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_VAL_0, 0x800);
@@ -1213,7 +1214,7 @@ static void lpphy_rev0_1_rc_calib(struct b43_wldev *dev)
mean_sq_pwr = ideal_pwr - normal_pwr;
mean_sq_pwr *= mean_sq_pwr;
inner_sum += mean_sq_pwr;
- if ((i = 128) || (inner_sum < mean_sq_pwr_min)) {
+ if ((i == 128) || (inner_sum < mean_sq_pwr_min)) {
lpphy->rc_cap = i;
mean_sq_pwr_min = inner_sum;
}
--
1.5.6
^ permalink raw reply related
* Compiling against different kernel
From: Ed W @ 2009-08-25 12:46 UTC (permalink / raw)
To: linux-wireless
Hi, I am building a kernel for an embedded 32bit x86 kernel on my x86_64
machine. I have a 32bit x86 build environment in a chroot, but
obviously "uname" still looks like the host
I try to compile compat-wireless (2009-08-24) like this:
make ARCH=x86 KLIB=/usr/src/linux-2.6.30.5-grsecurity-2.1.14-aufs/
KLIB_BUILD=/usr/src/linux-2.6.30.5-grsecurity-2.1.14-aufs/
I get:
FATAL: Could not load
/lib/modules/2.6.29.6-grsec2.1.14-vs2.3.0.36.14/modules.dep: No such
file or directory
FATAL: Could not load
/lib/modules/2.6.29.6-grsec2.1.14-vs2.3.0.36.14/modules.dep: No such
file or directory
./scripts/gen-compat-autoconf.sh config.mk > include/linux/compat_autoconf.h
FATAL: Could not load
/lib/modules/2.6.29.6-grsec2.1.14-vs2.3.0.36.14/modules.dep: No such
file or directory
FATAL: Could not load
/lib/modules/2.6.29.6-grsec2.1.14-vs2.3.0.36.14/modules.dep: No such
file or directory
make -C /usr/src/linux-2.6.30.5-grsecurity-2.1.14-aufs/
M=/usr/src/compat-wireless-2009-08-24 modules
..etc..
(where it's clearly trying to find the modules dir for the running 64bit
kernel, rather than the
I'm looking through the makefile, but I can't see how it's trying to
adapt depmod to use the correct modules.dep?
Can someone please help with the correct incantation to cross compile?
Thanks
Ed W
^ permalink raw reply
* Re: Abour linux driver supports BCM4325
From: Michael Buesch @ 2009-08-25 10:53 UTC (permalink / raw)
To: feng tian; +Cc: Johannes Berg, Larry Finger, linux-wireless
In-Reply-To: <f42a38140908250016g72207b64h9d2a33cb73a78b1f@mail.gmail.com>
On Tuesday 25 August 2009 09:16:36 feng tian wrote:
> Dear Michael,
>
> Another question:
> We can't get the actual "datasheet" of BCM 4325. The pdf from broadcom
> is so rough, and we also sent email to ask more detailed spec, but no
> feedback.
> What kind of datasheet of BCM4325 are you using now?
> Could you please share this with us?
>
> Thank you very much.
>
> BR, Feng
>
>
http://bcm-v4.sipsolutions.net/
--
Greetings, Michael.
^ permalink raw reply
* Re: Linux Kernel Wireless stack presentation
From: Johannes Berg @ 2009-08-25 10:37 UTC (permalink / raw)
To: Rami Rosen; +Cc: linux-wireless
In-Reply-To: <eb3ff54b0908250329s3e1a4715u27c82512fff520d5@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 792 bytes --]
Hi,
> > iwconfig wlan0 power timeout 0 == PS-poll,
>
> I am not sure I fully understand what you mean here by
> "iwconfig wlan0 power timeout 0 == PS-poll". As far as I understand,
> "iwconfig wlan0 power timeout 0" invokes ieee80211_change_ps(); this method
> notifies the driver about disabling PS (by
> ieee80211_hw_config(...IEEE80211_CONF_CHANGE_PS))
> and sets the flags to have ~IEEE80211_CONF_PS; It also cancells the
> dynamic_ps_enable_work work_queue thread. But what PS-POLL has to do with it ?
> I am not sure I understand how PSPOLL is relevant here.
No,
iwconfig wlan0 power off
goes into the disable PS case.
iwconfig wlan0 power timeout 0
sets the timeout to zero and power management on. And when the timeout
is 0 we use ps-poll.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: Linux Kernel Wireless stack presentation
From: Rami Rosen @ 2009-08-25 10:29 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1250760130.4100.23.camel@johannes.local>
Hello,
> iwconfig wlan0 power timeout 0 == PS-poll,
I am not sure I fully understand what you mean here by
"iwconfig wlan0 power timeout 0 == PS-poll". As far as I understand,
"iwconfig wlan0 power timeout 0" invokes ieee80211_change_ps(); this method
notifies the driver about disabling PS (by
ieee80211_hw_config(...IEEE80211_CONF_CHANGE_PS))
and sets the flags to have ~IEEE80211_CONF_PS; It also cancells the
dynamic_ps_enable_work work_queue thread. But what PS-POLL has to do with it ?
I am not sure I understand how PSPOLL is relevant here.
It could be that I missunderstand you in some point here.
Regards,
Rami Rosen
On Thu, Aug 20, 2009 at 12:22 PM, Johannes
Berg<johannes@sipsolutions.net> wrote:
> On Thu, 2009-08-20 at 10:02 +0300, Rami Rosen wrote:
>
>> http://tuxology.net/wp-content/uploads/2009/08/wirelessLecHerzelinux.pdf
>
> had a quick look
>
> * almost all drivers support passive scanning -- all the modern ones at
> least -- maybe some old drivers don't, but all using cfg80211 do
> * your presentation is based on old code -- all the code stuff about
> scanning is already outdated in wireless-testing
> * you can scan for multiple specific SSIDs and channels:
> iw wlan0 scan freq 2412 ssid foo bar baz
> * iw has a better IE parser, so showing a result from that may be more
> instructive
> * code stuff about authentication/association is also outdated already
> * the STA_MLME_DISABLED stuff no longer exists
> * AP MLME will never be in the kernel, not just not in the near
> future :)
> * raw packets still go through the mac80211 stack, they arrive in
> monitor_start_xmit() or so
> * four-address format is not necessarily used only for WDS, the
> standard doesn't define uses for it (ToDS = FromDS = 1)
> * an AP may transmit nullfunc (!) frames to tell clients it has no data
> buffered, but it never transmits frames with the PM bit on
> * power timeout 5 is described incorrectly -- it doesn't go to sleep
> for 5 seconds, it actually stays awake for 5 seconds after each
> packet transmission -- the time spent asleep is calculated based on
> the DTIM period etc. Cf. 04fe20372e70685d9f15966216cdffd3795fe590.
> * STA may wake up in response to TIM[AID] == 1 instead of sending
> PS-poll, which we do depends on the timeout (iwconfig wlan0 power
> timeout 0 == PS-poll, iwconfig wlan0 power timeout 100ms == send
> nullfunc and stay awake for 100ms)
> * "paramter" typo
> * ibss is in net/mac80211/ibss.c and has been for quite a while
> * PM in IBSS is not implemented typically
> * s/80211.s/802.11s/
> * s/80211.n/802.11n/
> * you can change the channel with iw (iw phy set freq ...) but it isn't
> really useful unless you're AP/monitor (and rejected otherwise)
> * Fedora no longer updates from wireless-testing afaik
> * wmaster0 is no longer created
> * assigning interface_modes doesn't set the mode, it just sets the
> possible modes :)
> * you can also call iterate_interfaces_atomic() in irq context
> * nobody cares about the wireless extensions version any more :)
> * for sniffing you may care about "iw dev <devname> set monitor <flag>*"
>
> Hey that got long!
>
> johannes
>
^ permalink raw reply
* [PATCH] PRISM54: fix compilation warning
From: Jaswinder Singh Rajput @ 2009-08-25 9:58 UTC (permalink / raw)
To: Luis R. Rodriguez, linux-wireless, John W. Linville
CC [M] drivers/net/wireless/prism54/islpci_eth.o
drivers/net/wireless/prism54/islpci_eth.c: In function ‘islpci_eth_cleanup_transmit’:
drivers/net/wireless/prism54/islpci_eth.c:53: warning: cast from pointer to integer of different size
drivers/net/wireless/prism54/islpci_eth.c: In function ‘islpci_eth_receive’:
drivers/net/wireless/prism54/islpci_eth.c:453: warning: cast from pointer to integer of different size
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
drivers/net/wireless/prism54/islpci_eth.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c
index 8f62109..80a9a9c 100644
--- a/drivers/net/wireless/prism54/islpci_eth.c
+++ b/drivers/net/wireless/prism54/islpci_eth.c
@@ -50,7 +50,7 @@ islpci_eth_cleanup_transmit(islpci_private *priv,
/* check for holes in the arrays caused by multi fragment frames
* searching for the last fragment of a frame */
- if (priv->pci_map_tx_address[index] != (dma_addr_t) NULL) {
+ if (priv->pci_map_tx_address[index]) {
/* entry is the last fragment of a frame
* free the skb structure and unmap pci memory */
skb = priv->data_low_tx[index];
@@ -450,7 +450,7 @@ islpci_eth_receive(islpci_private *priv)
pci_map_single(priv->pdev, (void *) skb->data,
MAX_FRAGMENT_SIZE_RX + 2,
PCI_DMA_FROMDEVICE);
- if (unlikely(priv->pci_map_rx_address[index] == (dma_addr_t) NULL)) {
+ if (unlikely(!priv->pci_map_rx_address[index])) {
/* error mapping the buffer to device accessable memory address */
DEBUG(SHOW_ERROR_MESSAGES,
"Error mapping DMA address\n");
--
1.6.2.5
^ permalink raw reply related
* Re: [RFC/RFT] rtl8187: Implement rfkill support
From: Johannes Berg @ 2009-08-25 9:27 UTC (permalink / raw)
To: htl10; +Cc: Larry Finger, Herton Ronaldo Krzesinski, linux-wireless
In-Reply-To: <950315.98615.qm@web23105.mail.ird.yahoo.com>
[-- Attachment #1: Type: text/plain, Size: 806 bytes --]
On Tue, 2009-08-25 at 06:51 +0000, Hin-Tak Leung wrote:
> dmesg and rfkill/state corresponds exactly to what the sliding switch
> does (in the on position, dmesg says it is on, states says 2, in the
> off position, dmesg says it is off, state says 1). NM basically
> ignores rfkill/state, and just if'up the device whenever it notices
> the device has gone down.
NM can't ignore the state since cfg80211 enforces it.
Can you please use rfkill (http://git.sipsolutions.net/rfkill.git) to
see what's going on? Like print out events while you slide the button
and use NM etc.
One thing that would be possible -- does your poll callback work while
the interface is down? Try to tell NM to turn off the wireless network,
and see whether the state ever changes with your slider.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [PATCH] compal-laptop: Replace sysfs support with rfkill support
From: Alan Jenkins @ 2009-08-25 8:15 UTC (permalink / raw)
To: Mario Limonciello
Cc: cezary.jackiewicz, linux-wireless, linux-acpi, linux-kernel
In-Reply-To: <1251143422-13905-1-git-send-email-Mario_Limonciello@Dell.com>
On 8/24/09, Mario Limonciello <Mario_Limonciello@dell.com> wrote:
> This drops the support for manually groking the files in sysfs
> to turn on and off the WLAN and BT for Compal laptops in favor
> of platform rfkill support.
>
> It has been combined into a single patch to not introduce regressions
> in the process of simply adding rfkill support
Ok, that looks better.
Thanks
Alan
^ permalink raw reply
* Re: Abour linux driver supports BCM4325
From: feng tian @ 2009-08-25 7:16 UTC (permalink / raw)
To: Michael Buesch; +Cc: Johannes Berg, Larry Finger, linux-wireless
In-Reply-To: <f42a38140908240235v9206b79m3055f8a96c3dcb64@mail.gmail.com>
Dear Michael,
Another question:
We can't get the actual "datasheet" of BCM 4325. The pdf from broadcom
is so rough, and we also sent email to ask more detailed spec, but no
feedback.
What kind of datasheet of BCM4325 are you using now?
Could you please share this with us?
Thank you very much.
BR, Feng
^ permalink raw reply
* Re: [RFC/RFT] rtl8187: Implement rfkill support
From: Hin-Tak Leung @ 2009-08-25 6:51 UTC (permalink / raw)
To: Larry Finger; +Cc: Herton Ronaldo Krzesinski, linux-wireless
In-Reply-To: <4A935C2D.5010308@lwfinger.net>
--- On Tue, 25/8/09, Larry Finger <Larry.Finger@lwfinger.net> wrote:
> Hin-Tak Leung wrote:
> > --- On Tue, 25/8/09, Larry Finger <Larry.Finger@lwfinger.net>
> wrote:
> >
> >>> [PATCH] rtl8187: fix circular locking
> >> (rtl8187_stop/rtl8187_work)
> >>
> >> This patch fixes the problem. You can add a
> Tested-by to
> >> it.
> >
> > Hmm, I am still wondering about why NM insists on if
> up'ing the device. I read bits of things and apparently hal
> is supposed to know the device is rfkill'ed and let NM know.
> But lshal is not listing the device as having an killswitch.
> I don't know how hal is supposed to work out that info
> though.
> >
> > also I noted that
> /sys/class/rfkill_backport/rfkill0/state goes from 1 to 2
> when I slide the switch to the 'off' position. Some says it
> should be 0?
> > Don't know if hal is affected by its being
> rfkill_backport (compat-wireless) rather than rfkill (stock
> vendor kernel). well, it should look there if it isn't :-).
> >
> > It looks like it is a hal problem...
>
> The interpretation is as follows:
> 0 - blocked by software such as 'rfkill block 1'
> 1 - unblocked
> 2 - blocked by hardware
>
> Your state is doing exactly what I would expect. When NM
> brings the
> device up, does the above state change? Does dmesg show
> anything?
dmesg and rfkill/state corresponds exactly to what the sliding switch does (in the on position, dmesg says it is on, states says 2, in the off position, dmesg says it is off, state says 1). NM basically ignores rfkill/state, and just if'up the device whenever it notices the device has gone down.
hal is supposed to have knowledge of the rfkill state (which it hasn't, from what I see of the lshal output - there is no killswitch entry in there), and let NM through dbus know to not bother the device. At the moment I think it is somewhere in hal that's not working properly.
^ permalink raw reply
* Re: [RFC/RFT] rtl8187: Implement rfkill support
From: Larry Finger @ 2009-08-25 3:36 UTC (permalink / raw)
To: htl10; +Cc: Herton Ronaldo Krzesinski, linux-wireless
In-Reply-To: <622090.22128.qm@web23106.mail.ird.yahoo.com>
Hin-Tak Leung wrote:
> --- On Tue, 25/8/09, Larry Finger <Larry.Finger@lwfinger.net> wrote:
>
>>> [PATCH] rtl8187: fix circular locking
>> (rtl8187_stop/rtl8187_work)
>>
>> This patch fixes the problem. You can add a Tested-by to
>> it.
>
> Hmm, I am still wondering about why NM insists on if up'ing the device. I read bits of things and apparently hal is supposed to know the device is rfkill'ed and let NM know. But lshal is not listing the device as having an killswitch. I don't know how hal is supposed to work out that info though.
>
> also I noted that /sys/class/rfkill_backport/rfkill0/state goes from 1 to 2 when I slide the switch to the 'off' position. Some says it should be 0?
> Don't know if hal is affected by its being rfkill_backport (compat-wireless) rather than rfkill (stock vendor kernel). well, it should look there if it isn't :-).
>
> It looks like it is a hal problem...
The interpretation is as follows:
0 - blocked by software such as 'rfkill block 1'
1 - unblocked
2 - blocked by hardware
Your state is doing exactly what I would expect. When NM brings the
device up, does the above state change? Does dmesg show anything?
Larry
^ permalink raw reply
* [PATCH 3/4] ath5k: use the skb->cb directly for RX status
From: Bob Copeland @ 2009-08-25 3:00 UTC (permalink / raw)
To: linville, jirislaby, mickflemm, lrodriguez
Cc: linux-wireless, ath5k-devel, Bob Copeland
In-Reply-To: <1251169233-24169-1-git-send-email-me@bobcopeland.com>
Save a memcpy by just storing updates directly in the skb
control block.
Signed-off-by: Bob Copeland <me@bobcopeland.com>
---
drivers/net/wireless/ath/ath5k/base.c | 41 +++++++++++++++++----------------
1 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index c4adf98..10bf015 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1741,7 +1741,7 @@ ath5k_check_ibss_tsf(struct ath5k_softc *sc, struct sk_buff *skb,
static void
ath5k_tasklet_rx(unsigned long data)
{
- struct ieee80211_rx_status rxs = {};
+ struct ieee80211_rx_status *rxs;
struct ath5k_rx_status rs = {};
struct sk_buff *skb, *next_skb;
dma_addr_t next_skb_addr;
@@ -1751,6 +1751,7 @@ ath5k_tasklet_rx(unsigned long data)
int ret;
int hdrlen;
int padsize;
+ int rx_flag;
spin_lock(&sc->rxbuflock);
if (list_empty(&sc->rxbuf)) {
@@ -1758,7 +1759,7 @@ ath5k_tasklet_rx(unsigned long data)
goto unlock;
}
do {
- rxs.flag = 0;
+ rx_flag = 0;
bf = list_first_entry(&sc->rxbuf, struct ath5k_buf, list);
BUG_ON(bf->skb == NULL);
@@ -1802,7 +1803,7 @@ ath5k_tasklet_rx(unsigned long data)
goto accept;
}
if (rs.rs_status & AR5K_RXERR_MIC) {
- rxs.flag |= RX_FLAG_MMIC_ERROR;
+ rx_flag |= RX_FLAG_MMIC_ERROR;
goto accept;
}
@@ -1840,6 +1841,7 @@ accept:
memmove(skb->data + padsize, skb->data, hdrlen);
skb_pull(skb, padsize);
}
+ rxs = IEEE80211_SKB_RXCB(skb);
/*
* always extend the mac timestamp, since this information is
@@ -1861,41 +1863,40 @@ accept:
* impossible to comply to that. This affects IBSS merge only
* right now, so it's not too bad...
*/
- rxs.mactime = ath5k_extend_tsf(sc->ah, rs.rs_tstamp);
- rxs.flag |= RX_FLAG_TSFT;
+ rxs->mactime = ath5k_extend_tsf(sc->ah, rs.rs_tstamp);
+ rxs->flag = rx_flag | RX_FLAG_TSFT;
- rxs.freq = sc->curchan->center_freq;
- rxs.band = sc->curband->band;
+ rxs->freq = sc->curchan->center_freq;
+ rxs->band = sc->curband->band;
- rxs.noise = sc->ah->ah_noise_floor;
- rxs.signal = rxs.noise + rs.rs_rssi;
+ rxs->noise = sc->ah->ah_noise_floor;
+ rxs->signal = rxs->noise + rs.rs_rssi;
/* An rssi of 35 indicates you should be able use
* 54 Mbps reliably. A more elaborate scheme can be used
* here but it requires a map of SNR/throughput for each
* possible mode used */
- rxs.qual = rs.rs_rssi * 100 / 35;
+ rxs->qual = rs.rs_rssi * 100 / 35;
/* rssi can be more than 35 though, anything above that
* should be considered at 100% */
- if (rxs.qual > 100)
- rxs.qual = 100;
+ if (rxs->qual > 100)
+ rxs->qual = 100;
- rxs.antenna = rs.rs_antenna;
- rxs.rate_idx = ath5k_hw_to_driver_rix(sc, rs.rs_rate);
- rxs.flag |= ath5k_rx_decrypted(sc, ds, skb, &rs);
+ rxs->antenna = rs.rs_antenna;
+ rxs->rate_idx = ath5k_hw_to_driver_rix(sc, rs.rs_rate);
+ rxs->flag |= ath5k_rx_decrypted(sc, ds, skb, &rs);
- if (rxs.rate_idx >= 0 && rs.rs_rate ==
- sc->curband->bitrates[rxs.rate_idx].hw_value_short)
- rxs.flag |= RX_FLAG_SHORTPRE;
+ if (rxs->rate_idx >= 0 && rs.rs_rate ==
+ sc->curband->bitrates[rxs->rate_idx].hw_value_short)
+ rxs->flag |= RX_FLAG_SHORTPRE;
ath5k_debug_dump_skb(sc, skb, "RX ", 0);
/* check beacons in IBSS mode */
if (sc->opmode == NL80211_IFTYPE_ADHOC)
- ath5k_check_ibss_tsf(sc, skb, &rxs);
+ ath5k_check_ibss_tsf(sc, skb, rxs);
- memcpy(IEEE80211_SKB_RXCB(skb), &rxs, sizeof(rxs));
ieee80211_rx(sc->hw, skb);
bf->skb = next_skb;
--
1.6.2.5
^ permalink raw reply related
* [PATCH 1/4] ath5k: clean up filter flags setting
From: Bob Copeland @ 2009-08-25 3:00 UTC (permalink / raw)
To: linville, jirislaby, mickflemm, lrodriguez
Cc: linux-wireless, ath5k-devel, Bob Copeland
In-Reply-To: <1251169233-24169-1-git-send-email-me@bobcopeland.com>
The maze of if() statements in configure_filter is confusing.
Reorganizing it as a switch statement makes it more apparent what
is going on and reveals several suspicious settings. This has no
functional changes, though it does remove some redundant flags
that are set earlier.
Also now that we can sleep, protect sc->filter_flags with the
sc lock.
Signed-off-by: Bob Copeland <me@bobcopeland.com>
---
drivers/net/wireless/ath/ath5k/base.c | 39 +++++++++++++++++++-------------
1 files changed, 23 insertions(+), 16 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 5056410..c4adf98 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2918,6 +2918,8 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
struct ath5k_hw *ah = sc->ah;
u32 mfilt[2], rfilt;
+ mutex_lock(&sc->lock);
+
mfilt[0] = multicast;
mfilt[1] = multicast >> 32;
@@ -2968,22 +2970,25 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
/* XXX move these to mac80211, and add a beacon IFF flag to mac80211 */
- if (sc->opmode == NL80211_IFTYPE_MONITOR)
- rfilt |= AR5K_RX_FILTER_CONTROL | AR5K_RX_FILTER_BEACON |
- AR5K_RX_FILTER_PROBEREQ | AR5K_RX_FILTER_PROM;
- if (sc->opmode != NL80211_IFTYPE_STATION)
- rfilt |= AR5K_RX_FILTER_PROBEREQ;
- if (sc->opmode != NL80211_IFTYPE_AP &&
- sc->opmode != NL80211_IFTYPE_MESH_POINT &&
- test_bit(ATH_STAT_PROMISC, sc->status))
- rfilt |= AR5K_RX_FILTER_PROM;
- if ((sc->opmode == NL80211_IFTYPE_STATION && sc->assoc) ||
- sc->opmode == NL80211_IFTYPE_ADHOC ||
- sc->opmode == NL80211_IFTYPE_AP)
- rfilt |= AR5K_RX_FILTER_BEACON;
- if (sc->opmode == NL80211_IFTYPE_MESH_POINT)
- rfilt |= AR5K_RX_FILTER_CONTROL | AR5K_RX_FILTER_BEACON |
- AR5K_RX_FILTER_PROBEREQ | AR5K_RX_FILTER_PROM;
+ switch (sc->opmode) {
+ case NL80211_IFTYPE_MESH_POINT:
+ case NL80211_IFTYPE_MONITOR:
+ rfilt |= AR5K_RX_FILTER_CONTROL |
+ AR5K_RX_FILTER_BEACON |
+ AR5K_RX_FILTER_PROBEREQ |
+ AR5K_RX_FILTER_PROM;
+ break;
+ case NL80211_IFTYPE_AP:
+ case NL80211_IFTYPE_ADHOC:
+ rfilt |= AR5K_RX_FILTER_PROBEREQ |
+ AR5K_RX_FILTER_BEACON;
+ break;
+ case NL80211_IFTYPE_STATION:
+ if (sc->assoc)
+ rfilt |= AR5K_RX_FILTER_BEACON;
+ default:
+ break;
+ }
/* Set filters */
ath5k_hw_set_rx_filter(ah, rfilt);
@@ -2993,6 +2998,8 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
/* Set the cached hw filter flags, this will alter actually
* be set in HW */
sc->filter_flags = rfilt;
+
+ mutex_unlock(&sc->lock);
}
static int
--
1.6.2.5
^ permalink raw reply related
* [PATCH 4/4] ath5k: add hardware CCMP encyption support
From: Bob Copeland @ 2009-08-25 3:00 UTC (permalink / raw)
To: linville, jirislaby, mickflemm, lrodriguez
Cc: linux-wireless, ath5k-devel, Bob Copeland
In-Reply-To: <1251169233-24169-1-git-send-email-me@bobcopeland.com>
Recent ath5k hardware is capable of doing CCMP acceleration.
Enable it for the cards that support it.
Signed-off-by: Bob Copeland <me@bobcopeland.com>
---
drivers/net/wireless/ath/ath5k/ath5k.h | 1 +
drivers/net/wireless/ath/ath5k/attach.c | 10 ++++++++++
drivers/net/wireless/ath/ath5k/base.c | 3 +++
3 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index 862762c..cdc79cd 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -1037,6 +1037,7 @@ struct ath5k_hw {
bool ah_turbo;
bool ah_calibration;
bool ah_single_chip;
+ bool ah_aes_support;
bool ah_combined_mic;
enum ath5k_version ah_version;
diff --git a/drivers/net/wireless/ath/ath5k/attach.c b/drivers/net/wireless/ath/ath5k/attach.c
index 65d438b..109ab7b 100644
--- a/drivers/net/wireless/ath/ath5k/attach.c
+++ b/drivers/net/wireless/ath/ath5k/attach.c
@@ -106,6 +106,7 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
{
struct ath5k_hw *ah;
struct pci_dev *pdev = sc->pdev;
+ struct ath5k_eeprom_info *ee;
int ret;
u32 srev;
@@ -315,6 +316,15 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
goto err_free;
}
+ /* Crypto settings */
+ ee = &ah->ah_capabilities.cap_eeprom;
+ ah->ah_aes_support =
+ (ee->ee_version >= AR5K_EEPROM_VERSION_5_0 &&
+ !AR5K_EEPROM_AES_DIS(ee->ee_misc5) &&
+ (ah->ah_mac_version > (AR5K_SREV_AR5212 >> 4) ||
+ (ah->ah_mac_version == (AR5K_SREV_AR5212 >> 4) &&
+ ah->ah_mac_revision >= (AR5K_SREV_AR5211 >> 4))));
+
if (srev >= AR5K_SREV_AR2414) {
ah->ah_combined_mic = true;
AR5K_REG_ENABLE_BITS(ah, AR5K_MISC_MODE,
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 10bf015..94d46fd 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -3022,6 +3022,9 @@ ath5k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
case ALG_TKIP:
break;
case ALG_CCMP:
+ if (sc->ah->ah_aes_support)
+ break;
+
return -EOPNOTSUPP;
default:
WARN_ON(1);
--
1.6.2.5
^ permalink raw reply related
* [PATCH 0/4] ath5k: misc updates
From: Bob Copeland @ 2009-08-25 3:00 UTC (permalink / raw)
To: linville, jirislaby, mickflemm, lrodriguez
Cc: linux-wireless, ath5k-devel, Bob Copeland
Hi John,
Here are a few patches that have been sitting around in my tree
for a while. A cleanup or two, rxs conversion, and CCMP support.
Bob Copeland (4):
ath5k: clean up filter flags setting
ath5k: add led pin configuration for compaq c700 laptop
ath5k: use the skb->cb directly for RX status
ath5k: add hardware CCMP encyption support
drivers/net/wireless/ath/ath5k/ath5k.h | 1 +
drivers/net/wireless/ath/ath5k/attach.c | 10 ++++
drivers/net/wireless/ath/ath5k/base.c | 83 +++++++++++++++++-------------
drivers/net/wireless/ath/ath5k/led.c | 2 +
4 files changed, 60 insertions(+), 36 deletions(-)
^ permalink raw reply
* [PATCH 2/4] ath5k: add led pin configuration for compaq c700 laptop
From: Bob Copeland @ 2009-08-25 3:00 UTC (permalink / raw)
To: linville, jirislaby, mickflemm, lrodriguez
Cc: linux-wireless, ath5k-devel, Bob Copeland, Marcos Chaparro
In-Reply-To: <1251169233-24169-1-git-send-email-me@bobcopeland.com>
From: Marcos Chaparro <nitrousnrg@gmail.com>
With this patch, a compaq c700 can turn on the wifi led.
The array of compatible devices now includes the hardware
present in this computer, as well as the led pin and
polarity.
Signed-off-by: Marcos Chaparro <nitrousnrg@gmail.com>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
---
drivers/net/wireless/ath/ath5k/led.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/led.c b/drivers/net/wireless/ath/ath5k/led.c
index 876725f..b767c3b 100644
--- a/drivers/net/wireless/ath/ath5k/led.c
+++ b/drivers/net/wireless/ath/ath5k/led.c
@@ -69,6 +69,8 @@ static const struct pci_device_id ath5k_led_devices[] = {
{ ATH_SDEVICE(PCI_VENDOR_ID_AZWAVE, 0x1026), ATH_LED(3, 0) },
/* IBM ThinkPad AR5BXB6 (legovini@spiro.fisica.unipd.it) */
{ ATH_SDEVICE(PCI_VENDOR_ID_IBM, 0x058a), ATH_LED(1, 0) },
+ /* HP Compaq C700 (nitrousnrg@gmail.com) */
+ { ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137b), ATH_LED(3, 1) },
/* IBM-specific AR5212 (all others) */
{ PCI_VDEVICE(ATHEROS, PCI_DEVICE_ID_ATHEROS_AR5212_IBM), ATH_LED(0, 0) },
{ }
--
1.6.2.5
^ permalink raw reply related
* Re: [RFC/RFT] rtl8187: Implement rfkill support
From: Hin-Tak Leung @ 2009-08-25 2:51 UTC (permalink / raw)
To: Herton Ronaldo Krzesinski, Larry Finger; +Cc: linux-wireless
In-Reply-To: <4A933E87.7030600@lwfinger.net>
--- On Tue, 25/8/09, Larry Finger <Larry.Finger@lwfinger.net> wrote:
> > [PATCH] rtl8187: fix circular locking
> (rtl8187_stop/rtl8187_work)
>
> This patch fixes the problem. You can add a Tested-by to
> it.
Hmm, I am still wondering about why NM insists on if up'ing the device. I read bits of things and apparently hal is supposed to know the device is rfkill'ed and let NM know. But lshal is not listing the device as having an killswitch. I don't know how hal is supposed to work out that info though.
also I noted that /sys/class/rfkill_backport/rfkill0/state goes from 1 to 2 when I slide the switch to the 'off' position. Some says it should be 0?
Don't know if hal is affected by its being rfkill_backport (compat-wireless) rather than rfkill (stock vendor kernel). well, it should look there if it isn't :-).
It looks like it is a hal problem...
^ permalink raw reply
* Re: [RFC/RFT] rtl8187: Implement rfkill support
From: Larry Finger @ 2009-08-25 1:29 UTC (permalink / raw)
To: Herton Ronaldo Krzesinski; +Cc: linux-wireless, Hin-Tak Leung
In-Reply-To: <200908241503.38020.herton@mandriva.com.br>
Herton Ronaldo Krzesinski wrote:
> Em Dom 23 Ago 2009, às 22:46:40, Larry Finger escreveu:
>> Herton Ronaldo Krzesinski wrote:
>>> This change implements rfkill support for RTL8187B and RTL8187L devices,
>>> using new cfg80211 rfkill API.
>>>
>>> Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
>>> ---
>> I found a problem with this patch. When I issue an 'rfkill block 1'
>> command, I get the following circular locking warning:
>
> Hmm, this is a issue that was already present before the rfkill patch, but
> seems with it, it became more likely to happen. Please try this patch:
>
> [PATCH] rtl8187: fix circular locking (rtl8187_stop/rtl8187_work)
This patch fixes the problem. You can add a Tested-by to it.
Larry
^ permalink raw reply
* Re: [PATCH] ath9k: Fix read buffer overflow
From: Luis R. Rodriguez @ 2009-08-24 23:34 UTC (permalink / raw)
To: John W. Linville
Cc: Roel Kluin, Jouni Malinen, linux-wireless, ath9k-devel,
Andrew Morton, m.sujith
In-Reply-To: <20090820145239.GC2657@tuxdriver.com>
On Thu, Aug 20, 2009 at 7:52 AM, John W. Linville<linville@tuxdriver.com> wrote:
> Anybody?
Sorry for the delay,
Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com>
This is actually pretty sloppy existing code and I'd prefer to see
this nasty POS code rewritten to avoid such nasty checks from the
start. Also notice how both ath9k_hw_get_legacy_target_powers() and
ath9k_hw_get_target_powers() do exactly the same, except they use a
different name for the bool, a different structure for the calibrated
power targets (array size changes on one element of the struct). But
this patch also fixes another not-noted potential negative rade index
access: lowIndex could be -1 under a special circumstance and this
would prevent that negative index access as well on powInfo[lowIndex].
So although this probably just does not happen right now its safer to
have a fix for two of these theoretical negative array index access
than nothing at hand; a proper rewrite of these two routines as I want
it would require quite a few changes here and more testing. Mentally
lets add that to the TODO list..
Luis
^ 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