1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2014-2023 Broadcom 3 * All rights reserved. 4 */ 5 6 #ifndef _BNXT_UTIL_H_ 7 #define _BNXT_UTIL_H_ 8 9 #ifndef BIT 10 #define BIT(n) (1UL << (n)) 11 #endif /* BIT */ 12 #ifndef BIT_MASK 13 #define BIT_MASK(len) (BIT(len) - 1) 14 #endif /* BIT_MASK */ 15 16 #define PCI_SUBSYSTEM_ID_OFFSET 0x2e 17 18 int bnxt_check_zero_bytes(const uint8_t *bytes, int len); 19 void bnxt_eth_hw_addr_random(uint8_t *mac_addr); 20 uint8_t hweight32(uint32_t word32); 21 #endif /* _BNXT_UTIL_H_ */ 22