* Re: mac80211: NOHZ: local_softirq_pending 08
From: Oliver Hartkopp @ 2009-09-12 16:41 UTC (permalink / raw)
To: Michael Buesch
Cc: Kalle Valo, linux-wireless, netdev, Johannes Berg,
John W. Linville
In-Reply-To: <200909111813.35810.mb@bu3sch.de>
[-- Attachment #1: Type: text/plain, Size: 932 bytes --]
Michael Buesch wrote:
>> As there are several users in the kernel do exact this test and call the
>> appropriate netif_rx() function, i would suggest to create a static inline
>> function:
>>
>> static inline int netif_rx_ti(struct sk_buff *skb)
>> {
>> if (in_interrupt())
>> return netif_rx(skb);
>> return netif_rx_ni(skb);
>> }
>>
>> ('ti' for test in_interrupt())
>>
>> in include/linux/netdevice.h
>>
>> What do you think about that?
>
> Yeah, I'm fine with that.
>
Hi Michael,
i cooked a patch that introduces netif_rx_ti() and fixes up the problems in
mac80211 and the CAN subsystem.
Currently i'm pondering whether netif_rx_ti() is needed in all cases or if
there are code sections that'll never be executed from irq-context.
In theses cases netif_rx_ni() should be prefered to netif_rx_ti() to prevent
the obsolete check ...
Is there any of your changes that should better use netif_rx_ni() ?
Regards,
Oliver
[-- Attachment #2: net-NOHZ-local_softirq_pending-08.patch --]
[-- Type: text/x-patch, Size: 3612 bytes --]
diff --git a/drivers/net/can/vcan.c b/drivers/net/can/vcan.c
index 6971f6c..899f3d3 100644
--- a/drivers/net/can/vcan.c
+++ b/drivers/net/can/vcan.c
@@ -80,7 +80,7 @@ static void vcan_rx(struct sk_buff *skb, struct net_device *dev)
skb->dev = dev;
skb->ip_summed = CHECKSUM_UNNECESSARY;
- netif_rx(skb);
+ netif_rx_ti(skb);
}
static netdev_tx_t vcan_tx(struct sk_buff *skb, struct net_device *dev)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a44118b..b34c05d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1503,6 +1503,18 @@ extern int netdev_budget;
extern void netdev_run_todo(void);
/**
+ * netif_rx_ti - test for irq context and post buffer to the network code
+ * @skb: buffer to post
+ *
+ */
+static inline int netif_rx_ti(struct sk_buff *skb)
+{
+ if (in_interrupt())
+ return netif_rx(skb);
+ return netif_rx_ni(skb);
+}
+
+/**
* dev_put - release reference to device
* @dev: network device
*
diff --git a/net/can/af_can.c b/net/can/af_can.c
index ef1c43a..c21e7f4 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -278,7 +278,7 @@ int can_send(struct sk_buff *skb, int loop)
}
if (newskb)
- netif_rx(newskb);
+ netif_rx_ti(newskb);
/* update statistics */
can_stats.tx_frames++;
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 5608f6c..bbcb4cb 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -606,7 +606,7 @@ static void ieee80211_send_layer2_update(struct sta_info *sta)
skb->dev = sta->sdata->dev;
skb->protocol = eth_type_trans(skb, sta->sdata->dev);
memset(skb->cb, 0, sizeof(skb->cb));
- netif_rx(skb);
+ netif_rx_ti(skb);
}
static void sta_apply_parameters(struct ieee80211_local *local,
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 797f539..1109f99 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -591,7 +591,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
skb2 = skb_clone(skb, GFP_ATOMIC);
if (skb2) {
skb2->dev = prev_dev;
- netif_rx(skb2);
+ netif_rx_ti(skb2);
}
}
@@ -600,7 +600,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
}
if (prev_dev) {
skb->dev = prev_dev;
- netif_rx(skb);
+ netif_rx_ti(skb);
skb = NULL;
}
rcu_read_unlock();
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index c01588f..5bb7c04 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -309,7 +309,7 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb,
skb2 = skb_clone(skb, GFP_ATOMIC);
if (skb2) {
skb2->dev = prev_dev;
- netif_rx(skb2);
+ netif_rx_ti(skb2);
}
}
@@ -320,7 +320,7 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb,
if (prev_dev) {
skb->dev = prev_dev;
- netif_rx(skb);
+ netif_rx_ti(skb);
} else
dev_kfree_skb(skb);
@@ -1349,7 +1349,7 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
/* deliver to local stack */
skb->protocol = eth_type_trans(skb, dev);
memset(skb->cb, 0, sizeof(skb->cb));
- netif_rx(skb);
+ netif_rx_ti(skb);
}
}
@@ -1943,7 +1943,7 @@ static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx)
skb2 = skb_clone(skb, GFP_ATOMIC);
if (skb2) {
skb2->dev = prev_dev;
- netif_rx(skb2);
+ netif_rx_ti(skb2);
}
}
@@ -1954,7 +1954,7 @@ static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx)
if (prev_dev) {
skb->dev = prev_dev;
- netif_rx(skb);
+ netif_rx_ti(skb);
skb = NULL;
} else
goto out_free_skb;
^ permalink raw reply related
* Re: A station can't reconnect after it wakes up
From: Johannes Berg @ 2009-09-12 14:58 UTC (permalink / raw)
To: Igor Perminov; +Cc: linux-wireless, hostap, Jouni Malinen, Artur Skawina
In-Reply-To: <1252620184.26765.65.camel@sunlight>
[-- Attachment #1: Type: text/plain, Size: 1133 bytes --]
On Fri, 2009-09-11 at 02:03 +0400, Igor Perminov wrote:
> Jouni suggests to not buffer Auth/Assoc frames at all, independently of
> station's PS state.
Ok, works for me.
> I think, it isn't enough, because an AP should send
> a number of EAPOL Key frames after that, which are data frames and
> therefore will be buffered anyway.
That's not a problem though since the handshake will be in data frames
and synchronise the PS state on both ends via the sleep bit.
> I think mac80211 in AP mode should reset WLAN_STA_PS flag of the station
> (and purge frames having been buffered previously if any) on an event
> indicating beginning of authentication.
> The event may be one of the following:
> A) An Auth frame being received from the station.
> B) An Auth frame being sent to the station.
> C) A special API call from an application (hostapd), when it is
> receiving an Auth frame from the station and is beginning
> authentication/association.
>
> Johannes, what do you think of these approaches?
I think this is not necessary. Just make sure that auth/assoc frames
aren't buffered.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [PATCH] cfg80211: allow scanning on specified frequencies when using wext-compatibility
From: Johannes Berg @ 2009-09-12 14:56 UTC (permalink / raw)
To: Holger Schurig; +Cc: John W Linville, linux-wireless
In-Reply-To: <200909110952.14644.hs4233@mail.mn-solutions.de>
[-- Attachment #1: Type: text/plain, Size: 1074 bytes --]
On Fri, 2009-09-11 at 09:52 +0200, Holger Schurig wrote:
> Now, if I want to report an -EINVAL for every possibly invalid
> scan-request channel, I'd have to do this:
>
>
> If scan-request has freqs:
> Loop over all scan-request freqs
> Loop over all bands
> Loop over all channels
> search for freq
> if found:
> Stick channel to scan request
> else:
> err = -EINVAL
> else:
> Loop over all bands
> Loop over all channels
> Stick channel to scan request
>
> This is considerable code-bloat for such a seldom-used function.
Doesn't seem that bad considering that the inner loop is already in an
existing function.
> I'd rather do it like this:
>
>
> Loop over all bands
> Loop over all channels
> If scan-request hasn't this channel freq: continue
> Stick channel to scan request
> if no channels:
> err = -EINVAL
>
> That's a compromise :-)
I guess. I'd still prefer the other way, but it's wext, so I don't
really care :)
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [PATCH 07/13] iwlwifi: clean up ht config a little
From: Johannes Berg @ 2009-09-12 13:12 UTC (permalink / raw)
To: Gábor Stefanik
Cc: Reinette Chatre, linville, linux-wireless, ipw3945-devel
In-Reply-To: <69e28c910909111046m23414728nb9b56c53960340ea@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 723 bytes --]
On Fri, 2009-09-11 at 19:46 +0200, Gábor Stefanik wrote:
> On Fri, Sep 11, 2009 at 7:38 PM, Reinette Chatre
> <reinette.chatre@intel.com> wrote:
> > From: Johannes Berg <johannes@sipsolutions.net>
> >
> > is_ht can be bool instead of u8, and there's
> > no need to use IWL_CHANNEL_WIDTH_* constants
> > in supported_chan_width when that could just
> > be named is_40mhz instead.
>
> What about is_ht40?
Wrong approach. If you want to clean it up further, I would suggest
replacing both "is_ht" and "is_40mhz" by the channel type as passed by
mac80211, or using conf_is_ht40() etc. instead. Didn't feel motivated
enough at this point though and just wanted to get rid of the extra
constants.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* [PATCH v2] genetlink: fix netns vs. netlink table locking
From: Johannes Berg @ 2009-09-12 13:03 UTC (permalink / raw)
To: netdev; +Cc: linux-wireless
In-Reply-To: <1252425578.3806.22.camel@johannes.local>
Since my commits introducing netns awareness into
genetlink we can get this problem:
BUG: scheduling while atomic: modprobe/1178/0x00000002
2 locks held by modprobe/1178:
#0: (genl_mutex){+.+.+.}, at: [<ffffffff8135ee1a>] genl_register_mc_grou
#1: (rcu_read_lock){.+.+..}, at: [<ffffffff8135eeb5>] genl_register_mc_g
Pid: 1178, comm: modprobe Not tainted 2.6.31-rc8-wl-34789-g95cb731-dirty #
Call Trace:
[<ffffffff8103e285>] __schedule_bug+0x85/0x90
[<ffffffff81403138>] schedule+0x108/0x588
[<ffffffff8135b131>] netlink_table_grab+0xa1/0xf0
[<ffffffff8135c3a7>] netlink_change_ngroups+0x47/0x100
[<ffffffff8135ef0f>] genl_register_mc_group+0x12f/0x290
because I overlooked that netlink_table_grab() will
schedule, thinking it was just the rwlock. However,
in the contention case, that isn't actually true.
Fix this by letting the code grab the netlink table
lock first and then the RCU for netns protection.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
v2: rebase over removal of netlink_change_ngroups EXPORT_SYMBOL
include/linux/netlink.h | 4 +++
net/netlink/af_netlink.c | 51 ++++++++++++++++++++++++++---------------------
net/netlink/genetlink.c | 5 +++-
3 files changed, 37 insertions(+), 23 deletions(-)
--- wireless-testing.orig/include/linux/netlink.h 2009-09-12 06:58:44.000000000 -0600
+++ wireless-testing/include/linux/netlink.h 2009-09-12 06:58:53.000000000 -0600
@@ -176,12 +176,16 @@ struct netlink_skb_parms
#define NETLINK_CREDS(skb) (&NETLINK_CB((skb)).creds)
+extern void netlink_table_grab(void);
+extern void netlink_table_ungrab(void);
+
extern struct sock *netlink_kernel_create(struct net *net,
int unit,unsigned int groups,
void (*input)(struct sk_buff *skb),
struct mutex *cb_mutex,
struct module *module);
extern void netlink_kernel_release(struct sock *sk);
+extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups);
extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);
extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group);
extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
--- wireless-testing.orig/net/netlink/af_netlink.c 2009-09-12 06:58:46.000000000 -0600
+++ wireless-testing/net/netlink/af_netlink.c 2009-09-12 06:58:53.000000000 -0600
@@ -177,9 +177,11 @@ static void netlink_sock_destruct(struct
* this, _but_ remember, it adds useless work on UP machines.
*/
-static void netlink_table_grab(void)
+void netlink_table_grab(void)
__acquires(nl_table_lock)
{
+ might_sleep();
+
write_lock_irq(&nl_table_lock);
if (atomic_read(&nl_table_users)) {
@@ -200,7 +202,7 @@ static void netlink_table_grab(void)
}
}
-static void netlink_table_ungrab(void)
+void netlink_table_ungrab(void)
__releases(nl_table_lock)
{
write_unlock_irq(&nl_table_lock);
@@ -1549,37 +1551,21 @@ static void netlink_free_old_listeners(s
kfree(lrh->ptr);
}
-/**
- * netlink_change_ngroups - change number of multicast groups
- *
- * This changes the number of multicast groups that are available
- * on a certain netlink family. Note that it is not possible to
- * change the number of groups to below 32. Also note that it does
- * not implicitly call netlink_clear_multicast_users() when the
- * number of groups is reduced.
- *
- * @sk: The kernel netlink socket, as returned by netlink_kernel_create().
- * @groups: The new number of groups.
- */
-int netlink_change_ngroups(struct sock *sk, unsigned int groups)
+int __netlink_change_ngroups(struct sock *sk, unsigned int groups)
{
unsigned long *listeners, *old = NULL;
struct listeners_rcu_head *old_rcu_head;
struct netlink_table *tbl = &nl_table[sk->sk_protocol];
- int err = 0;
if (groups < 32)
groups = 32;
- netlink_table_grab();
if (NLGRPSZ(tbl->groups) < NLGRPSZ(groups)) {
listeners = kzalloc(NLGRPSZ(groups) +
sizeof(struct listeners_rcu_head),
GFP_ATOMIC);
- if (!listeners) {
- err = -ENOMEM;
- goto out_ungrab;
- }
+ if (!listeners)
+ return -ENOMEM;
old = tbl->listeners;
memcpy(listeners, old, NLGRPSZ(tbl->groups));
rcu_assign_pointer(tbl->listeners, listeners);
@@ -1597,8 +1583,29 @@ int netlink_change_ngroups(struct sock *
}
tbl->groups = groups;
- out_ungrab:
+ return 0;
+}
+
+/**
+ * netlink_change_ngroups - change number of multicast groups
+ *
+ * This changes the number of multicast groups that are available
+ * on a certain netlink family. Note that it is not possible to
+ * change the number of groups to below 32. Also note that it does
+ * not implicitly call netlink_clear_multicast_users() when the
+ * number of groups is reduced.
+ *
+ * @sk: The kernel netlink socket, as returned by netlink_kernel_create().
+ * @groups: The new number of groups.
+ */
+int netlink_change_ngroups(struct sock *sk, unsigned int groups)
+{
+ int err;
+
+ netlink_table_grab();
+ err = __netlink_change_ngroups(sk, groups);
netlink_table_ungrab();
+
return err;
}
--- wireless-testing.orig/net/netlink/genetlink.c 2009-09-12 06:58:46.000000000 -0600
+++ wireless-testing/net/netlink/genetlink.c 2009-09-12 06:58:53.000000000 -0600
@@ -176,9 +176,10 @@ int genl_register_mc_group(struct genl_f
if (family->netnsok) {
struct net *net;
+ netlink_table_grab();
rcu_read_lock();
for_each_net_rcu(net) {
- err = netlink_change_ngroups(net->genl_sock,
+ err = __netlink_change_ngroups(net->genl_sock,
mc_groups_longs * BITS_PER_LONG);
if (err) {
/*
@@ -188,10 +189,12 @@ int genl_register_mc_group(struct genl_f
* increased on some sockets which is ok.
*/
rcu_read_unlock();
+ netlink_table_ungrab();
goto out;
}
}
rcu_read_unlock();
+ netlink_table_ungrab();
} else {
err = netlink_change_ngroups(init_net.genl_sock,
mc_groups_longs * BITS_PER_LONG);
^ permalink raw reply
* Re: [PATCH 3/4] ath5k: define ath_common ops
From: Jiri Slaby @ 2009-09-12 11:53 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: Nick Kossifidis, devel, ath9k-devel, linux-wireless, Alan Cox,
Linus Torvalds, Jeff Garzik
In-Reply-To: <43e72e890909110023k62a512bejd712a3449cc8328d@mail.gmail.com>
On 09/11/2009 09:23 AM, Luis R. Rodriguez wrote:
> On Thu, Sep 10, 2009 at 11:46 PM, Jiri Slaby <jirislaby@gmail.com> wrote:
>> I definitely agree with Nick here. Althought whole ath_ops will be hot
>> cache after the first operation, there is no need to prolong hot paths
>> by computing the op address and a call. Ok, read/write on PCI is pretty
>> slow, but still...
>
> That is the way I had it originally before submission, and I
> completely agree its reasonable to not incur additional cost at the
> expense of having two separate read/write paths, and perhaps we should
> only incur the extra cost on routines shared between
> ath9k/ath9k/ath9k_htc. But -- is there really is a measurable cost
> penalty?
Hardly there is a measurable one. As I wrote earlier one will wait ages
for PCI in comparison to few load+call cycles.
> This is why I asked if someone can test and give measurable
> differences over this. If there really isn't then that's not strong
> point against it.
Well, honestly I see no strong point for it. It rather looks like an
obfuscation, not improvement.
> For example, long ago I had argued over the cost incurred over the
> unnecessary branching on ioread()/iowrite() when you know you have
> MMIO devices [1] -- the defense then, and IMHO reasonable now, was
> that the benefits of allowing cleaner drivers through the new
> interfaces outweigh the theoretical penalties imposed by them.
Ok, that one has benefits. You just needn't care about what is behind
that mapping. It will choose a PIO or MMIO op on its own.
When it's always MMIO I personally prefer simple ioremap though. (I
didn't at the time of merging the driver.)
> Granted you can argue these new interfaces between
> ath5k/ath9k/ath9k_htc would make things a little more complex, but I
> would expect sharing the code will help in the end. And if these
> interfaces are not acceptable I'm completely open to better suggested
> alternatives.
Ok, I think nothing more than this is needed:
+static u32 ath5k_ioread32(void *hw_priv, u32 reg_offset)
+{
+ return ath5k_hw_reg_read(hw_priv, reg_offset)
+}
+
+static void ath5k_iowrite32(void *hw_priv, u32 reg_offset, u32 val)
+{
+ ath5k_hw_reg_write(hw_priv, val, reg_offset);
+}
+
+static struct ath_ops ath5k_common_ops = {
+ .read = ath5k_ioread32,
+ .write = ath5k_iowrite32,
+};
What I wonder is why ath_ops has reg+val parameters in the opposite
manner than the rest of kernel? It is error-prone.
^ permalink raw reply
* [PATCH] compat-2.6: Make it possible to build without running depmod
From: Natanael Copa @ 2009-09-12 10:31 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: linux-wireless, Natanael Copa
When building binary packages you normally don't want to run depmod
for the running kernel. This patch allows packagers override depmod.
make DEPMOD=: ...
The patch also address the issue in the scripts called from Makefile
and it should be compatible with current behaviour.
---
Makefile | 3 ++-
scripts/check_depmod | 2 +-
scripts/modlib.sh | 5 +++--
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index ab97de0..7c796ec 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,7 @@ endif
export KLIB_BUILD ?= $(KLIB)/build
# Sometimes not available in the path
MODPROBE := /sbin/modprobe
+DEPMOD := /sbin/depmod
MADWIFI=$(shell $(MODPROBE) -l ath_pci)
OLD_IWL=$(shell $(MODPROBE) -l iwl4965)
@@ -182,7 +183,7 @@ uninstall:
@rm -f $(KLIB)/$(KMODDIR)/drivers/misc/eeprom/eeprom_93cx6.ko*
@rm -f $(KLIB)/$(KMODDIR)/drivers/misc/eeprom_93cx6.ko*
@rm -f $(KLIB)/$(KMODDIR)/drivers/net/b44.ko*
- @/sbin/depmod -ae
+ @$(DEPMOD) -ae
@echo
@echo "Your old wireless subsystem modules were left intact:"
@echo
diff --git a/scripts/check_depmod b/scripts/check_depmod
index f127a6a..0b81573 100755
--- a/scripts/check_depmod
+++ b/scripts/check_depmod
@@ -12,7 +12,7 @@ DEPMOD_DIR="/etc/depmod.d/"
COMPAT_DEPMOD_FILE=compat-wireless.conf
GREP_REGEX_UPDATES="^[[:space:]]*search.*[[:space:]]updates\([[:space:]]\|$\)"
GREP_REGEX_SEARCH="^[[:space:]]*search[[:space:]].\+$"
-DEPMOD_CMD="depmod"
+DEPMOD_CMD="${DEPMOD:-depmod}"
function add_compat_depmod_conf {
echo "NOTE: Your distribution lacks an $DEPMOD_DIR directory with "
diff --git a/scripts/modlib.sh b/scripts/modlib.sh
index 91e53f1..76d5b01 100755
--- a/scripts/modlib.sh
+++ b/scripts/modlib.sh
@@ -10,6 +10,7 @@ PATH=$PATH:/usr/sbin:/sbin
# Appended to module file at the end when we want to ignore one
IGNORE_SUFFIX=".ignore"
VER=`uname -r`
+DEPMOD_CMD=${DEPMOD:-depmod}
# If 'module' is found, its renamed to 'module.ignore'
function module_disable {
@@ -39,7 +40,7 @@ function module_disable {
echo -en "Disabling $MODULE ..."
fi
mv -f $i ${i}${IGNORE_SUFFIX}
- depmod -ae
+ ${DEPMOD_CMD} -ae
CHECK_AGAIN=`modprobe -l $MODULE`
if [ "$CHECK" != "$CHECK_AGAIN" ]; then
echo -e "\t[OK]\tModule disabled:"
@@ -65,7 +66,7 @@ function module_enable {
echo -en "Enabling $MODULE ..."
DIR=`dirname $i`
mv $i $DIR/$MODULE_KO
- depmod -ae
+ ${DEPMOD_CMD} -ae
CHECK=`modprobe -l $MODULE`
if [ "$DIR/$MODULE_KO" != $CHECK ]; then
if [ -z $CHECK ]; then
--
1.6.4.2
^ permalink raw reply related
* [PATCH] b43: Disable PMQ mechanism
From: Michael Buesch @ 2009-09-11 22:52 UTC (permalink / raw)
To: John W. Linville; +Cc: Broadcom Wireless, linux-wireless
This reduces IRQ pressure by about one third on a saturated link
by disabling the PMQ mechanism. We currently don't use that mechanism.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
---
If we implement PMQ in the future, we need to re-enable it, but only
for AP mode. See the comment in the sourcecode.
Index: wireless-testing/drivers/net/wireless/b43/main.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/main.c 2009-09-12 00:31:44.000000000 +0200
+++ wireless-testing/drivers/net/wireless/b43/main.c 2009-09-12 00:41:27.000000000 +0200
@@ -2675,6 +2675,20 @@ static void b43_adjust_opmode(struct b43
cfp_pretbtt = 50;
}
b43_write16(dev, 0x612, cfp_pretbtt);
+
+ /* FIXME: We don't currently implement the PMQ mechanism,
+ * so always disable it. If we want to implement PMQ,
+ * we need to enable it here (clear DISCPMQ) in AP mode.
+ */
+ if (0 /* ctl & B43_MACCTL_AP */) {
+ b43_write32(dev, B43_MMIO_MACCTL,
+ b43_read32(dev, B43_MMIO_MACCTL)
+ & ~B43_MACCTL_DISCPMQ);
+ } else {
+ b43_write32(dev, B43_MMIO_MACCTL,
+ b43_read32(dev, B43_MMIO_MACCTL)
+ | B43_MACCTL_DISCPMQ);
+ }
}
static void b43_rate_memory_write(struct b43_wldev *dev, u16 rate, int is_ofdm)
--
Greetings, Michael.
^ permalink raw reply
* [PATCH] b43: Add optional verbose runtime statistics
From: Michael Buesch @ 2009-09-11 22:48 UTC (permalink / raw)
To: John W. Linville; +Cc: Broadcom Wireless, linux-wireless
This adds support for verbose runtime statistics.
It defaults to off and must be enabled in debugfs, if desired.
The first measurement may be incorrect, because statistics are not cleared
after they got enabled through debugfs.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
---
Index: wireless-testing/drivers/net/wireless/b43/b43.h
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/b43.h 2009-09-12 00:31:32.000000000 +0200
+++ wireless-testing/drivers/net/wireless/b43/b43.h 2009-09-12 00:31:44.000000000 +0200
@@ -817,6 +817,10 @@ struct b43_wldev {
/* Debugging stuff follows. */
#ifdef CONFIG_B43_DEBUG
struct b43_dfsentry *dfsentry;
+ unsigned int irq_count;
+ unsigned int irq_bit_count[32];
+ unsigned int tx_count;
+ unsigned int rx_count;
#endif
};
Index: wireless-testing/drivers/net/wireless/b43/debugfs.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/debugfs.c 2009-09-12 00:31:31.000000000 +0200
+++ wireless-testing/drivers/net/wireless/b43/debugfs.c 2009-09-12 00:31:44.000000000 +0200
@@ -689,6 +689,7 @@ static void b43_add_dynamic_debug(struct
add_dyn_dbg("debug_lo", B43_DBG_LO, 0);
add_dyn_dbg("debug_firmware", B43_DBG_FIRMWARE, 0);
add_dyn_dbg("debug_keys", B43_DBG_KEYS, 0);
+ add_dyn_dbg("debug_verbose_stats", B43_DBG_VERBOSESTATS, 0);
#undef add_dyn_dbg
}
Index: wireless-testing/drivers/net/wireless/b43/debugfs.h
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/debugfs.h 2009-09-12 00:31:31.000000000 +0200
+++ wireless-testing/drivers/net/wireless/b43/debugfs.h 2009-09-12 00:31:44.000000000 +0200
@@ -13,6 +13,7 @@ enum b43_dyndbg { /* Dynamic debugging
B43_DBG_LO,
B43_DBG_FIRMWARE,
B43_DBG_KEYS,
+ B43_DBG_VERBOSESTATS,
__B43_NR_DYNDBG,
};
Index: wireless-testing/drivers/net/wireless/b43/main.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/main.c 2009-09-12 00:31:32.000000000 +0200
+++ wireless-testing/drivers/net/wireless/b43/main.c 2009-09-12 00:31:44.000000000 +0200
@@ -1830,6 +1830,16 @@ static void b43_do_interrupt_thread(stru
/* Re-enable interrupts on the device by restoring the current interrupt mask. */
b43_write32(dev, B43_MMIO_GEN_IRQ_MASK, dev->irq_mask);
+
+#if B43_DEBUG
+ if (b43_debug(dev, B43_DBG_VERBOSESTATS)) {
+ dev->irq_count++;
+ for (i = 0; i < ARRAY_SIZE(dev->irq_bit_count); i++) {
+ if (reason & (1 << i))
+ dev->irq_bit_count[i]++;
+ }
+ }
+#endif
}
/* Interrupt thread handler. Handles device interrupts in thread context. */
@@ -2893,6 +2903,27 @@ static void b43_periodic_every15sec(stru
atomic_set(&phy->txerr_cnt, B43_PHY_TX_BADNESS_LIMIT);
wmb();
+
+#if B43_DEBUG
+ if (b43_debug(dev, B43_DBG_VERBOSESTATS)) {
+ unsigned int i;
+
+ b43dbg(dev->wl, "Stats: %7u IRQs/sec, %7u TX/sec, %7u RX/sec\n",
+ dev->irq_count / 15,
+ dev->tx_count / 15,
+ dev->rx_count / 15);
+ dev->irq_count = 0;
+ dev->tx_count = 0;
+ dev->rx_count = 0;
+ for (i = 0; i < ARRAY_SIZE(dev->irq_bit_count); i++) {
+ if (dev->irq_bit_count[i]) {
+ b43dbg(dev->wl, "Stats: %7u IRQ-%02u/sec (0x%08X)\n",
+ dev->irq_bit_count[i] / 15, i, (1 << i));
+ dev->irq_bit_count[i] = 0;
+ }
+ }
+ }
+#endif
}
static void do_periodic_work(struct b43_wldev *dev)
@@ -3092,6 +3123,9 @@ static void b43_tx_work(struct work_stru
dev_kfree_skb(skb); /* Drop it */
}
+#if B43_DEBUG
+ dev->tx_count++;
+#endif
mutex_unlock(&wl->mutex);
}
Index: wireless-testing/drivers/net/wireless/b43/xmit.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/xmit.c 2009-09-12 00:31:31.000000000 +0200
+++ wireless-testing/drivers/net/wireless/b43/xmit.c 2009-09-12 00:31:44.000000000 +0200
@@ -692,6 +692,9 @@ void b43_rx(struct b43_wldev *dev, struc
memcpy(IEEE80211_SKB_RXCB(skb), &status, sizeof(status));
ieee80211_rx(dev->wl->hw, skb);
+#if B43_DEBUG
+ dev->rx_count++;
+#endif
return;
drop:
b43dbg(dev->wl, "RX: Packet dropped\n");
--
Greetings, Michael.
^ permalink raw reply
* Re: [PATCH 07/13] iwlwifi: clean up ht config a little
From: reinette chatre @ 2009-09-11 21:12 UTC (permalink / raw)
To: Gábor Stefanik
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org,
ipw3945-devel@lists.sourceforge.net, Johannes Berg
In-Reply-To: <69e28c910909111046m23414728nb9b56c53960340ea@mail.gmail.com>
Hi Gábor,
On Fri, 2009-09-11 at 10:46 -0700, Gábor Stefanik wrote:
> On Fri, Sep 11, 2009 at 7:38 PM, Reinette Chatre
> <reinette.chatre@intel.com> wrote:
> > From: Johannes Berg <johannes@sipsolutions.net>
> >
> > is_ht can be bool instead of u8, and there's
> > no need to use IWL_CHANNEL_WIDTH_* constants
> > in supported_chan_width when that could just
> > be named is_40mhz instead.
>
> What about is_ht40?
It seems that this structure distinguishes explicitly between being ht
(with "is_ht") and the supported channel width (now with "is_40mhz"). To
me it seems a bit awkward to have "is_ht" and "is_ht40". As you can tell
Johannes has been cleaning this up, so maybe he noticed a way in which
this can be clarified.
Reinette
^ permalink raw reply
* [PATCH] b43: Fix IRQ sync for SDIO
From: Michael Buesch @ 2009-09-11 21:04 UTC (permalink / raw)
To: John W. Linville; +Cc: Broadcom Wireless, linux-wireless, Albert Herranz
synchronize_irq is meaningless for SDIO. sdio_release_irq will
sync the IRQ thread for us.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
---
Index: wireless-testing/drivers/net/wireless/b43/main.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/main.c 2009-09-11 22:50:17.000000000 +0200
+++ wireless-testing/drivers/net/wireless/b43/main.c 2009-09-11 22:52:25.000000000 +0200
@@ -3854,10 +3854,15 @@ redo:
b43_read32(dev, B43_MMIO_GEN_IRQ_MASK); /* Flush */
spin_unlock_irq(&wl->hardirq_lock);
}
- /* Synchronize the interrupt handlers. Unlock to avoid deadlocks. */
+ /* Synchronize and free the interrupt handlers. Unlock to avoid deadlocks. */
orig_dev = dev;
mutex_unlock(&wl->mutex);
- synchronize_irq(dev->dev->irq);
+ if (dev->dev->bus->bustype == SSB_BUSTYPE_SDIO) {
+ b43_sdio_free_irq(dev);
+ } else {
+ synchronize_irq(dev->dev->irq);
+ free_irq(dev->dev->irq, dev);
+ }
mutex_lock(&wl->mutex);
dev = wl->current_dev;
if (!dev)
@@ -3874,10 +3879,6 @@ redo:
dev_kfree_skb(skb_dequeue(&wl->tx_queue));
b43_mac_suspend(dev);
- if (dev->dev->bus->bustype == SSB_BUSTYPE_SDIO)
- b43_sdio_free_irq(dev);
- else
- free_irq(dev->dev->irq, dev);
b43_leds_exit(dev);
b43dbg(wl, "Wireless interface stopped\n");
--
Greetings, Michael.
^ permalink raw reply
* [PATCH] b43: Rewrite suspend/resume code
From: Michael Buesch @ 2009-09-11 19:44 UTC (permalink / raw)
To: John W. Linville; +Cc: Broadcom Wireless, linux-wireless
This removes most of the b43 suspend/resume code (it's handled by mac80211)
and moves the registration of devices to the attachment phase. This is
required, because we must not register/unregister devices on suspend/resume.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
---
Nobody replied to my RFT request, so I guess it's OK.
John, this patch needs to be applied in front of some other patches
that I already sent. See this series file, if you have problems applying
the patches: http://bu3sch.de/patches/wireless-testing/20090911-2143/patches/series
Index: wireless-testing/drivers/net/wireless/b43/main.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/main.c 2009-09-11 21:29:20.000000000 +0200
+++ wireless-testing/drivers/net/wireless/b43/main.c 2009-09-11 21:29:22.000000000 +0200
@@ -3006,14 +3006,18 @@ static void b43_security_init(struct b43
static int b43_rng_read(struct hwrng *rng, u32 *data)
{
struct b43_wl *wl = (struct b43_wl *)rng->priv;
+ struct b43_wldev *dev;
+ int count = -ENODEV;
- /* FIXME: We need to take wl->mutex here to make sure the device
- * is not going away from under our ass. However it could deadlock
- * with hwrng internal locking. */
-
- *data = b43_read16(wl->current_dev, B43_MMIO_RNG);
+ mutex_lock(&wl->mutex);
+ dev = wl->current_dev;
+ if (likely(dev && b43_status(dev) >= B43_STAT_INITIALIZED)) {
+ *data = b43_read16(dev, B43_MMIO_RNG);
+ count = sizeof(u16);
+ }
+ mutex_unlock(&wl->mutex);
- return (sizeof(u16));
+ return count;
}
#endif /* CONFIG_B43_HWRNG */
@@ -3855,6 +3859,7 @@ redo:
b43_mac_suspend(dev);
free_irq(dev->dev->irq, dev);
+ b43_leds_exit(dev);
b43dbg(wl, "Wireless interface stopped\n");
return dev;
@@ -3886,8 +3891,10 @@ static int b43_wireless_core_start(struc
/* Start maintainance work */
b43_periodic_tasks_setup(dev);
+ b43_leds_init(dev);
+
b43dbg(dev->wl, "Wireless interface started\n");
- out:
+out:
return err;
}
@@ -4164,10 +4171,6 @@ static void b43_wireless_core_exit(struc
macctl |= B43_MACCTL_PSM_JMP0;
b43_write32(dev, B43_MMIO_MACCTL, macctl);
- if (!dev->suspend_in_progress) {
- b43_leds_exit(dev);
- b43_rng_exit(dev->wl);
- }
b43_dma_free(dev);
b43_pio_free(dev);
b43_chip_exit(dev);
@@ -4184,7 +4187,6 @@ static void b43_wireless_core_exit(struc
/* Initialize a wireless core */
static int b43_wireless_core_init(struct b43_wldev *dev)
{
- struct b43_wl *wl = dev->wl;
struct ssb_bus *bus = dev->dev->bus;
struct ssb_sprom *sprom = &bus->sprom;
struct b43_phy *phy = &dev->phy;
@@ -4284,13 +4286,9 @@ static int b43_wireless_core_init(struct
ssb_bus_powerup(bus, !(sprom->boardflags_lo & B43_BFL_XTAL_NOSLOW));
b43_upload_card_macaddress(dev);
b43_security_init(dev);
- if (!dev->suspend_in_progress)
- b43_rng_init(wl);
b43_set_status(dev, B43_STAT_INITIALIZED);
- if (!dev->suspend_in_progress)
- b43_leds_init(dev);
out:
return err;
@@ -4839,7 +4837,6 @@ static int b43_wireless_init(struct ssb_
/* Initialize struct b43_wl */
wl->hw = hw;
- spin_lock_init(&wl->leds_lock);
mutex_init(&wl->mutex);
spin_lock_init(&wl->hardirq_lock);
INIT_LIST_HEAD(&wl->devlist);
@@ -4880,6 +4877,8 @@ static int b43_probe(struct ssb_device *
err = ieee80211_register_hw(wl->hw);
if (err)
goto err_one_core_detach;
+ b43_leds_register(wl->current_dev);
+ b43_rng_init(wl);
}
out:
@@ -4908,12 +4907,16 @@ static void b43_remove(struct ssb_device
* might have modified it. Restoring is important, so the networking
* stack can properly free resources. */
wl->hw->queues = wl->mac80211_initially_registered_queues;
+ wl->current_dev = NULL;
+ cancel_work_sync(&wl->leds.work);
ieee80211_unregister_hw(wl->hw);
}
b43_one_core_detach(dev);
if (list_empty(&wl->devlist)) {
+ b43_rng_exit(wl);
+ b43_leds_unregister(wldev);
/* Last core on the chip unregistered.
* We can destroy common struct b43_wl.
*/
@@ -4931,74 +4934,11 @@ void b43_controller_restart(struct b43_w
ieee80211_queue_work(dev->wl->hw, &dev->restart_work);
}
-#ifdef CONFIG_PM
-
-static int b43_suspend(struct ssb_device *dev, pm_message_t state)
-{
- struct b43_wldev *wldev = ssb_get_drvdata(dev);
- struct b43_wl *wl = wldev->wl;
-
- b43dbg(wl, "Suspending...\n");
-
- mutex_lock(&wl->mutex);
- wldev->suspend_in_progress = true;
- wldev->suspend_init_status = b43_status(wldev);
- if (wldev->suspend_init_status >= B43_STAT_STARTED)
- wldev = b43_wireless_core_stop(wldev);
- if (wldev && wldev->suspend_init_status >= B43_STAT_INITIALIZED)
- b43_wireless_core_exit(wldev);
- mutex_unlock(&wl->mutex);
-
- b43dbg(wl, "Device suspended.\n");
-
- return 0;
-}
-
-static int b43_resume(struct ssb_device *dev)
-{
- struct b43_wldev *wldev = ssb_get_drvdata(dev);
- struct b43_wl *wl = wldev->wl;
- int err = 0;
-
- b43dbg(wl, "Resuming...\n");
-
- mutex_lock(&wl->mutex);
- if (wldev->suspend_init_status >= B43_STAT_INITIALIZED) {
- err = b43_wireless_core_init(wldev);
- if (err) {
- b43err(wl, "Resume failed at core init\n");
- goto out;
- }
- }
- if (wldev->suspend_init_status >= B43_STAT_STARTED) {
- err = b43_wireless_core_start(wldev);
- if (err) {
- b43_leds_exit(wldev);
- b43_rng_exit(wldev->wl);
- b43_wireless_core_exit(wldev);
- b43err(wl, "Resume failed at core start\n");
- goto out;
- }
- }
- b43dbg(wl, "Device resumed.\n");
- out:
- wldev->suspend_in_progress = false;
- mutex_unlock(&wl->mutex);
- return err;
-}
-
-#else /* CONFIG_PM */
-# define b43_suspend NULL
-# define b43_resume NULL
-#endif /* CONFIG_PM */
-
static struct ssb_driver b43_ssb_driver = {
.name = KBUILD_MODNAME,
.id_table = b43_ssb_tbl,
.probe = b43_probe,
.remove = b43_remove,
- .suspend = b43_suspend,
- .resume = b43_resume,
};
static void b43_print_driverinfo(void)
Index: wireless-testing/drivers/net/wireless/b43/b43.h
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/b43.h 2009-09-11 21:29:20.000000000 +0200
+++ wireless-testing/drivers/net/wireless/b43/b43.h 2009-09-11 21:29:22.000000000 +0200
@@ -629,13 +629,6 @@ struct b43_wl {
* from the mac80211 subsystem. */
u16 mac80211_initially_registered_queues;
- /* R/W lock for data transmission.
- * Transmissions on 2+ queues can run concurrently, but somebody else
- * might sync with TX by write_lock_irqsave()'ing. */
- rwlock_t tx_lock;
- /* Lock for LEDs access. */
- spinlock_t leds_lock;
-
/* We can only have one operating interface (802.11 core)
* at a time. General information about this interface follows.
*/
@@ -686,6 +679,9 @@ struct b43_wl {
struct work_struct tx_work;
/* Queue of packets to be transmitted. */
struct sk_buff_head tx_queue;
+
+ /* The device LEDs. */
+ struct b43_leds leds;
};
/* The type of the firmware file. */
@@ -768,13 +764,10 @@ struct b43_wldev {
/* The device initialization status.
* Use b43_status() to query. */
atomic_t __init_status;
- /* Saved init status for handling suspend. */
- int suspend_init_status;
bool bad_frames_preempt; /* Use "Bad Frames Preemption" (default off) */
bool dfq_valid; /* Directed frame queue valid (IBSS PS mode, ATIM) */
bool radio_hw_enable; /* saved state of radio hardware enabled state */
- bool suspend_in_progress; /* TRUE, if we are in a suspend/resume cycle */
bool qos_enabled; /* TRUE, if QoS is used. */
bool hwcrypto_enabled; /* TRUE, if HW crypto acceleration is enabled. */
@@ -794,12 +787,6 @@ struct b43_wldev {
/* Various statistics about the physical device. */
struct b43_stats stats;
- /* The device LEDs. */
- struct b43_led led_tx;
- struct b43_led led_rx;
- struct b43_led led_assoc;
- struct b43_led led_radio;
-
/* Reason code of the last interrupt. */
u32 irq_reason;
u32 dma_reason[6];
Index: wireless-testing/drivers/net/wireless/b43/leds.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/leds.c 2009-09-11 21:29:20.000000000 +0200
+++ wireless-testing/drivers/net/wireless/b43/leds.c 2009-09-11 21:29:22.000000000 +0200
@@ -34,57 +34,91 @@
static void b43_led_turn_on(struct b43_wldev *dev, u8 led_index,
bool activelow)
{
- struct b43_wl *wl = dev->wl;
- unsigned long flags;
u16 ctl;
- spin_lock_irqsave(&wl->leds_lock, flags);
ctl = b43_read16(dev, B43_MMIO_GPIO_CONTROL);
if (activelow)
ctl &= ~(1 << led_index);
else
ctl |= (1 << led_index);
b43_write16(dev, B43_MMIO_GPIO_CONTROL, ctl);
- spin_unlock_irqrestore(&wl->leds_lock, flags);
}
static void b43_led_turn_off(struct b43_wldev *dev, u8 led_index,
bool activelow)
{
- struct b43_wl *wl = dev->wl;
- unsigned long flags;
u16 ctl;
- spin_lock_irqsave(&wl->leds_lock, flags);
ctl = b43_read16(dev, B43_MMIO_GPIO_CONTROL);
if (activelow)
ctl |= (1 << led_index);
else
ctl &= ~(1 << led_index);
b43_write16(dev, B43_MMIO_GPIO_CONTROL, ctl);
- spin_unlock_irqrestore(&wl->leds_lock, flags);
}
-/* Callback from the LED subsystem. */
-static void b43_led_brightness_set(struct led_classdev *led_dev,
- enum led_brightness brightness)
+static void b43_led_update(struct b43_wldev *dev,
+ struct b43_led *led)
{
- struct b43_led *led = container_of(led_dev, struct b43_led, led_dev);
- struct b43_wldev *dev = led->dev;
bool radio_enabled;
+ bool turn_on;
- if (unlikely(b43_status(dev) < B43_STAT_INITIALIZED))
+ if (!led->wl)
return;
- /* Checking the radio-enabled status here is slightly racy,
- * but we want to avoid the locking overhead and we don't care
- * whether the LED has the wrong state for a second. */
radio_enabled = (dev->phy.radio_on && dev->radio_hw_enable);
- if (brightness == LED_OFF || !radio_enabled)
- b43_led_turn_off(dev, led->index, led->activelow);
+ /* The led->state read is racy, but we don't care. In case we raced
+ * with the brightness_set handler, we will be called again soon
+ * to fixup our state. */
+ if (radio_enabled)
+ turn_on = atomic_read(&led->state) != LED_OFF;
else
+ turn_on = 0;
+ if (turn_on == led->hw_state)
+ return;
+ led->hw_state = turn_on;
+
+ if (turn_on)
b43_led_turn_on(dev, led->index, led->activelow);
+ else
+ b43_led_turn_off(dev, led->index, led->activelow);
+}
+
+static void b43_leds_work(struct work_struct *work)
+{
+ struct b43_leds *leds = container_of(work, struct b43_leds, work);
+ struct b43_wl *wl = container_of(leds, struct b43_wl, leds);
+ struct b43_wldev *dev;
+
+ mutex_lock(&wl->mutex);
+ dev = wl->current_dev;
+ if (unlikely(!dev || b43_status(dev) < B43_STAT_STARTED))
+ goto out_unlock;
+
+ b43_led_update(dev, &wl->leds.led_tx);
+ b43_led_update(dev, &wl->leds.led_rx);
+ b43_led_update(dev, &wl->leds.led_radio);
+ b43_led_update(dev, &wl->leds.led_assoc);
+
+out_unlock:
+ mutex_unlock(&wl->mutex);
+}
+
+/* Callback from the LED subsystem. */
+static void b43_led_brightness_set(struct led_classdev *led_dev,
+ enum led_brightness brightness)
+{
+ struct b43_led *led = container_of(led_dev, struct b43_led, led_dev);
+ struct b43_wl *wl = led->wl;
+
+ /* The check for current_dev is only needed while unregistering,
+ * so it is sequencial and does not race. But we must not dereference
+ * current_dev here. */
+ if (likely(wl->current_dev)) {
+ atomic_set(&led->state, brightness);
+ ieee80211_queue_work(wl->hw, &wl->leds.work);
+ }
}
static int b43_register_led(struct b43_wldev *dev, struct b43_led *led,
@@ -93,15 +127,15 @@ static int b43_register_led(struct b43_w
{
int err;
- b43_led_turn_off(dev, led_index, activelow);
- if (led->dev)
+ if (led->wl)
return -EEXIST;
if (!default_trigger)
return -EINVAL;
- led->dev = dev;
+ led->wl = dev->wl;
led->index = led_index;
led->activelow = activelow;
strncpy(led->name, name, sizeof(led->name));
+ atomic_set(&led->state, 0);
led->led_dev.name = led->name;
led->led_dev.default_trigger = default_trigger;
@@ -110,19 +144,19 @@ static int b43_register_led(struct b43_w
err = led_classdev_register(dev->dev->dev, &led->led_dev);
if (err) {
b43warn(dev->wl, "LEDs: Failed to register %s\n", name);
- led->dev = NULL;
+ led->wl = NULL;
return err;
}
+
return 0;
}
static void b43_unregister_led(struct b43_led *led)
{
- if (!led->dev)
+ if (!led->wl)
return;
led_classdev_unregister(&led->led_dev);
- b43_led_turn_off(led->dev, led->index, led->activelow);
- led->dev = NULL;
+ led->wl = NULL;
}
static void b43_map_led(struct b43_wldev *dev,
@@ -137,24 +171,20 @@ static void b43_map_led(struct b43_wldev
* generic LED triggers. */
switch (behaviour) {
case B43_LED_INACTIVE:
- break;
case B43_LED_OFF:
- b43_led_turn_off(dev, led_index, activelow);
- break;
case B43_LED_ON:
- b43_led_turn_on(dev, led_index, activelow);
break;
case B43_LED_ACTIVITY:
case B43_LED_TRANSFER:
case B43_LED_APTRANSFER:
snprintf(name, sizeof(name),
"b43-%s::tx", wiphy_name(hw->wiphy));
- b43_register_led(dev, &dev->led_tx, name,
+ b43_register_led(dev, &dev->wl->leds.led_tx, name,
ieee80211_get_tx_led_name(hw),
led_index, activelow);
snprintf(name, sizeof(name),
"b43-%s::rx", wiphy_name(hw->wiphy));
- b43_register_led(dev, &dev->led_rx, name,
+ b43_register_led(dev, &dev->wl->leds.led_rx, name,
ieee80211_get_rx_led_name(hw),
led_index, activelow);
break;
@@ -164,18 +194,15 @@ static void b43_map_led(struct b43_wldev
case B43_LED_MODE_BG:
snprintf(name, sizeof(name),
"b43-%s::radio", wiphy_name(hw->wiphy));
- b43_register_led(dev, &dev->led_radio, name,
+ b43_register_led(dev, &dev->wl->leds.led_radio, name,
ieee80211_get_radio_led_name(hw),
led_index, activelow);
- /* Sync the RF-kill LED state with radio and switch states. */
- if (dev->phy.radio_on && b43_is_hw_radio_enabled(dev))
- b43_led_turn_on(dev, led_index, activelow);
break;
case B43_LED_WEIRD:
case B43_LED_ASSOC:
snprintf(name, sizeof(name),
"b43-%s::assoc", wiphy_name(hw->wiphy));
- b43_register_led(dev, &dev->led_assoc, name,
+ b43_register_led(dev, &dev->wl->leds.led_assoc, name,
ieee80211_get_assoc_led_name(hw),
led_index, activelow);
break;
@@ -186,58 +213,140 @@ static void b43_map_led(struct b43_wldev
}
}
-void b43_leds_init(struct b43_wldev *dev)
+static void b43_led_get_sprominfo(struct b43_wldev *dev,
+ unsigned int led_index,
+ enum b43_led_behaviour *behaviour,
+ bool *activelow)
{
struct ssb_bus *bus = dev->dev->bus;
u8 sprom[4];
- int i;
- enum b43_led_behaviour behaviour;
- bool activelow;
sprom[0] = bus->sprom.gpio0;
sprom[1] = bus->sprom.gpio1;
sprom[2] = bus->sprom.gpio2;
sprom[3] = bus->sprom.gpio3;
- for (i = 0; i < 4; i++) {
- if (sprom[i] == 0xFF) {
- /* There is no LED information in the SPROM
- * for this LED. Hardcode it here. */
- activelow = 0;
- switch (i) {
- case 0:
- behaviour = B43_LED_ACTIVITY;
- activelow = 1;
- if (bus->boardinfo.vendor == PCI_VENDOR_ID_COMPAQ)
- behaviour = B43_LED_RADIO_ALL;
- break;
- case 1:
- behaviour = B43_LED_RADIO_B;
- if (bus->boardinfo.vendor == PCI_VENDOR_ID_ASUSTEK)
- behaviour = B43_LED_ASSOC;
- break;
- case 2:
- behaviour = B43_LED_RADIO_A;
- break;
- case 3:
- behaviour = B43_LED_OFF;
- break;
- default:
- B43_WARN_ON(1);
- return;
- }
+ if (sprom[led_index] == 0xFF) {
+ /* There is no LED information in the SPROM
+ * for this LED. Hardcode it here. */
+ *activelow = 0;
+ switch (led_index) {
+ case 0:
+ *behaviour = B43_LED_ACTIVITY;
+ *activelow = 1;
+ if (bus->boardinfo.vendor == PCI_VENDOR_ID_COMPAQ)
+ *behaviour = B43_LED_RADIO_ALL;
+ break;
+ case 1:
+ *behaviour = B43_LED_RADIO_B;
+ if (bus->boardinfo.vendor == PCI_VENDOR_ID_ASUSTEK)
+ *behaviour = B43_LED_ASSOC;
+ break;
+ case 2:
+ *behaviour = B43_LED_RADIO_A;
+ break;
+ case 3:
+ *behaviour = B43_LED_OFF;
+ break;
+ default:
+ B43_WARN_ON(1);
+ return;
+ }
+ } else {
+ *behaviour = sprom[led_index] & B43_LED_BEHAVIOUR;
+ *activelow = !!(sprom[led_index] & B43_LED_ACTIVELOW);
+ }
+}
+
+void b43_leds_init(struct b43_wldev *dev)
+{
+ struct b43_led *led;
+ unsigned int i;
+ enum b43_led_behaviour behaviour;
+ bool activelow;
+
+ /* Sync the RF-kill LED state (if we have one) with radio and switch states. */
+ led = &dev->wl->leds.led_radio;
+ if (led->wl) {
+ if (dev->phy.radio_on && b43_is_hw_radio_enabled(dev)) {
+ b43_led_turn_on(dev, led->index, led->activelow);
+ led->hw_state = 1;
+ atomic_set(&led->state, 1);
} else {
- behaviour = sprom[i] & B43_LED_BEHAVIOUR;
- activelow = !!(sprom[i] & B43_LED_ACTIVELOW);
+ b43_led_turn_off(dev, led->index, led->activelow);
+ led->hw_state = 0;
+ atomic_set(&led->state, 0);
+ }
+ }
+
+ /* Initialize TX/RX/ASSOC leds */
+ led = &dev->wl->leds.led_tx;
+ if (led->wl) {
+ b43_led_turn_off(dev, led->index, led->activelow);
+ led->hw_state = 0;
+ atomic_set(&led->state, 0);
+ }
+ led = &dev->wl->leds.led_rx;
+ if (led->wl) {
+ b43_led_turn_off(dev, led->index, led->activelow);
+ led->hw_state = 0;
+ atomic_set(&led->state, 0);
+ }
+ led = &dev->wl->leds.led_assoc;
+ if (led->wl) {
+ b43_led_turn_off(dev, led->index, led->activelow);
+ led->hw_state = 0;
+ atomic_set(&led->state, 0);
+ }
+
+ /* Initialize other LED states. */
+ for (i = 0; i < B43_MAX_NR_LEDS; i++) {
+ b43_led_get_sprominfo(dev, i, &behaviour, &activelow);
+ switch (behaviour) {
+ case B43_LED_OFF:
+ b43_led_turn_off(dev, i, activelow);
+ break;
+ case B43_LED_ON:
+ b43_led_turn_on(dev, i, activelow);
+ break;
+ default:
+ /* Leave others as-is. */
+ break;
}
- b43_map_led(dev, i, behaviour, activelow);
}
}
void b43_leds_exit(struct b43_wldev *dev)
{
- b43_unregister_led(&dev->led_tx);
- b43_unregister_led(&dev->led_rx);
- b43_unregister_led(&dev->led_assoc);
- b43_unregister_led(&dev->led_radio);
+ struct b43_leds *leds = &dev->wl->leds;
+
+ b43_led_turn_off(dev, leds->led_tx.index, leds->led_tx.activelow);
+ b43_led_turn_off(dev, leds->led_rx.index, leds->led_rx.activelow);
+ b43_led_turn_off(dev, leds->led_assoc.index, leds->led_assoc.activelow);
+ b43_led_turn_off(dev, leds->led_radio.index, leds->led_radio.activelow);
+}
+
+void b43_leds_register(struct b43_wldev *dev)
+{
+ unsigned int i;
+ enum b43_led_behaviour behaviour;
+ bool activelow;
+
+ INIT_WORK(&dev->wl->leds.work, b43_leds_work);
+
+ /* Register the LEDs to the LED subsystem. */
+ for (i = 0; i < B43_MAX_NR_LEDS; i++) {
+ b43_led_get_sprominfo(dev, i, &behaviour, &activelow);
+ b43_map_led(dev, i, behaviour, activelow);
+ }
+}
+
+void b43_leds_unregister(struct b43_wldev *dev)
+{
+ struct b43_leds *leds = &dev->wl->leds;
+
+ b43_unregister_led(&leds->led_tx);
+ b43_unregister_led(&leds->led_rx);
+ b43_unregister_led(&leds->led_assoc);
+ b43_unregister_led(&leds->led_radio);
}
Index: wireless-testing/drivers/net/wireless/b43/leds.h
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/leds.h 2009-09-11 21:29:20.000000000 +0200
+++ wireless-testing/drivers/net/wireless/b43/leds.h 2009-09-11 21:29:22.000000000 +0200
@@ -7,12 +7,13 @@ struct b43_wldev;
#include <linux/types.h>
#include <linux/leds.h>
+#include <linux/workqueue.h>
#define B43_LED_MAX_NAME_LEN 31
struct b43_led {
- struct b43_wldev *dev;
+ struct b43_wl *wl;
/* The LED class device */
struct led_classdev led_dev;
/* The index number of the LED. */
@@ -22,8 +23,23 @@ struct b43_led {
bool activelow;
/* The unique name string for this LED device. */
char name[B43_LED_MAX_NAME_LEN + 1];
+ /* The current status of the LED. This is updated locklessly. */
+ atomic_t state;
+ /* The active state in hardware. */
+ bool hw_state;
};
+struct b43_leds {
+ struct b43_led led_tx;
+ struct b43_led led_rx;
+ struct b43_led led_radio;
+ struct b43_led led_assoc;
+
+ struct work_struct work;
+};
+
+#define B43_MAX_NR_LEDS 4
+
#define B43_LED_BEHAVIOUR 0x7F
#define B43_LED_ACTIVELOW 0x80
/* LED behaviour values */
@@ -42,6 +58,8 @@ enum b43_led_behaviour {
B43_LED_INACTIVE,
};
+void b43_leds_register(struct b43_wldev *dev);
+void b43_leds_unregister(struct b43_wldev *dev);
void b43_leds_init(struct b43_wldev *dev);
void b43_leds_exit(struct b43_wldev *dev);
@@ -49,10 +67,16 @@ void b43_leds_exit(struct b43_wldev *dev
#else /* CONFIG_B43_LEDS */
/* LED support disabled */
-struct b43_led {
+struct b43_leds {
/* empty */
};
+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_init(struct b43_wldev *dev)
{
}
--
Greetings, Michael.
^ permalink raw reply
* Re: [PATCH 3/4] ath5k: define ath_common ops
From: Linus Torvalds @ 2009-09-11 20:11 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: devel, ath9k-devel, Jeff Garzik, linux-wireless, Nick Kossifidis,
Alan Cox
In-Reply-To: <43e72e890909111043m78411058i86e61909a35412f@mail.gmail.com>
On Fri, 11 Sep 2009, Luis R. Rodriguez wrote:
>
> > In fact, if you know what kind of IO op it is (ie "it's always MMIO"),
> > you'd be even better using "writel()" directly,
>
> Heh.. you realize I tried to document such a thing a while ago and it
> seems you opposed it [1]?
If it's mapped with "pci_iomap()" you should use ioread*/iowrite*.
But if you know it's always MMIO, and you use just ioremap() to map it,
and then readl/writel.
It's the _mixing_ of the two that I object to:
- pci_iomap() - can do either MMIO of PIO
- readl/writel - always just MMIO
should preferably not be mixed.
(Sure it will _work_, but I wouldn't encourage it)
Linus
^ permalink raw reply
* Re: Questions about regulatory domain & passive scanning
From: John W. Linville @ 2009-09-11 19:35 UTC (permalink / raw)
To: Gábor Stefanik
Cc: Luis R. Rodriguez, Holger Schurig, linux-wireless, Kel Modderman
In-Reply-To: <69e28c910909111226s48ac1db9ya8fe2cce54861c1e@mail.gmail.com>
On Fri, Sep 11, 2009 at 09:26:11PM +0200, Gábor Stefanik wrote:
> On Fri, Sep 11, 2009 at 8:36 PM, Luis R. Rodriguez
> <lrodriguez@atheros.com> wrote:
> > On Fri, Sep 11, 2009 at 5:27 AM, Holger Schurig
> > <hs4233@mail.mn-solutions.de> wrote:
> >> Hi !
> >>
> >> I'm playing with regulatory domain using wireless-testing, iw,
> >> crda and ath5 on Debian. Here are some observations:
> >>
> >> 1) Debian sucks here
> >
> > We've tried a few times to poke them and after some thread exchanges
> > and some changes to wirless-regdb and crda due to concerns over the
> > signing stuff due to the DFSG in account for these discussions it
> > seems some stuff was packaged but not sure where it went. Kel, are you
> > aware of the status in this regard on Debian?
>
> Well, if the problem is signing, then they are always free to package
> a patched crda that accepts unsigned or self-signed databases; AFAIK
> GPL doesn't prohibit that (though it kinda defeats the purpose of
> crda).
I disagree about that defeating the purpose -- the purpose is to put
the decision making into userland. The signing is a configuration
issue, allowing distributions to have "trusted" configuration sources
by default.
--
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: Questions about regulatory domain & passive scanning
From: Gábor Stefanik @ 2009-09-11 19:26 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: Holger Schurig, linux-wireless, Kel Modderman
In-Reply-To: <43e72e890909111136r67a305b9qc3e78a7dcb205d@mail.gmail.com>
On Fri, Sep 11, 2009 at 8:36 PM, Luis R. Rodriguez
<lrodriguez@atheros.com> wrote:
> On Fri, Sep 11, 2009 at 5:27 AM, Holger Schurig
> <hs4233@mail.mn-solutions.de> wrote:
>> Hi !
>>
>> I'm playing with regulatory domain using wireless-testing, iw,
>> crda and ath5 on Debian. Here are some observations:
>>
>> 1) Debian sucks here
>
> We've tried a few times to poke them and after some thread exchanges
> and some changes to wirless-regdb and crda due to concerns over the
> signing stuff due to the DFSG in account for these discussions it
> seems some stuff was packaged but not sure where it went. Kel, are you
> aware of the status in this regard on Debian?
Well, if the problem is signing, then they are always free to package
a patched crda that accepts unsigned or self-signed databases; AFAIK
GPL doesn't prohibit that (though it kinda defeats the purpose of
crda).
>
> [1] http://lists.alioth.debian.org/pipermail/pkg-wpa-devel/2009-May/002267.html
>
>> 2) I remove CONFIG_WIRELESS_OLD_REGULATORY. Then, after inserting
>> the card, I see in "iw list":
>>
>> * 2412 MHz [1] (20.0 dBm)
>> * 2417 MHz [2] (20.0 dBm)
>> * 2422 MHz [3] (20.0 dBm)
>> * 2427 MHz [4] (20.0 dBm)
>> * 2432 MHz [5] (20.0 dBm)
>> * 2437 MHz [6] (20.0 dBm)
>> * 2442 MHz [7] (20.0 dBm)
>> * 2447 MHz [8] (20.0 dBm)
>> * 2452 MHz [9] (20.0 dBm)
>> * 2457 MHz [10] (20.0 dBm)
>> * 2462 MHz [11] (20.0 dBm)
>> * 2467 MHz [12] (20.0 dBm) (passive scanning)
>> * 2472 MHz [13] (20.0 dBm) (passive scanning)
>> * 2484 MHz [14] (20.0 dBm) (passive scanning)
>>
>> I'd like to highlight the "passive scanning". Is this info
>> from the card EEPROM?
>
> If you lack crda, by default you will world roam, even if your EEPROM
> has been programmed to a specific regulatory domain and calibrated as
> such -- reason being is we moved regulatory content to userspace; so
> OLD_REG had only 3 statically built regulatory domains in the kernel,
> with CRDA you get all of them on userspace, and no more need to update
> the kernel to update regulatory settings. World roaming has some
> enhancements though like enabling active scanning on passive-scanning
> channels if youo pick up a beacon from an AP on that channel.
>
>> 3) After "iw reg set DE" (for germany), it's now
>>
>> 2412 MHz [1] (20.0 dBm)
>> 2417 MHz [2] (20.0 dBm)
>> 2422 MHz [3] (20.0 dBm)
>> 2427 MHz [4] (20.0 dBm)
>> 2432 MHz [5] (20.0 dBm)
>> 2437 MHz [6] (20.0 dBm)
>> 2442 MHz [7] (20.0 dBm)
>> 2447 MHz [8] (20.0 dBm)
>> 2452 MHz [9] (20.0 dBm)
>> 2457 MHz [10] (20.0 dBm)
>> 2462 MHz [11] (20.0 dBm)
>> 2467 MHz [12] (20.0 dBm) (passive scanning)
>> 2472 MHz [13] (20.0 dBm) (passive scanning)
>> 2484 MHz [14] (disabled)
>>
>> Great, CRDA worked obviously: channel 14 has been disabled.
>
> Sure, but keep in mind your regulatory domain must've been read too
> first, that's probably what lifted your passive scan flag on channel
> 12 unless you did a scan prior to trying to set the regulatory domain.
>
>> And, as I understand it, CRDA can just limit settings
>> further, not widening it. Therefore channels 12 and 13
>> are still marked as "passive scanning".
>
> Right. Now if your card is world roaming (defined in
> net/wireless/reg.c as reg_is_world_roaming() ) you could lift passive
> scan off of 12 and 13 if you had an AP there.
>
>> If I want to get them to "active scanning", would I need to
>> modify the EEPROM of the card?
>
> Well yes, but you must note that is something not supported, not
> recommended, unless you are a manufacturer selling cards and have the
> capability to calibrate, etc, and certify. That is -- EEPROM
> programming is not something designed to be changed by the end user.
>
>> ath_info says "Reg. Domain:
>> 0x60".
>
> Ok, as I have documented on the ath wiki page [1] any Atheros
> regulatory domain which has 0x60 is world roaming. As I also
> documented as well these 12 world regulatory domains are statically
> built into the kernel on ath as they are custom world regulatory
> domains, so even without the presence of CRDA you'll get the
> regulatory domain your card is designed for. With OLD_REG though you
> end up trying to stick to static kenrel US rules so you would only be
> allowed to use what the US allows on your 0x60 regulatory domain, this
> is ath_world_regdom_60_61_62 on drivers/net/wireless/ath/regd.c.
>
> [1] http://wireless.kernel.org/en/users/Drivers/ath
>
> Luis
> --
> 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
* Re: Questions about regulatory domain & passive scanning
From: Luis R. Rodriguez @ 2009-09-11 18:36 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless, Kel Modderman
In-Reply-To: <200909111427.39974.hs4233@mail.mn-solutions.de>
On Fri, Sep 11, 2009 at 5:27 AM, Holger Schurig
<hs4233@mail.mn-solutions.de> wrote:
> Hi !
>
> I'm playing with regulatory domain using wireless-testing, iw,
> crda and ath5 on Debian. Here are some observations:
>
> 1) Debian sucks here
We've tried a few times to poke them and after some thread exchanges
and some changes to wirless-regdb and crda due to concerns over the
signing stuff due to the DFSG in account for these discussions it
seems some stuff was packaged but not sure where it went. Kel, are you
aware of the status in this regard on Debian?
[1] http://lists.alioth.debian.org/pipermail/pkg-wpa-devel/2009-May/002267.html
> 2) I remove CONFIG_WIRELESS_OLD_REGULATORY. Then, after inserting
> the card, I see in "iw list":
>
> * 2412 MHz [1] (20.0 dBm)
> * 2417 MHz [2] (20.0 dBm)
> * 2422 MHz [3] (20.0 dBm)
> * 2427 MHz [4] (20.0 dBm)
> * 2432 MHz [5] (20.0 dBm)
> * 2437 MHz [6] (20.0 dBm)
> * 2442 MHz [7] (20.0 dBm)
> * 2447 MHz [8] (20.0 dBm)
> * 2452 MHz [9] (20.0 dBm)
> * 2457 MHz [10] (20.0 dBm)
> * 2462 MHz [11] (20.0 dBm)
> * 2467 MHz [12] (20.0 dBm) (passive scanning)
> * 2472 MHz [13] (20.0 dBm) (passive scanning)
> * 2484 MHz [14] (20.0 dBm) (passive scanning)
>
> I'd like to highlight the "passive scanning". Is this info
> from the card EEPROM?
If you lack crda, by default you will world roam, even if your EEPROM
has been programmed to a specific regulatory domain and calibrated as
such -- reason being is we moved regulatory content to userspace; so
OLD_REG had only 3 statically built regulatory domains in the kernel,
with CRDA you get all of them on userspace, and no more need to update
the kernel to update regulatory settings. World roaming has some
enhancements though like enabling active scanning on passive-scanning
channels if youo pick up a beacon from an AP on that channel.
> 3) After "iw reg set DE" (for germany), it's now
>
> 2412 MHz [1] (20.0 dBm)
> 2417 MHz [2] (20.0 dBm)
> 2422 MHz [3] (20.0 dBm)
> 2427 MHz [4] (20.0 dBm)
> 2432 MHz [5] (20.0 dBm)
> 2437 MHz [6] (20.0 dBm)
> 2442 MHz [7] (20.0 dBm)
> 2447 MHz [8] (20.0 dBm)
> 2452 MHz [9] (20.0 dBm)
> 2457 MHz [10] (20.0 dBm)
> 2462 MHz [11] (20.0 dBm)
> 2467 MHz [12] (20.0 dBm) (passive scanning)
> 2472 MHz [13] (20.0 dBm) (passive scanning)
> 2484 MHz [14] (disabled)
>
> Great, CRDA worked obviously: channel 14 has been disabled.
Sure, but keep in mind your regulatory domain must've been read too
first, that's probably what lifted your passive scan flag on channel
12 unless you did a scan prior to trying to set the regulatory domain.
> And, as I understand it, CRDA can just limit settings
> further, not widening it. Therefore channels 12 and 13
> are still marked as "passive scanning".
Right. Now if your card is world roaming (defined in
net/wireless/reg.c as reg_is_world_roaming() ) you could lift passive
scan off of 12 and 13 if you had an AP there.
> If I want to get them to "active scanning", would I need to
> modify the EEPROM of the card?
Well yes, but you must note that is something not supported, not
recommended, unless you are a manufacturer selling cards and have the
capability to calibrate, etc, and certify. That is -- EEPROM
programming is not something designed to be changed by the end user.
> ath_info says "Reg. Domain:
> 0x60".
Ok, as I have documented on the ath wiki page [1] any Atheros
regulatory domain which has 0x60 is world roaming. As I also
documented as well these 12 world regulatory domains are statically
built into the kernel on ath as they are custom world regulatory
domains, so even without the presence of CRDA you'll get the
regulatory domain your card is designed for. With OLD_REG though you
end up trying to stick to static kenrel US rules so you would only be
allowed to use what the US allows on your 0x60 regulatory domain, this
is ath_world_regdom_60_61_62 on drivers/net/wireless/ath/regd.c.
[1] http://wireless.kernel.org/en/users/Drivers/ath
Luis
^ permalink raw reply
* Re: [PATCH 3/4] ath5k: define ath_common ops
From: Luis R. Rodriguez @ 2009-09-11 17:53 UTC (permalink / raw)
To: Bob Copeland
Cc: Jiri Slaby, Nick Kossifidis, devel, ath9k-devel, linux-wireless,
Alan Cox, Linus Torvalds, Jeff Garzik
In-Reply-To: <b6c5339f0909110435l2e420685y7715f3512873008e@mail.gmail.com>
On Fri, Sep 11, 2009 at 4:35 AM, Bob Copeland <me@bobcopeland.com> wrote:
> On Fri, Sep 11, 2009 at 3:23 AM, Luis R. Rodriguez
> <lrodriguez@atheros.com> wrote:
>> ath9k/ath9k/ath9k_htc. But -- is there really is a measurable cost
>> penalty?
>>
>> This is why I asked if someone can test and give measurable
>> differences over this. If there really isn't then that's not strong
>> point against it.
>
> Honestly, it probably won't matter in the grand scheme of things, but I
> think if you are proposing a patch that touches every hotpath in two
> drivers, then you need to do the work to say "by the way, this has benefit
> X which outweighs the very small (or absent) performance regression Y,
> and here are the numbers.
You're completely right, sorry about that. I thought the advantages
would have been obvious but let me clarify them them:
So far I've tested this with:
time iw list dev wlan0 scan > /dev/null
Both with and without the patches and the time it takes to scan, when
not associated, remains the same. Granted I do have an Intel Core Duo
1.8 GHz, so if some others could test this on some embedded platforms
that would be appreciated.
The main added advantage to these changes is the possibility to now
share hw access code between ath5k/ath9k. With the patches as-is you
get one hot path on the driver, whether or not you use common hw code
through ath.ko or through the driver's own hw code. It is unclear to
me whether this has any measurable benefits so an alternative is to
only use the common read/write ops on the common ath.ko.
Although I don't see any measurable differences at the moment I
suspect most people are inclined to leave hw access directly on the
driver and only use common hw read/write ops for the common code. I'll
respin these patches to do just that.
Luis
^ permalink raw reply
* [PATCH 13/13 v2.6.32] iwlwifi: disable powersave for 4965
From: reinette chatre @ 2009-09-11 17:50 UTC (permalink / raw)
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
ipw3945-devel@lists.sourceforge.net, Johannes Berg
In-Reply-To: <1252690699-25796-14-git-send-email-reinette.chatre@intel.com>
From: Johannes Berg <johannes@sipsolutions.net>
There's a bug in 4965 powersave that appears to
be related to the way it keeps track of its data
during sleep, but we haven't found it yet. Due to
that, using powersave may spontaneously cause the
device to SYSASSERT when transitioning from sleep
to wake. Therefore, disable powersave for 4965,
until (if ever, unfortunately) we can identify
and fix the problem.
Cf. http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=1982
which was closed, but now has re-appeared with
IDLE mode, which probably means we never really
fixed it.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
This version of the patch applies to 2.6.32. Please use previous
version for wireless-testing.
Thank you very much
drivers/net/wireless/iwlwifi/iwl-4965.c | 1 +
drivers/net/wireless/iwlwifi/iwl-core.c | 9 ++++++---
drivers/net/wireless/iwlwifi/iwl-core.h | 1 +
drivers/net/wireless/iwlwifi/iwl-power.c | 5 +++--
4 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 63df1e4..d61d5a3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2346,6 +2346,7 @@ struct iwl_cfg iwl4965_agn_cfg = {
.mod_params = &iwl4965_mod_params,
.use_isr_legacy = true,
.ht_greenfield_support = false,
+ .broken_powersave = true,
};
/* Module firmware */
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 5c6cee2..e447c1a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1565,9 +1565,12 @@ int iwl_setup_mac(struct iwl_priv *priv)
hw->flags = IEEE80211_HW_SIGNAL_DBM |
IEEE80211_HW_NOISE_DBM |
IEEE80211_HW_AMPDU_AGGREGATION |
- IEEE80211_HW_SPECTRUM_MGMT |
- IEEE80211_HW_SUPPORTS_PS |
- IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
+ IEEE80211_HW_SPECTRUM_MGMT;
+
+ if (!priv->cfg->broken_powersave)
+ hw->flags |= IEEE80211_HW_SUPPORTS_PS |
+ IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
+
hw->wiphy->interface_modes =
BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_ADHOC);
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index cab148d..5e1f700 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -256,6 +256,7 @@ struct iwl_cfg {
const u16 max_ll_items;
const bool shadow_ram_support;
const bool ht_greenfield_support;
+ const bool broken_powersave;
};
/***************************
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c
index 4ec6a83..60be976 100644
--- a/drivers/net/wireless/iwlwifi/iwl-power.c
+++ b/drivers/net/wireless/iwlwifi/iwl-power.c
@@ -292,8 +292,9 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force)
else
dtimper = 1;
- /* TT power setting overwrites everything */
- if (tt->state >= IWL_TI_1)
+ if (priv->cfg->broken_powersave)
+ iwl_power_sleep_cam_cmd(priv, &cmd);
+ else if (tt->state >= IWL_TI_1)
iwl_static_sleep_cmd(priv, &cmd, tt->tt_power_mode, dtimper);
else if (!enabled)
iwl_power_sleep_cam_cmd(priv, &cmd);
--
1.5.6.3
^ permalink raw reply related
* Re: [PATCH 13/13 v2.6.32 and w-t] iwlwifi: disable powersave for 4965
From: reinette chatre @ 2009-09-11 17:48 UTC (permalink / raw)
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
ipw3945-devel@lists.sourceforge.net, Johannes Berg
In-Reply-To: <1252690699-25796-14-git-send-email-reinette.chatre@intel.com>
On Fri, 2009-09-11 at 10:38 -0700, Chatre, Reinette wrote:
> From: Johannes Berg <johannes@sipsolutions.net>
>
> There's a bug in 4965 powersave that appears to
> be related to the way it keeps track of its data
> during sleep, but we haven't found it yet. Due to
> that, using powersave may spontaneously cause the
> device to SYSASSERT when transitioning from sleep
> to wake. Therefore, disable powersave for 4965,
> until (if ever, unfortunately) we can identify
> and fix the problem.
>
> Cf. http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=1982
> which was closed, but now has re-appeared with
> IDLE mode, which probably means we never really
> fixed it.
>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
> ---
This patch only applies to wireless-testing (as it is based on an
earlier patch in this series that does not target 2.6.32). I will send a
different version that applies cleanly onto 2.6.32.
Sorry for inconvenience.
Reinette
^ permalink raw reply
* Re: [PATCH 07/13] iwlwifi: clean up ht config a little
From: Gábor Stefanik @ 2009-09-11 17:46 UTC (permalink / raw)
To: Reinette Chatre; +Cc: linville, linux-wireless, ipw3945-devel, Johannes Berg
In-Reply-To: <1252690699-25796-8-git-send-email-reinette.chatre@intel.com>
On Fri, Sep 11, 2009 at 7:38 PM, Reinette Chatre
<reinette.chatre@intel.com> wrote:
> From: Johannes Berg <johannes@sipsolutions.net>
>
> is_ht can be bool instead of u8, and there's
> no need to use IWL_CHANNEL_WIDTH_* constants
> in supported_chan_width when that could just
> be named is_40mhz instead.
What about is_ht40?
>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
> ---
> drivers/net/wireless/iwlwifi/iwl-core.c | 14 +++++---------
> drivers/net/wireless/iwlwifi/iwl-dev.h | 7 ++-----
> 2 files changed, 7 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
> index acfd7b4..7c50065 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-core.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-core.c
> @@ -636,8 +636,7 @@ u8 iwl_is_ht40_tx_allowed(struct iwl_priv *priv,
> {
> struct iwl_ht_info *iwl_ht_conf = &priv->current_ht_config;
>
> - if ((!iwl_ht_conf->is_ht) ||
> - (iwl_ht_conf->supported_chan_width != IWL_CHANNEL_WIDTH_40MHZ))
> + if (!iwl_ht_conf->is_ht || !iwl_ht_conf->is_40mhz)
> return 0;
>
> /* We do not check for IEEE80211_HT_CAP_SUP_WIDTH_20_40
> @@ -2799,21 +2798,18 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
> if (conf_is_ht40_minus(conf)) {
> ht_conf->extension_chan_offset =
> IEEE80211_HT_PARAM_CHA_SEC_BELOW;
> - ht_conf->supported_chan_width =
> - IWL_CHANNEL_WIDTH_40MHZ;
> + ht_conf->is_40mhz = true;
> } else if (conf_is_ht40_plus(conf)) {
> ht_conf->extension_chan_offset =
> IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
> - ht_conf->supported_chan_width =
> - IWL_CHANNEL_WIDTH_40MHZ;
> + ht_conf->is_40mhz = true;
> } else {
> ht_conf->extension_chan_offset =
> IEEE80211_HT_PARAM_CHA_SEC_NONE;
> - ht_conf->supported_chan_width =
> - IWL_CHANNEL_WIDTH_20MHZ;
> + ht_conf->is_40mhz = false;
> }
> } else
> - ht_conf->supported_chan_width = IWL_CHANNEL_WIDTH_20MHZ;
> + ht_conf->is_40mhz = false;
> /* Default to no protection. Protection mode will later be set
> * from BSS config in iwl_ht_conf */
> ht_conf->ht_protection = IEEE80211_HT_OP_MODE_PROTECTION_NONE;
> diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
> index 028d505..961d534 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-dev.h
> +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
> @@ -504,8 +504,8 @@ union iwl_ht_rate_supp {
>
> struct iwl_ht_info {
> /* self configuration data */
> - u8 is_ht;
> - u8 supported_chan_width;
> + bool is_ht;
> + bool is_40mhz;
> u8 sm_ps;
> struct ieee80211_mcs_info mcs;
> /* BSS related data */
> @@ -726,9 +726,6 @@ struct iwl_dma_ptr {
> size_t size;
> };
>
> -#define IWL_CHANNEL_WIDTH_20MHZ 0
> -#define IWL_CHANNEL_WIDTH_40MHZ 1
> -
> #define IWL_OPERATION_MODE_AUTO 0
> #define IWL_OPERATION_MODE_HT_ONLY 1
> #define IWL_OPERATION_MODE_MIXED 2
> --
> 1.5.6.3
>
> --
> 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
* Re: [PATCH 3/4] ath5k: define ath_common ops
From: Luis R. Rodriguez @ 2009-09-11 17:43 UTC (permalink / raw)
To: Linus Torvalds
Cc: devel, ath9k-devel, Jeff Garzik, linux-wireless, Nick Kossifidis,
Alan Cox
In-Reply-To: <alpine.LFD.2.01.0909110720210.3654@localhost.localdomain>
On Fri, Sep 11, 2009 at 7:24 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
>
> On Fri, 11 Sep 2009, Luis R. Rodriguez wrote:
>>
>> That is the way I had it originally before submission, and I
>> completely agree its reasonable to not incur additional cost at the
>> expense of having two separate read/write paths, and perhaps we should
>> only incur the extra cost on routines shared between
>> ath9k/ath9k/ath9k_htc. But -- is there really is a measurable cost
>> penalty?
>
> There's a measurable size penalty, at least.
My tests so far yield no performance difference but I'm sure there is
some, maybe as Jouni noted, more visible on embedded systems.
> In fact, if you know what kind of IO op it is (ie "it's always MMIO"),
> you'd be even better using "writel()" directly,
Heh.. you realize I tried to document such a thing a while ago and it
seems you opposed it [1]?
[1] http://lkml.indiana.edu/hypermail/linux/kernel/0709.2/0593.html
Luis
^ permalink raw reply
* [PATCH 13/13 v2.6.32 and w-t] iwlwifi: disable powersave for 4965
From: Reinette Chatre @ 2009-09-11 17:38 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Johannes Berg, Reinette Chatre
In-Reply-To: <1252690699-25796-1-git-send-email-reinette.chatre@intel.com>
From: Johannes Berg <johannes@sipsolutions.net>
There's a bug in 4965 powersave that appears to
be related to the way it keeps track of its data
during sleep, but we haven't found it yet. Due to
that, using powersave may spontaneously cause the
device to SYSASSERT when transitioning from sleep
to wake. Therefore, disable powersave for 4965,
until (if ever, unfortunately) we can identify
and fix the problem.
Cf. http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=1982
which was closed, but now has re-appeared with
IDLE mode, which probably means we never really
fixed it.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-4965.c | 1 +
drivers/net/wireless/iwlwifi/iwl-core.c | 9 ++++++---
drivers/net/wireless/iwlwifi/iwl-core.h | 1 +
drivers/net/wireless/iwlwifi/iwl-power.c | 5 +++--
4 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 63df1e4..d61d5a3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2346,6 +2346,7 @@ struct iwl_cfg iwl4965_agn_cfg = {
.mod_params = &iwl4965_mod_params,
.use_isr_legacy = true,
.ht_greenfield_support = false,
+ .broken_powersave = true,
.led_compensation = 61,
};
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 5c6cee2..e447c1a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1565,9 +1565,12 @@ int iwl_setup_mac(struct iwl_priv *priv)
hw->flags = IEEE80211_HW_SIGNAL_DBM |
IEEE80211_HW_NOISE_DBM |
IEEE80211_HW_AMPDU_AGGREGATION |
- IEEE80211_HW_SPECTRUM_MGMT |
- IEEE80211_HW_SUPPORTS_PS |
- IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
+ IEEE80211_HW_SPECTRUM_MGMT;
+
+ if (!priv->cfg->broken_powersave)
+ hw->flags |= IEEE80211_HW_SUPPORTS_PS |
+ IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
+
hw->wiphy->interface_modes =
BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_ADHOC);
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index cab148d..5e1f700 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -256,6 +256,7 @@ struct iwl_cfg {
const bool shadow_ram_support;
const bool ht_greenfield_support;
u16 led_compensation;
+ const bool broken_powersave;
};
/***************************
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c
index 4ec6a83..60be976 100644
--- a/drivers/net/wireless/iwlwifi/iwl-power.c
+++ b/drivers/net/wireless/iwlwifi/iwl-power.c
@@ -292,8 +292,9 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force)
else
dtimper = 1;
- /* TT power setting overwrites everything */
- if (tt->state >= IWL_TI_1)
+ if (priv->cfg->broken_powersave)
+ iwl_power_sleep_cam_cmd(priv, &cmd);
+ else if (tt->state >= IWL_TI_1)
iwl_static_sleep_cmd(priv, &cmd, tt->tt_power_mode, dtimper);
else if (!enabled)
iwl_power_sleep_cam_cmd(priv, &cmd);
--
1.5.6.3
^ permalink raw reply related
* [PATCH 12/13 v2.6.32 and w-t] iwlwifi: find the correct first antenna
From: Reinette Chatre @ 2009-09-11 17:38 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy, Reinette Chatre
In-Reply-To: <1252690699-25796-1-git-send-email-reinette.chatre@intel.com>
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
We can not assume antenna "A" is the first valid anttena for
all the NIC. Need to make sure choice the correct antenna based on
h/w configuration for transmit to avoid sending frame on invalid
antenna
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 9d0758a..18af37c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -760,6 +760,7 @@ static u32 rs_get_lower_rate(struct iwl_lq_sta *lq_sta,
u16 high_low;
u8 switch_to_legacy = 0;
u8 is_green = lq_sta->is_green;
+ struct iwl_priv *priv = lq_sta->drv;
/* check if we need to switch from HT to legacy rates.
* assumption is that mandatory rates (1Mbps or 6Mbps)
@@ -773,7 +774,8 @@ static u32 rs_get_lower_rate(struct iwl_lq_sta *lq_sta,
tbl->lq_type = LQ_G;
if (num_of_ant(tbl->ant_type) > 1)
- tbl->ant_type = ANT_A;/*FIXME:RS*/
+ tbl->ant_type =
+ first_antenna(priv->hw_params.valid_tx_ant);
tbl->is_ht40 = 0;
tbl->is_SGI = 0;
--
1.5.6.3
^ permalink raw reply related
* [PATCH 10/13] iwlwifi: show NVM version in debugfs
From: Reinette Chatre @ 2009-09-11 17:38 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy, Reinette Chatre
In-Reply-To: <1252690699-25796-1-git-send-email-reinette.chatre@intel.com>
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Show version number along with dumping NVM data, the version information
being removed from sysfs, add it back to debugfs to help debugging.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-debugfs.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index fb84485..1a0337f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -383,6 +383,7 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
int pos = 0, ofs = 0, buf_size = 0;
const u8 *ptr;
char *buf;
+ u16 eeprom_ver;
size_t eeprom_len = priv->cfg->eeprom_size;
buf_size = 4 * eeprom_len + 256;
@@ -403,9 +404,11 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
IWL_ERR(priv, "Can not allocate Buffer\n");
return -ENOMEM;
}
- pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s\n",
+ eeprom_ver = iwl_eeprom_query16(priv, EEPROM_VERSION);
+ pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s, "
+ "version: 0x%x\n",
(priv->nvm_device_type == NVM_DEVICE_TYPE_OTP)
- ? "OTP" : "EEPROM");
+ ? "OTP" : "EEPROM", eeprom_ver);
for (ofs = 0 ; ofs < eeprom_len ; ofs += 16) {
pos += scnprintf(buf + pos, buf_size - pos, "0x%.4x ", ofs);
hex_dump_to_buffer(ptr + ofs, 16 , 16, 2, buf + pos,
--
1.5.6.3
^ permalink raw reply related
* [PATCH 09/13] iwlwifi: clean up ht config naming
From: Reinette Chatre @ 2009-09-11 17:38 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Johannes Berg, Reinette Chatre
In-Reply-To: <1252690699-25796-1-git-send-email-reinette.chatre@intel.com>
From: Johannes Berg <johannes@sipsolutions.net>
Daniel Halperin pointed out that the naming
here is rather inconsistent with at least 3
different names being used for one thing in
different contexts. Rename the struct to
iwl_ht_config (rather than iwl_ht_info) and
use ht_conf as a variable for it.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-core.c | 48 ++++++++++++++--------------
drivers/net/wireless/iwlwifi/iwl-core.h | 2 +-
drivers/net/wireless/iwlwifi/iwl-dev.h | 4 +-
4 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index fd73153..9d0758a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -662,7 +662,7 @@ static int rs_toggle_antenna(u32 valid_ant, u32 *rate_n_flags,
* there are no non-GF stations present in the BSS.
*/
static inline u8 rs_use_green(struct ieee80211_sta *sta,
- struct iwl_ht_info *ht_conf)
+ struct iwl_ht_config *ht_conf)
{
return (sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD) &&
!(ht_conf->non_GF_STA_present);
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 7c50065..d9a757a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -634,9 +634,9 @@ static u8 iwl_is_channel_extension(struct iwl_priv *priv,
u8 iwl_is_ht40_tx_allowed(struct iwl_priv *priv,
struct ieee80211_sta_ht_cap *sta_ht_inf)
{
- struct iwl_ht_info *iwl_ht_conf = &priv->current_ht_config;
+ struct iwl_ht_config *ht_conf = &priv->current_ht_config;
- if (!iwl_ht_conf->is_ht || !iwl_ht_conf->is_40mhz)
+ if (!ht_conf->is_ht || !ht_conf->is_40mhz)
return 0;
/* We do not check for IEEE80211_HT_CAP_SUP_WIDTH_20_40
@@ -652,7 +652,7 @@ u8 iwl_is_ht40_tx_allowed(struct iwl_priv *priv,
#endif
return iwl_is_channel_extension(priv, priv->band,
le16_to_cpu(priv->staging_rxon.channel),
- iwl_ht_conf->extension_chan_offset);
+ ht_conf->extension_chan_offset);
}
EXPORT_SYMBOL(iwl_is_ht40_tx_allowed);
@@ -876,11 +876,11 @@ u8 iwl_rate_get_lowest_plcp(struct iwl_priv *priv)
}
EXPORT_SYMBOL(iwl_rate_get_lowest_plcp);
-void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_info *ht_info)
+void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_config *ht_conf)
{
struct iwl_rxon_cmd *rxon = &priv->staging_rxon;
- if (!ht_info->is_ht) {
+ if (!ht_conf->is_ht) {
rxon->flags &= ~(RXON_FLG_CHANNEL_MODE_MSK |
RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK |
RXON_FLG_HT40_PROT_MSK |
@@ -891,7 +891,7 @@ void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_info *ht_info)
/* FIXME: if the definition of ht_protection changed, the "translation"
* will be needed for rxon->flags
*/
- rxon->flags |= cpu_to_le32(ht_info->ht_protection << RXON_FLG_HT_OPERATING_MODE_POS);
+ rxon->flags |= cpu_to_le32(ht_conf->ht_protection << RXON_FLG_HT_OPERATING_MODE_POS);
/* Set up channel bandwidth:
* 20 MHz only, 20/40 mixed or pure 40 if ht40 ok */
@@ -900,10 +900,10 @@ void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_info *ht_info)
RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK);
if (iwl_is_ht40_tx_allowed(priv, NULL)) {
/* pure ht40 */
- if (ht_info->ht_protection == IEEE80211_HT_OP_MODE_PROTECTION_20MHZ) {
+ if (ht_conf->ht_protection == IEEE80211_HT_OP_MODE_PROTECTION_20MHZ) {
rxon->flags |= RXON_FLG_CHANNEL_MODE_PURE_40;
/* Note: control channel is opposite of extension channel */
- switch (ht_info->extension_chan_offset) {
+ switch (ht_conf->extension_chan_offset) {
case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
rxon->flags &= ~RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK;
break;
@@ -913,7 +913,7 @@ void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_info *ht_info)
}
} else {
/* Note: control channel is opposite of extension channel */
- switch (ht_info->extension_chan_offset) {
+ switch (ht_conf->extension_chan_offset) {
case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
rxon->flags &= ~(RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK);
rxon->flags |= RXON_FLG_CHANNEL_MODE_MIXED;
@@ -939,11 +939,11 @@ void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_info *ht_info)
IWL_DEBUG_ASSOC(priv, "supported HT rate 0x%X 0x%X 0x%X "
"rxon flags 0x%X operation mode :0x%X "
"extension channel offset 0x%x\n",
- ht_info->mcs.rx_mask[0],
- ht_info->mcs.rx_mask[1],
- ht_info->mcs.rx_mask[2],
- le32_to_cpu(rxon->flags), ht_info->ht_protection,
- ht_info->extension_chan_offset);
+ ht_conf->mcs.rx_mask[0],
+ ht_conf->mcs.rx_mask[1],
+ ht_conf->mcs.rx_mask[2],
+ le32_to_cpu(rxon->flags), ht_conf->ht_protection,
+ ht_conf->extension_chan_offset);
return;
}
EXPORT_SYMBOL(iwl_set_rxon_ht);
@@ -2408,13 +2408,13 @@ EXPORT_SYMBOL(iwl_mac_conf_tx);
static void iwl_ht_conf(struct iwl_priv *priv,
struct ieee80211_bss_conf *bss_conf)
{
- struct ieee80211_sta_ht_cap *ht_conf;
- struct iwl_ht_info *iwl_conf = &priv->current_ht_config;
+ struct iwl_ht_config *ht_conf = &priv->current_ht_config;
+ struct ieee80211_sta_ht_cap *ht_cap;
struct ieee80211_sta *sta;
IWL_DEBUG_MAC80211(priv, "enter: \n");
- if (!iwl_conf->is_ht)
+ if (!ht_conf->is_ht)
return;
@@ -2430,15 +2430,15 @@ static void iwl_ht_conf(struct iwl_priv *priv,
rcu_read_unlock();
return;
}
- ht_conf = &sta->ht_cap;
+ ht_cap = &sta->ht_cap;
- iwl_conf->sm_ps = (u8)((ht_conf->cap & IEEE80211_HT_CAP_SM_PS) >> 2);
+ ht_conf->sm_ps = (u8)((ht_cap->cap & IEEE80211_HT_CAP_SM_PS) >> 2);
- memcpy(&iwl_conf->mcs, &ht_conf->mcs, 16);
+ memcpy(&ht_conf->mcs, &ht_cap->mcs, 16);
- iwl_conf->ht_protection =
+ ht_conf->ht_protection =
bss_conf->ht_operation_mode & IEEE80211_HT_OP_MODE_PROTECTION;
- iwl_conf->non_GF_STA_present =
+ ht_conf->non_GF_STA_present =
!!(bss_conf->ht_operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
rcu_read_unlock();
@@ -2748,7 +2748,7 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
struct iwl_priv *priv = hw->priv;
const struct iwl_channel_info *ch_info;
struct ieee80211_conf *conf = &hw->conf;
- struct iwl_ht_info *ht_conf = &priv->current_ht_config;
+ struct iwl_ht_config *ht_conf = &priv->current_ht_config;
unsigned long flags = 0;
int ret = 0;
u16 ch;
@@ -2915,7 +2915,7 @@ void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
IWL_DEBUG_MAC80211(priv, "enter\n");
spin_lock_irqsave(&priv->lock, flags);
- memset(&priv->current_ht_config, 0, sizeof(struct iwl_ht_info));
+ memset(&priv->current_ht_config, 0, sizeof(struct iwl_ht_config));
spin_unlock_irqrestore(&priv->lock, flags);
iwl_reset_qos(priv);
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index dfeca62..cab148d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -274,7 +274,7 @@ int iwl_check_rxon_cmd(struct iwl_priv *priv);
int iwl_full_rxon_required(struct iwl_priv *priv);
void iwl_set_rxon_chain(struct iwl_priv *priv);
int iwl_set_rxon_channel(struct iwl_priv *priv, struct ieee80211_channel *ch);
-void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_info *ht_info);
+void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_config *ht_conf);
u8 iwl_is_ht40_tx_allowed(struct iwl_priv *priv,
struct ieee80211_sta_ht_cap *sta_ht_inf);
void iwl_set_flags_for_band(struct iwl_priv *priv, enum ieee80211_band band);
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 961d534..e161f8d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -502,7 +502,7 @@ union iwl_ht_rate_supp {
#define CFG_HT_MPDU_DENSITY_4USEC (0x5)
#define CFG_HT_MPDU_DENSITY_DEF CFG_HT_MPDU_DENSITY_4USEC
-struct iwl_ht_info {
+struct iwl_ht_config {
/* self configuration data */
bool is_ht;
bool is_40mhz;
@@ -1077,7 +1077,7 @@ struct iwl_priv {
struct iwl_chain_noise_data chain_noise_data;
__le16 sensitivity_tbl[HD_TABLE_SIZE];
- struct iwl_ht_info current_ht_config;
+ struct iwl_ht_config current_ht_config;
u8 last_phy_res[100];
/* Rate scaling data */
--
1.5.6.3
^ permalink raw reply related
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