Lines Matching refs:tlv
254 #define TLV_DATA(tlv) ((void *)((char *)(tlv) + TLV_LENGTH(0)))
256 static inline int TLV_OK(const void *tlv, __u16 space)
259 * Would also like to check that "tlv" is a multiple of 4,
261 * - Tried doing (!(tlv & (TLV_ALIGNTO-1))), but GCC compiler
263 * - Tried casting "tlv" to integer type, but causes warning about size
268 (__be16_to_cpu(((struct tlv_desc *)tlv)->tlv_len) <= space);
271 static inline int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type)
273 return TLV_OK(tlv, space) &&
274 (__be16_to_cpu(((struct tlv_desc *)tlv)->tlv_type) == exp_type);
277 static inline int TLV_GET_LEN(struct tlv_desc *tlv)
279 return __be16_to_cpu(tlv->tlv_len);
282 static inline void TLV_SET_LEN(struct tlv_desc *tlv, __u16 len)
284 tlv->tlv_len = __cpu_to_be16(len);
287 static inline int TLV_CHECK_TYPE(struct tlv_desc *tlv, __u16 type)
289 return (__be16_to_cpu(tlv->tlv_type) == type);
292 static inline void TLV_SET_TYPE(struct tlv_desc *tlv, __u16 type)
294 tlv->tlv_type = __cpu_to_be16(type);
297 static inline int TLV_SET(void *tlv, __u16 type, void *data, __u16 len)
303 tlv_ptr = (struct tlv_desc *)tlv;