arl.h (1993B)
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 * File: arl.h 8 * Purpose: Defines structures and routines for ARL operations 9 * defined in: 10 * drv/arl.c HW table management 11 * drv/arlmsg.c ARL message handling 12 */ 13 14 #ifndef _SOC_ARL_H 15 #define _SOC_ARL_H 16 17 #include <shared/avl.h> 18 #if defined(BCM_ESW_SUPPORT) || defined(BCM_SAND_SUPPORT) 19 #include <soc/mcm/memregs.h> 20 #endif 21 22 extern int soc_arl_attach(int unit); 23 extern int soc_arl_detach(int unit); 24 extern int soc_arl_init(int unit); 25 26 27 /* 28 * ARL miscellaneous functions 29 */ 30 31 extern int soc_arl_mode_set(int unit, int mode); 32 extern int soc_arl_mode_get(int unit, int *mode); 33 34 extern int soc_arl_freeze(int unit); 35 extern int soc_arl_thaw(int unit); 36 extern int soc_arl_frozen_cml_set(int unit, soc_port_t port, int cml, 37 int *repl_cml); 38 extern int soc_arl_frozen_cml_get(int unit, soc_port_t port, int *cml); 39 extern void _drv_arl_hash(uint8 *hash_value, uint8 length, uint16 *hash_result); 40 /* 41 * For ARL software shadow database access 42 */ 43 extern int soc_arl_database_dump(int unit, uint32 index, 44 l2_arl_sw_entry_t *entry); 45 extern int soc_arl_database_delete(int unit, uint32 index); 46 extern int soc_arl_database_add(int unit, uint32 index, int pending); 47 48 #define ARL_TABLE_WRITE 0 /* For ARL Write operateion */ 49 #define ARL_TABLE_READ 1 /* For ARL Read operateion */ 50 #define ARL_ENTRY_NULL(e1)\ 51 ((e1)->entry_data[0] == 0 && \ 52 (e1)->entry_data[1] == 0 && \ 53 (e1)->entry_data[2] == 0) 54 55 56 #define _ARL_SEARCH_VALID_OP_START 0x1 57 #define _ARL_SEARCH_VALID_OP_GET 0x2 58 #define _ARL_SEARCH_VALID_OP_DONE 0x3 59 #define _ARL_SEARCH_VALID_OP_NEXT 0x4 60 extern int soc_arl_search_valid(int unit, int op, void *index, void *entry, void *entry1); 61 62 #endif /* !_SOC_ARL_H */