]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
11 years agomac80211: don't send delBA when removing stations
Johannes Berg [Wed, 18 Jul 2012 10:54:46 +0000 (12:54 +0200)]
mac80211: don't send delBA when removing stations

When a station is removed and we stop the aggregation
sessions, it's not useful to send delBA since this is
due to us or the station disassociating or dropping
the connection in some other way, so change that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: don't send delBA before disassoc
Johannes Berg [Wed, 18 Jul 2012 10:53:34 +0000 (12:53 +0200)]
mac80211: don't send delBA before disassoc

When we disassociate, it's not really useful to
send delBA action frames since we're going to send
disassoc/deauth anyway, so change that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: fix IBSS auth TX debug message
Sylvain Roger Rieunier [Thu, 20 Sep 2012 08:03:29 +0000 (10:03 +0200)]
mac80211: fix IBSS auth TX debug message

In the IBSS auth TX debug message the BSSID and DA
address are reversed, fix that.

Signed-off-by: Sylvain Roger Rieunier <sylvain.roger.rieunier@gmail.com>
[reword commit message and make it fit 72 cols]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: constify name parameter to add_virtual_intf
Johannes Berg [Wed, 19 Sep 2012 07:26:06 +0000 (09:26 +0200)]
cfg80211: constify name parameter to add_virtual_intf

The name can't be modified by the driver,
make it const.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: make reset debugfs depend on CONFIG_PM
Johannes Berg [Wed, 19 Sep 2012 06:20:24 +0000 (08:20 +0200)]
mac80211: make reset debugfs depend on CONFIG_PM

The suspend/resume code depends on CONFIG_PM, so
the reset debugfs file can only be made available
if that is enabled.

Fengguang Wu's zero-day build testing found this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211/nl80211: Notify connection request failure in AP mode
Pandiyarajan Pitchaimuthu [Tue, 18 Sep 2012 11:20:49 +0000 (16:50 +0530)]
cfg80211/nl80211: Notify connection request failure in AP mode

In AP mode, when a station requests connection to an AP and if the
request is failed for particular reason, userspace is notified about the
failure through NL80211_CMD_CONN_FAILED command. Reason for the failure
is sent through the attribute NL80211_ATTR_CONN_FAILED_REASON.

Signed-off-by: Pandiyarajan Pitchaimuthu <c_ppitch@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: remove obsolete comment for .sched_scan_stop() callback
Arend van Spriel [Tue, 18 Sep 2012 08:59:59 +0000 (10:59 +0200)]
cfg80211: remove obsolete comment for .sched_scan_stop() callback

The kerneldoc comment for .sched_scan_stop() callback describes a
driver_initiated flag, but the interface does not hold such a flag.

Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agowireless: remove unreachable code
Alan Cox [Mon, 17 Sep 2012 10:54:15 +0000 (11:54 +0100)]
wireless: remove unreachable code

The only case where intersected_rd can become non NULL is within an if. All
paths from that if return, so the end chunk has therefore squawked its
last and is no more.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: allow re-open the blocked peer link in mesh
Chun-Yeow Yeoh [Fri, 14 Sep 2012 06:18:31 +0000 (14:18 +0800)]
mac80211: allow re-open the blocked peer link in mesh

Peer link which is blocked using the "iw mesh0 station
set <MAC addr> plink_action block" is previously not able
to re-open using "iw mesh0 station set <MAC addr>
plink_action open". This patch is intended to solve this.

If the station plink state remains at OPN_SNT once open,
try block and open again should solve this problem.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: change locking around ieee80211_recalc_smps
Johannes Berg [Tue, 11 Sep 2012 08:17:11 +0000 (10:17 +0200)]
mac80211: change locking around ieee80211_recalc_smps

Make the function acquire the necessary mutex itself
to simplify the callers.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: handle power constraint/country IE better
Johannes Berg [Wed, 5 Sep 2012 11:41:37 +0000 (13:41 +0200)]
mac80211: handle power constraint/country IE better

Currently, mac80211 uses the power constraint IE, and reduces
the regulatory max TX power by it. This can cause issues if
the AP is advertising a large power constraint value matching
a high TX power in its country IE, for example in this case:

...
Country: US  Environment: Indoor/Outdoor
    ...
    Channels [157 - 157] @ 30 dBm
    ...
Power constraint: 13 dB
...

What happened here is that our local regulatory TX power is
15 dBm, and gets reduced by 13 dB so we end up with only
2 dBm effective TX power, which is way too low.

Instead, handle the country IE/power constraint IE combined
and restrict our TX power to the max of the regulatory power
and the maximum power advertised by the AP, in this case
17 dBm (= 30 dBm - 13 dB).

Also print a message when this happens to let the user know
and help us debug issues with it.

Reported-by: Carl A. Cook <CACook@quantum-equities.com>
Tested-by: Carl A. Cook <CACook@quantum-equities.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: remove unneeded CONFIG_PM ifdef
Johannes Berg [Fri, 7 Sep 2012 15:25:27 +0000 (17:25 +0200)]
mac80211: remove unneeded CONFIG_PM ifdef

The functions are only called if CONFIG_PM is set
as the callers are under an ifdef, so there's no
need to also define no-op functions.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: validate skb->dev in the tx status path
Felix Fietkau [Sat, 8 Sep 2012 09:58:30 +0000 (11:58 +0200)]
mac80211: validate skb->dev in the tx status path

skb->dev might contain a stale reference to a device that was already
deleted, and using it unchecked can lead to invalid pointer accesses.
Since this is only used for nl80211 tx, iterate over active interfaces
to find a match for skb->dev, and discard the tx status if the device
is gone.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: use call_rcu() on sta deletion
Eliad Peller [Sun, 9 Sep 2012 11:43:51 +0000 (14:43 +0300)]
mac80211: use call_rcu() on sta deletion

mac80211 calls synchronize_rcu() on sta deletion,
which increase the roaming time significantly.

Convert it into a call_rcu() mechanism, in order
to avoid blocking. Since some of the cleanup
functions might sleep, schedule from the call_rcu
callback a new work that will do the actual cleanup.

In order to make sure the cleanup occurs before
the interface went down, flush local->workqueue
on ieee80211_do_stop().

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: add key flag for management keys
Johannes Berg [Tue, 4 Sep 2012 15:08:23 +0000 (17:08 +0200)]
mac80211: add key flag for management keys

Mark keys that might be used to receive management
frames so drivers can fall back on software crypto
for them if they don't support hardware offload.
As the new flag is only set correctly for RX keys
and the existing IEEE80211_KEY_FLAG_SW_MGMT flag
can only affect TX, also rename the latter to
IEEE80211_KEY_FLAG_SW_MGMT_TX.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: reply to AUTH with DEAUTH if sta allocation fails in IBSS
Antonio Quartulli [Fri, 7 Sep 2012 11:28:53 +0000 (13:28 +0200)]
mac80211: reply to AUTH with DEAUTH if sta allocation fails in IBSS

Whenever a host gets an AUTH frame it first allocates a new
station and then replies with another AUTH frame. However,
if sta allocations fails the host should send a DEAUTH frame
instead to tell the other end that something went wrong.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
[reword commit message a bit]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: move ieee80211_send_deauth_disassoc outside mlme code
Antonio Quartulli [Fri, 7 Sep 2012 11:28:52 +0000 (13:28 +0200)]
mac80211: move ieee80211_send_deauth_disassoc outside mlme code

Move ieee80211_send_deauth_disassoc() to util.c to make it
available for the rest of the mac80211 code.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
[reword commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonet/mac80211/scan.c: removes unnecessary semicolon
Peter Senna Tschudin [Thu, 6 Sep 2012 16:09:16 +0000 (18:09 +0200)]
net/mac80211/scan.c: removes unnecessary semicolon

removes unnecessary semicolon

Found by Coccinelle: http://coccinelle.lip6.fr/

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: refactor set_channel_type
Michal Kazior [Tue, 26 Jun 2012 12:37:21 +0000 (14:37 +0200)]
mac80211: refactor set_channel_type

Split functionality for further reuse.

Will prevent code duplication when channel context
channel_type merging is introduced.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: use synchronize_net() on key destroying
Eliad Peller [Wed, 5 Sep 2012 17:23:56 +0000 (20:23 +0300)]
mac80211: use synchronize_net() on key destroying

__ieee80211_key_destroy() calls synchronize_rcu() in
order to sync the tx path before destroying the key.

However, synching the tx path can be done with
synchronize_net() as well, which is usually faster
(the timing might be important for roaming scenarios).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: check power constraint IE size when parsing
Johannes Berg [Wed, 5 Sep 2012 11:07:00 +0000 (13:07 +0200)]
mac80211: check power constraint IE size when parsing

The power constraint IE is always a single byte
so check the size when parsing instead of later.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211_hwsim: move module_init/exit
Johannes Berg [Fri, 27 Jul 2012 13:16:02 +0000 (15:16 +0200)]
mac80211_hwsim: move module_init/exit

These should be with the functions so move
the module_init/exit statements.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agowireless: remove obsolete chan no/center freq conversion functions
Johannes Berg [Tue, 24 Jul 2012 15:38:43 +0000 (17:38 +0200)]
wireless: remove obsolete chan no/center freq conversion functions

There are a number of functions that shouldn't really
be used when modern functions that take the band are
available in cfg80211. Remove these, but for now keep
 * ieee80211_freq_to_dsss_chan and
 * ieee80211_dsss_chan_to_freq
as they're used in older drivers.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoMerge remote-tracking branch 'wireless-next/master' into mac80211-next
Johannes Berg [Thu, 6 Sep 2012 15:05:28 +0000 (17:05 +0200)]
Merge remote-tracking branch 'wireless-next/master' into mac80211-next

11 years agomac80211: disconnect if channel switch fails
Johannes Berg [Wed, 1 Aug 2012 20:32:45 +0000 (22:32 +0200)]
mac80211: disconnect if channel switch fails

Disconnect from the AP if channel switching in the
driver failed or if the new channel is unavailable.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: don't hang on to sched_scan_ies
Johannes Berg [Tue, 4 Sep 2012 17:15:01 +0000 (19:15 +0200)]
mac80211: don't hang on to sched_scan_ies

There's no need to keep a copy of the scheduled
scan IEs after the driver has been told, if it
requires a copy it must make one. Therefore, we
can move sched_scan_ies into the function.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoMerge remote-tracking branch 'mac80211/master' into mac80211-next
Johannes Berg [Thu, 6 Sep 2012 13:55:50 +0000 (15:55 +0200)]
Merge remote-tracking branch 'mac80211/master' into mac80211-next

Pull in mac80211.git to let the next patch apply
without conflicts, also resolving a hwsim conflict.

Conflicts:
drivers/net/wireless/mac80211_hwsim.c

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: use list_move instead of list_del/list_add
Wei Yongjun [Thu, 6 Sep 2012 05:20:53 +0000 (13:20 +0800)]
mac80211: use list_move instead of list_del/list_add

Using list_move() instead of list_del() + list_add().

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: fix indentation
Hila Gonen [Sun, 26 Aug 2012 08:00:28 +0000 (11:00 +0300)]
cfg80211: fix indentation

checkpatch pointed out an issue, fix it.

Signed-off-by: Hila Gonen <hila.gonen@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agowext: include wireless event id when it has a size problem
Arend van Spriel [Fri, 24 Aug 2012 12:43:31 +0000 (14:43 +0200)]
wext: include wireless event id when it has a size problem

The wext code checks is the event data is within size limits.
When this check fails a message is logged with violating size.
This patch adds the event id to put us on the right track for
resolving that violation.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: Various small fixes for cfg.c: mpath_set_pinfo()
LEO Airwarosu Yoichi Shinoda [Mon, 27 Aug 2012 13:28:16 +0000 (22:28 +0900)]
mac80211: Various small fixes for cfg.c: mpath_set_pinfo()

Various small fixes for net/mac80211/cfg.c:mpath_set_pinfo():
Initialize *pinfo before filling members in, handle MESH_PATH_RESOLVED
correctly, and remove bogus assignment; result in correct display
of FLAGS values and meaningful EXPTIME for expired paths in iw utility.

Signed-off-by: Yoichi Shinoda <shinoda@jaist.ac.jp>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: don't use kerneldoc for ieee80211_add_rx_radiotap_header
Johannes Berg [Wed, 5 Sep 2012 13:54:51 +0000 (15:54 +0200)]
mac80211: don't use kerneldoc for ieee80211_add_rx_radiotap_header

Doing so creates warnings, but the function is internal and
not part of the 802.11 docbooks, so it from kerneldoc.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: add kerneldoc entry for "vht_cap"
Robert P. J. Day [Sun, 26 Aug 2012 18:21:47 +0000 (14:21 -0400)]
cfg80211: add kerneldoc entry for "vht_cap"

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: use list_move_tail instead of list_del/list_add_tail
Wei Yongjun [Wed, 5 Sep 2012 06:34:12 +0000 (14:34 +0800)]
cfg80211: use list_move_tail instead of list_del/list_add_tail

Using list_move_tail() instead of list_del() + list_add_tail().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonl80211: fix possible memory leak nl80211_connect()
Wei Yongjun [Sun, 2 Sep 2012 13:41:04 +0000 (21:41 +0800)]
nl80211: fix possible memory leak nl80211_connect()

connkeys is malloced in nl80211_parse_connkeys() and should
be freed in the error handling case, otherwise it will cause
memory leak.

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: clear bssid on auth/assoc failure
Eliad Peller [Tue, 4 Sep 2012 14:44:45 +0000 (17:44 +0300)]
mac80211: clear bssid on auth/assoc failure

ifmgd->bssid wasn't cleared properly in some
auth/assoc failure cases, causing mac80211 and
the low-level driver to go out of sync.

Clear ifmgd->bssid on failure, and notify the driver.

Cc: stable@kernel.org # 3.4+
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: Do not check for valid hw_queues for P2P_DEVICE
Ilan Peer [Tue, 21 Aug 2012 09:43:35 +0000 (12:43 +0300)]
mac80211: Do not check for valid hw_queues for P2P_DEVICE

A P2P Device interface does not have a netdev, and is not
expected to be used for transmitting data, so there is no
need to assign hw queues for it.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
John W. Linville [Thu, 23 Aug 2012 13:49:42 +0000 (09:49 -0400)]
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, 22 Aug 2012 18:15:47 +0000 (14:15 -0400)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

11 years agomac80211: Fix AP mode regression
Sujith Manoharan [Wed, 22 Aug 2012 08:51:07 +0000 (14:21 +0530)]
mac80211: Fix AP mode regression

Commit mac80211: avoid using synchronize_rcu in ieee80211_set_probe_resp
changed the return value when the probe response template is not present.
Revert to the earlier value of 1 - this fixes AP mode for drivers like
ath9k.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: fix DS to MBSS address translation
Thomas Pedersen [Mon, 20 Aug 2012 18:28:25 +0000 (11:28 -0700)]
mac80211: fix DS to MBSS address translation

The destination address of unicast frames forwarded through a mesh gate
was being replaced with the broadcast address. Instead leave the
original destination address as the mesh DA. If the nexthop address is
not in the mpath table it will be resolved. If that fails, the frame
will be forwarded to known mesh gates.

Reported-by: Cedric Voncken <cedric.voncken@acksys.fr>
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocarl9170: report A-MPDU status
Christian Lamparter [Tue, 31 Jul 2012 21:12:16 +0000 (21:12 +0000)]
carl9170: report A-MPDU status

Because the hardware reports whenever an frame
was either at the start, in the middle or at
the end of a A-MPDU, we can easily report the
information for radiotap.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_htc: implement sta_rc_update() mac80211 callback
Antonio Quartulli [Sun, 12 Aug 2012 17:36:41 +0000 (19:36 +0200)]
ath9k_htc: implement sta_rc_update() mac80211 callback

In case of changes in the supported rates set for a given station, it is now
possible to use this callback to update the current internal state of the
station in the htc driver.

Reported-by: Gui Iribarren <gui@altermundi.net>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobcma: detect and register NAND flash device
Rafał Miłecki [Sun, 12 Aug 2012 11:08:05 +0000 (13:08 +0200)]
bcma: detect and register NAND flash device

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobcma: detect and register serial flash device
Rafał Miłecki [Fri, 10 Aug 2012 19:23:53 +0000 (21:23 +0200)]
bcma: detect and register serial flash device

Signed-off-by: Rafał Miłecki <zajec5@gmail.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 [Tue, 21 Aug 2012 20:00:21 +0000 (16:00 -0400)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next

Conflicts:
drivers/net/wireless/mac80211_hwsim.c

11 years agoRevert "rfkill: remove dead code"
AceLan Kao [Thu, 26 Jul 2012 01:51:08 +0000 (09:51 +0800)]
Revert "rfkill: remove dead code"

This reverts commit 2e48928d8a0f38c1b5c81eb3f1294de8a6382c68.

Those functions are needed and should not be removed, or
there is no way to set the rfkill led trigger name.

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: fix FW restart on init FW
Amit Beka [Mon, 6 Aug 2012 14:01:05 +0000 (17:01 +0300)]
iwlwifi: fix FW restart on init FW

When unregistered with mac80211, we can't call its functionality
for FW restart, so avoid it and prevent automatic FW restart for
the init firmware.

Signed-off-by: Amit Beka <amit.beka@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoiwlwifi: fix the preparation of the card
Emmanuel Grumbach [Sun, 5 Aug 2012 13:55:06 +0000 (16:55 +0300)]
iwlwifi: fix the preparation of the card

There is no need to check if the ownership has been
relinquished but we should rather try to get it in a
loop.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: clean up ieee80211_subif_start_xmit
Johannes Berg [Mon, 30 Jul 2012 13:11:56 +0000 (15:11 +0200)]
mac80211: clean up ieee80211_subif_start_xmit

There's no need to carry around a return value
that is always NETDEV_TX_OK anyway.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: pass channel to ieee80211_send_probe_req
Johannes Berg [Mon, 30 Jul 2012 10:26:34 +0000 (12:26 +0200)]
mac80211: pass channel to ieee80211_send_probe_req

In multi-channel scenarios, the channel that we will
transmit a probe request on isn't always the current
channel (which will be NULL anyway) but will instead
be the channel that the AP is on. Pass the channel
to the ieee80211_send_probe_req() function so it can
be used in the different scenarios. The scan code
continues to pass the current channel, of course.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: convert ops checks to WARN_ON
Johannes Berg [Thu, 26 Jul 2012 12:42:10 +0000 (14:42 +0200)]
mac80211: convert ops checks to WARN_ON

There's no need to BUG_ON when a driver registers
invalid operations, warn and return an error.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: check operating channel in scan
Johannes Berg [Thu, 26 Jul 2012 12:38:32 +0000 (14:38 +0200)]
mac80211: check operating channel in scan

The optimisation of scanning only on the current
channel should check the operating channel. Also
modify it to compare channel pointer rather than
the frequency.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: use RX status band instead of current band
Johannes Berg [Thu, 26 Jul 2012 12:31:19 +0000 (14:31 +0200)]
mac80211: use RX status band instead of current band

Even for single-channel devices it is possible that we
switch the channel temporarily (e.g. for scanning) but
while doing so process a received frame that was still
received on the old channel, so checking the current
band is racy. Use the band from status instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: don't assume channel is set in tracing
Johannes Berg [Thu, 26 Jul 2012 12:27:39 +0000 (14:27 +0200)]
mac80211: don't assume channel is set in tracing

With the move to multi-channel and away from
drv_config(), hw.conf.channel will not always
be set, only for devices using the current API
instead of the new channel context APIs. Check
the channel is set before adding its frequency
to the trace data.

Also break some overly long lines in the code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: use oper_channel in rate init
Johannes Berg [Mon, 23 Jul 2012 12:29:21 +0000 (14:29 +0200)]
mac80211: use oper_channel in rate init

Using hw.conf.channel is wrong as it could be the
temporary channel if the station is added from the
workqueue while the device is already on another
channel. Use oper_channel instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: remove freq/chantype from debugfs
Johannes Berg [Thu, 26 Jul 2012 12:22:06 +0000 (14:22 +0200)]
mac80211: remove freq/chantype from debugfs

You can now get these values through iw, and
they conflict with multi-channel work.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: remove almost unused local variable
Johannes Berg [Thu, 26 Jul 2012 12:07:46 +0000 (14:07 +0200)]
mac80211: remove almost unused local variable

In ieee80211_beacon_get_tim() we can use the
txrc.sband instead of a separate local variable.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: mesh: don't use global channel type
Johannes Berg [Wed, 25 Jul 2012 11:51:49 +0000 (13:51 +0200)]
mac80211: mesh: don't use global channel type

Using local->_oper_channel_type in the mesh code is
completely wrong as this value is the combination
of the various interface channel types and can be
a different value from the mesh interface in case
there are multiple virtual interfaces.

Use sdata->vif.bss_conf.channel_type instead as it
tracks the per-vif channel type.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: simplify buffers in aes_128_cmac_vector
Johannes Berg [Sun, 19 Aug 2012 12:51:44 +0000 (14:51 +0200)]
mac80211: simplify buffers in aes_128_cmac_vector

There's no need to use a single scratch buffer and
calculate offsets into it, just use two separate
buffers for the separate variables.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211_hwsim: add support for P2P Device
Johannes Berg [Tue, 19 Jun 2012 15:29:29 +0000 (17:29 +0200)]
mac80211_hwsim: add support for P2P Device

Advertise support for P2P Device in hwsim
to be able to test it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: add IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF
Johannes Berg [Tue, 19 Jun 2012 15:19:44 +0000 (17:19 +0200)]
mac80211: add IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF

Some devices like the current iwlwifi implementation
require that the P2P interface address match the P2P
Device address (only one P2P interface is supported.)
Add the HW flag IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF
that allows drivers to request that P2P Interfaces
added while a P2P Device is active get the same MAC
address by default.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: support P2P Device abstraction
Johannes Berg [Mon, 18 Jun 2012 18:07:15 +0000 (20:07 +0200)]
mac80211: support P2P Device abstraction

After cfg80211 got a P2P Device abstraction, add
support to mac80211. Whether it really is supported
or not will depend on whether or not the driver has
support for it, but mac80211 needs to change to be
able to support drivers that need a P2P Device.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: add P2P Device abstraction
Johannes Berg [Fri, 15 Jun 2012 22:19:54 +0000 (00:19 +0200)]
cfg80211: add P2P Device abstraction

In order to support using a different MAC address
for the P2P Device address we must first have a
P2P Device abstraction that can be assigned a MAC
address.

This abstraction will also be useful to support
offloading P2P operations to the device, e.g.
periodic listen for discoverability.

Currently, the driver is responsible for assigning
a MAC address to the P2P Device, but this could be
changed by allowing a MAC address to be given to
the NEW_INTERFACE command.

As it has no associated netdev, a P2P Device can
only be identified by its wdev identifier but the
previous patches allowed using the wdev identifier
in various APIs, e.g. remain-on-channel.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: make ieee80211_beacon_connection_loss_work static
Johannes Berg [Wed, 1 Aug 2012 14:49:34 +0000 (16:49 +0200)]
mac80211: make ieee80211_beacon_connection_loss_work static

There's no need to declare the function in the
header file since it's only used in a single
place, so make it static.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: check size of channel switch IE when parsing
Johannes Berg [Wed, 1 Aug 2012 14:13:02 +0000 (16:13 +0200)]
mac80211: check size of channel switch IE when parsing

The channel switch IE has a fixed size, so we can
discard it in parsing if it's not the right size
and use the right struct pointer.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: fix CSA handling timer
Johannes Berg [Wed, 1 Aug 2012 13:53:45 +0000 (15:53 +0200)]
mac80211: fix CSA handling timer

The time until the channel switch is in TU,
not in milliseconds, so use TU_TO_EXP_TIME()
to correctly program the timer.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: clean up CSA handling code
Johannes Berg [Wed, 1 Aug 2012 13:50:46 +0000 (15:50 +0200)]
mac80211: clean up CSA handling code

Clean up the CSA handling code by moving some
of it out of the if and using a C99 initializer
for the struct passed to the driver method.

While at it, also add a comment that we should
wait for a beacon after switching the channel.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: remove unneeded 'bssid' variable
Johannes Berg [Wed, 1 Aug 2012 13:48:38 +0000 (15:48 +0200)]
mac80211: remove unneeded 'bssid' variable

There's no need to copy the BSSID just to print
it, remove the unnecessary variable.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: support A-MPDU status reporting
Johannes Berg [Thu, 5 Jul 2012 09:34:31 +0000 (11:34 +0200)]
mac80211: support A-MPDU status reporting

Support getting A-MPDU status information from the
drivers and reporting it to userspace via radiotap
in the standard fields.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agowireless: add radiotap A-MPDU status field
Johannes Berg [Thu, 5 Jul 2012 09:32:16 +0000 (11:32 +0200)]
wireless: add radiotap A-MPDU status field

Define the A-MPDU status field in radiotap, also
update the radiotap parser for it and the MCS field
that was apparently missed last time.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: add supported rates change notification in IBSS
Antonio Quartulli [Sun, 12 Aug 2012 16:24:55 +0000 (18:24 +0200)]
mac80211: add supported rates change notification in IBSS

In IBSS it is possible that the supported rates set for a station changes over
time (e.g. it gets first initialised as an empty set because of no available
information about rates and updated later). In this case the driver has to be
notified about the change in order to update its internal table accordingly (if
needed).

This behaviour is needed by all those drivers that handle rc internally but
leave stations management to mac80211

Reported-by: Gui Iribarren <gui@altermundi.net>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
[Johannes - add docs, validate IBSS mode only, fix compilation]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: clean up mpath_move_to_queue()
Thomas Pedersen [Fri, 10 Aug 2012 01:15:40 +0000 (18:15 -0700)]
mac80211: clean up mpath_move_to_queue()

Use skb_queue_walk_safe instead, and fix a few issues:

- didn't free old skbs on moving
- didn't react to failed skb alloc
- needlessly held a local pointer to the destination frame queue
- didn't check destination queue length before adding skb

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: use skb_queue_walk() in mesh_path_assign_nexthop
Thomas Pedersen [Fri, 10 Aug 2012 01:15:39 +0000 (18:15 -0700)]
mac80211: use skb_queue_walk() in mesh_path_assign_nexthop

Since all we really want is just to iterate over all skbs, do just that
and avoid (de)queueing to a clusmy tmpq.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: avoid using synchronize_rcu in ieee80211_set_probe_resp
Eyal Shapira [Mon, 6 Aug 2012 11:26:16 +0000 (14:26 +0300)]
mac80211: avoid using synchronize_rcu in ieee80211_set_probe_resp

This could take a while (100ms+) and may delay sending assoc resp
in AP mode with WPS or P2P GO (as setting the probe resp takes place
there). We've encountered situations where the delay was big enough
to cause connection problems with devices like Galaxy Nexus.
Switch to using call_rcu with a free handler.

[Arik - rework to use plain buffer and instead of skb]

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agop54: fix powerpc gcc warnings
Christian Lamparter [Sat, 11 Aug 2012 11:09:20 +0000 (13:09 +0200)]
p54: fix powerpc gcc warnings

My commit "p54: parse output power table" introduced
the following compiler warnings for powerpc-allmodconfig

eeprom.c: In function 'p54_get_maxpower':
eeprom.c:291 warning: comparison of distinct pointer types lacks a cast
eeporm.c:292 warning: comparison of distinct pointer types lacks a cast
eeprom.c:293 warning: comparison of distinct pointer types lacks a cast
eeprom.c:294 warning: comparison of distinct pointer types lacks a cast

This patch fixes those by using max_t(u16
which forces a type cast.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Tested-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomac80211: fix unnecessary beacon update after peering status change
Marco Porsch [Wed, 8 Aug 2012 05:58:43 +0000 (07:58 +0200)]
mac80211: fix unnecessary beacon update after peering status change

ieee80211_bss_info_change_notify is called everytime a peer link is established
or closed, because the accepting_plinks flag in the meshconf IE *might* have changed.

With this patch the corresponding functions return the BSS_CHANGED_BEACON flag when a beacon update is necessary.

Also it makes mesh_accept_plinks_update the common place to update the accepting_plinks flag.
mesh_accept_plinks_update is called upon plink change and also periodically from ieee80211_mesh_housekeeping.
Thus, it also picks up changes of local->num_sta.

Signed-off-by: Marco Porsch <marco.porsch@etit.tu-chemnitz.de>
Acked-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: document firmware dependencies
Jeff Mahoney [Mon, 6 Aug 2012 19:17:26 +0000 (15:17 -0400)]
brcmsmac: document firmware dependencies

The brcmsmac driver requests firmware but doesn't document the
dependency. This means that software that analyzes the modules to
determine if firmware is needed won't detect it.

Specifically, (at least) openSUSE won't install the kernel-firmware
package if no hardware requires it.

This patch adds the MODULE_FIRMWARE directives.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: tune rc_stats to display only valid rates
Rajkumar Manoharan [Fri, 10 Aug 2012 11:17:30 +0000 (16:47 +0530)]
ath9k: tune rc_stats to display only valid rates

This could make rc_stats more simpler and ease the debugging.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Trim rate table
Sujith Manoharan [Fri, 10 Aug 2012 11:17:23 +0000 (16:47 +0530)]
ath9k: Trim rate table

Remove ctrl_rate, cw40index, sgi_index, ht_index and calculate
the rate index for TX status from the valid_rate_index that
is populated at initialization time.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Remove MIMO-PS specific code
Sujith Manoharan [Fri, 10 Aug 2012 11:17:16 +0000 (16:47 +0530)]
ath9k: Remove MIMO-PS specific code

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Cleanup TX status API
Sujith Manoharan [Fri, 10 Aug 2012 11:17:09 +0000 (16:47 +0530)]
ath9k: Cleanup TX status API

Calculate the final rate index inside ath_rc_tx_status().

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Bail out properly before calculating rate index
Sujith Manoharan [Fri, 10 Aug 2012 11:17:03 +0000 (16:47 +0530)]
ath9k: Bail out properly before calculating rate index

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Fix RTS/CTS rate selection
Sujith Manoharan [Fri, 10 Aug 2012 11:16:57 +0000 (16:46 +0530)]
ath9k: Fix RTS/CTS rate selection

The current method of assigning the RTS/CTS rate is completely
broken for HT mode and breaks P2P operation. Fix this by using
the basic_rates provided to the driver by mac80211. For now,
choose the lowest supported basic rate for HT frames.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Do not set IEEE80211_TX_RC_USE_SHORT_PREAMBLE
Sujith Manoharan [Fri, 10 Aug 2012 11:16:50 +0000 (16:46 +0530)]
ath9k: Do not set IEEE80211_TX_RC_USE_SHORT_PREAMBLE

mac80211 does it for us.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Unify valid rate calculation routines
Sujith Manoharan [Fri, 10 Aug 2012 11:16:44 +0000 (16:46 +0530)]
ath9k: Unify valid rate calculation routines

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Remove ath_rc_set_valid_rate_idx
Sujith Manoharan [Fri, 10 Aug 2012 11:16:37 +0000 (16:46 +0530)]
ath9k: Remove ath_rc_set_valid_rate_idx

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Change rateset calculation
Sujith Manoharan [Fri, 10 Aug 2012 11:16:31 +0000 (16:46 +0530)]
ath9k: Change rateset calculation

Commit "ath9k: Change rate control to use legacy rate as last MRR"
resulted in the mixing of HT/legacy rates in a single rateset,
which is undesirable. Revert this behavior.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Cleanup index retrieval routines
Sujith Manoharan [Fri, 10 Aug 2012 11:16:24 +0000 (16:46 +0530)]
ath9k: Cleanup index retrieval routines

Trim API and remove unused variables.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Cleanup ath_rc_setvalid_htrates
Sujith Manoharan [Fri, 10 Aug 2012 11:16:18 +0000 (16:46 +0530)]
ath9k: Cleanup ath_rc_setvalid_htrates

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Cleanup ath_rc_setvalid_rates
Sujith Manoharan [Fri, 10 Aug 2012 11:16:11 +0000 (16:46 +0530)]
ath9k: Cleanup ath_rc_setvalid_rates

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Cleanup RC init API
Sujith Manoharan [Fri, 10 Aug 2012 11:16:04 +0000 (16:46 +0530)]
ath9k: Cleanup RC init API

A reference to the rate table is stored inside the
private structure, so there is no need to pass "rate_table"
around.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Simplify rate table initialization
Sujith Manoharan [Fri, 10 Aug 2012 11:15:52 +0000 (16:45 +0530)]
ath9k: Simplify rate table initialization

Remove various local variables that duplicate information
already stored in mac80211.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: use GFP_ATOMIC under spin lock
Dan Carpenter [Thu, 9 Aug 2012 06:57:57 +0000 (09:57 +0300)]
mwifiex: use GFP_ATOMIC under spin lock

We're holding the sta_list_spinlock here so we can't sleep.

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>
11 years agomwifiex: notify cfg80211 about MIC failures
Amitkumar Karwar [Thu, 9 Aug 2012 02:02:56 +0000 (19:02 -0700)]
mwifiex: notify cfg80211 about MIC failures

Call cfg80211_michael_mic_failure() handler when there is a MIC error
event from firmware.

Signed-off-by: Amitkumar Karwar <akarwar@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>
11 years agomwifiex: fix 'smatch' warning in preparing key_material cmd
Bing Zhao [Thu, 9 Aug 2012 02:01:52 +0000 (19:01 -0700)]
mwifiex: fix 'smatch' warning in preparing key_material cmd

The key length can be 32 bytes for TKIP and 16 bytes for AES_CMAC.
'smatch' warns on memcpy using key_len variable to copy data to
a 16 bytes buffer. Use fixed length to avoid the warning.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agossb: check for flash presentence
Rafał Miłecki [Wed, 8 Aug 2012 17:37:04 +0000 (19:37 +0200)]
ssb: check for flash presentence

We can not assume parallel flash is always present, there are boards
with *serial* flash and probably some without flash at all.
Define some bits by the way.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Reviewed-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43legacy: fix logic in GPIO init
Rafał Miłecki [Wed, 8 Aug 2012 17:10:16 +0000 (19:10 +0200)]
b43legacy: fix logic in GPIO init

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: N-PHY: fix 0x2057 radio calib copy/paste mistake
Rafał Miłecki [Wed, 8 Aug 2012 17:10:15 +0000 (19:10 +0200)]
b43: N-PHY: fix 0x2057 radio calib copy/paste mistake

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobcma: add (mostly) NAND defines
Rafał Miłecki [Wed, 8 Aug 2012 17:10:14 +0000 (19:10 +0200)]
bcma: add (mostly) NAND defines

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>