blob: cd78ee4ffa220bd9c54adb80e8fef38e8d434a61 [file] [log] [blame]
Stephen Hemmingerf8942e02010-09-08 14:46:36 -07001#ifndef BCM_PHS_DEFINES_H
2#define BCM_PHS_DEFINES_H
3
Kevin McKinneybb1c74e2012-12-20 00:31:22 -05004#define PHS_INVALID_TABLE_INDEX 0xffffffff
Arnd Bergmann9f1c75a2010-09-30 10:24:11 +02005#define PHS_MEM_TAG "_SHP"
Kevin McKinneybb1c74e2012-12-20 00:31:22 -05006
7/* PHS Defines */
Kevin McKinneyf0393b92012-12-20 00:31:21 -05008#define STATUS_PHS_COMPRESSED 0xa1
9#define STATUS_PHS_NOCOMPRESSION 0xa2
10#define APPLY_PHS 1
11#define MAX_NO_BIT 7
12#define ZERO_PHSI 0
13#define VERIFY 0
14#define SIZE_MULTIPLE_32 4
15#define UNCOMPRESSED_PACKET 0
16#define DYNAMIC 0
17#define SUPPRESS 0x80
18#define NO_CLASSIFIER_MATCH 0
19#define SEND_PACKET_UNCOMPRESSED 0
20#define PHSI_IS_ZERO 0
21#define PHSI_LEN 1
22#define ERROR_LEN 0
23#define PHS_BUFFER_SIZE 1532
24#define MAX_PHSRULE_PER_SF 20
25#define MAX_SERVICEFLOWS 17
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070026
Kevin McKinneybb1c74e2012-12-20 00:31:22 -050027/* PHS Error Defines */
Kevin McKinneyf0393b92012-12-20 00:31:21 -050028#define PHS_SUCCESS 0
29#define ERR_PHS_INVALID_DEVICE_EXETENSION 0x800
30#define ERR_PHS_INVALID_PHS_RULE 0x801
31#define ERR_PHS_RULE_ALREADY_EXISTS 0x802
32#define ERR_SF_MATCH_FAIL 0x803
33#define ERR_INVALID_CLASSIFIERTABLE_FOR_SF 0x804
34#define ERR_SFTABLE_FULL 0x805
35#define ERR_CLSASSIFIER_TABLE_FULL 0x806
36#define ERR_PHSRULE_MEMALLOC_FAIL 0x807
37#define ERR_CLSID_MATCH_FAIL 0x808
38#define ERR_PHSRULE_MATCH_FAIL 0x809
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070039
Kevin McKinneya903d652012-12-20 00:31:34 -050040struct bcm_phs_rule {
Kevin McKinney3efa5352012-12-20 00:31:24 -050041 u8 u8PHSI;
42 u8 u8PHSFLength;
43 u8 u8PHSF[MAX_PHS_LENGTHS];
44 u8 u8PHSMLength;
45 u8 u8PHSM[MAX_PHS_LENGTHS];
46 u8 u8PHSS;
47 u8 u8PHSV;
48 u8 u8RefCnt;
49 u8 bUnclassifiedPHSRule;
50 u8 u8Reserved[3];
Kevin McKinney86773aa2012-12-20 00:31:27 -050051 long PHSModifiedBytes;
Kevin McKinney11f49a22012-12-20 00:31:26 -050052 unsigned long PHSModifiedNumPackets;
53 unsigned long PHSErrorNumPackets;
Kevin McKinneya903d652012-12-20 00:31:34 -050054};
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070055
Kevin McKinney37fed6a2012-12-20 00:31:33 -050056enum bcm_phs_classifier_context {
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070057 eActiveClassifierRuleContext,
58 eOldClassifierRuleContext
Kevin McKinney37fed6a2012-12-20 00:31:33 -050059};
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070060
Kevin McKinney2212e932012-12-20 00:31:32 -050061struct bcm_phs_classifier_entry {
Kevin McKinney3efa5352012-12-20 00:31:24 -050062 u8 bUsed;
Kevin McKinney72ccb862012-12-20 00:31:25 -050063 u16 uiClassifierRuleId;
Kevin McKinney3efa5352012-12-20 00:31:24 -050064 u8 u8PHSI;
Kevin McKinneya903d652012-12-20 00:31:34 -050065 struct bcm_phs_rule *pstPhsRule;
Kevin McKinney3efa5352012-12-20 00:31:24 -050066 u8 bUnclassifiedPHSRule;
Kevin McKinney2212e932012-12-20 00:31:32 -050067};
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070068
Kevin McKinneya700dbd2012-12-20 00:31:31 -050069struct bcm_phs_classifier_table {
Kevin McKinney72ccb862012-12-20 00:31:25 -050070 u16 uiTotalClassifiers;
Kevin McKinney2212e932012-12-20 00:31:32 -050071 struct bcm_phs_classifier_entry stActivePhsRulesList[MAX_PHSRULE_PER_SF];
72 struct bcm_phs_classifier_entry stOldPhsRulesList[MAX_PHSRULE_PER_SF];
Kevin McKinney72ccb862012-12-20 00:31:25 -050073 u16 uiOldestPhsRuleIndex;
Kevin McKinneya700dbd2012-12-20 00:31:31 -050074};
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070075
Kevin McKinneydb134a62012-12-20 00:31:30 -050076struct bcm_phs_entry {
Kevin McKinney3efa5352012-12-20 00:31:24 -050077 u8 bUsed;
Kevin McKinney72ccb862012-12-20 00:31:25 -050078 u16 uiVcid;
Kevin McKinneya700dbd2012-12-20 00:31:31 -050079 struct bcm_phs_classifier_table *pstClassifierTable;
Kevin McKinneydb134a62012-12-20 00:31:30 -050080};
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070081
Kevin McKinneyda4d1502012-12-20 00:31:29 -050082struct bcm_phs_table {
Kevin McKinney72ccb862012-12-20 00:31:25 -050083 u16 uiTotalServiceFlows;
Kevin McKinneydb134a62012-12-20 00:31:30 -050084 struct bcm_phs_entry stSFList[MAX_SERVICEFLOWS];
Kevin McKinneyda4d1502012-12-20 00:31:29 -050085};
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070086
Kevin McKinney60dadf92012-12-20 00:31:28 -050087struct bcm_phs_extension {
Kevin McKinneybb1c74e2012-12-20 00:31:22 -050088 /* PHS Specific data */
Kevin McKinneyda4d1502012-12-20 00:31:29 -050089 struct bcm_phs_table *pstServiceFlowPhsRulesTable;
Kevin McKinneyf0393b92012-12-20 00:31:21 -050090 void *CompressedTxBuffer;
91 void *UnCompressedRxBuffer;
Kevin McKinney60dadf92012-12-20 00:31:28 -050092};
Stephen Hemmingerf8942e02010-09-08 14:46:36 -070093
94#endif