Lines Matching full:vp
14 struct vic_provinfo *vp; in vic_provinfo_alloc() local
19 vp = kzalloc(VIC_PROVINFO_MAX_DATA, flags); in vic_provinfo_alloc()
20 if (!vp) in vic_provinfo_alloc()
23 memcpy(vp->oui, oui, sizeof(vp->oui)); in vic_provinfo_alloc()
24 vp->type = type; in vic_provinfo_alloc()
25 vp->length = htonl(sizeof(vp->num_tlvs)); in vic_provinfo_alloc()
27 return vp; in vic_provinfo_alloc()
30 void vic_provinfo_free(struct vic_provinfo *vp) in vic_provinfo_free() argument
32 kfree(vp); in vic_provinfo_free()
35 int vic_provinfo_add_tlv(struct vic_provinfo *vp, u16 type, u16 length, in vic_provinfo_add_tlv() argument
40 if (!vp || !value) in vic_provinfo_add_tlv()
43 if (ntohl(vp->length) + offsetof(struct vic_provinfo_tlv, value) + in vic_provinfo_add_tlv()
47 tlv = (struct vic_provinfo_tlv *)((u8 *)vp->tlv + in vic_provinfo_add_tlv()
48 ntohl(vp->length) - sizeof(vp->num_tlvs)); in vic_provinfo_add_tlv()
55 vp->num_tlvs = htonl(ntohl(vp->num_tlvs) + 1); in vic_provinfo_add_tlv()
56 vp->length = htonl(ntohl(vp->length) + in vic_provinfo_add_tlv()
62 size_t vic_provinfo_size(struct vic_provinfo *vp) in vic_provinfo_size() argument
64 return vp ? ntohl(vp->length) + sizeof(*vp) - sizeof(vp->num_tlvs) : 0; in vic_provinfo_size()