4 *Copyright (C) 2010 Beceem Communications, Inc.
6 *This program is free software: you can redistribute it and/or modify
7 *it under the terms of the GNU General Public License version 2 as
8 *published by the Free Software Foundation.
10 *This program is distributed in the hope that it will be useful,but
11 *WITHOUT ANY WARRANTY; without even the implied warranty of
12 *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 *See the GNU General Public License for more details.
15 *You should have received a copy of the GNU General Public License
16 *along with this program. If not, write to the Free Software Foundation, Inc.,
17 *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef BCM_PHS_DEFINES_H
23 #define BCM_PHS_DEFINES_H
25 #define PHS_INVALID_TABLE_INDEX 0xffffffff
27 /************************* MACROS **********************************************/
28 #define PHS_MEM_TAG '_SHP'
33 #define STATUS_PHS_COMPRESSED 0xa1
34 #define STATUS_PHS_NOCOMPRESSION 0xa2
39 #define SIZE_MULTIPLE_32 4
40 #define UNCOMPRESSED_PACKET 0
43 #define NO_CLASSIFIER_MATCH 0
44 #define SEND_PACKET_UNCOMPRESSED 0
45 #define PHSI_IS_ZERO 0
48 #define PHS_BUFFER_SIZE 1532
51 //#define MAX_PHS_LENGTHS 100
52 #define MAX_PHSRULE_PER_SF 20
53 #define MAX_SERVICEFLOWS 17
57 #define ERR_PHS_INVALID_DEVICE_EXETENSION 0x800
58 #define ERR_PHS_INVALID_PHS_RULE 0x801
59 #define ERR_PHS_RULE_ALREADY_EXISTS 0x802
60 #define ERR_SF_MATCH_FAIL 0x803
61 #define ERR_INVALID_CLASSIFIERTABLE_FOR_SF 0x804
62 #define ERR_SFTABLE_FULL 0x805
63 #define ERR_CLSASSIFIER_TABLE_FULL 0x806
64 #define ERR_PHSRULE_MEMALLOC_FAIL 0x807
65 #define ERR_CLSID_MATCH_FAIL 0x808
66 #define ERR_PHSRULE_MATCH_FAIL 0x809
68 typedef struct _S_PHS_RULE
70 /// brief 8bit PHSI Of The Service Flow
72 /// brief PHSF Of The Service Flow
74 B_UINT8 u8PHSF
[MAX_PHS_LENGTHS
];
75 /// brief PHSM Of The Service Flow
77 B_UINT8 u8PHSM
[MAX_PHS_LENGTHS
];
78 /// brief 8bit PHSS Of The Service Flow
80 /// brief 8bit PHSV Of The Service Flow
82 //Reference Count for this PHS Rule
84 //Flag to Store Unclassified PHS rules only in DL
85 B_UINT8 bUnclassifiedPHSRule
;
87 B_UINT8 u8Reserved
[3];
89 LONG PHSModifiedBytes
;
90 ULONG PHSModifiedNumPackets
;
91 ULONG PHSErrorNumPackets
;
95 typedef enum _E_CLASSIFIER_ENTRY_CONTEXT
97 eActiveClassifierRuleContext
,
98 eOldClassifierRuleContext
99 }E_CLASSIFIER_ENTRY_CONTEXT
;
101 typedef struct _S_CLASSIFIER_ENTRY
104 B_UINT16 uiClassifierRuleId
;
106 S_PHS_RULE
*pstPhsRule
;
107 B_UINT8 bUnclassifiedPHSRule
;
112 typedef struct _S_CLASSIFIER_TABLE
114 B_UINT16 uiTotalClassifiers
;
115 S_CLASSIFIER_ENTRY stActivePhsRulesList
[MAX_PHSRULE_PER_SF
];
116 S_CLASSIFIER_ENTRY stOldPhsRulesList
[MAX_PHSRULE_PER_SF
];
117 B_UINT16 uiOldestPhsRuleIndex
;
122 typedef struct _S_SERVICEFLOW_ENTRY
126 S_CLASSIFIER_TABLE
*pstClassifierTable
;
127 }S_SERVICEFLOW_ENTRY
;
129 typedef struct _S_SERVICEFLOW_TABLE
131 B_UINT16 uiTotalServiceFlows
;
132 S_SERVICEFLOW_ENTRY stSFList
[MAX_SERVICEFLOWS
];
134 }S_SERVICEFLOW_TABLE
;
137 typedef struct _PHS_DEVICE_EXTENSION
139 /* PHS Specific data*/
140 S_SERVICEFLOW_TABLE
*pstServiceFlowPhsRulesTable
;
141 void *CompressedTxBuffer
;
142 void *UnCompressedRxBuffer
;
143 }PHS_DEVICE_EXTENSION
,*PPHS_DEVICE_EXTENSION
;