1#ifndef BCM_PHS_DEFINES_H
2#define BCM_PHS_DEFINES_H
3
4#define PHS_INVALID_TABLE_INDEX	0xffffffff
5#define PHS_MEM_TAG "_SHP"
6
7/* PHS Defines */
8#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
26
27/* PHS Error Defines */
28#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
39
40struct bcm_phs_rule {
41	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];
51	long PHSModifiedBytes;
52	unsigned long PHSModifiedNumPackets;
53	unsigned long PHSErrorNumPackets;
54};
55
56enum bcm_phs_classifier_context {
57	eActiveClassifierRuleContext,
58	eOldClassifierRuleContext
59};
60
61struct bcm_phs_classifier_entry {
62	u8  bUsed;
63	u16 uiClassifierRuleId;
64	u8  u8PHSI;
65	struct bcm_phs_rule *pstPhsRule;
66	u8  bUnclassifiedPHSRule;
67};
68
69struct bcm_phs_classifier_table {
70	u16 uiTotalClassifiers;
71	struct bcm_phs_classifier_entry stActivePhsRulesList[MAX_PHSRULE_PER_SF];
72	struct bcm_phs_classifier_entry stOldPhsRulesList[MAX_PHSRULE_PER_SF];
73	u16 uiOldestPhsRuleIndex;
74};
75
76struct bcm_phs_entry {
77	u8  bUsed;
78	u16 uiVcid;
79	struct bcm_phs_classifier_table *pstClassifierTable;
80};
81
82struct bcm_phs_table {
83	u16 uiTotalServiceFlows;
84	struct bcm_phs_entry stSFList[MAX_SERVICEFLOWS];
85};
86
87struct bcm_phs_extension {
88	/* PHS Specific data */
89	struct bcm_phs_table *pstServiceFlowPhsRulesTable;
90	void *CompressedTxBuffer;
91	void *UnCompressedRxBuffer;
92};
93
94#endif
95