lkml.org 
[lkml]   [2017]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RESEND PATCH 7/7] net: qrtr: Support decoding incoming v2 packets
From
From: Bjorn Andersson <bjorn.andersson@linaro.org>
Date: Wed, 4 Oct 2017 20:51:05 -0700

> +/**
> + * struct qrtr_hdr_v2 - (I|R)PCrouter packet header later versions
> + * @version: protocol version
> + * @type: packet type; one of QRTR_TYPE_*
> + * @flags: bitmask of QRTR_FLAGS_*
> + * @optlen: length of optional header data
> + * @size: length of packet, excluding this header and optlen
> + * @src_node_id: source node
> + * @src_port_id: source port
> + * @dst_node_id: destination node
> + * @dst_port_id: destination port
> + */
> +struct qrtr_hdr_v2 {
> + u8 version;
> + u8 type;
> + u8 flags;
> + u8 optlen;
> + __le32 size;
> + __le16 src_node_id;
> + __le16 src_port_id;
> + __le16 dst_node_id;
> + __le16 dst_port_id;
> +} __packed;

__packed should be only used when it is provably necessary, and it
should not be needed here.

\
 
 \ /
  Last update: 2017-10-06 03:06    [W:0.061 / U:1.344 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site