From 1ff2f1dee88c11cbdd7c50f2690ef49a6f95a12b Mon Sep 17 00:00:00 2001 From: Sai Pratyusha Magam Date: Fri, 2 Jun 2023 09:22:20 +0530 Subject: [PATCH] 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 --- qdf/linux/src/qdf_nbuf.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/qdf/linux/src/qdf_nbuf.c b/qdf/linux/src/qdf_nbuf.c index f71c1e1628..e1344727e6 100644 --- a/qdf/linux/src/qdf_nbuf.c +++ b/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);