PHSDefines.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #ifndef BCM_PHS_DEFINES_H
  2. #define BCM_PHS_DEFINES_H
  3. #define PHS_INVALID_TABLE_INDEX 0xffffffff
  4. #define PHS_MEM_TAG "_SHP"
  5. /* PHS Defines */
  6. #define STATUS_PHS_COMPRESSED 0xa1
  7. #define STATUS_PHS_NOCOMPRESSION 0xa2
  8. #define APPLY_PHS 1
  9. #define MAX_NO_BIT 7
  10. #define ZERO_PHSI 0
  11. #define VERIFY 0
  12. #define SIZE_MULTIPLE_32 4
  13. #define UNCOMPRESSED_PACKET 0
  14. #define DYNAMIC 0
  15. #define SUPPRESS 0x80
  16. #define NO_CLASSIFIER_MATCH 0
  17. #define SEND_PACKET_UNCOMPRESSED 0
  18. #define PHSI_IS_ZERO 0
  19. #define PHSI_LEN 1
  20. #define ERROR_LEN 0
  21. #define PHS_BUFFER_SIZE 1532
  22. #define MAX_PHSRULE_PER_SF 20
  23. #define MAX_SERVICEFLOWS 17
  24. /* PHS Error Defines */
  25. #define PHS_SUCCESS 0
  26. #define ERR_PHS_INVALID_DEVICE_EXETENSION 0x800
  27. #define ERR_PHS_INVALID_PHS_RULE 0x801
  28. #define ERR_PHS_RULE_ALREADY_EXISTS 0x802
  29. #define ERR_SF_MATCH_FAIL 0x803
  30. #define ERR_INVALID_CLASSIFIERTABLE_FOR_SF 0x804
  31. #define ERR_SFTABLE_FULL 0x805
  32. #define ERR_CLSASSIFIER_TABLE_FULL 0x806
  33. #define ERR_PHSRULE_MEMALLOC_FAIL 0x807
  34. #define ERR_CLSID_MATCH_FAIL 0x808
  35. #define ERR_PHSRULE_MATCH_FAIL 0x809
  36. struct bcm_phs_rule {
  37. u8 u8PHSI;
  38. u8 u8PHSFLength;
  39. u8 u8PHSF[MAX_PHS_LENGTHS];
  40. u8 u8PHSMLength;
  41. u8 u8PHSM[MAX_PHS_LENGTHS];
  42. u8 u8PHSS;
  43. u8 u8PHSV;
  44. u8 u8RefCnt;
  45. u8 bUnclassifiedPHSRule;
  46. u8 u8Reserved[3];
  47. long PHSModifiedBytes;
  48. unsigned long PHSModifiedNumPackets;
  49. unsigned long PHSErrorNumPackets;
  50. };
  51. enum bcm_phs_classifier_context {
  52. eActiveClassifierRuleContext,
  53. eOldClassifierRuleContext
  54. };
  55. struct bcm_phs_classifier_entry {
  56. u8 bUsed;
  57. u16 uiClassifierRuleId;
  58. u8 u8PHSI;
  59. struct bcm_phs_rule *pstPhsRule;
  60. u8 bUnclassifiedPHSRule;
  61. };
  62. struct bcm_phs_classifier_table {
  63. u16 uiTotalClassifiers;
  64. struct bcm_phs_classifier_entry stActivePhsRulesList[MAX_PHSRULE_PER_SF];
  65. struct bcm_phs_classifier_entry stOldPhsRulesList[MAX_PHSRULE_PER_SF];
  66. u16 uiOldestPhsRuleIndex;
  67. };
  68. struct bcm_phs_entry {
  69. u8 bUsed;
  70. u16 uiVcid;
  71. struct bcm_phs_classifier_table *pstClassifierTable;
  72. };
  73. struct bcm_phs_table {
  74. u16 uiTotalServiceFlows;
  75. struct bcm_phs_entry stSFList[MAX_SERVICEFLOWS];
  76. };
  77. struct bcm_phs_extension {
  78. /* PHS Specific data */
  79. struct bcm_phs_table *pstServiceFlowPhsRulesTable;
  80. void *CompressedTxBuffer;
  81. void *UnCompressedRxBuffer;
  82. };
  83. #endif