aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000 (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-07-02staging: wilc1000: remove obsolete TODO fileGreg Kroah-Hartman1-3/+0
The movement of wilc1000 out of staging left an obsolete TODO file. Remove that as it's no longer needed. Cc: Kalle Valo <kvalo@codeaurora.org> Cc: <Ajay.Kathat@microchip.com> Cc: <Venkateswara.Kaja@microchip.com> Cc: <Sripad.Balwadgi@microchip.com> Cc: <Nicolas.Ferre@microchip.com> Cc: <johannes@sipsolutions.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-26wilc1000: move wilc driver out of stagingAjay Singh18-10654/+0
WILC1000 is an IEEE 802.11 b/g/n IoT link controller module. The WILC1000 connects to Microchip AVR/SMART MCUs, SMART MPUs, and other processors with minimal resource requirements with a simple SPI/SDIO-to-Wi-Fi interface. WILC1000 driver has been part of staging for few years. With contributions from the community, it has improved significantly. Full driver review has helped in achieving the current state. The details for those reviews are captured in 1 & 2. [1]. https://lore.kernel.org/linux-wireless/1537957525-11467-1-git-send-email-ajay.kathat@microchip.com/ [2]. https://lore.kernel.org/linux-wireless/1562896697-8002-1-git-send-email-ajay.kathat@microchip.com/ Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-06-07Merge tag 'staging-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/stagingLinus Torvalds1-1/+3
Pull staging/IIO driver updates from Greg KH: "Here is the large set of staging and IIO driver changes for 5.8-rc1 Nothing major, but a lot of new IIO drivers are included in here, along with other core iio cleanups and changes. On the staging driver front, again, nothing noticable. No new deletions or additions, just a ton of tiny cleanups all over the tree done by a lot of different people. Most coding style, but many actual real fixes and cleanups that are nice to see. All of these have been in linux-next for a while with no reported issues" * tag 'staging-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (618 commits) staging: rtl8723bs: Use common packet header constants staging: sm750fb: Add names to proc_setBLANK args staging: most: usb: init return value in default path of switch/case expression staging: vchiq: Get rid of VCHIQ_SERVICE_OPENEND callback reason staging: vchiq: move vchiq_release_message() into vchiq staging: vchi: Get rid of C++ guards staging: vchi: Get rid of not implemented function declarations staging: vchi: Get rid of vchiq_status_to_vchi() staging: vchi: Get rid of vchi_service_set_option() staging: vchi: Merge vchi_msg_queue() into vchi_queue_kernel_message() staging: vchiq: Move copy callback handling into vchiq staging: vchi: Get rid of vchi_queue_user_message() staging: vchi: Get rid of vchi_service_destroy() staging: most: usb: use function sysfs_streq staging: most: usb: add missing put_device calls staging: most: usb: use correct error codes staging: most: usb: replace code to calculate array index staging: most: usb: don't use error path to exit function on success staging: most: usb: move allocation of URB out of critical section staging: most: usb: return 0 instead of variable ...
2020-05-05staging: wilc1000: Increase the size of wid_list arrayOscar Carter1-1/+3
Increase by one the size of wid_list array as index variable can reach a value of 5. If this happens, an out-of-bounds access is performed. Also, use a #define instead of a hard-coded literal for the new array size. Addresses-Coverity-ID: 1451981 ("Out-of-bounds access") Fixes: f5a3cb90b802d ("staging: wilc1000: add passive scan support") Acked-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Oscar Carter <oscar.carter@gmx.com> Link: https://lore.kernel.org/r/20200504150911.4470-1-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-29staging: wilc1000: adjust for management frame register API changesJohannes Berg4-41/+30
Adjust to the API changes in cfg80211 for management frame registration. Fixes: 6cd536fe62ef ("cfg80211: change internal management frame registration API") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200428101400.bac7e94c2bf8.I6a2287b9f68f35aff5f6de409c5ffa388de760e2@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-03-26staging: wilc1000: Use crc7 in lib/ rather than a private copyGeorge Spelvin2-58/+11
The code in lib/ is the desired polynomial, and even includes the 1-bit left shift in the table rather than needing to code it explicitly. While I'm in Kconfig, add a description of what a WILC1000 is. Kconfig questions that require me to look up a data sheet to find out that I probably don't have one are a pet peeve. Cc: Adham Abozaeid <adham.abozaeid@microchip.com> Cc: linux-wireless@vger.kernel.org Reviewed-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: George Spelvin <lkml@sdf.org> Link: https://lore.kernel.org/r/20200326152251.19094-1-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-26staging: wilc1000: remove label from examples in DT binding documentationAjay Singh1-3/+2
Remove labels and not relevant property from DT binding documentation examples as suggested in [1]. 1. https://patchwork.ozlabs.org/patch/1252837 Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200325164234.14146-1-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-17staging: wilc1000: rearrange line exceeding 80 charactersGokce Kuler1-2/+4
Moved to the bottom line after && operator for it exceeds 80 character Signed-off-by: Gokce Kuler <gokcekuler@gmail.com> Link: https://lore.kernel.org/r/20200316151009.GA7604@siyah2 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-17Staging: wilc1000: cfg80211: Use kmemdup instead of kmalloc and memcpyShreeya Patel1-2/+1
Replace calls to kmalloc followed by a memcpy with a direct call to kmemdup. The Coccinelle semantic patch used to make this change is as follows: @@ expression from,to,size,flag; statement S; @@ - to = \(kmalloc\|kzalloc\)(size,flag); + to = kmemdup(from,size,flag); if (to==NULL || ...) S - memcpy(to, from, size); Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Reviewed-by: Stefano Brivio <sbrivio@redhat.com> Link: https://lore.kernel.org/r/20200313112451.25610-1-shreeya.patel23498@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-12staging: wilc1000: updated DT binding documentationAjay Singh3-129/+72
Merged the DT binding documentation of SDIO and SPI into a single file. Removed documentation for some of the properties which are not required and handled review comments received in [1] & [2]. [1]. https://lore.kernel.org/linux-wireless/20200303020230.GA15543@bogus [2]. https://lore.kernel.org/linux-wireless/20200303015558.GA6876@bogus Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200307085523.7320-4-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-12staging: wilc1000: modified 'clock-names' and 'compatible' propertyAjay Singh2-3/+3
Modified the 'clock-names' property by removing '_clk' from its name and remove '_spi/sdio' from 'compatible' string. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200307085523.7320-3-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-12staging: wilc1000: use 'interrupts' property instead of 'irq-gpio'Ajay Singh5-51/+21
Make use of 'interrupts' property instead of using gpio for handling the interrupt as suggested in [1]. [1]. https://lore.kernel.org/linux-wireless/20200303015558.GA6876@bogus Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200307085523.7320-2-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-10staging: wilc1000: spi: Use new structure for SPI transfer delaysSergiu Cuciurean1-3/+12
In a recent change to the SPI subsystem in commit <bebcfd272df6> ("spi: introduce `delay` field for `spi_transfer` + spi_transfer_delay_exec()"), a new `delay` struct was added to replace the `delay_usecs`. This change replaces the current `delay_usecs` with `delay` for this driver. The `spi_transfer_delay_exec()` function [in the SPI framework] makes sure that both `delay_usecs` & `delay` are used (in this order to preserve backwards compatibility). Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com> Link: https://lore.kernel.org/r/20200304074319.22107-1-sergiu.cuciurean@analog.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-04staging: wilc1000: use flexible-array member instead of zero-length arrayAjay Singh1-5/+5
Use flexible-array member introduced in C99 instead of zero-length array. Most of zero-length array was already taken care in previous patch [1]. Now modified few more cases which were not handled earlier. [1]. https://patchwork.kernel.org/patch/11394197/ Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200302162226.4196-4-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-04staging: wilc1000: remove unnecessary always true 'if' conditionsAjay Singh2-18/+14
Remove the unnecessary always true 'if' conditions and simiplifed the logic as suggested in [1]. [1]. https://lore.kernel.org/linux-wireless/20200302092346.GA24308@kadam/ Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200302162226.4196-3-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-04staging: wilc1000: use correct data for memcpy in wilc_hif_pack_sta_param()Ajay Singh1-1/+1
Use correct data for memcpy in wilc_hif_pack_sta_param(). Its reported by Smatch static code analyser tool as discussed in [1]. [1]. https://lore.kernel.org/linux-wireless/20200302092346.GA24308@kadam/ Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200302162226.4196-2-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-23staging: wilc1000: use YAML schemas for DT binding documentationAjay Singh4-72/+129
Use YAML schemas for wilc1000 DT binding documentations. Currently, the files are present in '/drivers/staging/wilc1000/' but these will be moved to '/Documentation/devicetree/bindings/net/wireless/' later once the driver move out-of-staging. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200221123817.16643-1-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-23staging: wilc1000: avoid double unlocking of 'wilc->hif_cs' mutexAjay Singh1-1/+0
Possible double unlocking of 'wilc->hif_cs' mutex was identified by smatch [1]. Removed the extra call to release_bus() in wilc_wlan_handle_txq() which was missed in earlier commit fdc2ac1aafc6 ("staging: wilc1000: support suspend/resume functionality"). [1]. https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org/thread/NOEVW7C3GV74EWXJO3XX6VT2NKVB2HMT/ Reported-by: kbuild test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200221170120.15739-1-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-23staging: Replace zero-length array with flexible-array memberGustavo A. R. Silva2-6/+6
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Link: https://lore.kernel.org/r/20200220132908.GA30501@embeddedor Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14staging: wilc1000: define macros to replace magic number valuesAjay Singh4-43/+99
Define macros for global as well as SPI/SDIO specific register to avoid use of magic numbers. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200214172250.13026-9-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14staging: wilc1000: use short name for hif local variable in chip_wakeup()Ajay Singh1-19/+16
Make use of a shorter name for 'hif' variable to avoid possible 80 character checkpatch warning while the replacing hardcoded value with macros in chip_wakeup(). Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200214172250.13026-8-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14staging: wilc1000: define macros for different register address for SDIOAjay Singh2-37/+76
Instead of using hardcoded value for SDIO register address added the macro for them. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200214172250.13026-7-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14staging: wilc1000: use commmon function to set SDIO block sizeAjay Singh1-40/+11
Use common function wilc_sdio_set_block_size() to set the block size for SDIO. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200214172250.13026-6-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14staging: wilc1000: make use of ALIGN macroAjay Singh2-35/+3
Make use of 'ALIGN' macro to align the size data value. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200214172250.13026-5-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14staging: wilc1000: refactor interrupt handling for sdioAjay Singh3-66/+39
Make use of FIELD_PREP/FIELD_GET macro to refactor the interrupt handling for SDIO. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200214172250.13026-4-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14staging: wilc1000: remove use of MAX_NUN_INT_THRPT_ENH2 macroAjay Singh2-18/+4
Make use of MAX_NUM_INT existing macro to handle the maximum supported interrupts count and removed MAX_NUN_INT_THRPT_ENH2 macro. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200214172250.13026-3-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-14staging: wilc1000: make use of FIELD_GET/_PREP macroAjay Singh6-21/+39
Simplified the code by making use of FIELD_GET/_PREP bitfield macro. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200214172250.13026-2-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-12staging: wilc1000: refactor p2p action frames handling API'sAjay Singh1-172/+128
Refactor handling of P2P specific action frames. Make use of 'struct' to handle the P2P frames instead of manipulating using 'buf' pointer. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200212154503.8835-1-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-11staging: wilc1000: directly fetch 'priv' handler from 'vif' instanceAjay Singh1-2/+1
The 'priv' handler is already present in 'vif' struct so directly fetch its value from vif handler in wilc_handle_roc_expired(). Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200211152802.6096-2-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-11staging: wilc1000: remove use of vendor specific IE for p2p handlingAjay Singh3-77/+4
Remove the use of vendor specific IE parameter to decide p2p_GO/p2p_Client roles between two 'wilc' device. Previously p2p group formation between two 'wilc' device make use of vendor IE for roles decision. The role is decided based on the 'go_intent' value. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200211152802.6096-1-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-09staging: wilc1000: refactor SPI read/write commands handling API'sAjay Singh1-380/+374
Refactor SPI commands handling by making use of 'struct' for data exchange and extraction of information flow between host and firmware. The SPI read/write commands are now handled in separate function instead of using a single function to process all types of command. The use of 'struct' helped to make the code self explanatory. These points were discussed and suggested during code review [1]. 1. https://www.spinics.net/lists/linux-wireless/msg191489.html Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200203160848.4052-1-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-23staging: wilc1000: avoid mutex unlock without lock in wilc_wlan_handle_txq()Ajay Singh3-6/+12
In wilc_wlan_handle_txq(), mutex unlock was called without acquiring it. Also error code for full VMM condition was incorrect as discussed in [1]. Now used a proper code to indicate VMM is full, for which transfer to VMM is required again. 'wilc_wlan_handle_txq()' should be called again if the VMM space was full earlier or otherwise based on 'txq_event' signal. 1. https://lore.kernel.org/driverdev-devel/20191113183322.a54mh2w6dulklgsd@kili.mountain/ Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200123182129.4053-2-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-23staging: wilc1000: return zero on success and non-zero on function failureAjay Singh4-239/+197
Some of the HIF layer API's return zero for failure and non-zero for success condition. Now, modified the functions to return zero for success and non-zero for failure as its recommended approach suggested in [1]. 1. https://lore.kernel.org/driverdev-devel/20191113183322.a54mh2w6dulklgsd@kili.mountain/ Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200123182129.4053-1-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-22staging: wilc1000: remove unused code prior to throughput enhancement in SPIAjay Singh1-139/+4
The firmware now uses throughput enhancement code by default for SPI so remove the previous implementation as its not used anymore. Removed the use of 'has_thrpt_enh' element as its always true. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200117160157.8706-5-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-22staging: wilc1000: added 'wilc_' prefix for 'struct assoc_resp' nameAjay Singh2-2/+2
Use 'wilc_' prefix for 'assoc_resp' struct to have proper naming convention. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200117160157.8706-4-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-22staging: wilc1000: move firmware API struct's to separate header fileAjay Singh5-108/+120
It's recommended to keep the 'struct' used for passing data to firmware in separate header file. So added 'fw.h' header file to keep struct's used to pass data to firmware. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200117160157.8706-3-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-22staging: wilc1000: remove use of infinite loop conditionsAjay Singh3-146/+84
Avoid the use of 'while (1)' infinite loop conditions. It's not recommended to have infinite loop in kernel code because a small bug can cause never ending loops so use terminator condition as suggested in full driver review [1]. [1]. https://lore.kernel.org/linux-wireless/20191023100313.52B3F606CF@smtp.codeaurora.org/ Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20200117160157.8706-2-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-15staging: wilc1000: remove redundant assignment to variable resultColin Ian King1-2/+2
The variable result is being initialized with a value that is never read and is being re-assigned later on. The assignment is redundant and hence can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20200114172720.376286-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-10staging: wilc1000: use GENMASK to extract wid typeAjay Singh2-4/+5
Refactor code by make use of 'GENMASK' to extract the WID type from buffer received from firmware. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20191122205153.30723-4-adham.abozaeid@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-10staging: wilc1000: use kernel provided struct cast to extract mac headerAjay Singh1-6/+3
To parse the mac header make use of *struct ieee80211_hdr* instead of extracting individual fields separately using pointer operation. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20191122205153.30723-3-adham.abozaeid@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-10staging: wilc1000: remove unused compile time featurizationAjay Singh1-23/+0
Removed the unused compile type featurization. It's not recommended to have compile type feature. Currently removing these defines as they are not used. If any of these parameters are needed later should be added using run time feature. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20191122205153.30723-2-adham.abozaeid@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-11staging: wilc1000: fix illegal memory access in wilc_parse_join_bss_param()Ajay Singh1-10/+15
Do not copy the extended supported rates in 'param->supp_rates' if the array is already full with basic rates values. The array size check helped to avoid possible illegal memory access [1] while copying to 'param->supp_rates' array. 1. https://marc.info/?l=linux-next&m=157301720517456&w=2 Reported-by: coverity-bot <keescook+coverity-bot@chromium.org> Addresses-Coverity-ID: 1487400 ("Memory - illegal accesses") Fixes: 4e0b0f42c9c7 ("staging: wilc1000: use struct to pack join parameters for FW") Cc: stable@vger.kernel.org Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20191106062127.3165-1-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-05staging: wilc1000: use defines for msg types received from firmwareAjay Singh1-11/+9
Added defines for different types of messages received from firmware. Removed the unnecessary comments because after the addition of macros the message types are self-explanatory. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20191105095058.24223-7-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-05staging: wilc1000: added proper spacing for commentsAjay Singh5-12/+21
Added proper space for the comments and added newline before the comments inside a struct. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20191105095058.24223-6-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-05staging: wilc1000: avoid use of C++ style commentsAjay Singh1-1/+1
Replace C++ style comment with C style. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20191105095058.24223-5-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-05staging: wilc1000: added 'WILC_' prefix in header guard macroAjay Singh3-6/+6
Use 'WILC_' prefix in header guard to follow the proper naming convention for macro name. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20191105095058.24223-4-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-05staging: wilc1000: remove 'wilc_' prefix from filenamesAjay Singh15-24/+24
Remove 'wilc_' prefix from filenames, the driver is already present inside the 'wilc1000' directory so no need to add 'wilc_' in filenames. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20191105095058.24223-3-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-05staging: wilc1000: avoid 'bool' datatype in struct sent to firmwareAjay Singh1-2/+4
Use 'u8' instead of 'bool' datatype for struct element sent to firmware because storage of bool datatype is not guaranteed. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20191105095058.24223-2-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-29staging: wilc1000: check if device is initialzied before changing vifAdham Abozaeid1-6/+12
When killing hostapd, the interface is closed which deinitializes the device, then change virtual interface is called. This change checks if the device is initialized before sending the interface change command to the device Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com> Link: https://lore.kernel.org/r/20191028184019.31194-1-adham.abozaeid@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-24staging: wilc1000: handle mgmt frames for both interfaces during concurrent modeAjay Singh2-8/+5
During concurrent mode(AP/STA + P2P), pass the mgmt frames received from firmware to appropriate interface. Iterate the complete interface list to pass frames on the interface which has registered to receive mgmt frame. Added extra time for 'remain_on_ch' timer to ensure that timeout for uncanceled remain_on_channel is not triggered & 'p2p_listen_state' is not cleared before passing the mgmt frames to p2p interface. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Link: https://lore.kernel.org/r/20191018124511.22751-1-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>