Commit Graph

415 Commits

Author SHA1 Message Date
Oren Givon 2bccec4e12 iwlwifi: add more new 8260 series PCI IDs
More sub system IDs were introduced for the 8260 series.
Add the new sub system IDs so the cards can be recognized.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-12 09:57:46 +02:00
Emmanuel Grumbach e0b8d40513 iwlwifi: pcie: allow the op_mode to freeze the stuck queue timer
This allows the op_mode to let the transport know that a
queue is currently frozen and that its timer should be
stopped.
When the queue is unfrozen, its timer should be set to
expire after the remainder of the timeout has elapsed.
This can be used when stations go to sleep. When a station
goes to sleep, the op_mode can freeze the timer so that the
queue will never be considered as stuck. When the station
wakes up, the queue will be unfrozen.
This is meant to avoid false positives that would happen if
a buggy station goes to sleep for a very long time. In case
we have a dedicated queue for this station (BA agreement)
and it goes to sleep for a very long time, the queue would
rightfully be stopped during all that time. In this case,
the stuck queue timer could fire and that would be a false
positive.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-12 09:57:43 +02:00
Eran Harary 16bc119b6b iwlwifi: trans: Take ownership on secure machine before FW load
When we load the firmware for the 8000 B step device, it'll
verify its signature. In the current version of the
hardware, there can be a race between the WiFi firmware
being loaded and the Bluetooth firmware being loaded.

Check that WiFi is authenticated, if not, take ownership
on the authentication machine to make sure that the WiFi
firmware will be authenticated.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-12 09:57:41 +02:00
Oren Givon 3a1a61476d iwlwifi: add new 8260 series PCI IDs
New sub system IDs were introduced for the 8260 series.
This patch adds them so new 8260 cards can be recognized.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-12 09:57:40 +02:00
Emmanuel Grumbach 6a65bd534e iwlwifi: pcie: include more registers in the prph dump
This adds BT Coex data to the prph register list.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-12 09:57:36 +02:00
Emmanuel Grumbach 36277234da iwlwifi: pcie: speed up the Tx DMA stop flow
We don't need to acquire MAC access for each access, it
makes much more sense to keep the MAC access. This speeds
up the Tx DMA stop flow significantly.
Moreover, if one channel can't be stopped, stop the others
but don't poll for them to avoid being stuck there for a
long time.

This solves a situation in which we were stuck in that flow
for way too long with a spinlock held which led to a kernel
panic.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-12 09:57:35 +02:00
Eran Harary 7a42baa621 iwlwifi: mvm: support family 8000 B2/C steps
In-order to recognize newer step of the device, the driver
must read the chip_version_id from the AUX bus MISC address
space. This will determine what firmware file will be
loaded.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-12 09:57:35 +02:00
Emmanuel Grumbach a2227ce2a3 iwlwifi: pcie: apply destination before releasing reset
This allows to use the firmware debugging system even when
the configuration values are set hard coded in the firmware.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-01 16:55:08 +02:00
Emmanuel Grumbach 4cf677fd54 iwlwifi: allow to define the stuck queue timer per queue
Different queue can have different behavior. While it can be
unacceptable for a certain queue to be stuck for 2 seconds
(e.g. the command queue), it can happen that another queue
will stay stuck for even longer (a queue servicing a power
saving client in GO).
The op_mode can even make the timeout be a function of the
listen interval.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-02-01 15:57:23 +02:00
Emmanuel Grumbach ce71c2f797 iwlwifi: mvm: enable watchdog on Tx queues for mvm
This watchdog allows to monitor the transmit queues. When a
queue doesn't progress for a too long time, a timer fires
and then, debug data can be collected.
This watchdog has never been enabled on dvm controlled
devices, so don't enable it there.
In order to have it running on mvm controlled devices, we
need to fix a small issue in the transport layer: mvm
controlled devices use the shadow registers optimization.
In this case, the watchdog wasn't running at all, even if
enabled by the module parameter. Fix that on the way.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-02-01 15:57:22 +02:00
Emmanuel Grumbach cd8f438405 iwlwifi: pcie: disable the SCD_BASE_ADDR when we resume from WoWLAN
The base address of the scheduler in the device's memory
(SRAM) comes from two different sources. The periphery
register and the alive notification from the firmware.
We have a check in iwl_pcie_tx_start that ensures that
they are the same.
When we resume from WoWLAN, the firmware may have crashed
for whatever reason. In that case, the whole device may be
reset which means that the periphery register will hold a
meaningless value. When we come to compare
trans_pcie->scd_base_addr (which really holds the value we
had when we loaded the WoWLAN firmware upon suspend) and
the current value of the register, we don't see a match
unsurprisingly.
Trick the check to avoid a loud yet harmless WARN.
Note that when the WoWLAN has crashed, we will see that
in iwl_trans_pcie_d3_resume which will let the op_mode
know. Once the op_mode is informed that the WowLAN firmware
has crashed, it can't do much besides resetting the whole
device.

CC: <stable@vger.kernel.org>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-02-01 15:57:21 +02:00
Emmanuel Grumbach cb6bb128b7 iwlwifi: pcie: prepare the enablement of 31 TFD queues
Some devices have 31 TFD queues. Don't enable it yet since
there are still issues with it, but at least prepare the
code for it. There was a bug in the read pointer assignment,
fix that. Also, move the inline functions to iwl-scd.h which
is the right place.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-02-01 15:57:20 +02:00
Emmanuel Grumbach e885c58bf8 iwlwifi: pcie: don't dump useless data when a TFD queue hangs
Printing all the scratch data of the TFDs of that queue is
useless and stuffed the kernel log with data. Remove that.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-02-01 15:39:08 +02:00
Eran Harary afb8891740 iwlwifi: pcie: support secured boot flow for family 8000 B step
The driver loads the 2 CPU sections, then it needs to let
the firmware know to start the authentication of the
sections. This is done by writing the relevants bits to
FH_UCODE_LOAD_STATUS.

For CPU1, the driver sets the lower 16 bits. For both CPUs,
the driver sets all the 32 bits.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:55:26 +02:00
Eran Harary 716e48a650 iwlwifi: mvm: support family 8000 C step
C step functionality in the driver is exactly the same as
B step besides the ucode name that present as iwlwifi-8000C-xx.ucode
instead of iwlwifi-8000B-xx.ucode

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:55:20 +02:00
Johannes Berg dad33ecfdb iwlwifi: pcie: init ref_lock
The ref_lock that was recently added is missing initialization
which makes lockdep unhappy and is generally a bad idea.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:55:19 +02:00
Emmanuel Grumbach d5234cb2f4 Merge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-next
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

Conflicts:
	drivers/net/wireless/iwlwifi/iwl-fw-file.h
	drivers/net/wireless/iwlwifi/mvm/scan.c
2015-01-22 17:55:12 +02:00
Emmanuel Grumbach 0294d9eece iwlwifi: mvm: let the firmware configure the scheduler
A new host command can be used to configure the scheduler
instead of accessing the scheduler's registers from the
driver. This is easier and less error prone since accessing
the hardware at certain moments can lead to races with the
firmware.
Prefer to use the host command whenever it is available.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:54:02 +02:00
Oren Givon 9b8a7a9077 iwlwifi: add new config and PCI IDs for 4165 series
Add a new config for 4165 series over PCI and insert support
for two new 4165 series PCI IDs.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Reviewed-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:53:55 +02:00
Arik Nemtsov 2b0e2b0f7b iwlwifi: pcie: correctly define 7265-D cfg
The trans cfg was not replaced for 7265-D cards. This led to a check of
the min-NVM version against a 7265-C card, causing very-old 7265-D cards
to operate incorrectly with the driver.

Fixes: 3fd0d3c170 ("iwlwifi: pcie: support 7265-D devices")
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-05 11:01:41 +02:00
Eran Harary ff29862464 iwlwifi: mvm: call to pcie_apply_destination also on family 8000 B step
In order to config the FW and to allocate monitor buffer driver should
run the function iwl_pcie_apply_destination immediately after FW sections
are loaded.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Reviewed-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:13:40 +02:00
Eliad Peller 6735943faf iwlwifi: mvm: support IWL_D0I3_MODE_ON_SUSPEND d0i3 mode
Enter d0i3 on suspend, and exit d0i3. Wait for the
command responses in both cases.

Use this mode in case of pcie trans.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:20 +02:00
Eliad Peller 7616f334e6 iwlwifi: pcie: add basic reference accounting
Implement the ref/unref trans ops and track both tx and
host command queues (and hold references while they
are not empty).

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:18 +02:00
Emmanuel Grumbach b7aaeae478 iwlwifi: pcie: let the Manageability Engine know when we leave
When the driver is unload, the Manageability Engine should
know about that - send an event to inform it about this
event.

Reviewed-by: Reuven Borok <reuven.borok@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:13 +02:00
Liad Kaufman baa21e8349 iwlwifi: pcie: limit fw chunk sizes given to fh
New FW has chunks that are larger than the size limit of the
FH's DMA. To make sure we don't crash it - actively limit the
max size of each chunk.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-14 10:20:30 +02:00
Emmanuel Grumbach 55fd1ce820 iwlwifi: add new device IDs for 3165
A few device IDs were added, reflect this change in the
driver.

Cc; <stable@vger.kernel.org> [3.13+]
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-14 10:20:30 +02:00
Emmanuel Grumbach 03d6c3b0fa iwlwifi: pcie: re-ACK all interrupts after device reset
When we reset the device, the CSR_INT gets cleared as well
as CSR_INT_MASK. Meaning that we shouldn't get any interrupt
but, due to a hardware bug, recent devices will keep sending
interrupts. This leads to an interrupt storm while stopping
the device.
The way to fix this is to ACK all the interrupts after the
device is reset so that the value of CSR_INT will stay
0xffffffff.

Fixes: 522713c81e ("iwlwifi: pcie: properly reset the device")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-14 10:20:29 +02:00
Liad Kaufman 99684ae356 iwlwifi: pcie: support more monitor types dumping
Until this patch, dumping the monitor data could be done only
for PCIe external (DRAM) mode in 7000 HW family. This patch
allows to pull the monitor data also on other families, and
also to pull the monitor data if an internal buffer is used.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-02 16:51:56 +02:00
Liad Kaufman 09e350f720 iwlwifi: pcie: config regs according to fw tlv
Sometimes there is a need to configure some registers for
setting some FW properties, such as the FW monitor mode
(internal/external). This patch supports setting this for
PCIe mode.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-02 16:51:55 +02:00
Liad Kaufman 06d51e0d99 iwlwifi: pcie: add fh registers to dump data
Adds all FH registers between FH_MEM_UPPER_BOUND and
FH_MEM_LOWER_BOUND (which should be readable to the driver)
to the dump data when it is collected.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-01 13:00:20 +02:00
Eran Harary dcab8ecd56 iwlwifi: mvm: support ucode load for family_8000 B0 only
The ucode load flow changed for B0 hardware step.
Change the code accordingly.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-01 13:00:16 +02:00
Emmanuel Grumbach 655e5cf0d5 iwlwifi: pcie: claim ownership on the device after stop_device()
Not doing so would allow other possible users of the device
to take ownership and prevent normal WiFi operation.

This fixes the second part of:
https://bugzilla.kernel.org/show_bug.cgi?id=87191

Reviewed-by: Moshe Harel <moshe.harel@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-01 12:04:45 +02:00
Eliad Peller 804d4c5a81 iwlwifi: pcie: refactor cmd_in_flight set/clear code
A following patche will use trans_pcie->cmd_in_flight
for reference accounting as well. get ready for it.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-01 12:04:41 +02:00
Johannes Berg 3fd0d3c170 iwlwifi: pcie: support 7265-D devices
Identify 7265-D devices using the hardware revision (they have the
same PCI IDs as 7265) and change the configuration for them taking
the differences (currently only the firmware image) into account.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-11-24 08:30:12 +02:00
Arik Nemtsov fe45773b5b iwlwifi: pcie: support loading FW with extended mem range
Toggle the LMPM_CHICK register when writing chunks into the FW's extended
SRAM. This tells the FW to put the chunk into a different memory space.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-11-23 20:11:33 +02:00
Emmanuel Grumbach 522713c81e iwlwifi: pcie: properly reset the device
We were toggling the wrong bit when we reset the device,
fix that. Moreover, since the reset can take time, we need
to wait before we set the rfkill interrupt. Not doing so
can be racy since the driver is enabling the rfkill
interrupt while the device is resetting which will clear
all the registers including the CSR_INT_MASK.
This can basically lead to a situation where we don't
enable the rfkill interrupt. If that happens, the user will
not be able to re-enable the device when de-asserting
rfkill.

This scenario happened to the submitter of:
https://bugzilla.kernel.org/show_bug.cgi?id=87191

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-11-23 20:07:37 +02:00
Emmanuel Grumbach aeb8f93208 Merge remote-tracking branch 'wireless-next/master' into iwlwifi-next 2014-11-23 19:56:35 +02:00
John W. Linville ab1f5a532c Merge commit '4e6ce4dc7ce71d0886908d55129d5d6482a27ff9' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless 2014-11-19 15:38:48 -05:00
Emmanuel Grumbach 6a08f5144c iwlwifi: pcie: newer platform needs a OS alive indication
This is fully backward compatible with older platforms.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-11-11 17:15:10 +02:00
Emmanuel Grumbach 01e58a281e iwlwifi: pcie: introduce delay when waking up the device
In some rare cases, the firmware can put the device to
sleep after the driver requested the access. This is
because the access request can take a short time to be
propagated to the firmware.

If that happens, the driver may think that it has access
since the firmware hasn't put the device to sleep yet, but
right after the driver's check, the firmware might put the
device to sleep.

Warn when this happens by allowing the firmware to finish
the "put the device sleep" flow so that the driver will
not get access to the device. This will make the issue
visible.

This still doesn't fix the race, but at least it makes
it more visible.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-11-11 17:15:09 +02:00
Liad Kaufman 87dd634ae7 iwlwifi: pcie: fix prph dump length
The length counting previously done had an error in it, causing
the length down the data dumping function to be shorter than it
should be, causing the end of the data to get truncated off and
lost.

Cc: <stable@vger.kernel.org> [3.17+]
Fixes: 67c65f2cf7 ("iwlwifi: dump periphery registers to fw-error-dump")
Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-11-11 07:24:57 +02:00
Emmanuel Grumbach 31b8b343e0 iwlwifi: fix RFkill while calibrating
If the RFkill interrupt fires while we calibrate, it would
make the firmware fail and the driver wasn't able to recover.
Change the flow so that the driver will kill the firmware
in that case.

Since we have now two flows that are calling
trans_stop_device (the RFkill interrupt and the
op_mode_mvm_start function) - we need to better sync this.
Use the STATUS_DEVICE_ENABLED in the pcie transport in an
atomic way to achieve this.

This fixes: https://bugzilla.kernel.org/show_bug.cgi?id=86231

CC: <stable@vger.kernel.org> [3.10+]
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-11-03 15:29:17 +02:00
Johannes Berg aadede6e9f iwlwifi: mvm: port to devcoredump framework
iwlwifi features a debug mechanism that allows to dump
binary data which is helpful to debug the firmware.
Until now, this data was made available for the userspace
through debugfs. For this exact purpose, devcoredump was
created. Move to the new infrastructure.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-29 14:13:43 +02:00
Eran Harary c7583d7dd6 iwlwifi: always run the secured flow for family 8000
In the new format the "CSS section" has the same TLV type
as the "mem section". So we need to run the secured flow
for all the 8000 products.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-29 12:52:24 +02:00
Emmanuel Grumbach a3ead6568c iwlwifi: pcie: fix recovery from ARC reset in WoWLAN
When the ARC is reset when we exit from Sx in case we had
WoWLAN running, we can't access the prph before we reset
the NIC.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-29 12:52:23 +02:00
Emmanuel Grumbach 40a76905ad iwlwifi: pcie: warn if extern fw_debug buffer failed
Otherwise we have no way to know that the buffer hasn't been
allocated.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-29 12:52:23 +02:00
Emmanuel Grumbach 7f2ac8fb31 iwlwifi: pcie: fix polling in various places
iwl_poll_bit may return a strictly positive value when the
poll doesn't match on the first try.
This was caught when WoWLAN started failing upon resume
even if the poll_bit actually succeeded.

Also change a wrong print. If we reach the end of
iwl_pcie_prepare_card_hw, it means that we couldn't
get the devices.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-23 21:21:49 +03:00
Emmanuel Grumbach 9180ac5071 iwlwifi: configure the LTR
The LTR is the handshake between the device and the root
complex about the latency allowed when the bus exits power
save. This configuration was missing and this led to high
latency in the link power up. The end user could experience
high latency in the network because of this.

Cc: <stable@vger.kernel.org> [3.10+]
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-10-23 21:21:47 +03:00
Liad Kaufman 1fc0e22138 iwlwifi: pcie: fix HW_REV saving for 8000 series
Align the trans->hw_rev variable format with previous series
format.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-09-21 13:25:47 +03:00
Oren Givon 4f08970f52 iwlwifi: Add missing PCI IDs for the 7260 series
Add 4 missing PCI IDs for the 7260 series.

Cc: <stable@vger.kernel.org> [3.10+]
Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-09-21 13:25:46 +03:00
Johannes Berg 5d4185ae0c iwlwifi: pcie: clear command data on freeing
When freeing the structures used for command data, clear their
memory as they may have contained key material at some point.
Also clear the duplicated buffer when freeing it to be safe;
currently key material is never put there but that may change.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-09-14 12:56:39 +03:00
Liad Kaufman c2a2b28bb7 iwlwifi: make hw rev checking more readable
Rather than ANDing with a mask - use existing macros, which
are more readable.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-09-14 12:56:39 +03:00
Emmanuel Grumbach 3a736bcb18 iwlwifi: trans: don't configure the set_active in SCD for dvm
This configuration is not needed for dvm, and it actually
broke it.

Reported-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-09-14 12:56:39 +03:00
Oren Givon d4200cb248 iwlwifi: add and edit 8000 series PCI IDs
Edit some 8000 series PCI IDs and add configuration to
Dual Band Wireless N 8260 devices.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-09-14 12:56:36 +03:00
Emmanuel Grumbach 71511c866b Merge remote-tracking branch 'iwlwifi-fixes/master' into NEXT 2014-09-14 12:54:42 +03:00
Oren Givon 498abba6a0 iwlwifi: add PCI IDs and add then new 3165 series
This change does the following:
1) Add a new 7265 series PCI ID
2) Add two new 3160 series PCI IDs
3) Add the new 3165 series PCI IDs and configurations

Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-09-08 19:47:16 +03:00
Johannes Berg 8b4139dc9f iwlwifi: add Intel Mobile Communications copyright
Our legal structure changed at some point (see wikipedia), but
we forgot to immediately switch over to the new copyright
notice.

For files that we have modified in the time since the change,
add the proper copyright notice now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-09-03 22:49:07 +03:00
Avri Altman 002a9e2677 iwlwifi: trans: configure the scheduler enable register
Currently the firmware is handling this, but that is wrong as it then
needs to assume a certain command queue, therefore this should be in
the driver; add it here so it can be removed from the firmware in the
future.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-09-03 22:49:06 +03:00
Johannes Berg 64ba893066 iwlwifi: trans: make aggregation explicit for TX queue handling
Currently a valid sta_id is assumed to mean that the queue is
meant to also be aggregated, but that assumption will not be
true in the future, so don't make it in the lower level but
only in the inline wrapper.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-09-03 22:49:06 +03:00
Johannes Berg d4578ea810 iwlwifi: trans: allow skipping scheduler hardware config
In a later patch, the hardware configuration will be moved to
firmware. Prepare for this by allowing hardware configuration
in the transport to be skipped by not passing a configuration
on enable and passing configure_scd=false on disable.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-09-03 22:49:05 +03:00
Johannes Berg fea7795f1c iwlwifi: trans: refactor txq_enable arguments
Instead of having all arguments passed to the function,
add a struct to hold them and only pass some directly.

This will make future work in this area cleaner.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-09-03 22:49:01 +03:00
Avri Altman 680073b78a iwlwifi: consolidate hw scheduler configuration code
Configuring the hw scheduler during queue enablement is done by
writing the appropriate values to the scheduler peripherals, and
it is essentially the same for all buses.

Whenever writing is done via the standard iwl_write_prph, we can
avoid duplicating the code for each bus. Those operations are
queue deactivation, RA/TID mapping, chain-building settings,
enabling/disabling aggregations and activating/deactivating the
TX FIFOs.

Consolidate this code using static inlines in a new header file.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-09-03 22:49:00 +03:00
Benoit Taine 9baa3c34ac PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use
We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to
meet kernel coding style guidelines.  This issue was reported by checkpatch.

A simplified version of the semantic patch that makes this change is as
follows (http://coccinelle.lip6.fr/):

// <smpl>

@@
identifier i;
declarer name DEFINE_PCI_DEVICE_TABLE;
initializer z;
@@

- DEFINE_PCI_DEVICE_TABLE(i)
+ const struct pci_device_id i[]
= z;

// </smpl>

[bhelgaas: add semantic patch]
Signed-off-by: Benoit Taine <benoit.taine@lip6.fr>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2014-08-12 12:15:14 -06:00
Emmanuel Grumbach 473ad712a4 iwlwifi: dump CSRs to fw-error-dump
Add the Control Status Registers to the firmware error dump
infrastructure.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-07-22 19:21:12 +03:00
Emmanuel Grumbach 67c65f2cf7 iwlwifi: dump periphery registers to fw-error-dump
Use the fw-error-dump infrastructure to dump the periphery
registers. Only certain ranges are readable, so dump only
these.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-07-22 19:21:11 +03:00
Emmanuel Grumbach 48eb7b34ff iwlwifi: split fw-error-dump between transport and mvm
The mvm op_mode won't allocate the buffer for the transport
any more. The transport allocates its own buffer and mvm
is in charge of splicing the buffers in the debugfs hook.

This makes the repartition easier to handle.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-07-22 19:21:10 +03:00
Emmanuel Grumbach c544e9c4c3 iwlwifi: rename iwl_fw_error_fw_mon to iwl_fw_error_dump_fw_mon
This is matches the convention of the other structures.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-07-06 11:16:16 +03:00
Emmanuel Grumbach 44621b82aa Merge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-next 2014-07-06 11:15:23 +03:00
Liad Kaufman b513ee7fd6 iwlwifi: update trans->hw_rev 8000 hw family format
The format of the CSR_HW_REV register has changed in 8000
HW family. To keep backwards compatibility, we store the
value of this register as usual in trans->hw_rev, only we
store it in the old format in this variable.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-06-24 21:55:32 +03:00
Andy Lutomirski f40faf6237 iwlwifi: pcie: improve debugfs queue info
This adds need_update and write_actual to rx_queue and need_update
and an HCMD indicator to tx_queue.

On my card, rx_queue now looks like:

read: 181
write: 180
write_actual: 176
need_update: 0
free_count: 40
closed_rb_num: 181

tx_queue now looks like:

hwq 00: read=29 write=30 use=1 stop=0 need_update=0
hwq 01: read=0 write=0 use=1 stop=0 need_update=0
hwq 02: read=128 write=128 use=1 stop=0 need_update=0
hwq 03: read=0 write=0 use=1 stop=0 need_update=0
hwq 04: read=94 write=94 use=1 stop=0 need_update=0 HCMD
hwq 05: read=0 write=0 use=0 stop=0 need_update=0
hwq 06: read=0 write=0 use=0 stop=0 need_update=0
hwq 07: read=0 write=0 use=0 stop=0 need_update=0
hwq 08: read=0 write=0 use=0 stop=0 need_update=0
hwq 09: read=0 write=0 use=0 stop=0 need_update=0
hwq 10: read=0 write=0 use=0 stop=0 need_update=0
hwq 11: read=0 write=0 use=0 stop=0 need_update=0
hwq 12: read=0 write=0 use=0 stop=0 need_update=0
hwq 13: read=0 write=0 use=0 stop=0 need_update=0
hwq 14: read=0 write=0 use=0 stop=0 need_update=0
hwq 15: read=0 write=0 use=0 stop=0 need_update=0
hwq 16: read=0 write=0 use=0 stop=0 need_update=0
hwq 17: read=0 write=0 use=0 stop=0 need_update=0
hwq 18: read=0 write=0 use=0 stop=0 need_update=0
hwq 19: read=0 write=0 use=0 stop=0 need_update=0

This may help with debugging queue stalls.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-06-24 21:55:30 +03:00
Andy Lutomirski d536c32b45 iwlwifi: pcie: log when waking the NIC for hcmd submission fails
I've never seen this happen, but it's useful to rule it out.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-06-24 21:55:29 +03:00
Emmanuel Grumbach c2d202017d iwlwifi: pcie: add firmware monitor capabilities
This allows to use the firmware monitor. This capability
uses a lot of contiguous memory (up to 64MB), so make its
usage module parameter dependent.

The driver will try to allocate as much contiguous memory
as possible downgrading its requirements until the
allocation succeeds.

Dump this data into the fw-error dump file when an error
happens.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-06-24 21:55:27 +03:00
Oren Givon b3c063ae72 iwlwifi: update the 7265 series HW IDs
Add one more 7265 series HW ID.
Edit one existing 7265 series HW ID.

CC: <stable@vger.kernel.org> [3.13+]
Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-06-24 21:06:46 +03:00
Liad Kaufman 4c9706dc2f iwlwifi: update nmi register
In the 8000 HW family the register for forcing an NMI has
changed, so this allows to still be able to force an NMI
while taking into account the HW in order to write to the
correct register.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-05-15 19:50:51 +03:00
Emmanuel Grumbach d090f878b0 iwlwifi: pcie: disable BHs in iwl_pcie_txq_check_wrptrs
This fixes:

=================================
[ INFO: inconsistent lock state ]
3.14.3+ #5 Tainted: G           O
---------------------------------
inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
swapper/3/0 [HC0[0]:SC1[3]:HE1:SE0] takes:
 (&(&txq->lock)->rlock){+.?...}, at: [<ffffffffa059803c>] iwl_pcie_enqueue_hcmd+0x12c/0x1000 [iwlwifi]
{SOFTIRQ-ON-W} state was registered at:
  [<ffffffff810d9071>] __lock_acquire+0x5f1/0x13b0
  [<ffffffff810d9ee0>] lock_acquire+0xb0/0x1f0
  [<ffffffff817ef80e>] _raw_spin_lock+0x3e/0x80
  [<ffffffffa0598f7a>] iwl_pcie_txq_check_wrptrs+0x6a/0xb0 [iwlwifi]
  [<ffffffffa0594b5a>] iwl_pcie_irq_handler+0xdba/0x2670 [iwlwifi]
  [<ffffffff810ef1e0>] irq_thread_fn+0x20/0x50
  [<ffffffff810ef77f>] irq_thread+0x11f/0x150
  [<ffffffff810a04f0>] kthread+0xf0/0x110
  [<ffffffff817fa4bc>] ret_from_fork+0x7c/0xb0
irq event stamp: 1142192
hardirqs last  enabled at (1142192): [<ffffffff817efb6c>] _raw_spin_unlock_irq+0x2c/0x40
hardirqs last disabled at (1142191): [<ffffffff817ef9ef>] _raw_spin_lock_irq+0x1f/0x80
softirqs last  enabled at (1142188): [<ffffffff81079082>] _local_bh_enable+0x22/0x50
softirqs last disabled at (1142189): [<ffffffff8107ad35>] irq_exit+0xe5/0xf0

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&(&txq->lock)->rlock);
  <Interrupt>
    lock(&(&txq->lock)->rlock);

Fixes: ea68f46070 ("iwlwifi: pcie: clarify TX queue need_update handling")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-05-13 13:53:53 +03:00
Emmanuel Grumbach 90c456fc79 Merge remote-tracking branch 'iwlwifi-fixes/master' into HEAD 2014-05-13 13:51:53 +03:00
Emmanuel Grumbach 501fd9895c iwlwifi: pcie: try to get ownership several times
Some races with the hardware can happen when we take
ownership of the device. Don't give up after the first try.

Cc: <stable@vger.kernel.org>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-05-11 13:07:12 +03:00
Johannes Berg 3c6acb614d iwlwifi: add missing trailing newlines to debug messages
All messages should have a trailing newline, add all the
missing ones. Also make all messages constants, replacing
the single one that pointlessly used a variable.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-05-11 12:54:58 +03:00
Emmanuel Grumbach 83f7a85f11 iwlwifi: pcie: disable interrupts upon PCIe alloc
In case RFKILL is in KILL position, the NIC will issue an
interrupt straight away. This interrupt won't be sent
because it is masked in the hardware.
But if our interrupt service routine is called for another
reason (SHARED_IRQ), then we'll look at the interrupt cause
and service it. This can cause bad things if we are not
ready yet.
Explicitly clean the interrupt cause register to make sure
we won't service anything before we are ready to.

Cc: <stable@vger.kernel.org> [3.14]
Reported-and-tested-by: Alexander Monakov <amonakov@gmail.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-05-07 22:54:32 +03:00
Johannes Berg 4d075007d6 iwlwifi: mvm/pcie: capture last commands on firmware error
When a firmware error occurs, capture the last 32 commands
(which are still in memory) in the error dump debugfs file.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-05-06 23:32:44 +03:00
Johannes Berg 83f32a4b4a iwlwifi: pcie: get rid of q->n_bd
This variable always tracks a constant value (256) so there's
no need to have it. Removing it simplifies code generation,
reducing the .text size (by about 240 bytes on x86-64.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-05-06 21:39:05 +03:00
Johannes Berg 6d6e68f839 iwlwifi: pcie: use bool for iwl_pcie_txq_build_tfd() argument
The 'reset' argument is clearly a boolean, so use bool instead
of u8 with 0/1 values.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-05-06 20:41:21 +03:00
Emmanuel Grumbach 939ecf6b14 Merge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-next 2014-05-06 20:37:33 +03:00
Emmanuel Grumbach e03bbb62cf iwlwifi: don't disable SCD chain extension on newer devices
7000 device series have a fix for this hardware feature.
Stop disabling it, and get an improvement in Tx throughput.
This feature allows the scheduler to fetch more frames on
the fly while an A-MPDU is being built - which means that
we can get larger A-MPDU. This, of course, give an
improvement in the Tx throughput.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-04-13 22:23:20 +03:00
Emmanuel Grumbach 748fa67cb7 iwlwifi: mvm: replace BUG_ON by WARN_ON in scan.c
While the scan_cmd should really be allocated in init (and
we do fail init in case the allocation failed), it doesn't
mean we should lock up the machine if something really bad
happened.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-04-13 09:36:03 +03:00
Emmanuel Grumbach fa1a91fd76 iwlwifi: pcie: WARN upon traffic while flushing TX queues
This must not happen - otherwise we might keep flushing
forever.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-04-13 09:35:59 +03:00
Emmanuel Grumbach 3cafdbe6ad iwlwifi: allow to wait for a subset of the queues
This will be used later to flush / wait for queues that are
related to a specific vif.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-04-13 09:35:58 +03:00
Eran Harary 69e921317b iwlwifi: move CPU1_CPU2_SEPARATOR_SECTION to iwl-fw.h
This define is related to the firmware packaging and is
needed by more than one transport.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-04-13 09:35:55 +03:00
Emmanuel Grumbach e69140e59a iwlwifi: pcie: unify iwl_rx_replenish and iwl_rx_replenish_now
Besides the different allocation flags, they are really
the same. Pass the gfp_t flags as a parameter, and unify
them.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-04-13 09:35:55 +03:00
Johannes Berg ea68f46070 iwlwifi: pcie: clarify TX queue need_update handling
Similar to the recent RX queue patch, this changes the need_update
handling for the TX queues to be clearer and only done when needed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-04-13 09:35:54 +03:00
Johannes Berg 42646ba046 iwlwifi: pcie: fix TX queue locking
When updating the write pointer, the TX queue should be locked
to get consistent state, fix that in the interrupt handler.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-04-13 09:35:53 +03:00
Johannes Berg 43aa616f32 iwlwifi: pcie: use bool for TX queue where appropriate
Instead of using u8 to hold logic values, use bool.

Also fix a comment, the return value is no longer relevant.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-04-13 09:35:52 +03:00
Johannes Berg 5d63f926d1 iwlwifi: pcie: clarify RX queue need_update handling and locking
When shadow registers are enabled, then need_update never needs
to be set, so move the need_update handling into the function
that really needs to do it (iwl_pcie_rxq_inc_wr_ptr) and also
separate the check when it woke up. While at it, convert it to
bool.

This also clarifies the locking and means the irq_lock needs to
no longer be held for any such updates.

The irq_lock also doesn't have to be held for restocking since
everything else locks the RX queue properly, so remove that and
finally disentangle the two locks entirely so there aren't any
dependencies between the two left.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-04-13 09:35:52 +03:00
Johannes Berg f14d6b39c0 iwlwifi: pcie: implement GRO without NAPI
Use the new NAPI infrastructure added to mac80211 to get
GRO. We don't really implement NAPI since we don't have
a real poll function and we never schedule a NAPI poll.
Instead of this, we collect all the packets we got from a
single interrupt and then call napi_gro_flush().

This allows us to benefit from GRO. In half duplex medium
like WiFi, its main advantage is that it reduces the number
of TCP Acks, hence improving the TCP Rx performance.

Since we call the Rx path with a spinlock held, remove
the might_sleep mention from the op_mode's API.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ido Yariv <ido@wizery.com>
[Squash different patches and rewrite the commit message]
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-04-13 09:35:47 +03:00
Oren Givon 80f2679e58 iwlwifi: add new 7265 HW IDs
Add 2 new HW IDs for the 7265 series.

Cc: <stable@vger.kernel.org> [3.13+]
Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-04-13 08:27:32 +03:00
Emmanuel Grumbach e7f7634092 iwlwifi: pcie: don't leave the new NICs awake for commands
A hardware bug had been discovered on 7260 / 3160 and 7265
and the workaround for this bug is to force the NIC to stay
awake as long as we have host commands in flight. This
workaround has been introduced for all NICs in a previous
patch:

b943949105 ("iwlwifi: pcie: keep the NIC awake when commands are in flight")

In newer NICs, this bug is solved, so we can let the NIC go
to sleep even when we send commands. The hardware will wake
up when we increment the scheduler write pointer.
Make the workaround conditional to only use it on affected
hardware.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-04-06 10:18:47 +03:00
John W. Linville aa4a625088 Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next 2014-03-18 16:55:28 -04:00
John W. Linville 3e3cb6caea Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes 2014-03-14 14:33:19 -04:00
Johannes Berg 14cfca7152 iwlwifi: return whether to stop from rfkill method
When indicating RF-kill toggle to the higher layer, that
may in turn call back to the transport (for MVM at least)
to turn off the device quickly. Instead of that, allow it
to return whether or not the device should be turned off,
this gets rid of the call indirection and will help make
the API more consistent when we go back to non-threaded
interrupts again for PCIe.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-03-09 19:16:46 +02:00
Alexander Bondar a812cba9bb iwlwifi: pcie: enable LP XTAL to reduce power consumption
1. Enable LP XTAL to avoid HW bug where device may consume much
power if FW is not loaded after device reset. LP XTAL is
disabled by default after device HW reset. Configure device's
"persistence" mode to avoid resetting XTAL again when SHRD_HW_RST
occurs in S3.

2. Add methods to access SHR (shared block memory space) directly from PCI
bus w/o need to power up MAC HW.

Shared internal registers (e.g. SHR_APMG_GP1, SHR_APMG_XTAL_CFG)can be
accessed directly from PCI bus through SHR arbiter even when MAC HW is
powered down. This is possible due to indirect read/write via
HEEP_CTRL_WRD_PCIEX_CTRL (0xEC) and HEEP_CTRL_WRD_PCIEX_DATA (0xF4)
registers.

Use iwl_write32()/iwl_read32() family to access these registers. The MAC HW
need not be powered up so no "grab inc access" is required.

For example, to read from SHR_APMG_GP1 register (0x1DC),
first, write to the control register:
HEEP_CTRL_WRD_PCIEX_CTRL[15:0] = 0x1DC (offset of the SHR_APMG_GP1 register)
HEEP_CTRL_WRD_PCIEX_CTRL[29:28] = 2 (read access)
second, read from the data register HEEP_CTRL_WRD_PCIEX_DATA[31:0].

To write the register, first, write to the data register
HEEP_CTRL_WRD_PCIEX_DATA[31:0] and then:
HEEP_CTRL_WRD_PCIEX_CTRL[15:0] = 0x1DC (offset of the SHR_APMG_GP1 register)
HEEP_CTRL_WRD_PCIEX_CTRL[29:28] = 3 (write access)

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-03-09 19:16:39 +02:00