Broadcom SDK and wireless driver: another attempt to update to ver. 5.10.147.0
[tomato.git] / release / src-rt / include / emf / igs / igsc_export.h
blob94654e3f1a35a67a877aa19148005537fe260cce
1 /*
2 * Copyright (C) 2009, Broadcom Corporation
3 * All Rights Reserved.
4 *
5 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
6 * the contents of this file may not be disclosed to third parties, copied
7 * or duplicated in any form, in whole or in part, without the prior
8 * written permission of Broadcom Corporation.
10 * $Id: igsc_export.h,v 1.3 2008/08/13 02:51:52 Exp $
13 #ifndef _IGSC_EXPORT_H_
14 #define _IGSC_EXPORT_H_
16 #ifdef IGSDBG
18 #define IGS_LOG_DEBUG (1 << 0)
19 #define IGS_LOG_ERROR (1 << 1)
20 #define IGS_LOG_WARN (1 << 2)
21 #define IGS_LOG_INFO (1 << 3)
22 #define IGS_LOG_IGSDB (1 << 4)
24 #define IGS_LOG_LVL (IGS_LOG_ERROR | \
25 IGS_LOG_WARN | \
26 IGS_LOG_DEBUG | \
27 IGS_LOG_INFO | \
28 IGS_LOG_IGSDB)
30 #if (IGS_LOG_LVL & IGS_LOG_DEBUG)
31 #define IGS_DEBUG(fmt, args...) printf("IGS_DEBUG: " fmt, ##args)
32 #else /* IGS_LOG_LVL & IGS_LOG_DEBUG */
33 #define IGS_DEBUG(fmt, args...)
34 #endif /* IGS_LOG_LVL & IGS_LOG_DEBUG */
36 #if (IGS_LOG_LVL & IGS_LOG_ERROR)
37 #define IGS_ERROR(fmt, args...) printf("IGS_ERROR: " fmt, ##args)
38 #else /* IGS_LOG_LVL & IGS_LOG_ERROR */
39 #define IGS_ERROR(fmt, args...)
40 #endif /* IGS_LOG_LVL & IGS_LOG_ERROR */
42 #if (IGS_LOG_LVL & IGS_LOG_WARN)
43 #define IGS_WARN(fmt, args...) printf("IGS_WARN.: " fmt, ##args)
44 #else /* IGS_LOG_LVL & IGS_LOG_WARN */
45 #define IGS_WARN(fmt, args...)
46 #endif /* IGS_LOG_LVL & IGS_LOG_WARN */
48 #if (IGS_LOG_LVL & IGS_LOG_INFO)
49 #define IGS_INFO(fmt, args...) printf("IGS_INFO.: " fmt, ##args)
50 #else /* IGS_LOG_LVL & IGS_LOG_INFO */
51 #define IGS_INFO(fmt, args...)
52 #endif /* IGS_LOG_LVL & IGS_LOG_INFO */
54 #if (IGS_LOG_LVL & IGS_LOG_IGSDB)
55 #define IGS_IGSDB(fmt, args...) printf("IGS_IGSDB: " fmt, ##args)
56 #else /* IGS_LOG_LVL & IGS_LOG_IGSDB */
57 #define IGS_IGSDB(fmt, args...)
58 #endif /* IGS_LOG_LVL & IGS_LOG_IGSDB */
60 #else /* IGSDBG */
62 #define IGS_DEBUG(fmt, args...)
63 #define IGS_ERROR(fmt, args...) printf(fmt, ##args)
64 #define IGS_WARN(fmt, args...)
65 #define IGS_INFO(fmt, args...)
66 #define IGS_IGSDB(fmt, args...)
68 #endif /* IGSDBG */
70 typedef int32 (*igs_broadcast_fn_ptr)(void *wrapper, uint8 *ip, uint32 length, uint32 mgrp_ip);
73 * Wrapper specific functions
75 typedef struct igsc_wrapper
78 /* Function called to broadcast IGMP query*/
79 int32 (*igs_broadcast)(void *wrapper, uint8 *ip, uint32 length, uint32 mgrp_ip);
81 }igsc_wrapper_t;
83 struct igsc_info;
86 * Description: This function is called from the OS specific module init
87 * routine to initialize the IGSL. This function primarily
88 * initializes the IGMP Snooping Layer global (IGSL) data and
89 * IGSDB. It also associates the snooper instance with EMF
90 * instance.
92 * Input: inst_id - IGS instance identifier.
93 * igs_info - IGSL OS Specific global data handle
94 * osh - OS abstraction layer handle
95 * emf_handle - Handle to use when interfacing with EMF.
96 * wrapper - Wrapper spcific info.
98 * Return: igsc_info - IGSL Common code global data handle
100 extern void * igsc_init(int8 *inst_id, void *igs_info, osl_t *osh, igsc_wrapper_t *wrapper);
103 * Description: This function is called from OS specific module exit routine
104 * This routine primarily stops the group interval timers,
105 * deletes and frees up the IGSDB entries.
107 * Input: igs_info - IGSL OS Specific global data handle
109 extern void igsc_exit(struct igsc_info *igsc_info);
112 * Description: This function returns various packet counters and global
113 * stats of IGSL. It is called from the IGSL OS specific
114 * command handler.
116 * Input: igsc_info - IGSL Common code global instance handle
117 * size - Size of the input buffer.
119 * Output: stats - Pointer to structure of type igs_stats_t
121 * Return: SUCCESS or FAILURE.
123 extern int32 igsc_stats_get(struct igsc_info *igsc_info, igs_stats_t *stats, uint32 size);
126 * Description: This function clears the group interval timers and
127 * deletes the group, host and interface entries of the
128 * IGSDB.
130 * Input: igs_info - IGSL OS Specific global data handle
132 extern void igsc_sdb_clear(struct igsc_info *igsc_info);
135 * Description: This function is called to obtain the IGSDB entry list.
137 extern int32 igsc_sdb_list(struct igsc_info *igsc_info, igs_cfg_sdb_list_t *list, uint32 size);
140 * Description: This function is called from the OS Specific layer when
141 * user issues a configuration command.
143 * Input: igs_info - IGSC global instance handle
145 * Input/Output: cfg - Pointer to configuration request data. It
146 * contains the command id, operation type,
147 * corresponding arguments and output status.
149 extern void igsc_cfg_request_process(struct igsc_info *igsc_info, igs_cfg_request_t *cfg);
152 * Description: This function is called to delete igsc sdb entries
153 * specific to an interface
155 * Input: igs_info - IGSC global instance handle
156 * ifp - Interface pointer
158 extern int32 igsc_sdb_interface_del(struct igsc_info *igsc_info, void *ifp);
161 * Description: This function is called to delete igsc sdb rtport entries
162 * specific to an interface
164 * Input: igs_info - IGSC global instance handle
165 * ifp - Interface pointer
167 extern int32 igsc_interface_rtport_del(struct igsc_info *igsc_info, void *ifp);
169 #endif /* _IGSC_EXPORT_H_ */