Commit Graph

648747 Commits

Author SHA1 Message Date
Michael Schenk 575ddce050 rtlwifi: rtl_usb: Fix for URB leaking when doing ifconfig up/down
In the function rtl_usb_start we pre-allocate a certain number of urbs
for RX path but they will not be freed when calling rtl_usb_stop. This
results in leaking urbs when doing ifconfig up and down. Eventually,
the system has no available urbs.

Signed-off-by: Michael Schenk <michael.schenk@albis-elcon.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-28 09:11:34 +02:00
Guy Mishol 64ad08605e wlcore: print the sdio buffer after reading it
fix an issue where we printed the sdio buffer before
actually read it.

Signed-off-by: Guy Mishol <guym@ti.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-28 09:11:08 +02:00
Amitkumar Karwar cc37d8efd2 mwifiex: use pci_dma_sync_single* APIs
On some platforms, driver is unable read sleep cookie signature even
if firmware has written it through DMA. The problem is fixed by using
pci_dma_sync_single* APIs while reading DMA buffer shared with firmware.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-28 09:10:04 +02:00
Amitkumar Karwar 3e66849865 mwifiex: mwifiex_unmap_pci_memory() handling for sleep confirm
Sleep confirm is a special command for which "adapter->cur_cmd" pointer
is not set. When it's response is received, host writes SLEEP confirm done
to a register. Firmware will perform DMA for writing sleep cookie signature
on same buffer after this.

Let's not immediately call mwifiex_unmap_pci_memory() for this special
command. Unmapping will be done when firmware completes writing sleep
cookie signature.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-28 09:10:03 +02:00
Serge Vasilugin 98e71f44c5 rt2x00: add support for RT5350 WiSoC
Support for the RT5350 WiSoC was added to OpenWrt after having a
lengthy debate about the legality of the original submission, see
https://lists.openwrt.org/pipermail/openwrt-devel/2013-January/018224.html
MTK/Ralink Acked replied and says we can merge this patch under the GPL.
https://dev.openwrt.org/changeset/36177

Signed-off-by: Serge Vasilugin <vasilugin@yandex.ru>
Tested-by: Michel Stempin <michel.stempin@wanadoo.fr>
Acked-by: John Crispin <blogic@openwrt.org>
[daniel@makrotopia.org: added commit message, cleaned up code]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-28 09:03:46 +02:00
Daniel Golle 5c4412e072 rt2x00: rt2800lib: add support for RT3352 with 20MHz crystal
On Rt3352 the driver needs to know the frequency of an external
crystal which can be either 40 MHz (as on all other WiSoCs until now)
or 20 MHz.
Get the clock attached by ramips WiSoC platform code which probes
SYSC_REG_SYSCFG (added by John Crispin in commit 6ac8579b96) and
introduce a new flag clk_is_20mhz in struct hw_mode_spec to make the
driver aware and use either 40 MHz or 20 MHz specific rf_vals on those
WiSoC platforms.
The introduced support for boards with a 20 MHz crystal is also needed
for RT5350.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-28 09:03:45 +02:00
Stanislaw Gruszka 34db70b92f rt2x00: add copy of clk for soc devices
Since clk_get() is not trivial add copy of clk pointer to rt2x00dev
for System On Chip devices and initialize it on probe routine.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-28 09:03:45 +02:00
Rafał Miłecki b3d75a81f0 brcmfmac: drop duplicated core selection from brcmf_pcie_attach
It was left after reworking PCIe reset in commit 07fe2e38c7
("brcmfmac: Reset PCIE devices after recognition.").

Cc: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-28 08:34:40 +02:00
Kalle Valo 0b9c1ac193 Some improvements, bugfixes and new features:
* A bunch of cleanups here and there;
  * A few simple bugfixes;
  * Some more work in preparation for A000 family support;
  * Add support for radiotap timestamps;
  * Some work on our firmware debugging capabilities;
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEF3LNfgb2BPWm68smoUecoho8xfoFAliKWqIACgkQoUecoho8
 xfqipxAAkesi5DqpHKXsLUq3OqBGzWVkgth5LEyeCGYGE5VeaPvrDpsTt6J31+n8
 4hT2eHpVs+lh30oDhy/ApFmOJgrtKpX3vTlEPPiZqSMqibwxvQzHDHqQLm4vWXG0
 dpg02Hd7Dl7+KQ2L9cuSjKlgjGbFWVPOoJyRHK36wq4ry00Ots+A4HxBOqTUT6UT
 S4TTMLoHqiEZP2yIBS4jiG9fKhDZR3meILfYXHjgXpi8n+9MKEZ+LjpjowUp3S1S
 UcSggpr5u6wik4JznAz9pTCvQNptBbyy8OFUcQY90SA9uSvPO5J9w32uvDHTg0l1
 IaqfiH2CXs0GiD7o7SHyZcdWTFeFPbPxq0GnpIWf5kHKJRYlO5t369TtXQ1zExSN
 h+Tvr9P6cfBQ7dGbV3YHu6zsvA067LkKpH7ivMX8cuCvmP+VtsOnLXi35t1OiJ+m
 SnIC0Jw8kVJCgJuRYgaQ0AAuQq6JkEaXLQU8RsHhge0MRfe4bAAEmut6PX7bh6EK
 YVxVoGs4m+q8nUDS+lC3I16U8pakKy1NCtRDkJIQ+JUsoCsov0AodN2ndxB9xBXb
 3j9kG5cPUksosKX2eGCc99vayYz+0IhIeyOenWpDEsvTtzAWHe7Z8jc9St6sIT18
 QRoJXg/6v1+/5GlQ5+naAuLpz96W+vOJqsxB59vIO3kJC7nPZNg=
 =6IIg
 -----END PGP SIGNATURE-----

Merge tag 'iwlwifi-next-for-kalle-2017-01-26' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

Some improvements, bugfixes and new features:
 * A bunch of cleanups here and there;
 * A few simple bugfixes;
 * Some more work in preparation for A000 family support;
 * Add support for radiotap timestamps;
 * Some work on our firmware debugging capabilities;
2017-01-27 13:23:48 +02:00
Sara Sharon 758c98e089 iwlwifi: mvm: cleanup redundant assignment
This set of station id is redundant - it is being initialised
above.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:39:02 +02:00
Sara Sharon cf90da352a iwlwifi: mvm: use mvm_disable_queue instead of sharing logic
When removing inactive queue - use the central disable queue
function. This is needed due to a000 changes to come, but is
a proper cleanup anyway.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:39:02 +02:00
Luca Coelho 758d1a8a8a iwlwifi: mvm: mark ret as maybe_unused in iwl_dbgfs_fw_restart_write()
The value returned from iwl_mvm_send_cmd_pdu() in this function is not
used and always returns an error (which is the whole point of the
call).  Tag the ret variable with __maybe_unused to avoid this compile
warning when W=1 is used:

/home/luca/iwlwifi/stack-dev/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c: In function ‘iwl_dbgfs_fw_restart_write’:
/home/luca/iwlwifi/stack-dev/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c:875:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
  int ret;
      ^

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:39:02 +02:00
Luca Coelho a43ae1de13 iwlwifi: dvm: remove unused variable compiler warning in debugfs.c
When compiling with W=1, we get the following warning in debugfs.c:

/home/luca/iwlwifi/stack-dev/drivers/net/wireless/intel/iwlwifi/dvm/debugfs.c: In function ‘iwl_dbgfs_fw_restart_write’:
/home/luca/iwlwifi/stack-dev/drivers/net/wireless/intel/iwlwifi/dvm/debugfs.c:2313:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
  int ret;
      ^

Fix it by ignoring the return value in this case.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:39:01 +02:00
Luca Coelho 18c44b271b iwlwifi: mvm: remove unused sta_id variable in iwl_mvm_change_queue_owner()
Remove the sta_id variable, to avoid this compile warning when
compiling with W=1:

/home/luca/iwlwifi/stack-dev/drivers/net/wireless/intel/iwlwifi/mvm/sta.c: In function ‘iwl_mvm_change_queue_owner’:
/home/luca/iwlwifi/stack-dev/drivers/net/wireless/intel/iwlwifi/mvm/sta.c:871:5: warning: variable ‘sta_id’ set but not used [-Wunused-but-set-variable]
  s8 sta_id;
     ^

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:39:01 +02:00
Sara Sharon 727c02dfb8 iwlwifi: pcie: cleanup rfkill checks
Move repeating code to a separate function.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:39:00 +02:00
Luca Coelho ad04e088d4 iwlwifi: dvm: make rs_tl_get_load() return void
The return value from this function is never used, so make it return
void to avoid getting the following warning when compiling wiht W=1:

/home/luca/iwlwifi/stack-dev/drivers/net/wireless/intel/iwlwifi/dvm/rs.c: In function ‘rs_tl_turn_on_agg_for_tid’:
/home/luca/iwlwifi/stack-dev/drivers/net/wireless/intel/iwlwifi/dvm/rs.c:400:6: warning: variable ‘load’ set but not used [-Wunused-but-set-variable]
  u32 load;
      ^

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:39:00 +02:00
Kirtika Ruchandani 3ce4a03852 iwlwifi: pcie: trans: Remove unused 'shift_param'
shift_param is defined and set in iwl_pcie_load_cpu_sections but not
used. Fix this to avoid -Wunused-but-set-variable warning.

The code using it turned into dead code with commit dcab8ecd56
("iwlwifi: mvm: support ucode load for family_8000 B0 only") which
added a separate function iwl_pcie_load_given_ucode_8000 (then 8000b)
for IWL_DEVICE_FAMILY_8000. Commit 76f8c0e17e ("iwlwifi: pcie:
remove dead code") removed the dead code but left shift_param as is.

iwlwifi/pcie/trans.c: In function ‘iwl_pcie_load_cpu_sections’:
iwlwifi/pcie/trans.c:871:6: warning: variable ‘shift_param’ set but not used [-Wunused-but-set-variable]

Fixes: dcab8ecd56 ("iwlwifi: mvm: support ucode load for family_8000 B0 only")
Fixes: 76f8c0e17e ("iwlwifi: pcie: remove dead code")
Signed-off-by: Kirtika Ruchandani <kirtika@google.com>
Cc: Sara Sharon <sara.sharon@intel.com>
Cc: Luca Coelho <luciano.coelho@intel.com>
Cc: Liad Kaufman <liad.kaufman@intel.com>
Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
[removed some unnecessary braces]
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:39:00 +02:00
Kirtika Ruchandani 9d50443575 iwlwifi: mvm: rs: Remove unused 'mcs' variable
Commit 5fc0f76c4 introduced Rx stats from debugfs, the function
iwl_mvm_reset_frame_stats from that commit defines and sets mcs but
does not use it. Compiling iwlwifi with W=1 gives this warning -

iwlwifi/mvm/rs.c: In function ‘iwl_mvm_update_frame_stats’:
iwlwifi/mvm/rs.c:3074:14: warning: variable ‘mcs’ set but not used [-Wunused-but-set-variable]

Fixes: 5fc0f76c43 (iwlwifi: mvm: add Rx frames statistics via debugfs)
Signed-off-by: Kirtika Ruchandani <kirtika@google.com>
Cc: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:38:59 +02:00
Kirtika Ruchandani c94aace003 iwlwifi: mvm: rs: Remove unused 'mvmvif'/'mvmsta' variables
mvmvif is defined and set in rs_mimo_allow but not used. Compiling
iwlwifi with W=1 gives the following warning, remove it. mvmsta is
used only to obtain mvmvif so remove it as well.

iwlwifi/mvm/rs.c: In function 'rs_mimo_allow':
iwlwifi/mvm/rs.c:165:22: warning: variable 'mvmvif' set but not used.[-Wunused-but-set-variable]

This fix removes calls to iwl_mvm_sta_from_mac &
iwl_mvm_vif_from_mac. They are both accessors, and do not have any
side-effects.  Commit e621c2282e ("iwlwifi: rs: Remove workaround
that disables MIMO on P2P") removed a workaround that disabled MIMO on
P2P, 'mvmvif' was used for that workaround, but not removed with it.

Fixes: e621c2282e ("iwlwifi: rs: Remove workaround that disables MIMO on P2P")
Signed-off-by: Kirtika Ruchandani <kirtika@google.com>
Cc: Alexander Bondar <alexander.bondar@intel.com>
Cc: Emmanuel Grumbach <emmmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:38:59 +02:00
Luca Coelho 7b1be5ad26 iwlwifi: mvm: remove unused variable in iwl_mvm_handle_statistics()
The temperature variable is set but not used in
iwl_mvm_handle_statistics().  Remove it to avoid the following
compiler warning when W=1 is used:

/home/luca/iwlwifi/stack-dev/drivers/net/wireless/intel/iwlwifi/mvm/rx.c: In function ‘iwl_mvm_handle_rx_statistics’:
/home/luca/iwlwifi/stack-dev/drivers/net/wireless/intel/iwlwifi/mvm/rx.c:759:6: warning: variable ‘temperature’ set but not used [-Wunused-but-set-variable]
  u32 temperature;
      ^

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:38:58 +02:00
Jürg Billeter d8320d75b5 iwlwifi: fix MODULE_FIRMWARE for 6030
IWL6000G2B_UCODE_API_MAX is not defined. ucode_api_max of
IWL_DEVICE_6030 uses IWL6000G2_UCODE_API_MAX. Use this also for
MODULE_FIRMWARE.

Fixes: 9d9b21d1b6 ("iwlwifi: remove IWL_*_UCODE_API_OK")
Signed-off-by: Jürg Billeter <j@bitron.ch>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:38:58 +02:00
Sara Sharon 34118c25a9 iwlwifi: mvm: support version 2 of stored beacon notification
For 9000 devices withg upload, FW cannot send the entire phy
flags, and will send only the band - which is what we really
care about anyway. Change is backward compatible.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:38:58 +02:00
Sara Sharon 5ec295dbbd iwlwifi: mvm: separate rate calculation to a new function
In preparation for the new TX cmd - move the rate calculation
to a diffrent function, and make it independent of the TX
command.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:38:57 +02:00
Sara Sharon b86dd74f8c iwlwifi: mvm: change iwl_mvm_tx_csum to return value
Currently the function changes the TX cmd itself.
Make it more generic by returning a value, as preperation
to the new TX cmd.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:38:57 +02:00
Sara Sharon eef187a7b8 iwlwifi: enlarge number of ucode sections
The maximum number of firmware sections is now 32 instead of 16 for
a000 devices. Set the appropriate define.  Avoid out of bounds access
in case there are more sections than the maximum set by driver.

Make the driver extensible to FW size changes by allocating the
section memory dynamically.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:38:57 +02:00
Sara Sharon 850fe9af62 iwlwifi: mvm: replace the number of blocks calculation
The logic in the paging calculations is a bit hard to
follow. Replace it with a kernel define.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:38:56 +02:00
Sara Sharon 08d785fd80 iwlwifi: mvm: simplify paging allocation code
Some of the code there is duplicate while the only change is
the block size. Unifying it shortens the code and make the
difference clearer.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:38:56 +02:00
Luca Coelho 5d81fbd5df iwlwifi: mvm: bump max API to 28
We skipped one release, so bump twice, to 28.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:38:55 +02:00
Johannes Berg c2e27e16f2 iwlwifi: mvm: properly check for transport data in dump
When copying from vmalloc'ed memory to the SG list, don't crash
if the transport didn't provide any data.

Fixes: 7e62a699aa ("iwlwifi: mvm: use dev_coredumpsg()")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:38:55 +02:00
Johannes Berg 5bdaa0ef77 iwlwifi: allow memory debug TLV to specify the memory type
Due to some new features and changes, the firmware file will now
specify what type of memory to dump, in upper 8 bits of the type
field of the TLV. Parse it (types we don't understand are errors)
and teach the code to dump periphery memory.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-26 09:38:27 +02:00
Johannes Berg 1110f8e37d iwlwifi: mvm: make iwl_dump_prph() void
The return value is never used, so make the function void.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-23 23:36:56 +02:00
Johannes Berg 2ed1e01910 iwlwifi: mvm: accept arbitrary memory dump TLVs
There's no reason to be validating the memory dump types, or
checking them for duplication, or anything, since we really
just pass them through from the TLV to the dump.

Thus, change the way we handle memory dump TLVs to let the
driver just blindly use anything specified there, dumping it
into the memory dump output file.

This makes the system extensible without driver changes.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-23 23:36:50 +02:00
Luca Coelho bac453ab37 iwlwifi: mvm: don't restart HW if suspend fails with unified image
For unified images, we shouldn't restart the HW if suspend fails.  The
only reason for restarting the HW with non-unified images is to go
back to the D0 image.

Fixes: 23ae61282b ("iwlwifi: mvm: Do not switch to D3 image on suspend")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-23 23:36:46 +02:00
Johannes Berg 371a17ed41 iwlwifi: mvm: expose device timestamp in radiotap
Set the relevant fields to export the 32-bit device timestamp to
radiotap using the new mac80211 infrastructure. This will be useful
to allow synchronising monitor captures taken on different hardware
simultaneously.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-23 23:36:38 +02:00
Larry Finger 106e0deca1 rtlwifi: rtl8192cu: Convert driver to use common macros
These drivers use a set of complicated macros to extract and insert
information for the RX and TX descriptors. Driver rtl8192cu had a
different set than was used for the PCI-based drivers. To simplify
the code, rtl8192cu is switched to use the common version. In the
process, two errors in those common macros were found and fixed.

Besides simplifying the code, there is an additional benefit. We have
no BE hardware to test the PCI driver, but using the common macros
provides an additional test for the validity of many endian-sensitive
operations.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-20 12:06:10 +02:00
Larry Finger 69d8597e9f rtlwifi: rtl8192cu: Calculate descriptor checksum correctly for BE
This driver requires a checksum for the descriptors so that the wifi
chip is assured that the USB transmission was correct. These entries
are little-endian, but the driver was always using cpu order in the
calculation. As a result, the driver failed on BE hardware.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-20 12:06:09 +02:00
Larry Finger 89d32c9071 rtlwifi: Download firmware as bytes rather than as dwords
The firmware is read from disk as a little-endian byte string. The code
that loads the firmware into the device transfers it as 4-byte quantities.
The routines that write multi-byte quantities on BE hardware assume that
the data are in CPU order, and automatically do the conversion to the LE
order required by the device. As a result, the firmware is transmitted
incorrectly. Rather than do multiple byte swaps on the data, the download
routine is revised to transmit bytes rather than dwords. Although the
number of I/O operations is increased, the firmware is not often loaded.

All drivers have the same bug, and use essentially the same code to
download firmware. These routines have been moved into rtlwifi.

Some CamelCase variables have been renamed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-20 12:06:09 +02:00
Larry Finger 9336d376ed rtlwifi: Remove debugging entry in sysfs
As the kernel provides access to module parameters through entries in
/sys/module/<driver>/parameters/, there is no need for a private
interface. Thus the existing code for setting the debug level is
removed.

Reported-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-20 12:05:17 +02:00
Larry Finger c34df318ec rtlwifi: Convert COMP_XX entries into a proper debugging mask
The debugging macros contain a parameter COMP_XX that could be used as a
mask; however, the code turns all these various bits on at the same time.
This change implements them as a proper mask, and adds module parameters
to set the mask at load time.

The current name "debug" for the debug level has been changed to
"debug_level" to better differentiate it from "debug_mask".

The debug routines have also been changed to interrogate the structure
that is loaded at entry time. As a result, the structure rtl_debug is no
longer needed, and all references to it are deleted.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-20 12:05:17 +02:00
Larry Finger 102e295ed5 rtlwifi: Redo debugging macros RTPRINT and RT_PRINT_DATA
These two debugging formss implement debugging using rather complicated
macro constructions. These are replaced with compiled code that is easier
to understand.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-20 12:05:16 +02:00
Rafał Miłecki e8cd47501f brcmfmac: rename brcmf_bus_start function to brcmf_bus_started
This intends to make init/attach process slightly easier to follow.

What driver was doing in brcmf_bus_start wasn't bus specific at all and
function brcmf_bus_stop wasn't undoing things done there. This function
is supposed to be called by bus specific code when the bus is ready.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-20 12:03:57 +02:00
Rafał Miłecki bfa7295e5b brcmfmac: drop brcmf_bus_detach and inline its code
Driver used to call brcmf_bus_detach only from one place and it already
contained a check for drvr not being NULL. We can get rid of this extra
function, call brcmf_bus_stop directly and simplify the code.
There also isn't brcmf_bus_attach function which one could expect so it
looks more consistent this way.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-20 12:03:56 +02:00
Rafał Miłecki f5611e0381 brcmfmac: move brcmf_c_set_joinpref_default declaration to common.h
Function brcmf_c_set_joinpref_default is in common.c, so move it to the
related header.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-20 12:03:56 +02:00
Rafał Miłecki c8d870794d brcmfmac: drop unneeded function declarations from headers
Functions brcmf_c_prec_enq and brcmf_sdio_init don't exist so we
really don't need their declarations. Function brcmf_parse_tlvs is used
in cfg80211.c only so make it static and drop from header as well.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-20 12:03:55 +02:00
Gavin Li 8e290cecdd brcmfmac: fix incorrect event channel deduction
brcmf_sdio_fromevntchan() was being called on the the data frame
rather than the software header, causing some frames to be
mischaracterized as on the event channel rather than the data channel.

This fixes a major performance regression (due to dropped packets). With
this patch the download speed jumped from 1Mbit/s back up to 40MBit/s due
to the sheer amount of packets being incorrectly processed.

Fixes: c56caa9db8 ("brcmfmac: screening firmware event packet")
Signed-off-by: Gavin Li <git@thegavinli.com>
Cc: <stable@vger.kernel.org> # 4.7+
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
[kvalo@codeaurora.org: improve commit logs based on email discussion]
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-20 12:02:28 +02:00
Jes Sorensen 1ee83789fc rtl8xxxu: Update author/maintainer contact info
Update copyright year and email address.

Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-20 11:49:01 +02:00
Axel Köllhofer 5407fd7de6 rtl8xxxu: Add additional USB IDs for rtl8192eu devices
These IDs originate from the vendor driver

Signed-off-by: Axel Köllhofer <AxelKoellhofer@web.de>
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-20 11:49:01 +02:00
Axel Köllhofer 66dfa26ebc rtl8xxxu: Add USB ID for D-Link DWA-131 rev E1 (rtl8192eu)
This was tested by David Patiño.

Reported-by: David Patiño <davidpatino82@gmail.com>
Signed-off-by: Axel Köllhofer <AxelKoellhofer@web.de>
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-20 11:49:01 +02:00
Jes Sorensen c14239f23a rtl8xxxu: Add another 8192eu device to the USB list
TP-Link TL-WN822N v4 (2357:0108)

Reported-by: Gregory Auzanneau <linux@reolight.net>
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-20 11:49:00 +02:00
Jes Sorensen d607e39656 rtl8xxxu: Mark 8192eu device 0x0bda:0x818b as tested
Device reported as working fine, so tell the driver not to warn about
it being untested.

Reported-by: Aex Aey <aexaey@gmail.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-20 11:49:00 +02:00