]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/log
mirror_ubuntu-artful-kernel.git
11 years agossb: extif: fix compile errors
Hauke Mehrtens [Mon, 26 Nov 2012 23:31:55 +0000 (00:31 +0100)]
ssb: extif: fix compile errors

If CONFIG_SSB_EMBEDDED or CONFIG_SSB_DRIVER_MIPS is set and
CONFIG_SSB_DRIVER_EXTIF is not set, it will cause compile problems
because of missing functions. This patch fixes these problems.

The mips driver now also uses ssb_chipco_available() instead of
checking bus->chipco.dev manually.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobcma: handle return value of pci_assign_resource
Hauke Mehrtens [Mon, 26 Nov 2012 23:30:04 +0000 (00:30 +0100)]
bcma: handle return value of pci_assign_resource

This fixes the following warning:

  CC      drivers/bcma/driver_pci_host.o
drivers/bcma/driver_pci_host.c: In function 'bcma_core_pci_fixup_addresses':
drivers/bcma/driver_pci_host.c:555:23: error: ignoring return value of
'pci_assign_resource', declared with attribute warn_unused_result
[-Werror=unused-result]

Reported-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomac80211: simplify loop in minstrel_ht
Johannes Berg [Tue, 13 Nov 2012 20:36:27 +0000 (21:36 +0100)]
mac80211: simplify loop in minstrel_ht

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: fix BSS struct IE access races
Johannes Berg [Thu, 29 Nov 2012 00:25:20 +0000 (01:25 +0100)]
cfg80211: fix BSS struct IE access races

When a BSS struct is updated, the IEs are currently
overwritten or freed. This can lead to races if some
other CPU is accessing the BSS struct and using the
IEs concurrently.

Fix this by always allocating the IEs in a new struct
that holds the data and length and protecting access
to this new struct with RCU.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: remove probe response temporary buffer allocation
Johannes Berg [Thu, 29 Nov 2012 12:00:10 +0000 (13:00 +0100)]
mac80211: remove probe response temporary buffer allocation

Instead of allocating a temporary buffer to build IEs
build them right into the SKB.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: make ieee80211_build_preq_ies safer
Johannes Berg [Thu, 29 Nov 2012 11:45:18 +0000 (12:45 +0100)]
mac80211: make ieee80211_build_preq_ies safer

Instead of assuming 200 bytes are always enough for
all the IEs we add, give the length of the buffer
to the function and warn instead of overrunning.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: fix cmp_hidden_bss
Johannes Berg [Wed, 28 Nov 2012 21:42:34 +0000 (22:42 +0100)]
cfg80211: fix cmp_hidden_bss

The cmp_bss() comparator function uses memcmp() to
compare the SSID. This means that cmp_hidden_bss()
needs to similarly return a number bigger than zero
(use 1) instead of -1 when ie1 is bigger than ie2,
which is the case if an ie2 byte is non-zero.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: fix whitespace in scan handling
Johannes Berg [Wed, 28 Nov 2012 21:39:37 +0000 (22:39 +0100)]
cfg80211: fix whitespace in scan handling

Fix a number of indentation and similar issues.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: don't BUG_ON BSS struct issues
Johannes Berg [Wed, 28 Nov 2012 21:14:56 +0000 (22:14 +0100)]
cfg80211: don't BUG_ON BSS struct issues

There's no need to stop the machine, just leak
the BSS entry if there's an issue with its hold
counter when freeing.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: allow userspace registration for probe requests in IBSS
Antonio Quartulli [Thu, 29 Nov 2012 23:18:12 +0000 (00:18 +0100)]
mac80211: allow userspace registration for probe requests in IBSS

This change allows userspace to register for probe request
frames on an IBSS interface. Userspace then has to handle
them and send replies.

Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: fix for mesh sync to indicate TBTT adjustment
Marco Porsch [Fri, 23 Nov 2012 20:23:18 +0000 (12:23 -0800)]
mac80211: fix for mesh sync to indicate TBTT adjustment

Currently the mesh sync code checks, whether peers indicate TBTT adjustment,
but it never sets the corresponding flag itself.

By setting ifmsh->tbtt_adjusting to true, it will set the corresponding field
in the mesh configuration IE of own beacons.
This indication will be set in the current beacon. The TBTT adjustment will be
performed afterwards, affecting the next beacon. Thus, the first beacon with
stable TBTT will not indicate adjustment anymore and peers will continue
tracking the new offset.

Signed-off-by: Marco Porsch <marco.porsch@etit.tu-chemnitz.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonl80211: Fix HT_IBSS feature check in ibss_join
Simon Wunderlich [Thu, 29 Nov 2012 17:37:22 +0000 (18:37 +0100)]
nl80211: Fix HT_IBSS feature check in ibss_join

There is a standalone if, seems to be a regression of commit
"nl80211/cfg80211: add VHT MCS support".

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: add debugfs file for last rx rate
Saravana [Thu, 29 Nov 2012 14:24:19 +0000 (19:54 +0530)]
mac80211: add debugfs file for last rx rate

Add a debugfs file showing the rate at which
the last packet is received.

Signed-off-by: Saravana <saravanad@posedge.com>
[fix whitespace]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: re-organize the rx rate calculation logic
Saravana [Wed, 28 Nov 2012 12:59:38 +0000 (18:29 +0530)]
mac80211: re-organize the rx rate calculation logic

Currently the logic to fill a struct rate_info with
a STA's last RX rate is accessible only in the cfg.c.
As the RX rate calculation might be needed elsewhere,
split this out into a separate function.

Signed-off-by: Saravana <saravanad@posedge.com>
[fix various whitespace issues, reword commit log]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: add debugfs file for current tx rate
Saravana [Thu, 29 Nov 2012 13:52:37 +0000 (19:22 +0530)]
mac80211: add debugfs file for current tx rate

Add a debugfs file showing the current tx rate.
The information available in the rc_stats file
doesn't evidently provides us the current tx rate.
This patch adds the support for the same.

Signed-off-by: Saravana <saravanad@posedge.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: add debugfs file for last ack signal
Saravana [Wed, 28 Nov 2012 12:57:09 +0000 (18:27 +0530)]
mac80211: add debugfs file for last ack signal

Add a debugfs file showing the signal strength
of the ack frame that is received for the
currently sent tx packet

Signed-off-by: Saravana <saravanad@posedge.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: Remove unused VHT chan code
Mahesh Palivela [Thu, 29 Nov 2012 08:41:07 +0000 (14:11 +0530)]
cfg80211: Remove unused VHT chan code

Cleanup of unused VHT channel config related code.

Signed-off-by: Mahesh Palivela <maheshp@posedge.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoNFC: Fix incorrect llcp pointer dereference
Waldemar Rymarkiewicz [Mon, 26 Nov 2012 07:40:04 +0000 (08:40 +0100)]
NFC: Fix incorrect llcp pointer dereference

nfc_llcp_ns(s) dereferences the s pointer which is freed a line
above. In a result, it can produce a crash or you will read
incorrect value.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agomac80211: don't reinit rate control when mesh sta exists
Helmut Schaa [Tue, 27 Nov 2012 17:03:13 +0000 (18:03 +0100)]
mac80211: don't reinit rate control when mesh sta exists

This fixes some unintended resets of the rate control statistics
when minstrel_ht is used resulting in non-optimal throughput on mesh
links.

Tested-by: Emanuel Taube <emanuel.taube@gmail.com>
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: reject setting masked mac addresses
Helmut Schaa [Tue, 27 Nov 2012 17:23:06 +0000 (18:23 +0100)]
mac80211: reject setting masked mac addresses

If a driver registers an address mask we should ensure that no
interface gets an address assigned that isn't covered by the
registered address mask. This prevents invalid configurations
from reaching the device and causing problems.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
[change function flow to reduce indentation, fix locking]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: fix potential NULL dereference
Dan Carpenter [Tue, 27 Nov 2012 17:31:19 +0000 (20:31 +0300)]
mac80211: fix potential NULL dereference

Smatch complains that we could dereference skb later in the function.
It's probably unlikely, but we may as well return here and avoid it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
[change summary]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonl80211: remove unnecessary checks
Johannes Berg [Mon, 26 Nov 2012 11:51:52 +0000 (12:51 +0100)]
nl80211: remove unnecessary checks

The CQM TX-error rate/interval can't be less than
zero since they're unsigned values, remove checks.
Also fix indentation of the function.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: support P2P GO powersave configuration
Johannes Berg [Wed, 14 Nov 2012 14:21:17 +0000 (15:21 +0100)]
mac80211: support P2P GO powersave configuration

If the low-level driver wants to support P2P GO
powersave configuration, it must set the cfg80211
flags and mac80211 will pass the parameters to it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonl80211: support P2P GO powersave configuration
Johannes Berg [Wed, 14 Nov 2012 14:17:28 +0000 (15:17 +0100)]
nl80211: support P2P GO powersave configuration

If a driver supports P2P GO powersave, allow it to
set the new feature flags for it and allow userspace
to configure the parameters for it. This can be done
at GO startup and later changed with SET_BSS.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: support (partial) VHT radiotap information
Johannes Berg [Thu, 22 Nov 2012 22:00:18 +0000 (23:00 +0100)]
mac80211: support (partial) VHT radiotap information

Add some information that we have about VHT to radiotap.
This at least lets one see the MCS and NSS information.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: support VHT association
Johannes Berg [Thu, 22 Nov 2012 13:11:39 +0000 (14:11 +0100)]
mac80211: support VHT association

Determine the VHT channel from the AP's VHT operation IE
(if present) and configure the hardware to that channel
if it is supported. If channel contexts cause a channel
to not be usable, try a smaller bandwidth.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: rework chandef checking and export it
Johannes Berg [Thu, 22 Nov 2012 15:59:45 +0000 (16:59 +0100)]
cfg80211: rework chandef checking and export it

Some of the chandef checking that we do in cfg80211
to check if a channel is supported or not is also
needed in mac80211, so rework that a bit and export
the functions that are needed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobcma: add more package IDs
Hauke Mehrtens [Sat, 24 Nov 2012 18:34:17 +0000 (19:34 +0100)]
bcma: add more package IDs

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agop54: improve TSF timestamp precision
Christian Lamparter [Sat, 24 Nov 2012 13:23:25 +0000 (14:23 +0100)]
p54: improve TSF timestamp precision

The LMAC API states that the TSF clock value of
every rx'ed frame is a "usec accurate timestamp
of the hardware clock at the end of frame
(before OFDM SIFS EOF padding)".

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoiwlwifi: initialize rx_status
Johannes Berg [Fri, 23 Nov 2012 22:46:19 +0000 (23:46 +0100)]
iwlwifi: initialize rx_status

The vendor radiotap patch added a few fields to
struct ieee80211_rx_status that need to be zero,
initialize the struct instead of using whatever
was left on the stack.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Tested-by: Kalle Valo <kvalo@adurom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoiwlegacy: initialize rx_status
Johannes Berg [Thu, 22 Nov 2012 11:58:16 +0000 (12:58 +0100)]
iwlegacy: initialize rx_status

The vendor radiotap patch added a few fields to
struct ieee80211_rx_status that need to be zero,
initialize the struct instead of using whatever
was left on the stack.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add __printf verification to logging prototypes
Joe Perches [Wed, 21 Nov 2012 18:17:34 +0000 (10:17 -0800)]
brcmsmac: Add __printf verification to logging prototypes

Adding __printf helps spot format and argument mismatches.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
John W. Linville [Mon, 26 Nov 2012 19:46:41 +0000 (14:46 -0500)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next

11 years agomac80211: fix remain-on-channel (non-)cancelling
Johannes Berg [Fri, 23 Nov 2012 23:32:19 +0000 (00:32 +0100)]
mac80211: fix remain-on-channel (non-)cancelling

Felix Liao reported that when an interface is set DOWN
while another interface is executing a ROC, the warning
in ieee80211_start_next_roc() (about the first item on
the list having started already) triggers.

This is because ieee80211_roc_purge() calls it even if
it never actually changed the list of ROC items. To fix
this, simply remove the function call. If it is needed
then it will be done by the ieee80211_sw_roc_work()
function when the ROC item that is being removed while
active is cleaned up.

Cc: stable@vger.kernel.org
Reported-by: Felix Liao <Felix.Liao@watchguard.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Mon, 26 Nov 2012 19:25:22 +0000 (14:25 -0500)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes

11 years agocfg80211: fix some tracing output issues
Johannes Berg [Fri, 16 Nov 2012 16:22:28 +0000 (17:22 +0100)]
cfg80211: fix some tracing output issues

In some cases, e.g. probe_status, there were spaces
missing so the trace output was confusing. Also make
it more like mac80211 when printing netdevs/wiphys
to make reading a combined log easier.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211_hwsim: remove printing scan config
Johannes Berg [Tue, 20 Nov 2012 16:34:10 +0000 (17:34 +0100)]
mac80211_hwsim: remove printing scan config

The frequencies will be printed when actually
doing the scan, and the IEs can be captured
on the hwsim0 monitor.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211_hwsim: advertise VHT support
Johannes Berg [Mon, 12 Nov 2012 10:51:50 +0000 (11:51 +0100)]
mac80211_hwsim: advertise VHT support

If the number of channels is > 1, which means that
hwsim will use mac80211 channel contexts, it can
also advertise VHT support.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agowireless: add definitions for VHT MCS support
Johannes Berg [Mon, 12 Nov 2012 10:44:18 +0000 (11:44 +0100)]
wireless: add definitions for VHT MCS support

Add definitions for the VHT MCS support values that
are used to indicate, for each number of streams
(1 through 8) which MCSes are supported.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: support VHT rates in TX info
Johannes Berg [Fri, 9 Nov 2012 17:38:32 +0000 (18:38 +0100)]
mac80211: support VHT rates in TX info

To achieve this, limit the number of retries to
31 (instead of 255) and use the three bits that
are then free for VHT flags.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: support drivers reporting VHT RX
Johannes Berg [Fri, 9 Nov 2012 14:07:02 +0000 (15:07 +0100)]
mac80211: support drivers reporting VHT RX

Add support to mac80211 for having drivers report
received VHT MCS information.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonl80211/cfg80211: add VHT MCS support
Johannes Berg [Fri, 9 Nov 2012 13:56:41 +0000 (14:56 +0100)]
nl80211/cfg80211: add VHT MCS support

Add support for reporting and calculating VHT MCSes.

Note that I'm not completely sure that the bitrate
calculations are correct, nor that they can't be
simplified.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: convert to channel definition struct
Johannes Berg [Fri, 9 Nov 2012 10:39:59 +0000 (11:39 +0100)]
mac80211: convert to channel definition struct

Convert mac80211 (and where necessary, some drivers a
little bit) to the new channel definition struct.

This will allow extending mac80211 for VHT, which is
currently restricted to channel contexts since there
are no drivers using that which makes it easier. As
I also don't care about VHT for drivers not using the
channel context API, I won't convert the previous API
to VHT support.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonl80211/cfg80211: support VHT channel configuration
Johannes Berg [Thu, 8 Nov 2012 22:14:50 +0000 (23:14 +0100)]
nl80211/cfg80211: support VHT channel configuration

Change nl80211 to support specifying a VHT (or HT)
using the control channel frequency (as before) and
new attributes for the channel width and first and
second center frequency. The old channel type is of
course still supported for HT.

Also change the cfg80211 channel definition struct
to support these by adding the relevant fields to
it (and removing the _type field.)

This also adds new helper functions:
 - cfg80211_chandef_create to create a channel def
   struct given the control channel and channel type,
 - cfg80211_chandef_identical to check if two channel
   definitions are identical
 - cfg80211_chandef_compatible to check if the given
   channel definitions are compatible, and return the
   wider of the two

This isn't entirely complete, but that doesn't matter
until we have a driver using it. In particular, it's
missing
 - regulatory checks on the usable bandwidth (if that
   even makes sense)
 - regulatory TX power (database can't deal with it)
 - a proper channel compatibility calculation for the
   new channel types

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: pass a channel definition struct
Johannes Berg [Thu, 8 Nov 2012 20:25:48 +0000 (21:25 +0100)]
cfg80211: pass a channel definition struct

Instead of passing a channel pointer and channel type
to all functions and driver methods, pass a new channel
definition struct. Right now, this struct contains just
the control channel and channel type, but for VHT this
will change.

Also, add a small inline cfg80211_get_chandef_type() so
that drivers don't need to use the _type field of the
new structure all the time, which will change.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonl80211: add documentation for channel type
Johannes Berg [Thu, 8 Nov 2012 18:20:56 +0000 (19:20 +0100)]
nl80211: add documentation for channel type

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: remove remain-on-channel channel type
Johannes Berg [Thu, 8 Nov 2012 17:31:02 +0000 (18:31 +0100)]
cfg80211: remove remain-on-channel channel type

As mwifiex (and mac80211 in the software case) are the
only drivers actually implementing remain-on-channel
with channel type, userspace can't be relying on it.
This is the case, as it's used only for P2P operations
right now.

Rather than adding a flag to tell userspace whether or
not it can actually rely on it, simplify all the code
by removing the ability to use different channel types.
Leave only the validation of the attribute, so that if
we extend it again later (with the needed capability
flag), it can't break userspace sending invalid data.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: fix managed mode channel flags handling
Johannes Berg [Mon, 26 Nov 2012 10:57:41 +0000 (11:57 +0100)]
mac80211: fix managed mode channel flags handling

If ieee80211_prep_channel() decides that HT should be
disabled (because the HT IEs from the AP were invalid)
it will set the IEEE80211_STA_DISABLE_HT to not send
HT capabilities to the AP when associating. If this
happens during authentication, the flag will be lost
and we send HT frames, even if the channel config was
set up for non-HT. This can lead to issues.

Fix this by always resetting the ifmgd flags to zero
when the channel context is released so that the flag
resetting in ieee80211_mgd_assoc() isn't necessary.

To make the code a bit easier move the call to release
the channel in ieee80211_set_disassoc() to the end of
the function together with the flag resetting (which
needs to be at the end to avoid timers setting flags.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: remove mesh config macros from mesh_plink.c
Marco Porsch [Thu, 22 Nov 2012 02:40:32 +0000 (18:40 -0800)]
mac80211: remove mesh config macros from mesh_plink.c

Use shortcut pointer instead where it is appropriate.

Signed-off-by: Marco Porsch <marco.porsch@etit.tu-chemnitz.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: refactor ieee80211_set_qos_hdr
Marco Porsch [Thu, 22 Nov 2012 02:40:31 +0000 (18:40 -0800)]
mac80211: refactor ieee80211_set_qos_hdr

Return early if not a QoS Data frame.
Give proper documentation.

Signed-off-by: Marco Porsch <marco.porsch@etit.tu-chemnitz.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: move Mesh Capability field definition to ieee80211.h
Marco Porsch [Thu, 22 Nov 2012 02:40:30 +0000 (18:40 -0800)]
mac80211: move Mesh Capability field definition to ieee80211.h

Signed-off-by: Marco Porsch <marco.porsch@etit.tu-chemnitz.de>
[prefix with IEEE80211_]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: in ADHOC print debug message for every Auth message
Antonio Quartulli [Sun, 25 Nov 2012 22:24:27 +0000 (23:24 +0100)]
mac80211: in ADHOC print debug message for every Auth message

The debug message has to be printed also for an Auth message with
auth_sequence != 1. This helps understanding whether the two Auth
messages are exchanged correctly or not.

Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: in ADHOC don't update last_rx if sta is not authorized
Antonio Quartulli [Sun, 25 Nov 2012 22:13:42 +0000 (23:13 +0100)]
mac80211: in ADHOC don't update last_rx if sta is not authorized

It does not make sense to keep a station alive if it is not authorised
at all. If IBSS/RSN is used it could also be the case that something
went wrong during the keys exchange and the stations ended up in a not
recoverable state.

By not updating last_rx we are giving the station a chance to be
deleted and to start the key exchange once again from scratch.

Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: change function signature of cfg80211_get_p2p_attr()
Arend van Spriel [Sun, 25 Nov 2012 18:13:28 +0000 (19:13 +0100)]
cfg80211: change function signature of cfg80211_get_p2p_attr()

The function cfg80211_get_p2p_attr() can fail and returns
a negative error code. However, the return type is unsigned
int. The largest positive number is determined by desired_len
variable in the function, which is u16. So changing the return
type to int to allow easy error checking. Also change the type
for the attribute to enum for improved type checking.

Signed-off-by: Arend van Spriel <arend@broadcom.com>
[fix indentation, don't use u8 attr variable]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: use DS or HT operation IEs to determine BSS channel
Johannes Berg [Fri, 23 Nov 2012 13:23:30 +0000 (14:23 +0100)]
cfg80211: use DS or HT operation IEs to determine BSS channel

Currently, mac80211 checks the DS params IE if present and
uses it for the (primary) BSS channel, instead of the one
that the frame was received on. This is particularly useful
in the 2.4 GHz band since a frame is often received on one
of the adjacent channels due to overlap.

Move this code to cfg80211 so other drivers also do this.

Additionally, on 5 GHz, in particular with some (possibly)
upcoming changes in 802.11ai and duplicate transmissions
when wider channels are used, something similar happens.
So if present, also use the (primary) channel information
contained in the HT operation IE.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: disable HT advertising unless AP supports it
Johannes Berg [Thu, 22 Nov 2012 13:34:05 +0000 (14:34 +0100)]
mac80211: disable HT advertising unless AP supports it

If the AP doesn't support HT, or more importantly if
it does but we have to disable it because its IEs are
broken, don't advertise HT support in our association
request. Otherwise, we configure our channel to be a
20 MHz non-HT channel but the AP might still think we
support HT, or even 40 MHz.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: rename IEEE80211_STA_DISABLE_11N to HT
Johannes Berg [Thu, 22 Nov 2012 13:32:09 +0000 (14:32 +0100)]
mac80211: rename IEEE80211_STA_DISABLE_11N to HT

Since the 11n spec amendment was rolled into the
2012 version, "11n" no longer makes sense. Use
"HT" instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: fix RX chains configuration
Johannes Berg [Thu, 22 Nov 2012 13:17:23 +0000 (14:17 +0100)]
mac80211: fix RX chains configuration

If the driver doesn't support 40 MHz channels, then
mac80211 erroneously sets number of RX chains to one
although the number of chains is independent of the
support for 40 MHz channels.

Fix this by checking the 40 MHz support only for the
code that sets the 40 MHz channel not the complete
HT code block.

This also means the HT20 channel type will always be
set in the changed code block so there's no need to
set it in case we override the AP due to invalid IEs
in the probe response/beacon.

The indentation is a bit quirky, but I'm rewriting
this code for VHT support so this will change again
very soon.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: fix radiotap vendor area skipping
Johannes Berg [Thu, 22 Nov 2012 09:20:58 +0000 (10:20 +0100)]
mac80211: fix radiotap vendor area skipping

The radiotap vendor area in the skb head must be skipped
and accounted for in a few functions until it is removed.
I missed this in my patch, so a few places use this data
as though it was the 802.11 header, fix these places.

Reported-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Tested-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agortl8723ae: fix build break from "mac80211: support RX_FLAG_MACTIME_END"
John W. Linville [Wed, 21 Nov 2012 19:59:46 +0000 (14:59 -0500)]
rtl8723ae: fix build break from "mac80211: support RX_FLAG_MACTIME_END"

  CC      drivers/net/wireless/rtlwifi/rtl8723ae/trx.o
drivers/net/wireless/rtlwifi/rtl8723ae/trx.c: In function â€˜rtl8723ae_rx_query_desc’:
drivers/net/wireless/rtlwifi/rtl8723ae/trx.c:324:21: error: â€˜RX_FLAG_MACTIME_MPDU’ undeclared (first use in this function)
drivers/net/wireless/rtlwifi/rtl8723ae/trx.c:324:21: note: each undeclared identifier is reported only once for each function it appears in
make[3]: *** [drivers/net/wireless/rtlwifi/rtl8723ae/trx.o] Error 1

Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
John W. Linville [Wed, 21 Nov 2012 19:43:51 +0000 (14:43 -0500)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next

11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Wed, 21 Nov 2012 19:38:49 +0000 (14:38 -0500)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

Conflicts:
drivers/net/wireless/iwlwifi/pcie/trans.c

11 years agobrcmsmac: Remove stray argument from debug macro
Seth Forshee [Wed, 21 Nov 2012 15:24:31 +0000 (09:24 -0600)]
brcmsmac: Remove stray argument from debug macro

One of the debug macro invocations ended up with a stray 0 argument
where the format string should be. Remove it.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Remove unused wlc_prio2prec_map and _BRCMS_PREC_* constants
Seth Forshee [Wed, 21 Nov 2012 15:24:30 +0000 (09:24 -0600)]
brcmsmac: Remove unused wlc_prio2prec_map and _BRCMS_PREC_* constants

Fixes sparse warning:
drivers/net/wireless/brcm80211/brcmsmac/main.c:308:10: sparse: symbol 'wlc_prio2prec_map' was not declared. Should it be static?

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Remove 'stations' debugfs file
Sujith Manoharan [Wed, 21 Nov 2012 12:43:15 +0000 (18:13 +0530)]
ath9k: Remove 'stations' debugfs file

The 'stations' debugfs file has multiple issues. It doesn't scale
to an arbitrary number of associated stations and allocating
64K is not elegant either. Now that changes have been made in
mac80211 to support dynamic creation/deletion of driver-specific
debugfs files on station addition/removal, remove this file and
make use of the mac80211 hooks (which will be done in a sebsequent
patch).

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Fix rate control debugging
Sujith Manoharan [Wed, 21 Nov 2012 12:43:14 +0000 (18:13 +0530)]
ath9k: Fix rate control debugging

Update the rate statistics only when debugfs has been enabled
in ath9k and mac80211 and move the stat() functions under proper
conditionals.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Fill remove_sta_debugfs() callback
Sujith Manoharan [Wed, 21 Nov 2012 12:43:13 +0000 (18:13 +0530)]
ath9k: Fill remove_sta_debugfs() callback

Remove the rate control statistics debugfs file properly
via remove_sta_debugfs(). Also, check for both MAC80211_DEBUGFS
and ATH9K_DEBUGFS config options.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Add a debugfs file to dump queue statistics
Sujith Manoharan [Wed, 21 Nov 2012 12:43:12 +0000 (18:13 +0530)]
ath9k: Add a debugfs file to dump queue statistics

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Fix the 'xmit' debugfs file
Sujith Manoharan [Wed, 21 Nov 2012 12:43:11 +0000 (18:13 +0530)]
ath9k: Fix the 'xmit' debugfs file

The 'xmit' debugfs file has become big and unwieldy, fix
multiple issues with its usage:

* Store TX counters/statistics only for the 4 Access Categories.
  Use IEEE80211_NUM_ACS instead of ATH9K_NUM_TX_QUEUES.

* Move various utility macros to debug.h, they can be reused
  elsewhere.

* Remove tx_complete_poll_work_seen.

* Remove code that accesses various internal queue-specific
  variables without any locking whatsoever. HW/SW queue details
  will be handled in a subsequent patch.

* Do not print internal values like txq_headidx and txq_headidx.
  They were mostly unused anyway, considering code like:
  PRX("txq_tailidx:     ", txq_headidx);

* Handle 'txprocdesc' for EDMA too.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k/ath9k_htc: Remove WME macros
Sujith Manoharan [Wed, 21 Nov 2012 12:43:10 +0000 (18:13 +0530)]
ath9k/ath9k_htc: Remove WME macros

Use the macros provided by mac80211 and remove redundant
declarations inside the drivers.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agonet/wireless: ipw2200: introduce ipw_set_geo function
Stanislav Yakovlev [Tue, 20 Nov 2012 23:54:20 +0000 (23:54 +0000)]
net/wireless: ipw2200: introduce ipw_set_geo function

Move regulatory domain initialization code to a separate function.

Signed-off-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: stomp audio profiles on weak signal strength
Rajkumar Manoharan [Tue, 20 Nov 2012 13:00:01 +0000 (18:30 +0530)]
ath9k: stomp audio profiles on weak signal strength

On lower WLAN signal strength, WLAN downlink traffic might suffer
from retransmissions. At the mean time, playing SCO/A2DP profiles
is affecting WLAN stability. In such scenario, by stomping SCO/A2DP
BT traffic completely for a BTCOEX period, gives WLAN traffic an
oppertunity to recover PHY rate. It also improves WLAN stability at
lower RSSI without sacificing BT traffic.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Fix MCI reset in BT cal_req
Rajkumar Manoharan [Tue, 20 Nov 2012 13:00:00 +0000 (18:30 +0530)]
ath9k: Fix MCI reset in BT cal_req

This patch reverts the commit "ath9k_hw: Wait BT calibration to complete"
and bail out from MCI interrupt routine for chip reset. The above commit
stalls the WLAN TCP traffic while bringing up and down the BT interface
iteratively. Fixing this properly by queueing up chip reset and bailing
out properly from tasklet routine.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Process FATAL interrupts at first
Rajkumar Manoharan [Tue, 20 Nov 2012 12:59:59 +0000 (18:29 +0530)]
ath9k: Process FATAL interrupts at first

FATAL and WATCHDOG interrupts should be processed first followed
by others.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetoot...
John W. Linville [Wed, 21 Nov 2012 18:03:00 +0000 (13:03 -0500)]
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next

11 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
John W. Linville [Wed, 21 Nov 2012 17:57:56 +0000 (12:57 -0500)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless

Conflicts:
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
drivers/net/wireless/iwlwifi/pcie/tx.c

11 years agomac80211: Add debugfs callbacks for station addition/removal
Sujith Manoharan [Tue, 20 Nov 2012 03:16:02 +0000 (08:46 +0530)]
mac80211: Add debugfs callbacks for station addition/removal

Provide drivers with hooks to create debugfs files when
a new station is added. This would help drivers to take
advantage of mac80211's station list infrastructure and not maintain
tedious station management code internally.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
[ifdef inline wrapper functions]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: fix the basic CCK rates calculation
Emmanuel Grumbach [Tue, 20 Nov 2012 14:31:25 +0000 (16:31 +0200)]
iwlwifi: fix the basic CCK rates calculation

Fix a copy paste error in iwl_calc_basic_rates which leads
to a wrong calculation of CCK basic rates.

Cc: stable@vger.kernel.org
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: remove effectless assignment
Emmanuel Grumbach [Tue, 20 Nov 2012 11:49:24 +0000 (13:49 +0200)]
iwlwifi: remove effectless assignment

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agobrcmfmac: include linux/vmalloc.h from usb.c
John W. Linville [Mon, 19 Nov 2012 16:04:28 +0000 (11:04 -0500)]
brcmfmac: include linux/vmalloc.h from usb.c

This avoids build failures on some architectures...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
11 years agobrcmfmac: check return from kzalloc in brcmf_fweh_process_event
John W. Linville [Mon, 19 Nov 2012 15:53:32 +0000 (10:53 -0500)]
brcmfmac: check return from kzalloc in brcmf_fweh_process_event

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
11 years agobrcmsmac: Remove some noisy and uninformative debug messages
Seth Forshee [Thu, 15 Nov 2012 14:08:12 +0000 (08:08 -0600)]
brcmsmac: Remove some noisy and uninformative debug messages

These messages clutter up the trace buffer without adding any useful
information.

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add tracepoint for AMPDU session information
Seth Forshee [Thu, 15 Nov 2012 14:08:11 +0000 (08:08 -0600)]
brcmsmac: Add tracepoint for AMPDU session information

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add tracepoint for macintstatus
Seth Forshee [Thu, 15 Nov 2012 14:08:10 +0000 (08:08 -0600)]
brcmsmac: Add tracepoint for macintstatus

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Improve tx trace and debug support
Seth Forshee [Thu, 15 Nov 2012 14:08:09 +0000 (08:08 -0600)]
brcmsmac: Improve tx trace and debug support

Add the brcmsmac_tx trace system for tx debugging. Existing code to dump
tx status and descriptors are converted to using tracepoints, allowing
for more efficient collection and post-processing of this data. These
tracepoints are placed to collect data for all tx frames instead of only
on errors. Logging of tx errors is also improved.

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add brcms_dbg_ht() debug macro
Seth Forshee [Thu, 15 Nov 2012 14:08:08 +0000 (08:08 -0600)]
brcmsmac: Add brcms_dbg_ht() debug macro

Also convert relevant messages to use this macro.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add brcms_dbg_dma() debug macro
Seth Forshee [Thu, 15 Nov 2012 14:08:07 +0000 (08:08 -0600)]
brcmsmac: Add brcms_dbg_dma() debug macro

Also convert relevant messages to use this macro.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add brcms_dbg_int() debug macro
Seth Forshee [Thu, 15 Nov 2012 14:08:06 +0000 (08:08 -0600)]
brcmsmac: Add brcms_dbg_int() debug macro

Also convert relevant message to use this macro.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add rx and tx debug macros
Seth Forshee [Thu, 15 Nov 2012 14:08:05 +0000 (08:08 -0600)]
brcmsmac: Add rx and tx debug macros

Also convert relevant messages over to use thses macros.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add brcms_dbg_mac80211() debug macro
Seth Forshee [Thu, 15 Nov 2012 14:08:04 +0000 (08:08 -0600)]
brcmsmac: Add brcms_dbg_mac80211() debug macro

This macro is used for messages related to the 802.11 MAC layer.
Relevant messages are also converted to use this macro.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Use debug macros for general error and debug statements
Seth Forshee [Thu, 15 Nov 2012 14:08:03 +0000 (08:08 -0600)]
brcmsmac: Use debug macros for general error and debug statements

Convert most uses of wiphy_* and pr_* for general error and debug
messages to use the internal debug macros instead. Most code used only
for initialization still use wiphy_err(), as well as some locations
which are executed too early to use the debug macros. Some debug
messages which are redundant or not useful are removed.

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add support for writing debug messages to the trace buffer
Seth Forshee [Thu, 15 Nov 2012 14:08:02 +0000 (08:08 -0600)]
brcmsmac: Add support for writing debug messages to the trace buffer

Add a new brcmsmac_msg trace system to enable writing of debug messages
to the trace buffer, and add brcms_* macros for storing device debug
messages in the trace buffer in addition to the printk log buffer.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add module parameter for setting the debug level
Seth Forshee [Thu, 15 Nov 2012 14:08:01 +0000 (08:08 -0600)]
brcmsmac: Add module parameter for setting the debug level

The debug level can be set by passing debug=... to brcmsmac whenever
CONFIG_BRCMDBG is enabled.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcm80211: Convert log message levels to debug levels
Seth Forshee [Thu, 15 Nov 2012 14:08:00 +0000 (08:08 -0600)]
brcm80211: Convert log message levels to debug levels

In preparation for enhancements to debug and trace support, convert the
message levels to debug levels which will be used for enabling
categories of debug messages. The two message levels are little-used
anyway and are combined into the BRCM_DL_INFO debug level.

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcm80211: Allow trace support to be enabled separately from debug
Seth Forshee [Thu, 15 Nov 2012 14:07:59 +0000 (08:07 -0600)]
brcm80211: Allow trace support to be enabled separately from debug

Since the runtime overhead of trace support is small when tracing is
disabled, users may be interested in turning on trace support while
leaving other debug features off. Add a new config option named
CONFIG_BRCM_TRACING for this purpose.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Reduce number of entries in tx DMA rings
Seth Forshee [Thu, 15 Nov 2012 14:07:58 +0000 (08:07 -0600)]
brcmsmac: Reduce number of entries in tx DMA rings

Currently up to 256 frames can be queued for each DMA ring. This is
excessive, and now that we have better flow control we can get by with
less. Experimentation has shown 64 to work well.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Use correct descriptor count when calculating next rx descriptor
Seth Forshee [Thu, 15 Nov 2012 14:07:57 +0000 (08:07 -0600)]
brcmsmac: Use correct descriptor count when calculating next rx descriptor

nextrxd() is calling txd(), which means that the tx descriptor count is
used to determine when to wrap for determining the next ring buffer
entry. This has worked so far since the driver has been using the same
number of rx and tx descriptors, but it's obviously going to be a
problem if different numbers of descriptors are used.

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Remove internal tx queue
Seth Forshee [Thu, 15 Nov 2012 14:07:56 +0000 (08:07 -0600)]
brcmsmac: Remove internal tx queue

The brcmsmac internal tx buffering is problematic. The amount of
buffering is excessive (228 packets in addition to the 256 slots in each
DMA ring), and frames may be dropped due to a lack of flow control.

This patch reworks the transmit code path to remove the internal
buffering. Frames are immediately handed off to the DMA support rather
than passing through an intermediate queue. Non-aggregate frames are
queued immediately into the tx rings, and aggregate frames are queued
temporarily in an AMPDU session until ready for transmit.

Transmit flow control is also added to avoid dropping packets when the
tx rings are full. Conceptually this is a separate change, but it's
included in this commit because removing the tx queue without adding
flow control could cause significant problems.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Use IEEE 802.11 AC levels for pktq precedence levels
Seth Forshee [Thu, 15 Nov 2012 14:07:55 +0000 (08:07 -0600)]
brcmsmac: Use IEEE 802.11 AC levels for pktq precedence levels

The mac80211 tx queues and brcmsmac DMA fifos both map directly to AC
levels. Therefore it's much more straightforward to queue tx frames and
choose the tx fifo based on the mac80211 queue instead of mapping 802.1D
priority tags to precedence levels then back to AC levels. mac80211
already maps the 802.1D levels to the appropriate AC levels and queues
management frames at the maximum priority, so the results should be
identical.

One functional change resulting from this patch is that AMPDU retries no
longer get a priority boost to queue them ahead of packets with the same
priority already in the tx queue. This behavior will be restored (in
effect at least) in a later patch when the tx queue is removed.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Remove unimplemented flow control functions
Seth Forshee [Thu, 15 Nov 2012 14:07:54 +0000 (08:07 -0600)]
brcmsmac: Remove unimplemented flow control functions

Functions for flow control exist but remain unimplemented. Remove these
in advance of adding real flow control.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>