net/rndis: Define common message header for RNDIS messages.

And avoid RNDIS_HEADER_OFFSET hardcoding.

Reviewed by:	hps
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7739
This commit is contained in:
Sepherosa Ziehau 2016-09-02 05:57:13 +00:00
parent 178228a10e
commit 772b86ba12

View File

@ -92,6 +92,14 @@
#define RNDIS_DF_CONNECTIONLESS 0x00000001
#define RNDIS_DF_CONNECTION_ORIENTED 0x00000002
/*
* Common RNDIS message header.
*/
struct rndis_msghdr {
uint32_t rm_type;
uint32_t rm_len;
};
/*
* RNDIS data message
*/
@ -322,7 +330,7 @@ struct rndis_keepalive_comp {
#define NDIS_PACKET_TYPE_MAC_FRAME 0x00008000
/* RNDIS offsets */
#define RNDIS_HEADER_OFFSET 8 /* bytes */
#define RNDIS_HEADER_OFFSET ((uint32_t)sizeof(struct rndis_msghdr))
#define RNDIS_DATA_OFFSET \
((uint32_t)(sizeof(struct rndis_packet_msg) - RNDIS_HEADER_OFFSET))