First Support on Ginger and OMAP TI
[linux-ginger.git] / drivers / staging / rt3090 / igmp_snoop.h
blob63f9692e0b35ac12fa9b523e0c9e7d21b2f16edd
1 /*
2 *************************************************************************
3 * Ralink Tech Inc.
4 * 5F., No.36, Taiyuan St., Jhubei City,
5 * Hsinchu County 302,
6 * Taiwan, R.O.C.
8 * (c) Copyright 2002-2007, Ralink Technology, Inc.
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 * This program is distributed in the hope that it will be useful, *
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 * GNU General Public License for more details. *
19 * *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program; if not, write to the *
22 * Free Software Foundation, Inc., *
23 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
24 * *
25 *************************************************************************
27 Module Name:
28 igmp_snoop.h
30 Abstract:
31 Miniport generic portion header file
33 Revision History:
34 Who When What
35 -------- ---------- ----------------------------------------------
39 #ifndef __RTMP_IGMP_SNOOP_H__
40 #define __RTMP_IGMP_SNOOP_H__
42 #include "link_list.h"
44 #define IGMP_PROTOCOL_DESCRIPTOR 0x02
45 #define IGMP_V1_MEMBERSHIP_REPORT 0x12
46 #define IGMP_V2_MEMBERSHIP_REPORT 0x16
47 #define IGMP_LEAVE_GROUP 0x17
48 #define IGMP_V3_MEMBERSHIP_REPORT 0x22
50 #define MLD_V1_LISTENER_REPORT 131
51 #define MLD_V1_LISTENER_DONE 132
52 #define MLD_V2_LISTERNER_REPORT 143
54 #define IGMPMAC_TB_ENTRY_AGEOUT_TIME 120 * OS_HZ
56 #define MULTICAST_ADDR_HASH_INDEX(Addr) (MAC_ADDR_HASH(Addr) % (MAX_LEN_OF_MULTICAST_FILTER_HASH_TABLE))
58 #define IS_MULTICAST_MAC_ADDR(Addr) ((((Addr[0]) & 0x01) == 0x01) && ((Addr[0]) != 0xff))
59 #define IS_BROADCAST_MAC_ADDR(Addr) ((((Addr[0]) & 0xff) == 0xff))
61 VOID MulticastFilterTableInit(
62 IN PMULTICAST_FILTER_TABLE *ppMulticastFilterTable);
64 VOID MultiCastFilterTableReset(
65 IN PMULTICAST_FILTER_TABLE *ppMulticastFilterTable);
67 BOOLEAN MulticastFilterTableInsertEntry(
68 IN PRTMP_ADAPTER pAd,
69 IN PUCHAR pGrpId,
70 IN PUCHAR pMemberAddr,
71 IN PNET_DEV dev,
72 IN MulticastFilterEntryType type);
74 BOOLEAN MulticastFilterTableDeleteEntry(
75 IN PRTMP_ADAPTER pAd,
76 IN PUCHAR pGrpId,
77 IN PUCHAR pMemberAddr,
78 IN PNET_DEV dev);
80 PMULTICAST_FILTER_TABLE_ENTRY MulticastFilterTableLookup(
81 IN PMULTICAST_FILTER_TABLE pMulticastFilterTable,
82 IN PUCHAR pAddr,
83 IN PNET_DEV dev);
85 BOOLEAN isIgmpPkt(
86 IN PUCHAR pDstMacAddr,
87 IN PUCHAR pIpHeader);
89 VOID IGMPSnooping(
90 IN PRTMP_ADAPTER pAd,
91 IN PUCHAR pDstMacAddr,
92 IN PUCHAR pSrcMacAddr,
93 IN PUCHAR pIpHeader,
94 IN PNET_DEV pDev);
96 BOOLEAN isMldPkt(
97 IN PUCHAR pDstMacAddr,
98 IN PUCHAR pIpHeader,
99 OUT UINT8 *pProtoType,
100 OUT PUCHAR *pMldHeader);
102 VOID MLDSnooping(
103 IN PRTMP_ADAPTER pAd,
104 IN PUCHAR pDstMacAddr,
105 IN PUCHAR pSrcMacAddr,
106 IN PUCHAR pIpHeader,
107 IN PNET_DEV pDev);
109 UCHAR IgmpMemberCnt(
110 IN PLIST_HEADER pList);
112 VOID IgmpGroupDelMembers(
113 IN PRTMP_ADAPTER pAd,
114 IN PUCHAR pMemberAddr,
115 IN PNET_DEV pDev);
117 INT Set_IgmpSn_Enable_Proc(
118 IN PRTMP_ADAPTER pAd,
119 IN PSTRING arg);
121 INT Set_IgmpSn_AddEntry_Proc(
122 IN PRTMP_ADAPTER pAd,
123 IN PSTRING arg);
125 INT Set_IgmpSn_DelEntry_Proc(
126 IN PRTMP_ADAPTER pAd,
127 IN PSTRING arg);
129 INT Set_IgmpSn_TabDisplay_Proc(
130 IN PRTMP_ADAPTER pAd,
131 IN PSTRING arg);
133 void rtmp_read_igmp_snoop_from_file(
134 IN PRTMP_ADAPTER pAd,
135 PSTRING tmpbuf,
136 PSTRING buffer);
138 NDIS_STATUS IgmpPktInfoQuery(
139 IN PRTMP_ADAPTER pAd,
140 IN PUCHAR pSrcBufVA,
141 IN PNDIS_PACKET pPacket,
142 IN UCHAR apidx,
143 OUT BOOLEAN *pInIgmpGroup,
144 OUT PMULTICAST_FILTER_TABLE_ENTRY *ppGroupEntry);
146 NDIS_STATUS IgmpPktClone(
147 IN PRTMP_ADAPTER pAd,
148 IN PNDIS_PACKET pPacket,
149 IN UCHAR QueIdx,
150 IN PMULTICAST_FILTER_TABLE_ENTRY pGroupEntry);
152 #endif /* __RTMP_IGMP_SNOOP_H__ */