@@ -1483,13 +1483,12 @@ struct htt_mac_addr {
u32 mac_addr_h16;
};
-static inline void dp_peer_map_get_mac_addr(u32 addr_l32, u16 addr_h16,
- u8 *addr)
+static inline void ath11k_dp_get_mac_addr(u32 addr_l32, u16 addr_h16, u8 *addr)
{
-#ifdef __BIG_ENDIAN
- addr_l32 = swap32(addr_l32);
- addr_h16 = swap16(addr_h16);
-#endif
+ if (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)) {
+ addr_l32 = swab32(addr_l32);
+ addr_h16 = swab16(addr_h16);
+ }
memcpy(addr, &addr_l32, 4);
memcpy(addr + 4, &addr_h16, ETH_ALEN - 4);
}
@@ -1386,8 +1386,8 @@ void ath11k_dp_htt_htc_t2h_msg_handler(struct ath11k_base *ab,
resp->peer_map_ev.info);
peer_mac_h16 = FIELD_GET(HTT_T2H_PEER_MAP_INFO1_MAC_ADDR_H16,
resp->peer_map_ev.info1);
- dp_peer_map_get_mac_addr(resp->peer_map_ev.mac_addr_l32,
- peer_mac_h16, mac_addr);
+ ath11k_dp_get_mac_addr(resp->peer_map_ev.mac_addr_l32,
+ peer_mac_h16, mac_addr);
ast_hash = FIELD_GET(HTT_T2H_PEER_MAP_INFO2_AST_HASH_VAL,
resp->peer_map_ev.info1);
ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash);
@@ -1032,11 +1032,9 @@ int ath11k_hal_srng_setup(struct ath11k_base *sc, enum hal_ring_type type,
(srng->entry_size * srng->num_entries) << 2);
/* TODO: Add comments on these swap configurations */
-#ifdef __BIG_ENDIAN
- srng->flags |= HAL_SRNG_FLAGS_MSI_SWAP |
- HAL_SRNG_FLAGS_DATA_TLV_SWAP |
- HAL_SRNG_FLAGS_RING_PTR_SWAP;
-#endif
+ if (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
+ srng->flags |= HAL_SRNG_FLAGS_MSI_SWAP | HAL_SRNG_FLAGS_DATA_TLV_SWAP |
+ HAL_SRNG_FLAGS_RING_PTR_SWAP;
reg_base = srng->hwreg_base[HAL_SRNG_REG_GRP_R2];
Replace ifdef __BIG_ENDIAN with IS_ENABLED(CONFIG_CPU_BIG_ENDIAN). Replace swapXX() with swabXX(). Also does a renaming of dp_peer_map_get_mac_addr. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@codeaurora.org> --- drivers/net/wireless/ath/ath11k/dp.h | 11 +++++------ drivers/net/wireless/ath/ath11k/dp_rx.c | 4 ++-- drivers/net/wireless/ath/ath11k/hal.c | 8 +++----- 3 files changed, 10 insertions(+), 13 deletions(-)