aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wfx/hif_tx_mib.h
diff options
context:
space:
mode:
authorJérôme Pouiller <jerome.pouiller@silabs.com>2020-01-15 13:54:10 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-16 20:59:46 +0100
commit5fd64673cf6e2ca08447a77de3d2fe7e73d54915 (patch)
tree90cd437a34b26b6bcf8b7ee828ae2d2e90e5ac88 /drivers/staging/wfx/hif_tx_mib.h
parentstaging: wfx: simplify hif_set_tx_rate_retry_policy() usage (diff)
downloadlinux-dev-5fd64673cf6e2ca08447a77de3d2fe7e73d54915.tar.xz
linux-dev-5fd64673cf6e2ca08447a77de3d2fe7e73d54915.zip
staging: wfx: simplify hif_set_output_power() usage
Hardware API use 10th of dBm for output power unit. Upper layers should use same units than mac80211 and the conversion should be done by low level layer of the driver (hif_set_output_power()) In add, current code of hif_set_output_power() use a __le32 while the device API specify a specific structure for this. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200115135338.14374-7-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx/hif_tx_mib.h')
-rw-r--r--drivers/staging/wfx/hif_tx_mib.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h
index ef033a409381..749df67131c3 100644
--- a/drivers/staging/wfx/hif_tx_mib.h
+++ b/drivers/staging/wfx/hif_tx_mib.h
@@ -15,13 +15,15 @@
#include "hif_tx.h"
#include "hif_api_mib.h"
-static inline int hif_set_output_power(struct wfx_vif *wvif, int power_level)
+static inline int hif_set_output_power(struct wfx_vif *wvif, int val)
{
- __le32 val = cpu_to_le32(power_level);
+ struct hif_mib_current_tx_power_level arg = {
+ .power_level = cpu_to_le32(val * 10),
+ };
return hif_write_mib(wvif->wdev, wvif->id,
HIF_MIB_ID_CURRENT_TX_POWER_LEVEL,
- &val, sizeof(val));
+ &arg, sizeof(arg));
}
static inline int hif_set_beacon_wakeup_period(struct wfx_vif *wvif,