Tim Gardner [Fri, 10 Feb 2012 00:19:52 +0000 (18:19 -0600)]
rtlwifi: rtl8192se firmware load can overflow target buffer
Define RTL8190_MAX_RAW_FIRMWARE_CODE_SIZE which represents the
maximimum possible firmware file size. Use it in the definition
of the buffer which receives the firmware file data.
Set RTL8190_MAX_RAW_FIRMWARE_CODE_SIZE closer to the actual size of
the firmware file, e.g., 90000 (down from hard coded 164000). The current
size of rtlwifi/rtl8192sefw.bin is 88856.
Set max_fw_size to RTL8190_MAX_RAW_FIRMWARE_CODE_SIZE for the size limit
check. Fix the error case where max_fw_size is not cleared if the size
limit check fails.
Cc: Chaoming Li <chaoming_li@realsil.com.cn> Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Tim Gardner <tim.gardner@canonical.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
brcm80211: fmac: make sdio firmware filename specific
The sdio driver part uses firmware name brcmfmac.bin. With addition
of usb this name is too generic. This patch renames the filename
to brcmfmac-sdio.bin.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Alwin Beukers <alwin@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
brcm80211: fmac: add USB support for bcm43235/6/8 chipsets
This patch extends the use of the brcmfmac driver with support for
chipsets with a USB host interface. The first chipsets supported are
the bcm43235, bcm43236, and bcm43238 for which firmware has been
submitted.
This driver change has been successfully built for x86, x86_64,
ppc64, arm_le, and mips_be.
It has been tested successfully on x86 and x86_64.
Cc: M. Lambert <lambertm@westman.wave.ca> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Reviewed-by: Kan Yan <kanyan@broadcom.com> Reviewed-by: Alwin Beukers <alwin@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
brcm80211: fmac: use spinlock calls saving irq flags in brcmf_enq_event()
This function is executed within irq context. The call spin_unlock_irq
does enable interrupts which is not desired in the irq context. This patch
replaces them using the spin_loc_irqsave and spin_unlock_irqrestore
functions.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Kan Yan <kanyan@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
brcm80211: fmac: change allocation flag in brcmf_enq_event() function
As the function is called from atomic context it should not do the
kzalloc call with GFP_KERNEL.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Kan Yan <kanyan@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
brcm80211: fmac: update bus state in common driver part
The bus state is updated in the sdio bus init function, but it is
better to do it when the brcmf_bus_start() function is completed
successfully. The brcmf_netdev_open() function will return -EAGAIN
until the state is updated instead of calling brcmf_bus_start() to
avoid reentering that function.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
brcm80211: fmac: only return success in brcmf_sdbrcm_bus_init() when true
The function brcmf_sdbrcm_bus_init() always returned success except for
firmware download failure. However, also when enabling SDIO function 2
is failing the function should return failure. This patch fixes that.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
brcm80211: fmac: move module entry points to dhd_linux.c
The module_init/exit functions are moved to dhd_linux.c to prepare
for supporting multiple host interface types.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
brcm80211: fmac: use specific types in struct brcmf_bus
The fields bus_priv and drvr are defined as void pointer. It is
preferred to have specific types for compiler type checking. To
prepare for other bus types the bus_priv field is defined as a
union containing the sdio bus private structure reference.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Thu, 9 Feb 2012 20:09:01 +0000 (21:09 +0100)]
brcm80211: fmac: make sure cancel_work_sync only called after INIT_WORK
INIT_WORK only gets called after brcmf_proto_attach returns
success. This dependency should be annotated in brcmf_detach to
avoid any error.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
brcm80211: fmac: resolve smatch issues in brcmfmac code
This patch resolves the following smatch issues:
wl_cfg80211.c +1377 brcmf_cfg80211_connect(65) warn: min_t truncates
here '(sme->ssid_len)' (4294967295 vs 9223372036854775807)
dhd_sdio.c +1275 brcmf_sdbrcm_rxglom(156) warn: min_t truncates here
'(pfirst->len)' (2147483647 vs 4294967295)
dhd_sdio.c +1457 brcmf_sdbrcm_rxglom(338) warn: min_t truncates here
'(pfirst->len)' (2147483647 vs 4294967295)
bcmsdh_sdmmc.c +300 brcmf_sdioh_request_buffer(10) warn: variable
dereferenced before check 'pkt' (see line 295)
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
brcm80211: smac: fix endless retry of A-MPDU transmissions
The A-MPDU code checked against a retry limit, but it was using
the wrong variable to do so. This patch fixes this to assure
proper retry mechanism.
This problem had a side-effect causing the mac80211 flush callback
to remain waiting forever as well. That side effect has been fixed
by commit by Stanislaw Gruszka:
brcm80211: smac: remove redundant assignments from txpwrctrl_pwr_setup_nphy
The function wlc_phy_txpwrctrl_pwr_setup_nphy() does assign a local
variable target_pwr_qtrdbm in several code paths, but in the end all
code paths are coming to an assignment of that variable which does
override all previous. So those early and redundant assignments have
been removed.
Reported-by: Larry Finger <Larry.Finger@lwfinger.net> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Alwin Beukers <alwin@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
brcm80211: update the maintainers listed for brcm80211 drivers
Henry Ptasinski is not working on the brcm80211 driver so taking
his name/email out of the MAINTAINERS file.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Larry Finger [Thu, 9 Feb 2012 02:56:52 +0000 (20:56 -0600)]
rtlwifi: rtl8192c-common: rtl8192se: rtl8192de: Simplify if statements
Devendra Naga <devendra.aaru@gmail.com> submitted a patch for rtl8192c_common
to change the tests in _rtl92c_store_pwrIndex_diffrate_offset(). This patch
improves on those changes and applies similar modifications to drivers rtl8192se
and rtl8192de.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
John Li [Wed, 8 Feb 2012 13:25:24 +0000 (21:25 +0800)]
rt2x00:Add debug message for new chipset
Signed-off-by: John Li <chen-yang.li@mediatek.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
John Li [Wed, 8 Feb 2012 13:19:01 +0000 (21:19 +0800)]
rt2x00:Fix typo
Signed-off-by: John Li <chen-yang.li@mediatek.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Devendra.Naga [Tue, 31 Jan 2012 07:11:03 +0000 (02:11 -0500)]
rtlwifi/rtl8192c: in _rtl92c_phy_calculate_bit_shift remove comparing bitmask against 1
in _rtl92c_phy_calculate_bit_shift everytime the right shifted bitmask
is AND with 1 and compared against 1. i.e.
if ((bitmask >> i) & 0x1 == 1)
break;
which in the if condition is anyway becomes a 1 or 0.
Signed-off-by: Devendra.Naga <devendra.aaru@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Pavel Roskin [Sat, 11 Feb 2012 15:01:53 +0000 (10:01 -0500)]
ath9k: stop on rates with idx -1 in ath9k rate control's .tx_status
Rate control algorithms are supposed to stop processing when they
encounter a rate with the index -1. Checking for rate->count not being
zero is not enough.
Allowing a rate with negative index leads to memory corruption in
ath_debug_stat_rc().
One consequence of the bug is discussed at
https://bugzilla.redhat.com/show_bug.cgi?id=768639
Signed-off-by: Pavel Roskin <proski@gnu.org> Cc: stable@vger.kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
Amitkumar Karwar [Fri, 10 Feb 2012 02:32:22 +0000 (18:32 -0800)]
mwifiex: clear previous security setting during association
Driver maintains different flags for WEP, WPA, WPA2 security modes.
Appropriate flag is set using security information provided in
connect request. mwifiex_is_network_compatible() routine uses them
to check if driver's setting is compatible with AP. Association is
aborted if the routine fails.
For some corner cases, it is observed that association is failed
even for valid security information based on association history.
This patch fixes the problem by clearing previous security setting
during each association.
We should set WEP key provided in connect request as default tx key.
This missing change is also added here.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Wed, 8 Feb 2012 18:17:11 +0000 (19:17 +0100)]
mac80211: do not call rate control .tx_status before .rate_init
Most rate control implementations assume .get_rate and .tx_status are only
called once the per-station data has been fully initialized.
minstrel_ht crashes if this assumption is violated.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Tested-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 20 Jan 2012 12:55:23 +0000 (13:55 +0100)]
mac80211: call rate control only after init
There are situations where we don't have the
necessary rate control information yet for
station entries, e.g. when associating. This
currently doesn't really happen due to the
dummy station handling; explicitly disabling
rate control when it's not initialised will
allow us to remove dummy stations.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ulisses Furquim [Mon, 30 Jan 2012 20:26:29 +0000 (18:26 -0200)]
Bluetooth: Fix possible use after free in delete path
We need to use the _sync() version for cancelling the info and security
timer in the L2CAP connection delete path. Otherwise the delayed work
handler might run after the connection object is freed.
Ulisses Furquim [Mon, 30 Jan 2012 20:26:28 +0000 (18:26 -0200)]
Bluetooth: Remove usage of __cancel_delayed_work()
__cancel_delayed_work() is being used in some paths where we cannot
sleep waiting for the delayed work to finish. However, that function
might return while the timer is running and the work will be queued
again. Replace the calls with safer cancel_delayed_work() version
which spins until the timer handler finishes on other CPUs and
cancels the delayed work.
Johan Hedberg [Fri, 3 Feb 2012 19:29:40 +0000 (21:29 +0200)]
Bluetooth: Add missing QUIRK_NO_RESET test to hci_dev_do_close
We should only perform a reset in hci_dev_do_close if the
HCI_QUIRK_NO_RESET flag is set (since in such a case a reset will not be
performed when initializing the device).
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
The issue appears to be the rfcomm_session_put in rfcomm_recv_ua. This
operation doesn't seem be to required as for the non-initiator case we
have the rfcomm_process_rx doing an explicit put and in the initiator
case the last dlc_unlink will drive the reference counter to 0.
There have been several attempts to fix these issue:
6c2718d Bluetooth: Do not call rfcomm_session_put() for RFCOMM UA on closed socket 683d949 Bluetooth: Never deallocate a session when some DLC points to it
but AFAICS they do not fix the issue just make it harder to reproduce.
Andre Guedes [Fri, 27 Jan 2012 22:42:02 +0000 (19:42 -0300)]
Bluetooth: Fix potential deadlock
We don't need to use the _sync variant in hci_conn_hold and
hci_conn_put to cancel conn->disc_work delayed work. This way
we avoid potential deadlocks like this one reported by lockdep.
======================================================
[ INFO: possible circular locking dependency detected ]
3.2.0+ #1 Not tainted
-------------------------------------------------------
kworker/u:1/17 is trying to acquire lock:
(&hdev->lock){+.+.+.}, at: [<ffffffffa0041155>] hci_conn_timeout+0x62/0x158 [bluetooth]
but task is already holding lock:
((&(&conn->disc_work)->work)){+.+...}, at: [<ffffffff81035751>] process_one_work+0x11a/0x2bf
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
Octavian Purdila [Sat, 21 Jan 2012 22:28:34 +0000 (00:28 +0200)]
Bluetooth: silence lockdep warning
Since bluetooth uses multiple protocols types, to avoid lockdep
warnings, we need to use different lockdep classes (one for each
protocol type).
This is already done in bt_sock_create but it misses a couple of cases
when new connections are created. This patch corrects that to fix the
following warning:
Bluetooth: l2cap_set_timer needs jiffies as timeout value
After moving L2CAP timers to workqueues l2cap_set_timer expects timeout
value to be specified in jiffies but constants defined in miliseconds
are used. This makes timeouts unreliable when CONFIG_HZ is not set to
1000.
__set_chan_timer macro still uses jiffies as input to avoid multiple
conversions from/to jiffies for sk_sndtimeo value which is already
specified in jiffies.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com> Ackec-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Bluetooth: Fix sk_sndtimeo initialization for L2CAP socket
sk_sndtime value should be specified in jiffies thus initial value
needs to be converted from miliseconds. Otherwise this timeout is
unreliable when CONFIG_HZ is not set to 1000.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de> Acked-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Peter Hurley [Fri, 13 Jan 2012 14:11:30 +0000 (15:11 +0100)]
Bluetooth: Fix l2cap conn failures for ssp devices
Commit 330605423c fixed l2cap conn establishment for non-ssp remote
devices by not setting HCI_CONN_ENCRYPT_PEND every time conn security
is tested (which was always returning failure on any subsequent
security checks).
However, this broke l2cap conn establishment for ssp remote devices
when an ACL link was already established at SDP-level security. This
fix ensures that encryption must be pending whenever authentication
is also pending.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Tested-by: Daniel Wagner <daniel.wagner@bmw-carit.de> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Dan Carpenter [Wed, 8 Feb 2012 09:20:04 +0000 (12:20 +0300)]
wl12xx: remove some dead code in wl1271_plt_init()
"ret" has already been checked at this point, and we don't need to check
it again. This was left around from a previous patch 49d750ca14
"wl12xx: 1281/1283 support - New radio structs and functions".
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Eliad Peller [Mon, 6 Feb 2012 10:47:56 +0000 (12:47 +0200)]
wl12xx: enter forced-psm on fw change
Enter forced psm when changing fw, in order to make the
sta a bit more disconnection-persistent.
(DPM doesn't know about the incoming recovery, so it
won't enter psm by itself)
Eliad Peller [Mon, 6 Feb 2012 11:07:52 +0000 (13:07 +0200)]
wl12xx: dynamically change fw according to number of active roles
wl12xx uses different fw for single-role and multi-role
scenarios (due to lack of space, some of the fw advanced
features are disabled in the multi-role fw).
Add checks on add_interfae and remove_interface in order
to determine whether a fw switch is needed (and initiate
recovery in this case).
Eyal Shapira [Thu, 2 Feb 2012 11:54:28 +0000 (13:54 +0200)]
wl12xx: use split scan for normal scan
Split scan allows the FW to schedule other activities
during a scan which may be a long operation. This is
achieved by setting a trigger TID to ANY_TID and a scan
trigger timeout other than 0. The default one is set to 50ms.
Eliad Peller [Thu, 2 Feb 2012 11:15:35 +0000 (13:15 +0200)]
wl12xx: declare support for hw scan while idle
By allowing hw scan while idle, we no longer
need the redundant ROC/CROC that are done
on idle off/on, which helps simplifying the
state machine of the driver.
This way, we can also allow scanning while
there is an ongoing sched scan (otherwise,
we won't be able to ROC on idle-off)
The encryption consideration on auto-arp configuration,
along with a fw fix, seem to resolve the crashes that
occured when auto-arp was enabled, so we can re-enable it now.
Eliad Peller [Thu, 2 Feb 2012 10:22:09 +0000 (12:22 +0200)]
wl12xx: consider encryption and QoS in auto arp template
When configuring the arp response template,
and encryption is enabled, we should add some
space and set the protected flag bit in the fc.
In order to track the encryption type, set
wlvif->encryption_type when setting an encryption key,
and reconfigure the arp response. Clear this field on
wl1271_join, as keys have to be re-configured
anyway after a join command.
Eyal Shapira [Thu, 2 Feb 2012 17:06:45 +0000 (19:06 +0200)]
wl12xx: add forced_ps mode
For certain WiFi certification tests forcing PS
is necessary. Since DPS is now enabled in the FW
and this can't be achieved by using netlatency
this required a new config option.
Eyal Shapira [Thu, 2 Feb 2012 10:03:40 +0000 (12:03 +0200)]
wl12xx: add suspend_listen_interval debugfs file
Add read/write to suspend_dtim_interval file which
controls the number of DTIM periods between wakeups
while the host is suspended.
The value while the host is resumed is controlled
by the file dtim_interval which existed previously.
Eyal Shapira [Thu, 2 Feb 2012 10:03:39 +0000 (12:03 +0200)]
wl12xx: Set different wake up conditions in case of suspend
Added ability to set different wake up conditions for suspend/resume.
Set default values to wake up every 3 DTIMs while suspended
and every 1 DTIM while resumed
Eliad Peller [Tue, 31 Jan 2012 15:54:42 +0000 (17:54 +0200)]
wl12xx: add TX_HW_ATTR_HOST_ENCRYPT flag
In WEP shared authentication, we encrypt the auth frame
in the host, and we want the fw to pass it as-is.
Use the TX_HW_ATTR_HOST_ENCRYPT flag in order to indicate
it to the fw.
Eyal Shapira [Tue, 31 Jan 2012 09:57:24 +0000 (11:57 +0200)]
wl12xx: enable/disable BET with AUTO_PS/ACTIVE
While the FW with dynamic PS controls BET when going to PSM and back
internally within the FW, there's still a need to enable it from the driver
at least once (so enable on every entry to AUTO_PS)
and disable it once we explicitly go back to STATION_ACTIVE_MODE.
BET isn't relevant for 5GHz
Eyal Shapira [Tue, 31 Jan 2012 09:57:22 +0000 (11:57 +0200)]
wl12xx: add dynamic_ps_timeout debugfs file
Enable read/write of dynamic_ps_timeout which controls the timeout
of the dynamic PS implemented in the FW.
dynamic_ps_timeout is the timeout (in msec) until going back to PS
when there's no Rx/Tx
Eyal Shapira [Tue, 31 Jan 2012 09:57:21 +0000 (11:57 +0200)]
wl12xx: add support for HW dynamic PS
FW now supports dynamic PS so we don't need to use mac80211 support.
FW will go to PSM after a specified timeout with no Rx/Tx traffic.
- Changed FW API to include new PS mode (AUTO_MODE) and including timeout parameter
- The default PS mode would be dynamic PS
- Default timeout is 100ms (same as it used to be in mac80211)
- Avoid using mac80211 APIs to disable/enable dynamic PS as we're not
using mac80211 PS control anymore.
- COEX is handled by the FW while in dynamic PS so removed
handling of SOFT_GEMINI
Eliad Peller [Tue, 31 Jan 2012 09:57:16 +0000 (11:57 +0200)]
wl12xx: fw api change - add role_id to set_template
The set_template commands now takes the role_id as
parameter.
Usually, we'll use the vif's main role_id.
However, sometimes we'll want to use
wlvif->dev_role_id instead of wlvif->role_id,
so pass the wanted role_id as param.
Update WL127X_FW_NAME/WL128X_FW_NAME.
(This commit starts a series of fw update patches,
and changes the start() callback to return an error
in order to prevent the use of the driver during the
transition. This change will be reverted in the
last patch of series)
Commit b6ad726 ("mmc: core: Prevent too long response times
for suspend") fails the suspend if the mmc host can't be
claimed before suspend. As the host is claimed by us as long
as the chip is powered on, suspend will always fail.
Eliad Peller [Tue, 24 Jan 2012 16:18:42 +0000 (18:18 +0200)]
wl12xx: check bss_conf->assoc on CHANGED_BSSID
with the new auth/assoc redesign, we get CHANGED_BSSID
indication before CHANGED_ASSOC indication, while our
CHANGED_BSSID handling block assumes we are already
associated.
Fix it by checking we are either in ibss mode, or
already associated.
Luciano Coelho [Tue, 24 Jan 2012 09:46:32 +0000 (11:46 +0200)]
wl12xx: remove unnecessary shadow declaration
The vif variable was being declared inside one of the internal blocks
of wl1271_event_process. This is not necessary, since this variable
is already declared in the function context.
Luciano Coelho [Fri, 13 Jan 2012 12:04:29 +0000 (14:04 +0200)]
wl12xx: add testmode operation to read the BD_ADDR from Fuse ROM
Add a testmode command to retrieve the BD_ADDR that is stored in the
Fuse ROM in newer PGs. In old PGs this operation is not supported.
The caller can then derive the MAC addresses from it.
Luciano Coelho [Fri, 23 Dec 2011 07:32:17 +0000 (09:32 +0200)]
wl12xx: use two MAC addresses based on the NVS or from fuse ROM
Add support for two MAC addresses. If the NVS has a valid MAC
address, that takes precedence and we use two sequential address
starting from the one specified.
If the NVS doesn't contain a valid MAC address (ie. if it is set to
00:00:00:00:00:00), we check if the HW PG version in use has the
BD_ADDR written in the fuse ROM. If it does, we read it and derive
the two subsequent addresses for WLAN.
During production, 3 addresses are reserved per device. The first for
Bluetooth (burnt in the fuse ROM) and the following two for WLAN.
This patch has some code by Igal and Arik (squashed from internal
patches).
Luciano Coelho [Wed, 18 Jan 2012 12:53:22 +0000 (14:53 +0200)]
wl12xx: read chip ID and HW PG version during probe
In order to read the MAC addresses from the fuse ROM, we need to know
the chip ID and the HW PG version. We need to know the MAC address
during probe, because that's when we register our HW with mac80211.
To prepare for that, this patch reads the chip ID and HW PG version
during probe instead of doing it at boot time. We power the chip on
briefly in order to do that.
Luciano Coelho [Thu, 12 Jan 2012 12:45:34 +0000 (14:45 +0200)]
wl12xx: move partition table definition to io.c
Up till now we only needed to access the partition table in boot.c.
But to add support for reading the MAC address from the FUSE in
testmode, we will have to change the partition in testmode.c.
Thus, we move the partition table to io.c and export it via io.h. It
makes more sense to have it in the io part anyway.
Luciano Coelho [Wed, 11 Jan 2012 07:42:42 +0000 (09:42 +0200)]
wl12xx: cancel delayed elp work and clear flags when stopping PLT
In some cases a race condition can happen if we don't cancel any
pending ELP work before stopping PLT. With this commit we cancel ELP
work and clear the wl->flags bitmask. Also clean up the wl elements
after powering off.
Ido Yariv [Wed, 11 Jan 2012 07:42:41 +0000 (09:42 +0200)]
wl12xx: Fix potential interrupt storm
The interrupt threaded handler exits immediately if the driver's state
is WL1271_STATE_OFF. As a result, the interrupt status is not read. If
the interrupt is level triggered, it will be fired again.
Fix this by disabling interrupts before setting the state to OFF.
Ido Yariv [Wed, 11 Jan 2012 07:42:40 +0000 (09:42 +0200)]
wl12xx: Power off after flushing work
When stopping plt, the chip is powered off before all current work items
are flushed and interrupts are disabled. This might introduce a race in
which the driver tries to communicate with a powered off chip.
Fix this by powering off the device only after interrupts are disabled
and all work items are flushed.
Luciano Coelho [Wed, 21 Dec 2011 20:36:28 +0000 (22:36 +0200)]
wl1251: convert 32-bit values to le32 before writing to the chip
The 32-bit values were not converted before writing them to the chip.
Change the wl1251_read32() and wl1251_write32() so that they always
read and write le32 values and convert to and from the CPU endianess.
Luciano Coelho [Wed, 21 Dec 2011 20:36:27 +0000 (22:36 +0200)]
wl1251: fix sparse warning
The wl1251 driver was generating the following warning:
drivers/net/wireless/wl1251/boot.c:467:21: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl1251/boot.c:467:21: expected unsigned int [unsigned] [assigned] [usertype] val
drivers/net/wireless/wl1251/boot.c:467:21: got restricted __le32 [usertype] <noident>
Fix this by removing one cpu_to_le32() call in the wrong place.
Simon Graham [Thu, 9 Feb 2012 14:55:13 +0000 (09:55 -0500)]
rtlwifi: Modify rtl_pci_init to return 0 on success
Fixes problem where caller would think routine succeeded when it failed
leading to divide by zero panic.
Signed-off-by: Simon Graham <simon.graham@virtualcomputer.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
read_lock(&tpt_trig->trig.leddev_list_lock) is accessed via the path
ieee80211_open (->) ieee80211_do_open (->) ieee80211_mod_tpt_led_trig
(->) ieee80211_start_tpt_led_trig (->) tpt_trig_timer before initializing
it.
the intilization of this read/write lock happens via the path
ieee80211_led_init (->) led_trigger_register, but we are doing
'ieee80211_led_init' after 'ieeee80211_if_add' where we
register netdev_ops.
so we access leddev_list_lock before initializing it and causes the
following bug in chrome laptops with AR928X cards with the following
script
while true
do
sudo modprobe -v ath9k
sleep 3
sudo modprobe -r ath9k
sleep 3
done
BUG: rwlock bad magic on CPU#1, wpa_supplicant/358, f5b9eccc
Pid: 358, comm: wpa_supplicant Not tainted 3.0.13 #1
Call Trace:
rtlwifi: Modify rtl_pci_init to return 0 on success
Fixes problem where caller would think routine succeeded when it failed
leading to divide by zero panic.
(This also reverts an earlier attempt, commit 42bc0c97 "rtlwifi: Return
correct failure code on error". -- JWL)
Signed-off-by: Simon Graham <simon.graham@virtualcomputer.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Wed, 8 Feb 2012 18:17:11 +0000 (19:17 +0100)]
mac80211: do not call rate control .tx_status before .rate_init
Most rate control implementations assume .get_rate and .tx_status are only
called once the per-station data has been fully initialized.
minstrel_ht crashes if this assumption is violated.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Tested-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Simon Graham [Wed, 8 Feb 2012 17:34:23 +0000 (12:34 -0500)]
rtlwifi: Return correct failure code on error
Callers of rtl_pci_init expect zero to be returned on error. Returning
the error code leads to, amongst other things, divide by zero panics
attempting to use the ring size that is set to zero.
Signed-off-by: Simon Graham <simon.graham@virtualcomputer.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
If you want to use mesh support from mac80211 on a recent
kernel on 2.6.24 you'll run into a name clash when compiling
against include/linux/namei.h, so rename this routine.
/home/mcgrof/tmp/compat-wireless-3.2.5-1/net/mac80211/mesh_pathtbl.c: At top level:
/home/mcgrof/tmp/compat-wireless-3.2.5-1/net/mac80211/mesh_pathtbl.c:342:26: error: conflicting types for ‘path_lookup’
include/linux/namei.h:71:12: note: previous declaration of ‘path_lookup’ was here
Although this could sit as a separate patch in compat-wireless it seems
best to just merge upstream.
Cc: Javier Cardona <javier@cozybit.com> Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org> Acked-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Simon Graham [Wed, 8 Feb 2012 00:07:38 +0000 (18:07 -0600)]
rtlwifi: Handle previous allocation failures when freeing device memory
Handle previous allocation failures when freeing device memory
Signed-off-by: Simon Graham <simon.graham@virtualcomputer.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
rt2x00: Correctly set txmixer_gain in RT3572 channel switching.
Align with the v2.5.0.0 Ralink RT3572 driver.
Save the EEPROM txmixer_gain values inside the rt2800 driver data structure
and use it throughout the code.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>