diff options
author | Jérôme Pouiller <jerome.pouiller@silabs.com> | 2019-12-17 16:15:34 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-18 15:56:30 +0100 |
commit | 094ecec9be6096960cb4ae6a6256759bbba7aa0a (patch) | |
tree | dc816e1647718aa3259292f59357358717690b93 /drivers/staging/wfx/hif_tx_mib.h | |
parent | 397f36c1c786b70fa24a27fde7c425fcf34313fa (diff) |
staging: wfx: simplify hif_set_template_frame() usage
The structure hif_mib_template_frame come from hardware API. It is not
intended to be manipulated in upper layers of the driver.
In add, the current code for hif_set_template_frame() is dumb. All the
difficult task is left to the caller. So, there is code to factorize
here.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191217161318.31402-50-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.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index d77765f75f10..b1eeda2a3ab3 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -130,8 +130,17 @@ static inline int hif_set_operational_mode(struct wfx_dev *wdev, } static inline int hif_set_template_frame(struct wfx_vif *wvif, - struct hif_mib_template_frame *arg) + struct sk_buff *skb, + u8 frame_type, int init_rate) { + struct hif_mib_template_frame *arg; + + skb_push(skb, 4); + arg = (struct hif_mib_template_frame *)skb->data; + skb_pull(skb, 4); + arg->init_rate = init_rate; + arg->frame_type = frame_type; + arg->frame_length = cpu_to_le16(skb->len); return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_TEMPLATE_FRAME, arg, sizeof(*arg)); } |