Kiran Divekar [Fri, 28 Aug 2009 12:17:59 +0000 (17:47 +0530)]
libertas: add NULL check on return value of get_zeroed_page
Most of the places in debugfs.c are missing a NULL check on the return value of
get_zeroed_page API call. Added required NULL check at appropriate places.
Signed-off-by: Kiran Divekar <kirandivekar@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jussi Kivilinna [Fri, 28 Aug 2009 10:28:14 +0000 (13:28 +0300)]
rndis_wlan: rename wireless stats worker to device poller
Stats worker no longer poll stats from device anymore. It's still
needed to poll device control channel for connect/disconnect events,
so rename stats worker as device poller.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jussi Kivilinna [Fri, 28 Aug 2009 09:59:26 +0000 (12:59 +0300)]
rndis_wlan: enable infrastructure before setting random essid
Random essid must be set to turn on radio when not connected. If device is
in ad-hoc mode, this results 'media connect' indications with the random
essid which should be ignored.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jussi Kivilinna [Fri, 28 Aug 2009 09:59:05 +0000 (12:59 +0300)]
rndis_wlan: increase scan timer delay
Increase scan delay from 1 sec to 6 sec. Spec says that scan by
OID_802_11_BSSID_LIST_SCAN completes in 6 seconds.
Before rfkill patch too short delay was not problem as device was
always active (radio on) and performing background scanning.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jussi Kivilinna [Fri, 28 Aug 2009 09:59:00 +0000 (12:59 +0300)]
rndis_wlan: resize bssid list if too small
Buffer used for bssid list might be too small. Change rndis_query_oid()
to return required buffer length to caller and make rndis_check_bssid_list()
resize buffer when needed.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jussi Kivilinna [Fri, 28 Aug 2009 09:58:49 +0000 (12:58 +0300)]
rndis_wlan: ignore OID_802_11_ADD_KEY triggered media connect indications
Setting WPA keys with OID_802_11_ADD_KEY sometimes trigger
instant media connect indication. These indications are extranous and
should be ignored, as otherwise driver would send reassociation event to
userspace which in this case is not needed.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Gábor Stefanik [Thu, 27 Aug 2009 20:49:49 +0000 (22:49 +0200)]
b43: Implement antenna diversity support for LP-PHY
The A/G-PHY changes are fallout fixes from the enum change,
which in turn allows the LP-PHY code to be much simpler.
The antenna_to_phyctl change is a fix for a potential
existing bug that this patch may otherwise trigger.
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Gábor Stefanik [Thu, 27 Aug 2009 15:24:23 +0000 (17:24 +0200)]
b43: Enable LP-PHY support by default and remove Kconfig warning
The most common LP-PHY device, BCM4312, is now fully functional.
So, no need to say "probably won't work for you" anymore.
It's also not "for debuggers and developers only", as it is
perfectly usable for end-users now (at least for BCM4312).
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
without having to specify the driver data as well.
Signed-off-by: Pavel Roskin <proski@gnu.org> Acked-by: Bob Copeland <me@bobcopeland.com> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Pavel Roskin [Thu, 27 Aug 2009 02:30:00 +0000 (22:30 -0400)]
ath5k: fix uninitialized value use in ath5k_eeprom_read_turbo_modes()
The `val' variable in ath5k_eeprom_read_turbo_modes() is used
uninitialized. gcc 4.4.1 with -fno-inline-functions-called-once reports
it:
eeprom.c: In function 'ath5k_eeprom_read_turbo_modes':
eeprom.c:441: warning: 'val' may be used uninitialized in this function
Comparing the code to the Atheros HAL, it's clear that the split between
ath5k_eeprom_read_modes() and ath5k_eeprom_read_turbo_modes() was
incorrect.
The Atheros HAL reads both turbo and non-turbo data from EEPROM in one
function. Some turbo mode parameters are derived from the same EEPROM
values as non-turbo parameters, just from different bits.
Merge ath5k_eeprom_read_turbo_modes() into ath5k_eeprom_read_modes() to
fix the warning. The actual values and offsets have been cross-checked
against Atheros HAL.
Signed-off-by: Pavel Roskin <proski@gnu.org> Acked-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bob Copeland [Thu, 27 Aug 2009 19:17:15 +0000 (15:17 -0400)]
ath5k: clarify srev comparison for CCMP check
As Pavel Roskin noted, the check for mac version as copied from
legacy_hal made no sense. This replaces it with the equivalent
and makes up a suitable #define for the mac version legacy_hal
checked.
Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 26 Aug 2009 20:15:13 +0000 (22:15 +0200)]
iwlwifi: fix ICT irq table endianness
The ICT IRQ table is a set of __le32 values, not u32 values,
so when reading it we need to take into account that it has
to be converted to CPU endianness. This was causing a lot of
trouble on my powerpc box where various things would simply
not work for no apparent reason with 5xxx cards, but worked
with 4965 -- which doesn't use the ICT table.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ivo van Doorn [Wed, 26 Aug 2009 19:04:08 +0000 (21:04 +0200)]
rt2x00: Cleanup rt2x00mac_bss_info_changed()
Since patch "rt2x00: bss_info_changed() callback is allowed to sleep" the
variable delayed wasn't used anymore. This means it can be removed
along with the call to schedule_work which depended on that variable.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Gábor Stefanik [Wed, 26 Aug 2009 18:51:25 +0000 (20:51 +0200)]
b43: Fix and update LP-PHY code
-Fix a few nasty typos (b43_phy_* operations instead of b43_radio_*)
in the channel tune routines.
-Fix some typos & spec errors found by MMIO tracing.
-Optimize b43_phy_write & b43_phy_mask/set/maskset to use
only the minimal number of MMIO accesses. (Write is possible
using a single 32-bit MMIO write, while set/mask/maskset can
be done in 3 16-bit MMIOs).
-Set the default channel back to 1, as the bug forcing us to use
channel 7 is now fixed.
With this, the device comes up, scans, associates, transmits,
receives, monitors and injects on all channels - in other words,
it's fully functional. Sensitivity and TX power are still sub-optimal,
due to the lack of calibration (that's next on my list).
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Gábor Stefanik [Wed, 26 Aug 2009 18:51:24 +0000 (20:51 +0200)]
b43: LP-PHY: Fix and simplify Qdiv roundup
The Qdiv roundup routine is essentially a fixed-point
division algorithm, using only integer math.
However, the version in the specs had a major error
that has been recently fixed (a missing quotient++).
Replace Qdiv roundup with a rewritten, simplified version.
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This change implements rfkill support for RTL8187B and RTL8187L devices,
using new cfg80211 rfkill API.
Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Tested-by: Hin-Tak Leung <htl10@users.sourceforge.net> Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br> Signed-off-by: John W. Linville <linville@tuxdriver.com>
The problem here is that rtl8187_stop, while helding priv->conf_mutex,
runs cancel_delayed_work_sync on an workqueue that runs rtl8187_work,
which also takes priv->conf_mutex lock. Move cancel_delayed_work_sync
out of rtl8187_stop priv->conf_mutex locking region.
Reported-by: Larry Finger <Larry.Finger@lwfinger.net> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br> Signed-off-by: John W. Linville <linville@tuxdriver.com>
ath9k: Split ath9k_hw_btcoex_enable() into two logical pieces
This function currently does initialization + enable the
btcoex support. Split it into two logical functions which
does the above operations separately. Btcoex initialization
is done during attach time and enabling this feature is done
in start(). Also, add code to disable btcoex support in stop().
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jussi Kivilinna [Wed, 26 Aug 2009 12:53:02 +0000 (15:53 +0300)]
rndis_wlan: set cipher suites for cfg80211
rndis_wlan does not set cipher suites list for cfg80211 which causes
wext-compat-range to report rndis_wlan not supporting WPA. Patch adds
cipher suites list and fixes NetworkManager not being able to connect to
WPA encrypted APs.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jouni Malinen [Tue, 25 Aug 2009 14:44:28 +0000 (17:44 +0300)]
mac80211: Check pending scan request after having processed mgd work
When the queued management work items are processed in
ieee80211_sta_work() an item could be removed. This could change the
anybusy from true to false, so we better check whether we can start a
new scan only after having processed the pending work first.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Tue, 25 Aug 2009 14:33:47 +0000 (16:33 +0200)]
mac80211: fix scan cancel on ifdown
When an interface is taken down while a scan is
pending -- i.e. a scan request was accepted but
not yet acted upon due to other work being in
progress -- we currently do not properly cancel
that scan and end up getting stuck. Fix this by
doing better checks when an interface is taken
down.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Gábor Stefanik [Tue, 25 Aug 2009 14:17:48 +0000 (16:17 +0200)]
b43: LP-PHY: Fix a few typos in the RC calibration code
The RC calibration code has some typos - fix them.
Also, make the default channel 7, as channel 1 is still
broken (only channels 7 and 8, and occasionally 9 work).
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
CC [M] drivers/net/wireless/prism54/islpci_eth.o
drivers/net/wireless/prism54/islpci_eth.c: In function ‘islpci_eth_cleanup_transmit’:
drivers/net/wireless/prism54/islpci_eth.c:53: warning: cast from pointer to integer of different size
drivers/net/wireless/prism54/islpci_eth.c: In function ‘islpci_eth_receive’:
drivers/net/wireless/prism54/islpci_eth.c:453: warning: cast from pointer to integer of different size
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Marcos Chaparro [Tue, 25 Aug 2009 03:00:31 +0000 (23:00 -0400)]
ath5k: add led pin configuration for compaq c700 laptop
With this patch, a compaq c700 can turn on the wifi led.
The array of compatible devices now includes the hardware
present in this computer, as well as the led pin and
polarity.
Signed-off-by: Marcos Chaparro <nitrousnrg@gmail.com> Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bob Copeland [Tue, 25 Aug 2009 03:00:30 +0000 (23:00 -0400)]
ath5k: clean up filter flags setting
The maze of if() statements in configure_filter is confusing.
Reorganizing it as a switch statement makes it more apparent what
is going on and reveals several suspicious settings. This has no
functional changes, though it does remove some redundant flags
that are set earlier.
Also now that we can sleep, protect sc->filter_flags with the
sc lock.
Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Arnd Hannemann [Mon, 24 Aug 2009 18:51:46 +0000 (20:51 +0200)]
mac80211: Fix output of minstrels rc_stats
An integer overflow in the minstrel debug code prevented the
throughput to be displayed correctly. This patch fixes that,
by permutating operations like proposed by Pavel Roskin.
Signed-off-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Joerg Albert [Fri, 21 Aug 2009 21:25:07 +0000 (23:25 +0200)]
ar9170: cleanup of bss_info_changed and beacon config
Add beacon control by BSS_CHANGED_BEACON_ENABLED and
bss_conf->enable_beacon from mac80211.
Signed-off-by: Joerg Albert <jal2@gmx.de> Signed-off-by: Christian Lamparter <chunkeey@web.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reinette Chatre [Fri, 21 Aug 2009 21:03:51 +0000 (14:03 -0700)]
MAINTAINERS: Update ipw2x00 and iwlwifi entries
Update MAINTAINERS file to reflect current maintenance status of ipw2x00
drivers. We remove James's name as he is not involved with this project
anymore. We also update the Status to "Odd Fixes". This has been true for a
while now, we have to make it official. There is also a new email address
with which all relevant people can be reached. The same email address
should be used for iwlwifi.
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Cc: James Ketrenos <jketreno@linux.intel.com> Acked-by: James Ketrenos <jketreno@linux.intel.com> Acked-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reinette Chatre [Fri, 21 Aug 2009 20:34:26 +0000 (13:34 -0700)]
ipw2x00: update contact information
Intel Linux wireless folks can be reached via this address.
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Acked-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Wey-Yi Guy [Fri, 21 Aug 2009 20:34:25 +0000 (13:34 -0700)]
iwlwifi: fix unloading driver while scanning
If NetworkManager is busy scanning when user
tries to unload the module, the driver can not be unloaded
because HW still scanning.
Make sure driver sends abort scan host command to uCode if it
is in the middle of scanning during driver unload.
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 [Fri, 21 Aug 2009 20:34:24 +0000 (13:34 -0700)]
iwlwifi: fix remove key error
Fix following error by sending synchronous command and waiting for the command
to complete.
mac80211-phy0: failed to remove key (0, ff:ff:ff:ff:ff:ff) from hardware (-16).
-16 is EBUSY error. The asynchronous command tests for STATUS_EXIT_PENDING
while interface is getting down and it returns -EBUSY error if set.
Changing the host command from asynchronous call to synchronous call
enables command to be run while interface is going down.
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>
Wey-Yi Guy [Fri, 21 Aug 2009 20:34:23 +0000 (13:34 -0700)]
iwlwifi: read enhanced tx power info from EEPROM image
For 6000 series and up, additional enhanced regulatory tx power
limitation information is added to EEPROM image.
In order to setup the tx power limitation per channel correctly. Read
the enhanced tx power information from EEPROM image and update
accordingly.
The information is provided per SISO (a,b,c) chain based, it also has
information for both MIMO2 and MIMO3. For tx power regulatory
limitation, take the highest number from all the chains and update.
Also update tx_power_user_lmt to the highest power supported by any
channels and chains
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>
Wey-Yi Guy [Fri, 21 Aug 2009 20:34:22 +0000 (13:34 -0700)]
iwlwifi: remove duplicated define
Remove duplicated define "STA_FLG_PWR_SAVE_MSK"
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>
iwlwifi: set HT flags in ieee80211_rx_status for received packets
Add code to set the HT flags (HT, 40 MHz, Short guard interval) in
the ieee80211_rx_status field passed to mac80211. This ensures that mac80211
processes these HT packets correctly.
Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
iwlwifi: clear rate control flags on non-HT packet
Clear the flags (most importantly, the IEEE80211_TX_RC_MCS flag)
when sending a non-HT packet so that the rate index can be properly treated.
This fixes the reporting of legacy rates in wireless-extensions for packets
sent after an HT packet.
Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Wey-Yi Guy [Fri, 21 Aug 2009 20:34:19 +0000 (13:34 -0700)]
iwlwifi: show current tx power
debugFs file show current tx power for all the transmit chains
Adding "tx_power" file in /sys/kernal/debug/ieee80211/phy0/iwlagn/debug
to display current tx power for all the active chains in 1/2 dB step.
Show tx power information "Not available" if uCode can not provide the
information or interface is down.
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>
Wey-Yi Guy [Fri, 21 Aug 2009 20:34:18 +0000 (13:34 -0700)]
iwlwifi: change IWL6000_UCODE_API_MAX to v4
uCode version changed to v4 for 6000 series
The additional parameter added to v4 is providing current tx power for
each chain in tx statistics portion of "statistics notification"
command.
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>
Wey-Yi Guy [Fri, 21 Aug 2009 20:34:17 +0000 (13:34 -0700)]
iwlwifi: error checking for setting tx_power in sysfs
Perform error checking and report failure when setting tx power from
sysfs.
If fail to set the tx power, do not update the local copy, so user will
not see the incorrect tx power in sysfs
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>
Wey-Yi Guy [Fri, 21 Aug 2009 20:34:16 +0000 (13:34 -0700)]
iwlwifi: name changes from "tx_power_channel_lmt" to "tx_power_device_lmt"
Changing the name from "tx_power_channel_lmt" to "tx_power_device_lmt";
to give idea that scope of limit is for overall device, not any
individual channels
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>
Wey-Yi Guy [Fri, 21 Aug 2009 20:34:15 +0000 (13:34 -0700)]
iwlwifi: do not allow set tx power over channel power limit
When setting tx power in sysfs, check against max channel tx power
limit instead of IWL_TX_POWER_TARGET_POWER_MAX.
Different devices have different max tx power limit; using
IWL_TX_POWER_TARGET_POWER_MAX can excess the limitaion and give wrong
information.
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>
Wey-Yi Guy [Fri, 21 Aug 2009 20:34:14 +0000 (13:34 -0700)]
iwlwifi: set default tx power user limit to minimal
Set the tx_power_user_lmt to the lowest power level
this value will get overwritten by channel's max power avg
from eeprom
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>
Gábor Stefanik [Fri, 21 Aug 2009 18:44:09 +0000 (20:44 +0200)]
iwlwifi: Make injection of non-broadcast frames work again
Commit 1ccb84d87d04df3c76cd4352fe69786d8c7cf016 by Wey-Yi Guy
("iwlwifi: clean up unused NL80211_IFTYPE_MONITOR for Monitor mode")
broke injection of non-broadcast frames to unassociated stations
(causing a SYSASSERT for all such injected frames), due to injected
frames no longer automatically getting a broadcast station ID assigned.
This patch restores the old behavior, fixing the aforementioned
regression.
Also, consistently check for IEEE80211_TX_CTL_INJECTED instead of
iwl_is_monitor_mode in the TX path, as TX_CTL_INJECTED specifically
means that a given packet is coming from a monitor interface, while
iwl_is_monitor_mode only shows whether a monitor interface exists
on the device.
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com> Acked-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Marek Vasut [Fri, 21 Aug 2009 02:08:16 +0000 (04:08 +0200)]
libertas: Add support for Marvell Libertas CF8305
The CF8305 is a very old silicon running firmware version 3.0 . This card also
needs some special treatment as it's so old it can't do unaligned register
access. But since that happens only at one place, there were no changes made to
the register access functions, but instead that particular place was fixed.
Also, this card uses only one-stage firmware which is loaded the same way as
helper firmware. The second-stage firmware isn't loaded on this card and doesn't
therefore have to be supplied.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Dan Williams [Fri, 21 Aug 2009 14:35:20 +0000 (09:35 -0500)]
libertas: clean up and clarify get_common_rates
Clarify what the heck the function is doing with better variable names
and less indirection and better comments. Also ensure callers use the
proper minimum size, even though all rates arrays should be size
MAX_RATES anyway. Reverts part of Andrey's dynamic alloc patch since we
don't really need it. Also leaves the passed-in rates array alone on
errors.
Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 21 Aug 2009 12:44:45 +0000 (14:44 +0200)]
mac80211: remove tasklet enable/disable
Due to the way the tasklets work in mac80211 there's
no need to ever disable them.
However, we need to clear the pending packets when
taking down the last interface because otherwise
the tx_pending_tasklet might be queued if the
driver mucks with the queues (which it shouldn't).
I've had a situation occasionally with ar9170 in
which ksoftirq was using 100% CPU time because
a disabled tasklet was scheduled, and I think that
was due to ar9170 receiving a packet while the
tasklet was disabled. That's strange and it really
should not do that for other reasons, but there's
no need to waste that much CPU time over it, it
should just warn instead.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 21 Aug 2009 12:51:05 +0000 (14:51 +0200)]
cfg80211: clean up properly on interface type change
When the interface type changes while connected, and the
driver does not require the interface to be down for a
type change, it is currently possible to get very strange
results unless the driver takes special care, which it
shouldn't have to.
To fix this, take care to disconnect/leave IBSS when
changing the interface type -- even if the driver may fail
the call. Also process all events that may be pending to
avoid running into a situation where an event is reported
but only processed after the type has already changed,
which would lead to missing events and warnings.
A side effect of this is that you will have disconnected
or left the IBSS even if the mode change ultimately fails,
but since the intention was to change it and thus leave or
disconnect, this is not a problem.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 21 Aug 2009 10:23:49 +0000 (12:23 +0200)]
cfg80211: make spurious warnings less likely, configurable
Bob reported that he got warnings in IBSS mode about
the ssid_len being zero on a joined event, but only
when kmemcheck was enabled. This appears to be due
to a race condition between drivers and userspace,
when the driver reports joined but the user in the
meantime decided to leave the IBSS again, the warning
would trigger. This was made more likely by kmemcheck
delaying the code that does the check and sends the
event.
So first, make the warning trigger closer to the
driver, which means it's not locked, but since only
the warning depends on it that's ok.
And secondly, users will not want to have spurious
warnings at all, so make those that are known to be
racy in such a way configurable.
Reported-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
John W. Linville [Thu, 20 Aug 2009 18:48:03 +0000 (14:48 -0400)]
libipw: switch from ieee80211_* to libipw_* naming policy
This eliminates the dual definition of ieee80211_channel (and possibly
others), further clarifying who defines what and paving the way for
inclusion of cfg80211.h.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Thu, 20 Aug 2009 19:36:16 +0000 (21:36 +0200)]
cfg80211: check lost scans later, fix bug
When we lose a scan, cfg80211 tries to clean up after
the driver. However, it currently does this too early,
it does this in GOING_DOWN already instead of DOWN, so
it may happen with mac80211. Besides fixing this, also
make it more robust by leaking the scan request so if
the driver later actually finishes the scan, it won't
crash. Also check in ___cfg80211_scan_done whether a
scan request is still pending and exit if not.
Reported-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Tested-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Thu, 20 Aug 2009 18:02:20 +0000 (20:02 +0200)]
mac80211: fix configure_filter invocation after stop
Since configure_filter can sleep now, any multicast
configuration needed to be postponed to a work struct.
This, however, lead to a problem that we could queue
the work, stop the device and then afterwards invoke
configure_filter which may lead to driver hangs and is
a bug. To fix this, we can just cancel the filter work
since it's unnecessary to do after stopping the hw.
Since there are various places that call drv_stop, and
two of them do very similar things, the code for them
can be put into a shared function at the same time.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Reported-by: Lennert Buytenhek <buytenh@wantstofly.org> Tested-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Javier Cardona [Fri, 21 Aug 2009 02:12:07 +0000 (19:12 -0700)]
ath9k: Add support FIF_OTHER_BSS filtering mode.
Support for FIF_OTHER_BSS was missing. This patch adds support for this
filtering mode which in turn resolves a problem where mesh interfaces would not
receive broadcast traffic.
Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
The patch "mac80211: fix PS-poll response race" somehow broke
broadcast buffering in a funny way.
During normal operation - stations are awake - the firmware refused
to transmit broadcast frames and reported P54_TX_PSM_CANCELLED.
But everything worked as soon as one station entered PSM.
The reason:
The stack sets IEEE80211_TX_CTL_SEND_AFTER_DTIM for outgoing
broadcast frames as soon as a station is marked as sleeping.
This flag triggers a path which will reroute these frames
into p54's "content after beacon" queue, which is designed
to cope with the demands for psm.
This patch restores the old behavior.
IEEE80211_TX_CTL_CLEAR_PS_FILT will once again be used to signalize
the firmware to ignore the ps canceling for certain frames.
Signed-off-by: Christian Lamparter <chunkeey@web.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ursula Braun [Wed, 26 Aug 2009 02:01:10 +0000 (02:01 +0000)]
qeth: display "undefined" value of sysfs-attribute "layer2"
If nothing has been written into the qeth sysfs-attribute layer2,
its value is "-1" meaning "not yet defined". But the value is
displayed as "1" meaning "layer2 selected". The patch changes the
reading of this "-1"-value to "-1" to make clear the layer2-attribute
has not yet been defined.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
qeth displayed an entry in /proc/service_level even when no valid
MCL-string was available (the MCL info is blank). The change is to
create an entry in /proc/service_level only when MCL-string is
non-zero.
Signed-off-by: Klaus-Dieter Wacker <kdwacker@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Frank Blaschka [Wed, 26 Aug 2009 02:01:07 +0000 (02:01 +0000)]
qeth: scheduling while atomic during ifconfig online sequence
In case the IP address list contains entries (not removed when the device was set
offline) this entries should be registered next time the device is brought online.
In the past this was done implicitly with the device open call but since we wait
in the set IPv4 IPA and the device open common code holds various locks this
does not work any longer.
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>