Quellcode durchsuchen

qcacmn: Dump more WoW wakeup packet info

Propagation from qcacld-2.0 to qcacmn.

Dump some more info for WOW wakeup packet:
   1) ether_type
   2) proto_type in case of IPV4 and IPV6 packets
   3) src port and dst port in case of TCP/UDP

Change-Id: I1578aa5322af50f0ae43248c48a2f754ea081970
CRs-Fixed: 1043939
Himanshu Agarwal vor 8 Jahren
Ursprung
Commit
ab4d9e94be
3 geänderte Dateien mit 69 neuen und 1 gelöschten Zeilen
  1. 30 0
      qdf/inc/qdf_nbuf.h
  2. 2 1
      qdf/linux/src/i_qdf_nbuf.h
  3. 37 0
      qdf/linux/src/qdf_nbuf.c

+ 30 - 0
qdf/inc/qdf_nbuf.h

@@ -1347,6 +1347,36 @@ qdf_nbuf_data_get_icmpv6_subtype(uint8_t *data)
 	return __qdf_nbuf_data_get_icmpv6_subtype(data);
 }
 
+/**
+ * qdf_nbuf_data_get_ipv4_proto() - get the proto type
+ *            of IPV4 packet.
+ * @data: Pointer to IPV4 packet data buffer
+ *
+ * This func. returns the proto type of IPV4 packet.
+ *
+ * Return: proto type of IPV4 packet.
+ */
+static inline uint8_t
+qdf_nbuf_data_get_ipv4_proto(uint8_t *data)
+{
+	return __qdf_nbuf_data_get_ipv4_proto(data);
+}
+
+/**
+ * qdf_nbuf_data_get_ipv6_proto() - get the proto type
+ *            of IPV6 packet.
+ * @data: Pointer to IPV6 packet data buffer
+ *
+ * This func. returns the proto type of IPV6 packet.
+ *
+ * Return: proto type of IPV6 packet.
+ */
+static inline uint8_t
+qdf_nbuf_data_get_ipv6_proto(uint8_t *data)
+{
+	return __qdf_nbuf_data_get_ipv6_proto(data);
+}
+
 /**
  * qdf_nbuf_is_ipv4_pkt() - check if packet is a ipv4 packet or not
  * @buf:  buffer

+ 2 - 1
qdf/linux/src/i_qdf_nbuf.h

@@ -508,7 +508,8 @@ enum qdf_proto_subtype  __qdf_nbuf_data_get_eapol_subtype(uint8_t *data);
 enum qdf_proto_subtype  __qdf_nbuf_data_get_arp_subtype(uint8_t *data);
 enum qdf_proto_subtype  __qdf_nbuf_data_get_icmp_subtype(uint8_t *data);
 enum qdf_proto_subtype  __qdf_nbuf_data_get_icmpv6_subtype(uint8_t *data);
-
+uint8_t __qdf_nbuf_data_get_ipv4_proto(uint8_t *data);
+uint8_t __qdf_nbuf_data_get_ipv6_proto(uint8_t *data);
 
 /**
  * __qdf_to_status() - OS to QDF status conversion

+ 37 - 0
qdf/linux/src/qdf_nbuf.c

@@ -652,6 +652,43 @@ __qdf_nbuf_data_get_icmpv6_subtype(uint8_t *data)
 	return proto_subtype;
 }
 
+/**
+ * __qdf_nbuf_data_get_ipv4_proto() - get the proto type
+ *            of IPV4 packet.
+ * @data: Pointer to IPV4 packet data buffer
+ *
+ * This func. returns the proto type of IPV4 packet.
+ *
+ * Return: proto type of IPV4 packet.
+ */
+uint8_t
+__qdf_nbuf_data_get_ipv4_proto(uint8_t *data)
+{
+	uint8_t proto_type;
+
+	proto_type = (uint8_t)(*(uint8_t *)(data +
+				QDF_NBUF_TRAC_IPV4_PROTO_TYPE_OFFSET));
+	return proto_type;
+}
+
+/**
+ * __qdf_nbuf_data_get_ipv6_proto() - get the proto type
+ *            of IPV6 packet.
+ * @data: Pointer to IPV6 packet data buffer
+ *
+ * This func. returns the proto type of IPV6 packet.
+ *
+ * Return: proto type of IPV6 packet.
+ */
+uint8_t
+__qdf_nbuf_data_get_ipv6_proto(uint8_t *data)
+{
+	uint8_t proto_type;
+
+	proto_type = (uint8_t)(*(uint8_t *)(data +
+				QDF_NBUF_TRAC_IPV6_PROTO_TYPE_OFFSET));
+	return proto_type;
+}
 
 /**
  * __qdf_nbuf_data_is_ipv4_pkt() - check if packet is a ipv4 packet