phymod_debug.c (927B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 6 */ 7 8 #include <phymod/phymod_debug.h> 9 10 /* 11 * Global variables to control verbose debug output. 12 * Please see PHYMOD_VDBG macro in phymod_debug.h for usage. 13 */ 14 uint32_t phymod_dbg_mask; 15 uint32_t phymod_dbg_addr; 16 uint32_t phymod_dbg_lane; 17 18 int 19 phymod_debug_check(uint32_t flags, const phymod_access_t *pa) 20 { 21 if ((flags & phymod_dbg_mask) == 0) { 22 return 0; 23 } 24 if (pa == NULL) { 25 return 1; 26 } 27 if ((pa->addr == phymod_dbg_addr)||(phymod_dbg_addr==0)) { 28 if((phymod_dbg_lane==0) || 29 /* lane_mask is not set in core_access read & write */ 30 (pa->lane_mask==0) || 31 (pa->lane_mask & phymod_dbg_lane) != 0) { 32 return 1; 33 } 34 } 35 return 0; 36 }