Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [PATCH v2] mac80211: Add HT IE to IBSS beacons and probe responses.
From: Johannes Berg @ 2010-05-11 10:48 UTC (permalink / raw)
  To: Benoit Papillault; +Cc: linux-wireless
In-Reply-To: <4BE49BDD.8010803@free.fr>

On Sat, 2010-05-08 at 01:01 +0200, Benoit Papillault wrote:

> > It would be helpful if you were to rebase over my patch that adds the
> > channel type tracking.
> 
> Your patches are now in wireless-testing, so I am doing it at the moment.

Thanks.

> >> +	if (channel_type != NL80211_CHAN_NO_HT&&
> >> +	    sband->ht_cap.ht_supported) {
> >
> > You shouldn't be able to get here with an HT channel but !ht_supported,
> > no? Or is that to support the case where you have HT only on one band?
> 
> Good point. I think there are several cases here :
> 
> - a non-HT STA is joining an HT IBSS (we need to check 802.11n-2009 to 
> see how it's supposed to be handled). In this case channel_type could be 
> ht40+ and ht_supported = false

Hmm, true.

> - an HT STA is joining a non-HT IBSS. It's clear in this case that no HT 
> IE should be sent, which is catched by (channel_type != 
> NL80211_CHAN_NO_HT) condition.

Right.

> Could we examine those cases in a follow up patch?

Well what do we actually need to do then?

> >> +}
> >> +
> >> +int ieee80211_add_ht_info(u8 **ppos,
> >> +			  struct ieee80211_supported_band *sband,
> >> +			  struct ieee80211_channel *channel,
> >> +			  enum nl80211_channel_type channel_type)
> >
> > what's wrong with ieee80211_add_ht_ie()
> 
> Seems it's close to what I'm doing, but not entirely the same. I will 
> read it. If applicable, should I move ieee80211_add_ht_ie to util.c (and 
> declaration to ieee80211_i.h) then ?

Yes.

Also I just noticed that there's a TODO item in rx.c when we receive an
HT frame from a peer we don't know about yet. Not sure what to do there,
but you'll need to look at it.

johannes


^ permalink raw reply

* [PATCH 2.6.34] mac80211: don't process work item with wrong frame
From: Johannes Berg @ 2010-05-11 10:42 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

When we process a frame, we currently just match it
to the work struct by the MAC addresses, and not by
the work type. This means that we can end up doing
the work for an association request item when (for
whatever reason) we receive another frame type, for
example a probe response. Processing the wrong type
of frame will lead to completely invalid data being
processed, and will lead to various problems like
thinking the association was successful even if the
AP never sent an assocation response.

Fix this by making each processing function check
that it is invoked for the right work struct type
only and continue processing otherwise (and drop
frames that we didn't expect).

This bug was uncovered during the debugging for
https://bugzilla.kernel.org/show_bug.cgi?id=15862
but doesn't seem to be the cause for any of the
various problems reported there.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
Sorry. This is a dumb bug :(

 net/mac80211/work.c |   27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

--- wireless-testing.orig/net/mac80211/work.c	2010-05-11 09:56:43.000000000 +0200
+++ wireless-testing/net/mac80211/work.c	2010-05-11 10:04:13.000000000 +0200
@@ -33,6 +33,7 @@
 #define IEEE80211_MAX_PROBE_TRIES 5
 
 enum work_action {
+	WORK_ACT_MISMATCH,
 	WORK_ACT_NONE,
 	WORK_ACT_TIMEOUT,
 	WORK_ACT_DONE,
@@ -585,7 +586,7 @@ ieee80211_rx_mgmt_auth(struct ieee80211_
 	u16 auth_alg, auth_transaction, status_code;
 
 	if (wk->type != IEEE80211_WORK_AUTH)
-		return WORK_ACT_NONE;
+		return WORK_ACT_MISMATCH;
 
 	if (len < 24 + 6)
 		return WORK_ACT_NONE;
@@ -636,6 +637,9 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee
 	struct ieee802_11_elems elems;
 	u8 *pos;
 
+	if (wk->type != IEEE80211_WORK_ASSOC)
+		return WORK_ACT_MISMATCH;
+
 	/*
 	 * AssocResp and ReassocResp have identical structure, so process both
 	 * of them in this function.
@@ -691,6 +695,12 @@ ieee80211_rx_mgmt_probe_resp(struct ieee
 
 	ASSERT_WORK_MTX(local);
 
+	if (wk->type != IEEE80211_WORK_DIRECT_PROBE)
+		return WORK_ACT_MISMATCH;
+
+	if (len < 24 + 12)
+		return WORK_ACT_NONE;
+
 	baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt;
 	if (baselen > len)
 		return WORK_ACT_NONE;
@@ -705,7 +715,7 @@ static void ieee80211_work_rx_queued_mgm
 	struct ieee80211_rx_status *rx_status;
 	struct ieee80211_mgmt *mgmt;
 	struct ieee80211_work *wk;
-	enum work_action rma = WORK_ACT_NONE;
+	enum work_action rma;
 	u16 fc;
 
 	rx_status = (struct ieee80211_rx_status *) skb->cb;
@@ -752,7 +762,17 @@ static void ieee80211_work_rx_queued_mgm
 			break;
 		default:
 			WARN_ON(1);
+			rma = WORK_ACT_NONE;
 		}
+
+		/*
+		 * We've either received an unexpected frame, or we have
+		 * multiple work items and need to match the frame to the
+		 * right one.
+		 */
+		if (rma == WORK_ACT_MISMATCH)
+			continue;
+
 		/*
 		 * We've processed this frame for that work, so it can't
 		 * belong to another work struct.
@@ -762,6 +782,9 @@ static void ieee80211_work_rx_queued_mgm
 	}
 
 	switch (rma) {
+	case WORK_ACT_MISMATCH:
+		/* ignore this unmatched frame */
+		break;
 	case WORK_ACT_NONE:
 		break;
 	case WORK_ACT_DONE:



^ permalink raw reply

* Re: kernel BUG in iwl-agn-rs.c:2076, WAS: iwlagn + some accesspoint == hardlock
From: Nils Radtke @ 2010-05-11  9:41 UTC (permalink / raw)
  To: reinette.chatre; +Cc: linville, linux-kernel, linux-wireless

  Hi,

Thanks a lot for the driver not hanging w/ bug_on() any more. At least the machine 
keeps working and when on battery no repeated reboots are required any more. That alone
already means a lot.

# On Mon, 2010-05-10 at 11:36 -0700, Nils Radtke wrote:
# >   Today weather was fine again, finally. So testing with .33.3 w/ the patch applied: 
# > 
# >   http://marc.info/?l=linux-wireless&m=127290931304496&w=2
# > 
# > The kernel kernel .32 was still running before it crashed immediately on wireless activation.
# > The crash log showed again at least two messages, the last was as already described in my first
# > message, bug from 2010-04-30: I think even the 0x2030 was the same:
# > 
# > EIP rs_tx_status +x8f/x2030 
# 
# You report an issue on 2.6.32 ...
Yes. These errors happened to be the same regardless of .32 or .33

# > W/ .33.3 and the above patch applied:
# 
# ... but then test the patch with 2.6.33.
# 
# Which kernel are you focused on?
Sorry, no intention to confuse or show erratic behaviour.. :)

It's just that the errors occur on both of them. Then I accidently booted the old one again (now
removed from the system), but again, the error showed up on .32, .33{1,2,3} . But you always had
had an indication which kernel it happened on.

OTH, it's basically the same, the identical error persists, so I can't seem the difference here. 
Except for a scientific approach one shouldn't do that, ACK. But, hey, I'd like to use the machine in
the meantime and happened to update the kernel source. 

# > Linux mypole 2.6.33.3 #18 SMP PREEMPT Thu May 6 21:51:37 CEST 2010 i686 GNU/Linux
# > 
# > May 10 19:14:11 [   80.586637] iwlagn 0000:03:00.0: expected_tpt should have been calculated by now
# > May 10 19:23:17 [  626.476078] iwlagn 0000:03:00.0: expected_tpt should have been calculated by now
# > May 10 19:23:30 [  638.913740] iwlagn 0000:03:00.0: expected_tpt should have been calculated by now
# > May 10 19:23:32 [  641.232425] iwlagn 0000:03:00.0: expected_tpt should have been calculated by now
# > May 10 19:23:54 [  663.392697] iwlagn 0000:03:00.0: expected_tpt should have been calculated by now
# > May 10 19:23:58 [  666.980247] iwlagn 0000:03:00.0: expected_tpt should have been calculated by now
# > May 10 19:24:02 [  671.121826] iwlagn 0000:03:00.0: expected_tpt should have been calculated by now
# Can you see any impact on your connection speed that can be connected to
# these messages?
I'm glad you're asking. Yes, indeed, speed it exceptionally low to what might be achievable. Around 30k/s
average, burst with maybe 200k/s, instead of 700k/s.

# > Additionally these were logged, could you tell why they're there and what to do? (also .33.3 w/ patch)
# > 
# > May 10 19:24:16 [  685.079617] iwlagn 0000:03:00.0: iwl_tx_agg_start on ra = 00:1a:70:12:23:25 tid = 0
# > May 10 19:24:22 [  691.026737] iwlagn 0000:03:00.0: iwl_tx_agg_start on ra = 00:1a:70:12:23:25 tid = 0
# > May 10 19:28:02 [  911.406162] iwlagn 0000:03:00.0: iwl_tx_agg_start on ra = 00:1a:70:12:23:25 tid = 0
# > May 10 19:35:38 [ 1367.251240] iwlagn 0000:03:00.0: iwl_tx_agg_start on ra = 00:1a:70:12:23:25 tid = 0
# > 
# > The above "iwl_tx_agg_start" lines happen when connecting - again to a Cisco AP - and the connection gets
# > dropped the exact moment when a download is started. It even often drops when dhcp is still negotiating, has
# > got it's IP but the nego isn't finished yet. Conn drops, same procedure again and again. This happens only
# > with this Cisco AP (which is BTW another one from the "expected_tpt should have been calculated by now" 
# > problem).
# It could be that some of the queues get stuck. Can you try with the
# patches in
# http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2037#c113 ? They
# are based on 2.6.33.
Good, no wait, bad, now running on .34-rc7. *sigh

I'll apply the patches to .33. .34-rc7 hadn't brought the desired success w/ the olicard100 usb-umts-stick.

Update: noticed you mean 2.6.33 not .33.x ;) On .33.3 it doesn't apply cleanly for a couple of files..
Any objections if I apply it to .33.3 anyway? (Fixing the rej of course..)

Interestingly enough, quilt import 0001*patch imports, quilt push patches but it applies the patch w/o
rej. patch -p1 0001*patch does recognize the patch already applied and rejects..

All patches applied successfully, trying again these days.

Thanks for your comments.

Will keep you informed.

Nils


^ permalink raw reply

* Re: [RFC PATCH 0/2] mac80211: antenna configuration
From: Bruno Randolf @ 2010-05-11  9:34 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linville, linux-wireless, holgerschurig
In-Reply-To: <1273567999.3669.27.camel@jlt3.sipsolutions.net>

On Tuesday 11 May 2010 17:53:19 you wrote:
> On Tue, 2010-05-11 at 17:38 +0900, Bruno Randolf wrote:
> > i have followed holger schurig's suggestion to use a bitmap for allowed
> > antennas. when multiple antennas are selected in the bitmap, the driver
> > may use diversity. i think that this allows for the most flexible, yet
> > simple configuration of antennas, and drivers can just reject
> > configurations they cannot support. i hope that this will also be
> > generic enough for 802.11n with multiple antennas
> 
> Not sure ... 11n has antennas and chains, but people mix them up
> frequently. Does this API even make sense for 11n? Use cases? Should it
> be about *antennas*, or about *chains*?

thanks for the review! i'll resend tomorrow.

i personally don't know about 802.11n - and what i need is about *antennas* :)

bruno

^ permalink raw reply

* Re: [patch 2/9] ath9k: range checking issues in htc_hst.c
From: Dan Carpenter @ 2010-05-11  9:29 UTC (permalink / raw)
  To: Sujith.Manoharan
  Cc: Luis Rodriguez, Jouni Malinen, Vasanth Thiagarajan,
	Senthilkumar Balasubramanian, John W. Linville, Ming Lei,
	linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org
In-Reply-To: <19432.61450.971181.675920@gargle.gargle.HOWL>

On Tue, May 11, 2010 at 11:20:02AM +0530, Sujith.Manoharan@atheros.com wrote:
> Dan Carpenter wrote:
> > The original code had ENDPOINT_MAX and HST_ENDPOINT_MAX switched.
> > 
> > Also the first loop was off by one, it started past the end of the array
> > and went down to 1 instead of going down to 0.  The test at the end of
> > the loop to see if we exited via a break wasn't right because
> > "tmp_endpoint" is always non-null here.
> 
> This is a very good catch and fixes a stack corruption issue.
> Do you mind if I work upon this patch and send out an updated fix ?
> 
> Sujith

Sorry, I meant to do that yesterday but I was out of it.  Yes.  Please 
send the updated fix.

regards,
dan carpenter

^ permalink raw reply

* [PATCH] ar9170usb:add vendor and device ID for Qwest/Actiontec 802AIN Wireless N USB Network Adapter
From: Steve Tanner @ 2010-05-11  9:19 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Christian Lamparter

* add support for the Qwest/Actiontec 802AIN Wireless N USB Network Adapter.

lsusb identifies the device as: "ID 1668:1200 Actiontec Electronics, Inc. [hex]"

usb_modeswitch package and appropriate rules are required to switch
the device from "ID 0ace:20ff ZyDas"

Changes-licensed-under: GPL
---
diff --git a/linux-source-2.6.32.orig/drivers/net/wireless/ath/ar9170/usb.c
b/linux-source-2.6.32/drivers/net/wireless/ath/ar9170/usb.c
index f141a4f..1070313 100644
--- a/linux-source-2.6.32.orig/drivers/net/wireless/ath/ar9170/usb.c
+++ b/linux-source-2.6.32/drivers/net/wireless/ath/ar9170/usb.c
@@ -94,6 +94,8 @@ static struct usb_device_id ar9170_usb_ids[] = {
        { USB_DEVICE(0x057C, 0x8401) },
        /* AVM FRITZ!WLAN USB Stick N 2.4 */
        { USB_DEVICE(0x057C, 0x8402), .driver_info = AR9170_REQ_FW1_ONLY },
+       /* Qwest/Actiontec 802AIN Wireless N USB Network Adapter */
+       { USB_DEVICE(0x1668, 0x1200) },

        /* terminate */
        {}

^ permalink raw reply related

* Re: [RFC PATCH 0/2] mac80211: antenna configuration
From: Johannes Berg @ 2010-05-11  8:53 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless, holgerschurig
In-Reply-To: <20100511083121.28289.96180.stgit@tt-desk>

On Tue, 2010-05-11 at 17:38 +0900, Bruno Randolf wrote:

> i have followed holger schurig's suggestion to use a bitmap for allowed
> antennas. when multiple antennas are selected in the bitmap, the driver may use
> diversity. i think that this allows for the most flexible, yet simple
> configuration of antennas, and drivers can just reject configurations they
> cannot support. i hope that this will also be generic enough for 802.11n with
> multiple antennas

Not sure ... 11n has antennas and chains, but people mix them up
frequently. Does this API even make sense for 11n? Use cases? Should it
be about *antennas*, or about *chains*?

johannes


^ permalink raw reply

* Re: [RFC PATCH 1/2] mac80211: Add nl80211 antenna configuration
From: Johannes Berg @ 2010-05-11  8:52 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless, holgerschurig
In-Reply-To: <20100511083900.28289.43864.stgit@tt-desk>

On Tue, 2010-05-11 at 17:39 +0900, Bruno Randolf wrote:


> +static inline int drv_set_antenna(struct ieee80211_local *local,
> +				  u8 tx_ant, u8 rx_ant)
> +{
> +	int ret = -EOPNOTSUPP;
> +	might_sleep();
> +	if (local->ops->set_antenna)
> +		ret = local->ops->set_antenna(&local->hw, tx_ant, rx_ant);
> +	return ret;
> +}
> +
> +static inline int drv_get_antenna(struct ieee80211_local *local,
> +				  u8 *tx_ant, u8 *rx_ant)
> +{
> +	int ret = -EOPNOTSUPP;
> +	might_sleep();
> +	if (local->ops->get_antenna)
> +		ret = local->ops->get_antenna(&local->hw, tx_ant, rx_ant);
> +	return ret;
> +}

Oh .. and add tracing please.

johannes


^ permalink raw reply

* Re: [RFC PATCH 1/2] mac80211: Add nl80211 antenna configuration
From: Johannes Berg @ 2010-05-11  8:51 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless, holgerschurig
In-Reply-To: <20100511083900.28289.43864.stgit@tt-desk>

On Tue, 2010-05-11 at 17:39 +0900, Bruno Randolf wrote:
> Allow setting TX and RX antenna configuration via nl80211/cfg80211.
> 
> The antenna configuration is defined as a bitmap of allowed antennas. This
> bitmap is 8 bit at the moment, each bit representing one antenna. If multiple
> antennas are selected, the driver may use diversity for receive and transmit.
> This allows for a simple, yet flexible configuration interface for antennas,
> while drivers may reject configurations they cannot support.

This is missing advertising whether or not the commands are available.
Look for the CMD() macro.

johannes


^ permalink raw reply

* Re: [RFC PATCH 2/2] ath5k: Add support for cfg80211 antenna setting
From: Johannes Berg @ 2010-05-11  8:50 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless, holgerschurig
In-Reply-To: <20100511083910.28289.71188.stgit@tt-desk>

On Tue, 2010-05-11 at 17:39 +0900, Bruno Randolf wrote:

> +	if (tx_ant == 1 && rx_ant == 1)
> +		ath5k_hw_set_antenna_mode(sc->ah, AR5K_ANTMODE_FIXED_A);
> +	else if (tx_ant == 2 && rx_ant == 2)
> +		ath5k_hw_set_antenna_mode(sc->ah, AR5K_ANTMODE_FIXED_B);
> +	else if (tx_ant == 3 && rx_ant == 3)
> +		ath5k_hw_set_antenna_mode(sc->ah, AR5K_ANTMODE_DEFAULT);
> +	else
> +		return -EOPNOTSUPP;

That should be -EINVAL, I think.

johannes


^ permalink raw reply

* Re: [RFC PATCH 1/2] mac80211: Add nl80211 antenna configuration
From: Johannes Berg @ 2010-05-11  8:50 UTC (permalink / raw)
  To: Bruno Randolf; +Cc: linville, linux-wireless, holgerschurig
In-Reply-To: <20100511083900.28289.43864.stgit@tt-desk>

On Tue, 2010-05-11 at 17:39 +0900, Bruno Randolf wrote:

> +	[NL80211_ATTR_ANTENNA_TX] = { .type = NLA_U8 },
> +	[NL80211_ATTR_ANTENNA_RX] = { .type = NLA_U8 },
>  };

> +	tx_ant = nla_get_u8(info->attrs[NL80211_ATTR_ANTENNA_TX]);
> +	rx_ant = nla_get_u8(info->attrs[NL80211_ATTR_ANTENNA_RX]);

> +	NLA_PUT_U32(msg, NL80211_ATTR_ANTENNA_TX, tx_ant);
> +	NLA_PUT_U32(msg, NL80211_ATTR_ANTENNA_RX, rx_ant);

That isn't right.

johannes


^ permalink raw reply

* [RFC PATCH 3/3] iw: Add antenna set/get
From: Bruno Randolf @ 2010-05-11  8:39 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless, holgerschurig
In-Reply-To: <20100511083933.28347.37155.stgit@tt-desk>

Add commands to set and get the antenna configuration. The antenna
configuration is defined as a bitmap of 8 antennas. When multiple antennas are
selected the driver may use diversity. Also the driver may reject antenna
configurations it cannot support.

Signed-off-by: Bruno Randolf <br1@einfach.org>
---
 Makefile  |    2 +
 antenna.c |   92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 93 insertions(+), 1 deletions(-)
 create mode 100644 antenna.c

diff --git a/Makefile b/Makefile
index d303f45..e526cda 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@ CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
 OBJS = iw.o genl.o event.o info.o phy.o \
 	interface.o ibss.o station.o survey.o util.o \
 	mesh.o mpath.o scan.o reg.o version.o \
-	reason.o status.o connect.o link.o offch.o ps.o cqm.o
+	reason.o status.o connect.o link.o offch.o ps.o cqm.o antenna.o
 OBJS += sections.o
 ALL = iw
 
diff --git a/antenna.c b/antenna.c
new file mode 100644
index 0000000..dd59c76
--- /dev/null
+++ b/antenna.c
@@ -0,0 +1,92 @@
+#include <net/if.h>
+#include <errno.h>
+#include <string.h>
+
+#include <netlink/genl/genl.h>
+#include <netlink/genl/family.h>
+#include <netlink/genl/ctrl.h>
+#include <netlink/msg.h>
+#include <netlink/attr.h>
+
+#include "nl80211.h"
+#include "iw.h"
+
+SECTION(antenna);
+
+static int set_antenna(struct nl80211_state *state,
+			struct nl_cb *cb,
+			struct nl_msg *msg,
+			int argc, char **argv)
+{
+	char *end;
+	uint8_t tx_ant, rx_ant;
+
+	if (argc != 4)
+		return 1;
+
+	if (strcmp(*argv, "tx") == 0) {
+		argv++;
+		argc--;
+
+		tx_ant = strtoul(argv[0], &end, 10);
+		argv++;
+		argc--;
+	}
+
+	if (strcmp(*argv, "rx") == 0) {
+		argv++;
+		argc--;
+
+		rx_ant = strtoul(argv[0], &end, 10);
+		argv++;
+		argc--;
+	}
+
+	if (*end)
+		return 1;
+
+	NLA_PUT_U8(msg, NL80211_ATTR_ANTENNA_TX, tx_ant);
+	NLA_PUT_U8(msg, NL80211_ATTR_ANTENNA_RX, rx_ant);
+	return 0;
+
+ nla_put_failure:
+	return -ENOBUFS;
+}
+
+COMMAND(antenna, set, "tx <bitmap> rx <bitmap>",
+	NL80211_CMD_SET_ANTENNA, 0, CIB_PHY, set_antenna,
+	"Set a bitmap of allowed antennas to use for TX and RX.\n"
+	"The driver may reject antenna configurations it cannot support.");
+
+
+static int print_antenna_handler(struct nl_msg *msg, void *arg)
+{
+	struct nlattr *attrs[NL80211_ATTR_MAX + 1];
+	struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
+	uint8_t tx_ant, rx_ant;
+
+	nla_parse(attrs, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
+		  genlmsg_attrlen(gnlh, 0), NULL);
+
+	if (!attrs[NL80211_ATTR_ANTENNA_TX] || !attrs[NL80211_ATTR_ANTENNA_RX])
+		return NL_SKIP;
+
+	tx_ant = nla_get_u8(attrs[NL80211_ATTR_ANTENNA_TX]);
+	rx_ant = nla_get_u8(attrs[NL80211_ATTR_ANTENNA_RX]);
+
+	printf("Antenna configuration: tx %d rx %d\n", tx_ant, rx_ant);
+
+	return NL_SKIP;
+}
+
+static int get_antenna(struct nl80211_state *state,
+			struct nl_cb *cb,
+			struct nl_msg *msg,
+			int argc, char **argv)
+{
+	nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_antenna_handler, NULL);
+	return 0;
+}
+
+COMMAND(antenna, get, NULL, NL80211_CMD_GET_ANTENNA, 0, CIB_PHY, get_antenna,
+	"Retrieve antenna configuration.");


^ permalink raw reply related

* [RFC PATCH 2/3] iw: sync nl80211.h with wireless-testing
From: Bruno Randolf @ 2010-05-11  8:39 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless, holgerschurig
In-Reply-To: <20100511083933.28347.37155.stgit@tt-desk>

adding AP isolate, set channel and antenna settings

Signed-off-by: Bruno Randolf <br1@einfach.org>
---
 nl80211.h |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/nl80211.h b/nl80211.h
index daf6a34..46a2c76 100644
--- a/nl80211.h
+++ b/nl80211.h
@@ -52,6 +52,8 @@
  *	%NL80211_ATTR_WIPHY_CHANNEL_TYPE, %NL80211_ATTR_WIPHY_RETRY_SHORT,
  *	%NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
  *	and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD.
+ *	However, for setting the channel, see %NL80211_CMD_SET_CHANNEL
+ *	instead, the support here is for backward compatibility only.
  * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
  *	or rename notification. Has attributes %NL80211_ATTR_WIPHY and
  *	%NL80211_ATTR_WIPHY_NAME.
@@ -329,6 +331,18 @@
  * @NL80211_CMD_NOTIFY_CQM: Connection quality monitor notification. This
  *	command is used as an event to indicate the that a trigger level was
  *	reached.
+ * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ
+ *	and %NL80211_ATTR_WIPHY_CHANNEL_TYPE) the given interface (identifed
+ *	by %NL80211_ATTR_IFINDEX) shall operate on.
+ *	In case multiple channels are supported by the device, the mechanism
+ *	with which it switches channels is implementation-defined.
+ *	When a monitor interface is given, it can only switch channel while
+ *	no other interfaces are operating to avoid disturbing the operation
+ *	of any other interfaces, and other interfaces will again take
+ *	precedence when they are used.
+ *
+ * @NL80211_CMD_SET_ANTENNA: Set a bitmap of antennas to use.
+ * @NL80211_CMD_GET_ANTENNA: Get antenna configuration from driver.
  *
  * @NL80211_CMD_MAX: highest used command number
  * @__NL80211_CMD_AFTER_LAST: internal use
@@ -428,6 +442,11 @@ enum nl80211_commands {
 	NL80211_CMD_SET_CQM,
 	NL80211_CMD_NOTIFY_CQM,
 
+	NL80211_CMD_SET_CHANNEL,
+
+	NL80211_CMD_SET_ANTENNA,
+	NL80211_CMD_GET_ANTENNA,
+
 	/* add new commands above here */
 
 	/* used to define NL80211_CMD_MAX below */
@@ -703,6 +722,18 @@ enum nl80211_commands {
  * @NL80211_ATTR_CQM: connection quality monitor configuration in a
  *	nested attribute with %NL80211_ATTR_CQM_* sub-attributes.
  *
+ * @NL80211_ATTR_LOCAL_STATE_CHANGE: Flag attribute to indicate that a command
+ *	is requesting a local authentication/association state change without
+ *	invoking actual management frame exchange. This can be used with
+ *	NL80211_CMD_AUTHENTICATE, NL80211_CMD_DEAUTHENTICATE,
+ *	NL80211_CMD_DISASSOCIATE.
+ *
+ * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations
+ *	connected to this BSS.
+ *
+ * @NL80211_ATTR_ANTENNA_TX: Bitmap of antennas to use for transmitting.
+ * @NL80211_ATTR_ANTENNA_RX: Bitmap of antennas to use for receiving.
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -856,6 +887,13 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_CQM,
 
+	NL80211_ATTR_LOCAL_STATE_CHANGE,
+
+	NL80211_ATTR_AP_ISOLATE,
+
+	NL80211_ATTR_ANTENNA_TX,
+	NL80211_ATTR_ANTENNA_RX,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,


^ permalink raw reply related

* [RFC PATCH 1/3] iw: fix makefile for cqm
From: Bruno Randolf @ 2010-05-11  8:39 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless, holgerschurig

Signed-off-by: Bruno Randolf <br1@einfach.org>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index e21900a..d303f45 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@ CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
 OBJS = iw.o genl.o event.o info.o phy.o \
 	interface.o ibss.o station.o survey.o util.o \
 	mesh.o mpath.o scan.o reg.o version.o \
-	reason.o status.o connect.o link.o offch.o ps.o cqm.c
+	reason.o status.o connect.o link.o offch.o ps.o cqm.o
 OBJS += sections.o
 ALL = iw
 


^ permalink raw reply related

* [RFC PATCH 2/2] ath5k: Add support for cfg80211 antenna setting
From: Bruno Randolf @ 2010-05-11  8:39 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless, holgerschurig
In-Reply-To: <20100511083121.28289.96180.stgit@tt-desk>

Support setting the antenna configuration via cfg80211. At the moment only
allow the simple pre-defined configurations we already have (fixed antenna A/B
or diversity), but more advanced settings should be possible later.

Signed-off-by: Bruno Randolf <br1@einfach.org>
---
 drivers/net/wireless/ath/ath5k/base.c |   34 +++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index a99f310..fbf3d45 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -256,6 +256,8 @@ static void ath5k_sw_scan_start(struct ieee80211_hw *hw);
 static void ath5k_sw_scan_complete(struct ieee80211_hw *hw);
 static void ath5k_set_coverage_class(struct ieee80211_hw *hw,
 		u8 coverage_class);
+static int ath5k_set_antenna(struct ieee80211_hw *hw, u8 tx_ant, u8 rx_ant);
+static int ath5k_get_antenna(struct ieee80211_hw *hw, u8 *tx_ant, u8 *rx_ant);
 
 static const struct ieee80211_ops ath5k_hw_ops = {
 	.tx 		= ath5k_tx,
@@ -277,6 +279,8 @@ static const struct ieee80211_ops ath5k_hw_ops = {
 	.sw_scan_start	= ath5k_sw_scan_start,
 	.sw_scan_complete = ath5k_sw_scan_complete,
 	.set_coverage_class = ath5k_set_coverage_class,
+	.set_antenna	= ath5k_set_antenna,
+	.get_antenna	= ath5k_get_antenna,
 };
 
 /*
@@ -3482,3 +3486,33 @@ static void ath5k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class)
 	ath5k_hw_set_coverage_class(sc->ah, coverage_class);
 	mutex_unlock(&sc->lock);
 }
+
+static int ath5k_set_antenna(struct ieee80211_hw *hw, u8 tx_ant, u8 rx_ant)
+{
+	struct ath5k_softc *sc = hw->priv;
+
+	if (tx_ant == 1 && rx_ant == 1)
+		ath5k_hw_set_antenna_mode(sc->ah, AR5K_ANTMODE_FIXED_A);
+	else if (tx_ant == 2 && rx_ant == 2)
+		ath5k_hw_set_antenna_mode(sc->ah, AR5K_ANTMODE_FIXED_B);
+	else if (tx_ant == 3 && rx_ant == 3)
+		ath5k_hw_set_antenna_mode(sc->ah, AR5K_ANTMODE_DEFAULT);
+	else
+		return -EOPNOTSUPP;
+	return 0;
+}
+
+static int ath5k_get_antenna(struct ieee80211_hw *hw, u8 *tx_ant, u8 *rx_ant)
+{
+	struct ath5k_softc *sc = hw->priv;
+
+	switch (sc->ah->ah_ant_mode) {
+	case AR5K_ANTMODE_FIXED_A:
+		*tx_ant = 1; *rx_ant = 1; break;
+	case AR5K_ANTMODE_FIXED_B:
+		*tx_ant = 2; *rx_ant = 2; break;
+	case AR5K_ANTMODE_DEFAULT:
+		*tx_ant = 3; *rx_ant = 3; break;
+	}
+	return 0;
+}


^ permalink raw reply related

* [RFC PATCH 1/2] mac80211: Add nl80211 antenna configuration
From: Bruno Randolf @ 2010-05-11  8:39 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless, holgerschurig
In-Reply-To: <20100511083121.28289.96180.stgit@tt-desk>

Allow setting TX and RX antenna configuration via nl80211/cfg80211.

The antenna configuration is defined as a bitmap of allowed antennas. This
bitmap is 8 bit at the moment, each bit representing one antenna. If multiple
antennas are selected, the driver may use diversity for receive and transmit.
This allows for a simple, yet flexible configuration interface for antennas,
while drivers may reject configurations they cannot support.

Signed-off-by: Bruno Randolf <br1@einfach.org>
---
 include/linux/nl80211.h   |   12 +++++
 include/net/cfg80211.h    |    3 +
 include/net/mac80211.h    |    2 +
 net/mac80211/cfg.c        |   16 ++++++
 net/mac80211/driver-ops.h |   21 ++++++++
 net/wireless/nl80211.c    |  114 +++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 168 insertions(+), 0 deletions(-)

diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index b7c77f9..46a2c76 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -341,6 +341,9 @@
  *	of any other interfaces, and other interfaces will again take
  *	precedence when they are used.
  *
+ * @NL80211_CMD_SET_ANTENNA: Set a bitmap of antennas to use.
+ * @NL80211_CMD_GET_ANTENNA: Get antenna configuration from driver.
+ *
  * @NL80211_CMD_MAX: highest used command number
  * @__NL80211_CMD_AFTER_LAST: internal use
  */
@@ -441,6 +444,9 @@ enum nl80211_commands {
 
 	NL80211_CMD_SET_CHANNEL,
 
+	NL80211_CMD_SET_ANTENNA,
+	NL80211_CMD_GET_ANTENNA,
+
 	/* add new commands above here */
 
 	/* used to define NL80211_CMD_MAX below */
@@ -725,6 +731,9 @@ enum nl80211_commands {
  * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations
  *	connected to this BSS.
  *
+ * @NL80211_ATTR_ANTENNA_TX: Bitmap of antennas to use for transmitting.
+ * @NL80211_ATTR_ANTENNA_RX: Bitmap of antennas to use for receiving.
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -882,6 +891,9 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_AP_ISOLATE,
 
+	NL80211_ATTR_ANTENNA_TX,
+	NL80211_ATTR_ANTENNA_RX,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index b44a2e5..8861f40 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1176,6 +1176,9 @@ struct cfg80211_ops {
 	int	(*set_cqm_rssi_config)(struct wiphy *wiphy,
 				       struct net_device *dev,
 				       s32 rssi_thold, u32 rssi_hyst);
+
+	int	(*set_antenna)(struct wiphy *wiphy, u8 tx_ant, u8 rx_ant);
+	int	(*get_antenna)(struct wiphy *wiphy, u8 *tx_ant, u8 *rx_ant);
 };
 
 /*
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 9448a5b..1a8f97a 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1694,6 +1694,8 @@ struct ieee80211_ops {
 	int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len);
 #endif
 	void (*flush)(struct ieee80211_hw *hw, bool drop);
+	int (*set_antenna)(struct ieee80211_hw *hw, u8 tx_ant, u8 rx_ant);
+	int (*get_antenna)(struct ieee80211_hw *hw, u8 *tx_ant, u8 *rx_ant);
 };
 
 /**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index c7000a6..efd04bc 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1560,6 +1560,20 @@ static int ieee80211_action(struct wiphy *wiphy, struct net_device *dev,
 				    channel_type, buf, len, cookie);
 }
 
+static int ieee80211_set_antenna(struct wiphy *wiphy, u8 tx_ant, u8 rx_ant)
+{
+	struct ieee80211_local *local = wiphy_priv(wiphy);
+
+	return drv_set_antenna(local, tx_ant, rx_ant);
+}
+
+static int ieee80211_get_antenna(struct wiphy *wiphy, u8 *tx_ant, u8 *rx_ant)
+{
+	struct ieee80211_local *local = wiphy_priv(wiphy);
+
+	return drv_get_antenna(local, tx_ant, rx_ant);
+}
+
 struct cfg80211_ops mac80211_config_ops = {
 	.add_virtual_intf = ieee80211_add_iface,
 	.del_virtual_intf = ieee80211_del_iface,
@@ -1611,4 +1625,6 @@ struct cfg80211_ops mac80211_config_ops = {
 	.cancel_remain_on_channel = ieee80211_cancel_remain_on_channel,
 	.action = ieee80211_action,
 	.set_cqm_rssi_config = ieee80211_set_cqm_rssi_config,
+	.set_antenna = ieee80211_set_antenna,
+	.get_antenna = ieee80211_get_antenna,
 };
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 997008e..d6fe1b7 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -373,4 +373,25 @@ static inline void drv_flush(struct ieee80211_local *local, bool drop)
 	if (local->ops->flush)
 		local->ops->flush(&local->hw, drop);
 }
+
+static inline int drv_set_antenna(struct ieee80211_local *local,
+				  u8 tx_ant, u8 rx_ant)
+{
+	int ret = -EOPNOTSUPP;
+	might_sleep();
+	if (local->ops->set_antenna)
+		ret = local->ops->set_antenna(&local->hw, tx_ant, rx_ant);
+	return ret;
+}
+
+static inline int drv_get_antenna(struct ieee80211_local *local,
+				  u8 *tx_ant, u8 *rx_ant)
+{
+	int ret = -EOPNOTSUPP;
+	might_sleep();
+	if (local->ops->get_antenna)
+		ret = local->ops->get_antenna(&local->hw, tx_ant, rx_ant);
+	return ret;
+}
+
 #endif /* __MAC80211_DRIVER_OPS */
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index aaa1aad..dbfc126 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -153,6 +153,8 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
 	[NL80211_ATTR_CQM] = { .type = NLA_NESTED, },
 	[NL80211_ATTR_LOCAL_STATE_CHANGE] = { .type = NLA_FLAG },
 	[NL80211_ATTR_AP_ISOLATE] = { .type = NLA_U8 },
+	[NL80211_ATTR_ANTENNA_TX] = { .type = NLA_U8 },
+	[NL80211_ATTR_ANTENNA_RX] = { .type = NLA_U8 },
 };
 
 /* policy for the attributes */
@@ -4963,6 +4965,106 @@ out:
 	return err;
 }
 
+static int nl80211_set_antenna(struct sk_buff *skb, struct genl_info *info)
+{
+	struct cfg80211_registered_device *rdev;
+	int res;
+	u8 rx_ant = 0, tx_ant = 0;
+
+	if (!info->attrs[NL80211_ATTR_WIPHY] ||
+	    !info->attrs[NL80211_ATTR_ANTENNA_TX] ||
+	    !info->attrs[NL80211_ATTR_ANTENNA_RX]) {
+		return -EINVAL;
+	}
+
+	tx_ant = nla_get_u8(info->attrs[NL80211_ATTR_ANTENNA_TX]);
+	rx_ant = nla_get_u8(info->attrs[NL80211_ATTR_ANTENNA_RX]);
+
+	rtnl_lock();
+
+	rdev = cfg80211_get_dev_from_info(info);
+	if (IS_ERR(rdev)) {
+		res = -ENODEV;
+		goto unlock_rtnl;
+	}
+
+	if (!rdev->ops->set_antenna) {
+		res = -EOPNOTSUPP;
+		goto unlock_rdev;
+	}
+
+	res = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant);
+
+ unlock_rdev:
+	cfg80211_unlock_rdev(rdev);
+
+ unlock_rtnl:
+	rtnl_unlock();
+	return res;
+}
+
+static int nl80211_get_antenna(struct sk_buff *skb, struct genl_info *info)
+{
+	struct cfg80211_registered_device *rdev;
+	struct sk_buff *msg;
+	void *hdr;
+	int res;
+	u8 tx_ant, rx_ant;
+
+	if (!info->attrs[NL80211_ATTR_WIPHY])
+		return -EINVAL;
+
+	rtnl_lock();
+
+	rdev = cfg80211_get_dev_from_info(info);
+	if (IS_ERR(rdev)) {
+		res = -ENODEV;
+		goto unlock_rtnl;
+	}
+
+	if (!rdev->ops->get_antenna) {
+		res = -EOPNOTSUPP;
+		goto unlock_rdev;
+	}
+
+	msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+	if (!msg) {
+		res = -ENOMEM;
+		goto unlock_rdev;
+	}
+
+	hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0,
+			     NL80211_CMD_GET_ANTENNA);
+	if (!hdr) {
+		res = -ENOMEM;
+		goto free_msg;
+	}
+
+	res = rdev->ops->get_antenna(&rdev->wiphy, &tx_ant, &rx_ant);
+	if (res)
+		goto free_msg;
+
+	NLA_PUT_U32(msg, NL80211_ATTR_ANTENNA_TX, tx_ant);
+	NLA_PUT_U32(msg, NL80211_ATTR_ANTENNA_RX, rx_ant);
+
+	genlmsg_end(msg, hdr);
+	res = genlmsg_reply(msg, info);
+	goto unlock_rdev;
+
+ nla_put_failure:
+	res = -ENOBUFS;
+
+ free_msg:
+	nlmsg_free(msg);
+
+ unlock_rdev:
+	cfg80211_unlock_rdev(rdev);
+
+ unlock_rtnl:
+	rtnl_unlock();
+	return res;
+}
+
 static struct genl_ops nl80211_ops[] = {
 	{
 		.cmd = NL80211_CMD_GET_WIPHY,
@@ -5279,6 +5381,18 @@ static struct genl_ops nl80211_ops[] = {
 		.policy = nl80211_policy,
 		.flags = GENL_ADMIN_PERM,
 	},
+	{
+		.cmd = NL80211_CMD_SET_ANTENNA,
+		.doit = nl80211_set_antenna,
+		.policy = nl80211_policy,
+		.flags = GENL_ADMIN_PERM,
+	},
+	{
+		.cmd = NL80211_CMD_GET_ANTENNA,
+		.doit = nl80211_get_antenna,
+		.policy = nl80211_policy,
+		/* can be retrieved by unprivileged users */
+	},
 };
 
 static struct genl_multicast_group nl80211_mlme_mcgrp = {


^ permalink raw reply related

* [RFC PATCH 0/2] mac80211: antenna configuration
From: Bruno Randolf @ 2010-05-11  8:38 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless, holgerschurig

hi!

this adds antenna configuration via nl80211. patches for iw will follow
shortly.

i have followed holger schurig's suggestion to use a bitmap for allowed
antennas. when multiple antennas are selected in the bitmap, the driver may use
diversity. i think that this allows for the most flexible, yet simple
configuration of antennas, and drivers can just reject configurations they
cannot support. i hope that this will also be generic enough for 802.11n with
multiple antennas - but for the moment i think the most important use case is
that we sometimes know that only one antenna is available and we want to
disable diversity and use only one fixed antenna. at least for ath5k this is
sometimes necessary to get good results with only one antenna.

please check it out and let me know what you think,
bruno

---

Bruno Randolf (2):
      mac80211: Add nl80211 antenna configuration
      ath5k: Add support for cfg80211 antenna setting


 drivers/net/wireless/ath/ath5k/base.c |   34 ++++++++++
 include/linux/nl80211.h               |   12 +++
 include/net/cfg80211.h                |    3 +
 include/net/mac80211.h                |    2 +
 net/mac80211/cfg.c                    |   16 +++++
 net/mac80211/driver-ops.h             |   21 ++++++
 net/wireless/nl80211.c                |  114 +++++++++++++++++++++++++++++++++
 7 files changed, 202 insertions(+), 0 deletions(-)

-- 
Signature

^ permalink raw reply

* Re: pull request: wireless-2.6 2010-05-10
From: David Miller @ 2010-05-11  5:54 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20100510174329.GC11681@tuxdriver.com>

From: "John W. Linville" <linville@tuxdriver.com>
Date: Mon, 10 May 2010 13:43:29 -0400

> Here are three more candidates for 2.6.34.  I hesitated to push them,
> but at least two of them are documented regressions and the other (i.e.
> "iwlwifi: work around passive scan issue") avoids some rather annoying
> firmware restarts at little or no risk.  I think it would be good to
> take these now rather than later.
> 
> Please let me know if there are problems!

Pulled, thanks John.

^ permalink raw reply

* [patch 2/9] ath9k: range checking issues in htc_hst.c
From: Sujith.Manoharan @ 2010-05-11  5:50 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Luis Rodriguez, Jouni Malinen, Vasanth Thiagarajan,
	Senthilkumar Balasubramanian, John W. Linville, Ming Lei,
	linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org
In-Reply-To: <20100508162201.GN27064@bicker>

Dan Carpenter wrote:
> The original code had ENDPOINT_MAX and HST_ENDPOINT_MAX switched.
> 
> Also the first loop was off by one, it started past the end of the array
> and went down to 1 instead of going down to 0.  The test at the end of
> the loop to see if we exited via a break wasn't right because
> "tmp_endpoint" is always non-null here.

This is a very good catch and fixes a stack corruption issue.
Do you mind if I work upon this patch and send out an updated fix ?

Sujith

^ permalink raw reply

* Re: [patch 9/9] wl1271: remove some unneeded code
From: Luciano Coelho @ 2010-05-11  4:28 UTC (permalink / raw)
  To: ext Dan Carpenter
  Cc: John W. Linville, Oikarinen Juuso (Nokia-D/Tampere),
	Paasikivi Teemu.3 (EXT-Ixonos/Tampere), Kalle Valo,
	linux-wireless@vger.kernel.org
In-Reply-To: <20100508162638.GU27064@bicker>

On Sat, 2010-05-08 at 18:26 +0200, ext Dan Carpenter wrote:
> The goto and the break are equivelent.  I removed the goto in memory of
> Edsger Dijkstra who famously hated gotos and who would have been eighty
> years old next Tuesday.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
> index 55aa813..da40cee 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_main.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_main.c
> @@ -1563,8 +1563,6 @@ static int wl1271_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
>  	default:
>  		wl1271_error("Unsupported key cmd 0x%x", cmd);
>  		ret = -EOPNOTSUPP;
> -		goto out_sleep;
> -
>  		break;
>  	}

We use goto out_* in error cases throughout our code (sorry Edsger!) and
in many cases they are not needed because they're the last check in the
function, but we still use them for consistency.

In this case, there are two "consistency" items conflicting with each
other (ie. the "break" in the last case entry is not needed, but it's
there for consistency).  Your change indeed makes the code look cleaner,
so I think the "keep-the-break-in-the-default-case" rule should win
here. ;)

Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
 


-- 
Cheers,
Luca.



^ permalink raw reply

* Re: [patch 8/9] wl1271: fix notifier interface supported test
From: Luciano Coelho @ 2010-05-11  4:27 UTC (permalink / raw)
  To: ext Dan Carpenter
  Cc: John W. Linville, Oikarinen Juuso (Nokia-D/Tampere),
	Paasikivi Teemu.3 (EXT-Ixonos/Tampere), Kalle Valo,
	linux-wireless@vger.kernel.org
In-Reply-To: <20100508162551.GT27064@bicker>

On Sat, 2010-05-08 at 18:25 +0200, ext Dan Carpenter wrote:
> The "(wl == NULL)" test doesn't work here because "wl" is always
> non-null.  The intent of the code is to return if the interface
> was not supported by the driver.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
> index b61cd10..55aa813 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_main.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_main.c
> @@ -852,7 +852,7 @@ static int wl1271_dev_notify(struct notifier_block *me, unsigned long what,
>  		if (wl == wl_temp)
>  			break;
>  	}
> -	if (wl == NULL)
> +	if (wl != wl_temp)
>  		return NOTIFY_DONE;
>  
>  	/* Get the interface IP address for the device. "ifa" will become

Thanks for the fix.

Acked-by: Luciano Coelho <luciano.coelho@nokia.com>


-- 
Cheers,
Luca.



^ permalink raw reply

* Re: [patch 7/9] wl1271: add missing spin_lock()
From: Luciano Coelho @ 2010-05-11  4:27 UTC (permalink / raw)
  To: ext Dan Carpenter
  Cc: John W. Linville, Oikarinen Juuso (Nokia-D/Tampere),
	Paasikivi Teemu.3 (EXT-Ixonos/Tampere), Kalle Valo,
	linux-wireless@vger.kernel.org
In-Reply-To: <20100508162517.GS27064@bicker>

On Sat, 2010-05-08 at 18:25 +0200, ext Dan Carpenter wrote:
> We should start the loop consistently with the "wl_lock" lock held.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
> index 3e4b9fb..b61cd10 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_main.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_main.c
> @@ -466,6 +466,7 @@ static void wl1271_irq_work(struct work_struct *work)
>  		intr = le32_to_cpu(wl->fw_status->intr);
>  		if (!intr) {
>  			wl1271_debug(DEBUG_IRQ, "Zero interrupt received.");
> +			spin_lock_irqsave(&wl->wl_lock, flags);
>  			continue;
>  		}
>  

Good catch.  Thank you.

Acked-by: Luciano Coelho <luciano.coelho@nokia.com>


-- 
Cheers,
Luca.



^ permalink raw reply

* [PATCH 2/2] ath9k: Remove unused rx_edma in ath_rx_addbuffer_edma()
From: Vasanthakumar Thiagarajan @ 2010-05-11  2:41 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless
In-Reply-To: <1273545695-2987-1-git-send-email-vasanth@atheros.com>

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
 drivers/net/wireless/ath/ath9k/recv.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index da54ff5..ba13913 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -150,11 +150,9 @@ static bool ath_rx_edma_buf_link(struct ath_softc *sc,
 static void ath_rx_addbuffer_edma(struct ath_softc *sc,
 				  enum ath9k_rx_qtype qtype, int size)
 {
-	struct ath_rx_edma *rx_edma;
 	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
 	u32 nbuf = 0;
 
-	rx_edma = &sc->rx.rx_edma[qtype];
 	if (list_empty(&sc->rx.rxbuf)) {
 		ath_print(common, ATH_DBG_QUEUE, "No free rx buf available\n");
 		return;
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 1/2] ath9k: Fix bug in handling rx frames with invalid descriptor content
From: Vasanthakumar Thiagarajan @ 2010-05-11  2:41 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless

Don't send them for further processing.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
 drivers/net/wireless/ath/ath9k/recv.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index ac60c4e..da54ff5 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -718,6 +718,7 @@ static bool ath_edma_get_buffers(struct ath_softc *sc,
 		__skb_unlink(skb, &rx_edma->rx_fifo);
 		list_add_tail(&bf->list, &sc->rx.rxbuf);
 		ath_rx_edma_buf_link(sc, qtype);
+		return true;
 	}
 	skb_queue_tail(&rx_edma->rx_buffers, skb);
 
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH] ath9k_hw: new initialization values for AR9003
From: Luis R. Rodriguez @ 2010-05-11  1:42 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Luis R. Rodriguez, Don Breslin

These changes include:

  * For PAPRD, the TXRF3.capdiv5G, TXRF3.rdiv5G and TXRF3.rdiv2G
    are set to 0x0, the TXRF6.capdiv2G is set to 0x2 for all
    three chains.
  * The d2cas5G/d3cas5G/d4cas5G was updated to 4/4/4 in lowest_ob_db
    Tx gain table.
  * To improve DPPM, three parameters were updated (Released from Madhan):
	1. RANGE_OSDAC is set to 0x1 for 2G, 0x0 for 5G
	2. offsetC1 is set to 0xc
	3. inv_clk320_adc is set to 0x1
  * To reduce PHY error(from spur), cycpwr_thr1 and cycpwr_thr1_ext
    are increased to 0x8 at 2G.
  * The 2G Rx gain tables are updated with mixer gain setting 3,1,0.

The new checksums yield:

initvals -f ar9003
0x00000000c2bfa7d5        ar9300_2p0_radio_postamble
0x00000000ada2b114        ar9300Modes_lowest_ob_db_tx_gain_table_2p0
0x00000000e0bc2c84        ar9300Modes_fast_clock_2p0
0x00000000056eaf74        ar9300_2p0_radio_core
0x0000000000000000        ar9300Common_rx_gain_table_merlin_2p0
0x0000000078658fb5        ar9300_2p0_mac_postamble
0x0000000023235333        ar9300_2p0_soc_postamble
0x0000000054d41904        ar9200_merlin_2p0_radio_core
0x00000000748572cf        ar9300_2p0_baseband_postamble
0x000000009aa5a0a4        ar9300_2p0_baseband_core
0x000000003df9a326        ar9300Modes_high_power_tx_gain_table_2p0
0x000000001cfba124        ar9300Modes_high_ob_db_tx_gain_table_2p0
0x0000000011302700        ar9300Common_rx_gain_table_2p0
0x00000000e3eab114        ar9300Modes_low_ob_db_tx_gain_table_2p0
0x00000000c9d66d40        ar9300_2p0_mac_core
0x000000001e1d0800        ar9300Common_wo_xlna_rx_gain_table_2p0
0x00000000a0c54980        ar9300_2p0_soc_preamble
0x00000000292e2544        ar9300PciePhy_pll_on_clkreq_disable_L1_2p0
0x000000002d3e2544        ar9300PciePhy_clkreq_enable_L1_2p0
0x00000000293e2544        ar9300PciePhy_clkreq_disable_L1_2p0

Cc: Don Breslin <don.breslin@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath/ath9k/ar9003_initvals.h |  268 +++++++++++-----------
 1 files changed, 134 insertions(+), 134 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_initvals.h b/drivers/net/wireless/ath/ath9k/ar9003_initvals.h
index ef6116e..db019dd 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_initvals.h
@@ -25,8 +25,11 @@ static const u32 ar9300_2p0_radio_postamble[][5] = {
 	{0x000160ac, 0xa4653c00, 0xa4653c00, 0x24652800, 0x24652800},
 	{0x000160b0, 0x03284f3e, 0x03284f3e, 0x05d08f20, 0x05d08f20},
 	{0x0001610c, 0x08000000, 0x00000000, 0x00000000, 0x00000000},
+	{0x00016140, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
 	{0x0001650c, 0x08000000, 0x00000000, 0x00000000, 0x00000000},
+	{0x00016540, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
 	{0x0001690c, 0x08000000, 0x00000000, 0x00000000, 0x00000000},
+	{0x00016940, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
 };
 
 static const u32 ar9300Modes_lowest_ob_db_tx_gain_table_2p0[][5] = {
@@ -97,13 +100,13 @@ static const u32 ar9300Modes_lowest_ob_db_tx_gain_table_2p0[][5] = {
 	{0x0000a5f8, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec},
 	{0x0000a5fc, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec},
 	{0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
-	{0x00016048, 0x60001a61, 0x60001a61, 0x60001a61, 0x60001a61},
+	{0x00016048, 0x62480001, 0x62480001, 0x62480001, 0x62480001},
 	{0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
 	{0x00016444, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
-	{0x00016448, 0x60001a61, 0x60001a61, 0x60001a61, 0x60001a61},
+	{0x00016448, 0x62480001, 0x62480001, 0x62480001, 0x62480001},
 	{0x00016468, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
 	{0x00016844, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
-	{0x00016848, 0x60001a61, 0x60001a61, 0x60001a61, 0x60001a61},
+	{0x00016848, 0x62480001, 0x62480001, 0x62480001, 0x62480001},
 	{0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
 };
 
@@ -129,7 +132,7 @@ static const u32 ar9300_2p0_radio_core[][2] = {
 	{0x00016040, 0x7f80fff8},
 	{0x0001604c, 0x76d005b5},
 	{0x00016050, 0x556cf031},
-	{0x00016054, 0x43449440},
+	{0x00016054, 0x13449440},
 	{0x00016058, 0x0c51c92c},
 	{0x0001605c, 0x3db7fffc},
 	{0x00016060, 0xfffffffc},
@@ -152,12 +155,11 @@ static const u32 ar9300_2p0_radio_core[][2] = {
 	{0x00016100, 0x3fffbe01},
 	{0x00016104, 0xfff80000},
 	{0x00016108, 0x00080010},
-	{0x00016140, 0x10804008},
 	{0x00016144, 0x02084080},
 	{0x00016148, 0x00000000},
 	{0x00016280, 0x058a0001},
 	{0x00016284, 0x3d840208},
-	{0x00016288, 0x01a20408},
+	{0x00016288, 0x05a20408},
 	{0x0001628c, 0x00038c07},
 	{0x00016290, 0x40000004},
 	{0x00016294, 0x458aa14f},
@@ -190,7 +192,7 @@ static const u32 ar9300_2p0_radio_core[][2] = {
 	{0x00016440, 0x7f80fff8},
 	{0x0001644c, 0x76d005b5},
 	{0x00016450, 0x556cf031},
-	{0x00016454, 0x43449440},
+	{0x00016454, 0x13449440},
 	{0x00016458, 0x0c51c92c},
 	{0x0001645c, 0x3db7fffc},
 	{0x00016460, 0xfffffffc},
@@ -199,7 +201,6 @@ static const u32 ar9300_2p0_radio_core[][2] = {
 	{0x00016500, 0x3fffbe01},
 	{0x00016504, 0xfff80000},
 	{0x00016508, 0x00080010},
-	{0x00016540, 0x10804008},
 	{0x00016544, 0x02084080},
 	{0x00016548, 0x00000000},
 	{0x00016780, 0x00000000},
@@ -231,7 +232,7 @@ static const u32 ar9300_2p0_radio_core[][2] = {
 	{0x00016840, 0x7f80fff8},
 	{0x0001684c, 0x76d005b5},
 	{0x00016850, 0x556cf031},
-	{0x00016854, 0x43449440},
+	{0x00016854, 0x13449440},
 	{0x00016858, 0x0c51c92c},
 	{0x0001685c, 0x3db7fffc},
 	{0x00016860, 0xfffffffc},
@@ -240,7 +241,6 @@ static const u32 ar9300_2p0_radio_core[][2] = {
 	{0x00016900, 0x3fffbe01},
 	{0x00016904, 0xfff80000},
 	{0x00016908, 0x00080010},
-	{0x00016940, 0x10804008},
 	{0x00016944, 0x02084080},
 	{0x00016948, 0x00000000},
 	{0x00016b80, 0x00000000},
@@ -588,12 +588,12 @@ static const u32 ar9200_merlin_2p0_radio_core[][2] = {
 
 static const u32 ar9300_2p0_baseband_postamble[][5] = {
 	/* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
-	{0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8005, 0xd00a800b},
+	{0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a8011},
 	{0x00009820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a012e},
 	{0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
 	{0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x06903881},
 	{0x0000982c, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4},
-	{0x00009830, 0x0000059c, 0x0000059c, 0x0000059c, 0x00000b9c},
+	{0x00009830, 0x0000059c, 0x0000059c, 0x0000119c, 0x0000119c},
 	{0x00009c00, 0x00000044, 0x000000c4, 0x000000c4, 0x00000044},
 	{0x00009e00, 0x0372161e, 0x0372161e, 0x037216a0, 0x037216a0},
 	{0x00009e04, 0x00802020, 0x00802020, 0x00802020, 0x00802020},
@@ -604,8 +604,8 @@ static const u32 ar9300_2p0_baseband_postamble[][5] = {
 	{0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
 	{0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce},
 	{0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021},
-	{0x00009e44, 0x02321e27, 0x02321e27, 0x02282324, 0x02282324},
-	{0x00009e48, 0x5030201a, 0x5030201a, 0x50302010, 0x50302010},
+	{0x00009e44, 0x02321e27, 0x02321e27, 0x02291e27, 0x02291e27},
+	{0x00009e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012},
 	{0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
 	{0x0000a204, 0x000037c0, 0x000037c4, 0x000037c4, 0x000037c0},
 	{0x0000a208, 0x00000104, 0x00000104, 0x00000004, 0x00000004},
@@ -674,7 +674,7 @@ static const u32 ar9300_2p0_baseband_core[][2] = {
 	{0x00009d10, 0x01834061},
 	{0x00009d14, 0x00c0040b},
 	{0x00009d18, 0x00000000},
-	{0x00009e08, 0x0038233c},
+	{0x00009e08, 0x0038230c},
 	{0x00009e24, 0x990bb515},
 	{0x00009e28, 0x0c6f0000},
 	{0x00009e30, 0x06336f77},
@@ -901,13 +901,13 @@ static const u32 ar9300Modes_high_power_tx_gain_table_2p0[][5] = {
 	{0x0000a5f8, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec},
 	{0x0000a5fc, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec},
 	{0x00016044, 0x056db2e6, 0x056db2e6, 0x056db2e6, 0x056db2e6},
-	{0x00016048, 0xae481a61, 0xae481a61, 0xae481a61, 0xae481a61},
+	{0x00016048, 0xae480001, 0xae480001, 0xae480001, 0xae480001},
 	{0x00016068, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c},
 	{0x00016444, 0x056db2e6, 0x056db2e6, 0x056db2e6, 0x056db2e6},
-	{0x00016448, 0xae481a61, 0xae481a61, 0xae481a61, 0xae481a61},
+	{0x00016448, 0xae480001, 0xae480001, 0xae480001, 0xae480001},
 	{0x00016468, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c},
 	{0x00016844, 0x056db2e6, 0x056db2e6, 0x056db2e6, 0x056db2e6},
-	{0x00016848, 0xae481a61, 0xae481a61, 0xae481a61, 0xae481a61},
+	{0x00016848, 0xae480001, 0xae480001, 0xae480001, 0xae480001},
 	{0x00016868, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c},
 };
 
@@ -979,13 +979,13 @@ static const u32 ar9300Modes_high_ob_db_tx_gain_table_2p0[][5] = {
 	{0x0000a5f8, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec},
 	{0x0000a5fc, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec},
 	{0x00016044, 0x056db2e4, 0x056db2e4, 0x056db2e4, 0x056db2e4},
-	{0x00016048, 0x8e481a61, 0x8e481a61, 0x8e481a61, 0x8e481a61},
+	{0x00016048, 0x8e480001, 0x8e480001, 0x8e480001, 0x8e480001},
 	{0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
 	{0x00016444, 0x056db2e4, 0x056db2e4, 0x056db2e4, 0x056db2e4},
-	{0x00016448, 0x8e481a61, 0x8e481a61, 0x8e481a61, 0x8e481a61},
+	{0x00016448, 0x8e480001, 0x8e480001, 0x8e480001, 0x8e480001},
 	{0x00016468, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
 	{0x00016844, 0x056db2e4, 0x056db2e4, 0x056db2e4, 0x056db2e4},
-	{0x00016848, 0x8e481a61, 0x8e481a61, 0x8e481a61, 0x8e481a61},
+	{0x00016848, 0x8e480001, 0x8e480001, 0x8e480001, 0x8e480001},
 	{0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
 };
 
@@ -995,22 +995,22 @@ static const u32 ar9300Common_rx_gain_table_2p0[][2] = {
 	{0x0000a004, 0x00030002},
 	{0x0000a008, 0x00050004},
 	{0x0000a00c, 0x00810080},
-	{0x0000a010, 0x01800082},
-	{0x0000a014, 0x01820181},
-	{0x0000a018, 0x01840183},
-	{0x0000a01c, 0x01880185},
-	{0x0000a020, 0x018a0189},
-	{0x0000a024, 0x02850284},
-	{0x0000a028, 0x02890288},
-	{0x0000a02c, 0x028b028a},
-	{0x0000a030, 0x028d028c},
-	{0x0000a034, 0x02910290},
-	{0x0000a038, 0x02930292},
-	{0x0000a03c, 0x03910390},
-	{0x0000a040, 0x03930392},
-	{0x0000a044, 0x03950394},
-	{0x0000a048, 0x00000396},
-	{0x0000a04c, 0x00000000},
+	{0x0000a010, 0x00830082},
+	{0x0000a014, 0x01810180},
+	{0x0000a018, 0x01830182},
+	{0x0000a01c, 0x01850184},
+	{0x0000a020, 0x01890188},
+	{0x0000a024, 0x018b018a},
+	{0x0000a028, 0x018d018c},
+	{0x0000a02c, 0x01910190},
+	{0x0000a030, 0x01930192},
+	{0x0000a034, 0x01950194},
+	{0x0000a038, 0x038a0196},
+	{0x0000a03c, 0x038c038b},
+	{0x0000a040, 0x0390038d},
+	{0x0000a044, 0x03920391},
+	{0x0000a048, 0x03940393},
+	{0x0000a04c, 0x03960395},
 	{0x0000a050, 0x00000000},
 	{0x0000a054, 0x00000000},
 	{0x0000a058, 0x00000000},
@@ -1023,14 +1023,14 @@ static const u32 ar9300Common_rx_gain_table_2p0[][2] = {
 	{0x0000a074, 0x00000000},
 	{0x0000a078, 0x00000000},
 	{0x0000a07c, 0x00000000},
-	{0x0000a080, 0x28282828},
-	{0x0000a084, 0x21212128},
-	{0x0000a088, 0x21212121},
-	{0x0000a08c, 0x1c1c1c21},
-	{0x0000a090, 0x1c1c1c1c},
-	{0x0000a094, 0x17171c1c},
-	{0x0000a098, 0x02020212},
-	{0x0000a09c, 0x02020202},
+	{0x0000a080, 0x22222229},
+	{0x0000a084, 0x1d1d1d1d},
+	{0x0000a088, 0x1d1d1d1d},
+	{0x0000a08c, 0x1d1d1d1d},
+	{0x0000a090, 0x171d1d1d},
+	{0x0000a094, 0x11111717},
+	{0x0000a098, 0x00030311},
+	{0x0000a09c, 0x00000000},
 	{0x0000a0a0, 0x00000000},
 	{0x0000a0a4, 0x00000000},
 	{0x0000a0a8, 0x00000000},
@@ -1040,26 +1040,26 @@ static const u32 ar9300Common_rx_gain_table_2p0[][2] = {
 	{0x0000a0b8, 0x00000000},
 	{0x0000a0bc, 0x00000000},
 	{0x0000a0c0, 0x001f0000},
-	{0x0000a0c4, 0x011f0100},
-	{0x0000a0c8, 0x011d011e},
-	{0x0000a0cc, 0x011b011c},
+	{0x0000a0c4, 0x01000101},
+	{0x0000a0c8, 0x011e011f},
+	{0x0000a0cc, 0x011c011d},
 	{0x0000a0d0, 0x02030204},
 	{0x0000a0d4, 0x02010202},
 	{0x0000a0d8, 0x021f0200},
-	{0x0000a0dc, 0x021d021e},
-	{0x0000a0e0, 0x03010302},
-	{0x0000a0e4, 0x031f0300},
-	{0x0000a0e8, 0x0402031e},
+	{0x0000a0dc, 0x0302021e},
+	{0x0000a0e0, 0x03000301},
+	{0x0000a0e4, 0x031e031f},
+	{0x0000a0e8, 0x0402031d},
 	{0x0000a0ec, 0x04000401},
 	{0x0000a0f0, 0x041e041f},
-	{0x0000a0f4, 0x05010502},
-	{0x0000a0f8, 0x051f0500},
-	{0x0000a0fc, 0x0602051e},
-	{0x0000a100, 0x06000601},
-	{0x0000a104, 0x061e061f},
-	{0x0000a108, 0x0703061d},
-	{0x0000a10c, 0x07010702},
-	{0x0000a110, 0x00000700},
+	{0x0000a0f4, 0x0502041d},
+	{0x0000a0f8, 0x05000501},
+	{0x0000a0fc, 0x051e051f},
+	{0x0000a100, 0x06010602},
+	{0x0000a104, 0x061f0600},
+	{0x0000a108, 0x061d061e},
+	{0x0000a10c, 0x07020703},
+	{0x0000a110, 0x07000701},
 	{0x0000a114, 0x00000000},
 	{0x0000a118, 0x00000000},
 	{0x0000a11c, 0x00000000},
@@ -1072,26 +1072,26 @@ static const u32 ar9300Common_rx_gain_table_2p0[][2] = {
 	{0x0000a138, 0x00000000},
 	{0x0000a13c, 0x00000000},
 	{0x0000a140, 0x001f0000},
-	{0x0000a144, 0x011f0100},
-	{0x0000a148, 0x011d011e},
-	{0x0000a14c, 0x011b011c},
+	{0x0000a144, 0x01000101},
+	{0x0000a148, 0x011e011f},
+	{0x0000a14c, 0x011c011d},
 	{0x0000a150, 0x02030204},
 	{0x0000a154, 0x02010202},
 	{0x0000a158, 0x021f0200},
-	{0x0000a15c, 0x021d021e},
-	{0x0000a160, 0x03010302},
-	{0x0000a164, 0x031f0300},
-	{0x0000a168, 0x0402031e},
+	{0x0000a15c, 0x0302021e},
+	{0x0000a160, 0x03000301},
+	{0x0000a164, 0x031e031f},
+	{0x0000a168, 0x0402031d},
 	{0x0000a16c, 0x04000401},
 	{0x0000a170, 0x041e041f},
-	{0x0000a174, 0x05010502},
-	{0x0000a178, 0x051f0500},
-	{0x0000a17c, 0x0602051e},
-	{0x0000a180, 0x06000601},
-	{0x0000a184, 0x061e061f},
-	{0x0000a188, 0x0703061d},
-	{0x0000a18c, 0x07010702},
-	{0x0000a190, 0x00000700},
+	{0x0000a174, 0x0502041d},
+	{0x0000a178, 0x05000501},
+	{0x0000a17c, 0x051e051f},
+	{0x0000a180, 0x06010602},
+	{0x0000a184, 0x061f0600},
+	{0x0000a188, 0x061d061e},
+	{0x0000a18c, 0x07020703},
+	{0x0000a190, 0x07000701},
 	{0x0000a194, 0x00000000},
 	{0x0000a198, 0x00000000},
 	{0x0000a19c, 0x00000000},
@@ -1317,13 +1317,13 @@ static const u32 ar9300Modes_low_ob_db_tx_gain_table_2p0[][5] = {
 	{0x0000a5f8, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec},
 	{0x0000a5fc, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec},
 	{0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
-	{0x00016048, 0x64001a61, 0x64001a61, 0x64001a61, 0x64001a61},
+	{0x00016048, 0x64000001, 0x64000001, 0x64000001, 0x64000001},
 	{0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
 	{0x00016444, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
-	{0x00016448, 0x64001a61, 0x64001a61, 0x64001a61, 0x64001a61},
+	{0x00016448, 0x64000001, 0x64000001, 0x64000001, 0x64000001},
 	{0x00016468, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
 	{0x00016844, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
-	{0x00016848, 0x64001a61, 0x64001a61, 0x64001a61, 0x64001a61},
+	{0x00016848, 0x64000001, 0x64000001, 0x64000001, 0x64000001},
 	{0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
 };
 
@@ -1497,22 +1497,22 @@ static const u32 ar9300Common_wo_xlna_rx_gain_table_2p0[][2] = {
 	{0x0000a004, 0x00030002},
 	{0x0000a008, 0x00050004},
 	{0x0000a00c, 0x00810080},
-	{0x0000a010, 0x01800082},
-	{0x0000a014, 0x01820181},
-	{0x0000a018, 0x01840183},
-	{0x0000a01c, 0x01880185},
-	{0x0000a020, 0x018a0189},
-	{0x0000a024, 0x02850284},
-	{0x0000a028, 0x02890288},
-	{0x0000a02c, 0x03850384},
-	{0x0000a030, 0x03890388},
-	{0x0000a034, 0x038b038a},
-	{0x0000a038, 0x038d038c},
-	{0x0000a03c, 0x03910390},
-	{0x0000a040, 0x03930392},
-	{0x0000a044, 0x03950394},
-	{0x0000a048, 0x00000396},
-	{0x0000a04c, 0x00000000},
+	{0x0000a010, 0x00830082},
+	{0x0000a014, 0x01810180},
+	{0x0000a018, 0x01830182},
+	{0x0000a01c, 0x01850184},
+	{0x0000a020, 0x01890188},
+	{0x0000a024, 0x018b018a},
+	{0x0000a028, 0x018d018c},
+	{0x0000a02c, 0x03820190},
+	{0x0000a030, 0x03840383},
+	{0x0000a034, 0x03880385},
+	{0x0000a038, 0x038a0389},
+	{0x0000a03c, 0x038c038b},
+	{0x0000a040, 0x0390038d},
+	{0x0000a044, 0x03920391},
+	{0x0000a048, 0x03940393},
+	{0x0000a04c, 0x03960395},
 	{0x0000a050, 0x00000000},
 	{0x0000a054, 0x00000000},
 	{0x0000a058, 0x00000000},
@@ -1525,15 +1525,15 @@ static const u32 ar9300Common_wo_xlna_rx_gain_table_2p0[][2] = {
 	{0x0000a074, 0x00000000},
 	{0x0000a078, 0x00000000},
 	{0x0000a07c, 0x00000000},
-	{0x0000a080, 0x28282828},
-	{0x0000a084, 0x28282828},
-	{0x0000a088, 0x28282828},
-	{0x0000a08c, 0x28282828},
-	{0x0000a090, 0x28282828},
-	{0x0000a094, 0x21212128},
-	{0x0000a098, 0x171c1c1c},
-	{0x0000a09c, 0x02020212},
-	{0x0000a0a0, 0x00000202},
+	{0x0000a080, 0x29292929},
+	{0x0000a084, 0x29292929},
+	{0x0000a088, 0x29292929},
+	{0x0000a08c, 0x29292929},
+	{0x0000a090, 0x22292929},
+	{0x0000a094, 0x1d1d2222},
+	{0x0000a098, 0x0c111117},
+	{0x0000a09c, 0x00030303},
+	{0x0000a0a0, 0x00000000},
 	{0x0000a0a4, 0x00000000},
 	{0x0000a0a8, 0x00000000},
 	{0x0000a0ac, 0x00000000},
@@ -1542,26 +1542,26 @@ static const u32 ar9300Common_wo_xlna_rx_gain_table_2p0[][2] = {
 	{0x0000a0b8, 0x00000000},
 	{0x0000a0bc, 0x00000000},
 	{0x0000a0c0, 0x001f0000},
-	{0x0000a0c4, 0x011f0100},
-	{0x0000a0c8, 0x011d011e},
-	{0x0000a0cc, 0x011b011c},
+	{0x0000a0c4, 0x01000101},
+	{0x0000a0c8, 0x011e011f},
+	{0x0000a0cc, 0x011c011d},
 	{0x0000a0d0, 0x02030204},
 	{0x0000a0d4, 0x02010202},
 	{0x0000a0d8, 0x021f0200},
-	{0x0000a0dc, 0x021d021e},
-	{0x0000a0e0, 0x03010302},
-	{0x0000a0e4, 0x031f0300},
-	{0x0000a0e8, 0x0402031e},
+	{0x0000a0dc, 0x0302021e},
+	{0x0000a0e0, 0x03000301},
+	{0x0000a0e4, 0x031e031f},
+	{0x0000a0e8, 0x0402031d},
 	{0x0000a0ec, 0x04000401},
 	{0x0000a0f0, 0x041e041f},
-	{0x0000a0f4, 0x05010502},
-	{0x0000a0f8, 0x051f0500},
-	{0x0000a0fc, 0x0602051e},
-	{0x0000a100, 0x06000601},
-	{0x0000a104, 0x061e061f},
-	{0x0000a108, 0x0703061d},
-	{0x0000a10c, 0x07010702},
-	{0x0000a110, 0x00000700},
+	{0x0000a0f4, 0x0502041d},
+	{0x0000a0f8, 0x05000501},
+	{0x0000a0fc, 0x051e051f},
+	{0x0000a100, 0x06010602},
+	{0x0000a104, 0x061f0600},
+	{0x0000a108, 0x061d061e},
+	{0x0000a10c, 0x07020703},
+	{0x0000a110, 0x07000701},
 	{0x0000a114, 0x00000000},
 	{0x0000a118, 0x00000000},
 	{0x0000a11c, 0x00000000},
@@ -1574,26 +1574,26 @@ static const u32 ar9300Common_wo_xlna_rx_gain_table_2p0[][2] = {
 	{0x0000a138, 0x00000000},
 	{0x0000a13c, 0x00000000},
 	{0x0000a140, 0x001f0000},
-	{0x0000a144, 0x011f0100},
-	{0x0000a148, 0x011d011e},
-	{0x0000a14c, 0x011b011c},
+	{0x0000a144, 0x01000101},
+	{0x0000a148, 0x011e011f},
+	{0x0000a14c, 0x011c011d},
 	{0x0000a150, 0x02030204},
 	{0x0000a154, 0x02010202},
 	{0x0000a158, 0x021f0200},
-	{0x0000a15c, 0x021d021e},
-	{0x0000a160, 0x03010302},
-	{0x0000a164, 0x031f0300},
-	{0x0000a168, 0x0402031e},
+	{0x0000a15c, 0x0302021e},
+	{0x0000a160, 0x03000301},
+	{0x0000a164, 0x031e031f},
+	{0x0000a168, 0x0402031d},
 	{0x0000a16c, 0x04000401},
 	{0x0000a170, 0x041e041f},
-	{0x0000a174, 0x05010502},
-	{0x0000a178, 0x051f0500},
-	{0x0000a17c, 0x0602051e},
-	{0x0000a180, 0x06000601},
-	{0x0000a184, 0x061e061f},
-	{0x0000a188, 0x0703061d},
-	{0x0000a18c, 0x07010702},
-	{0x0000a190, 0x00000700},
+	{0x0000a174, 0x0502041d},
+	{0x0000a178, 0x05000501},
+	{0x0000a17c, 0x051e051f},
+	{0x0000a180, 0x06010602},
+	{0x0000a184, 0x061f0600},
+	{0x0000a188, 0x061d061e},
+	{0x0000a18c, 0x07020703},
+	{0x0000a190, 0x07000701},
 	{0x0000a194, 0x00000000},
 	{0x0000a198, 0x00000000},
 	{0x0000a19c, 0x00000000},
@@ -1620,7 +1620,7 @@ static const u32 ar9300Common_wo_xlna_rx_gain_table_2p0[][2] = {
 	{0x0000a1f0, 0x00000396},
 	{0x0000a1f4, 0x00000396},
 	{0x0000a1f8, 0x00000396},
-	{0x0000a1fc, 0x00000296},
+	{0x0000a1fc, 0x00000196},
 	{0x0000b000, 0x00010000},
 	{0x0000b004, 0x00030002},
 	{0x0000b008, 0x00050004},
-- 
1.6.3.3


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox