summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-05-03iio: adc: mpc3422: Use get_unaligned_beXX()Andy Shevchenko
This makes the driver code slightly easier to read. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: adc: ad_sigma_delta: Use {get,put}_unaligned_be24()Andy Shevchenko
This makes the driver code slightly easier to read. Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Michael Hennerich <Michael.Hennerich@analog.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: Use an early return in iio_device_alloc to simplify code.Jonathan Cameron
Noticed whilst reviewing Alexandru's patch to the same function. If we simply flip the logic and return NULL immediately after memory allocation failure we reduce the indent of the following block and end up with more 'idiomatic' kernel code. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
2020-05-03iio: chemical: Add OF match table for CCS811 VOC sensorManivannan Sadhasivam
Add devicetree OF match table support for CCS811 VOC sensor. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: chemical: Add support for external Reset and Wakeup in CCS811Manivannan Sadhasivam
CCS811 VOC sensor exposes nRESET and nWAKE pins which can be connected to GPIO pins of the host controller. These pins can be used to externally release the device from reset and also to wake it up before any I2C transaction. The initial driver support assumed that the nRESET pin is not connected and the nWAKE pin is tied to ground. This commit improves it by adding support for controlling those two pins externally using a host controller. For the case of reset, if the hardware reset is not available, the mechanism to do software reset is also added. As a side effect of doing this, the IIO device allocation needs to be slightly moved to top of probe to make use of priv data early. Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03dt-bindings: iio: chemical: Add binding for CCS811 VOC sensorManivannan Sadhasivam
This commit adds devicetree binding for AMS CCS811 VOC sensor. Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03dt-bindings: iio: Add adis16475 documentationNuno Sá
Document the ADIS16475 device devicetree bindings Signed-off-by: Nuno Sá <nuno.sa@analog.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: imu: Add support for adis16475Nuno Sá
Support ADIS16475 and similar IMU devices. These devices are a precision, miniature MEMS inertial measurement unit (IMU) that includes a triaxial gyroscope and a triaxial accelerometer. Each inertial sensor combines with signal conditioning that optimizes dynamic performance. The driver adds support for the following devices: * adis16470, adis16475, adis16477, adis16465, adis16467, adis16500, adis16505, adis16507. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-25iio: adis: Support different burst sizesNuno Sá
Add burst_max_len to `adis_burst`. This is useful for devices which support different burst modes with different sizes. The buffer to be used in the spi transfer is allocated with this variable making sure that has space for all burst modes. The spi transfer length should hold the "real" burst length depending on the current burst mode configured in the device. Moreover, `extra_len` in `adis_burst` is made const and it should contain the smallest extra length necessary for a burst transfer. In `struct adis` was added a new `burst_extra_len` that should hold the extra bytes needed depending on the device instance being used. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-25iio: adis: Add adis_update_bits() APIsNuno Sá
This patch adds a `regmap_update_bits()` like API to the ADIS library. It provides locked and unlocked variant. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-25iio: imu: adis: Add irq flag variableNuno Sá
There are some ADIS devices that can configure the data ready pin polarity. Hence, we cannot hardcode our IRQ mask as IRQF_TRIGGER_RISING since we might want to have it as IRQF_TRIGGER_FALLING. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-25iio: imu: adis: Add Managed device functionsNuno Sá
This patch adds support for a managed device version of adis_setup_buffer_and_trigger. It works exactly as the original one but it calls all the devm_iio_* functions to setup an iio buffer and trigger. Hence we do not need to care about cleaning those and we do not need to support a remove() callback for every driver using the adis library. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-25iio: at91-sama5d2_adc: adjust iio_triggered_buffer_{predisable,postenable} ↵Alexandru Ardelean
positions The iio_triggered_buffer_{predisable,postenable} functions attach/detach poll functions. In most cases the iio_triggered_buffer_postenable() should be called first to attach the poll function, and then the driver can init the data to be triggered. In this case it's the other way around: the DMA code should be initialized before the attaching the poll function and the reverse should be done when un-initializing. To make things easier when removing the iio_triggered_buffer_postenable() & iio_triggered_buffer_predisable() functions from the IIO core API, the DMA code has been moved into preenable() for init, and postdisable() for uninit. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Reviewed-by: Ludovic Desroches <ludovic.desroches@microchip.com> Reviewed-by: Eugen Hristev <eugen.hristev@microchip.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-25iio: at91-sama5d2_adc: split at91_adc_current_chan_is_touch() helperAlexandru Ardelean
This change moves the logic to check if the current channel is the touchscreen channel to a separate helper. This reduces some code duplication, but the main intent is to re-use this in the next patches. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Reviewed-by: Eugen Hristev <eugen.hristev@microchip.com> Reviewed-by: Ludovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-25iio: adc: at91-sama5d2_adc: update for other trigger usageEugen Hristev
This change will allow the at91-sama5d2_adc driver to use other triggers than it's own. In particular, tested with the sysfs trigger. To be able to achieve this functionality, some changes were required: 1) Do not enable/disable channels when enabling/disabling the trigger. This is because the trigger is enabled/disabled only for our trigger (obviously). We need channels enabled/disabled regardless of what trigger is being used. 2) Cope with DMA : DMA cannot be used when using another type of trigger. Other triggers work through pollfunc, so we get polled anyway on every trigger. Thus we have to obtain data at every trigger. 3) When to start conversion? The usual pollfunc (store time from subsystem) would be in hard irq and this would be a good way, but current iio subsystem recommends to have it in the threaded irq. Thus adding software start code in this handler. 4) Buffer config: we need to setup buffer regardless of our own device's trigger. We may get one attached later. 5) IRQ handling: we use our own device IRQ only if it's our own trigger and we do not use DMA . If we use DMA, we use the DMA controller's IRQ. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-25iio: adc: at91-sama5d2_adc: handle unfinished conversionsEugen Hristev
It can happen that on IRQ trigger, not all conversions are done if we are enabling multiple channels. The IRQ is triggered on first EOC (end of channel), but it can happen that not all channels are done. This leads into erroneous reports to userspace (zero values or previous values). To solve this, in trigger handler, check if the mask of done channels is the same as the mask of active scan channels. If it's the same, proceed and push to buffers. Otherwise, use usleep to sleep until the conversion is done or we timeout. Normally, it should happen that in a short time fashion, all channels are ready, since the first IRQ triggered. If a hardware fault happens (for example the clock suddently dissappears), the handler will not be completed, in which case we do not report anything to userspace anymore. Also, change from using the EOC interrupts to DRDY interrupt. This helps with the fact that not 'n' interrupt statuses are enabled, each being able to trigger an interrupt, and instead only data ready interrupt can wake up the CPU. Like this, when data is ready, check in handler which and how many channels are done. While the DRDY is raised, other IRQs cannot occur. Once the channel data is being read, we ack the IRQ and finish the conversion. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-25iio: light: vl6180: add include of mod_devicetable.h and drop of_match_ptrJonathan Cameron
Enables probing via ACPI PRP0001 route and removes an example of an approach we no longer want people to copy. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
2020-04-25iio: light: st_uvis25: Add mod_devicetable.h and drop of_match_ptrJonathan Cameron
Enables probing via ACPI PRP0001 and removes an example that we don't want people to cut and paste into new drivers. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
2020-04-25iio: light: opt3001: Add mod_devicetable.h and drop use of of_match_ptrJonathan Cameron
Enables probing via ACPI PRP0001 but mostly about removing examples that might be copied to new drivers. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
2020-04-25iio: light: gp2ap020a00f: Swap of.h for mod_devicetable.h + drop of_match_ptrJonathan Cameron
Also drops ifdef protections for CONFIG_OF. Enables probing via ACPI PRP0001 and removes an example that might be cut and paste into new drivers. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
2020-04-25iio: light: cm3232: Add mod_devicetable.h include and drop of_match_ptrJonathan Cameron
Enables ACPI probing via PRP0001 and removes an example that might be cut and paste to a new driver. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
2020-04-25iio: light: cm32181: Add mod_devicetable.h and remove of_match_ptrJonathan Cameron
Enables probing via the ACPI PRP0001 route but more is mosty about removing examples of this that might get copied into new drivers. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
2020-04-25iio: light: bh1780: use mod_devicetable.h and drop of_match_ptr macroJonathan Cameron
Whilst this enables ACPI binding or the device via PRP0001 the primary aim is to remove potential for these two things to be cut and paste into new drivers. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
2020-04-25iio: accel: kxsd9-i2c: Use mod_devicetable.h and drop of_match_ptr macroNishant Malpani
Enables ACPI DSDT to probe via PRP0001 and the compatible property. Also removes the ifdef protections for CONFIG_OF. Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-25iio: accel: dmard06: Use mod_devicetable.h and drop of_match_ptr macroNishant Malpani
Enables ACPI DSDT to probe via PRP0001 and the compatible property. Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-25iio: chemical: atlas-sensor: add RTD-SM module supportMatt Ranostay
Atlas Scientific RTD-SM OEM sensor reads temperature using resistance temperature detector technology. Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-25dt-bindings: iio: chemical: add Atlas Scientific RTD-SM sensor docsMatt Ranostay
Cc: devicetree@vger.kernel.org Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-23staging: vt6656: Use fls instead of for loop in vnt_update_top_ratesOscar Carter
Replace the for loops of the vnt_update_top_rates function by the fls function. The purpose of the two for loops is to find the most significant bit set in a range of bits. So, they can be replace by the fls function (find last set) with a previous mask to define the range. This way avoid the iteration over unnecessary for loops. The header "linux/bits.h" can be remove as it is included in the header "linux/bitops.h". Signed-off-by: Oscar Carter <oscar.carter@gmx.com> Link: https://lore.kernel.org/r/20200420155246.4925-1-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: vt6656: Refactor the vnt_ofdm_min_rate functionOscar Carter
Replace the for loop by a ternary operator whose condition is an AND bitmask against the priv->basic_rates variable. The purpose of the for loop was to check if any of bits from RATE_54M to RATE_6M was set, but it's not necessary to check every individual bit. The same result can be achieved using only one single mask which comprises all the commented bits. This way avoid the iteration over an unnecessary for loop. Also change the return type to bool because it's the type that this function returns. Signed-off-by: Oscar Carter <oscar.carter@gmx.com> Link: https://lore.kernel.org/r/20200418134553.6415-1-oscar.carter@gmx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: gasket: Fix mapping refcnt leak when register/store failsXiyu Yang
gasket_sysfs_register_store() invokes get_mapping(), which returns a reference of the specified gasket_sysfs_mapping object to "mapping" with increased refcnt. When gasket_sysfs_register_store() returns, local variable "mapping" becomes invalid, so the refcount should be decreased to keep refcount balanced. The reference counting issue happens in one exception handling path of gasket_sysfs_register_store(). When gasket_dev is NULL, the function forgets to decrease the refcnt increased by get_mapping(), causing a refcnt leak. Fix this issue by calling put_mapping() when gasket_dev is NULL. Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com> Link: https://lore.kernel.org/r/1587618941-13718-1-git-send-email-xiyuyang19@fudan.edu.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: gasket: Fix mapping refcnt leak when put attribute failsXiyu Yang
gasket_sysfs_put_attr() invokes get_mapping(), which returns a reference of the specified gasket_sysfs_mapping object to "mapping" with increased refcnt. When gasket_sysfs_put_attr() returns, local variable "mapping" becomes invalid, so the refcount should be decreased to keep refcount balanced. The reference counting issue happens in one path of gasket_sysfs_put_attr(). When mapping attribute is unknown, the function forgets to decrease the refcnt increased by get_mapping(), causing a refcnt leak. Fix this issue by calling put_mapping() when put attribute fails due to unknown attribute. Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com> Link: https://lore.kernel.org/r/1587618895-13660-1-git-send-email-xiyuyang19@fudan.edu.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: mt7621-pinctrl: Use correct pointer type argument for sizeofJason Yan
Fix the following coccicheck warning: drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c:223:14-36: WARNING: Use correct pointer type argument for sizeof Signed-off-by: Jason Yan <yanaijie@huawei.com> Link: https://lore.kernel.org/r/20200420133416.3087-1-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: qlge: replace deprecated apis pci_dma_*realwakka
Replace legacy/depreacted pci_dma_* functions to new dma_* functions. Also replace PCI_DMA_* macro to DMA* macro. Signed-off-by: realwakka <realwakka@gmail.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20200420154009.21161-1-realwakka@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: qlge: cleanup indent in qlge_main.cMathieu Dolmen
Cleanup indentation style in qlge_main.c. Fix 2 warnings found by checkpatch.pl. Signed-off-by: Mathieu Dolmen <mathieu.dolmen@gmail.com> Link: https://lore.kernel.org/r/20200419125712.27506-1-mathieu.dolmen@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: vt6656: Move vnt_get_frame_time and vnt_get_phy_field to rxtxMalcolm Priestley
These functions are only used by rxtx so move them and their arrays used with them abbreviating the function description. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Link: https://lore.kernel.org/r/2a4fd665-2fe1-f1ad-1e9a-1b01f698ea79@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: vt6656: call vnt_update_pre_ed_threshold from vnt_config.Malcolm Priestley
vnt_update_pre_ed_threshold needs to be updated more often so call from vnt_config where it updated on any of config changes. It must have maximum sensitivity when the device is off channel or idle. Remove all the other calls in scanning and bss. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Link: https://lore.kernel.org/r/1b00c112-347c-b0bb-61ed-a874ee448ff8@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: vt6656: Move firmware functions into main_usb.Malcolm Priestley
The firmware function are not that complicated so move them into main_usb as static functions in callers visibility Firmware definitions moved to device.h and MODULE_FIRMWARE move to below module_usb_driver. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Link: https://lore.kernel.org/r/7b384871-826b-9365-e3ed-5717ecefd31c@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23Staging: rtl8723bs: rtw_wlan_util: Add size check of SSID IEDenis Straghkov
Add size check of SSID information element in incoming 802.11 frames, to prevent memcpy() of IE in array bssid->Ssid.Ssid, with size more than 32 bytes. Signed-off-by: Denis Straghkov <d.straghkov@ispras.ru> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20200421212525.24962-1-d.straghkov@ispras.ru Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: rtl8723bs: remove unused variable 'pregistrypriv'YueHaibing
drivers/staging/rtl8723bs/hal/sdio_halinit.c: In function HalRxAggr8723BSdio: drivers/staging/rtl8723bs/hal/sdio_halinit.c:547:24: warning: variable pregistrypriv set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20200421024145.43576-1-yuehaibing@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: rtl8723bs: remove defined but not used 'dB_Invert_Table'Jason Yan
Fix the following gcc warning: drivers/staging/rtl8723bs/hal/odm.c:10:18: warning: ‘dB_Invert_Table’ defined but not used [-Wunused-const-variable=] static const u16 dB_Invert_Table[8][12] = { ^~~~~~~~~~~~~~~ Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Jason Yan <yanaijie@huawei.com> Link: https://lore.kernel.org/r/20200417073439.41888-1-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: rtl8723bs: remove some variables in hal_btcoex.cJason Yan
Fix the following gcc warning: drivers/staging/rtl8723bs/hal/hal_btcoex.c:45:26: warning: ‘ioStaString’ defined but not used [-Wunused-const-variable=] static const char *const ioStaString[] = { ^~~~~~~~~~~ drivers/staging/rtl8723bs/hal/hal_btcoex.c:38:26: warning: ‘h2cStaString’ defined but not used [-Wunused-const-variable=] static const char *const h2cStaString[] = { ^~~~~~~~~~~~ drivers/staging/rtl8723bs/hal/hal_btcoex.c:33:26: warning: ‘BtLinkRoleString’ defined but not used [-Wunused-const-variable=] static const char *const BtLinkRoleString[] = { ^~~~~~~~~~~~~~~~ drivers/staging/rtl8723bs/hal/hal_btcoex.c:23:26: warning: ‘BtSpecString’ defined but not used [-Wunused-const-variable=] static const char *const BtSpecString[] = { ^~~~~~~~~~~~ drivers/staging/rtl8723bs/hal/hal_btcoex.c:15:26: warning: ‘BtProfileString’ defined but not used [-Wunused-const-variable=] static const char *const BtProfileString[] = { ^~~~~~~~~~~~~~~ Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Jason Yan <yanaijie@huawei.com> Link: https://lore.kernel.org/r/20200417073310.40893-1-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: wfx: drop unused attribute 'join_complete_status'Jérôme Pouiller
The field join_complete_status is never read. Drop it. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200420160311.57323-17-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: wfx: drop unused enum wfx_stateJérôme Pouiller
In former code, the field wvif->state was more or less redundant with vif->type. With the lasts change it has become unused. It is now time to drop it. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200420160311.57323-16-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: wfx: simplify wfx_remove_interface()Jérôme Pouiller
In wfx_remove_interface(), the current code differentiate AP and Station cases. However, it is not necessary. In all cases, the only important thing is the call to hif_reset(). We can use the same code to support all cases. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200420160311.57323-15-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: wfx: drop useless checks in wfx_do_unjoin()Jérôme Pouiller
The callers of wfx_do_unjoin() already take care of vif state. Therefore, it is not necessary to take care of the status of the interface. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200420160311.57323-14-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: wfx: drop protection for asynchronous join during scanJérôme Pouiller
In former code (before the inclusion of the driver in mainline kernel), hif_join() could run asynchronously. When a join request was in progress, it was forbidden to launch hif_scan(). Now, hif_join() is always run synchronously. There is no more reasons to keep a protection against this case. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200420160311.57323-13-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: wfx: keys are kept during whole firmware lifeJérôme Pouiller
Keys sent to the firmware are never reset. So, it is not necessary to re-upload them after hif_reset(). Thus, it is no more necessary to keep a copy of the keys in struct wfx_dev. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200420160311.57323-12-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: wfx: introduce wfx_set_default_unicast_key()Jérôme Pouiller
Currently code handle WEP keys manually. It is far easier to use the set_default_unicast_key() callback provided by mac80211. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200420160311.57323-11-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: wfx: drop useless update of field basic_rate_setJérôme Pouiller
Basic Rates are already set by hif_join(). hif_join() is also able to manage possible changes after association. Firmware also allows to change the Basic Rates with hif_set_association_mode() but it does not bring anything in our case. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200420160311.57323-10-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-23staging: wfx: simplify hif_set_bss_params()Jérôme Pouiller
The structure hif_req_set_bss_params come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_req_set_bss_params() is too dumb. It should pack data with hardware representation instead of leaving all work to the caller. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200420160311.57323-9-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>