Arend van Spriel a7dd0ac945 brcmfmac: add xtlv support to firmware interface layer
Newer firmware API require commands to use xtlv format. Add support
for that in the firmware interface layer.

Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1627505434-9544-4-git-send-email-arend.vanspriel@broadcom.com
2021-08-21 18:49:04 +03:00

32 lines
708 B
C

// SPDX-License-Identifier: ISC
/*
* Copyright (c) 2019 Broadcom
*/
#ifndef __BRCMF_XTLV_H
#define __BRCMF_XTLV_H
#include <linux/types.h>
#include <linux/bits.h>
/* bcm type(id), length, value with w/16 bit id/len. The structure below
* is nominal, and is used to support variable length id and type. See
* xtlv options below.
*/
struct brcmf_xtlv {
u16 id;
u16 len;
u8 data[0];
};
enum brcmf_xtlv_option {
BRCMF_XTLV_OPTION_ALIGN32 = BIT(0),
BRCMF_XTLV_OPTION_IDU8 = BIT(1),
BRCMF_XTLV_OPTION_LENU8 = BIT(2),
};
int brcmf_xtlv_data_size(int dlen, u16 opts);
void brcmf_xtlv_pack_header(struct brcmf_xtlv *xtlv, u16 id, u16 len,
const u8 *data, u16 opts);
#endif /* __BRCMF_XTLV_H */