Commit graph

54 commits

Author SHA1 Message Date
Heinrich Schuchardt 9b648d788d rsi: eliminate superfluous NULL check
msg is dereferenced before checking against NULL, e.g.
when assigning pad_bytes.
Remove the superfluous check in function rsi_mgmt_pkt_to_core.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-06-14 17:17:58 +03:00
Johannes Berg 57fbcce37b cfg80211: remove enum ieee80211_band
This enum is already perfectly aliased to enum nl80211_band, and
the only reason for it is that we get IEEE80211_NUM_BANDS out of
it. There's no really good reason to not declare the number of
bands in nl80211 though, so do that and remove the cfg80211 one.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-04-12 15:56:15 +02:00
Markus Elfring 37190b2694 rsi: Move variable initialisation into error code
In rsi_send_data_pkt(), it's a little more logical to assign 'status' in
the actual error handling code as opposed to at the top of the functon.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
[Deleted controversial bits, rewrote commit message]
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-07 19:37:48 +03:00
Markus Elfring ab2ef1d68f rsi: Delete unnecessary variable initialisation
In rsi_send_data_pkt(), the following variables are assigned to
before they're used:

 * tmp_hdr - Assigned on line 47, first used on line 48
 * bss - Assigned on line 41, first used on line 44
 * extnd_size - Assigned on line 50, first used on line 52
 * seq_num - Assigned on line 48, first used on line 96

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
[Rewrote commit message]
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-07 19:37:47 +03:00
Markus Elfring 8b28310efe rsi: Delete unnecessary variable initialisation
In rsi_send_mgmt_pkt(), the following variables are assigned to
before they're used:

 * wh - Assigned on line 161, first used on line 180
 * bss - Assigned on line 160, first used on line 196
 * msg - Assigned on line 168, first used on line 175
 * extnd_size - Assigned on line 139, first used on line 142

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
[Rewrote commit message]
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-07 19:37:46 +03:00
Sara Sharon 50ea05efaf mac80211: pass block ack session timeout to to driver
Currently mac80211 does not inform the driver of the session
block ack timeout when starting a rx aggregation session.
Drivers that manage the reorder buffer need to know this
parameter.
Seeing that there are now too many arguments for the
drv_ampdu_action() function, wrap them inside a structure.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-01-14 11:13:17 +01:00
Nicholas Mc Guire d47762633f rsi: bool tests do not need comparison
This is an API consolidation only. Bool initializations should
use true and false thus bool tests don't need an explicit comparison.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-12-30 17:34:26 +02:00
Nicholas Mc Guire 97d14b623c rsi: consolidate kmalloc/memset 0 calls to kzalloc
This is an API consolidation only. The use of kmalloc + memset to 0
is equivalent to kzalloc.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-12-30 17:32:30 +02:00
Kalle Valo 941a967c98 rsi: add vendor Kconfig entry
Part of reorganising wireless drivers directory and Kconfig.

Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-11-18 14:28:31 +02:00
Emmanuel Grumbach e3abc8ff0f mac80211: allow to transmit A-MSDU within A-MPDU
Advertise the capability to send A-MSDU within A-MPDU
in the AddBA request sent by mac80211. Let the driver
know about the peer's capabilities.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-09-22 15:21:23 +02:00
Christian Engelmayer a8b9774571 rsi: Fix possible leak when loading firmware
Commit 5d5cd85ff4 ("rsi: Fix failure to load firmware after memory
leak fix and fix the leak") also added a check on the allocation of
DMA-accessible memory that may directly return. In that case the
already allocated firmware data is leaked. Make sure the data is
always freed correctly. Detected by Coverity CID 1316519.

Fixes: 5d5cd85ff4 ("rsi: Fix failure to load firmware after memory leak fix and fix the leak")
Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-08-25 15:37:41 +03:00
Mike Looijmans 5d5cd85ff4 rsi: Fix failure to load firmware after memory leak fix and fix the leak
Fixes commit eae79b4f3e ("rsi: fix memory leak in rsi_load_ta_instructions()")
which stopped the driver from functioning.

Firmware data has been allocated using vmalloc(), resulting in memory
that cannot be used for DMA. Hence the firmware was first copied to a
buffer allocated with kmalloc() in the original code. This patch reverts
the commit and only calls "kfree()" to release the buffer after sending
the data. This fixes the memory leak without breaking the driver.

Add a comment to the kmemdup() calls to explain why this is done, and abort
if memory allocation fails.

Tested on a Topic Miami-Florida board which contains the rsi SDIO chip.

Also added the same kfree() call to the USB glue driver. This was not
tested on actual hardware though, as I only have the SDIO version.

Fixes: eae79b4f3e ("rsi: fix memory leak in rsi_load_ta_instructions()")
Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Cc: stable@vger.kernel.org
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-07-31 09:22:44 +03:00
Johannes Berg 30686bf7f5 mac80211: convert HW flags to unsigned long bitmap
As we're running out of hardware capability flags pretty quickly,
convert them to use the regular test_bit() style unsigned long
bitmaps.

This introduces a number of helper functions/macros to set and to
test the bits, along with new debugfs code.

The occurrences of an explicit __clear_bit() are intentional, the
drivers were never supposed to change their supported bits on the
fly. We should investigate changing this to be a per-frame flag.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-06-10 16:05:36 +02:00
Alexey Khoroshilov eae79b4f3e rsi: fix memory leak in rsi_load_ta_instructions()
Memory allocated by kmemdup() in rsi_load_ta_instructions() is leaked.
But duplication of firmware data here is useless,
so the patch removes kmemdup() at all.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 17:26:08 +02:00
Alexey Khoroshilov 50591c60a9 rsi: fix memory leaks and error handling in rsi_91x_usb
The patch fixes a couple of issues:
- absence of deallocation of rsi_dev->rx_usb_urb[0] in the driver;
- potential NULL pointer dereference because of lack of checks for memory
  allocation success in rsi_init_usb_interface().

By the way, it makes rsi_probe() returning error code instead of 1
and fixes comments regarding returning values.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-01 14:26:26 -04:00
Alexey Khoroshilov 5bc5ca85d5 rsi: GFP_ATOMIC is not needed in rsi_init_usb_interface()
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-01 14:26:26 -04:00
Jahnavi Meher d51193d4ae rsi: Fixed warnings reported by static code analyzers.
Fixed a warning related to incorrect return type and removed an
unnecessary semi colon.

Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-25 15:40:41 -04:00
Jahnavi Meher 688df7ec26 rsi: Fixed errors and warnings reported by static code analyzers.
Fixed a potential buffer overflow in 'rsi_rates' and a sparse warning
related to difference in endianness in rsi_91x_mgmt.c.

Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-25 15:40:40 -04:00
Jahnavi Meher e8c58e7a5a rsi: Changes for 40MHz
Added code required for 40MHz.

Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:23 -04:00
Jahnavi Meher 686a254177 rsi: Adding support for host based bgscan.
Added support for host based bgscan. The h/w queues are blocked
while bgscan is being performed and after coming to the connected
channel, the queues are unblocked.

Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:23 -04:00
Jahnavi Meher 85af5bf829 rsi: Adding support for 5GHz
Adding support for 5GHz.

Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:23 -04:00
Jahnavi Meher 7b748dc0ed rsi: Sending QoS null packet via the mgmt queue.
Send the QoS null packet via mgmt queue.

Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:22 -04:00
Jahnavi Meher 258587f913 rsi: Added debug messages.
Added some debug messages.

Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:22 -04:00
Jahnavi Meher 360accb0db rsi: Changed the logic of dequeuing packets from hal queues.
The number of packets being dequeued from s/w queues was fixed -
changed it to a dynamic calculation based on txop. There are also
some fixes to the dequeuing algorithm.

Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:22 -04:00
Jahnavi Meher f75d3419ec rsi: Changed the SDIO interrupt variables and some clean up.
Changed the SDIO interrupt variables and some clean ups.

Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:22 -04:00
Jahnavi Meher 2bfa6969d9 rsi: Use SGI if configured for fixed rate transmission.
Use SGI if configured while sending data packets at a fixed rate.

Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:22 -04:00
Jahnavi Meher be876b299e rsi: Lower level debug messages and changed handling of confirm received for rsi_program_bb_rf().
Lower level debug messages for some frames and changed confirm
received for rsi_program_bb_rf() to a valid case.

Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:22 -04:00
Jahnavi Meher 0d59f5267d rsi: Changed rate handling.
Changed rate handling.

Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:22 -04:00
Jahnavi Meher 8701d03128 rsi: Changed the rsi_set_channel() and rsi_program_bb_rf().
Made required changes to rsi_set_channel() and rsi_program_bb_rf()
functions.

Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:21 -04:00
Jahnavi Meher 4550faac36 rsi: Changed the radio caps frame.
Changed the radio caps frame and added the required fields.

Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:21 -04:00
Jahnavi Meher f870a340f1 rsi: Add macros for endpoints and set default value of endpoint.
Added macros for the endpoints and set the default value of endpoint
to 2.4GHz and 20MHz.

Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:21 -04:00
Jahnavi Meher aabd3ad41a rsi: Using band from rsi_common to fill in ieee80211_rx_status
Filling in band from common->band.

Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:21 -04:00
Jahnavi Meher 19d2e619e7 rsi: Fixed the kernel doc
Changed the function header to match the function name.

Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:21 -04:00
Jahnavi Meher 51b4a86abd rsi: Mapping the debugfs stats to the correct s/w queues.
Changed the queue numbers to macros, and corrected the mappings.

Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:21 -04:00
Alexey Khoroshilov e860c33f7d rsi_91x_sdio: add error handling into rsi_module_init()
Fix rsi_module_init() to propagate sdio_register_driver() errors.

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:16 -04:00
Alexey Khoroshilov b101426aae rsi: Use module_usb_driver
module_usb_driver eliminates the boilerplate and makes the code simpler,
in addition to the fact currently rsi_module_init() ignores usb_deregister() error.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19 15:49:16 -04:00
Linus Torvalds f9da455b93 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller:

 1) Seccomp BPF filters can now be JIT'd, from Alexei Starovoitov.

 2) Multiqueue support in xen-netback and xen-netfront, from Andrew J
    Benniston.

 3) Allow tweaking of aggregation settings in cdc_ncm driver, from Bjørn
    Mork.

 4) BPF now has a "random" opcode, from Chema Gonzalez.

 5) Add more BPF documentation and improve test framework, from Daniel
    Borkmann.

 6) Support TCP fastopen over ipv6, from Daniel Lee.

 7) Add software TSO helper functions and use them to support software
    TSO in mvneta and mv643xx_eth drivers.  From Ezequiel Garcia.

 8) Support software TSO in fec driver too, from Nimrod Andy.

 9) Add Broadcom SYSTEMPORT driver, from Florian Fainelli.

10) Handle broadcasts more gracefully over macvlan when there are large
    numbers of interfaces configured, from Herbert Xu.

11) Allow more control over fwmark used for non-socket based responses,
    from Lorenzo Colitti.

12) Do TCP congestion window limiting based upon measurements, from Neal
    Cardwell.

13) Support busy polling in SCTP, from Neal Horman.

14) Allow RSS key to be configured via ethtool, from Venkata Duvvuru.

15) Bridge promisc mode handling improvements from Vlad Yasevich.

16) Don't use inetpeer entries to implement ID generation any more, it
    performs poorly, from Eric Dumazet.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1522 commits)
  rtnetlink: fix userspace API breakage for iproute2 < v3.9.0
  tcp: fixing TLP's FIN recovery
  net: fec: Add software TSO support
  net: fec: Add Scatter/gather support
  net: fec: Increase buffer descriptor entry number
  net: fec: Factorize feature setting
  net: fec: Enable IP header hardware checksum
  net: fec: Factorize the .xmit transmit function
  bridge: fix compile error when compiling without IPv6 support
  bridge: fix smatch warning / potential null pointer dereference
  via-rhine: fix full-duplex with autoneg disable
  bnx2x: Enlarge the dorq threshold for VFs
  bnx2x: Check for UNDI in uncommon branch
  bnx2x: Fix 1G-baseT link
  bnx2x: Fix link for KR with swapped polarity lane
  sctp: Fix sk_ack_backlog wrap-around problem
  net/core: Add VF link state control policy
  net/fsl: xgmac_mdio is dependent on OF_MDIO
  net/fsl: Make xgmac_mdio read error message useful
  net_sched: drr: warn when qdisc is not work conserving
  ...
2014-06-12 14:27:40 -07:00
Kees Cook d6755bd4fb rsi: avoid format string leak to thread name
Since the rsi_create_kthread interface does not include any format
string arguments, make sure that the resulting thread name can never
accidentally process the name as a format string.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-05-29 13:08:10 -04:00
Jahnavi Meher 5f407acbb7 rsi: Changed the return value to enable BA set-up
Signed-off-by: Jahnavi Meher <jahnavi.meher@redpinesignals.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-05-13 15:56:53 -04:00
Seungwon Jeon cdc991790c mmc: drop the speed mode of card's state
Timing mode identifier has same role and can take the place
of speed mode. This change removes all related speed mode.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:05:53 -04:00
Jahnavi Meher 48d11dc379 rsi: Changing opcode for sta mode according to changes in firmware
Signed-off-by: Jahnavi Meher <jahnavi.meher@redpinesignals.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-04-30 12:13:16 -04:00
Christian Engelmayer 61698b7e22 rsi: Fix a potential memory leak in rsi_send_auto_rate_request()
Fix a potential memory leak in the error path of function
rsi_send_auto_rate_request(). In case memory allocation for array
'selected_rates' fails, the error path exits and leaves the previously
allocated skb in place. Detected by Coverity: CID 1195575.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-04-14 14:31:42 -04:00
Christian Engelmayer 98ddcbe033 rsi: Fix a potential memory leak in rsi_set_channel()
Fix a potential memory leak in function rsi_set_channel() that is used to
program channel changes. The channel check block for the frequency bands
directly exits the function in case of an error, thus leaving an already
allocated skb unreferenced. Move the checks above allocating the skb.
Detected by Coverity: CID 1195576.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-04-14 14:31:41 -04:00
Geert Uytterhoeven af64dc7474 rsi: Add missing initialization of ii
drivers/net/wireless/rsi/rsi_91x_core.c: In function ‘rsi_core_determine_hal_queue’:
drivers/net/wireless/rsi/rsi_91x_core.c:91: warning: ‘ii’ may be used uninitialized in this function

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-04-14 14:31:41 -04:00
Fariya Fatima d453ba81cd rsi: Fixed issue relating to doing dma on stack error.
Signed-off-by: Fariya Fatima <fariyaf@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-04-09 13:55:54 -04:00
Fariya Fatima 5156fd24e9 rsi: Fixed issue relating to index of q_num.
Signed-off-by: Fariya Fatima <fariyaf@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-04-09 13:55:54 -04:00
Fariya Fatima d50c761aef rsi: Fixed issue relating to return value.
Signed-off-by: Fariya Fatima <fariyaf@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-04-09 13:55:54 -04:00
Fariya Fatima 57a2a093b4 rsi: Fixed issue relating to variable de-referenced before check 'adapter'
Signed-off-by: Fariya Fatima <fariyaf@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-04-09 13:55:53 -04:00
Fariya Fatima bff37af7f2 rsi: Fixed signedness bug reported by static code analyzer.
Signed-off-by: Fariya Fatima <fariyaf@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-04-09 13:55:53 -04:00
Fariya Fatima b25e77fdfa rsi: Potential null pointer derefernce issue fixed.
Signed-off-by: Fariya Fatima <fariyaf@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-04-09 13:55:53 -04:00