소스 검색

qcacmn: Fix EAPOL Drop in Big Endian mode

Fix EAPOL Drop in DP when host is running in
Big Endian mode

Change-Id: If85845c73028429333595b639b3e29231e9bc7ee
CRs-Fixed: 3515114
Sai Pratyusha Magam 2 년 전
부모
커밋
1ff2f1dee8
1개의 변경된 파일22개의 추가작업 그리고 4개의 파일을 삭제
  1. 22 4
      qdf/linux/src/qdf_nbuf.c

+ 22 - 4
qdf/linux/src/qdf_nbuf.c

@@ -1845,16 +1845,34 @@ bool __qdf_nbuf_data_is_ipv4_dhcp_pkt(uint8_t *data)
 }
 qdf_export_symbol(__qdf_nbuf_data_is_ipv4_dhcp_pkt);
 
+/**
+ * qdf_is_eapol_type() - check if packet is EAPOL
+ * @type: Packet type
+ *
+ * This api is to check if frame is EAPOL packet type.
+ *
+ * Return: true if it is EAPOL frame
+ *         false otherwise.
+ */
+#ifdef BIG_ENDIAN_HOST
+static inline bool qdf_is_eapol_type(uint16_t type)
+{
+	return (type == QDF_NBUF_TRAC_EAPOL_ETH_TYPE);
+}
+#else
+static inline bool qdf_is_eapol_type(uint16_t type)
+{
+	return (type == QDF_SWAP_U16(QDF_NBUF_TRAC_EAPOL_ETH_TYPE));
+}
+#endif
+
 bool __qdf_nbuf_data_is_ipv4_eapol_pkt(uint8_t *data)
 {
 	uint16_t ether_type;
 
 	ether_type = __qdf_nbuf_get_ether_type(data);
 
-	if (ether_type == QDF_SWAP_U16(QDF_NBUF_TRAC_EAPOL_ETH_TYPE))
-		return true;
-	else
-		return false;
+	return qdf_is_eapol_type(ether_type);
 }
 qdf_export_symbol(__qdf_nbuf_data_is_ipv4_eapol_pkt);