Lines Matching refs:hdr
669 struct uath_cmd_hdr *hdr;
686 hdr = (struct uath_cmd_hdr *)cmd->buf;
687 memset(hdr, 0, sizeof(struct uath_cmd_hdr));
688 hdr->len = htobe32(cmd->buflen);
689 hdr->code = htobe32(code);
690 hdr->msgid = cmd->msgid; /* don't care about endianness */
691 hdr->magic = htobe32((cmd->flags & UATH_CMD_FLAG_MAGIC) ? 1 << 24 : 0);
692 memcpy((uint8_t *)(hdr + 1), idata, ilen);
704 olen < UATH_MAX_CMDSZ - sizeof(*hdr) + sizeof(uint32_t),
2203 struct uath_cmd_hdr *hdr;
2206 hdr = (struct uath_cmd_hdr *)cmd->buf;
2210 int len = be32toh(hdr->len);
2212 __func__, uath_codename(be32toh(hdr->code)),
2213 hdr->msgid, len, be32toh(hdr->magic));
2216 len > UATH_MAX_CMDSZ ? sizeof(*hdr) : len, '-');
2219 hdr->code = be32toh(hdr->code);
2220 hdr->len = be32toh(hdr->len);
2221 hdr->magic = be32toh(hdr->magic); /* target status on return */
2223 switch (hdr->code & 0xff) {
2226 dlen = hdr->len - sizeof(*hdr);
2234 __func__, hdr->code & 0xff, dlen);
2240 if (hdr->msgid < UATH_CMD_LIST_COUNT) {
2241 uint32_t *rp = (uint32_t *)(hdr+1);
2244 if (!(sizeof(*hdr) <= hdr->len &&
2245 hdr->len < UATH_MAX_CMDSZ)) {
2248 "msg ignored\n", __func__, hdr->len);
2273 __func__, hdr->code, olen,
2281 __func__, hdr->code, olen, dlen);
2294 if (hdr->msgid >= UATH_CMD_LIST_COUNT) {
2298 dlen = hdr->len - sizeof(*hdr);
2305 bcopy(hdr+1, cmd->odata, sizeof(uint32_t));