Lines Matching refs:opts
47 BCMPOSTTRAPFN(bcm_xtlv_hdr_size)(bcm_xtlv_opts_t opts) in BCMPOSTTRAPFN()
50 if (opts & BCM_XTLV_OPTION_LENU8) --len; in BCMPOSTTRAPFN()
51 if (opts & BCM_XTLV_OPTION_IDU8) --len; in BCMPOSTTRAPFN()
57 bcm_valid_xtlv(const bcm_xtlv_t *elt, int buf_len, bcm_xtlv_opts_t opts) in bcm_valid_xtlv() argument
60 buf_len >= bcm_xtlv_hdr_size(opts) && in bcm_valid_xtlv()
61 buf_len >= bcm_xtlv_size(elt, opts); in bcm_valid_xtlv()
65 BCMPOSTTRAPFN(bcm_xtlv_size_for_data)(int dlen, bcm_xtlv_opts_t opts) in BCMPOSTTRAPFN()
69 hsz = bcm_xtlv_hdr_size(opts); in BCMPOSTTRAPFN()
70 return ((opts & BCM_XTLV_OPTION_ALIGN32) ? ALIGN_SIZE(dlen + hsz, 4) in BCMPOSTTRAPFN()
75 bcm_xtlv_size(const bcm_xtlv_t *elt, bcm_xtlv_opts_t opts) in bcm_xtlv_size() argument
80 len = BCM_XTLV_LEN_EX(elt, opts); in bcm_xtlv_size()
81 size = bcm_xtlv_size_for_data(len, opts); in bcm_xtlv_size()
86 bcm_xtlv_len(const bcm_xtlv_t *elt, bcm_xtlv_opts_t opts) in bcm_xtlv_len() argument
92 if (opts & BCM_XTLV_OPTION_IDU8) { in bcm_xtlv_len()
96 if (opts & BCM_XTLV_OPTION_LENU8) { in bcm_xtlv_len()
98 } else if (opts & BCM_XTLV_OPTION_LENBE) { in bcm_xtlv_len()
108 bcm_xtlv_id(const bcm_xtlv_t *elt, bcm_xtlv_opts_t opts) in bcm_xtlv_id() argument
111 if (opts & BCM_XTLV_OPTION_IDU8) { in bcm_xtlv_id()
113 } else if (opts & BCM_XTLV_OPTION_IDBE) { in bcm_xtlv_id()
123 bcm_next_xtlv(const bcm_xtlv_t *elt, int *buflen, bcm_xtlv_opts_t opts) in bcm_next_xtlv() argument
131 if (!bcm_valid_xtlv(elt, *buflen, opts)) in bcm_next_xtlv()
135 sz = BCM_XTLV_SIZE_EX(elt, opts); in bcm_next_xtlv()
153 if (!bcm_valid_xtlv(elt, *buflen, opts)) in bcm_next_xtlv()
164 bcm_xtlv_buf_init(bcm_xtlvbuf_t *tlv_buf, uint8 *buf, uint16 len, bcm_xtlv_opts_t opts) in bcm_xtlv_buf_init() argument
169 tlv_buf->opts = opts; in bcm_xtlv_buf_init()
215 bcm_xtlv_opts_t opts) in BCMPOSTTRAPFN()
220 if (!(opts & mask)) { /* default */ in BCMPOSTTRAPFN()
226 } else if ((opts & mask) == mask) { /* u8 id and u8 len */ in BCMPOSTTRAPFN()
232 } else if (opts & BCM_XTLV_OPTION_IDU8) { /* u8 id, u16 len */ in BCMPOSTTRAPFN()
238 } else if (opts & BCM_XTLV_OPTION_LENU8) { /* u16 id, u8 len */ in BCMPOSTTRAPFN()
249 if (opts & BCM_XTLV_OPTION_LENU8) { in BCMPOSTTRAPFN()
262 const uint8 **data, bcm_xtlv_opts_t opts) in bcm_xtlv_unpack_xtlv() argument
265 *type = (uint16)bcm_xtlv_id(xtlv, opts); in bcm_xtlv_unpack_xtlv()
267 *len = (uint16)bcm_xtlv_len(xtlv, opts); in bcm_xtlv_unpack_xtlv()
269 *data = (const uint8 *)xtlv + BCM_XTLV_HDR_SIZE_EX(opts); in bcm_xtlv_unpack_xtlv()
281 size = bcm_xtlv_size_for_data(n, tbuf->opts); in bcm_xtlv_put_data()
286 bcm_xtlv_pack_xtlv(xtlv, type, (uint16)n, data, tbuf->opts); in bcm_xtlv_put_data()
312 xtlv_data = (uint8 *)xtlv + bcm_xtlv_hdr_size(tbuf->opts); in bcm_xtlv_put_int()
373 uint8 *dst_data, bcm_xtlv_opts_t opts) in bcm_unpack_xtlv_entry() argument
382 bcm_xtlv_unpack_xtlv(ptlv, &type, &len, &data, opts); in bcm_unpack_xtlv_entry()
390 *tlv_buf += BCM_XTLV_SIZE_EX(ptlv, opts); in bcm_unpack_xtlv_entry()
400 const uint8 *src_data, bcm_xtlv_opts_t opts) in bcm_pack_xtlv_entry() argument
407 size = bcm_xtlv_size_for_data(len, opts); in bcm_pack_xtlv_entry()
414 bcm_xtlv_pack_xtlv(ptlv, type, len, src_data, opts); in bcm_pack_xtlv_entry()
428 bcm_unpack_xtlv_buf(void *ctx, const uint8 *tlv_buf, uint16 buflen, bcm_xtlv_opts_t opts, in bcm_unpack_xtlv_buf() argument
443 hdr_size = BCM_XTLV_HDR_SIZE_EX(opts); in bcm_unpack_xtlv_buf()
447 bcm_xtlv_unpack_xtlv(ptlv, &type, &len, &data, opts); in bcm_unpack_xtlv_buf()
448 size = bcm_xtlv_size_for_data(len, opts); in bcm_unpack_xtlv_buf()
466 bcm_pack_xtlv_buf(void *ctx, uint8 *tlv_buf, uint16 buflen, bcm_xtlv_opts_t opts, in bcm_pack_xtlv_buf() argument
486 hdr_size = BCM_XTLV_HDR_SIZE_EX(opts); in bcm_pack_xtlv_buf()
490 size = bcm_xtlv_size_for_data(tlv_len, opts); in bcm_pack_xtlv_buf()
496 bcm_xtlv_pack_xtlv((bcm_xtlv_t *)buf, tlv_id, tlv_len, NULL, opts); in bcm_pack_xtlv_buf()
516 bcm_xtlv_opts_t opts) in bcm_pack_xtlv_buf_from_mem() argument
524 items->len, items->ptr, opts); in bcm_pack_xtlv_buf_from_mem()
541 bcm_xtlv_opts_t opts) in bcm_unpack_xtlv_buf_to_mem() argument
546 elt = bcm_valid_xtlv((const bcm_xtlv_t *)tlv_buf, *buflen, opts) ? in bcm_unpack_xtlv_buf_to_mem()
553 for (; elt != NULL && res == BCME_OK; elt = bcm_next_xtlv(elt, buflen, opts)) { in bcm_unpack_xtlv_buf_to_mem()
559 bcm_xtlv_unpack_xtlv(elt, &type, &len, &data, opts); in bcm_unpack_xtlv_buf_to_mem()
586 uint16 *datalen, bcm_xtlv_opts_t opts) in bcm_get_data_from_xtlv_buf() argument
599 hdr_size = BCM_XTLV_HDR_SIZE_EX(opts); in bcm_get_data_from_xtlv_buf()
607 bcm_xtlv_unpack_xtlv(ptlv, &type, &len, &data, opts); in bcm_get_data_from_xtlv_buf()
609 size = bcm_xtlv_size_for_data(len, opts); in bcm_get_data_from_xtlv_buf()
631 int src_buf_len, int dst_buf_len, bcm_xtlv_opts_t opts) in bcm_xtlv_bcopy() argument
634 src = (src && bcm_valid_xtlv(src, src_buf_len, opts)) ? src : NULL; in bcm_xtlv_bcopy()
640 bcm_xtlv_unpack_xtlv(src, &type, &len, &data, opts); in bcm_xtlv_bcopy()
641 size = bcm_xtlv_size_for_data(len, opts); in bcm_xtlv_bcopy()
643 bcm_xtlv_pack_xtlv(dst, type, len, data, opts); in bcm_xtlv_bcopy()