]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
15 years agoudpv4: Handle large incoming UDP/IPv4 packets and support software UFO.
Sridhar Samudrala [Thu, 9 Jul 2009 08:09:47 +0000 (08:09 +0000)]
udpv4: Handle large incoming UDP/IPv4 packets and support software UFO.

- validate and forward GSO UDP/IPv4 packets from untrusted sources.
- do software UFO if the outgoing device doesn't support UFO.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: move and export get_net_ns_by_pid
Johannes Berg [Fri, 10 Jul 2009 09:51:35 +0000 (09:51 +0000)]
net: move and export get_net_ns_by_pid

The function get_net_ns_by_pid(), to get a network
namespace from a pid_t, will be required in cfg80211
as well. Therefore, let's move it to net_namespace.c
and export it. We can't make it a static inline in
the !NETNS case because it needs to verify that the
given pid even exists (and return -ESRCH).

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogenetlink: make netns aware
Johannes Berg [Fri, 10 Jul 2009 09:51:34 +0000 (09:51 +0000)]
genetlink: make netns aware

This makes generic netlink network namespace aware. No
generic netlink families except for the controller family
are made namespace aware, they need to be checked one by
one and then set the family->netnsok member to true.

A new function genlmsg_multicast_netns() is introduced to
allow sending a multicast message in a given namespace,
for example when it applies to an object that lives in
that namespace, a new function genlmsg_multicast_allns()
to send a message to all network namespaces (for objects
that do not have an associated netns).

The function genlmsg_multicast() is changed to multicast
the message in just init_net, which is currently correct
for all generic netlink families since they only work in
init_net right now. Some will later want to work in all
net namespaces because they do not care about the netns
at all -- those will have to be converted to use one of
the new functions genlmsg_multicast_allns() or
genlmsg_multicast_netns() whenever they are made netns
aware in some way.

After this patch families can easily decide whether or
not they should be available in all net namespaces. Many
genl families us it for objects not related to networking
and should therefore be available in all namespaces, but
that will have to be done on a per family basis.

Note that this doesn't touch on the checkpoint/restart
problem where network namespaces could be used, genl
families and multicast groups are numbered globally and
I see no easy way of changing that, especially since it
must be possible to multicast to all network namespaces
for those families that do not care about netns.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: make namespace iteration possible under RCU
Johannes Berg [Fri, 10 Jul 2009 09:51:33 +0000 (09:51 +0000)]
net: make namespace iteration possible under RCU

All we need to take care of is using proper RCU list
add/del primitives and inserting a synchronize_rcu()
at one place to make sure the exit notifiers are run
after everybody has stopped iterating the list.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetlink: use call_rcu for netlink_change_ngroups
Johannes Berg [Fri, 10 Jul 2009 09:51:32 +0000 (09:51 +0000)]
netlink: use call_rcu for netlink_change_ngroups

For the network namespace work in generic netlink I need
to be able to call this function under rcu_read_lock(),
otherwise the locking becomes a nightmare and more locks
would be needed. Instead, just embed a struct rcu_head
(actually a struct listeners_rcu_head that also carries
the pointer to the memory block) into the listeners
memory so we can use call_rcu() instead of synchronising
and then freeing. No rcu_barrier() is needed since this
code cannot be modular.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetlink: remove unused exports
Johannes Berg [Fri, 10 Jul 2009 08:32:06 +0000 (08:32 +0000)]
netlink: remove unused exports

I added those myself in commits b4ff4f04 and 84659eb5,
but I see no reason now why they should be exported,
only generic netlink uses them which cannot be modular.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agohwsim: make testmode_cmd static
Johannes Berg [Tue, 7 Jul 2009 09:00:55 +0000 (11:00 +0200)]
hwsim: make testmode_cmd static

sparse correctly complains about this, no reason
for it not to be static.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: disallow configuring unsupported interfaces
Johannes Berg [Tue, 7 Jul 2009 01:56:13 +0000 (03:56 +0200)]
cfg80211: disallow configuring unsupported interfaces

In order to force drivers to advertise their interface
types, don't just disallow creating new interfaces with
unadvertised types but also disallow setting them UP.
Additionally, add some validation on the operations the
drivers support.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: clean up naming once and for all
Johannes Berg [Tue, 7 Jul 2009 01:56:12 +0000 (03:56 +0200)]
cfg80211: clean up naming once and for all

We've named the registered devices 'drv' sometimes,
thinking of "driver", which is not what it is, it's
the internal representation of a wiphy, i.e. a
device. Let's clean up the naming once and and use
'rdev' aka 'registered device' everywhere.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: fix locking
Johannes Berg [Tue, 7 Jul 2009 01:56:11 +0000 (03:56 +0200)]
cfg80211: fix locking

Over time, a lot of locking issues have crept into
the smarts of cfg80211, so e.g. scan completion can
race against a new scan, IBSS join can race against
leaving an IBSS, etc.

Introduce a new per-interface lock that protects
most of the per-interface data that we need to keep
track of, and sprinkle assertions about that lock
everywhere. Some things now need to be offloaded to
work structs so that we don't require being able to
sleep in functions the drivers call. The exception
to that are the MLME callbacks (rx_auth etc.) that
currently only mac80211 calls because it was easier
to do that there instead of in cfg80211, and future
drivers implementing those calls will, if they ever
exist, probably need to use a similar scheme like
mac80211 anyway...

In order to be able to handle _deauth and _disassoc
properly, introduce a cookie passed to it that will
determine locking requirements.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: fix MFP bug, sparse warnings
Johannes Berg [Tue, 7 Jul 2009 01:56:10 +0000 (03:56 +0200)]
cfg80211: fix MFP bug, sparse warnings

sparse warns about a number of things, and one of them
(use_mfp shadowed variable) actually is a bug, fix all
of them.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: properly name driver locking
Johannes Berg [Tue, 7 Jul 2009 01:56:09 +0000 (03:56 +0200)]
cfg80211: properly name driver locking

Currently we call that cfg80211_put_dev(), but that is
misleading. With the new convention of using 'rdev' for
registered_device variables, also call that function
cfg80211_unlock_rdev().

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: warn again on spurious deauth
Johannes Berg [Tue, 7 Jul 2009 01:56:08 +0000 (03:56 +0200)]
cfg80211: warn again on spurious deauth

The original code in mac80211 could send a deauth
frame under certain circumstances even if nothing
had ever requested an authentication. This has been
fixed with the rework there, so cfg80211 can now
warn again about spurious events to catch possible
future drivers or mac80211 regressions.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: mlme API must be able to sleep
Johannes Berg [Tue, 7 Jul 2009 01:56:07 +0000 (03:56 +0200)]
cfg80211: mlme API must be able to sleep

After the mac80211 mlme cleanup, we can require that
the MLME functions in cfg80211 can sleep. This will
simplify future work in cfg80211 a lot.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: dont use union for wext
Johannes Berg [Tue, 7 Jul 2009 01:56:06 +0000 (03:56 +0200)]
cfg80211: dont use union for wext

Otherwise it becomes very hard to reset the structs
correctly since wext can be configured while the
interface is down.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: fix netdev down problem
Johannes Berg [Tue, 7 Jul 2009 01:56:05 +0000 (03:56 +0200)]
cfg80211: fix netdev down problem

We shouldn't be looking at the ssid_len for non-IBSS,
and for IBSS we should also return an error on trying
to leave an IBSS while not in or joining an IBSS.

This fixes an issue where we wouldn't disconnect() on
an interface being taken down since there's no SSID
configured this way.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: refactor the WEP code to be directly usable
Johannes Berg [Tue, 7 Jul 2009 01:45:18 +0000 (03:45 +0200)]
mac80211: refactor the WEP code to be directly usable

The new key work for cfg80211 will only give us the WEP
key for shared auth to do that authentication, and not
via the regular key settings, so we need to be able to
encrypt a single frame in software, and that without a
key struct. Thus, refactor the WEP code to not require
a key structure but use the key, len and idx directly.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: rework MLME for multiple authentications
Johannes Berg [Tue, 7 Jul 2009 01:45:17 +0000 (03:45 +0200)]
mac80211: rework MLME for multiple authentications

Sit tight. This shakes up the world as you know
it. Let go of your spaghetti tongs, they will no
longer be required, the horrible statemachine in
net/mac80211/mlme.c is no more...

With the cfg80211 SME mac80211 now has much less
to keep track of, but, on the other hand, for FT
it needs to be able to keep track of at least one
authentication being in progress while associated.
So convert from a single state machine to having
small ones for all the different things we need to
do. For real FT it will still need work wrt. PS,
but this should be a good step.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: remove dead code from mlme
Johannes Berg [Tue, 7 Jul 2009 01:45:16 +0000 (03:45 +0200)]
mac80211: remove dead code from mlme

The ap_capab and last_probe struct members are unused.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: let SME control reassociation vs. association
Johannes Berg [Tue, 7 Jul 2009 12:37:26 +0000 (14:37 +0200)]
cfg80211: let SME control reassociation vs. association

Since we don't really know that well in the kernel,
let's let the SME control whether it wants to use
reassociation or not, by allowing it to give the
previous BSSID in the associate() parameters.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54: fix queue stall due to underrun
Christian Lamparter [Mon, 6 Jul 2009 13:18:13 +0000 (15:18 +0200)]
p54: fix queue stall due to underrun

Larry Finger discovered a weird behavior under load.
In essence, the queue's length count under runs,
which in turn renders the associated ac queue unusable.

Reported-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54usb: fix stalls caused by urb allocation failures
Christian Lamparter [Mon, 6 Jul 2009 13:17:56 +0000 (15:17 +0200)]
p54usb: fix stalls caused by urb allocation failures

This patch squashes a few old bugs, which have been around since
the initial version of p54usb in one form or another.

we never freed a orphaned frame, when were denied the resources,
which are necessary to pass the data into the usb subsystem.
As a result we could end up with a full queue that wasn't emptied,
until the device was brought down.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agorfkill: prep for rfkill API changes
Johannes Berg [Sun, 5 Jul 2009 12:51:06 +0000 (14:51 +0200)]
rfkill: prep for rfkill API changes

We've designed the /dev/rfkill API in a way that we
can increase the event struct by adding members at
the end, should it become necessary. To validate the
events, userspace and the kernel need to have the
proper event size to check for -- when reading from
the other end they need to verify that it's at least
version 1 of the event API, with the current struct
size, so define a constant for that and make the
code a little more 'future proof'.

Not that I expect that we'll have to change the event
size any time soon, but it's better to write the code
in a way that lends itself to extending.

Due to the current size of the event struct, the code
is currently equivalent, but should the event struct
ever need to be increased the new code might not need
changing.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: write PCU registers on initial reset
Bob Copeland [Sun, 5 Jul 2009 01:03:13 +0000 (21:03 -0400)]
ath5k: write PCU registers on initial reset

"Ath5k: unify resets"
introduced a regression into 2.6.28 where the PCU registers are never
initialized, due to ath5k_reset() always passing true for change_channel.
We subsequently program a lot of these registers but several may start
in an unknown state.

Cc: stable@kernel.org
Reported-by: Forrest Zhang <forrest@hifulltech.com>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: do not release irq across suspend/resume
Bob Copeland [Sat, 4 Jul 2009 16:59:54 +0000 (12:59 -0400)]
ath5k: do not release irq across suspend/resume

Paraphrasing Rafael J. Wysocki: "drivers should not release PCI IRQs
in suspend."  Doing so causes a warning during suspend/resume on some
platforms.

Cc: Rafael J. Wysocki <rjw@sisk.pl>
Reported-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath: remove unnecessary return in ath_regd_get_band_ctl
Bob Copeland [Sat, 4 Jul 2009 16:59:53 +0000 (12:59 -0400)]
ath: remove unnecessary return in ath_regd_get_band_ctl

'default' case already returns NO_CTL

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: rework beacon configuration
Bob Copeland [Sat, 4 Jul 2009 16:59:52 +0000 (12:59 -0400)]
ath5k: rework beacon configuration

Using the enable_beacon flag allows some simplifications and fixes
some corner cases in beacon handling.  This change adds a state
variable for beaconing in ath5k_beacon_config and handles both
enabling and disabling, thus eliminating the need for
ath5k_beacon_disable.  We also now configure the beacon when any
of the beacon parameters change, so ath5k_beacon_reconfig is no
longer needed (its mmiowb gets moved to ath5k_beacon_config).
Finally, by locking around the whole config function, we don't
need to worry about clearing the interrupt mask register before
installing the new mask.

The upshot is this correctly disables beaconing when the interfaces
are taken down, it fixes a potential restarting of beaconing
when ath5k_reset() is called, and ensures that updates to the
beacon interval take effect immediately.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: send buffered frames after the beacon
Bob Copeland [Sat, 4 Jul 2009 16:59:51 +0000 (12:59 -0400)]
ath5k: send buffered frames after the beacon

Enable the "Content" After Beacon queue and utilize it to send
any buffered frames for power-saving clients.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54spi: remove dead code and definitions
Christian Lamparter [Sat, 4 Jul 2009 15:49:59 +0000 (17:49 +0200)]
p54spi: remove dead code and definitions

This patch removes some dead code:
p54spi.c:115: warning: ‘p54spi_read16’ defined but not used

and while we're at it, p54spi_registers_array is purged as well.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54: two endian fixes
Christian Lamparter [Fri, 3 Jul 2009 19:01:15 +0000 (21:01 +0200)]
p54: two endian fixes

This patch fixes all CHECK_ENDIAN complains:

1. p54/fwio.c:296:6: warning: restricted __le32 degrades to integer
    p54/fwio.c:296:6: warning: restricted __le32 degrades to integer

2. p54/p54spi.c:172:32: warning: incorrect type in initializer
   p54spi.c:172:32:    expected restricted __le32 [usertype] buffer
   p54/p54spi.c:172:32:    got unsigned int

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: check for current_bss from giwrate
Samuel Ortiz [Fri, 3 Jul 2009 00:00:48 +0000 (02:00 +0200)]
cfg80211: check for current_bss from giwrate

When connecting to an ESSID manually, we may not set the BSSID, and thus
wdev->wext.connect.bssid will be NULL.
wdev->current_bss is always updated when a connection is established so we
should check it first.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agort2x00: use wiphy rfkill interface
Ivo van Doorn [Wed, 1 Jul 2009 13:17:35 +0000 (15:17 +0200)]
rt2x00: use wiphy rfkill interface

Remove the input_polldev from rt2x00 and replace it with
the rfkill interface offered by the wiphy structure. This
simplifies the entire rfkill handling in rt2x00 and allows
us to remove the CONFIG_RT2X00_LIB_RFKILL option and always
enables rfkill capabilities.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: fix aggregation limit
Johannes Berg [Wed, 1 Jul 2009 12:57:59 +0000 (14:57 +0200)]
iwlwifi: fix aggregation limit

According to the documentation, the limit is 0x3f == 63, not 64.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: shorten the passive dwell time for sw scans
Helmut Schaa [Tue, 30 Jun 2009 12:49:18 +0000 (14:49 +0200)]
mac80211: shorten the passive dwell time for sw scans

mac80211's software scan implementation uses a passive dwell time of
(HZ / 5) which means we stay 200ms on each passive channel. Compared
to iwlwifi's hw scan and the old ipw* drivers which use values around
120ms this is quite long.

Reducing the passive dwell time from 200ms to 125ms should save us
something around a second on cards capable of 11a and we should still be
able to catch beacons from most access points (assuming a ~100ms beacon
interval).

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: remove permissions from debugfs files
Jiri Slaby [Sun, 28 Jun 2009 21:25:28 +0000 (23:25 +0200)]
ath9k: remove permissions from debugfs files

Don't allow users to open debugfs files, because it can cause oopses.

When a user opens some file, driver unlinks it and frees the
corresponding structure, we will dereference freed memory.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: remove permissions from debugfs files
Jiri Slaby [Sun, 28 Jun 2009 21:25:27 +0000 (23:25 +0200)]
ath5k: remove permissions from debugfs files

Don't allow users to open debugfs files, because it can cause oopses.

When a user opens some file, driver unlinks it and frees the
corresponding structure, we will dereference freed memory.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agodrivers/net/wireless/ath/ath9k: Remove unnecessary semicolons
Joe Perches [Sun, 28 Jun 2009 16:26:32 +0000 (09:26 -0700)]
drivers/net/wireless/ath/ath9k: Remove unnecessary semicolons

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: always print buffer when error condition occurs
Reinette Chatre [Fri, 26 Jun 2009 18:00:55 +0000 (11:00 -0700)]
iwlwifi: always print buffer when error condition occurs

We want to see the buffer contents when the error occurs without
needing to set any debug flags.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: add utility to print buffer when error occurs
Reinette Chatre [Fri, 26 Jun 2009 18:00:54 +0000 (11:00 -0700)]
iwlwifi: add utility to print buffer when error occurs

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlagn: re-enable PS support for iwlagn
Reinette Chatre [Fri, 26 Jun 2009 18:00:53 +0000 (11:00 -0700)]
iwlagn: re-enable PS support for iwlagn

The register locking rework addressed the problem where nic
access was obtained incorrectly when PS is enabled.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwmc3200wifi: remove B0 hardware support
Zhu Yi [Thu, 25 Jun 2009 10:28:32 +0000 (18:28 +0800)]
iwmc3200wifi: remove B0 hardware support

The patch removes B0 hardware support. Nobody is using it anyway.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwmc3200wifi: simplify calibration map
Zhu Yi [Thu, 25 Jun 2009 10:28:31 +0000 (18:28 +0800)]
iwmc3200wifi: simplify calibration map

The patch simplifies calibration map by combining the init_calib_map
and periodic_calib_map into one calib_map in struct iwm_conf. Now the
initial calibration map is stored in the lower 16 bits of calib_map
and the periodic calibration map is stored in the higher 16 bits.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwmc3200wifi: replace netif_rx with netif_rx_ni
Zhu Yi [Thu, 25 Jun 2009 10:28:30 +0000 (18:28 +0800)]
iwmc3200wifi: replace netif_rx with netif_rx_ni

The patch uses netif_rx_ni() over netif_rx() to post buffers to
upper network code because it is always scheduled in a workqueue.
The problem was first observed from a dynamic ticks warning:

    "NOHZ: local_softirq_pending ..."

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agodrivers/net/wireless: Use PCI_VDEVICE
Joe Perches [Thu, 25 Jun 2009 05:13:27 +0000 (22:13 -0700)]
drivers/net/wireless: Use PCI_VDEVICE

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Handle different TX and RX streams properly.
Senthil Balasubramanian [Wed, 24 Jun 2009 13:26:42 +0000 (18:56 +0530)]
ath9k: Handle different TX and RX streams properly.

This patch fixes an issue when the TX and RX streams are different.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: race condition in SCANNING state check during ANI calibration
Senthil Balasubramanian [Wed, 24 Jun 2009 13:26:41 +0000 (18:56 +0530)]
ath9k: race condition in SCANNING state check during ANI calibration

ANI calibration shouldn't be done when we are not on our home channel.
This is already verified. However, it is racy. Fix this by proper
spin locks.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: stop ani when the STA gets disconnected.
Senthil Balasubramanian [Wed, 24 Jun 2009 13:26:40 +0000 (18:56 +0530)]
ath9k: stop ani when the STA gets disconnected.

ANI is not required when the STA is disconnected. So stop it and enable
ANI for adhoc and monitor mode.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: remove unnecessary STATION mode check.
Senthil Balasubramanian [Wed, 24 Jun 2009 13:26:39 +0000 (18:56 +0530)]
ath9k: remove unnecessary STATION mode check.

Remove unncessary STATION mode check in ath9k_bss_assoc_info() as
it is called only for STATION mode.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54: Modify p54 files for new organization
Christian Lamparter [Tue, 23 Jun 2009 15:39:45 +0000 (10:39 -0500)]
p54: Modify p54 files for new organization

Modify the remaining p54 files to account for the new file organization.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54: Move TX/RX code
Christian Lamparter [Tue, 23 Jun 2009 15:39:12 +0000 (10:39 -0500)]
p54: Move TX/RX code

Copy the TX/RX code from p54common.c into a new file txrx.c

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54: Move mac80211 glue code
Christian Lamparter [Tue, 23 Jun 2009 15:38:49 +0000 (10:38 -0500)]
p54: Move mac80211 glue code

Copy the mac80211 glue code from p54common.c into a new file main.c

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54: Move LMAC interface definitions
Christian Lamparter [Tue, 23 Jun 2009 15:38:24 +0000 (10:38 -0500)]
p54: Move LMAC interface definitions

Copy the LMAC Interface specific definitions from p54common.h into a new file lmac.h

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54: Move LED code
Christian Lamparter [Tue, 23 Jun 2009 15:37:59 +0000 (10:37 -0500)]
p54: Move LED code

Copy the LED code from p54common.c into a new file led.c

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54: Move firmware code
Christian Lamparter [Tue, 23 Jun 2009 15:37:40 +0000 (10:37 -0500)]
p54: Move firmware code

Copy the firmware i/o code from p54common.c into a new file fwio.c

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54: Move eeprom header
Christian Lamparter [Tue, 23 Jun 2009 15:37:13 +0000 (10:37 -0500)]
p54: Move eeprom header

Copy the eeprom code from p54common.h into a new file eeprom.h

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54: Move eeprom code
Christian Lamparter [Tue, 23 Jun 2009 15:36:26 +0000 (10:36 -0500)]
p54: Move eeprom code

Copy the eeprom code from p54common.c into a new file eeprom.c

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agowireless: remove redundant tests on unsigned
Roel Kluin [Mon, 22 Jun 2009 15:42:21 +0000 (17:42 +0200)]
wireless: remove redundant tests on unsigned

bufsize and remainder are unsigned. When negative they are wrapped and caught by
the other test.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54: redo rx_status into skb->cb
Christian Lamparter [Sat, 20 Jun 2009 19:13:46 +0000 (21:13 +0200)]
p54: redo rx_status into skb->cb

This patch slightly optimizes p54_rx_data's stack and code size.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoar9170usb: module link in sysfs
Christian Lamparter [Sat, 20 Jun 2009 03:10:24 +0000 (05:10 +0200)]
ar9170usb: module link in sysfs

Andrey Yurovsky reported that the driver forwarded erroneously the
parent device structure instead of the real thing, which of course
led to some dodgy sysfs links (at least?).

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: unify iwl_setup_rxon_timing
Tomas Winkler [Fri, 19 Jun 2009 20:52:45 +0000 (13:52 -0700)]
iwlwifi: unify iwl_setup_rxon_timing

This patch unifies setup_rxon_timing funcions
of AGN and 3945. HWs differ only in supported maximal
beacon interval. This is reflected in hw_paras.max_beacon_itrvl

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: scan requested channels only
Johannes Berg [Fri, 19 Jun 2009 20:52:44 +0000 (13:52 -0700)]
iwlwifi: scan requested channels only

When userspace requests only certain channels to be scanned,
we currently ignore that request entirely.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: make software queue assignment more efficient
Johannes Berg [Fri, 19 Jun 2009 20:52:43 +0000 (13:52 -0700)]
iwlwifi: make software queue assignment more efficient

There really is no reason to be assigning txq->swq_id all the
time, once at aggregation setup is sufficient.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: drop sw_crypto from hw_params.
Tomas Winkler [Fri, 19 Jun 2009 20:52:42 +0000 (13:52 -0700)]
iwlwifi: drop sw_crypto from hw_params.

Each HW supported by iwlwifi is capable of hardware crypto
so drop this flag from hw_params structure.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: Check HW ready before prepare card.
Mohamed Abbas [Fri, 19 Jun 2009 20:52:41 +0000 (13:52 -0700)]
iwlwifi: Check HW ready before prepare card.

Hardware may be ready for us to manage it without us trying to prepare
it first. Check if this is the case.

Signed-off-by: Mohamed Abbas <mohamed.abbas@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: differentiate quality reporting between legacy and HT configurations
Luis R. Rodriguez [Fri, 19 Jun 2009 18:57:59 +0000 (11:57 -0700)]
ath9k: differentiate quality reporting between legacy and HT configurations

We were not differentiating quality between legacy and HT
configurations. We change this to consider the differences.

New theory for reporting quality:

At a hardware RSSI of 45 you will be able to use MCS 7  reliably.
At a hardware RSSI of 45 you will be able to use MCS 15 reliably.
At a hardware RSSI of 35 you should be able use 54 Mbps reliably.

MCS 7  is the highets MCS index usable by a 1-stream device.
MCS 15 is the highest MCS index usable by a 2-stream device.

All ath9k devices are either 1-stream or 2-stream.

How many bars you see is derived from the qual reporting.

A more elaborate scheme can be used here but it requires tables
of SNR/throughput for each possible mode used. For the MCS table
you can refer to the wireless wiki:

http://wireless.kernel.org/en/developers/Documentation/ieee80211/802.11n

This should fix this bug report:

http://bugzilla.kernel.org/show_bug.cgi?id=13537

Cc: Janath.Peiris@atheros.com
Cc: Matt.Smith@atheros.com
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agolibertas: fix card cleanup order in SDIO driver
Andrey Yurovsky [Thu, 18 Jun 2009 02:15:19 +0000 (19:15 -0700)]
libertas: fix card cleanup order in SDIO driver

The SDIO driver sets the surpriseremoved flag before calling
lbs_remove_card.  With IEEE PS enabled, lbs_remove_card must issue a
command to exit IEEE PS mode, however with that flag set the command
path is blocked and the card is never taken out of IEEE PS mode.  This
step is required to ensure that the driver can be reloaded.  This patch
moves the setting of surpriseremoved after lbs_remove_card is called.

Tested with V9 firmware by ensuring that IEEE PS is disabled when the
driver is removed.  Reloading the driver is not fully tested due to a
separate issue with module reload in the SDIO driver, however this
patch at least leaves the card in a better state when we bring the
driver down.

Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agolibertas: correct card cleanup order in SPI driver
Andrey Yurovsky [Thu, 18 Jun 2009 16:51:57 +0000 (09:51 -0700)]
libertas: correct card cleanup order in SPI driver

The SPI driver does a couple of card cleanup steps in the wrong order on
module removal.  If IEEE PS is enabled, this results in the card being
left in IEEE PS mode and subsequent failures to reload the module.  The
problem is that the surpriseremoved flag is set before calling
lbs_remove_card, but that function needs to issue a command to exit IEEE
PS mode (the flag blocks the command path).  In addition, lbs_stop_card
should be called first because it clears out any pending commands.

Tested on a GSPI device with V9 firmware by confirming that we can
reload the module with or without IEEE PS enabled.

Also fix a warning from the wrong uint format in a printk.

V2: use z modifier, thanks Sebastian.

Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agolibertas: copy WPA keys to priv when associating
Andrey Yurovsky [Thu, 18 Jun 2009 01:45:34 +0000 (18:45 -0700)]
libertas: copy WPA keys to priv when associating

Libertas currently maintains a copy of the WPA unicast and group keys
when using WPA or WPA2.  This copy is checked when deciding whether or
not to return to sleep in IEEE PS mode but the actual copying back to
priv was omitted, which breaks IEEE PS mode with WPA/WPA2 when one
issues commands that require temporarily keeping the device awake.

This patch introduces the omitted copy-back of the keys so that IEEE PS
functions correctly in WPA/WPA2 mode.  Thanks to Dan Williams for
clearing up the issue.

V2: fix typo.  Also, this has been tested on GSPI and SDIO with V9 firmware.

Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: fix giwrange
Johannes Berg [Mon, 6 Jul 2009 17:40:51 +0000 (19:40 +0200)]
cfg80211: fix giwrange

"cfg80211: Advertise ciphers via WE according to driver capability"
unfortunately broke iwrange -- it used the variable c
that needs to be 0 for the channel list.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agonl80211: limit to one pairwise cipher for associate()
Johannes Berg [Thu, 2 Jul 2009 19:36:37 +0000 (21:36 +0200)]
nl80211: limit to one pairwise cipher for associate()

In this case, only one cipher makes sense, unlike for
connect() where it may be possible to have the card or
driver select.

No changes to mac80211 due to the way the structs are
laid out -- but the loop in net/mac80211/cfg.c will
degrade to just zero or one passes.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoorinoco: fix printk format specifier for size_t arguments
David Kilroy [Thu, 2 Jul 2009 19:26:45 +0000 (20:26 +0100)]
orinoco: fix printk format specifier for size_t arguments

This addresses the following compile warnings on 64-bit platforms.

drivers/net/wireless/orinoco/scan.c: In function 'orinoco_add_hostscan_results':
drivers/net/wireless/orinoco/scan.c:194: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
drivers/net/wireless/orinoco/scan.c:211: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
drivers/net/wireless/orinoco/scan.c:211: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: refuse authenticating to same BSSID twice
Johannes Berg [Thu, 2 Jul 2009 16:26:18 +0000 (18:26 +0200)]
cfg80211: refuse authenticating to same BSSID twice

It is possible that there are different BSS structs with
the same BSSID, but we cannot authenticate with multiple
of them them because we need the BSSID to be unique for
deauthenticating/disassociating.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: keep track of BSSes
Johannes Berg [Thu, 2 Jul 2009 15:20:43 +0000 (17:20 +0200)]
cfg80211: keep track of BSSes

In order to avoid problems with BSS structs going away
while they're in use, I've long wanted to make cfg80211
keep track of them. Without the SME, that wasn't doable
but now that we have the SME we can do this too. It can
keep track of up to four separate authentications and
one association, regardless of whether it's controlled
by the cfg80211 SME or the userspace SME.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: assimilate and export ieee80211_bss_get_ie
Johannes Berg [Thu, 2 Jul 2009 15:18:40 +0000 (17:18 +0200)]
cfg80211: assimilate and export ieee80211_bss_get_ie

This function from mac80211 seems generally useful, and
I will need it in cfg80211 soon.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: reset auth algorithm
Johannes Berg [Thu, 2 Jul 2009 13:49:03 +0000 (15:49 +0200)]
cfg80211: reset auth algorithm

When the interface is brought down, we need to
reset the auth algorithm because wpa_supplicant
doesn't reset it, and then we fail to use shared
key auth when required later.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: send events for userspace SME
Johannes Berg [Thu, 2 Jul 2009 07:58:04 +0000 (09:58 +0200)]
cfg80211: send events for userspace SME

When the userspace SME is in control, we are currently not sending
events, but this means that any userspace applications using wext
or nl80211 to receive events will not know what's going on unless
they can also interpret the nl80211 assoc event. Since we have all
the required code, let the SME follow events from the userspace
SME, this even means that you will be refused to connect() while
the userspace SME is in control and connected.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: remove dead code, clean up
Johannes Berg [Wed, 1 Jul 2009 19:41:17 +0000 (21:41 +0200)]
mac80211: remove dead code, clean up

With mac80211 now always controlled by an external SME,
a lot of code is dead -- SSID, BSSID, channel selection
is always done externally, etc. Additionally, rename
IEEE80211_STA_TKIP_WEP_USED to IEEE80211_STA_DISABLE_11N
and clean up the code a bit.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: remove auth algorithm retry
Johannes Berg [Wed, 1 Jul 2009 19:40:45 +0000 (21:40 +0200)]
mac80211: remove auth algorithm retry

The automatic auth algorithm issue is now solved in
cfg80211, so mac80211 no longer needs code to try
different algorithms -- just using whatever cfg80211
asked for is good.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: re-add HT disabling
Johannes Berg [Wed, 1 Jul 2009 19:27:01 +0000 (21:27 +0200)]
mac80211: re-add HT disabling

The IEEE80211_STA_TKIP_WEP_USED flag is used internally to
disable HT when WEP or TKIP are used. Now that cfg80211 is
giving us the required information, we can set the flag
appropriately again.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: implement get_wireless_stats
Johannes Berg [Wed, 1 Jul 2009 19:27:00 +0000 (21:27 +0200)]
cfg80211: implement get_wireless_stats

By dropping the noise reporting, we can implement
wireless stats in cfg80211. We also make the
handler return NULL if we have no information,
which is possible thanks to the recent wext change.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: implement IWRATE
Johannes Berg [Wed, 1 Jul 2009 19:26:59 +0000 (21:26 +0200)]
cfg80211: implement IWRATE

For now, let's implement that using a very hackish way:
simply mirror the wext API in the cfg80211 API. This
will have to be changed later when we implement proper
bitrate API.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: implement IWAP for WDS
Johannes Berg [Wed, 1 Jul 2009 19:26:58 +0000 (21:26 +0200)]
cfg80211: implement IWAP for WDS

This implements siocsiwap/giwap for WDS mode.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: implement iwpower
Johannes Berg [Wed, 1 Jul 2009 19:26:57 +0000 (21:26 +0200)]
cfg80211: implement iwpower

Just on/off and timeout, and with a hacky cfg80211 method
until we figure out what we want, though this is probably
sufficient as we want to use pm_qos for wifi everywhere.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: managed mode wext compatibility
Johannes Berg [Wed, 1 Jul 2009 19:26:56 +0000 (21:26 +0200)]
cfg80211: managed mode wext compatibility

This adds code to make it possible to use the cfg80211
connect() API with wireless extensions, and because the
previous patch added emulation of that API with auth()
and assoc(), by extension also supports wext on that.
At the same time, removes code from mac80211 for wext,
but doesn't yet clean up mac80211's mlme code more.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: emulate connect with auth/assoc
Johannes Berg [Thu, 2 Jul 2009 07:13:27 +0000 (09:13 +0200)]
cfg80211: emulate connect with auth/assoc

This adds code to cfg80211 so that drivers (mac80211 right
now) that don't implement connect but rather auth/assoc can
still be used with the nl80211 connect command. This will
also be necessary for the wext compat code.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: connect/disconnect API
Samuel Ortiz [Wed, 1 Jul 2009 19:26:54 +0000 (21:26 +0200)]
cfg80211: connect/disconnect API

This patch introduces the cfg80211 connect/disconnect API.
The goal here is to run the AUTH and ASSOC steps in one call.
This is needed for some fullmac cards that run both steps
directly from the target, after the host driver sends a
connect command.

Additionally, all the new crypto parameters for connect()
are now also valid for associate() -- although associate
requires the IEs to be used, the information can be useful
for drivers and should be given.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agowireless: define AKM suites
Johannes Berg [Wed, 1 Jul 2009 19:26:53 +0000 (21:26 +0200)]
wireless: define AKM suites

We'll need these values for some drivers using connect API
and for wext compat code, so let's define them.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: remove an unused function declaration
Johannes Berg [Wed, 1 Jul 2009 19:26:52 +0000 (21:26 +0200)]
mac80211: remove an unused function declaration

The ieee80211_scan_results function hasn't existed for a
long time now, so its declaration should be removed as
well.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: introduce nl80211 testmode command
Johannes Berg [Wed, 1 Jul 2009 19:26:51 +0000 (21:26 +0200)]
cfg80211: introduce nl80211 testmode command

This introduces a new NL80211_CMD_TESTMODE for testing
and calibration use with nl80211. There's no multiplexing
like like iwpriv had, and the command is not available by
default, it needs to be explicitly enabled in Kconfig and
shouldn't be enabled in most kernels.

The command requires a wiphy index or interface index to
identify the device to operate on, and the new TESTDATA
attribute. There also is API for sending replies to the
command, and testmode multicast messages (on a testmode
multicast group).

I've also updated mac80211 to be able to pass through the
command to the driver, since it itself doesn't implement
the testmode command.

Additionally, to give people an idea of how to use the
command, I've added a little code to hwsim that makes use
of the new command to set the powersave mode, this is
currently done via debugfs and should remain there, and
the testmode command only serves as an example of how to
use this best -- with nested netlink attributes in the
TESTDATA attribute. A hwsim testmode tool can be found at
http://git.sipsolutions.net/hwsim.git/. This tool is BSD
licensed so people can easily use it as a basis for their
own internal fabrication and validation tools.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agowext: constify extra argument to wireless_send_event
Johannes Berg [Wed, 1 Jul 2009 19:26:50 +0000 (21:26 +0200)]
wext: constify extra argument to wireless_send_event

This is never changed by the function, so can be marked const.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: tell SME about real auth state
Johannes Berg [Wed, 1 Jul 2009 19:26:49 +0000 (21:26 +0200)]
mac80211: tell SME about real auth state

When the auth algorithm is rejected, but we don't have
another one to try, we will eventually retry but that
isn't useful -- we'll then do it again and again until
we eventually give up. Instead, we should let the SME
know and go into disabled state. The same applies for
situations where the AP rejects with any other status
code.

Additionally, when trying the next auth algorithm, we
should reset the auth_tries so that just a single lost
frame doesn't lead to us giving up on the third auth
algorithm.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: remove wireless_dev->bssid
Johannes Berg [Wed, 1 Jul 2009 19:26:48 +0000 (21:26 +0200)]
cfg80211: remove wireless_dev->bssid

This variable isn't necessary -- the wext code keeps
track of the BSSID itself, and otherwise we have
current_bss.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: use proper allocation flags
Johannes Berg [Wed, 1 Jul 2009 19:26:47 +0000 (21:26 +0200)]
cfg80211: use proper allocation flags

Instead of hardcoding GFP_ATOMIC everywhere, add a
new function parameter that gets the flags from the
caller. Obviously then I need to update all callers
(all of them in mac80211), and it turns out that now
it's ok to use GFP_KERNEL in almost all places.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agonl80211: clean up function definitions
Johannes Berg [Wed, 1 Jul 2009 19:26:46 +0000 (21:26 +0200)]
nl80211: clean up function definitions

I don't like the 'extern' keyword much when it's not
necessary, it makes lines rather long.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: move break statement to correct place
Johannes Berg [Wed, 1 Jul 2009 19:26:45 +0000 (21:26 +0200)]
cfg80211: move break statement to correct place

Move a break statement to the correct place _after_ the
#endif, otherwise w/o WIRELESS_EXT things break badly.
Also, while touching this code, do a cleanup and assign
dev->ieee80211_ptr to a new variable.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agowext: default to y
Johannes Berg [Wed, 1 Jul 2009 19:26:44 +0000 (21:26 +0200)]
wext: default to y

The way I initially thought we could do wireless extensions
is by making all the compat code in cfg80211 be independent
of CONFIG_WIRELESS_EXT, but this is turning out to not be
feasible. Therefore, fix the Kconfig help text and make the
option default to yes, so people won't get a nasty surprise
when mac80211 will get rid of its 'select WIRELESS_EXT' any
time now.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: fix todo lock
Johannes Berg [Wed, 1 Jul 2009 19:26:43 +0000 (21:26 +0200)]
mac80211: fix todo lock

The key todo lock can be taken from different locks
that require it to be _bh to avoid lock inversion
due to (soft)irqs.

This should fix the two problems reported by Bob and
Gabor:
http://mid.gmane.org/20090619113049.GB18956@hash.localnet
http://mid.gmane.org/4A3FA376.8020307@openwrt.org

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Bob Copeland <me@bobcopeland.com>
Cc: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agowext: allow returning NULL stats
Johannes Berg [Wed, 1 Jul 2009 19:26:42 +0000 (21:26 +0200)]
wext: allow returning NULL stats

Currently, wext drivers cannot return NULL for stats even though
that would make the ioctl return -EOPNOTSUPP because that would
mean they are no longer listed in /proc/net/wireless. This patch
changes the wext core's behaviour to list them if they have any
wireless_handlers, but only show their stats when available, so
that drivers can start returning NULL if stats are currently not
available, reducing confusion for e.g. IBSS.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211_hwsim: fix-up build damage from removal of skb->dst
John W. Linville [Tue, 30 Jun 2009 20:55:52 +0000 (16:55 -0400)]
mac80211_hwsim: fix-up build damage from removal of skb->dst

Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: remove ath_rx_ps_back_to_sleep helper
Gabor Juhos [Fri, 19 Jun 2009 10:17:48 +0000 (12:17 +0200)]
ath9k: remove ath_rx_ps_back_to_sleep helper

This helper only clears the SC_OP_WAIT_FOR_{BEACON,CAB} flags.
Remove it and clear these flags directly in the approptiate
places instead.

Changes-licensed-under: ISC
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>