Johannes Berg [Mon, 23 Mar 2009 16:28:37 +0000 (17:28 +0100)]
mac80211: rework the pending packets code
The pending packets code is quite incomprehensible, uses memory barriers
nobody really understands, etc. This patch reworks it entirely, using
the queue spinlock, proper stop bits and the skb queues themselves to
indicate whether packets are pending or not (rather than a separate
variable like before).
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Reviewed-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Mon, 23 Mar 2009 16:28:36 +0000 (17:28 +0100)]
mac80211: fix A-MPDU queue assignment
Internally, mac80211 requires the skb's queue mapping to be set
to the AC queue, not the virtual A-MPDU queue. This is not done
correctly currently, this patch moves the code down to directly
before the driver is invoked and adds a comment that it will be
moved into the driver later.
Since this requires __ieee80211_tx() to have the sta pointer,
make sure to provide it in ieee80211_tx_pending().
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Reviewed-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Mon, 23 Mar 2009 16:28:35 +0000 (17:28 +0100)]
mac80211: rewrite fragmentation
Fragmentation currently uses an allocated array to store the
fragment skbs, and then keeps track of which have been sent
and which are still pending etc. This is rather complicated;
make it simpler by just chaining the fragments into skb->next
and removing from that list when sent. Also simplifies all
code that needs to touch fragments, since it now only needs
to walk the skb->next list.
This is a prerequisite for fixing the stored packet code,
which I need to do for proper aggregation packet storing.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Reviewed-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Wey-Yi Guy [Tue, 24 Mar 2009 17:02:54 +0000 (10:02 -0700)]
iwlwifi: show current driver status in user readable format
change the display of current driver status bit to user readable format
for better and easier debugging
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Tue, 24 Mar 2009 08:35:46 +0000 (09:35 +0100)]
cfg80211: fix locking in nl80211_set_wiphy
Luis reports that there's a circular locking dependency;
this is because cfg80211_dev_rename() will acquire the
cfg80211_mutex while the device mutex is held, while
this normally is done the other way around. The solution
is to open-code the device-getting in nl80211_set_wiphy
and require holding the mutex around cfg80211_dev_rename
rather than acquiring it within.
Also fix a bug -- rtnl locking is expected by drivers so
we need to provide it.
Reported-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Tue, 24 Mar 2009 07:46:57 +0000 (08:46 +0100)]
mac80211: fix RX path
My previous patch ("mac80211: remove mixed-cell and userspace MLME code")
was too obvious to me, so obvious that a stupid bug crept in. The IBSS
RX function must be invoked for IBSS, of course, not anything != IBSS.
Reported-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
ath9k: fix dma mapping leak of rx buffer upon rmmod
We were claiming DMA buffers on the RX tasklet but never
upon a simple module removal.
Cc: stable@kernel.org Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bob Copeland [Tue, 3 Mar 2009 02:55:18 +0000 (21:55 -0500)]
ath5k: warn and correct rate for unknown hw rate indexes
ath5k sets up a mapping table from the hardware rate index to
the rate index used by mac80211; however, we have seen some
received frames with incorrect rate indexes. Such frames
normally get dropped with a warning in __ieee80211_rx(),
but it doesn't include enough information to track down the
error.
This patch adds a warning to hw_to_driver_rix for any lookups
that result in a rate index of -1, then returns a valid rate so
the frame can be processed.
Changes-licensed-under: 3-Clause-BSD
Signed-off-by: Bob Copeland <me@bobcopeland.com> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
Lorenzo Nava [Sun, 22 Mar 2009 18:15:41 +0000 (19:15 +0100)]
b43: fix b43_plcp_get_bitrate_idx_ofdm return type
This patch fixes the return type of b43_plcp_get_bitrate_idx_ofdm. If
the plcp contains an error, the function return value is 255 instead
of -1, and the packet was not dropped. This causes a warning in
__ieee80211_rx function because rate idx is out of range.
Cc: stable@kernel.org Signed-off-by: Lorenzo Nava <navalorenx@gmail.com> Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Mon, 23 Mar 2009 13:10:22 +0000 (14:10 +0100)]
mac80211: rate control status only for controlled packets
This patch changes mac80211 to not notify the rate control algorithm's
tx_status() method when reporting status for a packet that didn't go
through the rate control algorithm's get_rate() method.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Kalle Valo [Sun, 22 Mar 2009 19:57:35 +0000 (21:57 +0200)]
mac80211: add beacon filtering support
Add IEEE80211_HW_BEACON_FILTERING flag so that driver inform that it supports
beacon filtering. Drivers need to call the new function
ieee80211_beacon_loss() to notify about beacon loss.
Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Kalle Valo [Sun, 22 Mar 2009 19:57:28 +0000 (21:57 +0200)]
cfg80211: add feature to hold bss
In beacon filtering there needs to be a way to not expire the BSS even
when no beacons are received. Add an interface to cfg80211 to hold
BSS and make sure that it's not expired.
Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Kalle Valo [Sun, 22 Mar 2009 19:57:21 +0000 (21:57 +0200)]
mac80211: disable power save when scanning
When software scanning we need to disable power save so that all possible
probe responses and beacons are received. For hardware scanning assume that
hardware will take care of that and document that assumption.
Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Kalle Valo [Sun, 22 Mar 2009 19:57:14 +0000 (21:57 +0200)]
mac80211: track beacons separately from the rx path activity
Separate beacon and rx path tracking in preparation for the beacon filtering
support. At the same time change ieee80211_associated() to look a bit simpler.
Probe requests are now sent only after IEEE80211_PROBE_IDLE_TIME, which
is now set to 60 seconds.
Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Kalle Valo [Sun, 22 Mar 2009 19:57:06 +0000 (21:57 +0200)]
mac80211: decrease execution of the associated timer
Currently the timer is triggering every two seconds
(IEEE80211_MONITORING_INTERVAL). Decrease the timer to only trigger during
data idle periods to avoid waking up CPU unnecessary. The timer will
still trigger during idle periods, that needs to be fixed later.
There's also a functional change that probe requests are sent only when the
data path is idle, earlier they were sent also while there was activity
on the data path.
This is also preparation for the beacon filtering support. Thanks to
Johannes Berg for the idea.
Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Add vendor ID for Quanta Microsystems and update the led table with the reported device.
Reported-by: Scott Barnes <nekoreeve@gmail.com> Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch update all necessary Makefile and Kconfig files.
Now you can then enable ar9170 in the kernel configuration under:
Device Drivers --->
[*] Network device support --->
Wireless LAN --->
[*] Wireless LAN (IEEE 802.11)
<M> Atheros AR9170 support
<M> Atheros AR9170 USB support
Signed-off-by: Christian Lamparter <chunkeey@web.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Sat, 21 Mar 2009 16:08:43 +0000 (17:08 +0100)]
mac80211: remove mixed-cell and userspace MLME code
Neither can currently be set from userspace, so there's no
regression potential, and neither will be supported from
userspace since the new userspace APIs allow the SME, which
is in userspace, to control all we need.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
cfg80211: remove code about country IE support with OLD_REG
We had left in code to allow interested developers to add
support for parsing country IEs when OLD_REG was enabled.
This never happened and since we're going to remove OLD_REG
lets just remove these comments and code for it.
This code path was never being entered so this has no
functional change.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
cfg80211: make regdom module parameter available oustide of OLD_REG
It seems a few users are using this module parameter although its not
recommended. People are finding it useful despite there being utilities
for setting this in userspace. I'm not aware of any distribution using
this though.
Until userspace and distributions catch up with a default userspace
automatic replacement (GeoClue integration would be nirvana) we copy
the ieee80211_regdom module parameter from OLD_REG to the new reg
code to help these users migrate.
Users who are using the non-valid ISO / IEC 3166 alpha "EU" in their
ieee80211_regdom module parameter and migrate to non-OLD_REG enabled
system will world roam.
This also schedules removal of this same ieee80211_regdom module
parameter circa March 2010. Hope is by then nirvana is reached and
users will abandoned the module parameter completely.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
cfg80211: fix incorrect assumption on last_request for 11d
The incorrect assumption is the last regulatory request
(last_request) is always a country IE when processing
country IEs. Although this is true 99% of the time the
first time this happens this could not be true.
This fixes an oops in the branch check for the last_request
when accessing drv_last_ie. The access was done under the
assumption the struct won't be null.
Note to stable: to port to 29 replace as follows, only 29 has
country IE code:
Cc: stable@kernel.org Reported-by: Quentin Armitage <Quentin@armitage.org.uk> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
cfg80211: force last_request to be set for OLD_REG if regdom is EU
Although EU is a bogus alpha2 we need to process the send request
as our code depends on last_request being set.
Cc: stable@kernel.org Reported-by: Quentin Armitage <Quentin@armitage.org.uk> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jouni Malinen [Fri, 20 Mar 2009 19:21:19 +0000 (21:21 +0200)]
nl80211: Check iftype in cfg80211 code
We do not want to require all the drivers using cfg80211 to need to do
this. In addition, make the error values consistent by using
EOPNOTSUPP instead of semi-random assortment of errno values.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jouni Malinen [Fri, 20 Mar 2009 19:21:17 +0000 (21:21 +0200)]
nl80211: Add more through validation of MLME command parameters
Check that the used authentication type and reason code are valid here
so that drivers/mac80211 do not need to care about this. In addition,
remove the unnecessary validation of SSID attribute length which is
taken care of by netlink policy.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jouni Malinen [Fri, 20 Mar 2009 19:21:16 +0000 (21:21 +0200)]
nl80211: Remove NL80211_CMD_SET_MGMT_EXTRA_IE
The functionality that NL80211_CMD_SET_MGMT_EXTRA_IE provided can now
be achieved with cleaner design by adding IE(s) into
NL80211_CMD_TRIGGER_SCAN, NL80211_CMD_AUTHENTICATE,
NL80211_CMD_ASSOCIATE, NL80211_CMD_DEAUTHENTICATE, and
NL80211_CMD_DISASSOCIATE.
Since this is a very recently added command and there are no known (or
known planned) applications using NL80211_CMD_SET_MGMT_EXTRA_IE and
taken into account how much extra complexity it adds to the IE
processing we have now (and need to add in the future to fix IE order
in couple of frames), it looks like the best option is to just remove
the implementation of this command for now. The enum values themselves
are left to avoid changing the nl80211 command or attribute numbers.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jouni Malinen [Fri, 20 Mar 2009 13:53:16 +0000 (15:53 +0200)]
mac80211: Fix memleak in nl80211 authentication on deinit
This file was forgotten from the quilt patch that added MLME
primitives, so the kfree on interface removal is missing. Fix this
potential memleak by freeing the temporary Authentication frame IEs
from SME when the interface is being removed.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 13 Mar 2009 10:44:18 +0000 (11:44 +0100)]
mac80211: resume properly, add suspend/resume test
When mac80211 resumes, it currently doesn't reconfigure the interfaces
entirely and also doesn't reconfigure BSS information -- fix this.
Also, to be able to test this, add a debugfs file that just calls
the suspend/resume code to see what happens when we go through that,
without needing the time-consuming suspend/resume cycle.
(Original version broke the build for CONFIG_PM=n. Define alternative
functions for that situation. -- JWL)
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Michael Buesch [Thu, 19 Mar 2009 18:27:21 +0000 (19:27 +0100)]
b43: Mask PHY TX error interrupt, if not debugging
This masks the PHY TX error interrupt, if debugging is disabled.
Currently we have a bug somewhere which triggers this interrupt once
in a while. (Depends on the network noise/quality). While this is nonfatal,
it scares the hell out of users and we frequently receive bugreports
that incorrectly identify this error message as the reason.
There's another problem with this. The PHY TX error interrupt is protected
with a watchdog that will restart the device if it keeps triggering very often.
This is used to fix interrupt storms from completely broken devices.
However, this watchdog might trigger in completely normal operation.
If the TX capacity of the card is saturated, the likeliness of the watchdog
triggering increases, as more TX errors occur. The current threshold
for the watchdog is 1000 errors in 15 seconds.
This patch adds a workaround for the issue by just enabling the interrupt
if debugging is disabled (by Kconfig or by modparam).
This has the downside that real fatal PHY TX errors are not caught anymore.
But this is nonfatal due to the following reasons:
* If the card is not able to transmit anymore, MLME will notice anyway.
* I did _never_ see a real fatal PHY TX error in a mainline b43 driver.
* It does _not_ result in interrupt storms or something like that.
It will simply result in a stalled card. It can be debugged by enabling
the debugging module parameter.
Signed-off-by: Michael Buesch <mb@bu3sch> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jouni Malinen [Thu, 19 Mar 2009 11:39:22 +0000 (13:39 +0200)]
nl80211: Add MLME primitives to support external SME
This patch adds new nl80211 commands to allow user space to request
authentication and association (and also deauthentication and
disassociation). The commands are structured to allow separate
authentication and association steps, i.e., the interface between
kernel and user space is similar to the MLME SAP interface in IEEE
802.11 standard and an user space application takes the role of the
SME.
The patch introduces MLME-AUTHENTICATE.request,
MLME-{,RE}ASSOCIATE.request, MLME-DEAUTHENTICATE.request, and
MLME-DISASSOCIATE.request primitives. The authentication and
association commands request the actual operations in two steps
(assuming the driver supports this; if not, separate authentication
step is skipped; this could end up being a separate "connect"
command).
The initial implementation for mac80211 uses the current
net/mac80211/mlme.c for actual sending and processing of management
frames and the new nl80211 commands will just stop the current state
machine from moving automatically from authentication to association.
Future cleanup may move more of the MLME operations into cfg80211.
The goal of this design is to provide more control of authentication and
association process to user space without having to move the full MLME
implementation. This should be enough to allow IEEE 802.11r FT protocol
and 802.11s SAE authentication to be implemented. Obviously, this will
also bring the extra benefit of not having to use WEXT for association
requests with mac80211. An example implementation of a user space SME
using the new nl80211 commands is available for wpa_supplicant.
This patch is enough to get IEEE 802.11r FT protocol working with
over-the-air mechanism (over-the-DS will need additional MLME
primitives for handling the FT Action frames).
Signed-off-by: Jouni Malinen <j@w1.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jouni Malinen [Thu, 19 Mar 2009 11:39:21 +0000 (13:39 +0200)]
nl80211: Event notifications for MLME events
Add new nl80211 event notifications (and a new multicast group, "mlme")
for informing user space about received and processed Authentication,
(Re)Association Response, Deauthentication, and Disassociation frames in
station and IBSS modes (i.e., MLME SAP interface primitives
MLME-AUTHENTICATE.confirm, MLME-ASSOCIATE.confirm,
MLME-REASSOCIATE.confirm, MLME-DEAUTHENTICATE.indicate, and
MLME-DISASSOCIATE.indication). The event data is encapsulated as the 802.11
management frame since we already have the frame in that format and it
includes all the needed information.
This is the initial step in providing MLME SAP interface for
authentication and association with nl80211. In other words, kernel code
will act as the MLME and a user space application can control it as the
SME.
Signed-off-by: Jouni Malinen <j@w1.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jouni Malinen [Thu, 19 Mar 2009 11:39:20 +0000 (13:39 +0200)]
mac80211: Fix reassociation by not clearing previous BSSID
We must not clear the previous BSSID when roaming to another AP within
the same ESS for reassociation to be used properly. It is fine to
clear this when the SSID changes, so let's move the code into
ieee80211_sta_set_ssid().
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
ath9k: Fix rate control update for aggregated frames
We will miss rate control update if first A-MPDU of an
aggregation is not Block Acked as we always tell if the
rate control needs to updated through update_rc of first
A-MPDU. This patch does rate control update for the first
A-MPDU which notifies it's tx status (which is not
necessarily the first A-MPDU of an aggregation) to mac80211.
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Kalle Valo [Wed, 18 Mar 2009 12:06:44 +0000 (14:06 +0200)]
mac80211: don't drop nullfunc frames during software scan
ieee80211_tx_h_check_assoc() was dropping everything else than probe
requests during software scan. So the nullfunc frame with the power save
bit was dropped and AP never received it. This meant that AP never
buffered any frames for the station during software scan.
Fix this by allowing to transmit both probe request and nullfunc frames
during software scan. Tested with stlc45xx.
Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Wey-Yi Guy [Wed, 18 Mar 2009 04:51:52 +0000 (21:51 -0700)]
iwlwifi: report error when detect failure during stop agg queue
This fix related to bug 1921 at
http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=1921
when detect error during stopping tx aggregation queue, report the error to
help identify the problem.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Abhijeet Kolekar [Wed, 18 Mar 2009 04:51:48 +0000 (21:51 -0700)]
iwl3945: set TFD_QUEUE_MAX to correct value
Total number of queues is 8 but only 7 of them are TX queues.
4 AC(Data) queue ,1 CMD and 2 HCCA. The HCCA queues are not used.
max_txq_num is set to maximum usable TX queues.
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Mohamed Abbas [Wed, 18 Mar 2009 04:51:47 +0000 (21:51 -0700)]
iwlwifi: support 11h
Set IEEE80211_HW_SPECTRUM_MGMT bit in hw->flags, this tell mac80211
we support spectrum mgmt.
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>
Mohamed Abbas [Wed, 18 Mar 2009 04:51:45 +0000 (21:51 -0700)]
iwlcore: dont commit power command if interface is not up
If user set new power level, accept the new power level and only
send command to host if the interface is up and radio on.
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>
Mohamed Abbas [Wed, 18 Mar 2009 04:51:44 +0000 (21:51 -0700)]
iwlagn: allow power level setting all the times
allow user to set power level at all times
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>
Wey-Yi Guy [Wed, 18 Mar 2009 04:51:43 +0000 (21:51 -0700)]
iwlwifi: return 0 for AMPDU_TX/RX_STOP request if NIC is going down
When receive IEEE80211_AMPDU_RX_STOP or IEEE80211_AMPDU_TX_STOP request
in iwl_mac_ampdu_action() from mac80211; check STATUS_EXIT_PENDING bit,
if NIC is on the way out, then return 0 back to mac80211, this can
prevent mac80211 report HW error incorrectly.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Mohamed Abbas [Wed, 18 Mar 2009 04:51:42 +0000 (21:51 -0700)]
iwl3945: use changed in iwl3945_mac_config
In function iwl3945_mac_config use changed flag to call only
the affected functions.
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>
Mohamed Abbas [Wed, 18 Mar 2009 04:59:18 +0000 (21:59 -0700)]
iwlagn: use changed in mac_config
In function iwl_mac_config use changed flag to call only
the affected functions. This patch also allow user to cache
channel, txpower and power value when the interface is not
ready and apply the changes once the interface ready.
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>
Johannes Berg [Thu, 12 Mar 2009 08:55:09 +0000 (09:55 +0100)]
nl80211: rework locking
When I added scanning to cfg80211, we got a lock dependency like this:
rtnl --> cfg80211_mtx
nl80211, on the other hand, has the reverse lock dependency:
cfg80211_mtx --> rtnl
which clearly is a bad idea. This patch reworks nl80211 to take these
two locks in the other order to fix the possible, and easily
triggerable, deadlock.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith [Tue, 17 Mar 2009 03:20:06 +0000 (08:50 +0530)]
mac80211: Tear down aggregation sessions for suspend/resume
When the driver has been notified with a STA_REMOVE, it tears down
the internal ADDBA state. On resume, trying to initiate aggregation would
fail because mac80211 has not cleared the operational state for that <TID,STA>.
This can be fixed by tearing down the existing sessions on a suspend.
Also, the driver can initiate a new BA session when suspend is in progress.
This is fixed by marking the station as being in suspend state and
denying ADDBA requests for such STAs.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bob Copeland [Tue, 17 Mar 2009 02:34:02 +0000 (22:34 -0400)]
ath5k: disable MIB interrupts
The MIB interrupt fires whenever counters overflow; however without
support for automatic noise immunity, we can sometimes get an interrupt
storm. The get_stats() callback reads the counters anyway so we can
disable the interrupt for now until ANI is implemented. This fixes
the issue reported in http://bugzilla.kernel.org/show_bug.cgi?id=12647.
Changes-licensed-under: 3-Clause-BSD
Cc: stable@kernel.org Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Sun, 15 Mar 2009 20:13:39 +0000 (22:13 +0200)]
ath5k: Choose the right initvals for RF2425
* Fix a typo in initvals.c so that we use the RF2425 array for RF2425 and not RF2413
Note: This also fixes incorect pd gain overlap since RF2425 has different pd gain overlap from RF2413
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Acked-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Sat, 14 Mar 2009 08:42:49 +0000 (09:42 +0100)]
mac80211: acquire sta_lock for station suspend/resume
To avoid concurrent manipulations of the sta list (which shouldn't
be possible at this point, but anyway) we need to hold the sta_lock
around iterating the list.
At the same time, we do not need to iterate the list at all if
the driver doesn't want to be notified.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Sat, 14 Mar 2009 08:34:01 +0000 (09:34 +0100)]
nl80211: export supported commands
This makes nl80211 export the supported commands (command groups)
per wiphy so userspace has an idea what it can do -- this will be
required reading for userspace when we introduce auth/assoc /or/
connect for older hardware that cannot separate auth and assoc.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 13 Mar 2009 11:52:10 +0000 (12:52 +0100)]
wireless: radiotap updates
Radiotap was updated to include a "bad PLCP" flag and standardise
the "bad FCS" flag in the "flags" rather than "RX flags" field,
this patch updates Linux to that standard.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 13 Mar 2009 10:43:36 +0000 (11:43 +0100)]
mac80211: stop queues across suspend/resume
Even though userland probably cannot submit packets, there might
still be some coming, and that's no good when the driver doesn't
expect them. Stop the queues across suspend/resume.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 13 Mar 2009 10:19:45 +0000 (11:19 +0100)]
mac80211: fix warnings in ieee80211_if_config
The last warning can never trigger, and the explicit AP_VLAN
check is pointless if we move the config_interface check down,
in practice config_interface is required anyway.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith [Fri, 13 Mar 2009 03:26:11 +0000 (08:56 +0530)]
ath9k: Fix bug in handling single stream stations
AP mode currently sets up the dual stream capability
for all stations. This patch fixes it by checking if the
associated station supports dual stream MCS rates (8-15).
We would disregard any MCS rates above 15, since Atheros
HW supports only 0..15 rates currently, and can't receive
at rates > 15 anyway.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Remove the PCI retry timeout code as that was just taken from ipw2100
due to historical reasons but in reality its a no-op, additionally its
simply incorrect as each PCI devices has its own custom PCI configuration
space on PCI config space >= 0x40. Not to mention we were trying to write
0 to a place that already has 0 on it.
Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Ben Cahill <ben.m.cahill@intel.com> Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> Tested-by: Adel Gadllah <adel.gadllah@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jouni Malinen [Thu, 12 Mar 2009 19:53:23 +0000 (21:53 +0200)]
ath9k: Add support for multiple virtual AP interfaces
This patch fixes the TSF offset calculation for staggered Beacon frames
and sets ATH_BCBUF back to the earlier value 4 to enable multi-BSS
configurations of up to four BSSes.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Thu, 12 Mar 2009 13:04:34 +0000 (14:04 +0100)]
mac80211: start pending scan after probe/auth/assoc timed out
If a scan is queued in STA mode while the interface is in state direct
probe, authenticate or associate the scan is delayed until the interface
enters disabled or associated state. But in case of direct probe-,
authentication- or association- timeout sta_work will not be scheduled
anymore (without external trigger) and thus the pending scan is not
executed and prevents a new scan from being triggered (-EBUSY).
Fix this by queueing the sta work again after direct probe-, authentication-
and association- timeout.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Thu, 12 Mar 2009 10:16:48 +0000 (11:16 +0100)]
mac80211: reduce max number of queues
No hw/driver actually supports more than four queues right now,
and we allocate a number of things per queue which means we
waste a bit of memory. Reduce the maximum number to four to
accurately reflect what we do (and need for QoS). Even if we
had hardware supporting more queues we couldn't take advantage
of that right now anyway.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reinette Chatre [Thu, 12 Mar 2009 16:20:40 +0000 (09:20 -0700)]
cfg80211/nl80211: remove usage of CONFIG_NL80211
The scan capability added to cfg80211/nl80211 introduced a
dependency on nl80211 by cfg80211. We can thus no longer have
just cfg80211 without nl80211. Specifically, cfg80211_scan_done()
calls nl80211_send_scan_aborted() or nl80211_send_scan_done().
Now we remove the option for user to select nl80211. It will always
be compiled if user selects cfg80211.
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Don't call ieee80211_sta_find_ibss() directly, like it's done in STA
mode, so that the commit() call is more harmless respectively has
less site-effects.
Signed-off-by: Alina Friedrichsen <x-alina@gmx.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Anton Vorontsov [Fri, 27 Mar 2009 23:00:03 +0000 (16:00 -0700)]
ucc_geth: Fix three oopses in PHY {de,}initialization code
When there are no free snums, UCC ethernet should gracefully fail, but
currently it oopses this way:
# ifconfig eth0 up
fill_init_enet_entries: Can not get SNUM.
ucc_geth_startup: Can not fill p_init_enet_param_shadow.
eth0: Cannot configure net device, aborting.
Unable to handle kernel paging request for data at address 0x00000190
Faulting instruction address: 0xc0294c88
Oops: Kernel access of bad area, sig: 11 [#1]
[...]
NIP [c0294c88] mutex_lock+0x0/0x1c
LR [c01b6be8] phy_stop+0x20/0x70
Call Trace:
[efb25da0] [efb2eb60] 0xefb2eb60 (unreliable)
[efb25db0] [c01b2058] ucc_geth_stop+0x2c/0x8c
[efb25dd0] [c01b4194] ucc_geth_open+0x48/0x27c
[efb25df0] [c020eec0] dev_open+0xc0/0x118
[...]
This is because the ucc_geth_stop() routine assumes that ugeth->phydev
is always initialized by the ucc_geth_open(), while it is not in case
of errors.
If we add a check to the ucc_geth_stop(), then another oops pops up:
Unable to handle kernel paging request for data at address 0x00000004
Faulting instruction address: 0xc01b46a4
Oops: Kernel access of bad area, sig: 11 [#1]
[...]
NIP [c01b46a4] adjust_link+0x20/0x1b4
LR [c01b770c] phy_state_machine+0xdc/0x44c
Call Trace:
[ef83bf10] [c021b388] linkwatch_schedule_work+0x74/0xf8 (unreliable)
[ef83bf40] [c01b770c] phy_state_machine+0xdc/0x44c
[ef83bf60] [c004c13c] run_workqueue+0xb8/0x148
[ef83bf90] [c004c870] worker_thread+0x70/0xd0
[ef83bfd0] [c00505fc] kthread+0x48/0x84
[ef83bff0] [c000f464] kernel_thread+0x4c/0x68
[...]
That one happens because ucc_geth_stop() does not call phy_disconnect()
and so phylib state machine is running without any idea that a MAC has
just died.
Also, when device tree specifies fixed-link, and CONFIG_FIXED_PHY
is disabled, we'll get this oops:
0:01 not found
eth2: Could not attach to PHY
eth2: Cannot initialize PHY, aborting.
Unable to handle kernel paging request for data at address 0x00000190
Faulting instruction address: 0xc02967d0
Oops: Kernel access of bad area, sig: 11 [#1]
[...]
NIP [c02967d0] mutex_lock+0x0/0x1c
LR [c01b6bcc] phy_stop+0x20/0x70
Call Trace:
[ef82be50] [efb6bb60] 0xefb6bb60 (unreliable)
[ef82be60] [c01b2058] ucc_geth_stop+0x2c/0x8c
[ef82be80] [c01b4194] ucc_geth_open+0x48/0x27c
[ef82bea0] [c0210a04] dev_open+0xc0/0x118
[ef82bec0] [c020f85c] dev_change_flags+0x84/0x1ac
[ef82bee0] [c037b768] ic_open_devs+0x168/0x2bc
[ef82bf20] [c037ca98] ip_auto_config+0x90/0x28c
[ef82bf60] [c0001b9c] do_one_initcall+0x34/0x1a0
[ef82bfd0] [c035e240] do_initcalls+0x38/0x58
[ef82bfe0] [c035e2c4] kernel_init+0x30/0x90
[ef82bff0] [c000f464] kernel_thread+0x4c/0x68
[...]
And again, ucc_geth_stop() assumes that ugeth->phydev is there, while
it isn't.
This patch fixes all three oopses simply by rearranging some code:
- In ucc_geth_open(): move init_phy() call to the beginning, so
that we only call ucc_geth_stop() with a PHY attached;
- Move phy_disconnect() call from ucc_geth_close() to
ucc_geth_stop(), so that we'll always disconnect the PHY.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Dmitri Vorobiev [Fri, 27 Mar 2009 22:55:36 +0000 (15:55 -0700)]
net: Add missing include into include/linux/netdevice.h
The inline function skb_gro_mac_header defined in include/linux/netdevice.h
makes use of page_address(). Depending on configuration options, the latter
is either defined as a macro or is declared as a function in another header
file, namely include/linux/mm.h. However, include/linux/netdevice.h does not
include include/linux/mm.h.
On MIPS, this has produced the following build error:
CC kernel/sysctl_check.o
In file included from include/linux/icmpv6.h:173,
from include/linux/ipv6.h:208,
from include/net/ip_vs.h:26,
from kernel/sysctl_check.c:6:
include/linux/netdevice.h: In function 'skb_gro_mac_header':
include/linux/netdevice.h:1132: error: implicit declaration of function
'page_address'
include/linux/netdevice.h:1133: warning: pointer/integer type mismatch
in conditional expression
make[1]: *** [kernel/sysctl_check.o] Error 1
make: *** [kernel] Error 2
The patch adds the missing include and fixes the build error.
Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.com> Signed-off-by: David S. Miller <davem@davemloft.net>