1 #ifndef BCM_PHS_DEFINES_H 2 #define BCM_PHS_DEFINES_H 3 4 #define PHS_INVALID_TABLE_INDEX 0xffffffff 5 6 /************************* MACROS **********************************************/ 7 #define PHS_MEM_TAG "_SHP" 8 9 10 11 //PHS Defines 12 #define STATUS_PHS_COMPRESSED 0xa1 13 #define STATUS_PHS_NOCOMPRESSION 0xa2 14 #define APPLY_PHS 1 15 #define MAX_NO_BIT 7 16 #define ZERO_PHSI 0 17 #define VERIFY 0 18 #define SIZE_MULTIPLE_32 4 19 #define UNCOMPRESSED_PACKET 0 20 #define DYNAMIC 0 21 #define SUPPRESS 0x80 22 #define NO_CLASSIFIER_MATCH 0 23 #define SEND_PACKET_UNCOMPRESSED 0 24 #define PHSI_IS_ZERO 0 25 #define PHSI_LEN 1 26 #define ERROR_LEN 0 27 #define PHS_BUFFER_SIZE 1532 28 29 30 //#define MAX_PHS_LENGTHS 100 31 #define MAX_PHSRULE_PER_SF 20 32 #define MAX_SERVICEFLOWS 17 33 34 //PHS Error Defines 35 #define PHS_SUCCESS 0 36 #define ERR_PHS_INVALID_DEVICE_EXETENSION 0x800 37 #define ERR_PHS_INVALID_PHS_RULE 0x801 38 #define ERR_PHS_RULE_ALREADY_EXISTS 0x802 39 #define ERR_SF_MATCH_FAIL 0x803 40 #define ERR_INVALID_CLASSIFIERTABLE_FOR_SF 0x804 41 #define ERR_SFTABLE_FULL 0x805 42 #define ERR_CLSASSIFIER_TABLE_FULL 0x806 43 #define ERR_PHSRULE_MEMALLOC_FAIL 0x807 44 #define ERR_CLSID_MATCH_FAIL 0x808 45 #define ERR_PHSRULE_MATCH_FAIL 0x809 46 47 typedef struct _S_PHS_RULE 48 { 49 /// brief 8bit PHSI Of The Service Flow 50 B_UINT8 u8PHSI; 51 /// brief PHSF Of The Service Flow 52 B_UINT8 u8PHSFLength; 53 B_UINT8 u8PHSF[MAX_PHS_LENGTHS]; 54 /// brief PHSM Of The Service Flow 55 B_UINT8 u8PHSMLength; 56 B_UINT8 u8PHSM[MAX_PHS_LENGTHS]; 57 /// brief 8bit PHSS Of The Service Flow 58 B_UINT8 u8PHSS; 59 /// brief 8bit PHSV Of The Service Flow 60 B_UINT8 u8PHSV; 61 //Reference Count for this PHS Rule 62 B_UINT8 u8RefCnt; 63 //Flag to Store Unclassified PHS rules only in DL 64 B_UINT8 bUnclassifiedPHSRule; 65 66 B_UINT8 u8Reserved[3]; 67 68 LONG PHSModifiedBytes; 69 ULONG PHSModifiedNumPackets; 70 ULONG PHSErrorNumPackets; 71 }S_PHS_RULE; 72 73 74 typedef enum _E_CLASSIFIER_ENTRY_CONTEXT 75 { 76 eActiveClassifierRuleContext, 77 eOldClassifierRuleContext 78 }E_CLASSIFIER_ENTRY_CONTEXT; 79 80 typedef struct _S_CLASSIFIER_ENTRY 81 { 82 B_UINT8 bUsed; 83 B_UINT16 uiClassifierRuleId; 84 B_UINT8 u8PHSI; 85 S_PHS_RULE *pstPhsRule; 86 B_UINT8 bUnclassifiedPHSRule; 87 88 }S_CLASSIFIER_ENTRY; 89 90 91 typedef struct _S_CLASSIFIER_TABLE 92 { 93 B_UINT16 uiTotalClassifiers; 94 S_CLASSIFIER_ENTRY stActivePhsRulesList[MAX_PHSRULE_PER_SF]; 95 S_CLASSIFIER_ENTRY stOldPhsRulesList[MAX_PHSRULE_PER_SF]; 96 B_UINT16 uiOldestPhsRuleIndex; 97 98 }S_CLASSIFIER_TABLE; 99 100 101 typedef struct _S_SERVICEFLOW_ENTRY 102 { 103 B_UINT8 bUsed; 104 B_UINT16 uiVcid; 105 S_CLASSIFIER_TABLE *pstClassifierTable; 106 }S_SERVICEFLOW_ENTRY; 107 108 typedef struct _S_SERVICEFLOW_TABLE 109 { 110 B_UINT16 uiTotalServiceFlows; 111 S_SERVICEFLOW_ENTRY stSFList[MAX_SERVICEFLOWS]; 112 113 }S_SERVICEFLOW_TABLE; 114 115 116 typedef struct _PHS_DEVICE_EXTENSION 117 { 118 /* PHS Specific data*/ 119 S_SERVICEFLOW_TABLE *pstServiceFlowPhsRulesTable; 120 void *CompressedTxBuffer; 121 void *UnCompressedRxBuffer; 122 }PHS_DEVICE_EXTENSION,*PPHS_DEVICE_EXTENSION; 123 124 125 #endif 126