]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
12 years agoiwlwifi: iwl_rx_cmd_buffer belongs to transport API
Johannes Berg [Mon, 5 Mar 2012 19:24:43 +0000 (11:24 -0800)]
iwlwifi: iwl_rx_cmd_buffer belongs to transport API

This is how the transport passes things
up into higher layers, so it belongs to
the transport API.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: move queue functions to PCI-E
Johannes Berg [Mon, 5 Mar 2012 19:24:42 +0000 (11:24 -0800)]
iwlwifi: move queue functions to PCI-E

iwl_queue_inc_wrap/iwl_queue_dec_wrap aren't
shared functions, they are PCI-E specific,
so move them into the appropriate header.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: transport's tx_agg_alloc must not sleep
Johannes Berg [Mon, 5 Mar 2012 19:24:41 +0000 (11:24 -0800)]
iwlwifi: transport's tx_agg_alloc must not sleep

The annotation/documentation is wrong, we call
it in a context that can't sleep.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: refactor PCI-E RX path
Johannes Berg [Mon, 5 Mar 2012 19:24:40 +0000 (11:24 -0800)]
iwlwifi: refactor PCI-E RX path

Just make the code easier to read with less indentation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: don't pass iwl_rx_mem_buffer to upper layers
Johannes Berg [Mon, 5 Mar 2012 19:24:39 +0000 (11:24 -0800)]
iwlwifi: don't pass iwl_rx_mem_buffer to upper layers

struct iwl_rx_mem_buffer implementation details
(DMA address, list pointers) that the upper
layers don't need. Introduce iwl_rx_cmd_buffer
that is passed upstream and only contains the
needed data (the page). Additionally, access
this data only via accessor functions, allowing
us to change the implementation in the future.
These accessors are rxb_addr() (as before) and
rxb_steal_page() to take ownership of the data.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: pass response packet directly
Johannes Berg [Mon, 5 Mar 2012 19:24:38 +0000 (11:24 -0800)]
iwlwifi: pass response packet directly

When CMD_WANT_SKB is set for a (synchronous)
command, the response is passed back to the
caller which is then responsible for freeing
it. Make this more abstract with real API,
passing directly the response packet in the
new cmd.resp_pkt member and also introduce
iwl_free_resp() to free the pages -- this
way the upper layers don't have to directly
touch the page implementation.

NOTE: This breaks IDI -- the new code isn't reflected there yet!

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: use ieee80211_tx_status
Johannes Berg [Mon, 5 Mar 2012 19:24:37 +0000 (11:24 -0800)]
iwlwifi: use ieee80211_tx_status

We currently use the _irqsafe version, but that
isn't recommended together with ieee80211_rx()
as it can cause races. If the device reports
a TX-status and RX in that order then with the
current combination mac80211 might process them
in the other order, which can cause issues with
powersaving clients.

Use ieee80211_tx_status() to avoid this race.
Since we don't want to call it with locks held,
process the frame queues later -- this is fine
as they are on the stack.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: move wowlan bool into priv
Johannes Berg [Mon, 5 Mar 2012 19:24:36 +0000 (11:24 -0800)]
iwlwifi: move wowlan bool into priv

With the new WoWLAN flow into the transport
there no longer is a need for this to be
shared, so move it into priv.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: clean up (wowlan) suspend flow
Johannes Berg [Mon, 5 Mar 2012 19:24:35 +0000 (11:24 -0800)]
iwlwifi: clean up (wowlan) suspend flow

In the WoWLAN suspend flow, instead of accessing
registers directly, ask the transport to do the
required setup at the end of suspend. If the
transport doesn't implement this, don't tell the
stack we support WoWLAN.

When the device suspends w/o WoWLAN, mac80211
will have stopped it already, which has already
called iwl_apm_stop() via stop_hw(). Thus, it
isn't necessary to call it again in pcie_suspend
and we can simply do nothing there.

This unifies the regular and WoWLAN suspend.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: reduce IDI code ifdef
Johannes Berg [Mon, 5 Mar 2012 19:24:34 +0000 (11:24 -0800)]
iwlwifi: reduce IDI code ifdef

The code in the two branches of the #ifdef
is almost the same so move the common code
outside the #ifdef.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: make config const
Johannes Berg [Mon, 5 Mar 2012 19:24:33 +0000 (11:24 -0800)]
iwlwifi: make config const

Writing to the global config structures
is always wrong. To protect against such
mistakes in the future, mark them const.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: use valid TX/RX antenna from hw_params
Johannes Berg [Mon, 5 Mar 2012 19:24:32 +0000 (11:24 -0800)]
iwlwifi: use valid TX/RX antenna from hw_params

It's not really a good idea to write to the
global static configuration. Use the valid
TX/RX antenna information only from the HW
params struct except in the case where the
values from the config are used to override
the values from the EEPROM.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: remove SKU from config
Johannes Berg [Mon, 5 Mar 2012 19:24:31 +0000 (11:24 -0800)]
iwlwifi: remove SKU from config

There's no SKU override, we always just use
it from EEPROM. As such, we can remove it
from the config and use it in hw_param only.
Since iwl_eeprom_check_sku() really needs
to fill it in also rename that to
iwl_eeprom_init_hw_params().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: remove per-device debug level
Johannes Berg [Mon, 5 Mar 2012 19:24:30 +0000 (11:24 -0800)]
iwlwifi: remove per-device debug level

There's no need for the per-device debug
level that we expose in debugfs since the
module parameter is writable in sysfs.

At the same time, simplify code by changing
    iwl_get_debug_level(shrd) & IWL_DL_ISR)
to
    iwl_have_debug_level(IWL_DL_ISR)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: simplify auth/assoc flow
Johannes Berg [Mon, 5 Mar 2012 19:24:29 +0000 (11:24 -0800)]
iwlwifi: simplify auth/assoc flow

With mac80211 now giving us station information
(via the sta_state callback) before auth/assoc
we can get rid of tx_sync by adding the station
early for the case of managed interfaces. Keep
AP mode actions the same for now.

As we now get the BSSID early, we can also get
rid of iwl_reprogram_ap_sta().

We can still optimise the number of RXONs we
send to the device, but that can be done later.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: make EXIT_PENDING depend on mac80211
Johannes Berg [Mon, 5 Mar 2012 19:24:28 +0000 (11:24 -0800)]
iwlwifi: make EXIT_PENDING depend on mac80211

There's no reason to set EXIT_PENDING when we
start removing the module, as mac80211 will
cleanly shut down the device in this case.
Additionally, there's no point in rejecting
commands to the device when we're cleaning up
as that only leads to unwanted errors from
mac80211 being printed, such as
  failed to remove key (...) from hardware (-16)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: remove shared lock
Johannes Berg [Mon, 5 Mar 2012 19:24:27 +0000 (11:24 -0800)]
iwlwifi: remove shared lock

Some data doesn't need protection, some of the
lock places are simply useless, and some data
can be protected with the mutex instead. Thus
the shared lock can be removed by making those
changes.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: introduce statistics lock
Johannes Berg [Mon, 5 Mar 2012 19:24:26 +0000 (11:24 -0800)]
iwlwifi: introduce statistics lock

The statistics are currently only half-heartedly
locked against concurrent reading & modification
so introduce a lock to really protect them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: make sta lock private & BH lock
Johannes Berg [Mon, 5 Mar 2012 19:24:25 +0000 (11:24 -0800)]
iwlwifi: make sta lock private & BH lock

Now that the transport has its own locking,
there's no need to have the sta_lock in the
shared data. Also, it can be a BH lock as
it's not used from IRQ handlers.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: introduce per-queue locks
Johannes Berg [Mon, 5 Mar 2012 19:24:24 +0000 (11:24 -0800)]
iwlwifi: introduce per-queue locks

Instead of (ab)using the sta_lock, make the
transport layer lock its own TX queue data
structures with a lock per queue. This also
unifies with the cmd queue lock.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: build some station commands directly
Johannes Berg [Mon, 5 Mar 2012 19:24:23 +0000 (11:24 -0800)]
iwlwifi: build some station commands directly

In the powersave related functions we only need
to set a few parameters for the station command
and can otherwise leave it blank -- there's no
need to copy it from the database.

This allows us to not use the sta lock here.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: simplify code in iwlagn_key_sta_id
Johannes Berg [Mon, 5 Mar 2012 19:24:22 +0000 (11:24 -0800)]
iwlwifi: simplify code in iwlagn_key_sta_id

Simplify the code by returning directly in the
error case and replacing the switch/if with a
single if statement.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: reduce sta_lock hold time in TX
Johannes Berg [Mon, 5 Mar 2012 19:24:21 +0000 (11:24 -0800)]
iwlwifi: reduce sta_lock hold time in TX

When we TX, we hold the sta_lock for a long
time, a lot of which isn't needed. Reduce
the time we hold the lock. Note that this
doesn't really change anything as the code
is already under the other spinlock, but it
makes the code easier to read.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: remove an unused argument
Johannes Berg [Mon, 5 Mar 2012 19:24:20 +0000 (11:24 -0800)]
iwlwifi: remove an unused argument

The station ID argument to the function
iwlagn_tx_cmd_build_hwcrypto isn't used
so remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: move iwl_clear_driver_stations to user
Johannes Berg [Mon, 5 Mar 2012 19:24:19 +0000 (11:24 -0800)]
iwlwifi: move iwl_clear_driver_stations to user

There's only one place using this function, so
move it where it's needed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoairo: fix test for FLAG_RADIO_DOWN
Dan Carpenter [Mon, 5 Mar 2012 18:10:07 +0000 (21:10 +0300)]
airo: fix test for FLAG_RADIO_DOWN

We should be doing a shift (1 << FLAG_RADIO_DOWN) here before testing
the flag.  As luck would have it, this test works almost correctly.
The current code tests for FLAG_RADIO_OFF instead of FLAG_RADIO_DOWN.

#define FLAG_RADIO_OFF  0       /* User disabling of MAC */
#define FLAG_RADIO_DOWN 1       /* ifup/ifdown disabling of MAC */

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: always monitor for stuck queues
Johannes Berg [Sun, 4 Mar 2012 16:50:46 +0000 (08:50 -0800)]
iwlwifi: always monitor for stuck queues

If we only monitor while associated, the following
can happen:
 - we're associated, and the queue stuck check
   runs, setting the queue "touch" time to X
 - we disassociate, stopping the monitoring,
   which leaves the time set to X
 - almost 2s later, we associate, and enqueue
   a frame
 - before the frame is transmitted, we monitor
   for stuck queues, and find the time set to
   X, although it is now later than X + 2000ms,
   so we decide that the queue is stuck and
   erroneously restart the device

It happens more with P2P because there we can
go between associated/unassociated frequently.

Cc: stable@vger.kernel.org
Reported-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agop54pci: use new driver.pm interface for suspend/resume
Christian Lamparter [Sat, 3 Mar 2012 20:25:19 +0000 (21:25 +0100)]
p54pci: use new driver.pm interface for suspend/resume

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agop54: pass interface setup errors back to mac80211
Christian Lamparter [Sat, 3 Mar 2012 20:24:43 +0000 (21:24 +0100)]
p54: pass interface setup errors back to mac80211

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agortlwifi: rtl8192ce: Fix loss of receive performance
Jingjun Wu [Sat, 3 Mar 2012 02:52:14 +0000 (20:52 -0600)]
rtlwifi: rtl8192ce: Fix loss of receive performance

Driver rtl8192ce when used with the RTL8188CE device would start at about
20 Mbps on a 54 Mbps connection, but quickly drop to 1 Mbps. One of the
symptoms is that the AP would need to retransmit each packet 4 of 5 times
before the driver would acknowledge it. Recovery is possible only by
unloading and reloading the driver. This problem was reported at
https://bugzilla.redhat.com/show_bug.cgi?id=770207.

The problem is due to a missing update of the gain setting.

Signed-off-by: Jingjun Wu <jingjun_wu@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath5k: allow AP and mesh mode to operate simultaneously
Chun-Yeow Yeoh [Sat, 3 Mar 2012 01:48:56 +0000 (09:48 +0800)]
ath5k: allow AP and mesh mode to operate simultaneously

This patch allows the possibility of having the mesh point and AP to be operated
simultaneously in one single radio. Previously, mesh point fails to generate the
mesh beacon if virtual AP is created for the same radio.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocfg80211/mac80211: report signal strength for mgmt frames
Johannes Berg [Mon, 5 Mar 2012 21:18:41 +0000 (22:18 +0100)]
cfg80211/mac80211: report signal strength for mgmt frames

Add the signal strength (in dBm only for now) to
frames that are received via nl80211's various
frame APIs.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcm80211: smac: cleanup couple of debug output statements
Arend van Spriel [Fri, 2 Mar 2012 21:55:51 +0000 (22:55 +0100)]
brcm80211: smac: cleanup couple of debug output statements

Tidying up some debug statements in brcms_c_ampdu_dotxstatus_complete()
that got broken strings to satisfy checkpatch, but the rules changed.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcm80211: smac: remove firmware requests from init_module syscall
Arend van Spriel [Fri, 2 Mar 2012 21:55:50 +0000 (22:55 +0100)]
brcm80211: smac: remove firmware requests from init_module syscall

As indicated in [1] on netdev mailing list drivers should not block
on the init_module() syscall. This patch defers the actual driver
registration to a workqueue so the init_module() syscall can complete
without delay.

[1] http://article.gmane.org/gmane.linux.network/217729/

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcm80211: fmac: remove firmware requests from init_module syscall
Arend van Spriel [Fri, 2 Mar 2012 21:55:49 +0000 (22:55 +0100)]
brcm80211: fmac: remove firmware requests from init_module syscall

As indicated in [1] on netdev mailing list drivers should not block
on the init_module() syscall. This patch defers the actual driver
registration to a workqueue so the init_module() syscall can complete
without delay.

[1] http://article.gmane.org/gmane.linux.network/217729/

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcm80211: fmac: initialize host interface drivers regardless result
Arend van Spriel [Fri, 2 Mar 2012 21:55:48 +0000 (22:55 +0100)]
brcm80211: fmac: initialize host interface drivers regardless result

The module init function of brcmfmac calls init functions for SDIO and
USB doing driver registration. This patch removes terminating the module
init when a driver registration for one host interface fails.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcm80211: fmac: use counters in brcmf_bus structure
Arend van Spriel [Fri, 2 Mar 2012 21:55:47 +0000 (22:55 +0100)]
brcm80211: fmac: use counters in brcmf_bus structure

The usb code defines a structure for counting statistics. However,
it should use the statistics entry provided in brcmf_bus as that is
exposed to the net_device. The usb private statistics counter only
remains with counters for control packets between driver and usb
device.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcm80211: fmac: remove brcmf_usb_attrib structure
Arend van Spriel [Fri, 2 Mar 2012 21:55:46 +0000 (22:55 +0100)]
brcm80211: fmac: remove brcmf_usb_attrib structure

Several fields in this structure are only written once or not used
at all. Remaining two fields have been moved and brcmf_usb_attrib
definition has been removed.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Kan Yan <kanyan@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcm80211: fmac: remove unnecessary NULL pointer check
Arend van Spriel [Fri, 2 Mar 2012 21:55:45 +0000 (22:55 +0100)]
brcm80211: fmac: remove unnecessary NULL pointer check

In brcmf_usb_up() the variable devinfo was checked for being
a NULL pointer, but this can not happen. Also the check was done
after dereferencing the pointer. This patch removes the check.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Kan Yan <kanyan@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agortlwifi: rtl8192c: Prevent sleeping from invalid context in rtl8192cu
Larry Finger [Fri, 2 Mar 2012 21:23:36 +0000 (15:23 -0600)]
rtlwifi: rtl8192c: Prevent sleeping from invalid context in rtl8192cu

When driver rtl8192cu is used with the debug level set to 3 or greater,
the result is "sleeping function called from invalid context" due to
an rcu_read_lock() call in the DM refresh routine in driver rtl8192c.
This lock is not necessary as the USB driver does not use the struct
being protected, thus the lock is set only when a PCI interface is
active.

This bug is reported in https://bugzilla.kernel.org/show_bug.cgi?id=42775.

Reported-by: Ronald Wahl <ronald.wahl@raritan.com>
Tested-by: Ronald Wahl <ronald.wahl@raritan.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Cc: Ronald Wahl <ronald.wahl@raritan.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agortlwifi: Remove extraneous value return
Larry Finger [Fri, 2 Mar 2012 19:22:46 +0000 (13:22 -0600)]
rtlwifi: Remove extraneous value return

In usb.c, routine _rtl_usb_init_sw() always returns 0, and rtl_usb_probe()
never checks the returned value. Thus we can change _rtl_usb_init_sw() to
a void routine. In addition, remove the underscore at the beginning of the
name of the routine.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agortlwifi: Detect misread of end-point count
Larry Finger [Fri, 2 Mar 2012 19:21:22 +0000 (13:21 -0600)]
rtlwifi: Detect misread of end-point count

In the unlikely event of a misread of the USB end point count, the driver
generates a divide fault. To prevent this, add a check of the value
returned by _rtl_usb_init(). In addition, add some logging to indicate
why the condition occurred.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: combine QoS with other BSS changes
Johannes Berg [Fri, 2 Mar 2012 14:56:59 +0000 (15:56 +0100)]
mac80211: combine QoS with other BSS changes

When associating and particularly when disassociating
there's no need to notify the driver about changes
with multiple calls to bss_info_changed, we should
combine the QoS enabling/disabling into the same call
as otherwise the driver could get confused about QoS
suddenly getting disabled while connected.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: use common radiotap code for cooked monitors
Johannes Berg [Fri, 2 Mar 2012 12:18:19 +0000 (13:18 +0100)]
mac80211: use common radiotap code for cooked monitors

There's no need to hardcode a subset of the
radiotap header for cooked monitor receive,
we can just reuse the normal monitor mode
radiotap code. This simplifies the code and
extends the information available on cooked
monitor interfaces.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocfg80211: Add an attribute to set inactivity timeout in AP mode
Vasanthakumar Thiagarajan [Fri, 2 Mar 2012 10:20:02 +0000 (15:50 +0530)]
cfg80211: Add an attribute to set inactivity timeout in AP mode

This patch adds an attribute, NL80211_ATTR_INACTIVITY_TIMEOUT,
to set the inactivity timeout which can be used to remove the
station in AP mode. This can be passed in NL80211_CMD_START_AP
and used by the drivers which have AP MLME in firmware but
don't support get_station() properly. To disable inactivity
timer in userspace, wpa_s for example, there is a new flag,
NL80211_FEATURE_INACTIVITY_TIMER, in nl80211_feature_flags
through which drivers can register their capability to use
the inactivity timeout to free the stations.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: fix the support of setting non-forwarding entity in Mesh
Chun-Yeow Yeoh [Thu, 1 Mar 2012 18:03:19 +0000 (02:03 +0800)]
mac80211: fix the support of setting non-forwarding entity in Mesh

RANN, PREP and PERR propagation should happen only if the
dot11MeshForwarding is true.  Besides, data frame should not be
forwarded if dot11MeshForwarding is false. This redundant checking
is necessary to avoid the broadcasted ARP breaking the non-forwarding
rule.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: add an rx flag for ignoring a packet's signal strength
Felix Fietkau [Thu, 1 Mar 2012 17:00:07 +0000 (18:00 +0100)]
mac80211: add an rx flag for ignoring a packet's signal strength

For A-MPDU rx it makes sense to only process the signal strength once per
aggregate instead of once per subframe. Additonally, some hardware (e.g.
Atheros) only provides valid signal strength information for the last
subframe.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocfg80211: fix kernel-doc
Johannes Berg [Thu, 1 Mar 2012 14:28:19 +0000 (15:28 +0100)]
cfg80211: fix kernel-doc

I forgot to update the kernel-doc in my patch
to redesign AP mode APIs, fix that now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: use compare_ether_addr on MAC addresses instead of memcmp
Felix Fietkau [Thu, 1 Mar 2012 14:22:09 +0000 (15:22 +0100)]
mac80211: use compare_ether_addr on MAC addresses instead of memcmp

Because of the constant size and guaranteed 16 bit alignment, the inline
compare_ether_addr function is much cheaper than calling memcmp.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: use 16 bit alignment for the if_ibss bssid field
Felix Fietkau [Thu, 1 Mar 2012 10:23:37 +0000 (11:23 +0100)]
mac80211: use 16 bit alignment for the if_ibss bssid field

Several MAC address comparison functions assume 16 bit alignment for pointers
passed to them. Since the addition of the control_port field, alignment
for the IBSS bssid was off by one, causing a severe performance hit on
architectures without efficient unaligned access (e.g. MIPS).

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: endian bug in mwifiex_drv_change_adhoc_chan()
Dan Carpenter [Thu, 1 Mar 2012 07:22:30 +0000 (10:22 +0300)]
mwifiex: endian bug in mwifiex_drv_change_adhoc_chan()

In mwifiex_drv_change_adhoc_chan() we pass channel to
mwifiex_bss_ioctl_ibss_channel() which sets the high 16 bits.  This
works on little endian systems but not on big endian ones.  I've changed
mwifiex_drv_change_adhoc_chan() to use a 16 bit variable.  This matches
the other functions in the file.

I considered changing mwifiex_change_adhoc_chan() as well but it turns
out that the function isn't implemented so I just removed the
definition.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agop54spi: Release GPIO lines and IRQ on error in p54spi_probe
Max Filippov [Wed, 29 Feb 2012 20:40:08 +0000 (00:40 +0400)]
p54spi: Release GPIO lines and IRQ on error in p54spi_probe

This makes it possible to reload driver if insmod has failed due to
missing firmware.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Cc: stable <stable@vger.kernel.org>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agorndis_wlan: use u8 for key indexes
Jussi Kivilinna [Wed, 29 Feb 2012 14:25:05 +0000 (16:25 +0200)]
rndis_wlan: use u8 for key indexes

cfg80211 uses u8 for key indexes and so should rndis_wlan.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agorndis_wlan: use RNDIS_WLAN_NUM_KEYS for all key index checks
Jussi Kivilinna [Wed, 29 Feb 2012 14:25:00 +0000 (16:25 +0200)]
rndis_wlan: use RNDIS_WLAN_NUM_KEYS for all key index checks

Use new RNDIS_WLAN_NUM_KEYS for checks in add_wep_key() and add_wpa_key().

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agorndis_wlan: fix le16/le32_to_cpu mix up with config.beacon_period
Jussi Kivilinna [Wed, 29 Feb 2012 14:24:54 +0000 (16:24 +0200)]
rndis_wlan: fix le16/le32_to_cpu mix up with config.beacon_period

'beacon_period' in 'struct ndis_80211_conf' is __le32 instead of __le16 so
le32_to_cpu must be used instead of le16_to_cpu.

Also correct 'beacon_interval' variables used for passing this value forward
from u16 to u32 and rename those variables 'beacon_period' This is to avoid
confusion because 'beacon_interval' is defined as __le16 at other structure,
'struct ndis_80211_fixed_ies'.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agorndis_wlan: prevent integer overflow in indication()
Dan Carpenter [Wed, 29 Feb 2012 06:37:53 +0000 (09:37 +0300)]
rndis_wlan: prevent integer overflow in indication()

If we pick a high value for "offset" then it could lead to an integer
overflow and we would get past the check for:
if (offset + len > buflen) { ...

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agorndis_wlan: make some variables unsigned
Dan Carpenter [Wed, 29 Feb 2012 06:36:57 +0000 (09:36 +0300)]
rndis_wlan: make some variables unsigned

These variables can never be less than zero because we cap them in
get_device_pmkids().  Let's make them unsigned here because it's simpler
to not have to worry about negative numbers when we read the code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agorndis_wlan: remove unneeded variables
Dan Carpenter [Wed, 29 Feb 2012 06:36:28 +0000 (09:36 +0300)]
rndis_wlan: remove unneeded variables

We never use the "len" variable.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agorndis_wlan: integer overflows in rndis_wlan_do_link_up_work()
Dan Carpenter [Thu, 1 Mar 2012 07:02:08 +0000 (10:02 +0300)]
rndis_wlan: integer overflows in rndis_wlan_do_link_up_work()

If "offset" is negative then we can get past this check:
if (offset > CONTROL_BUFFER_SIZE)
Or if we pick a very high "req_ie_len" then we can get around the check:
if (offset + req_ie_len > CONTROL_BUFFER_SIZE)

I made "resp_ie_len" and "req_ie_len" unsigned.  I don't know if it was
intentional that they were signed in the original.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years ago{nl,cfg,mac}80211: Implement RSSI threshold for mesh peering
Ashok Nagarajan [Wed, 29 Feb 2012 01:04:08 +0000 (17:04 -0800)]
{nl,cfg,mac}80211: Implement RSSI threshold for mesh peering

Mesh peer links are established only if average rssi of the peer
candidate satisfies the threshold. This is not in 802.11s specification
but was requested by David Fulgham, an open80211s user. This is a way to avoid
marginal peer links with stations that are barely within range.

This patch adds a new mesh configuration parameter, mesh_rssi_threshold. This
feature is supported only for hardwares that report signal in dBm.

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agob43: prevent firmware on bcm5354 from taking over wrong GPIO pins
Hauke Mehrtens [Tue, 28 Feb 2012 19:45:06 +0000 (20:45 +0100)]
b43: prevent firmware on bcm5354 from taking over wrong GPIO pins

When using the bcm5354 (Soc with integrated LP-PHY Wifi) with a recent
firmware >= 478.104 it runs out of memory after a very short time in
OpenWrt after doing an active scan or any thing else where packages are
send. This was cased by a gpio misconfiguration, the firmware triggered
the GPIO pins used for buttons on some devices and that caused an other
driver (OpenWrt diag) listening for these buttons irqs to send many
messages to the user space.
This patch fixes the bug for my devices (Asus WL-520GU) and makes it
work with firmware 666.2. Now the firmware just uses LED GPIO pin
number 1 and not the button pins any more.

This is the GPIO Pin layout used on my device, see [0].
GPIO pin layout:
pin#    name    type
0       power   led
1       wlan    led
2       reset   button
3       ses     buttom

This is the nvram configuration output of "nvram show |grep gpio"

related nvram configuration:
wl0gpio2=11
wl0gpio3=11
wl0gpio0=11
wl0gpio1=0x02
reset_gpio=2

[0]: https://dev.openwrt.org/browser/trunk/package/broadcom-diag/src/diag.c

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: make use of list_for_each_entry_safe
Mohammed Shafi Shajakhan [Tue, 28 Feb 2012 15:24:44 +0000 (20:54 +0530)]
ath9k: make use of list_for_each_entry_safe

this does the same thing as the previous code

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: completely zero intialize valid_phy_rate_idx
Mohammed Shafi Shajakhan [Tue, 28 Feb 2012 15:24:43 +0000 (20:54 +0530)]
ath9k: completely zero intialize valid_phy_rate_idx

its better to zero initialize the 'valid_phy_rate_idx' array completely

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: Fix the generation of PREQs in proactive RANN mechanism of HWMP
Chun-Yeow Yeoh [Tue, 28 Feb 2012 14:00:06 +0000 (22:00 +0800)]
mac80211: Fix the generation of PREQs in proactive RANN mechanism of HWMP

According to Section Y.7.4 Actions on receipt of proactive RANN, an individually
addressed PREQ should be generated towards the neighbor peer mesh STA indicated
in the RANN Sender Address field in the forwarding information.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: fix bug in wildcard scan handling
Amitkumar Karwar [Tue, 28 Feb 2012 06:04:15 +0000 (22:04 -0800)]
mwifiex: fix bug in wildcard scan handling

Currently if valid SSID list is provided in scan request, driver
performs specific SSID scan otherwise wildcard scan is chosen.

When wpa_supplicant provides valid SSID list followed by
zero-length SSID for wildcard scan, only specific SSID scan is
performed by driver. Actually driver is expected to do both type
of scanning in this case. The patch fixes this issue.

Also, use SSID list pointer provided by stack directly, instead
of copying SSID's to local structure.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: remove unnecessary struct mwifiex_802_11_ssid
Amitkumar Karwar [Tue, 28 Feb 2012 06:04:14 +0000 (22:04 -0800)]
mwifiex: remove unnecessary struct mwifiex_802_11_ssid

Use struct cfg80211_ssid available in include/net/cfg80211.h
instead of having similar definition in driver.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: correct bitrates advertised to cfg80211
Avinash Patil [Tue, 28 Feb 2012 06:04:11 +0000 (22:04 -0800)]
mwifiex: correct bitrates advertised to cfg80211

1. Driver and firmware do not support 22Mbps and 72Mbps bitrates.
Remove them from the rate table advertised to cfg80211.

2. First 4 rates from mwifiex_rates table are not valid for
5GHz/A band. Set correct bitrate array's index and no of rates for
ieee80211_supported_band for 5GHz band.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoMIPS: BCM47XX: provide sprom to bcma bus
Hauke Mehrtens [Mon, 27 Feb 2012 23:56:14 +0000 (00:56 +0100)]
MIPS: BCM47XX: provide sprom to bcma bus

On SoCs the sprom is often stored in nvram in the flashchip. This patch
registers a sprom fallback callback handler in bcma and provides the
sprom needed for this device.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoMIPS: BCM47XX: move and extend sprom parsing
Hauke Mehrtens [Mon, 27 Feb 2012 23:56:13 +0000 (00:56 +0100)]
MIPS: BCM47XX: move and extend sprom parsing

Move the sprom parsing from nvram into sprom.c. There are all values
needed for sprom version 1 to 9 read from nvram and there are more
sanity checks added. This is based on the sprom parsing in the open
source part of the Broadcom SDK.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoMIPS: BCM47XX: fix signature of nvram_parse_macaddr
Hauke Mehrtens [Mon, 27 Feb 2012 23:56:12 +0000 (00:56 +0100)]
MIPS: BCM47XX: fix signature of nvram_parse_macaddr

Explicitly enforce an char array of 6 bytes for the mac address.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoMIPS: BCM47XX: return number of written bytes in nvram_getenv
Hauke Mehrtens [Mon, 27 Feb 2012 23:56:11 +0000 (00:56 +0100)]
MIPS: BCM47XX: return number of written bytes in nvram_getenv

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobcma: add support for sprom not found on the device
Hauke Mehrtens [Mon, 27 Feb 2012 23:56:10 +0000 (00:56 +0100)]
bcma: add support for sprom not found on the device

On SoCs the sprom is stored in the nvram in a special partition on the
flash chip. The nvram contains the sprom for the main bus, but
sometimes also for a pci devices using bcma. This patch makes it
possible for the arch code to register a function to fetch the needed
sprom from the nvram and provide it to the bcma code.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobcma: export bcma_find_core
Hauke Mehrtens [Mon, 27 Feb 2012 23:56:09 +0000 (00:56 +0100)]
bcma: export bcma_find_core

This function is needed by the bcm47xx arch code to get the number of
the ieee80211 core.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agossb: add some missing sprom attributes
Hauke Mehrtens [Mon, 27 Feb 2012 23:56:08 +0000 (00:56 +0100)]
ssb: add some missing sprom attributes

This patch extends the sprom struct to contain all sprom attributes
found in sprom version 1 to 9. This was done accordingly to the open
source part of the Broadcom SDK.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agossb: add alpha2
Hauke Mehrtens [Mon, 27 Feb 2012 23:56:07 +0000 (00:56 +0100)]
ssb: add alpha2

This member contains the country code encoded with two chars

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agossb: fix per path sprom vars
Hauke Mehrtens [Mon, 27 Feb 2012 23:56:06 +0000 (00:56 +0100)]
ssb: fix per path sprom vars

On sprom version 4 and 5 there are 4 values for pa_2g, pa_5gl, pa_5g
and pa_5gh, for sprom version 8 and 9 there are only 3. Make the per
path sprom store also work for older sprom versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agossb: remove 5GHz antenna gain from sprom
Hauke Mehrtens [Mon, 27 Feb 2012 23:56:05 +0000 (00:56 +0100)]
ssb: remove 5GHz antenna gain from sprom

There is no 2.4 GHz or 5GHz antenna gain stored in sprom. The sprom
just stores the gain values for antenna 1 and 2 or 1 to 4 for more
recent sprom versions. On old devices antenna 2 was used for 5 GHz wifi.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agossb: sprom fix some sizes / signedness
Hauke Mehrtens [Mon, 27 Feb 2012 23:56:04 +0000 (00:56 +0100)]
ssb: sprom fix some sizes / signedness

Some parts of the sprom struct are bigger than needed.
The leddc and maxpwr values are just 8 bit long and not 16.
rxpo2g and rxpo5g are signed

I got these information for the open source part of the Broadcom SDK
covering sprom version 1 to 9. rxpo2g contained a negative number on my
bcm5354 based device, this cased an error and Broadcom SDK says this is
signed.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: fix drv_tx_last_beacon on AR9003 by processing beacon tx status
Felix Fietkau [Mon, 27 Feb 2012 18:58:42 +0000 (19:58 +0100)]
ath9k: fix drv_tx_last_beacon on AR9003 by processing beacon tx status

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_hw: enable interrupts for beacon tx completion events
Felix Fietkau [Mon, 27 Feb 2012 18:58:41 +0000 (19:58 +0100)]
ath9k_hw: enable interrupts for beacon tx completion events

Not doing so could cause the tx status queue to overflow during longer
periods of time without non-beacon tx. These events are also required
for proper drv_tx_last_beacon handling.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: do not call ath9k_hw_txprocdesc on AR9003 outside of the tx tasklet
Felix Fietkau [Mon, 27 Feb 2012 18:58:40 +0000 (19:58 +0100)]
ath9k: do not call ath9k_hw_txprocdesc on AR9003 outside of the tx tasklet

Since AR9003 uses a global tx status queue, processing tx status outside of
the regular tx tasklet is dangerous and messes up hardware/software
synchronization of tx status events.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoRevert "ath9k_hw: Fix false tx hung detection in AR9003 chips"
Felix Fietkau [Mon, 27 Feb 2012 18:58:39 +0000 (19:58 +0100)]
Revert "ath9k_hw: Fix false tx hung detection in AR9003 chips"

The approach of this change is flawed, as it triggers tx status processing
from more callsites, yet the chips only have one global tx status queue.
Subsequent patches will properly fix the issue that this one tried to address.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: handle auto authentication mode correctly
Amitkumar Karwar [Sat, 25 Feb 2012 05:36:05 +0000 (21:36 -0800)]
mwifiex: handle auto authentication mode correctly

When authentication type is configured to NL80211_AUTHTYPE_AUTOMATIC,
driver tries to connect using open mode. The association is failed
if AP is configured in shared mode.

This patch adds code to try association using shared mode as well if
open mode association fails.

Now since we returned exact error code in association response handler
(instead of -1), corresponding changes are done in
mwifiex_process_cmdresp().

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocarl9170: fix breakage from "mac80211: handle non-bufferable MMPDUs correctly"
John W. Linville [Wed, 29 Feb 2012 20:08:33 +0000 (15:08 -0500)]
carl9170: fix breakage from "mac80211: handle non-bufferable MMPDUs correctly"

That commit intended for 3.4 renamed IEEE80211_TX_CTL_POLL_RESPONSE as
IEEE80211_TX_CTL_NO_PS_BUFFER.  Meanwhile, "carl9170: fix frame delivery
if sta is in powersave mode" added a reference to
IEEE80211_TX_CTL_POLL_RESPONSE in the fixes stream for 3.3.  This simple
patch fixes that merge boo-boo.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
John W. Linville [Wed, 29 Feb 2012 19:53:21 +0000 (14:53 -0500)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless

12 years agoath9k: decouple RX error checking for DFS
Zefir Kurtisi [Mon, 27 Feb 2012 11:52:06 +0000 (12:52 +0100)]
ath9k: decouple RX error checking for DFS

Previous RX error checking was done exclusive-or for different error
types and caused DFS pulse events to be dropped when other error
flags (e.g. CRC) were set simultaneously.

This patch decouples PHY error processing from other types and ensures
that all pulses detected by HW are accounted by the pattern detector.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlegacy: remove unused enum il4965_calib_enabled_state
Greg Dietsche [Mon, 27 Feb 2012 18:25:33 +0000 (12:25 -0600)]
iwlegacy: remove unused enum il4965_calib_enabled_state

Remove the enum il4965_calib_enabled_state because it is not used.

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlegacy: remove enum iw_calib and related code
Greg Dietsche [Mon, 27 Feb 2012 18:25:32 +0000 (12:25 -0600)]
iwlegacy: remove enum iw_calib and related code

Remove the enum il_calib. It defined one identifier: IL_CALIB_MAX.
Remove the function il4965_calib_free_results. It was doing nothing
because IL_CALIB_MAX is zero. Next, remove calib_results from the
il_priv structure and also remove the associated return
type/struct il_calib_result.

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlegacy: Kconfig: Change Debug Option to be more clear
Greg Dietsche [Mon, 27 Feb 2012 18:25:31 +0000 (12:25 -0600)]
iwlegacy: Kconfig: Change Debug Option to be more clear

Since the menuconfig system doesn't indent the debug options
for the 3945 /4965, add some text to make it clear which
debug options are being configured.

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlegacy: Kconfig: Move Debugging Options
Greg Dietsche [Mon, 27 Feb 2012 18:25:30 +0000 (12:25 -0600)]
iwlegacy: Kconfig: Move Debugging Options

Move the debug options so they appear below the 3945 / 4965 options.

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: handle non-bufferable MMPDUs correctly
Johannes Berg [Mon, 27 Feb 2012 11:18:30 +0000 (12:18 +0100)]
mac80211: handle non-bufferable MMPDUs correctly

This renames the IEEE80211_TX_CTL_POLL_RESPONSE
TX flag to IEEE80211_TX_CTL_NO_PS_BUFFER and also
uses it for non-bufferable MMPDUs (all MMPDUs but
deauth, disassoc and action frames.)

Previously, mac80211 would let the MMPDU through
but not set the flag so drivers supporting some
hardware aids for avoiding the PS races would
then reject the frame.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: remove unnecessary enum MWIFIEX_802_11_WEP_STATUS
Amitkumar Karwar [Sat, 25 Feb 2012 05:36:04 +0000 (21:36 -0800)]
mwifiex: remove unnecessary enum MWIFIEX_802_11_WEP_STATUS

Instead of defining an 'enum', we can simply use 'u8' flag for WEP
status. Rename 'wep_status' to 'wep_enabled' to match with
'wpa_enabled' and 'wpa2_enabled'.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: remove redundant scan operation
Amitkumar Karwar [Sat, 25 Feb 2012 05:35:36 +0000 (21:35 -0800)]
mwifiex: remove redundant scan operation

It should have been removed by commit "mwifiex: use cfg80211 dynamic
scan..." (7c6fa2a843..) after adding code to avoid an extra scan
during association because scan entries are valid for 15 seconds in
cfg80211 stack.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: make deauth/disassoc sequence more natural
Johannes Berg [Fri, 24 Feb 2012 12:50:54 +0000 (13:50 +0100)]
mac80211: make deauth/disassoc sequence more natural

The association sequence looks (roughly) like
this now:
 * set BSSID
 * set station to EXIST state
 * send auth
 * set station to AUTH state
 * send assoc
 * set station to ASSOC state
 * set BSS info to associated

In contrast, the deauth/disassoc sequence is
the other way around:
 * clear BSSID/BSS info state
 * remove station
 * send deauth/disassoc
(in some cases the last two steps are reversed.)

This patch encodes the entire sequence in the
ieee80211_set_disassoc() function and changes
it to be like this, for good measure with an
explicit flush:
 * send deauth/disassoc
 * flush
 * remove station
 * clear BSSID/BSS info state

At least iwlwifi gets confused with the other
sequence in P2P mode and complains that it
wasn't able to flush the queues.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: fix ieee80211_set_disassoc() sending DelBA
Johannes Berg [Fri, 24 Feb 2012 12:50:53 +0000 (13:50 +0100)]
mac80211: fix ieee80211_set_disassoc() sending DelBA

When ieee80211_set_disassoc() is called with the
tx argument set to true, it will send DelBA out
to the peer. This isn't useful or necessary in a
few cases where we do it today, those being when
we lost the connection or when the supplicant
explicitly asked us to not tell the AP.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: dont call cfg80211 from ieee80211_send_deauth_disassoc
Johannes Berg [Fri, 24 Feb 2012 12:50:52 +0000 (13:50 +0100)]
mac80211: dont call cfg80211 from ieee80211_send_deauth_disassoc

Instead of calling cfg80211 in ieee80211_send_deauth_disassoc()
pass out the frame and call it from the caller. That saves the
SKB allocation if we don't actually want to send the frame and
enables us to make the ordering smarter in the future.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocfg80211: remove cookies from callbacks
Johannes Berg [Fri, 24 Feb 2012 12:50:51 +0000 (13:50 +0100)]
cfg80211: remove cookies from callbacks

In "cfg80211: no cookies in cfg80211_send_XXX()"
Holger Schurig removed the cookies in the calls
from mac80211 to cfg80211, but the ones in the
other direction were left in. Remove them now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoipw2x00: remove ipw2100_rates_11b[]
Stanislav Yakovlev [Fri, 10 Feb 2012 01:23:52 +0000 (20:23 -0500)]
ipw2x00: remove ipw2100_rates_11b[]

It's just a duplicate of ipw2100_bg_rates[].

Signed-off-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agozd1211rw: wait between setting hash table and powering radio on
Florian Fainelli [Wed, 29 Feb 2012 13:00:13 +0000 (14:00 +0100)]
zd1211rw: wait between setting hash table and powering radio on

I am running Debian testing kernel 3.1.0-1-amd64, using a 079b:0062 Sagem
XG-76NA 802.11bg stick.

Upon zd1211rw interface
bringup (ifconfig wlan0 up) I get the following timeout:

[  950.330573] zd1211rw 1-3:1.0: phy2
[  955.108510] zd1211rw 1-3:1.0: firmware version 4725
[  955.148532] zd1211rw 1-3:1.0: zd1211b chip 079b:0062 v4810 high 00-19-70
AL2230_RF pa0 g--NS
[snip]
[  955.204072] zd1211rw 1-3:1.0: error ioread32(CR_REG1): -110

A second ifconfig wlan0 up brings the interface up without problems.

After a bit more debugging, the call trace is the following:

[10241.028130] zd1211rw 1-3:1.0: zd_chip_lock_phy_regs: error
ioread32(CR_REG1): -110
[10241.028140] zd1211rw 1-3:1.0: zd_switch_radio_on: failed to lock PHY regs
[10241.028148] zd1211rw 1-3:1.0: zd_op_start: failed to set radio on

Adding a 10 milliseconds delay between the call to set_mc_hash() and
zd_chip_switch_radio_on() allows successful interface bringups in all
cases and matches what the vendor driver did.

Acked-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: reset encryption mode flag before association
Amitkumar Karwar [Sat, 25 Feb 2012 05:35:35 +0000 (21:35 -0800)]
mwifiex: reset encryption mode flag before association

Recent commit
"mwifiex: clear previous security setting during association"
fixes association failure problems observed in some corner cases
by clearing previous security setting before each association.

We should reset encryption mode flag as well. This patch takes care
of it.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>