summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ar5523/ar5523.c
AgeCommit message (Collapse)Author
2019-12-17ar5523: check NULL before memcpy() in ar5523_cmd()Denis Efremov
commit 315cee426f87658a6799815845788fde965ddaad upstream. memcpy() call with "idata == NULL && ilen == 0" results in undefined behavior in ar5523_cmd(). For example, NULL is passed in callchain "ar5523_stat_work() -> ar5523_cmd_write() -> ar5523_cmd()". This patch adds ilen check before memcpy() call in ar5523_cmd() to prevent an undefined behavior. Cc: Pontus Fuchs <pontus.fuchs@gmail.com> Cc: Kalle Valo <kvalo@codeaurora.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: David Laight <David.Laight@ACULAB.COM> Cc: stable@vger.kernel.org Signed-off-by: Denis Efremov <efremov@linux.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-10ar5523: constify usb_device_idArvind Yadav
usb_device_id are not supposed to change at runtime. All functions working with usb_device_id provided by <linux/usb.h> work with const usb_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-06-16networking: make skb_push & __skb_push return void pointersJohannes Berg
It seems like a historic accident that these return unsigned char *, and in many places that means casts are required, more often than not. Make these functions return void * and remove all the casts across the tree, adding a (u8 *) cast only where the unsigned char pointer was used directly, all done with the following spatch: @@ expression SKB, LEN; typedef u8; identifier fn = { skb_push, __skb_push, skb_push_rcsum }; @@ - *(fn(SKB, LEN)) + *(u8 *)fn(SKB, LEN) @@ expression E, SKB, LEN; identifier fn = { skb_push, __skb_push, skb_push_rcsum }; type T; @@ - E = ((T *)(fn(SKB, LEN))) + E = fn(SKB, LEN) @@ expression SKB, LEN; identifier fn = { skb_push, __skb_push, skb_push_rcsum }; @@ - fn(SKB, LEN)[0] + *(u8 *)fn(SKB, LEN) Note that the last part there converts from push(...)[0] to the more idiomatic *(u8 *)push(...). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-03-06wireless: Set NL80211_EXT_FEATURE_CQM_RSSI_LIST in multiple driversAndrew Zaborowski
Set the NL80211_EXT_FEATURE_CQM_RSSI_LIST wiphy extended feature wholesale in all mac80211-based drivers that do not set the IEEE80211_VIF_BEACON_FILTER flags on their interfaces. mac80211 will be processing supplied RSSI values in ieee80211_rx_mgmt_beacon and will detect when the thresholds set by ieee80211_set_cqm_rssi_range_config are crossed. Remaining (few) drivers need code to enable the firmware to monitor the thresholds. This is mostly only compile-tested. Signed-off-by: Andrew Zaborowski <andrew.zaborowski@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-08-13net: wireless: ath: ar5523: ar5523: don't print error when allocating urb failsWolfram Sang
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-04-12cfg80211: remove enum ieee80211_bandJohannes Berg
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>
2015-06-10mac80211: convert HW flags to unsigned long bitmapJohannes Berg
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-04-24mac80211: remove support for IFF_PROMISCJohannes Berg
This support is essentially useless as typically networks are encrypted, frames will be filtered by hardware, and rate scaling will be done with the intended recipient in mind. For real monitoring of the network, the monitor mode support should be used instead. Removing it removes a lot of corner cases. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-03-13ar5523: use container_ofFlorian Westphal
If we want to shrink skb->cb then we'd have to see about reducing struct ieee80211_tx_info, which gets embedded inside skb->cb[]. It provides a scratch space to be used by wireless drivers. ar5523 uses the maximum space available today (40 bytes), but it seems we don't need this -- data->skb pointer seems to always point back to the skb whose cb buffer the data structure resides, iow, given a pointer to the embedded control buffer we can infer the skb address. Tested-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-04-09mac80211: add vif to flush callEmmanuel Grumbach
This will allow the low level driver to make decision based on the vif such as queues etc... Since the vif might be NULL, we can't add it to the tracing functions. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> [fix staging rtl8821ae driver] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-02-04ar5523: fix usb id for Gigaset.Oleksij Rempel
Raw id and FW id should be switched. Tested-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Cc: stable@vger.kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03wireless: delete non-required instances of include <linux/init.h>Paul Gortmaker
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Acked-by: Christian Lamparter <chunkeey@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-09-26ar5523: Add USB ID of D-Link WUA-2340 rev A1Albert Pool
Signed-off-by: Albert Pool <albertpool@solcon.nl> Reported-by: Michael Landrum <landrummd@gmail.com> Acked-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-03-25mac80211: Use a cfg80211_chan_def in ieee80211_hw_conf_chanKarl Beldan
Drivers that don't use chanctxes cannot perform VHT association because they still use a "backward compatibility" pair of {ieee80211_channel, nl80211_channel_type} in ieee80211_conf and ieee80211_local. Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com> [fix kernel-doc] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-03-18mac80211: pass queue bitmap to flush operationJohannes Berg
There are a number of situations in which mac80211 only really needs to flush queues for one virtual interface, and in fact during this frames might be transmitted on other virtual interfaces. Calculate and pass a queue bitmap to the driver so it knows which queues to flush. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-11-14ar5523: Don't dereference sta if NULLPontus Fuchs
A missing else caused a potential NULL dereference. Reported-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-11-14ar5523: Fix sparse endianness warningsPontus Fuchs
__be32 variables where used a little careless leading to sparse warnings. Treat them a little more gentle. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-11-14ar5523: use module_usb_driver to simplify the codeWei Yongjun
Use the module_usb_driver() macro to make the code simpler by eliminating module_init and module_exit calls. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-10-29ar5523: Add new driverPontus Fuchs
This driver is for the AR5523 chipset from Atheros. It was created in 2007 by Christoph Hellwig but it was never finished. I found it a couple of months ago and after some polishing it's working pretty fine. The driver was written with the FreeBSD driver (uath) as reference, which was written with the reverse-engineered windows driver as reference, hence the feature set is very limited. Station mode only, no HW crypto offload. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>