History log of /drivers/net/wireless/b43/xmit.c
Revision Date Author Comments
c0624881187cd06fbcbdc177c507ab589b1b6f1e 23-Jul-2014 Rafał Miłecki <zajec5@gmail.com> b43: report correct rate to mac80211 for 5 GHz packets

So far we were assuming only A-PHY supports 5 GHz.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2fc68eb122c7ea6cd5be1fe7d6650c0beb2f4f40 12-Jun-2014 Rafał Miłecki <zajec5@gmail.com> b43: fix frequency reported on G-PHY with /new/ firmware

Support for firmware rev 508+ was added years ago, but we never noticed
it reports channel in a different way for G-PHY devices. Instead of
offset from 2400 MHz it simply passes channel id (AKA hw_value).

So far it was (most probably) affecting monitor mode users only, but
the following recent commit made it noticeable for quite everybody:

commit 3afc2167f60a327a2c1e1e2600ef209a3c2b75b7
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date: Tue Mar 4 16:50:13 2014 +0200

cfg80211/mac80211: ignore signal if the frame was heard on wrong channel

Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Cc: stable@vger.kernel.org
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
24acfc632b7ba55bbc2a9305e8df31c8e41178b6 20-May-2014 Rafał Miłecki <zajec5@gmail.com> b43: xmit: set 5 GHz bit depending on current band

PHYs other than A may also work in 5 GHz mode.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c8e4955653a470ece7bf580c84fc88eb58cc9850 25-Feb-2014 Silvan Jegen <s.jegen@gmail.com> net: Replace min macro with min_t

Instead of an explicit cast, use the min_t macro.

Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
bb6bd25c08738ace7102a550a15481e70bc31ee8 17-Jan-2014 ZHAO Gang <gamerh2o@gmail.com> b43: use kernel api to replace b43 specific helper function

Use ieee80211_channel_to_frequency() to replace b43_channel_to_freq_{2,5}ghz(),
and remove unused b43_freq_to_channel_{2,5}ghz().

Signed-off-by: ZHAO Gang <gamerh2o@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
64e5acb09ca6b50c97299cff9ef51299470b29f2 17-Jan-2014 ZHAO Gang <gamerh2o@gmail.com> b43: fix the wrong assignment of status.freq in b43_rx()

Use the right function to update frequency value.

If rx skb is probe response or beacon, the wrong frequency value can
cause problem that bss info can't be updated when it should be.

Cc: <stable@vger.kernel.org>
Fixes: 8318d78a44d4 ("cfg80211 API for channels/bitrates, mac80211
and driver conversion")
Signed-off-by: ZHAO Gang <gamerh2o@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d458cdf712e0c671e8e819abb16ecd6e44f9daec 02-Oct-2013 Joe Perches <joe@perches.com> net:drivers/net: Miscellaneous conversions to ETH_ALEN

Convert the memset/memcpy uses of 6 to ETH_ALEN
where appropriate.

Also convert some struct definitions and u8 array
declarations of [6] to ETH_ALEN.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
f4bda337bbb6e245e2a07f344990adeb6a70ff35 13-Nov-2012 Thomas Pedersen <thomas@cozybit.com> mac80211: support RX_FLAG_MACTIME_END

Allow drivers to indicate their mactime is at RX completion and adjust
for this in mac80211. Also rename the existing RX_FLAG_MACTIME_MPDU to
RX_FLAG_MACTIME_START to clarify its intent. Based on similar code by
Johannes Berg.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
[fix docs, atheros drivers]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1924b4e294df4e97ad22557700e554af409569bc 13-Jul-2012 Johannes Berg <johannes.berg@intel.com> b43: use temporary rate_index for error checking

The mac80211 rate_index changed to be a u8, so
can't hold the negative error value properly.
Use a temporary variable for error checking.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4ee73f338a528f44fd90496adfbfd9c119401850 11-Apr-2012 Michal Kazior <michal.kazior@tieto.com> mac80211: remove hw.conf.channel usage where possible

Removes hw.conf.channel usage from the following functions:
* ieee80211_mandatory_rates
* ieee80211_sta_get_rates
* ieee80211_frame_duration
* ieee80211_rts_duration
* ieee80211_ctstoself_duration

This is in preparation for multi-channel operation.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d748b4642a53cd1ead303f9e2b008295391466b7 28-Mar-2012 Johannes Berg <johannes.berg@intel.com> mac80211: remove antenna_sel_tx TX info field

This field is never set to anything non-zero in
mac80211, so we should be able to remove it.
Unfortunately though, the iwlwifi and iwlegacy
drivers use it for their internal TX status
processing (which shouldn't be using the rate
control API to start with), so add a new field
"status.antenna" for them, at least for now.

In the future, I plan to use the new field to
hold the hardware queue, while the SKB's queue
mapping holds the AC.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3db1cd5c05f35fb43eb134df6f321de4e63141f2 19-Dec-2011 Rusty Russell <rusty@rustcorp.com.au> net: fix assignment of 0/1 to bool variables.

DaveM said:
Please, this kind of stuff rots forever and not using bool properly
drives me crazy.

Joe Perches <joe@perches.com> gave me the spatch script:

@@
bool b;
@@
-b = 0
+b = false
@@
bool b;
@@
-b = 1
+b = true

I merely installed coccinelle, read the documentation and took credit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
73d51f38c736ae286372e90056a7f31519f555ac 17-Oct-2011 Rafał Miłecki <zajec5@gmail.com> b43: HT-PHY: report signal to mac80211

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
694718d8ad2f0b11d7376f8aa32b1befff6e5966 17-Oct-2011 Rafał Miłecki <zajec5@gmail.com> b43: fill ctl1 word on all newer PHYs, fix PHY errors

This fixes PHY transmission errors reported on some LP-PHY and HT-PHY
cards. For LP-PHY they were quite rare and not really noticable. On
HT-PHY they were critical, OFDM rates were not available at all.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
addc98519207fb8ca0609da720469e415f784d0c 28-Oct-2011 Larry Finger <Larry.Finger@lwfinger.net> b43: Remove unneeded message

The driver can spam the logs with "RX: Packet dropped" messages. These drops
originate from 1. a correpted PLCP, 2. decryption errors, and 3. packet
size underruns. Condition #3 logs a separate message, thus no dropped message
is needed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
207ae4a3733686df2aabd2dd6feefbde4e69cdd5 12-Oct-2011 Rafał Miłecki <zajec5@gmail.com> b43: N-PHY: report signal to mac80211

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5b346f3eb4b59e00fbaca51637f2cf1df3f47f9d 12-Oct-2011 Rafał Miłecki <zajec5@gmail.com> Revert "b43: trivial: do not report any link quality instead of invalid one"

This reverts commit 55ad5962e97430c83d51df36fc18865ee4f78c48.

I assumed N is newer than LP, which isn't true. This regressed LP case.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
55ad5962e97430c83d51df36fc18865ee4f78c48 07-Oct-2011 Rafał Miłecki <zajec5@gmail.com> b43: trivial: do not report any link quality instead of invalid one

We don't want to report random quality info (new PHYs are affected).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6a461c23e7051d090751a2030e5febf6356c8d57 12-Aug-2011 Rafał Miłecki <zajec5@gmail.com> b43: include HT-PHY in some common code

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
17030f48e31adde5b043741c91ba143f5f7db0fd 11-Aug-2011 Rafał Miłecki <zajec5@gmail.com> b43: support new RX header, noticed to be used in 598.314+ fw

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5d852905561a979dfb4d8a68f7313dcb8f055bec 11-Aug-2011 Rafał Miłecki <zajec5@gmail.com> b43: support new TX header, noticed to be used by 598.314+ fw

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
efe0249b0fd1e9a32a7e6a5dc9c751d4d97b0adf 11-Aug-2011 Rafał Miłecki <zajec5@gmail.com> b43: use enum for firmware header format

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2391b7e8d40e4b3be0756396c628d2323f2d0b8d 11-Aug-2011 Rafał Miłecki <zajec5@gmail.com> b43: rename TX header formats

Replace "old" and "new" with number of the first firmware known to use
the given format.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
523b02ea23b175dd3e46e3daf1bc9354376640a3 07-Jul-2011 Johannes Berg <johannes.berg@intel.com> mac80211: fix TKIP races, make API easier to use

Our current TKIP code races against itself on TX
since we can process multiple packets at the same
time on different ACs, but they all share the TX
context for TKIP. This can lead to bad IVs etc.

Also, the crypto offload helper code just obtains
the P1K/P2K from the cache, and can update it as
well, but there's no guarantee that packets are
really processed in order.

To fix these issues, first introduce a spinlock
that will protect the IV16/IV32 values in the TX
context. This first step makes sure that we don't
assign the same IV multiple times or get confused
in other ways.

Secondly, change the way the P1K cache works. I
add a field "p1k_iv32" that stores the value of
the IV32 when the P1K was last recomputed, and
if different from the last time, then a new P1K
is recomputed. This can cause the P1K computation
to flip back and forth if packets are processed
out of order. All this also happens under the new
spinlock.

Finally, because there are argument differences,
split up the ieee80211_get_tkip_key() API into
ieee80211_get_tkip_p1k() and ieee80211_get_tkip_p2k()
and give them the correct arguments.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
eb032b9837a958e21ca000358a5bde5e17192ddb 04-Jul-2011 Michael Büsch <m@bues.ch> Update my e-mail address

Signed-off-by: Michael Buesch <m@bues.ch>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
0581483afe1a6f90f828b36111b05a70c162137d 18-May-2011 Rafał Miłecki <zajec5@gmail.com> b43: bus: abstract SPROM

SPROM is another frequently used struct. We decided to share SPROM
struct between ssb na bcma as long as we will not need any hacks.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
dedb1eb977d75f301b17190cc4b6e7d17dbf17db 14-May-2011 Rafał Miłecki <zajec5@gmail.com> b43: rename b43_wldev's field with ssb_device to sdev

We free name "dev" for something generic (like dev abstraction layer).
Additionaly code is cleaner now, especially magic dev->dev-dev chains.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3311abbbbff1719bbbc8208761e4a75f095f383c 25-Feb-2011 Rafał Miłecki <zajec5@gmail.com> b43: fill PHY ctl word1 in TX header for N-PHY

This patch fixes tramissing on OFDM rates for PHYs 1 and 2. There is
still something wrong with PHYs 3+. Tests has shown decreasing of
performance on CCK rates by 1-2%, we have to live with that.
Additionaly this noticeably reduces amount of PHY errors. They were
mostly produced by auto-switching to higher rate for better
performanced, which resulted in no transmit at all and PHY errors.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6ebacbb79d2d05978ba50a24d8cbe2a76ff2014c 23-Feb-2011 Johannes Berg <johannes.berg@intel.com> mac80211: rename RX_FLAG_TSFT

The flag isn't very descriptive -- the intention
is that the driver provides a TSF timestamp at
the beginning of the MPDU -- make that clearer
by renaming the flag to RX_FLAG_MACTIME_MPDU.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4a277dd8da28b615f4c683b993e01d71f2e3aaec 26-Apr-2010 John W. Linville <linville@tuxdriver.com> b43: remove usage of deprecated noise value

Signed-off-by: John W. Linville <linville@tuxdriver.com>
c1b84ab059541517f51df534e87071723264833d 05-Nov-2009 Larry Finger <Larry.Finger@lwfinger.net> b43: Remove deprecated 'qual' from returned RX status

With the deprecation of the qual member of ieee80211_rx_status, that
calculation and an associated constant can be removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
72f5f457564e8ebc6c38ee4f98ee59cd03c2f614 16-Oct-2009 John W. Linville <linville@tuxdriver.com> b43: use ieee80211_rx_ni()

Convert to new use ieee80211_rx_ni() routine rather than open-coded
version.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
88499ab3d8dbbf9c080416952603742666c71262 09-Oct-2009 Michael Buesch <mb@bu3sch.de> b43: Optimize PIO scratchbuffer usage

This optimizes the PIO scratchbuffer usage.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
edbfdcceb41c0cbfc1dd2cd28af2272190be47ad 11-Oct-2009 Johannes Berg <johannes@sipsolutions.net> b43: fix ieee80211_rx() context

Due to the way it interacts with the networking
stack and other parts of mac80211, ieee80211_rx()
must be called with disabled softirqs.

[1] http://thread.gmane.org/gmane.linux.kernel.wireless.general/39440/focus=40266

Reported-by: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7e937c633f718e0916a294db7282c922c1bf3ce3 07-Oct-2009 Albert Herranz <albert_herranz@yahoo.es> b43: do not stack-allocate pio rx/tx header and tail buffers

The DMA-API debugging facility complains about b43 mapping memory from
stack for SDIO-based cards.

Indeed, b43 currently allocates the PIO RX/TX header and tail buffers
from stack. The solution here is to use heap-allocated buffers instead.

Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
990b86f4f9c54f83085d4136498ac44719b17654 12-Sep-2009 Michael Buesch <mb@bu3sch.de> b43: Add optional verbose runtime statistics

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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ce6c4a13927bc0418169fe543c6614abfab051eb 10-Sep-2009 Michael Buesch <mb@bu3sch.de> b43: Do not use _irqsafe callbacks

We don't need to call the irqsafe callbacks.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
cde1b55b43b71cabb1a94278a809bca21b9df791 06-Sep-2009 Michael Buesch <mb@bu3sch.de> b43: Fix sparse warning in hw-tkip code

This fixes a sparse warning in the hardware-TKIP code:

drivers/net/wireless/b43/xmit.c:272:18: warning: incorrect type in assignment (different base types)
drivers/net/wireless/b43/xmit.c:272:18: expected unsigned short [unsigned] [short] <noident>
drivers/net/wireless/b43/xmit.c:272:18: got restricted unsigned short [usertype] <noident>

The code should work correctly with and without this patch applied.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
035d0243ebbdbd5f8f07d6ce378c9a9b36415bc9 19-Aug-2009 gregor kowski <gregor.kowski@gmail.com> b43: add hardware tkip

This add hardware tkip for b43.

Signed-off-by: Gregor Kowski <gregor.kowski@gmail.com>
Acked-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
826ee70664c658a022d999f7eb4d3cd9448895dd 15-Aug-2009 Gábor Stefanik <netrolller.3d@gmail.com> b43: Handle B43_PHYTYPE_LP in RX path

Don't drop all packets received from an LP-PHY with WARN_ON.
Also update a comment with LP-specific information.

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
66d2d089c394c7e31020947d682523f77a93244b 06-Aug-2009 Michael Buesch <mb@bu3sch.de> b43: Fix hardware key index handling

This fixes the hardware encryption keys index and array size handling.

Thanks to Gregor Kowski for reporting this issue.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f1d58c2521eb160178b2151d6326d8dc5d7c8560 17-Jun-2009 Johannes Berg <johannes@sipsolutions.net> mac80211: push rx status into skb->cb

Within mac80211, we often need to copy the rx status into
skb->cb. This is wasteful, as drivers could be building it
in there to start with. This patch changes the API so that
drivers are expected to pass the RX status in skb->cb, now
accessible as IEEE80211_SKB_RXCB(skb). It also updates all
drivers to pass the rx status in there, but only by making
them memcpy() it into place before the call to the receive
function (ieee80211_rx(_irqsafe)). Each driver can now be
optimised on its own schedule.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b52a033c2c501a8015df3727a4bd73389ccb1641 04-Jun-2009 Matthieu CASTET <castet.matthieu@free.fr> b43: Fix possible unaligned u32 access

Fix possible unaligned u32 access in b43_generate_plcp_hdr().
Unaligned data is read/write with a u32 pointer instead of using the
packed structure. Some versions of gcc ignore the "packed" attribute, if the
structure element is accessed through a local pointer.

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a3c0b87c4f21911fb7185902dd13f0e3cd7f33f7 22-Mar-2009 Lorenzo Nava <navalorenx@gmail.com> b43: fix b43_plcp_get_bitrate_idx_ofdm return type

This patch fixes the return type of b43_plcp_get_bitrate_idx_ofdm. If
the plcp contains an error, the function return value is 255 instead
of -1, and the packet was not dropped. This causes a warning in
__ieee80211_rx function because rate idx is out of range.

Cc: stable@kernel.org
Signed-off-by: Lorenzo Nava <navalorenx@gmail.com>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ce4fbdbf161b2676b3833412367113572d739253 02-Mar-2009 Michael Buesch <mb@bu3sch.de> b43: Pass more RX flags to mac80211

This changes the RX handler to pass more status flags to mac80211.
It also changes part of the drop policy, if bad frames were requested. (Note that
currently mac80211 will throw a WARN_ON in that case. But nothing bad will happen).

This also removes some obsolete unused timestamping code.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1e87d68083cd073c84edb3a71fa4365d7fc092bd 06-Nov-2008 Johannes Berg <johannes@sipsolutions.net> b43: remove rate index warning

I frequently run into this warning, and added some
debugging to see why, and got this:

b43 bad rx: 00000000: 2f d2 e2 63 cf a7 14 04 28 18 c8 5f 88 4a a2 00
bogus junk | plcp | fctl| dur

b43 bad rx: 00000010: 00 11 24 91 07 4d 00 06 25 ff 8f 78 00 06 25 ff
my MAC address | BSSID | AP MAC
b43 bad rx: 00000020: 8f 76 20 74 00 00 42 07 00 20 00 00 00 00 aa aa
| seq | QoS | CCMP IV | data
...

As you can see, there are 6 bogus bytes (sometimes only five) and then
the frame. I don't know why, and I don't see how to recover, so let's
just drop these frames.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e6a9854b05c1a6af1308fe2b8c68f35abf28a3ee 21-Oct-2008 Johannes Berg <johannes@sipsolutions.net> mac80211/drivers: rewrite the rate control API

So after the previous changes we were still unhappy with how
convoluted the API is and decided to make things simpler for
everybody. This completely changes the rate control API, now
taking into account 802.11n with MCS rates and more control,
most drivers don't support that though.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
870abdf67170daa9f1022e55a35c469239fcc74c 05-Oct-2008 Felix Fietkau <nbd@openwrt.org> mac80211: add multi-rate retry support

This patch adjusts the rate control API to allow multi-rate retry
if supported by the driver. The ieee80211_hw struct specifies how
many alternate rate selections the driver supports.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
76708dee382a69b2f9d0e50f413f99fefb2dc509 05-Oct-2008 Felix Fietkau <nbd@openwrt.org> mac80211: free up 2 bytes in skb->cb

Free up 2 bytes in skb->cb to be used for multi-rate retry later.
Move iv_len and icv_len initialization into key alloc.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
18c8adeb0244f823ba78a51e23f813fe68bc3c54 28-Aug-2008 Michael Buesch <mb@bu3sch.de> b43: Rewrite TX power adjustment

This patch rewrites the TX power recalculation algorithms to scale better
with changed enviromnent. If there's low
TX traffic, the power will be checked against the desired values
every 60 seconds.
If there is high TX traffic, the check is redone every 2 seconds. This improves
the reaction times a lot and confuses the rate control less.
It will also reduce the time it initially takes to tune to a new TX power
value. With the old algorithm it could take about 30 to 45 seconds to settle to
a new power value. This will happen in about two to four seconds now.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ef1a628d83fc0423c36e773281162be790503168 27-Aug-2008 Michael Buesch <mb@bu3sch.de> b43: Implement dynamic PHY API

This patch implements a dynamic "ops" based PHY API.
This is needed in order to conveniently support future PHY types
to avoid the "switch"-hell.

This patch does not change any functionality. It just moves lots
of code from one place to another and adjusts it for the changed
data structures.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d0f09804144fd9471a13cf4d80e66842c7fa114f 29-Jul-2008 Johannes Berg <johannes@sipsolutions.net> mac80211: partially fix skb->cb use

This patch fixes mac80211 to not use the skb->cb over the queue step
from virtual interfaces to the master. The patch also, for now,
disables aggregation because that would still require requeuing,
will fix that in a separate patch. There are two other places (software
requeue and powersaving stations) where requeue can happen, but that is
not currently used by any drivers/not possible to use respectively.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f591fa5dbbbeaebd95c9c019b3a536a327fb79de 10-Jul-2008 Johannes Berg <johannes@sipsolutions.net> mac80211: fix TX sequence numbers

This patch makes mac80211 assign proper sequence numbers to
QoS-data frames. It also removes the old sequence number code
because we noticed that only the driver or hardware can assign
sequence numbers to non-QoS-data and especially management
frames in a race-free manner because beacons aren't passed
through mac80211's TX path.

This patch also adds temporary code to the rt2x00 drivers to
not break them completely, that code will have to be reworked
for proper sequence numbers on beacons.

It also moves sequence number assignment down in the TX path
so no sequence numbers are assigned to frames that are dropped.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f37d923422b61884a75a2a64865ed03ca5ccfc6d 15-Jun-2008 Harvey Harrison <harvey.harrison@gmail.com> b43: use frame control helpers

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e039fa4a4195ac4ee895e6f3d1334beed63256fe 15-May-2008 Johannes Berg <johannes@sipsolutions.net> mac80211: move TX info into skb->cb

This patch converts mac80211 and all drivers to have transmit
information and status in skb->cb rather than allocating extra
memory for it and copying all the data around. To make it fit,
a union is used where only data that is necessary for all steps
is kept outside of the union.

A number of fixes were done by Ivo, as well as the rt2x00 part
of this patch.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2e92e6f2c50b4baf85cca968f0e6f1b5c0df7d39 15-May-2008 Johannes Berg <johannes@sipsolutions.net> mac80211: use rate index in TX control

This patch modifies struct ieee80211_tx_control to give band
info and the rate index (instead of rate pointers) to drivers.
This mostly serves to reduce the TX control structure size to
make it fit into skb->cb so that the fragmentation code can
put it there and we can think about passing it to drivers that
way in the future.

The rt2x00 driver update was done by Ivo, thanks.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
566bfe5a8bcde13188a356f77666f8115813cf31 08-May-2008 Bruno Randolf <br1@einfach.org> mac80211: use hardware flags for signal/noise units

trying to clean up the signal/noise code. the previous code in mac80211 had
confusing names for the related variables, did not have much definition of
what units of signal and noise were provided and used implicit mechanisms from
the wireless extensions.

this patch introduces hardware capability flags to let the hardware specify
clearly if it can provide signal and noise level values and which units it can
provide. this also anticipates possible new units like RCPI in the future.

for signal:

IEEE80211_HW_SIGNAL_UNSPEC - unspecified, unknown, hw specific
IEEE80211_HW_SIGNAL_DB - dB difference to unspecified reference point
IEEE80211_HW_SIGNAL_DBM - dBm, difference to 1mW

for noise we currently only have dBm:

IEEE80211_HW_NOISE_DBM - dBm, difference to 1mW

if IEEE80211_HW_SIGNAL_UNSPEC or IEEE80211_HW_SIGNAL_DB is used the driver has
to provide the maximum value (max_signal) it reports in order for applications
to make sense of the signal values.

i tried my best to find out for each driver what it can provide and update it
but i'm not sure (?) for some of them and used the more conservative guess in
doubt. this can be fixed easily after this patch has been merged by changing
the hardware flags of the driver.

DRIVER SIGNAL MAX NOISE QUAL
-----------------------------------------------------------------
adm8211 unspec(?) 100 n/a missing
at76_usb unspec(?) (?) unused missing
ath5k dBm dBm percent rssi
b43legacy dBm dBm percent jssi(?)
b43 dBm dBm percent jssi(?)
iwl-3945 dBm dBm percent snr+more
iwl-4965 dBm dBm percent snr+more
p54 unspec 127 n/a missing
rt2x00 dBm n/a percent rssi+tx/rx frame success
rt2400 dBm n/a
rt2500pci dBm n/a
rt2500usb dBm n/a
rt61pci dBm n/a
rt73usb dBm n/a
rtl8180 unspec(?) 65 n/a (?)
rtl8187 unspec(?) 65 (?) noise(?)
zd1211 dB(?) 100 n/a percent

drivers/net/wireless/ath5k/base.c: Changes-licensed-under: 3-Clause-BSD

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1c014420583564ac09e3b67006f2e7050861e66b 17-Apr-2008 Ivo van Doorn <ivdoorn@gmail.com> mac80211: Replace ieee80211_tx_control->key_idx with ieee80211_key_conf

The hw_key_idx inside the ieee80211_key_conf structure does
not provide all the information drivers might need to perform
hardware encryption.

This is in particular true for rt2x00 who needs to know the
key algorithm and whether it is a shared or pairwise key.

By passing the ieee80211_key_conf pointer it assures us that
drivers can make full use of all information that it should know
about a particular key.

Additionally this patch updates all drivers to grab the hw_key_idx from
the ieee80211_key_conf structure.

v2: Removed bogus u16 cast
v3: Add warning about ieee80211_tx_control pointers
v4: Update warning about ieee80211_tx_control pointers

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7b584163979a9fe2ebfdd57a9d64cbe27166ab70 03-Apr-2008 Michael Buesch <mb@bu3sch.de> b43: Add more N-PHY stuff

This adds some minor stuff for N-PHY support. Nothing special.
Adds Analog switching and some TODOs for RSSI processing.
Just a patch I had floating around for quite some time now.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5100d5ac81b9330dc57e35adbe50923ba6107b8f 29-Mar-2008 Michael Buesch <mb@bu3sch.de> b43: Add PIO support for PCMCIA devices

This adds PIO support back (D'oh!) for PCMCIA devices.
This is a complete rewrite of the old PIO code. It does actually work
and we get reasonable performance out of it on a modern machine.
On a PowerBook G4 I get a few MBit for TX and a few more for RX.
So it doesn't work as well as DMA (of course), but it's a _lot_ faster
than the old PIO code (only got a few kBit with that).

The limiting factor is the host CPU speed. So it will generate 100%
CPU usage when the network interface is heavily loaded. A voluntary preemption
point in the RX path makes sure Desktop Latency isn't hurt.

PIO is needed for 16bit PCMCIA devices, as we really don't want to poke with
the braindead DMA mechanisms on PCMCIA sockets. Additionally, not all
PCMCIA sockets do actually support DMA in 16bit mode (mine doesn't).

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e6f5b934fba8c44c87c551e066aa7ca6fde2939e 05-Mar-2008 Michael Buesch <mb@bu3sch.de> b43: Add QOS support

This adds QOS support to the b43 driver.
QOS can be disabled on driver level with a module parameter for debugging purposes.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d007b7f42e2a3a2b95ef43e8cc1a3dfe66b19736 18-Feb-2008 Johannes Berg <johannes@sipsolutions.net> b43(legacy): include full timestamp in beacon frames

Having the full RX timestamp in beacons is necessary for IBSS
merge to work properly so extend the 16-bit timestamp to the
full 64 bits for beacon frames (as well as when monitor mode
is active.)

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8318d78a44d49ac1edf2bdec7299de3617c4232e 24-Jan-2008 Johannes Berg <johannes@sipsolutions.net> cfg80211 API for channels/bitrates, mac80211 and driver conversion

This patch creates new cfg80211 wiphy API for channel and bitrate
registration and converts mac80211 and drivers to the new API. The
old mac80211 API is completely ripped out. All drivers (except ath5k)
are updated to the new API, in many cases I expect that optimisations
can be done.

Along with the regulatory code I've also ripped out the
IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED flag, I believe it to be
unnecessary if the hardware simply gives us whatever channels it wants
to support and we then enable/disable them as required, which is pretty
much required for travelling.

Additionally, the patch adds proper "basic" rate handling for STA
mode interface, AP mode interface will have to have new API added
to allow userspace to set the basic rate set, currently it'll be
empty... However, the basic rate handling will need to be moved to
the BSS conf stuff.

I do expect there to be bugs in this, especially wrt. transmit
power handling where I'm basically clueless about how it should work.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
09552ccd8277e6382097e93a40f7311a09449367 23-Jan-2008 Michael Buesch <mb@bu3sch.de> b43: Drop packets that we are not able to encrypt

We must not transmit packets we're not able to encrypt.

This fixes a bug where in a tiny timeframe after machine resume
packets can get sent unencrypted and might leak information.

This also fixes three small resource leakages I spotted while fixing
the security problem. Properly deallocate the DMA slots in any DMA
allocation error path.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7be1bb6b798d506693d2d8668e801951996b5a4a 23-Jan-2008 Michael Buesch <mb@bu3sch.de> b43: Fix suspend/resume

This fixes suspend/resume.

We must not overwrite the MAC addresses on resume. Otherwise
the card won't ACK any packets anymore.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
eb189d8bc9824bcb2187ffdab27d77ab469264c3 28-Jan-2008 Michael Buesch <mb@bu3sch.de> b43: Add support for new firmware

This patch adds support for new firmware.
Old firmware is still supported until July 2008.

To get new firmware, go to
ftp://ftp.linksys.com/opensourcecode/wrt150nv11/1.51.3/
and download the tarball. We don't have a smaller tarball, yet.
That will be fixed later.
You can extract firmware out of the "wl_ap.o" file contained
in this tarball using latest fwcutter. You must pass the option
--unsupported to fwcutter.
Fwcutter-010 with official support for a new firmware image will
be released soon.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
32bfd35d4b63bd63de4bb0d791ef049c3c868726 19-Dec-2007 Johannes Berg <johannes@sipsolutions.net> mac80211: dont use interface indices in drivers

This patch gets rid of the if_id stuff where possible in favour of
a new per-virtual-interface structure "struct ieee80211_vif". This
structure is located at the end of the per-interface structure and
contains a variable length driver-use data area.

This has two advantages:
* removes the need to look up interfaces by if_id, this is better
for working with network namespaces and performance
* allows drivers to store and retrieve per-interface data without
having to allocate own lists/hash tables

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
03b29773b613f10d2f97dbf0983f1c4c58507967 26-Dec-2007 Michael Buesch <mb@bu3sch.de> b43: Remove PIO support

Remove b43 PIO support.
DMA works well on all supported devices. There's no reason to use PIO.
Additionally, new devices don't support PIO in hardware anymore.
b43 PIO support is dead and unused code.

After applying this patch please do
git rm drivers/net/wireless/b43/pio.h
git rm drivers/net/wireless/b43/pio.c
to remove the main PIO support code.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9db1f6d725921c413cc344beda5e7e7d011b02e7 22-Dec-2007 Michael Buesch <mb@bu3sch.de> b43: Only select allowed TX and RX antennas

This fixes antenna selection in b43. It adds a sanity check
for the antenna numbers we get from mac80211.

This patch depends on
ssb: Fix extraction of values from SPROM

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c0ddd04d55e0a4d1506b6b8a4eb9e2b62f3aa41d 21-Jan-2008 John W. Linville <linville@tuxdriver.com> wireless: cleanup some merge errors

Signed-off-by: John W. Linville <linville@tuxdriver.com>
d8be11ee95be9ec9eabfec9f635e0feac972369b 24-Nov-2007 Johannes Berg <johannes@sipsolutions.net> b43: include FCS in frames handed to mac80211

Sometimes it can be useful to see the FCS, especially when
bad-FCS frames are shown. Pass the FCS to mac80211 and let
it worry about snipping it off when required.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
95de2841aad971867851b59c0c5253ecc2e19832 09-Nov-2007 Larry Finger <Larry.Finger@lwfinger.net> b43: Convert to use of the new SPROM structure

The b43 driver is modified to use the new SPROM structure.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1f21ad2a4f7f66855dae600ddd635ff5fb299bbd 06-Nov-2007 Stefano Brivio <stefano.brivio@polimi.it> b43/b43legacy: fix my copyright notices

Fix my copyright notices in b43 and b43legacy.

Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Cc: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
74cfdba7ce7b601559a4bcdc9054baf1bdc6948d 28-Oct-2007 Michael Buesch <mb@bu3sch.de> b43: Use the retry limit parameters from mac80211

Use the limits provided by mac80211.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
03bffc1341c757e4b15a5a6058ad624e28b4801e 04-Dec-2007 Johannes Berg <johannes@sipsolutions.net> wireless: make drivers include the TSF RX flag where appropriate

These drivers pass full mactime information to the stack, make them
indicate this via the new RX_FLAG_TSFT to get mac80211 to show this
information in monitor mode.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
d987160b710c98997015832422a05e18d9f0f925 02-Jan-2008 Michael Buesch <mb@bu3sch.de> b43: Fix rxheader channel parsing

This patch fixes the parsing of the RX data header channel field.

The current code parses the header incorrectly and passes a wrong
channel number and frequency for each frame to mac80211.
The FIXMEs added by this patch don't matter for now as the code
where they live won't get executed anyway. They will be fixed later.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1a09404a2338163f181d170c7abdc2242b6c6f03 20-Sep-2007 Michael Buesch <mb@bu3sch.de> [B43]: Fix sparse warnings.

The remaining warning in phy.c will be fixed later.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
e4d6b7951812d98417feb10784e400e253caf633 18-Sep-2007 Michael Buesch <mb@bu3sch.de> [B43]: add mac80211-based driver for modern BCM43xx devices

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>