Analyze of MMIO dumps from BCM43224, BCM43225, BCM4313 and BCM4331 has
shown that wl disables parity check for all that cards. This is required
for receiving any packets from the hardware.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Joe Perches [Wed, 20 Jul 2011 15:51:35 +0000 (08:51 -0700)]
rtlwifi: Convert printks to pr_<level>
Use the current logging styles.
Add pr_fmt where appropriate.
Remove now unnecessary prefixes from printks.
Convert hard coded prefix to __func__.
Add a missing "\n" to a format.
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Tue, 19 Jul 2011 06:46:44 +0000 (08:46 +0200)]
ath9k_hw: validate and fix broken eeprom chainmask settings
Some devices (e.g. Ubiquiti AirRouter) ship with broken EEPROM chainmask
data, which breaks the initial calibration after a hardware reset.
To fix this, mask the eeprom chainmask with the chainmask of the chip,
and use the chip chainmask if the result is zero.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
mwifiex: put multicast/broadcast packets to the same RA
For ad-hoc mode, RA is created for each peer connected. In case of
multicast traffic new RA will be created for each multicast
address. While processing Tx packets we have to go through this
RA list. We can avoid some RA nodes by sharing same RA for both
multicast and broadcast packets.
Therefore "memset(0xff)" is used to treat multicast packet as broadcast
one while choosing RA.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Sun, 17 Jul 2011 08:44:11 +0000 (01:44 -0700)]
iwlagn: rename iwlagn_set_dynamic_key
We now have iwlagn_set_dynamic_key() and
iwl_set_dynamic_key() which is confusing,
rename the former to iwlagn_send_sta_key()
to better reflect what it does -- it only
sends a command and doesn't change driver
state.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Johannes Berg [Mon, 18 Jul 2011 08:59:22 +0000 (01:59 -0700)]
iwlagn: track beacon interval sent to device
Sometimes, when mac80211 changes the beacon
interval or when it isn't yet set in mac80211
before association, the uCode will sysassert
because we send it confusing RXON timing vs.
PAN parameters. To fix this, track the last
beacon interval sent to the device and use
that in PAN parameter calculations.
This fixes a bug during P2P group formation
as a client (and possibly association to a
regular AP) while connected to another AP.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Johannes Berg [Fri, 15 Jul 2011 20:23:45 +0000 (13:23 -0700)]
iwlagn: implement WoWLAN
Implement WoWLAN support in iwlagn. The device
supports a number of wakeup triggers and can do
GTK rekeying when asleep (if HW crypto is used).
Unfortunately, we need to disconnect from the AP
after resume since we can't yet get all the info
out of the wowlan uCode to stay connected safely.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Johannes Berg [Fri, 15 Jul 2011 20:03:12 +0000 (13:03 -0700)]
iwlagn: rewrite HW crypto
As I just discovered while doing WoWLAN, HW crypto
is done wrong for GTKs: they should be programmed
for the AP station ID (in the managed mode case)
and the HW can actually deal with multiple group
keys per station as well (which is useful in IBSS
RSN but that I've chosen not to use this).
To fix all this, modify the way keys are sent to
the device and key offsets are allocated. After
these changes, key offsets are stored into the
hw_key_idx which we can then track for the key
lifetime, not relying on our sta_cmd array. WEP
default keys get special treatment, of course.
Additionally, since I had the API for it, we can
now pre-fill TKIP phase 1 keys for RX now that we
can obtain the P1K from mac80211, a capability I
had added for WoWLAN initially.
Finally, some keys simply don't need to be added
into the device's key cache -- a key that won't
be used for RX is only needed in the TX header,
so "pretend" to have accepted any key without
adding it into the device -- no need to use up
key space there for it.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
iwlagn: add comment to warn about WoWLAN in resume / suspend flows
WoWLAN may need the NIC even after suspend. One should not do anything to the
NIC in the bus level, since one cannot check whether WoWLAN is enabled or not.
Same for resume.
Add a simple comment to the code to warn about this.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Call iwl_probe with a ready iwl_bus struct. This means that the bus layer
assigns the irq, dev and iwl_bus_ops pointers to iwl_bus before giving it to
iwl_probe.
The device specific struct is allocated together with the common iwl_bus struct
by the bus specific layer. The pointer to the aggregate struct is passed to the
upper layer that holds a pointer to iwl_bus instead of an embedded iw_bus.
The private data given to the PCI subsystem is now iwl_bus and not iwl_priv.
Provide bus_* inliners on the way in order to simplify the syntax.
Rename iwl-pci.h -> iwl-bus.h since it is bus agnostic and represent the
external of the bus layer.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
iwlagn: transport layer receives struct iwl_trans*
It still holds a pointer to iwl_priv. But hopefully this will disappear at some point.
Also add the multiple inclusion protection to iwl-trans.h that was forgotten.
Move iwl-trans structures to iwl-trans.h
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Since iwlagn_setup_deferred_work is always called, fold it into
iwl_setup_deferred_work. BT related works are setup by the new
bt_setup_deferred_work lib_ops.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.guy@intel.com>
Since iwlagn_rx_handler_setup is always called, fold it into
iwl_rx_handler_setup. BT related handlers are setup by the new
bt_rx_handler_setup lib_ops.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.guy@intel.com>
Andy Shevchenko [Wed, 20 Jul 2011 13:34:31 +0000 (16:34 +0300)]
wireless: mwifiex: print hw address via %pM
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Andy Shevchenko [Wed, 20 Jul 2011 13:34:30 +0000 (16:34 +0300)]
wireless: ath9k: use %pM to print MAC
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: "Luis R. Rodriguez" <lrodriguez@atheros.com> Cc: ath9k-devel@lists.ath9k.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
Andy Shevchenko [Wed, 20 Jul 2011 13:34:29 +0000 (16:34 +0300)]
wireless: rtlwifi: throw away MAC_FMT and use %pM instead
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
cfg80211: allow userspace to control supported rates in scan
made single-band cards crash since it would always
access all wiphy->bands[]. Fix this and reject any
attempts in the new helper ieee80211_get_ratemask()
to do the same, rejecting rates configuration for
unsupported bands.
Reported-by: Pavel Roskin <proski@gnu.org> Tested-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Pavel Roskin [Tue, 19 Jul 2011 22:02:15 +0000 (18:02 -0400)]
carl9170: fix sparse warnings enabled by CONFIG_SPARSE_RCU_POINTER
Signed-off-by: Pavel Roskin <proski@gnu.org> Acked-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
ieee80211_stop_rx_ba_session() was calling sta_info_get()
without rcu locking, and the return value was not
checked.
This resulted in the following panic:
Signed-off-by: Eliad Peller <eliad@wizery.com> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
cfg80211_netdev_notifier_call() is configuring psm in case
of NL80211_IFTYPE_STATION interface type (on NETDEV_UP).
do the same for NL80211_IFTYPE_P2P_CLIENT interface type.
Signed-off-by: Eliad Peller <eliad@wizery.com> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Tue, 19 Jul 2011 08:39:53 +0000 (10:39 +0200)]
mac80211: sync driver before TX
In P2P client mode, the GO (AP) to connect to might
have periods of time where it is not available due
to powersave. To allow the driver to sync with it
and send frames to the GO only when it is available
add a new callback tx_sync (and the corresponding
finish_tx_sync). These callbacks can sleep unlike
the actual TX.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Pavel Roskin [Fri, 15 Jul 2011 00:21:55 +0000 (20:21 -0400)]
ath5k: merge ath5k_hw and ath5k_softc
Both ath5k_hw and ath5k_softc represent one instance of the hardware.
This duplication is historical and is not needed anymore.
Keep the name "ath5k_hw" for the merged structure and "ah" for the
variable pointing to it. "ath5k_hw" is shorter than "ath5k_softc", more
descriptive and more widely used.
Put the combined structure to ath5k.h where the old ath5k_softc used to
be. Move some code from base.h to ath5k.h as needed.
Remove memory allocation for struct ath5k_hw and the corresponding error
handling. Merge iobase and ah_iobase fields.
Signed-off-by: Pavel Roskin <proski@gnu.org> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Some of the newer Broadcom chipsets have longe names like BCM43224,
BCM43225, etc. However Broadcom decided to keep using u16 for storing
them. Use %X or %d depending on chip_id value to avoid BCMA8D8, etc.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Acked-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Mon, 18 Jul 2011 16:08:35 +0000 (18:08 +0200)]
cfg80211: allow userspace to control supported rates in scan
Some P2P scans are not allowed to advertise
11b rates, but that is a rather special case
so instead of having that, allow userspace
to request the rate sets (per band) that are
advertised in scan probe request frames.
Since it's needed in two places now, factor
out some common code parsing a rate array.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
MAINTAINERS: change maintainer of the wl1251 driver
Kalle Valo has asked me to take over the maintenance of the wl1251
driver. Thanks Kalle for all his work on the wl1251 driver, I'll try
to keep up with his good work from now on.
At the same time, update the Web URL to something more specific.
There's not much in that page, but we will try to update it soon.
Signed-off-by: Luciano Coelho <coelho@ti.com> Acked-by: Kalle Valo <kvalo@adurom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
We use all that functions by pointers only. This forces compiler to
create additional duplicated functions that are not inline.
Noticed by Michael in similar bcma code.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Harshal Chhaya discovered during network tests, that
several of his clients dropped-off the network. The
captured packets shows that the beacons sent by the
AP are at a much lower power than the other data
packets.
The reason for this mishap: The driver never updated
the beacon phy register, so all beacons were always
sent at the lowest power.
Reference: http://marc.info/?l=linux-wireless&m=131067225105801 Reported-by: Harshal Chhaya <harshal@gmail.com> Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
SPROM rev 9 was discovered on 14e4:4331, it seems to have very similar
layout to rev 8 one. Use the same extracting function until we find some
differences.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
mac80211: reconfigure tx on device reconfiguration
Add tx_conf array to save the current tx queues
configuration, and reconfig it on resume (ieee80211_reconfig).
On resume, the driver is being reconfigured. Without
reconfiguring the tx queues as well, the driver might
configure the device to use wrong ac params (e.g. ps-poll
instead of uapsd).
Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Thu, 7 Jul 2011 12:11:51 +0000 (05:11 -0700)]
iwlagn: simplify TX flags assignments
The first assignment of TX_CMD_FLG_SEQ_CTL_MSK for
ack-expected mgmt frames is overwritten later in
the function, so it's useless. Also, probe response
frames, BACK request and others there are mutually
exclusive so can be moved into an else branch.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
iwlagn: move the Rx dispatching to the upper layer
The upper layer receives a pointer to an iwl_rx_mem_buffer. I would prefer the
upper layer to receive a pointer to an iwl_rx_packet, but this is impossible
since the Rx path needs to add the address of the page to the skb.
I may find a solution later.
All the pre_rx_handler and notification code has been moved to the upper layer.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Since all the irq / tasklet is now handled in the transport layer, it should
give an API to ensure that all the irq / tasklet have finished running. This
will allow the upper layer to release all its resources.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
iwlagn: move the tasklet / irq to the transport layer
PCIe doesn't provide any ISR registration API, whereas other buses do.
Hence, we need to move the tasklet and irq to the transport layer to allow this
flexibility.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Johannes Berg [Thu, 14 Jul 2011 14:48:54 +0000 (16:48 +0200)]
mac80211: be more careful in suspend/resume
When suspending with all netdevs down, the device
is stopped but we still call a number of driver
callbacks that the driver might not expect. The
same happens during resume, we might call a few
callbacks without starting the driver. Fix this
by checking open_count around more things and
exiting quickly if it is 0.
Also, while at this I noticed that the coverage
class isn't reprogrammed after resume, so add
that.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Pavel Roskin [Thu, 14 Jul 2011 01:38:18 +0000 (21:38 -0400)]
carl9170: fix formatting issues found by checkpatch
Signed-off-by: Pavel Roskin <proski@gnu.org> Acked-By: christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 13 Jul 2011 17:50:53 +0000 (19:50 +0200)]
mac80211: let key iteration get keys in install order
ieee80211_iter_keys() currently returns keys in
the backward order they were installed in, which
is a bit confusing. Add them to the tail of the
key list to make sure iterations go in the same
order that keys were originally installed in.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Wed, 13 Jul 2011 15:35:05 +0000 (23:35 +0800)]
ath9k: improve reliability of MIC error detection
For unicast the hardware sometimes reports MIC errors even though the
frame that it received actually contains a valid MIC - on some chips this
can happen frequently enough to trigger TKIP countermeasures.
Fix this issue by not reporting MIC errors for unicast frames with a
valid key, letting mac80211 validate the MIC instead.
Additionally, strip the MIC for all frames that the hardware considers
valid to avoid wasting CPU cycles re-validating it.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>