Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 1 | #ifndef BCM_PHS_DEFINES_H |
| 2 | #define BCM_PHS_DEFINES_H |
| 3 | |
Kevin McKinney | bb1c74e | 2012-12-20 00:31:22 -0500 | [diff] [blame] | 4 | #define PHS_INVALID_TABLE_INDEX 0xffffffff |
Arnd Bergmann | 9f1c75a | 2010-09-30 10:24:11 +0200 | [diff] [blame] | 5 | #define PHS_MEM_TAG "_SHP" |
Kevin McKinney | bb1c74e | 2012-12-20 00:31:22 -0500 | [diff] [blame] | 6 | |
| 7 | /* PHS Defines */ |
Kevin McKinney | f0393b9 | 2012-12-20 00:31:21 -0500 | [diff] [blame] | 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 |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 26 | |
Kevin McKinney | bb1c74e | 2012-12-20 00:31:22 -0500 | [diff] [blame] | 27 | /* PHS Error Defines */ |
Kevin McKinney | f0393b9 | 2012-12-20 00:31:21 -0500 | [diff] [blame] | 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 |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 39 | |
Kevin McKinney | a903d65 | 2012-12-20 00:31:34 -0500 | [diff] [blame] | 40 | struct bcm_phs_rule { |
Kevin McKinney | 3efa535 | 2012-12-20 00:31:24 -0500 | [diff] [blame] | 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]; |
Kevin McKinney | 86773aa | 2012-12-20 00:31:27 -0500 | [diff] [blame] | 51 | long PHSModifiedBytes; |
Kevin McKinney | 11f49a2 | 2012-12-20 00:31:26 -0500 | [diff] [blame] | 52 | unsigned long PHSModifiedNumPackets; |
| 53 | unsigned long PHSErrorNumPackets; |
Kevin McKinney | a903d65 | 2012-12-20 00:31:34 -0500 | [diff] [blame] | 54 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 55 | |
Kevin McKinney | 37fed6a | 2012-12-20 00:31:33 -0500 | [diff] [blame] | 56 | enum bcm_phs_classifier_context { |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 57 | eActiveClassifierRuleContext, |
| 58 | eOldClassifierRuleContext |
Kevin McKinney | 37fed6a | 2012-12-20 00:31:33 -0500 | [diff] [blame] | 59 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 60 | |
Kevin McKinney | 2212e93 | 2012-12-20 00:31:32 -0500 | [diff] [blame] | 61 | struct bcm_phs_classifier_entry { |
Kevin McKinney | 3efa535 | 2012-12-20 00:31:24 -0500 | [diff] [blame] | 62 | u8 bUsed; |
Kevin McKinney | 72ccb86 | 2012-12-20 00:31:25 -0500 | [diff] [blame] | 63 | u16 uiClassifierRuleId; |
Kevin McKinney | 3efa535 | 2012-12-20 00:31:24 -0500 | [diff] [blame] | 64 | u8 u8PHSI; |
Kevin McKinney | a903d65 | 2012-12-20 00:31:34 -0500 | [diff] [blame] | 65 | struct bcm_phs_rule *pstPhsRule; |
Kevin McKinney | 3efa535 | 2012-12-20 00:31:24 -0500 | [diff] [blame] | 66 | u8 bUnclassifiedPHSRule; |
Kevin McKinney | 2212e93 | 2012-12-20 00:31:32 -0500 | [diff] [blame] | 67 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 68 | |
Kevin McKinney | a700dbd | 2012-12-20 00:31:31 -0500 | [diff] [blame] | 69 | struct bcm_phs_classifier_table { |
Kevin McKinney | 72ccb86 | 2012-12-20 00:31:25 -0500 | [diff] [blame] | 70 | u16 uiTotalClassifiers; |
Kevin McKinney | 2212e93 | 2012-12-20 00:31:32 -0500 | [diff] [blame] | 71 | struct bcm_phs_classifier_entry stActivePhsRulesList[MAX_PHSRULE_PER_SF]; |
| 72 | struct bcm_phs_classifier_entry stOldPhsRulesList[MAX_PHSRULE_PER_SF]; |
Kevin McKinney | 72ccb86 | 2012-12-20 00:31:25 -0500 | [diff] [blame] | 73 | u16 uiOldestPhsRuleIndex; |
Kevin McKinney | a700dbd | 2012-12-20 00:31:31 -0500 | [diff] [blame] | 74 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 75 | |
Kevin McKinney | db134a6 | 2012-12-20 00:31:30 -0500 | [diff] [blame] | 76 | struct bcm_phs_entry { |
Kevin McKinney | 3efa535 | 2012-12-20 00:31:24 -0500 | [diff] [blame] | 77 | u8 bUsed; |
Kevin McKinney | 72ccb86 | 2012-12-20 00:31:25 -0500 | [diff] [blame] | 78 | u16 uiVcid; |
Kevin McKinney | a700dbd | 2012-12-20 00:31:31 -0500 | [diff] [blame] | 79 | struct bcm_phs_classifier_table *pstClassifierTable; |
Kevin McKinney | db134a6 | 2012-12-20 00:31:30 -0500 | [diff] [blame] | 80 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 81 | |
Kevin McKinney | da4d150 | 2012-12-20 00:31:29 -0500 | [diff] [blame] | 82 | struct bcm_phs_table { |
Kevin McKinney | 72ccb86 | 2012-12-20 00:31:25 -0500 | [diff] [blame] | 83 | u16 uiTotalServiceFlows; |
Kevin McKinney | db134a6 | 2012-12-20 00:31:30 -0500 | [diff] [blame] | 84 | struct bcm_phs_entry stSFList[MAX_SERVICEFLOWS]; |
Kevin McKinney | da4d150 | 2012-12-20 00:31:29 -0500 | [diff] [blame] | 85 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 86 | |
Kevin McKinney | 60dadf9 | 2012-12-20 00:31:28 -0500 | [diff] [blame] | 87 | struct bcm_phs_extension { |
Kevin McKinney | bb1c74e | 2012-12-20 00:31:22 -0500 | [diff] [blame] | 88 | /* PHS Specific data */ |
Kevin McKinney | da4d150 | 2012-12-20 00:31:29 -0500 | [diff] [blame] | 89 | struct bcm_phs_table *pstServiceFlowPhsRulesTable; |
Kevin McKinney | f0393b9 | 2012-12-20 00:31:21 -0500 | [diff] [blame] | 90 | void *CompressedTxBuffer; |
| 91 | void *UnCompressedRxBuffer; |
Kevin McKinney | 60dadf9 | 2012-12-20 00:31:28 -0500 | [diff] [blame] | 92 | }; |
Stephen Hemminger | f8942e0 | 2010-09-08 14:46:36 -0700 | [diff] [blame] | 93 | |
| 94 | #endif |