summaryrefslogtreecommitdiffstats
path: root/sys/net/rndis.h
diff options
context:
space:
mode:
authorsephe <sephe@FreeBSD.org>2016-10-17 07:46:13 +0000
committersephe <sephe@FreeBSD.org>2016-10-17 07:46:13 +0000
commitaff44a1ac4dc887b99ddbb4b1eaac5cd67c780ec (patch)
treecfec5869e764288aa1e680cf132a43a718688fe2 /sys/net/rndis.h
parentc540e0ba502fd51616bb991ccded1f93f5e84e98 (diff)
downloadFreeBSD-src-aff44a1ac4dc887b99ddbb4b1eaac5cd67c780ec.zip
FreeBSD-src-aff44a1ac4dc887b99ddbb4b1eaac5cd67c780ec.tar.gz
MFC 305175,305176,305179,305182,305268,305270,305276
305175 net/rndis: Define per-packet-info for RNDIS packet message Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7708 305176 hyperv/hn: Stringent per-packet-info verification. While I'm here, minor style changes. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7709 305179 hyperv/hn: Fix VLAN tag construction. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7716 305182 net/rndis: Define types for RNDIS pktinfo rm_type field. They are defined by NDIS spec, so the NDIS prefix. Reviewed by: hps Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7717 305268 hyperv/hn: Rework RXCSUM related bits Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7735 305270 hyperv/hn: Simplify RX hash related bits. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7736 305276 hyperv/hn: Use the per-packet-info types defined by net/rndis.h Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7737
Diffstat (limited to 'sys/net/rndis.h')
-rw-r--r--sys/net/rndis.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/sys/net/rndis.h b/sys/net/rndis.h
index 4c82ca4..7e75dde 100644
--- a/sys/net/rndis.h
+++ b/sys/net/rndis.h
@@ -112,6 +112,39 @@ struct rndis_packet_msg {
};
/*
+ * Minimum value for rm_dataoffset, rm_oobdataoffset, and
+ * rm_pktinfooffset.
+ */
+#define RNDIS_PACKET_MSG_OFFSET_MIN \
+ (sizeof(struct rndis_packet_msg) - \
+ __offsetof(struct rndis_packet_msg, rm_dataoffset))
+
+/* Per-packet-info for RNDIS data message */
+struct rndis_pktinfo {
+ uint32_t rm_size;
+ uint32_t rm_type; /* NDIS_PKTINFO_TYPE_ */
+ uint32_t rm_pktinfooffset;
+ uint8_t rm_data[];
+};
+
+#define RNDIS_PKTINFO_OFFSET \
+ __offsetof(struct rndis_pktinfo, rm_data[0])
+#define RNDIS_PKTINFO_ALIGN 4
+
+#define NDIS_PKTINFO_TYPE_CSUM 0
+#define NDIS_PKTINFO_TYPE_IPSEC 1
+#define NDIS_PKTINFO_TYPE_LSO 2
+#define NDIS_PKTINFO_TYPE_CLASSIFY 3
+/* reserved 4 */
+#define NDIS_PKTINFO_TYPE_SGLIST 5
+#define NDIS_PKTINFO_TYPE_VLAN 6
+#define NDIS_PKTINFO_TYPE_ORIG 7
+#define NDIS_PKTINFO_TYPE_PKT_CANCELID 8
+#define NDIS_PKTINFO_TYPE_ORIG_NBLIST 9
+#define NDIS_PKTINFO_TYPE_CACHE_NBLIST 10
+#define NDIS_PKTINFO_TYPE_PKT_PAD 11
+
+/*
* RNDIS control messages
*/
struct rndis_comp_hdr {
OpenPOWER on IntegriCloud