aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x_hsi.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bnx2x_hsi.h')
-rw-r--r--drivers/net/bnx2x_hsi.h1101
1 files changed, 882 insertions, 219 deletions
diff --git a/drivers/net/bnx2x_hsi.h b/drivers/net/bnx2x_hsi.h
index b21075ccb52e..d3e8198d7dba 100644
--- a/drivers/net/bnx2x_hsi.h
+++ b/drivers/net/bnx2x_hsi.h
@@ -132,6 +132,12 @@ struct shared_hw_cfg { /* NVRAM Offset */
132#define SHARED_HW_CFG_BOARD_TYPE_BCM957710T1003G 0x00000008 132#define SHARED_HW_CFG_BOARD_TYPE_BCM957710T1003G 0x00000008
133#define SHARED_HW_CFG_BOARD_TYPE_BCM957710A1022G 0x00000009 133#define SHARED_HW_CFG_BOARD_TYPE_BCM957710A1022G 0x00000009
134#define SHARED_HW_CFG_BOARD_TYPE_BCM957710A1021G 0x0000000a 134#define SHARED_HW_CFG_BOARD_TYPE_BCM957710A1021G 0x0000000a
135#define SHARED_HW_CFG_BOARD_TYPE_BCM957710A1023G 0x0000000b
136#define SHARED_HW_CFG_BOARD_TYPE_BCM957710A1033G 0x0000000c
137#define SHARED_HW_CFG_BOARD_TYPE_BCM957711T1101 0x0000000d
138#define SHARED_HW_CFG_BOARD_TYPE_BCM957711ET1201 0x0000000e
139#define SHARED_HW_CFG_BOARD_TYPE_BCM957711A1133G 0x0000000f
140#define SHARED_HW_CFG_BOARD_TYPE_BCM957711EA1233G 0x00000010
135 141
136#define SHARED_HW_CFG_BOARD_VER_MASK 0xffff0000 142#define SHARED_HW_CFG_BOARD_VER_MASK 0xffff0000
137#define SHARED_HW_CFG_BOARD_VER_SHIFT 16 143#define SHARED_HW_CFG_BOARD_VER_SHIFT 16
@@ -313,6 +319,7 @@ struct shared_feat_cfg { /* NVRAM Offset */
313 319
314 u32 config; /* 0x450 */ 320 u32 config; /* 0x450 */
315#define SHARED_FEATURE_BMC_ECHO_MODE_EN 0x00000001 321#define SHARED_FEATURE_BMC_ECHO_MODE_EN 0x00000001
322#define SHARED_FEATURE_MF_MODE_DISABLED 0x00000100
316 323
317}; 324};
318 325
@@ -502,28 +509,41 @@ struct port_feat_cfg { /* port 0: 0x454 port 1: 0x4c8 */
502}; 509};
503 510
504 511
505/***************************************************************************** 512/****************************************************************************
506 * Device Information * 513 * Device Information *
507 *****************************************************************************/ 514 ****************************************************************************/
508struct dev_info { /* size */ 515struct dev_info { /* size */
509 516
510 u32 bc_rev; /* 8 bits each: major, minor, build */ /* 4 */ 517 u32 bc_rev; /* 8 bits each: major, minor, build */ /* 4 */
511 518
512 struct shared_hw_cfg shared_hw_config; /* 40 */ 519 struct shared_hw_cfg shared_hw_config; /* 40 */
513 520
514 struct port_hw_cfg port_hw_config[PORT_MAX]; /* 400*2=800 */ 521 struct port_hw_cfg port_hw_config[PORT_MAX]; /* 400*2=800 */
515 522
516 struct shared_feat_cfg shared_feature_config; /* 4 */ 523 struct shared_feat_cfg shared_feature_config; /* 4 */
517 524
518 struct port_feat_cfg port_feature_config[PORT_MAX]; /* 116*2=232 */ 525 struct port_feat_cfg port_feature_config[PORT_MAX];/* 116*2=232 */
519 526
520}; 527};
521 528
522 529
523#define FUNC_0 0 530#define FUNC_0 0
524#define FUNC_1 1 531#define FUNC_1 1
532#define FUNC_2 2
533#define FUNC_3 3
534#define FUNC_4 4
535#define FUNC_5 5
536#define FUNC_6 6
537#define FUNC_7 7
525#define E1_FUNC_MAX 2 538#define E1_FUNC_MAX 2
526#define FUNC_MAX E1_FUNC_MAX 539#define E1H_FUNC_MAX 8
540
541#define VN_0 0
542#define VN_1 1
543#define VN_2 2
544#define VN_3 3
545#define E1VN_MAX 1
546#define E1HVN_MAX 4
527 547
528 548
529/* This value (in milliseconds) determines the frequency of the driver 549/* This value (in milliseconds) determines the frequency of the driver
@@ -619,7 +639,9 @@ struct drv_port_mb {
619#define LINK_STATUS_LINK_PARTNER_15GXFD_CAPABLE 0x08000000 639#define LINK_STATUS_LINK_PARTNER_15GXFD_CAPABLE 0x08000000
620#define LINK_STATUS_LINK_PARTNER_16GXFD_CAPABLE 0x10000000 640#define LINK_STATUS_LINK_PARTNER_16GXFD_CAPABLE 0x10000000
621 641
622 u32 reserved[3]; 642 u32 port_stx;
643
644 u32 reserved[2];
623 645
624}; 646};
625 647
@@ -642,6 +664,11 @@ struct drv_func_mb {
642#define DRV_MSG_CODE_GET_MANUF_KEY 0x82000000 664#define DRV_MSG_CODE_GET_MANUF_KEY 0x82000000
643#define DRV_MSG_CODE_LOAD_L2B_PRAM 0x90000000 665#define DRV_MSG_CODE_LOAD_L2B_PRAM 0x90000000
644 666
667#define BIOS_MSG_CODE_LIC_CHALLENGE 0xff010000
668#define BIOS_MSG_CODE_LIC_RESPONSE 0xff020000
669#define BIOS_MSG_CODE_VIRT_MAC_PRIM 0xff030000
670#define BIOS_MSG_CODE_VIRT_MAC_ISCSI 0xff040000
671
645#define DRV_MSG_SEQ_NUMBER_MASK 0x0000ffff 672#define DRV_MSG_SEQ_NUMBER_MASK 0x0000ffff
646 673
647 u32 drv_mb_param; 674 u32 drv_mb_param;
@@ -671,6 +698,11 @@ struct drv_func_mb {
671#define FW_MSG_CODE_L2B_PRAM_X_LOAD_FAILURE 0x90230000 698#define FW_MSG_CODE_L2B_PRAM_X_LOAD_FAILURE 0x90230000
672#define FW_MSG_CODE_L2B_PRAM_U_LOAD_FAILURE 0x90240000 699#define FW_MSG_CODE_L2B_PRAM_U_LOAD_FAILURE 0x90240000
673 700
701#define FW_MSG_CODE_LIC_CHALLENGE 0xff010000
702#define FW_MSG_CODE_LIC_RESPONSE 0xff020000
703#define FW_MSG_CODE_VIRT_MAC_PRIM 0xff030000
704#define FW_MSG_CODE_VIRT_MAC_ISCSI 0xff040000
705
674#define FW_MSG_SEQ_NUMBER_MASK 0x0000ffff 706#define FW_MSG_SEQ_NUMBER_MASK 0x0000ffff
675 707
676 u32 fw_mb_param; 708 u32 fw_mb_param;
@@ -696,7 +728,13 @@ struct drv_func_mb {
696 u32 iscsi_boot_signature; 728 u32 iscsi_boot_signature;
697 u32 iscsi_boot_block_offset; 729 u32 iscsi_boot_block_offset;
698 730
699 u32 reserved[3]; 731 u32 drv_status;
732#define DRV_STATUS_PMF 0x00000001
733
734 u32 virt_mac_upper;
735#define VIRT_MAC_SIGN_MASK 0xffff0000
736#define VIRT_MAC_SIGNATURE 0x564d0000
737 u32 virt_mac_lower;
700 738
701}; 739};
702 740
@@ -713,6 +751,92 @@ struct mgmtfw_state {
713 751
714 752
715/**************************************************************************** 753/****************************************************************************
754 * Multi-Function configuration *
755 ****************************************************************************/
756struct shared_mf_cfg {
757
758 u32 clp_mb;
759#define SHARED_MF_CLP_SET_DEFAULT 0x00000000
760 /* set by CLP */
761#define SHARED_MF_CLP_EXIT 0x00000001
762 /* set by MCP */
763#define SHARED_MF_CLP_EXIT_DONE 0x00010000
764
765};
766
767struct port_mf_cfg {
768
769 u32 dynamic_cfg; /* device control channel */
770#define PORT_MF_CFG_OUTER_VLAN_TAG_MASK 0x0000ffff
771#define PORT_MF_CFG_OUTER_VLAN_TAG_SHIFT 0
772#define PORT_MF_CFG_DYNAMIC_CFG_ENABLED 0x00010000
773#define PORT_MF_CFG_DYNAMIC_CFG_DEFAULT 0x00000000
774
775 u32 reserved[3];
776
777};
778
779struct func_mf_cfg {
780
781 u32 config;
782 /* E/R/I/D */
783 /* function 0 of each port cannot be hidden */
784#define FUNC_MF_CFG_FUNC_HIDE 0x00000001
785
786#define FUNC_MF_CFG_PROTOCOL_MASK 0x00000007
787#define FUNC_MF_CFG_PROTOCOL_ETHERNET 0x00000002
788#define FUNC_MF_CFG_PROTOCOL_ETHERNET_WITH_RDMA 0x00000004
789#define FUNC_MF_CFG_PROTOCOL_ISCSI 0x00000006
790#define FUNC_MF_CFG_PROTOCOL_DEFAULT\
791 FUNC_MF_CFG_PROTOCOL_ETHERNET_WITH_RDMA
792
793#define FUNC_MF_CFG_FUNC_DISABLED 0x00000008
794
795 /* PRI */
796 /* 0 - low priority, 3 - high priority */
797#define FUNC_MF_CFG_TRANSMIT_PRIORITY_MASK 0x00000300
798#define FUNC_MF_CFG_TRANSMIT_PRIORITY_SHIFT 8
799#define FUNC_MF_CFG_TRANSMIT_PRIORITY_DEFAULT 0x00000000
800
801 /* MINBW, MAXBW */
802 /* value range - 0..100, increments in 100Mbps */
803#define FUNC_MF_CFG_MIN_BW_MASK 0x00ff0000
804#define FUNC_MF_CFG_MIN_BW_SHIFT 16
805#define FUNC_MF_CFG_MIN_BW_DEFAULT 0x00000000
806#define FUNC_MF_CFG_MAX_BW_MASK 0xff000000
807#define FUNC_MF_CFG_MAX_BW_SHIFT 24
808#define FUNC_MF_CFG_MAX_BW_DEFAULT 0x64000000
809
810 u32 mac_upper; /* MAC */
811#define FUNC_MF_CFG_UPPERMAC_MASK 0x0000ffff
812#define FUNC_MF_CFG_UPPERMAC_SHIFT 0
813#define FUNC_MF_CFG_UPPERMAC_DEFAULT FUNC_MF_CFG_UPPERMAC_MASK
814 u32 mac_lower;
815#define FUNC_MF_CFG_LOWERMAC_DEFAULT 0xffffffff
816
817 u32 e1hov_tag; /* VNI */
818#define FUNC_MF_CFG_E1HOV_TAG_MASK 0x0000ffff
819#define FUNC_MF_CFG_E1HOV_TAG_SHIFT 0
820#define FUNC_MF_CFG_E1HOV_TAG_DEFAULT FUNC_MF_CFG_E1HOV_TAG_MASK
821
822 u32 reserved[2];
823
824};
825
826struct mf_cfg {
827
828 struct shared_mf_cfg shared_mf_config;
829 struct port_mf_cfg port_mf_config[PORT_MAX];
830#if defined(b710)
831 struct func_mf_cfg func_mf_config[E1_FUNC_MAX];
832#else
833 struct func_mf_cfg func_mf_config[E1H_FUNC_MAX];
834#endif
835
836};
837
838
839/****************************************************************************
716 * Shared Memory Region * 840 * Shared Memory Region *
717 ****************************************************************************/ 841 ****************************************************************************/
718struct shmem_region { /* SharedMem Offset (size) */ 842struct shmem_region { /* SharedMem Offset (size) */
@@ -747,14 +871,349 @@ struct shmem_region { /* SharedMem Offset (size) */
747 struct mgmtfw_state mgmtfw_state; /* 0x4ac (0x1b8) */ 871 struct mgmtfw_state mgmtfw_state; /* 0x4ac (0x1b8) */
748 872
749 struct drv_port_mb port_mb[PORT_MAX]; /* 0x664 (16*2=0x20) */ 873 struct drv_port_mb port_mb[PORT_MAX]; /* 0x664 (16*2=0x20) */
750 struct drv_func_mb func_mb[FUNC_MAX]; /* 0x684 (44*2=0x58) */ 874 struct drv_func_mb func_mb[E1H_FUNC_MAX];
875
876 struct mf_cfg mf_cfg;
751 877
752}; /* 0x6dc */ 878}; /* 0x6dc */
753 879
754 880
881struct emac_stats {
882 u32 rx_stat_ifhcinoctets;
883 u32 rx_stat_ifhcinbadoctets;
884 u32 rx_stat_etherstatsfragments;
885 u32 rx_stat_ifhcinucastpkts;
886 u32 rx_stat_ifhcinmulticastpkts;
887 u32 rx_stat_ifhcinbroadcastpkts;
888 u32 rx_stat_dot3statsfcserrors;
889 u32 rx_stat_dot3statsalignmenterrors;
890 u32 rx_stat_dot3statscarriersenseerrors;
891 u32 rx_stat_xonpauseframesreceived;
892 u32 rx_stat_xoffpauseframesreceived;
893 u32 rx_stat_maccontrolframesreceived;
894 u32 rx_stat_xoffstateentered;
895 u32 rx_stat_dot3statsframestoolong;
896 u32 rx_stat_etherstatsjabbers;
897 u32 rx_stat_etherstatsundersizepkts;
898 u32 rx_stat_etherstatspkts64octets;
899 u32 rx_stat_etherstatspkts65octetsto127octets;
900 u32 rx_stat_etherstatspkts128octetsto255octets;
901 u32 rx_stat_etherstatspkts256octetsto511octets;
902 u32 rx_stat_etherstatspkts512octetsto1023octets;
903 u32 rx_stat_etherstatspkts1024octetsto1522octets;
904 u32 rx_stat_etherstatspktsover1522octets;
905
906 u32 rx_stat_falsecarriererrors;
907
908 u32 tx_stat_ifhcoutoctets;
909 u32 tx_stat_ifhcoutbadoctets;
910 u32 tx_stat_etherstatscollisions;
911 u32 tx_stat_outxonsent;
912 u32 tx_stat_outxoffsent;
913 u32 tx_stat_flowcontroldone;
914 u32 tx_stat_dot3statssinglecollisionframes;
915 u32 tx_stat_dot3statsmultiplecollisionframes;
916 u32 tx_stat_dot3statsdeferredtransmissions;
917 u32 tx_stat_dot3statsexcessivecollisions;
918 u32 tx_stat_dot3statslatecollisions;
919 u32 tx_stat_ifhcoutucastpkts;
920 u32 tx_stat_ifhcoutmulticastpkts;
921 u32 tx_stat_ifhcoutbroadcastpkts;
922 u32 tx_stat_etherstatspkts64octets;
923 u32 tx_stat_etherstatspkts65octetsto127octets;
924 u32 tx_stat_etherstatspkts128octetsto255octets;
925 u32 tx_stat_etherstatspkts256octetsto511octets;
926 u32 tx_stat_etherstatspkts512octetsto1023octets;
927 u32 tx_stat_etherstatspkts1024octetsto1522octets;
928 u32 tx_stat_etherstatspktsover1522octets;
929 u32 tx_stat_dot3statsinternalmactransmiterrors;
930};
931
932
933struct bmac_stats {
934 u32 tx_stat_gtpkt_lo;
935 u32 tx_stat_gtpkt_hi;
936 u32 tx_stat_gtxpf_lo;
937 u32 tx_stat_gtxpf_hi;
938 u32 tx_stat_gtfcs_lo;
939 u32 tx_stat_gtfcs_hi;
940 u32 tx_stat_gtmca_lo;
941 u32 tx_stat_gtmca_hi;
942 u32 tx_stat_gtbca_lo;
943 u32 tx_stat_gtbca_hi;
944 u32 tx_stat_gtfrg_lo;
945 u32 tx_stat_gtfrg_hi;
946 u32 tx_stat_gtovr_lo;
947 u32 tx_stat_gtovr_hi;
948 u32 tx_stat_gt64_lo;
949 u32 tx_stat_gt64_hi;
950 u32 tx_stat_gt127_lo;
951 u32 tx_stat_gt127_hi;
952 u32 tx_stat_gt255_lo;
953 u32 tx_stat_gt255_hi;
954 u32 tx_stat_gt511_lo;
955 u32 tx_stat_gt511_hi;
956 u32 tx_stat_gt1023_lo;
957 u32 tx_stat_gt1023_hi;
958 u32 tx_stat_gt1518_lo;
959 u32 tx_stat_gt1518_hi;
960 u32 tx_stat_gt2047_lo;
961 u32 tx_stat_gt2047_hi;
962 u32 tx_stat_gt4095_lo;
963 u32 tx_stat_gt4095_hi;
964 u32 tx_stat_gt9216_lo;
965 u32 tx_stat_gt9216_hi;
966 u32 tx_stat_gt16383_lo;
967 u32 tx_stat_gt16383_hi;
968 u32 tx_stat_gtmax_lo;
969 u32 tx_stat_gtmax_hi;
970 u32 tx_stat_gtufl_lo;
971 u32 tx_stat_gtufl_hi;
972 u32 tx_stat_gterr_lo;
973 u32 tx_stat_gterr_hi;
974 u32 tx_stat_gtbyt_lo;
975 u32 tx_stat_gtbyt_hi;
976
977 u32 rx_stat_gr64_lo;
978 u32 rx_stat_gr64_hi;
979 u32 rx_stat_gr127_lo;
980 u32 rx_stat_gr127_hi;
981 u32 rx_stat_gr255_lo;
982 u32 rx_stat_gr255_hi;
983 u32 rx_stat_gr511_lo;
984 u32 rx_stat_gr511_hi;
985 u32 rx_stat_gr1023_lo;
986 u32 rx_stat_gr1023_hi;
987 u32 rx_stat_gr1518_lo;
988 u32 rx_stat_gr1518_hi;
989 u32 rx_stat_gr2047_lo;
990 u32 rx_stat_gr2047_hi;
991 u32 rx_stat_gr4095_lo;
992 u32 rx_stat_gr4095_hi;
993 u32 rx_stat_gr9216_lo;
994 u32 rx_stat_gr9216_hi;
995 u32 rx_stat_gr16383_lo;
996 u32 rx_stat_gr16383_hi;
997 u32 rx_stat_grmax_lo;
998 u32 rx_stat_grmax_hi;
999 u32 rx_stat_grpkt_lo;
1000 u32 rx_stat_grpkt_hi;
1001 u32 rx_stat_grfcs_lo;
1002 u32 rx_stat_grfcs_hi;
1003 u32 rx_stat_grmca_lo;
1004 u32 rx_stat_grmca_hi;
1005 u32 rx_stat_grbca_lo;
1006 u32 rx_stat_grbca_hi;
1007 u32 rx_stat_grxcf_lo;
1008 u32 rx_stat_grxcf_hi;
1009 u32 rx_stat_grxpf_lo;
1010 u32 rx_stat_grxpf_hi;
1011 u32 rx_stat_grxuo_lo;
1012 u32 rx_stat_grxuo_hi;
1013 u32 rx_stat_grjbr_lo;
1014 u32 rx_stat_grjbr_hi;
1015 u32 rx_stat_grovr_lo;
1016 u32 rx_stat_grovr_hi;
1017 u32 rx_stat_grflr_lo;
1018 u32 rx_stat_grflr_hi;
1019 u32 rx_stat_grmeg_lo;
1020 u32 rx_stat_grmeg_hi;
1021 u32 rx_stat_grmeb_lo;
1022 u32 rx_stat_grmeb_hi;
1023 u32 rx_stat_grbyt_lo;
1024 u32 rx_stat_grbyt_hi;
1025 u32 rx_stat_grund_lo;
1026 u32 rx_stat_grund_hi;
1027 u32 rx_stat_grfrg_lo;
1028 u32 rx_stat_grfrg_hi;
1029 u32 rx_stat_grerb_lo;
1030 u32 rx_stat_grerb_hi;
1031 u32 rx_stat_grfre_lo;
1032 u32 rx_stat_grfre_hi;
1033 u32 rx_stat_gripj_lo;
1034 u32 rx_stat_gripj_hi;
1035};
1036
1037
1038union mac_stats {
1039 struct emac_stats emac_stats;
1040 struct bmac_stats bmac_stats;
1041};
1042
1043
1044struct mac_stx {
1045 /* in_bad_octets */
1046 u32 rx_stat_ifhcinbadoctets_hi;
1047 u32 rx_stat_ifhcinbadoctets_lo;
1048
1049 /* out_bad_octets */
1050 u32 tx_stat_ifhcoutbadoctets_hi;
1051 u32 tx_stat_ifhcoutbadoctets_lo;
1052
1053 /* crc_receive_errors */
1054 u32 rx_stat_dot3statsfcserrors_hi;
1055 u32 rx_stat_dot3statsfcserrors_lo;
1056 /* alignment_errors */
1057 u32 rx_stat_dot3statsalignmenterrors_hi;
1058 u32 rx_stat_dot3statsalignmenterrors_lo;
1059 /* carrier_sense_errors */
1060 u32 rx_stat_dot3statscarriersenseerrors_hi;
1061 u32 rx_stat_dot3statscarriersenseerrors_lo;
1062 /* false_carrier_detections */
1063 u32 rx_stat_falsecarriererrors_hi;
1064 u32 rx_stat_falsecarriererrors_lo;
1065
1066 /* runt_packets_received */
1067 u32 rx_stat_etherstatsundersizepkts_hi;
1068 u32 rx_stat_etherstatsundersizepkts_lo;
1069 /* jabber_packets_received */
1070 u32 rx_stat_dot3statsframestoolong_hi;
1071 u32 rx_stat_dot3statsframestoolong_lo;
1072
1073 /* error_runt_packets_received */
1074 u32 rx_stat_etherstatsfragments_hi;
1075 u32 rx_stat_etherstatsfragments_lo;
1076 /* error_jabber_packets_received */
1077 u32 rx_stat_etherstatsjabbers_hi;
1078 u32 rx_stat_etherstatsjabbers_lo;
1079
1080 /* control_frames_received */
1081 u32 rx_stat_maccontrolframesreceived_hi;
1082 u32 rx_stat_maccontrolframesreceived_lo;
1083 u32 rx_stat_bmac_xpf_hi;
1084 u32 rx_stat_bmac_xpf_lo;
1085 u32 rx_stat_bmac_xcf_hi;
1086 u32 rx_stat_bmac_xcf_lo;
1087
1088 /* xoff_state_entered */
1089 u32 rx_stat_xoffstateentered_hi;
1090 u32 rx_stat_xoffstateentered_lo;
1091 /* pause_xon_frames_received */
1092 u32 rx_stat_xonpauseframesreceived_hi;
1093 u32 rx_stat_xonpauseframesreceived_lo;
1094 /* pause_xoff_frames_received */
1095 u32 rx_stat_xoffpauseframesreceived_hi;
1096 u32 rx_stat_xoffpauseframesreceived_lo;
1097 /* pause_xon_frames_transmitted */
1098 u32 tx_stat_outxonsent_hi;
1099 u32 tx_stat_outxonsent_lo;
1100 /* pause_xoff_frames_transmitted */
1101 u32 tx_stat_outxoffsent_hi;
1102 u32 tx_stat_outxoffsent_lo;
1103 /* flow_control_done */
1104 u32 tx_stat_flowcontroldone_hi;
1105 u32 tx_stat_flowcontroldone_lo;
1106
1107 /* ether_stats_collisions */
1108 u32 tx_stat_etherstatscollisions_hi;
1109 u32 tx_stat_etherstatscollisions_lo;
1110 /* single_collision_transmit_frames */
1111 u32 tx_stat_dot3statssinglecollisionframes_hi;
1112 u32 tx_stat_dot3statssinglecollisionframes_lo;
1113 /* multiple_collision_transmit_frames */
1114 u32 tx_stat_dot3statsmultiplecollisionframes_hi;
1115 u32 tx_stat_dot3statsmultiplecollisionframes_lo;
1116 /* deferred_transmissions */
1117 u32 tx_stat_dot3statsdeferredtransmissions_hi;
1118 u32 tx_stat_dot3statsdeferredtransmissions_lo;
1119 /* excessive_collision_frames */
1120 u32 tx_stat_dot3statsexcessivecollisions_hi;
1121 u32 tx_stat_dot3statsexcessivecollisions_lo;
1122 /* late_collision_frames */
1123 u32 tx_stat_dot3statslatecollisions_hi;
1124 u32 tx_stat_dot3statslatecollisions_lo;
1125
1126 /* frames_transmitted_64_bytes */
1127 u32 tx_stat_etherstatspkts64octets_hi;
1128 u32 tx_stat_etherstatspkts64octets_lo;
1129 /* frames_transmitted_65_127_bytes */
1130 u32 tx_stat_etherstatspkts65octetsto127octets_hi;
1131 u32 tx_stat_etherstatspkts65octetsto127octets_lo;
1132 /* frames_transmitted_128_255_bytes */
1133 u32 tx_stat_etherstatspkts128octetsto255octets_hi;
1134 u32 tx_stat_etherstatspkts128octetsto255octets_lo;
1135 /* frames_transmitted_256_511_bytes */
1136 u32 tx_stat_etherstatspkts256octetsto511octets_hi;
1137 u32 tx_stat_etherstatspkts256octetsto511octets_lo;
1138 /* frames_transmitted_512_1023_bytes */
1139 u32 tx_stat_etherstatspkts512octetsto1023octets_hi;
1140 u32 tx_stat_etherstatspkts512octetsto1023octets_lo;
1141 /* frames_transmitted_1024_1522_bytes */
1142 u32 tx_stat_etherstatspkts1024octetsto1522octets_hi;
1143 u32 tx_stat_etherstatspkts1024octetsto1522octets_lo;
1144 /* frames_transmitted_1523_9022_bytes */
1145 u32 tx_stat_etherstatspktsover1522octets_hi;
1146 u32 tx_stat_etherstatspktsover1522octets_lo;
1147 u32 tx_stat_bmac_2047_hi;
1148 u32 tx_stat_bmac_2047_lo;
1149 u32 tx_stat_bmac_4095_hi;
1150 u32 tx_stat_bmac_4095_lo;
1151 u32 tx_stat_bmac_9216_hi;
1152 u32 tx_stat_bmac_9216_lo;
1153 u32 tx_stat_bmac_16383_hi;
1154 u32 tx_stat_bmac_16383_lo;
1155
1156 /* internal_mac_transmit_errors */
1157 u32 tx_stat_dot3statsinternalmactransmiterrors_hi;
1158 u32 tx_stat_dot3statsinternalmactransmiterrors_lo;
1159
1160 /* if_out_discards */
1161 u32 tx_stat_bmac_ufl_hi;
1162 u32 tx_stat_bmac_ufl_lo;
1163};
1164
1165
1166#define MAC_STX_IDX_MAX 2
1167
1168struct host_port_stats {
1169 u32 host_port_stats_start;
1170
1171 struct mac_stx mac_stx[MAC_STX_IDX_MAX];
1172
1173 u32 brb_drop_hi;
1174 u32 brb_drop_lo;
1175
1176 u32 host_port_stats_end;
1177};
1178
1179
1180struct host_func_stats {
1181 u32 host_func_stats_start;
1182
1183 u32 total_bytes_received_hi;
1184 u32 total_bytes_received_lo;
1185
1186 u32 total_bytes_transmitted_hi;
1187 u32 total_bytes_transmitted_lo;
1188
1189 u32 total_unicast_packets_received_hi;
1190 u32 total_unicast_packets_received_lo;
1191
1192 u32 total_multicast_packets_received_hi;
1193 u32 total_multicast_packets_received_lo;
1194
1195 u32 total_broadcast_packets_received_hi;
1196 u32 total_broadcast_packets_received_lo;
1197
1198 u32 total_unicast_packets_transmitted_hi;
1199 u32 total_unicast_packets_transmitted_lo;
1200
1201 u32 total_multicast_packets_transmitted_hi;
1202 u32 total_multicast_packets_transmitted_lo;
1203
1204 u32 total_broadcast_packets_transmitted_hi;
1205 u32 total_broadcast_packets_transmitted_lo;
1206
1207 u32 valid_bytes_received_hi;
1208 u32 valid_bytes_received_lo;
1209
1210 u32 host_func_stats_end;
1211};
1212
1213
755#define BCM_5710_FW_MAJOR_VERSION 4 1214#define BCM_5710_FW_MAJOR_VERSION 4
756#define BCM_5710_FW_MINOR_VERSION 0 1215#define BCM_5710_FW_MINOR_VERSION 5
757#define BCM_5710_FW_REVISION_VERSION 14 1216#define BCM_5710_FW_REVISION_VERSION 1
758#define BCM_5710_FW_COMPILE_FLAGS 1 1217#define BCM_5710_FW_COMPILE_FLAGS 1
759 1218
760 1219
@@ -793,7 +1252,7 @@ struct doorbell_hdr {
793}; 1252};
794 1253
795/* 1254/*
796 * doorbell message send to the chip 1255 * doorbell message sent to the chip
797 */ 1256 */
798struct doorbell { 1257struct doorbell {
799#if defined(__BIG_ENDIAN) 1258#if defined(__BIG_ENDIAN)
@@ -849,8 +1308,10 @@ struct parsing_flags {
849 u16 flags; 1308 u16 flags;
850#define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE (0x1<<0) 1309#define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE (0x1<<0)
851#define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE_SHIFT 0 1310#define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE_SHIFT 0
852#define PARSING_FLAGS_NUMBER_OF_NESTED_VLANS (0x3<<1) 1311#define PARSING_FLAGS_VLAN (0x1<<1)
853#define PARSING_FLAGS_NUMBER_OF_NESTED_VLANS_SHIFT 1 1312#define PARSING_FLAGS_VLAN_SHIFT 1
1313#define PARSING_FLAGS_EXTRA_VLAN (0x1<<2)
1314#define PARSING_FLAGS_EXTRA_VLAN_SHIFT 2
854#define PARSING_FLAGS_OVER_ETHERNET_PROTOCOL (0x3<<3) 1315#define PARSING_FLAGS_OVER_ETHERNET_PROTOCOL (0x3<<3)
855#define PARSING_FLAGS_OVER_ETHERNET_PROTOCOL_SHIFT 3 1316#define PARSING_FLAGS_OVER_ETHERNET_PROTOCOL_SHIFT 3
856#define PARSING_FLAGS_IP_OPTIONS (0x1<<5) 1317#define PARSING_FLAGS_IP_OPTIONS (0x1<<5)
@@ -874,6 +1335,12 @@ struct parsing_flags {
874}; 1335};
875 1336
876 1337
1338struct regpair {
1339 u32 lo;
1340 u32 hi;
1341};
1342
1343
877/* 1344/*
878 * dmae command structure 1345 * dmae command structure
879 */ 1346 */
@@ -901,8 +1368,10 @@ struct dmae_command {
901#define DMAE_COMMAND_SRC_RESET_SHIFT 13 1368#define DMAE_COMMAND_SRC_RESET_SHIFT 13
902#define DMAE_COMMAND_DST_RESET (0x1<<14) 1369#define DMAE_COMMAND_DST_RESET (0x1<<14)
903#define DMAE_COMMAND_DST_RESET_SHIFT 14 1370#define DMAE_COMMAND_DST_RESET_SHIFT 14
904#define DMAE_COMMAND_RESERVED0 (0x1FFFF<<15) 1371#define DMAE_COMMAND_E1HVN (0x3<<15)
905#define DMAE_COMMAND_RESERVED0_SHIFT 15 1372#define DMAE_COMMAND_E1HVN_SHIFT 15
1373#define DMAE_COMMAND_RESERVED0 (0x7FFF<<17)
1374#define DMAE_COMMAND_RESERVED0_SHIFT 17
906 u32 src_addr_lo; 1375 u32 src_addr_lo;
907 u32 src_addr_hi; 1376 u32 src_addr_hi;
908 u32 dst_addr_lo; 1377 u32 dst_addr_lo;
@@ -952,72 +1421,107 @@ struct double_regpair {
952 1421
953 1422
954/* 1423/*
955 * The eth Rx Buffer Descriptor 1424 * The eth storm context of Ustorm (configuration part)
956 */
957struct eth_rx_bd {
958 u32 addr_lo;
959 u32 addr_hi;
960};
961
962/*
963 * The eth storm context of Ustorm
964 */ 1425 */
965struct ustorm_eth_st_context { 1426struct ustorm_eth_st_context_config {
966#if defined(__BIG_ENDIAN) 1427#if defined(__BIG_ENDIAN)
967 u8 sb_index_number; 1428 u8 flags;
1429#define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_MC_ALIGNMENT (0x1<<0)
1430#define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_MC_ALIGNMENT_SHIFT 0
1431#define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_DYNAMIC_HC (0x1<<1)
1432#define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_DYNAMIC_HC_SHIFT 1
1433#define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_TPA (0x1<<2)
1434#define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_TPA_SHIFT 2
1435#define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_SGE_RING (0x1<<3)
1436#define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_SGE_RING_SHIFT 3
1437#define __USTORM_ETH_ST_CONTEXT_CONFIG_RESERVED0 (0xF<<4)
1438#define __USTORM_ETH_ST_CONTEXT_CONFIG_RESERVED0_SHIFT 4
968 u8 status_block_id; 1439 u8 status_block_id;
969 u8 __local_rx_bd_cons; 1440 u8 clientId;
970 u8 __local_rx_bd_prod; 1441 u8 sb_index_numbers;
1442#define USTORM_ETH_ST_CONTEXT_CONFIG_CQE_SB_INDEX_NUMBER (0xF<<0)
1443#define USTORM_ETH_ST_CONTEXT_CONFIG_CQE_SB_INDEX_NUMBER_SHIFT 0
1444#define USTORM_ETH_ST_CONTEXT_CONFIG_BD_SB_INDEX_NUMBER (0xF<<4)
1445#define USTORM_ETH_ST_CONTEXT_CONFIG_BD_SB_INDEX_NUMBER_SHIFT 4
971#elif defined(__LITTLE_ENDIAN) 1446#elif defined(__LITTLE_ENDIAN)
972 u8 __local_rx_bd_prod; 1447 u8 sb_index_numbers;
973 u8 __local_rx_bd_cons; 1448#define USTORM_ETH_ST_CONTEXT_CONFIG_CQE_SB_INDEX_NUMBER (0xF<<0)
1449#define USTORM_ETH_ST_CONTEXT_CONFIG_CQE_SB_INDEX_NUMBER_SHIFT 0
1450#define USTORM_ETH_ST_CONTEXT_CONFIG_BD_SB_INDEX_NUMBER (0xF<<4)
1451#define USTORM_ETH_ST_CONTEXT_CONFIG_BD_SB_INDEX_NUMBER_SHIFT 4
1452 u8 clientId;
974 u8 status_block_id; 1453 u8 status_block_id;
975 u8 sb_index_number; 1454 u8 flags;
1455#define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_MC_ALIGNMENT (0x1<<0)
1456#define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_MC_ALIGNMENT_SHIFT 0
1457#define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_DYNAMIC_HC (0x1<<1)
1458#define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_DYNAMIC_HC_SHIFT 1
1459#define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_TPA (0x1<<2)
1460#define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_TPA_SHIFT 2
1461#define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_SGE_RING (0x1<<3)
1462#define USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_SGE_RING_SHIFT 3
1463#define __USTORM_ETH_ST_CONTEXT_CONFIG_RESERVED0 (0xF<<4)
1464#define __USTORM_ETH_ST_CONTEXT_CONFIG_RESERVED0_SHIFT 4
976#endif 1465#endif
977#if defined(__BIG_ENDIAN) 1466#if defined(__BIG_ENDIAN)
978 u16 rcq_cons; 1467 u16 bd_buff_size;
979 u16 rx_bd_cons; 1468 u16 mc_alignment_size;
980#elif defined(__LITTLE_ENDIAN) 1469#elif defined(__LITTLE_ENDIAN)
981 u16 rx_bd_cons; 1470 u16 mc_alignment_size;
982 u16 rcq_cons; 1471 u16 bd_buff_size;
983#endif 1472#endif
984 u32 rx_bd_page_base_lo;
985 u32 rx_bd_page_base_hi;
986 u32 rcq_base_address_lo;
987 u32 rcq_base_address_hi;
988#if defined(__BIG_ENDIAN) 1473#if defined(__BIG_ENDIAN)
989 u16 __num_of_returned_cqes; 1474 u8 __local_sge_prod;
990 u8 num_rss; 1475 u8 __local_bd_prod;
991 u8 flags; 1476 u16 sge_buff_size;
992#define USTORM_ETH_ST_CONTEXT_ENABLE_MC_ALIGNMENT (0x1<<0)
993#define USTORM_ETH_ST_CONTEXT_ENABLE_MC_ALIGNMENT_SHIFT 0
994#define USTORM_ETH_ST_CONTEXT_ENABLE_DYNAMIC_HC (0x1<<1)
995#define USTORM_ETH_ST_CONTEXT_ENABLE_DYNAMIC_HC_SHIFT 1
996#define USTORM_ETH_ST_CONTEXT_ENABLE_TPA (0x1<<2)
997#define USTORM_ETH_ST_CONTEXT_ENABLE_TPA_SHIFT 2
998#define __USTORM_ETH_ST_CONTEXT_RESERVED0 (0x1F<<3)
999#define __USTORM_ETH_ST_CONTEXT_RESERVED0_SHIFT 3
1000#elif defined(__LITTLE_ENDIAN) 1477#elif defined(__LITTLE_ENDIAN)
1001 u8 flags; 1478 u16 sge_buff_size;
1002#define USTORM_ETH_ST_CONTEXT_ENABLE_MC_ALIGNMENT (0x1<<0) 1479 u8 __local_bd_prod;
1003#define USTORM_ETH_ST_CONTEXT_ENABLE_MC_ALIGNMENT_SHIFT 0 1480 u8 __local_sge_prod;
1004#define USTORM_ETH_ST_CONTEXT_ENABLE_DYNAMIC_HC (0x1<<1)
1005#define USTORM_ETH_ST_CONTEXT_ENABLE_DYNAMIC_HC_SHIFT 1
1006#define USTORM_ETH_ST_CONTEXT_ENABLE_TPA (0x1<<2)
1007#define USTORM_ETH_ST_CONTEXT_ENABLE_TPA_SHIFT 2
1008#define __USTORM_ETH_ST_CONTEXT_RESERVED0 (0x1F<<3)
1009#define __USTORM_ETH_ST_CONTEXT_RESERVED0_SHIFT 3
1010 u8 num_rss;
1011 u16 __num_of_returned_cqes;
1012#endif 1481#endif
1013#if defined(__BIG_ENDIAN) 1482#if defined(__BIG_ENDIAN)
1014 u16 mc_alignment_size; 1483 u16 __bd_cons;
1015 u16 agg_threshold; 1484 u16 __sge_cons;
1016#elif defined(__LITTLE_ENDIAN) 1485#elif defined(__LITTLE_ENDIAN)
1017 u16 agg_threshold; 1486 u16 __sge_cons;
1018 u16 mc_alignment_size; 1487 u16 __bd_cons;
1019#endif 1488#endif
1489 u32 bd_page_base_lo;
1490 u32 bd_page_base_hi;
1491 u32 sge_page_base_lo;
1492 u32 sge_page_base_hi;
1493};
1494
1495/*
1496 * The eth Rx Buffer Descriptor
1497 */
1498struct eth_rx_bd {
1499 u32 addr_lo;
1500 u32 addr_hi;
1501};
1502
1503/*
1504 * The eth Rx SGE Descriptor
1505 */
1506struct eth_rx_sge {
1507 u32 addr_lo;
1508 u32 addr_hi;
1509};
1510
1511/*
1512 * Local BDs and SGEs rings (in ETH)
1513 */
1514struct eth_local_rx_rings {
1020 struct eth_rx_bd __local_bd_ring[16]; 1515 struct eth_rx_bd __local_bd_ring[16];
1516 struct eth_rx_sge __local_sge_ring[12];
1517};
1518
1519/*
1520 * The eth storm context of Ustorm
1521 */
1522struct ustorm_eth_st_context {
1523 struct ustorm_eth_st_context_config common;
1524 struct eth_local_rx_rings __rings;
1021}; 1525};
1022 1526
1023/* 1527/*
@@ -1088,9 +1592,9 @@ struct xstorm_eth_extra_ag_context_section {
1088#if defined(__BIG_ENDIAN) 1592#if defined(__BIG_ENDIAN)
1089 u16 __reserved3; 1593 u16 __reserved3;
1090 u8 __reserved2; 1594 u8 __reserved2;
1091 u8 __agg_misc7; 1595 u8 __da_only_cnt;
1092#elif defined(__LITTLE_ENDIAN) 1596#elif defined(__LITTLE_ENDIAN)
1093 u8 __agg_misc7; 1597 u8 __da_only_cnt;
1094 u8 __reserved2; 1598 u8 __reserved2;
1095 u16 __reserved3; 1599 u16 __reserved3;
1096#endif 1600#endif
@@ -1368,7 +1872,13 @@ struct timers_block_context {
1368 u32 __reserved_0; 1872 u32 __reserved_0;
1369 u32 __reserved_1; 1873 u32 __reserved_1;
1370 u32 __reserved_2; 1874 u32 __reserved_2;
1371 u32 __reserved_flags; 1875 u32 flags;
1876#define __TIMERS_BLOCK_CONTEXT_NUM_OF_ACTIVE_TIMERS (0x3<<0)
1877#define __TIMERS_BLOCK_CONTEXT_NUM_OF_ACTIVE_TIMERS_SHIFT 0
1878#define TIMERS_BLOCK_CONTEXT_CONN_VALID_FLG (0x1<<2)
1879#define TIMERS_BLOCK_CONTEXT_CONN_VALID_FLG_SHIFT 2
1880#define __TIMERS_BLOCK_CONTEXT_RESERVED0 (0x1FFFFFFF<<3)
1881#define __TIMERS_BLOCK_CONTEXT_RESERVED0_SHIFT 3
1372}; 1882};
1373 1883
1374/* 1884/*
@@ -1478,11 +1988,19 @@ struct xstorm_eth_st_context {
1478 u32 tx_bd_page_base_hi; 1988 u32 tx_bd_page_base_hi;
1479#if defined(__BIG_ENDIAN) 1989#if defined(__BIG_ENDIAN)
1480 u16 tx_bd_cons; 1990 u16 tx_bd_cons;
1481 u8 __reserved0; 1991 u8 statistics_data;
1992#define XSTORM_ETH_ST_CONTEXT_STATISTICS_COUNTER_ID (0x7F<<0)
1993#define XSTORM_ETH_ST_CONTEXT_STATISTICS_COUNTER_ID_SHIFT 0
1994#define XSTORM_ETH_ST_CONTEXT_STATISTICS_ENABLE (0x1<<7)
1995#define XSTORM_ETH_ST_CONTEXT_STATISTICS_ENABLE_SHIFT 7
1482 u8 __local_tx_bd_prod; 1996 u8 __local_tx_bd_prod;
1483#elif defined(__LITTLE_ENDIAN) 1997#elif defined(__LITTLE_ENDIAN)
1484 u8 __local_tx_bd_prod; 1998 u8 __local_tx_bd_prod;
1485 u8 __reserved0; 1999 u8 statistics_data;
2000#define XSTORM_ETH_ST_CONTEXT_STATISTICS_COUNTER_ID (0x7F<<0)
2001#define XSTORM_ETH_ST_CONTEXT_STATISTICS_COUNTER_ID_SHIFT 0
2002#define XSTORM_ETH_ST_CONTEXT_STATISTICS_ENABLE (0x1<<7)
2003#define XSTORM_ETH_ST_CONTEXT_STATISTICS_ENABLE_SHIFT 7
1486 u16 tx_bd_cons; 2004 u16 tx_bd_cons;
1487#endif 2005#endif
1488 u32 db_data_addr_lo; 2006 u32 db_data_addr_lo;
@@ -1559,7 +2077,7 @@ struct eth_tx_doorbell {
1559struct ustorm_def_status_block { 2077struct ustorm_def_status_block {
1560 u16 index_values[HC_USTORM_DEF_SB_NUM_INDICES]; 2078 u16 index_values[HC_USTORM_DEF_SB_NUM_INDICES];
1561 u16 status_block_index; 2079 u16 status_block_index;
1562 u8 reserved0; 2080 u8 func;
1563 u8 status_block_id; 2081 u8 status_block_id;
1564 u32 __flags; 2082 u32 __flags;
1565}; 2083};
@@ -1570,7 +2088,7 @@ struct ustorm_def_status_block {
1570struct cstorm_def_status_block { 2088struct cstorm_def_status_block {
1571 u16 index_values[HC_CSTORM_DEF_SB_NUM_INDICES]; 2089 u16 index_values[HC_CSTORM_DEF_SB_NUM_INDICES];
1572 u16 status_block_index; 2090 u16 status_block_index;
1573 u8 reserved0; 2091 u8 func;
1574 u8 status_block_id; 2092 u8 status_block_id;
1575 u32 __flags; 2093 u32 __flags;
1576}; 2094};
@@ -1581,7 +2099,7 @@ struct cstorm_def_status_block {
1581struct xstorm_def_status_block { 2099struct xstorm_def_status_block {
1582 u16 index_values[HC_XSTORM_DEF_SB_NUM_INDICES]; 2100 u16 index_values[HC_XSTORM_DEF_SB_NUM_INDICES];
1583 u16 status_block_index; 2101 u16 status_block_index;
1584 u8 reserved0; 2102 u8 func;
1585 u8 status_block_id; 2103 u8 status_block_id;
1586 u32 __flags; 2104 u32 __flags;
1587}; 2105};
@@ -1592,7 +2110,7 @@ struct xstorm_def_status_block {
1592struct tstorm_def_status_block { 2110struct tstorm_def_status_block {
1593 u16 index_values[HC_TSTORM_DEF_SB_NUM_INDICES]; 2111 u16 index_values[HC_TSTORM_DEF_SB_NUM_INDICES];
1594 u16 status_block_index; 2112 u16 status_block_index;
1595 u8 reserved0; 2113 u8 func;
1596 u8 status_block_id; 2114 u8 status_block_id;
1597 u32 __flags; 2115 u32 __flags;
1598}; 2116};
@@ -1615,7 +2133,7 @@ struct host_def_status_block {
1615struct ustorm_status_block { 2133struct ustorm_status_block {
1616 u16 index_values[HC_USTORM_SB_NUM_INDICES]; 2134 u16 index_values[HC_USTORM_SB_NUM_INDICES];
1617 u16 status_block_index; 2135 u16 status_block_index;
1618 u8 reserved0; 2136 u8 func;
1619 u8 status_block_id; 2137 u8 status_block_id;
1620 u32 __flags; 2138 u32 __flags;
1621}; 2139};
@@ -1626,7 +2144,7 @@ struct ustorm_status_block {
1626struct cstorm_status_block { 2144struct cstorm_status_block {
1627 u16 index_values[HC_CSTORM_SB_NUM_INDICES]; 2145 u16 index_values[HC_CSTORM_SB_NUM_INDICES];
1628 u16 status_block_index; 2146 u16 status_block_index;
1629 u8 reserved0; 2147 u8 func;
1630 u8 status_block_id; 2148 u8 status_block_id;
1631 u32 __flags; 2149 u32 __flags;
1632}; 2150};
@@ -1664,20 +2182,21 @@ struct eth_dynamic_hc_config {
1664 * regular eth FP CQE parameters struct 2182 * regular eth FP CQE parameters struct
1665 */ 2183 */
1666struct eth_fast_path_rx_cqe { 2184struct eth_fast_path_rx_cqe {
1667 u8 type; 2185 u8 type_error_flags;
1668 u8 error_type_flags; 2186#define ETH_FAST_PATH_RX_CQE_TYPE (0x1<<0)
1669#define ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG (0x1<<0) 2187#define ETH_FAST_PATH_RX_CQE_TYPE_SHIFT 0
1670#define ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG_SHIFT 0 2188#define ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG (0x1<<1)
1671#define ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG (0x1<<1) 2189#define ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG_SHIFT 1
1672#define ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG_SHIFT 1 2190#define ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG (0x1<<2)
1673#define ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG (0x1<<2) 2191#define ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG_SHIFT 2
1674#define ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG_SHIFT 2 2192#define ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG (0x1<<3)
1675#define ETH_FAST_PATH_RX_CQE_START_FLG (0x1<<3) 2193#define ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG_SHIFT 3
1676#define ETH_FAST_PATH_RX_CQE_START_FLG_SHIFT 3 2194#define ETH_FAST_PATH_RX_CQE_START_FLG (0x1<<4)
1677#define ETH_FAST_PATH_RX_CQE_END_FLG (0x1<<4) 2195#define ETH_FAST_PATH_RX_CQE_START_FLG_SHIFT 4
1678#define ETH_FAST_PATH_RX_CQE_END_FLG_SHIFT 4 2196#define ETH_FAST_PATH_RX_CQE_END_FLG (0x1<<5)
1679#define ETH_FAST_PATH_RX_CQE_RESERVED0 (0x7<<5) 2197#define ETH_FAST_PATH_RX_CQE_END_FLG_SHIFT 5
1680#define ETH_FAST_PATH_RX_CQE_RESERVED0_SHIFT 5 2198#define ETH_FAST_PATH_RX_CQE_RESERVED0 (0x3<<6)
2199#define ETH_FAST_PATH_RX_CQE_RESERVED0_SHIFT 6
1681 u8 status_flags; 2200 u8 status_flags;
1682#define ETH_FAST_PATH_RX_CQE_RSS_HASH_TYPE (0x7<<0) 2201#define ETH_FAST_PATH_RX_CQE_RSS_HASH_TYPE (0x7<<0)
1683#define ETH_FAST_PATH_RX_CQE_RSS_HASH_TYPE_SHIFT 0 2202#define ETH_FAST_PATH_RX_CQE_RSS_HASH_TYPE_SHIFT 0
@@ -1692,11 +2211,13 @@ struct eth_fast_path_rx_cqe {
1692#define ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG (0x1<<7) 2211#define ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG (0x1<<7)
1693#define ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG_SHIFT 7 2212#define ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG_SHIFT 7
1694 u8 placement_offset; 2213 u8 placement_offset;
2214 u8 queue_index;
1695 u32 rss_hash_result; 2215 u32 rss_hash_result;
1696 u16 vlan_tag; 2216 u16 vlan_tag;
1697 u16 pkt_len; 2217 u16 pkt_len;
1698 u16 queue_index; 2218 u16 len_on_bd;
1699 struct parsing_flags pars_flags; 2219 struct parsing_flags pars_flags;
2220 u16 sgl[8];
1700}; 2221};
1701 2222
1702 2223
@@ -1710,6 +2231,23 @@ struct eth_halt_ramrod_data {
1710 2231
1711 2232
1712/* 2233/*
2234 * The data for statistics query ramrod
2235 */
2236struct eth_query_ramrod_data {
2237#if defined(__BIG_ENDIAN)
2238 u8 reserved0;
2239 u8 collect_port_1b;
2240 u16 drv_counter;
2241#elif defined(__LITTLE_ENDIAN)
2242 u16 drv_counter;
2243 u8 collect_port_1b;
2244 u8 reserved0;
2245#endif
2246 u32 ctr_id_vector;
2247};
2248
2249
2250/*
1713 * Place holder for ramrods protocol specific data 2251 * Place holder for ramrods protocol specific data
1714 */ 2252 */
1715struct ramrod_data { 2253struct ramrod_data {
@@ -1739,15 +2277,20 @@ struct eth_rx_bd_next_page {
1739 * Eth Rx Cqe structure- general structure for ramrods 2277 * Eth Rx Cqe structure- general structure for ramrods
1740 */ 2278 */
1741struct common_ramrod_eth_rx_cqe { 2279struct common_ramrod_eth_rx_cqe {
1742 u8 type; 2280 u8 ramrod_type;
2281#define COMMON_RAMROD_ETH_RX_CQE_TYPE (0x1<<0)
2282#define COMMON_RAMROD_ETH_RX_CQE_TYPE_SHIFT 0
2283#define COMMON_RAMROD_ETH_RX_CQE_RESERVED0 (0x7F<<1)
2284#define COMMON_RAMROD_ETH_RX_CQE_RESERVED0_SHIFT 1
1743 u8 conn_type_3b; 2285 u8 conn_type_3b;
1744 u16 reserved; 2286 u16 reserved1;
1745 u32 conn_and_cmd_data; 2287 u32 conn_and_cmd_data;
1746#define COMMON_RAMROD_ETH_RX_CQE_CID (0xFFFFFF<<0) 2288#define COMMON_RAMROD_ETH_RX_CQE_CID (0xFFFFFF<<0)
1747#define COMMON_RAMROD_ETH_RX_CQE_CID_SHIFT 0 2289#define COMMON_RAMROD_ETH_RX_CQE_CID_SHIFT 0
1748#define COMMON_RAMROD_ETH_RX_CQE_CMD_ID (0xFF<<24) 2290#define COMMON_RAMROD_ETH_RX_CQE_CMD_ID (0xFF<<24)
1749#define COMMON_RAMROD_ETH_RX_CQE_CMD_ID_SHIFT 24 2291#define COMMON_RAMROD_ETH_RX_CQE_CMD_ID_SHIFT 24
1750 struct ramrod_data protocol_data; 2292 struct ramrod_data protocol_data;
2293 u32 reserved2[4];
1751}; 2294};
1752 2295
1753/* 2296/*
@@ -1756,8 +2299,7 @@ struct common_ramrod_eth_rx_cqe {
1756struct eth_rx_cqe_next_page { 2299struct eth_rx_cqe_next_page {
1757 u32 addr_lo; 2300 u32 addr_lo;
1758 u32 addr_hi; 2301 u32 addr_hi;
1759 u32 reserved0; 2302 u32 reserved[6];
1760 u32 reserved1;
1761}; 2303};
1762 2304
1763/* 2305/*
@@ -1787,11 +2329,6 @@ struct spe_hdr {
1787 u16 reserved; 2329 u16 reserved;
1788}; 2330};
1789 2331
1790struct regpair {
1791 u32 lo;
1792 u32 hi;
1793};
1794
1795/* 2332/*
1796 * ethernet slow path element 2333 * ethernet slow path element
1797 */ 2334 */
@@ -1802,6 +2339,7 @@ union eth_specific_data {
1802 struct eth_halt_ramrod_data halt_ramrod_data; 2339 struct eth_halt_ramrod_data halt_ramrod_data;
1803 struct regpair leading_cqe_addr; 2340 struct regpair leading_cqe_addr;
1804 struct regpair update_data_addr; 2341 struct regpair update_data_addr;
2342 struct eth_query_ramrod_data query_ramrod_data;
1805}; 2343};
1806 2344
1807/* 2345/*
@@ -1824,10 +2362,13 @@ struct eth_tx_db_data {
1824 2362
1825 2363
1826/* 2364/*
1827 * Common configuration parameters per port in Tstorm 2365 * Common configuration parameters per function in Tstorm
1828 */ 2366 */
1829struct tstorm_eth_function_common_config { 2367struct tstorm_eth_function_common_config {
1830 u32 config_flags; 2368#if defined(__BIG_ENDIAN)
2369 u8 leading_client_id;
2370 u8 rss_result_mask;
2371 u16 config_flags;
1831#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY (0x1<<0) 2372#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY (0x1<<0)
1832#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY_SHIFT 0 2373#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY_SHIFT 0
1833#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY (0x1<<1) 2374#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY (0x1<<1)
@@ -1840,17 +2381,32 @@ struct tstorm_eth_function_common_config {
1840#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_ENABLE_SHIFT 4 2381#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_ENABLE_SHIFT 4
1841#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_DEFAULT_ENABLE (0x1<<5) 2382#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_DEFAULT_ENABLE (0x1<<5)
1842#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_DEFAULT_ENABLE_SHIFT 5 2383#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_DEFAULT_ENABLE_SHIFT 5
1843#define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0 (0x3FFFFFF<<6) 2384#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_IN_CAM (0x1<<6)
1844#define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0_SHIFT 6 2385#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_IN_CAM_SHIFT 6
1845#if defined(__BIG_ENDIAN) 2386#define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0 (0x1FF<<7)
1846 u16 __secondary_vlan_id; 2387#define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0_SHIFT 7
1847 u8 leading_client_id;
1848 u8 rss_result_mask;
1849#elif defined(__LITTLE_ENDIAN) 2388#elif defined(__LITTLE_ENDIAN)
2389 u16 config_flags;
2390#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY (0x1<<0)
2391#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY_SHIFT 0
2392#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY (0x1<<1)
2393#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY_SHIFT 1
2394#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY (0x1<<2)
2395#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY_SHIFT 2
2396#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY (0x1<<3)
2397#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY_SHIFT 3
2398#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_ENABLE (0x1<<4)
2399#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_ENABLE_SHIFT 4
2400#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_DEFAULT_ENABLE (0x1<<5)
2401#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_DEFAULT_ENABLE_SHIFT 5
2402#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_IN_CAM (0x1<<6)
2403#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_IN_CAM_SHIFT 6
2404#define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0 (0x1FF<<7)
2405#define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0_SHIFT 7
1850 u8 rss_result_mask; 2406 u8 rss_result_mask;
1851 u8 leading_client_id; 2407 u8 leading_client_id;
1852 u16 __secondary_vlan_id;
1853#endif 2408#endif
2409 u16 vlan_id[2];
1854}; 2410};
1855 2411
1856/* 2412/*
@@ -1868,7 +2424,7 @@ struct eth_update_ramrod_data {
1868struct mac_configuration_hdr { 2424struct mac_configuration_hdr {
1869 u8 length_6b; 2425 u8 length_6b;
1870 u8 offset; 2426 u8 offset;
1871 u16 reserved0; 2427 u16 client_id;
1872 u32 reserved1; 2428 u32 reserved1;
1873}; 2429};
1874 2430
@@ -1925,15 +2481,55 @@ struct mac_configuration_cmd {
1925 2481
1926 2482
1927/* 2483/*
2484 * MAC address in list for ramrod
2485 */
2486struct mac_configuration_entry_e1h {
2487 u16 lsb_mac_addr;
2488 u16 middle_mac_addr;
2489 u16 msb_mac_addr;
2490 u16 vlan_id;
2491 u16 e1hov_id;
2492 u8 client_id;
2493 u8 flags;
2494#define MAC_CONFIGURATION_ENTRY_E1H_PORT (0x1<<0)
2495#define MAC_CONFIGURATION_ENTRY_E1H_PORT_SHIFT 0
2496#define MAC_CONFIGURATION_ENTRY_E1H_ACTION_TYPE (0x1<<1)
2497#define MAC_CONFIGURATION_ENTRY_E1H_ACTION_TYPE_SHIFT 1
2498#define MAC_CONFIGURATION_ENTRY_E1H_RDMA_MAC (0x1<<2)
2499#define MAC_CONFIGURATION_ENTRY_E1H_RDMA_MAC_SHIFT 2
2500#define MAC_CONFIGURATION_ENTRY_E1H_RESERVED0 (0x1F<<3)
2501#define MAC_CONFIGURATION_ENTRY_E1H_RESERVED0_SHIFT 3
2502};
2503
2504/*
2505 * MAC filtering configuration command
2506 */
2507struct mac_configuration_cmd_e1h {
2508 struct mac_configuration_hdr hdr;
2509 struct mac_configuration_entry_e1h config_table[32];
2510};
2511
2512
2513/*
2514 * approximate-match multicast filtering for E1H per function in Tstorm
2515 */
2516struct tstorm_eth_approximate_match_multicast_filtering {
2517 u32 mcast_add_hash_bit_array[8];
2518};
2519
2520
2521/*
1928 * Configuration parameters per client in Tstorm 2522 * Configuration parameters per client in Tstorm
1929 */ 2523 */
1930struct tstorm_eth_client_config { 2524struct tstorm_eth_client_config {
1931#if defined(__BIG_ENDIAN) 2525#if defined(__BIG_ENDIAN)
1932 u16 statistics_counter_id; 2526 u8 max_sges_for_packet;
2527 u8 statistics_counter_id;
1933 u16 mtu; 2528 u16 mtu;
1934#elif defined(__LITTLE_ENDIAN) 2529#elif defined(__LITTLE_ENDIAN)
1935 u16 mtu; 2530 u16 mtu;
1936 u16 statistics_counter_id; 2531 u8 statistics_counter_id;
2532 u8 max_sges_for_packet;
1937#endif 2533#endif
1938#if defined(__BIG_ENDIAN) 2534#if defined(__BIG_ENDIAN)
1939 u16 drop_flags; 2535 u16 drop_flags;
@@ -1941,42 +2537,42 @@ struct tstorm_eth_client_config {
1941#define TSTORM_ETH_CLIENT_CONFIG_DROP_IP_CS_ERR_SHIFT 0 2537#define TSTORM_ETH_CLIENT_CONFIG_DROP_IP_CS_ERR_SHIFT 0
1942#define TSTORM_ETH_CLIENT_CONFIG_DROP_TCP_CS_ERR (0x1<<1) 2538#define TSTORM_ETH_CLIENT_CONFIG_DROP_TCP_CS_ERR (0x1<<1)
1943#define TSTORM_ETH_CLIENT_CONFIG_DROP_TCP_CS_ERR_SHIFT 1 2539#define TSTORM_ETH_CLIENT_CONFIG_DROP_TCP_CS_ERR_SHIFT 1
1944#define TSTORM_ETH_CLIENT_CONFIG_DROP_MAC_ERR (0x1<<2) 2540#define TSTORM_ETH_CLIENT_CONFIG_DROP_TTL0 (0x1<<2)
1945#define TSTORM_ETH_CLIENT_CONFIG_DROP_MAC_ERR_SHIFT 2 2541#define TSTORM_ETH_CLIENT_CONFIG_DROP_TTL0_SHIFT 2
1946#define TSTORM_ETH_CLIENT_CONFIG_DROP_TTL0 (0x1<<3) 2542#define TSTORM_ETH_CLIENT_CONFIG_DROP_UDP_CS_ERR (0x1<<3)
1947#define TSTORM_ETH_CLIENT_CONFIG_DROP_TTL0_SHIFT 3 2543#define TSTORM_ETH_CLIENT_CONFIG_DROP_UDP_CS_ERR_SHIFT 3
1948#define TSTORM_ETH_CLIENT_CONFIG_DROP_UDP_CS_ERR (0x1<<4) 2544#define __TSTORM_ETH_CLIENT_CONFIG_RESERVED1 (0xFFF<<4)
1949#define TSTORM_ETH_CLIENT_CONFIG_DROP_UDP_CS_ERR_SHIFT 4 2545#define __TSTORM_ETH_CLIENT_CONFIG_RESERVED1_SHIFT 4
1950#define __TSTORM_ETH_CLIENT_CONFIG_RESERVED1 (0x7FF<<5)
1951#define __TSTORM_ETH_CLIENT_CONFIG_RESERVED1_SHIFT 5
1952 u16 config_flags; 2546 u16 config_flags;
1953#define TSTORM_ETH_CLIENT_CONFIG_VLAN_REMOVAL_ENABLE (0x1<<0) 2547#define TSTORM_ETH_CLIENT_CONFIG_VLAN_REMOVAL_ENABLE (0x1<<0)
1954#define TSTORM_ETH_CLIENT_CONFIG_VLAN_REMOVAL_ENABLE_SHIFT 0 2548#define TSTORM_ETH_CLIENT_CONFIG_VLAN_REMOVAL_ENABLE_SHIFT 0
1955#define TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE (0x1<<1) 2549#define TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE (0x1<<1)
1956#define TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE_SHIFT 1 2550#define TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE_SHIFT 1
1957#define __TSTORM_ETH_CLIENT_CONFIG_RESERVED0 (0x3FFF<<2) 2551#define TSTORM_ETH_CLIENT_CONFIG_ENABLE_SGE_RING (0x1<<2)
1958#define __TSTORM_ETH_CLIENT_CONFIG_RESERVED0_SHIFT 2 2552#define TSTORM_ETH_CLIENT_CONFIG_ENABLE_SGE_RING_SHIFT 2
2553#define __TSTORM_ETH_CLIENT_CONFIG_RESERVED0 (0x1FFF<<3)
2554#define __TSTORM_ETH_CLIENT_CONFIG_RESERVED0_SHIFT 3
1959#elif defined(__LITTLE_ENDIAN) 2555#elif defined(__LITTLE_ENDIAN)
1960 u16 config_flags; 2556 u16 config_flags;
1961#define TSTORM_ETH_CLIENT_CONFIG_VLAN_REMOVAL_ENABLE (0x1<<0) 2557#define TSTORM_ETH_CLIENT_CONFIG_VLAN_REMOVAL_ENABLE (0x1<<0)
1962#define TSTORM_ETH_CLIENT_CONFIG_VLAN_REMOVAL_ENABLE_SHIFT 0 2558#define TSTORM_ETH_CLIENT_CONFIG_VLAN_REMOVAL_ENABLE_SHIFT 0
1963#define TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE (0x1<<1) 2559#define TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE (0x1<<1)
1964#define TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE_SHIFT 1 2560#define TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE_SHIFT 1
1965#define __TSTORM_ETH_CLIENT_CONFIG_RESERVED0 (0x3FFF<<2) 2561#define TSTORM_ETH_CLIENT_CONFIG_ENABLE_SGE_RING (0x1<<2)
1966#define __TSTORM_ETH_CLIENT_CONFIG_RESERVED0_SHIFT 2 2562#define TSTORM_ETH_CLIENT_CONFIG_ENABLE_SGE_RING_SHIFT 2
2563#define __TSTORM_ETH_CLIENT_CONFIG_RESERVED0 (0x1FFF<<3)
2564#define __TSTORM_ETH_CLIENT_CONFIG_RESERVED0_SHIFT 3
1967 u16 drop_flags; 2565 u16 drop_flags;
1968#define TSTORM_ETH_CLIENT_CONFIG_DROP_IP_CS_ERR (0x1<<0) 2566#define TSTORM_ETH_CLIENT_CONFIG_DROP_IP_CS_ERR (0x1<<0)
1969#define TSTORM_ETH_CLIENT_CONFIG_DROP_IP_CS_ERR_SHIFT 0 2567#define TSTORM_ETH_CLIENT_CONFIG_DROP_IP_CS_ERR_SHIFT 0
1970#define TSTORM_ETH_CLIENT_CONFIG_DROP_TCP_CS_ERR (0x1<<1) 2568#define TSTORM_ETH_CLIENT_CONFIG_DROP_TCP_CS_ERR (0x1<<1)
1971#define TSTORM_ETH_CLIENT_CONFIG_DROP_TCP_CS_ERR_SHIFT 1 2569#define TSTORM_ETH_CLIENT_CONFIG_DROP_TCP_CS_ERR_SHIFT 1
1972#define TSTORM_ETH_CLIENT_CONFIG_DROP_MAC_ERR (0x1<<2) 2570#define TSTORM_ETH_CLIENT_CONFIG_DROP_TTL0 (0x1<<2)
1973#define TSTORM_ETH_CLIENT_CONFIG_DROP_MAC_ERR_SHIFT 2 2571#define TSTORM_ETH_CLIENT_CONFIG_DROP_TTL0_SHIFT 2
1974#define TSTORM_ETH_CLIENT_CONFIG_DROP_TTL0 (0x1<<3) 2572#define TSTORM_ETH_CLIENT_CONFIG_DROP_UDP_CS_ERR (0x1<<3)
1975#define TSTORM_ETH_CLIENT_CONFIG_DROP_TTL0_SHIFT 3 2573#define TSTORM_ETH_CLIENT_CONFIG_DROP_UDP_CS_ERR_SHIFT 3
1976#define TSTORM_ETH_CLIENT_CONFIG_DROP_UDP_CS_ERR (0x1<<4) 2574#define __TSTORM_ETH_CLIENT_CONFIG_RESERVED1 (0xFFF<<4)
1977#define TSTORM_ETH_CLIENT_CONFIG_DROP_UDP_CS_ERR_SHIFT 4 2575#define __TSTORM_ETH_CLIENT_CONFIG_RESERVED1_SHIFT 4
1978#define __TSTORM_ETH_CLIENT_CONFIG_RESERVED1 (0x7FF<<5)
1979#define __TSTORM_ETH_CLIENT_CONFIG_RESERVED1_SHIFT 5
1980#endif 2576#endif
1981}; 2577};
1982 2578
@@ -1992,103 +2588,119 @@ struct tstorm_eth_mac_filter_config {
1992 u32 bcast_drop_all; 2588 u32 bcast_drop_all;
1993 u32 bcast_accept_all; 2589 u32 bcast_accept_all;
1994 u32 strict_vlan; 2590 u32 strict_vlan;
1995 u32 __secondary_vlan_clients; 2591 u32 vlan_filter[2];
2592 u32 reserved;
1996}; 2593};
1997 2594
1998 2595
1999struct rate_shaping_per_protocol { 2596/*
2597 * Three RX producers for ETH
2598 */
2599struct tstorm_eth_rx_producers {
2000#if defined(__BIG_ENDIAN) 2600#if defined(__BIG_ENDIAN)
2001 u16 reserved0; 2601 u16 bd_prod;
2002 u16 protocol_rate; 2602 u16 cqe_prod;
2003#elif defined(__LITTLE_ENDIAN) 2603#elif defined(__LITTLE_ENDIAN)
2004 u16 protocol_rate; 2604 u16 cqe_prod;
2005 u16 reserved0; 2605 u16 bd_prod;
2006#endif 2606#endif
2007 u32 protocol_quota;
2008 s32 current_credit;
2009 u32 reserved;
2010};
2011
2012struct rate_shaping_vars {
2013 struct rate_shaping_per_protocol protocol_vars[NUM_OF_PROTOCOLS];
2014 u32 pause_mask;
2015 u32 periodic_stop;
2016 u32 rs_periodic_timeout;
2017 u32 rs_threshold;
2018 u32 last_periodic_time;
2019 u32 reserved;
2020};
2021
2022struct fairness_per_protocol {
2023 u32 credit_delta;
2024 s32 fair_credit;
2025#if defined(__BIG_ENDIAN) 2607#if defined(__BIG_ENDIAN)
2026 u16 reserved0; 2608 u16 reserved;
2027 u8 state; 2609 u16 sge_prod;
2028 u8 weight;
2029#elif defined(__LITTLE_ENDIAN) 2610#elif defined(__LITTLE_ENDIAN)
2030 u8 weight; 2611 u16 sge_prod;
2031 u8 state; 2612 u16 reserved;
2032 u16 reserved0;
2033#endif 2613#endif
2034 u32 reserved1;
2035}; 2614};
2036 2615
2037struct fairness_vars {
2038 struct fairness_per_protocol protocol_vars[NUM_OF_PROTOCOLS];
2039 u32 upper_bound;
2040 u32 port_rate;
2041 u32 pause_mask;
2042 u32 fair_threshold;
2043};
2044 2616
2045struct safc_struct { 2617/*
2046 u32 cur_pause_mask; 2618 * common flag to indicate existance of TPA.
2047 u32 expire_time; 2619 */
2620struct tstorm_eth_tpa_exist {
2048#if defined(__BIG_ENDIAN) 2621#if defined(__BIG_ENDIAN)
2049 u16 reserved0; 2622 u16 reserved1;
2050 u8 cur_cos_types; 2623 u8 reserved0;
2051 u8 safc_timeout_usec; 2624 u8 tpa_exist;
2052#elif defined(__LITTLE_ENDIAN) 2625#elif defined(__LITTLE_ENDIAN)
2053 u8 safc_timeout_usec; 2626 u8 tpa_exist;
2054 u8 cur_cos_types; 2627 u8 reserved0;
2055 u16 reserved0; 2628 u16 reserved1;
2056#endif 2629#endif
2057 u32 reserved1; 2630 u32 reserved2;
2058}; 2631};
2059 2632
2060struct demo_struct { 2633
2634/*
2635 * per-port SAFC demo variables
2636 */
2637struct cmng_flags_per_port {
2061 u8 con_number[NUM_OF_PROTOCOLS]; 2638 u8 con_number[NUM_OF_PROTOCOLS];
2062#if defined(__BIG_ENDIAN) 2639#if defined(__BIG_ENDIAN)
2063 u8 reserved1;
2064 u8 fairness_enable; 2640 u8 fairness_enable;
2065 u8 rate_shaping_enable; 2641 u8 rate_shaping_enable;
2066 u8 cmng_enable; 2642 u8 cmng_protocol_enable;
2643 u8 cmng_vn_enable;
2067#elif defined(__LITTLE_ENDIAN) 2644#elif defined(__LITTLE_ENDIAN)
2068 u8 cmng_enable; 2645 u8 cmng_vn_enable;
2646 u8 cmng_protocol_enable;
2069 u8 rate_shaping_enable; 2647 u8 rate_shaping_enable;
2070 u8 fairness_enable; 2648 u8 fairness_enable;
2071 u8 reserved1;
2072#endif 2649#endif
2073}; 2650};
2074 2651
2075struct cmng_struct { 2652
2076 struct rate_shaping_vars rs_vars; 2653/*
2077 struct fairness_vars fair_vars; 2654 * per-port rate shaping variables
2078 struct safc_struct safc_vars; 2655 */
2079 struct demo_struct demo_vars; 2656struct rate_shaping_vars_per_port {
2657 u32 rs_periodic_timeout;
2658 u32 rs_threshold;
2080}; 2659};
2081 2660
2082 2661
2083struct cos_to_protocol { 2662/*
2084 u8 mask[MAX_COS_NUMBER]; 2663 * per-port fairness variables
2664 */
2665struct fairness_vars_per_port {
2666 u32 upper_bound;
2667 u32 fair_threshold;
2668 u32 fairness_timeout;
2085}; 2669};
2086 2670
2087 2671
2088/* 2672/*
2089 * Common statistics collected by the Xstorm (per port) 2673 * per-port SAFC variables
2090 */ 2674 */
2091struct xstorm_common_stats { 2675struct safc_struct_per_port {
2676#if defined(__BIG_ENDIAN)
2677 u16 __reserved0;
2678 u8 cur_cos_types;
2679 u8 safc_timeout_usec;
2680#elif defined(__LITTLE_ENDIAN)
2681 u8 safc_timeout_usec;
2682 u8 cur_cos_types;
2683 u16 __reserved0;
2684#endif
2685 u8 cos_to_protocol[MAX_COS_NUMBER];
2686};
2687
2688
2689/*
2690 * Per-port congestion management variables
2691 */
2692struct cmng_struct_per_port {
2693 struct rate_shaping_vars_per_port rs_vars;
2694 struct fairness_vars_per_port fair_vars;
2695 struct safc_struct_per_port safc_vars;
2696 struct cmng_flags_per_port flags;
2697};
2698
2699
2700/*
2701 * Protocol-common statistics collected by the Xstorm (per client)
2702 */
2703struct xstorm_per_client_stats {
2092 struct regpair total_sent_bytes; 2704 struct regpair total_sent_bytes;
2093 u32 total_sent_pkts; 2705 u32 total_sent_pkts;
2094 u32 unicast_pkts_sent; 2706 u32 unicast_pkts_sent;
@@ -2097,9 +2709,31 @@ struct xstorm_common_stats {
2097 u32 multicast_pkts_sent; 2709 u32 multicast_pkts_sent;
2098 u32 broadcast_pkts_sent; 2710 u32 broadcast_pkts_sent;
2099 struct regpair broadcast_bytes_sent; 2711 struct regpair broadcast_bytes_sent;
2100 struct regpair done; 2712 u16 stats_counter;
2713 u16 reserved0;
2714 u32 reserved1;
2101}; 2715};
2102 2716
2717
2718/*
2719 * Common statistics collected by the Xstorm (per port)
2720 */
2721struct xstorm_common_stats {
2722 struct xstorm_per_client_stats client_statistics[MAX_X_STAT_COUNTER_ID];
2723};
2724
2725
2726/*
2727 * Protocol-common statistics collected by the Tstorm (per port)
2728 */
2729struct tstorm_per_port_stats {
2730 u32 mac_filter_discard;
2731 u32 xxoverflow_discard;
2732 u32 brb_truncate_discard;
2733 u32 mac_discard;
2734};
2735
2736
2103/* 2737/*
2104 * Protocol-common statistics collected by the Tstorm (per client) 2738 * Protocol-common statistics collected by the Tstorm (per client)
2105 */ 2739 */
@@ -2117,20 +2751,17 @@ struct tstorm_per_client_stats {
2117 u32 rcv_multicast_pkts; 2751 u32 rcv_multicast_pkts;
2118 u32 no_buff_discard; 2752 u32 no_buff_discard;
2119 u32 ttl0_discard; 2753 u32 ttl0_discard;
2120 u32 mac_discard; 2754 u16 stats_counter;
2121 u32 reserved; 2755 u16 reserved0;
2756 u32 reserved1;
2122}; 2757};
2123 2758
2124/* 2759/*
2125 * Protocol-common statistics collected by the Tstorm (per port) 2760 * Protocol-common statistics collected by the Tstorm
2126 */ 2761 */
2127struct tstorm_common_stats { 2762struct tstorm_common_stats {
2128 struct tstorm_per_client_stats client_statistics[MAX_T_STAT_COUNTER_ID]; 2763 struct tstorm_per_port_stats port_statistics;
2129 u32 mac_filter_discard; 2764 struct tstorm_per_client_stats client_statistics[MAX_T_STAT_COUNTER_ID];
2130 u32 xxoverflow_discard;
2131 u32 brb_truncate_discard;
2132 u32 reserved;
2133 struct regpair done;
2134}; 2765};
2135 2766
2136/* 2767/*
@@ -2143,6 +2774,16 @@ struct eth_stats_query {
2143 2774
2144 2775
2145/* 2776/*
2777 * per-vnic fairness variables
2778 */
2779struct fairness_vars_per_vn {
2780 u32 protocol_credit_delta[NUM_OF_PROTOCOLS];
2781 u32 vn_credit_delta;
2782 u32 __reserved0;
2783};
2784
2785
2786/*
2146 * FW version stored in the Xstorm RAM 2787 * FW version stored in the Xstorm RAM
2147 */ 2788 */
2148struct fw_version { 2789struct fw_version {
@@ -2160,8 +2801,10 @@ struct fw_version {
2160#define FW_VERSION_OPTIMIZED_SHIFT 0 2801#define FW_VERSION_OPTIMIZED_SHIFT 0
2161#define FW_VERSION_BIG_ENDIEN (0x1<<1) 2802#define FW_VERSION_BIG_ENDIEN (0x1<<1)
2162#define FW_VERSION_BIG_ENDIEN_SHIFT 1 2803#define FW_VERSION_BIG_ENDIEN_SHIFT 1
2163#define __FW_VERSION_RESERVED (0x3FFFFFFF<<2) 2804#define FW_VERSION_CHIP_VERSION (0x3<<2)
2164#define __FW_VERSION_RESERVED_SHIFT 2 2805#define FW_VERSION_CHIP_VERSION_SHIFT 2
2806#define __FW_VERSION_RESERVED (0xFFFFFFF<<4)
2807#define __FW_VERSION_RESERVED_SHIFT 4
2165}; 2808};
2166 2809
2167 2810
@@ -2169,15 +2812,9 @@ struct fw_version {
2169 * FW version stored in first line of pram 2812 * FW version stored in first line of pram
2170 */ 2813 */
2171struct pram_fw_version { 2814struct pram_fw_version {
2172#if defined(__BIG_ENDIAN)
2173 u16 patch;
2174 u8 primary;
2175 u8 client;
2176#elif defined(__LITTLE_ENDIAN)
2177 u8 client; 2815 u8 client;
2178 u8 primary; 2816 u8 primary;
2179 u16 patch; 2817 u16 patch;
2180#endif
2181 u8 flags; 2818 u8 flags;
2182#define PRAM_FW_VERSION_OPTIMIZED (0x1<<0) 2819#define PRAM_FW_VERSION_OPTIMIZED (0x1<<0)
2183#define PRAM_FW_VERSION_OPTIMIZED_SHIFT 0 2820#define PRAM_FW_VERSION_OPTIMIZED_SHIFT 0
@@ -2185,8 +2822,34 @@ struct pram_fw_version {
2185#define PRAM_FW_VERSION_STORM_ID_SHIFT 1 2822#define PRAM_FW_VERSION_STORM_ID_SHIFT 1
2186#define PRAM_FW_VERSION_BIG_ENDIEN (0x1<<3) 2823#define PRAM_FW_VERSION_BIG_ENDIEN (0x1<<3)
2187#define PRAM_FW_VERSION_BIG_ENDIEN_SHIFT 3 2824#define PRAM_FW_VERSION_BIG_ENDIEN_SHIFT 3
2188#define __PRAM_FW_VERSION_RESERVED0 (0xF<<4) 2825#define PRAM_FW_VERSION_CHIP_VERSION (0x3<<4)
2189#define __PRAM_FW_VERSION_RESERVED0_SHIFT 4 2826#define PRAM_FW_VERSION_CHIP_VERSION_SHIFT 4
2827#define __PRAM_FW_VERSION_RESERVED0 (0x3<<6)
2828#define __PRAM_FW_VERSION_RESERVED0_SHIFT 6
2829};
2830
2831
2832/*
2833 * a single rate shaping counter. can be used as protocol or vnic counter
2834 */
2835struct rate_shaping_counter {
2836 u32 quota;
2837#if defined(__BIG_ENDIAN)
2838 u16 __reserved0;
2839 u16 rate;
2840#elif defined(__LITTLE_ENDIAN)
2841 u16 rate;
2842 u16 __reserved0;
2843#endif
2844};
2845
2846
2847/*
2848 * per-vnic rate shaping variables
2849 */
2850struct rate_shaping_vars_per_vn {
2851 struct rate_shaping_counter protocol_counters[NUM_OF_PROTOCOLS];
2852 struct rate_shaping_counter vn_counter;
2190}; 2853};
2191 2854
2192 2855