Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: ISC
0002 /*
0003  * Copyright (c) 2019 Broadcom
0004  */
0005 #ifndef __BRCMF_XTLV_H
0006 #define __BRCMF_XTLV_H
0007 
0008 #include <linux/types.h>
0009 #include <linux/bits.h>
0010 
0011 /* bcm type(id), length, value with w/16 bit id/len. The structure below
0012  * is nominal, and is used to support variable length id and type. See
0013  * xtlv options below.
0014  */
0015 struct brcmf_xtlv {
0016     u16 id;
0017     u16 len;
0018     u8 data[];
0019 };
0020 
0021 enum brcmf_xtlv_option {
0022     BRCMF_XTLV_OPTION_ALIGN32 = BIT(0),
0023     BRCMF_XTLV_OPTION_IDU8 = BIT(1),
0024     BRCMF_XTLV_OPTION_LENU8 = BIT(2),
0025 };
0026 
0027 int brcmf_xtlv_data_size(int dlen, u16 opts);
0028 void brcmf_xtlv_pack_header(struct brcmf_xtlv *xtlv, u16 id, u16 len,
0029                 const u8 *data, u16 opts);
0030 
0031 #endif /* __BRCMF_XTLV_H */