sw_w32_mask(0, BIT(7), RTL839X_SMI_GLB_CTRL);
}
-const struct rtldsa_mib_list_item rtldsa_838x_mib_list[] = {
- MIB_LIST_ITEM("dot1dTpPortInDiscards", MIB_ITEM(MIB_REG_STD, 0xec, 1)),
- MIB_LIST_ITEM("ifOutDiscards", MIB_ITEM(MIB_REG_STD, 0xd0, 1)),
- MIB_LIST_ITEM("DropEvents", MIB_ITEM(MIB_REG_STD, 0xa8, 1)),
- MIB_LIST_ITEM("tx_BroadcastPkts", MIB_ITEM(MIB_REG_STD, 0xa4, 1)),
- MIB_LIST_ITEM("tx_MulticastPkts", MIB_ITEM(MIB_REG_STD, 0xa0, 1)),
- MIB_LIST_ITEM("tx_UndersizePkts", MIB_ITEM(MIB_REG_STD, 0x98, 1)),
- MIB_LIST_ITEM("rx_UndersizeDropPkts", MIB_ITEM(MIB_REG_STD, 0x90, 1)),
- MIB_LIST_ITEM("tx_OversizePkts", MIB_ITEM(MIB_REG_STD, 0x8c, 1)),
- MIB_LIST_ITEM("Collisions", MIB_ITEM(MIB_REG_STD, 0x7c, 1)),
- MIB_LIST_ITEM("rx_MacDiscards", MIB_ITEM(MIB_REG_STD, 0x40, 1))
-};
-
-const struct rtldsa_mib_desc rtldsa_838x_mib = {
- .symbol_errors = MIB_ITEM(MIB_REG_STD, 0xb8, 1),
-
- .if_in_octets = MIB_ITEM(MIB_REG_STD, 0xf8, 2),
- .if_out_octets = MIB_ITEM(MIB_REG_STD, 0xf0, 2),
- .if_in_ucast_pkts = MIB_ITEM(MIB_REG_STD, 0xe8, 1),
- .if_in_mcast_pkts = MIB_ITEM(MIB_REG_STD, 0xe4, 1),
- .if_in_bcast_pkts = MIB_ITEM(MIB_REG_STD, 0xe0, 1),
- .if_out_ucast_pkts = MIB_ITEM(MIB_REG_STD, 0xdc, 1),
- .if_out_mcast_pkts = MIB_ITEM(MIB_REG_STD, 0xd8, 1),
- .if_out_bcast_pkts = MIB_ITEM(MIB_REG_STD, 0xd4, 1),
- .if_out_discards = MIB_ITEM(MIB_REG_STD, 0xd0, 1),
- .single_collisions = MIB_ITEM(MIB_REG_STD, 0xcc, 1),
- .multiple_collisions = MIB_ITEM(MIB_REG_STD, 0xc8, 1),
- .deferred_transmissions = MIB_ITEM(MIB_REG_STD, 0xc4, 1),
- .late_collisions = MIB_ITEM(MIB_REG_STD, 0xc0, 1),
- .excessive_collisions = MIB_ITEM(MIB_REG_STD, 0xbc, 1),
- .crc_align_errors = MIB_ITEM(MIB_REG_STD, 0x9c, 1),
-
- .unsupported_opcodes = MIB_ITEM(MIB_REG_STD, 0xb4, 1),
-
- .rx_undersize_pkts = MIB_ITEM(MIB_REG_STD, 0x94, 1),
- .rx_oversize_pkts = MIB_ITEM(MIB_REG_STD, 0x88, 1),
- .rx_fragments = MIB_ITEM(MIB_REG_STD, 0x84, 1),
- .rx_jabbers = MIB_ITEM(MIB_REG_STD, 0x80, 1),
-
- .tx_pkts = {
- MIB_ITEM(MIB_REG_STD, 0x78, 1),
- MIB_ITEM(MIB_REG_STD, 0x70, 1),
- MIB_ITEM(MIB_REG_STD, 0x68, 1),
- MIB_ITEM(MIB_REG_STD, 0x60, 1),
- MIB_ITEM(MIB_REG_STD, 0x58, 1),
- MIB_ITEM(MIB_REG_STD, 0x50, 1),
- MIB_ITEM(MIB_REG_STD, 0x48, 1)
- },
- .rx_pkts = {
- MIB_ITEM(MIB_REG_STD, 0x74, 1),
- MIB_ITEM(MIB_REG_STD, 0x6c, 1),
- MIB_ITEM(MIB_REG_STD, 0x64, 1),
- MIB_ITEM(MIB_REG_STD, 0x5c, 1),
- MIB_ITEM(MIB_REG_STD, 0x54, 1),
- MIB_ITEM(MIB_REG_STD, 0x4c, 1),
- MIB_ITEM(MIB_REG_STD, 0x44, 1)
- },
- .rmon_ranges = {
- { 0, 64 },
- { 65, 127 },
- { 128, 255 },
- { 256, 511 },
- { 512, 1023 },
- { 1024, 1518 },
- { 1519, 10000 }
- },
-
- .drop_events = MIB_ITEM(MIB_REG_STD, 0xa8, 1),
- .collisions = MIB_ITEM(MIB_REG_STD, 0x7c, 1),
-
- .rx_pause_frames = MIB_ITEM(MIB_REG_STD, 0xb0, 1),
- .tx_pause_frames = MIB_ITEM(MIB_REG_STD, 0xac, 1),
-
- .list_count = ARRAY_SIZE(rtldsa_838x_mib_list),
- .list = rtldsa_838x_mib_list
-};
-
-const struct rtldsa_mib_list_item rtldsa_839x_mib_list[] = {
- MIB_LIST_ITEM("ifOutDiscards", MIB_ITEM(MIB_REG_STD, 0xd4, 1)),
- MIB_LIST_ITEM("dot1dTpPortInDiscards", MIB_ITEM(MIB_REG_STD, 0xd0, 1)),
- MIB_LIST_ITEM("DropEvents", MIB_ITEM(MIB_REG_STD, 0xa8, 1)),
- MIB_LIST_ITEM("tx_BroadcastPkts", MIB_ITEM(MIB_REG_STD, 0xa4, 1)),
- MIB_LIST_ITEM("tx_MulticastPkts", MIB_ITEM(MIB_REG_STD, 0xa0, 1)),
- MIB_LIST_ITEM("tx_UndersizePkts", MIB_ITEM(MIB_REG_STD, 0x98, 1)),
- MIB_LIST_ITEM("rx_UndersizeDropPkts", MIB_ITEM(MIB_REG_STD, 0x90, 1)),
- MIB_LIST_ITEM("tx_OversizePkts", MIB_ITEM(MIB_REG_STD, 0x8c, 1)),
- MIB_LIST_ITEM("Collisions", MIB_ITEM(MIB_REG_STD, 0x7c, 1)),
- MIB_LIST_ITEM("rx_LengthFieldError", MIB_ITEM(MIB_REG_STD, 0x40, 1)),
- MIB_LIST_ITEM("rx_FalseCarrierTimes", MIB_ITEM(MIB_REG_STD, 0x3c, 1)),
- MIB_LIST_ITEM("rx_UnderSizeOctets", MIB_ITEM(MIB_REG_STD, 0x38, 1)),
- MIB_LIST_ITEM("tx_Fragments", MIB_ITEM(MIB_REG_STD, 0x34, 1)),
- MIB_LIST_ITEM("tx_Jabbers", MIB_ITEM(MIB_REG_STD, 0x30, 1)),
- MIB_LIST_ITEM("tx_CRCAlignErrors", MIB_ITEM(MIB_REG_STD, 0x2c, 1)),
- MIB_LIST_ITEM("rx_FramingErrors", MIB_ITEM(MIB_REG_STD, 0x28, 1)),
- MIB_LIST_ITEM("rx_MacDiscards", MIB_ITEM(MIB_REG_STD, 0x24, 1))
-};
-
-const struct rtldsa_mib_desc rtldsa_839x_mib = {
- .symbol_errors = MIB_ITEM(MIB_REG_STD, 0xb8, 1),
-
- .if_in_octets = MIB_ITEM(MIB_REG_STD, 0xf8, 2),
- .if_out_octets = MIB_ITEM(MIB_REG_STD, 0xf0, 2),
- .if_in_ucast_pkts = MIB_ITEM(MIB_REG_STD, 0xec, 1),
- .if_in_mcast_pkts = MIB_ITEM(MIB_REG_STD, 0xe8, 1),
- .if_in_bcast_pkts = MIB_ITEM(MIB_REG_STD, 0xe4, 1),
- .if_out_ucast_pkts = MIB_ITEM(MIB_REG_STD, 0xe0, 1),
- .if_out_mcast_pkts = MIB_ITEM(MIB_REG_STD, 0xdc, 1),
- .if_out_bcast_pkts = MIB_ITEM(MIB_REG_STD, 0xd8, 1),
- .if_out_discards = MIB_ITEM(MIB_REG_STD, 0xd4, 1),
- .single_collisions = MIB_ITEM(MIB_REG_STD, 0xcc, 1),
- .multiple_collisions = MIB_ITEM(MIB_REG_STD, 0xc8, 1),
- .deferred_transmissions = MIB_ITEM(MIB_REG_STD, 0xc4, 1),
- .late_collisions = MIB_ITEM(MIB_REG_STD, 0xc0, 1),
- .excessive_collisions = MIB_ITEM(MIB_REG_STD, 0xbc, 1),
- .crc_align_errors = MIB_ITEM(MIB_REG_STD, 0x9c, 1),
-
- .unsupported_opcodes = MIB_ITEM(MIB_REG_STD, 0xb4, 1),
-
- .rx_undersize_pkts = MIB_ITEM(MIB_REG_STD, 0x94, 1),
- .rx_oversize_pkts = MIB_ITEM(MIB_REG_STD, 0x88, 1),
- .rx_fragments = MIB_ITEM(MIB_REG_STD, 0x84, 1),
- .rx_jabbers = MIB_ITEM(MIB_REG_STD, 0x80, 1),
-
- .tx_pkts = {
- MIB_ITEM(MIB_REG_STD, 0x78, 1),
- MIB_ITEM(MIB_REG_STD, 0x70, 1),
- MIB_ITEM(MIB_REG_STD, 0x68, 1),
- MIB_ITEM(MIB_REG_STD, 0x60, 1),
- MIB_ITEM(MIB_REG_STD, 0x58, 1),
- MIB_ITEM(MIB_REG_STD, 0x50, 1),
- MIB_ITEM(MIB_REG_STD, 0x48, 1)
- },
- .rx_pkts = {
- MIB_ITEM(MIB_REG_STD, 0x74, 1),
- MIB_ITEM(MIB_REG_STD, 0x6c, 1),
- MIB_ITEM(MIB_REG_STD, 0x64, 1),
- MIB_ITEM(MIB_REG_STD, 0x5c, 1),
- MIB_ITEM(MIB_REG_STD, 0x54, 1),
- MIB_ITEM(MIB_REG_STD, 0x4c, 1),
- MIB_ITEM(MIB_REG_STD, 0x44, 1)
- },
- .rmon_ranges = {
- { 0, 64 },
- { 65, 127 },
- { 128, 255 },
- { 256, 511 },
- { 512, 1023 },
- { 1024, 1518 },
- { 1519, 12288 }
- },
-
- .drop_events = MIB_ITEM(MIB_REG_STD, 0xa8, 1),
- .collisions = MIB_ITEM(MIB_REG_STD, 0x7c, 1),
-
- .rx_pause_frames = MIB_ITEM(MIB_REG_STD, 0xb0, 1),
- .tx_pause_frames = MIB_ITEM(MIB_REG_STD, 0xac, 1),
-
- .list_count = ARRAY_SIZE(rtldsa_839x_mib_list),
- .list = rtldsa_839x_mib_list
-};
-
-const struct rtldsa_mib_list_item rtldsa_930x_mib_list[] = {
- MIB_LIST_ITEM("ifOutDiscards", MIB_ITEM(MIB_REG_STD, 0xbc, 1)),
- MIB_LIST_ITEM("dot1dTpPortInDiscards", MIB_ITEM(MIB_REG_STD, 0xb8, 1)),
- MIB_LIST_ITEM("DropEvents", MIB_ITEM(MIB_REG_STD, 0x90, 1)),
- MIB_LIST_ITEM("tx_BroadcastPkts", MIB_ITEM(MIB_REG_STD, 0x8c, 1)),
- MIB_LIST_ITEM("tx_MulticastPkts", MIB_ITEM(MIB_REG_STD, 0x88, 1)),
- MIB_LIST_ITEM("tx_CRCAlignErrors", MIB_ITEM(MIB_REG_STD, 0x84, 1)),
- MIB_LIST_ITEM("tx_UndersizePkts", MIB_ITEM(MIB_REG_STD, 0x7c, 1)),
- MIB_LIST_ITEM("tx_OversizePkts", MIB_ITEM(MIB_REG_STD, 0x74, 1)),
- MIB_LIST_ITEM("tx_Fragments", MIB_ITEM(MIB_REG_STD, 0x6c, 1)),
- MIB_LIST_ITEM("tx_Jabbers", MIB_ITEM(MIB_REG_STD, 0x64, 1)),
- MIB_LIST_ITEM("tx_Collisions", MIB_ITEM(MIB_REG_STD, 0x5c, 1)),
- MIB_LIST_ITEM("rx_UndersizeDropPkts", MIB_ITEM(MIB_REG_PRV, 0x7c, 1)),
- MIB_LIST_ITEM("tx_PktsFlexibleOctetsSet1", MIB_ITEM(MIB_REG_PRV, 0x68, 1)),
- MIB_LIST_ITEM("rx_PktsFlexibleOctetsSet1", MIB_ITEM(MIB_REG_PRV, 0x64, 1)),
- MIB_LIST_ITEM("tx_PktsFlexibleOctetsCRCSet1", MIB_ITEM(MIB_REG_PRV, 0x60, 1)),
- MIB_LIST_ITEM("rx_PktsFlexibleOctetsCRCSet1", MIB_ITEM(MIB_REG_PRV, 0x5c, 1)),
- MIB_LIST_ITEM("tx_PktsFlexibleOctetsSet0", MIB_ITEM(MIB_REG_PRV, 0x58, 1)),
- MIB_LIST_ITEM("rx_PktsFlexibleOctetsSet0", MIB_ITEM(MIB_REG_PRV, 0x54, 1)),
- MIB_LIST_ITEM("tx_PktsFlexibleOctetsCRCSet0", MIB_ITEM(MIB_REG_PRV, 0x50, 1)),
- MIB_LIST_ITEM("rx_PktsFlexibleOctetsCRCSet0", MIB_ITEM(MIB_REG_PRV, 0x4c, 1)),
- MIB_LIST_ITEM("LengthFieldError", MIB_ITEM(MIB_REG_PRV, 0x48, 1)),
- MIB_LIST_ITEM("FalseCarrierTimes", MIB_ITEM(MIB_REG_PRV, 0x44, 1)),
- MIB_LIST_ITEM("UndersizeOctets", MIB_ITEM(MIB_REG_PRV, 0x40, 1)),
- MIB_LIST_ITEM("FramingErrors", MIB_ITEM(MIB_REG_PRV, 0x3c, 1)),
- MIB_LIST_ITEM("ParserErrors", MIB_ITEM(MIB_REG_PRV, 0x38, 1)),
- MIB_LIST_ITEM("rx_MacDiscards", MIB_ITEM(MIB_REG_PRV, 0x34, 1)),
- MIB_LIST_ITEM("rx_MacIPGShortDrop", MIB_ITEM(MIB_REG_PRV, 0x30, 1))
-};
-
-const struct rtldsa_mib_desc rtldsa_930x_mib = {
- .symbol_errors = MIB_ITEM(MIB_REG_STD, 0xa0, 1),
-
- .if_in_octets = MIB_ITEM(MIB_REG_STD, 0xf8, 2),
- .if_out_octets = MIB_ITEM(MIB_REG_STD, 0xf0, 2),
- .if_in_ucast_pkts = MIB_ITEM(MIB_REG_STD, 0xe8, 2),
- .if_in_mcast_pkts = MIB_ITEM(MIB_REG_STD, 0xe0, 2),
- .if_in_bcast_pkts = MIB_ITEM(MIB_REG_STD, 0xd8, 2),
- .if_out_ucast_pkts = MIB_ITEM(MIB_REG_STD, 0xd0, 2),
- .if_out_mcast_pkts = MIB_ITEM(MIB_REG_STD, 0xc8, 2),
- .if_out_bcast_pkts = MIB_ITEM(MIB_REG_STD, 0xc0, 2),
- .if_out_discards = MIB_ITEM(MIB_REG_STD, 0xbc, 1),
- .single_collisions = MIB_ITEM(MIB_REG_STD, 0xb4, 1),
- .multiple_collisions = MIB_ITEM(MIB_REG_STD, 0xb0, 1),
- .deferred_transmissions = MIB_ITEM(MIB_REG_STD, 0xac, 1),
- .late_collisions = MIB_ITEM(MIB_REG_STD, 0xa8, 1),
- .excessive_collisions = MIB_ITEM(MIB_REG_STD, 0xa4, 1),
- .crc_align_errors = MIB_ITEM(MIB_REG_STD, 0x80, 1),
- .rx_pkts_over_max_octets = MIB_ITEM(MIB_REG_PRV, 0x6c, 1),
-
- .unsupported_opcodes = MIB_ITEM(MIB_REG_STD, 0x9c, 1),
-
- .rx_undersize_pkts = MIB_ITEM(MIB_REG_STD, 0x78, 1),
- .rx_oversize_pkts = MIB_ITEM(MIB_REG_STD, 0x70, 1),
- .rx_fragments = MIB_ITEM(MIB_REG_STD, 0x68, 1),
- .rx_jabbers = MIB_ITEM(MIB_REG_STD, 0x60, 1),
-
- .tx_pkts = {
- MIB_ITEM(MIB_REG_STD, 0x58, 1),
- MIB_ITEM(MIB_REG_STD, 0x50, 1),
- MIB_ITEM(MIB_REG_STD, 0x48, 1),
- MIB_ITEM(MIB_REG_STD, 0x40, 1),
- MIB_ITEM(MIB_REG_STD, 0x38, 1),
- MIB_ITEM(MIB_REG_STD, 0x30, 1),
- MIB_ITEM(MIB_REG_PRV, 0x78, 1),
- MIB_ITEM(MIB_REG_PRV, 0x70, 1)
- },
- .rx_pkts = {
- MIB_ITEM(MIB_REG_STD, 0x54, 1),
- MIB_ITEM(MIB_REG_STD, 0x4c, 1),
- MIB_ITEM(MIB_REG_STD, 0x44, 1),
- MIB_ITEM(MIB_REG_STD, 0x3c, 1),
- MIB_ITEM(MIB_REG_STD, 0x34, 1),
- MIB_ITEM(MIB_REG_STD, 0x2c, 1),
- MIB_ITEM(MIB_REG_PRV, 0x74, 1),
- MIB_ITEM(MIB_REG_PRV, 0x6c, 1),
- },
- .rmon_ranges = {
- { 0, 64 },
- { 65, 127 },
- { 128, 255 },
- { 256, 511 },
- { 512, 1023 },
- { 1024, 1518 },
- { 1519, 12288 },
- { 12289, 65535 }
- },
-
- .drop_events = MIB_ITEM(MIB_REG_STD, 0x90, 1),
- .collisions = MIB_ITEM(MIB_REG_STD, 0x5c, 1),
-
- .rx_pause_frames = MIB_ITEM(MIB_REG_STD, 0x98, 1),
- .tx_pause_frames = MIB_ITEM(MIB_REG_STD, 0x94, 1),
-
- .list_count = ARRAY_SIZE(rtldsa_930x_mib_list),
- .list = rtldsa_930x_mib_list
-};
-
-const struct rtldsa_mib_list_item rtldsa_931x_mib_list[] = {
- MIB_LIST_ITEM("ifOutDiscards", MIB_ITEM(MIB_TBL_STD, 36, 1)),
- MIB_LIST_ITEM("dot1dTpPortInDiscards", MIB_ITEM(MIB_TBL_STD, 35, 1)),
- MIB_LIST_ITEM("DropEvents", MIB_ITEM(MIB_TBL_STD, 25, 1)),
- MIB_LIST_ITEM("tx_BroadcastPkts", MIB_ITEM(MIB_TBL_STD, 24, 1)),
- MIB_LIST_ITEM("tx_MulticastPkts", MIB_ITEM(MIB_TBL_STD, 23, 1)),
- MIB_LIST_ITEM("tx_CRCAlignErrors", MIB_ITEM(MIB_TBL_STD, 22, 1)),
- MIB_LIST_ITEM("tx_UndersizePkts", MIB_ITEM(MIB_TBL_STD, 20, 1)),
- MIB_LIST_ITEM("tx_OversizePkts", MIB_ITEM(MIB_TBL_STD, 18, 1)),
- MIB_LIST_ITEM("tx_Fragments", MIB_ITEM(MIB_TBL_STD, 16, 1)),
- MIB_LIST_ITEM("tx_Jabbers", MIB_ITEM(MIB_TBL_STD, 14, 1)),
- MIB_LIST_ITEM("tx_Collisions", MIB_ITEM(MIB_TBL_STD, 12, 1)),
-
- MIB_LIST_ITEM("rx_UndersizeDropPkts", MIB_ITEM(MIB_TBL_PRV, 27, 1)),
- MIB_LIST_ITEM("tx_PktsFlexibleOctetsSet1", MIB_ITEM(MIB_TBL_PRV, 22, 1)),
- MIB_LIST_ITEM("rx_PktsFlexibleOctetsSet1", MIB_ITEM(MIB_TBL_PRV, 21, 1)),
- MIB_LIST_ITEM("tx_PktsFlexibleOctetsCRCSet1", MIB_ITEM(MIB_TBL_PRV, 28, 1)),
- MIB_LIST_ITEM("rx_PktsFlexibleOctetsCRCSet1", MIB_ITEM(MIB_TBL_PRV, 27, 1)),
- MIB_LIST_ITEM("tx_PktsFlexibleOctetsSet0", MIB_ITEM(MIB_TBL_PRV, 18, 1)),
- MIB_LIST_ITEM("rx_PktsFlexibleOctetsSet0", MIB_ITEM(MIB_TBL_PRV, 17, 1)),
- MIB_LIST_ITEM("tx_PktsFlexibleOctetsCRCSet0", MIB_ITEM(MIB_TBL_PRV, 16, 1)),
- MIB_LIST_ITEM("rx_PktsFlexibleOctetsCRCSet0", MIB_ITEM(MIB_TBL_PRV, 15, 1)),
- MIB_LIST_ITEM("LengthFieldError", MIB_ITEM(MIB_TBL_PRV, 14, 1)),
- MIB_LIST_ITEM("FalseCarrierTimes", MIB_ITEM(MIB_TBL_PRV, 13, 1)),
- MIB_LIST_ITEM("UndersizeOctets", MIB_ITEM(MIB_TBL_PRV, 12, 1)),
- MIB_LIST_ITEM("FramingErrors", MIB_ITEM(MIB_TBL_PRV, 11, 1)),
- MIB_LIST_ITEM("rx_MacDiscards", MIB_ITEM(MIB_TBL_PRV, 9, 1)),
- MIB_LIST_ITEM("rx_MacIPGShortDrop", MIB_ITEM(MIB_TBL_PRV, 8, 1))
-};
-
-const struct rtldsa_mib_desc rtldsa_931x_mib = {
- .symbol_errors = MIB_ITEM(MIB_TBL_STD, 29, 1),
-
- .if_in_octets = MIB_ITEM(MIB_TBL_STD, 51, 2),
- .if_out_octets = MIB_ITEM(MIB_TBL_STD, 49, 2),
- .if_in_ucast_pkts = MIB_ITEM(MIB_TBL_STD, 47, 2),
- .if_in_mcast_pkts = MIB_ITEM(MIB_TBL_STD, 45, 2),
- .if_in_bcast_pkts = MIB_ITEM(MIB_TBL_STD, 43, 2),
- .if_out_ucast_pkts = MIB_ITEM(MIB_TBL_STD, 41, 2),
- .if_out_mcast_pkts = MIB_ITEM(MIB_TBL_STD, 39, 2),
- .if_out_bcast_pkts = MIB_ITEM(MIB_TBL_STD, 37, 2),
- .if_out_discards = MIB_ITEM(MIB_TBL_STD, 36, 1),
- .single_collisions = MIB_ITEM(MIB_TBL_STD, 35, 1),
- .multiple_collisions = MIB_ITEM(MIB_TBL_STD, 33, 1),
- .deferred_transmissions = MIB_ITEM(MIB_TBL_STD, 32, 1),
- .late_collisions = MIB_ITEM(MIB_TBL_STD, 31, 1),
- .excessive_collisions = MIB_ITEM(MIB_TBL_STD, 30, 1),
- .crc_align_errors = MIB_ITEM(MIB_TBL_STD, 21, 1),
- .rx_pkts_over_max_octets = MIB_ITEM(MIB_TBL_PRV, 23, 1),
-
- .unsupported_opcodes = MIB_ITEM(MIB_TBL_STD, 28, 1),
-
- .rx_undersize_pkts = MIB_ITEM(MIB_TBL_STD, 19, 1),
- .rx_oversize_pkts = MIB_ITEM(MIB_TBL_STD, 17, 1),
- .rx_fragments = MIB_ITEM(MIB_TBL_STD, 15, 1),
- .rx_jabbers = MIB_ITEM(MIB_TBL_STD, 13, 1),
-
- .tx_pkts = {
- MIB_ITEM(MIB_TBL_STD, 11, 1),
- MIB_ITEM(MIB_TBL_STD, 9, 1),
- MIB_ITEM(MIB_TBL_STD, 7, 1),
- MIB_ITEM(MIB_TBL_STD, 5, 1),
- MIB_ITEM(MIB_TBL_STD, 3, 1),
- MIB_ITEM(MIB_TBL_STD, 1, 1),
- MIB_ITEM(MIB_TBL_PRV, 26, 1),
- MIB_ITEM(MIB_TBL_PRV, 24, 1)
- },
- .rx_pkts = {
- MIB_ITEM(MIB_TBL_STD, 10, 1),
- MIB_ITEM(MIB_TBL_STD, 8, 1),
- MIB_ITEM(MIB_TBL_STD, 6, 1),
- MIB_ITEM(MIB_TBL_STD, 4, 1),
- MIB_ITEM(MIB_TBL_STD, 2, 1),
- MIB_ITEM(MIB_TBL_STD, 0, 1),
- MIB_ITEM(MIB_TBL_PRV, 25, 1),
- MIB_ITEM(MIB_TBL_PRV, 23, 1),
- },
- .rmon_ranges = {
- { 0, 64 },
- { 65, 127 },
- { 128, 255 },
- { 256, 511 },
- { 512, 1023 },
- { 1024, 1518 },
- { 1519, 12288 },
- { 12289, 65535 }
- },
-
- .drop_events = MIB_ITEM(MIB_TBL_STD, 25, 1),
- .collisions = MIB_ITEM(MIB_TBL_STD, 12, 1),
-
- .rx_pause_frames = MIB_ITEM(MIB_TBL_STD, 27, 1),
- .tx_pause_frames = MIB_ITEM(MIB_TBL_STD, 26, 1),
-
- .list_count = ARRAY_SIZE(rtldsa_931x_mib_list),
- .list = rtldsa_931x_mib_list
-};
-
/* DSA callbacks */
static enum dsa_tag_protocol rtldsa_get_tag_protocol(struct dsa_switch *ds,
static const struct rtldsa_mib_desc *rtldsa_get_mib_desc(struct rtl838x_switch_priv *priv)
{
- switch (priv->family_id) {
- case RTL8380_FAMILY_ID:
- return &rtldsa_838x_mib;
- case RTL8390_FAMILY_ID:
- return &rtldsa_839x_mib;
- case RTL9300_FAMILY_ID:
- return &rtldsa_930x_mib;
- case RTL9310_FAMILY_ID:
- return &rtldsa_931x_mib;
- default:
- return NULL;
- }
+ return priv->r->mib_desc;
}
static bool rtldsa_read_mib_item(struct rtl838x_switch_priv *priv, int port,
},
};
+const struct rtldsa_mib_list_item rtldsa_838x_mib_list[] = {
+ MIB_LIST_ITEM("dot1dTpPortInDiscards", MIB_ITEM(MIB_REG_STD, 0xec, 1)),
+ MIB_LIST_ITEM("ifOutDiscards", MIB_ITEM(MIB_REG_STD, 0xd0, 1)),
+ MIB_LIST_ITEM("DropEvents", MIB_ITEM(MIB_REG_STD, 0xa8, 1)),
+ MIB_LIST_ITEM("tx_BroadcastPkts", MIB_ITEM(MIB_REG_STD, 0xa4, 1)),
+ MIB_LIST_ITEM("tx_MulticastPkts", MIB_ITEM(MIB_REG_STD, 0xa0, 1)),
+ MIB_LIST_ITEM("tx_UndersizePkts", MIB_ITEM(MIB_REG_STD, 0x98, 1)),
+ MIB_LIST_ITEM("rx_UndersizeDropPkts", MIB_ITEM(MIB_REG_STD, 0x90, 1)),
+ MIB_LIST_ITEM("tx_OversizePkts", MIB_ITEM(MIB_REG_STD, 0x8c, 1)),
+ MIB_LIST_ITEM("Collisions", MIB_ITEM(MIB_REG_STD, 0x7c, 1)),
+ MIB_LIST_ITEM("rx_MacDiscards", MIB_ITEM(MIB_REG_STD, 0x40, 1))
+};
+
+const struct rtldsa_mib_desc rtldsa_838x_mib_desc = {
+ .symbol_errors = MIB_ITEM(MIB_REG_STD, 0xb8, 1),
+
+ .if_in_octets = MIB_ITEM(MIB_REG_STD, 0xf8, 2),
+ .if_out_octets = MIB_ITEM(MIB_REG_STD, 0xf0, 2),
+ .if_in_ucast_pkts = MIB_ITEM(MIB_REG_STD, 0xe8, 1),
+ .if_in_mcast_pkts = MIB_ITEM(MIB_REG_STD, 0xe4, 1),
+ .if_in_bcast_pkts = MIB_ITEM(MIB_REG_STD, 0xe0, 1),
+ .if_out_ucast_pkts = MIB_ITEM(MIB_REG_STD, 0xdc, 1),
+ .if_out_mcast_pkts = MIB_ITEM(MIB_REG_STD, 0xd8, 1),
+ .if_out_bcast_pkts = MIB_ITEM(MIB_REG_STD, 0xd4, 1),
+ .if_out_discards = MIB_ITEM(MIB_REG_STD, 0xd0, 1),
+ .single_collisions = MIB_ITEM(MIB_REG_STD, 0xcc, 1),
+ .multiple_collisions = MIB_ITEM(MIB_REG_STD, 0xc8, 1),
+ .deferred_transmissions = MIB_ITEM(MIB_REG_STD, 0xc4, 1),
+ .late_collisions = MIB_ITEM(MIB_REG_STD, 0xc0, 1),
+ .excessive_collisions = MIB_ITEM(MIB_REG_STD, 0xbc, 1),
+ .crc_align_errors = MIB_ITEM(MIB_REG_STD, 0x9c, 1),
+
+ .unsupported_opcodes = MIB_ITEM(MIB_REG_STD, 0xb4, 1),
+
+ .rx_undersize_pkts = MIB_ITEM(MIB_REG_STD, 0x94, 1),
+ .rx_oversize_pkts = MIB_ITEM(MIB_REG_STD, 0x88, 1),
+ .rx_fragments = MIB_ITEM(MIB_REG_STD, 0x84, 1),
+ .rx_jabbers = MIB_ITEM(MIB_REG_STD, 0x80, 1),
+
+ .tx_pkts = {
+ MIB_ITEM(MIB_REG_STD, 0x78, 1),
+ MIB_ITEM(MIB_REG_STD, 0x70, 1),
+ MIB_ITEM(MIB_REG_STD, 0x68, 1),
+ MIB_ITEM(MIB_REG_STD, 0x60, 1),
+ MIB_ITEM(MIB_REG_STD, 0x58, 1),
+ MIB_ITEM(MIB_REG_STD, 0x50, 1),
+ MIB_ITEM(MIB_REG_STD, 0x48, 1)
+ },
+ .rx_pkts = {
+ MIB_ITEM(MIB_REG_STD, 0x74, 1),
+ MIB_ITEM(MIB_REG_STD, 0x6c, 1),
+ MIB_ITEM(MIB_REG_STD, 0x64, 1),
+ MIB_ITEM(MIB_REG_STD, 0x5c, 1),
+ MIB_ITEM(MIB_REG_STD, 0x54, 1),
+ MIB_ITEM(MIB_REG_STD, 0x4c, 1),
+ MIB_ITEM(MIB_REG_STD, 0x44, 1)
+ },
+ .rmon_ranges = {
+ { 0, 64 },
+ { 65, 127 },
+ { 128, 255 },
+ { 256, 511 },
+ { 512, 1023 },
+ { 1024, 1518 },
+ { 1519, 10000 }
+ },
+
+ .drop_events = MIB_ITEM(MIB_REG_STD, 0xa8, 1),
+ .collisions = MIB_ITEM(MIB_REG_STD, 0x7c, 1),
+
+ .rx_pause_frames = MIB_ITEM(MIB_REG_STD, 0xb0, 1),
+ .tx_pause_frames = MIB_ITEM(MIB_REG_STD, 0xac, 1),
+
+ .list_count = ARRAY_SIZE(rtldsa_838x_mib_list),
+ .list = rtldsa_838x_mib_list
+};
+
void rtldsa_838x_print_matrix(void)
{
unsigned volatile int *ptr8;
.stat_port_rst = RTL838X_STAT_PORT_RST,
.stat_rst = RTL838X_STAT_RST,
.stat_port_std_mib = RTL838X_STAT_PORT_STD_MIB,
+ .mib_desc = &rtldsa_838x_mib_desc,
.stat_counters_lock = rtldsa_counters_lock_register,
.stat_counters_unlock = rtldsa_counters_unlock_register,
.stat_update_counters_atomically = rtldsa_update_counters_atomically,
int stat_rst;
int stat_port_std_mib;
int stat_port_prv_mib;
+ const struct rtldsa_mib_desc *mib_desc;
u64 (*stat_port_table_read)(int port, unsigned int mib_size, unsigned int offset, bool is_pvt);
void (*stat_counters_lock)(struct rtl838x_switch_priv *priv, int port);
void (*stat_counters_unlock)(struct rtl838x_switch_priv *priv, int port);
},
};
+const struct rtldsa_mib_list_item rtldsa_839x_mib_list[] = {
+ MIB_LIST_ITEM("ifOutDiscards", MIB_ITEM(MIB_REG_STD, 0xd4, 1)),
+ MIB_LIST_ITEM("dot1dTpPortInDiscards", MIB_ITEM(MIB_REG_STD, 0xd0, 1)),
+ MIB_LIST_ITEM("DropEvents", MIB_ITEM(MIB_REG_STD, 0xa8, 1)),
+ MIB_LIST_ITEM("tx_BroadcastPkts", MIB_ITEM(MIB_REG_STD, 0xa4, 1)),
+ MIB_LIST_ITEM("tx_MulticastPkts", MIB_ITEM(MIB_REG_STD, 0xa0, 1)),
+ MIB_LIST_ITEM("tx_UndersizePkts", MIB_ITEM(MIB_REG_STD, 0x98, 1)),
+ MIB_LIST_ITEM("rx_UndersizeDropPkts", MIB_ITEM(MIB_REG_STD, 0x90, 1)),
+ MIB_LIST_ITEM("tx_OversizePkts", MIB_ITEM(MIB_REG_STD, 0x8c, 1)),
+ MIB_LIST_ITEM("Collisions", MIB_ITEM(MIB_REG_STD, 0x7c, 1)),
+ MIB_LIST_ITEM("rx_LengthFieldError", MIB_ITEM(MIB_REG_STD, 0x40, 1)),
+ MIB_LIST_ITEM("rx_FalseCarrierTimes", MIB_ITEM(MIB_REG_STD, 0x3c, 1)),
+ MIB_LIST_ITEM("rx_UnderSizeOctets", MIB_ITEM(MIB_REG_STD, 0x38, 1)),
+ MIB_LIST_ITEM("tx_Fragments", MIB_ITEM(MIB_REG_STD, 0x34, 1)),
+ MIB_LIST_ITEM("tx_Jabbers", MIB_ITEM(MIB_REG_STD, 0x30, 1)),
+ MIB_LIST_ITEM("tx_CRCAlignErrors", MIB_ITEM(MIB_REG_STD, 0x2c, 1)),
+ MIB_LIST_ITEM("rx_FramingErrors", MIB_ITEM(MIB_REG_STD, 0x28, 1)),
+ MIB_LIST_ITEM("rx_MacDiscards", MIB_ITEM(MIB_REG_STD, 0x24, 1))
+};
+
+const struct rtldsa_mib_desc rtldsa_839x_mib_desc = {
+ .symbol_errors = MIB_ITEM(MIB_REG_STD, 0xb8, 1),
+
+ .if_in_octets = MIB_ITEM(MIB_REG_STD, 0xf8, 2),
+ .if_out_octets = MIB_ITEM(MIB_REG_STD, 0xf0, 2),
+ .if_in_ucast_pkts = MIB_ITEM(MIB_REG_STD, 0xec, 1),
+ .if_in_mcast_pkts = MIB_ITEM(MIB_REG_STD, 0xe8, 1),
+ .if_in_bcast_pkts = MIB_ITEM(MIB_REG_STD, 0xe4, 1),
+ .if_out_ucast_pkts = MIB_ITEM(MIB_REG_STD, 0xe0, 1),
+ .if_out_mcast_pkts = MIB_ITEM(MIB_REG_STD, 0xdc, 1),
+ .if_out_bcast_pkts = MIB_ITEM(MIB_REG_STD, 0xd8, 1),
+ .if_out_discards = MIB_ITEM(MIB_REG_STD, 0xd4, 1),
+ .single_collisions = MIB_ITEM(MIB_REG_STD, 0xcc, 1),
+ .multiple_collisions = MIB_ITEM(MIB_REG_STD, 0xc8, 1),
+ .deferred_transmissions = MIB_ITEM(MIB_REG_STD, 0xc4, 1),
+ .late_collisions = MIB_ITEM(MIB_REG_STD, 0xc0, 1),
+ .excessive_collisions = MIB_ITEM(MIB_REG_STD, 0xbc, 1),
+ .crc_align_errors = MIB_ITEM(MIB_REG_STD, 0x9c, 1),
+
+ .unsupported_opcodes = MIB_ITEM(MIB_REG_STD, 0xb4, 1),
+
+ .rx_undersize_pkts = MIB_ITEM(MIB_REG_STD, 0x94, 1),
+ .rx_oversize_pkts = MIB_ITEM(MIB_REG_STD, 0x88, 1),
+ .rx_fragments = MIB_ITEM(MIB_REG_STD, 0x84, 1),
+ .rx_jabbers = MIB_ITEM(MIB_REG_STD, 0x80, 1),
+
+ .tx_pkts = {
+ MIB_ITEM(MIB_REG_STD, 0x78, 1),
+ MIB_ITEM(MIB_REG_STD, 0x70, 1),
+ MIB_ITEM(MIB_REG_STD, 0x68, 1),
+ MIB_ITEM(MIB_REG_STD, 0x60, 1),
+ MIB_ITEM(MIB_REG_STD, 0x58, 1),
+ MIB_ITEM(MIB_REG_STD, 0x50, 1),
+ MIB_ITEM(MIB_REG_STD, 0x48, 1)
+ },
+ .rx_pkts = {
+ MIB_ITEM(MIB_REG_STD, 0x74, 1),
+ MIB_ITEM(MIB_REG_STD, 0x6c, 1),
+ MIB_ITEM(MIB_REG_STD, 0x64, 1),
+ MIB_ITEM(MIB_REG_STD, 0x5c, 1),
+ MIB_ITEM(MIB_REG_STD, 0x54, 1),
+ MIB_ITEM(MIB_REG_STD, 0x4c, 1),
+ MIB_ITEM(MIB_REG_STD, 0x44, 1)
+ },
+ .rmon_ranges = {
+ { 0, 64 },
+ { 65, 127 },
+ { 128, 255 },
+ { 256, 511 },
+ { 512, 1023 },
+ { 1024, 1518 },
+ { 1519, 12288 }
+ },
+
+ .drop_events = MIB_ITEM(MIB_REG_STD, 0xa8, 1),
+ .collisions = MIB_ITEM(MIB_REG_STD, 0x7c, 1),
+
+ .rx_pause_frames = MIB_ITEM(MIB_REG_STD, 0xb0, 1),
+ .tx_pause_frames = MIB_ITEM(MIB_REG_STD, 0xac, 1),
+
+ .list_count = ARRAY_SIZE(rtldsa_839x_mib_list),
+ .list = rtldsa_839x_mib_list
+};
+
void rtldsa_839x_print_matrix(void)
{
volatile u64 *ptr9;
.stat_port_rst = RTL839X_STAT_PORT_RST,
.stat_rst = RTL839X_STAT_RST,
.stat_port_std_mib = RTL839X_STAT_PORT_STD_MIB,
+ .mib_desc = &rtldsa_839x_mib_desc,
.stat_counters_lock = rtldsa_counters_lock_register,
.stat_counters_unlock = rtldsa_counters_unlock_register,
.stat_update_counters_atomically = rtldsa_update_counters_atomically,
},
};
+const struct rtldsa_mib_list_item rtldsa_930x_mib_list[] = {
+ MIB_LIST_ITEM("ifOutDiscards", MIB_ITEM(MIB_REG_STD, 0xbc, 1)),
+ MIB_LIST_ITEM("dot1dTpPortInDiscards", MIB_ITEM(MIB_REG_STD, 0xb8, 1)),
+ MIB_LIST_ITEM("DropEvents", MIB_ITEM(MIB_REG_STD, 0x90, 1)),
+ MIB_LIST_ITEM("tx_BroadcastPkts", MIB_ITEM(MIB_REG_STD, 0x8c, 1)),
+ MIB_LIST_ITEM("tx_MulticastPkts", MIB_ITEM(MIB_REG_STD, 0x88, 1)),
+ MIB_LIST_ITEM("tx_CRCAlignErrors", MIB_ITEM(MIB_REG_STD, 0x84, 1)),
+ MIB_LIST_ITEM("tx_UndersizePkts", MIB_ITEM(MIB_REG_STD, 0x7c, 1)),
+ MIB_LIST_ITEM("tx_OversizePkts", MIB_ITEM(MIB_REG_STD, 0x74, 1)),
+ MIB_LIST_ITEM("tx_Fragments", MIB_ITEM(MIB_REG_STD, 0x6c, 1)),
+ MIB_LIST_ITEM("tx_Jabbers", MIB_ITEM(MIB_REG_STD, 0x64, 1)),
+ MIB_LIST_ITEM("tx_Collisions", MIB_ITEM(MIB_REG_STD, 0x5c, 1)),
+ MIB_LIST_ITEM("rx_UndersizeDropPkts", MIB_ITEM(MIB_REG_PRV, 0x7c, 1)),
+ MIB_LIST_ITEM("tx_PktsFlexibleOctetsSet1", MIB_ITEM(MIB_REG_PRV, 0x68, 1)),
+ MIB_LIST_ITEM("rx_PktsFlexibleOctetsSet1", MIB_ITEM(MIB_REG_PRV, 0x64, 1)),
+ MIB_LIST_ITEM("tx_PktsFlexibleOctetsCRCSet1", MIB_ITEM(MIB_REG_PRV, 0x60, 1)),
+ MIB_LIST_ITEM("rx_PktsFlexibleOctetsCRCSet1", MIB_ITEM(MIB_REG_PRV, 0x5c, 1)),
+ MIB_LIST_ITEM("tx_PktsFlexibleOctetsSet0", MIB_ITEM(MIB_REG_PRV, 0x58, 1)),
+ MIB_LIST_ITEM("rx_PktsFlexibleOctetsSet0", MIB_ITEM(MIB_REG_PRV, 0x54, 1)),
+ MIB_LIST_ITEM("tx_PktsFlexibleOctetsCRCSet0", MIB_ITEM(MIB_REG_PRV, 0x50, 1)),
+ MIB_LIST_ITEM("rx_PktsFlexibleOctetsCRCSet0", MIB_ITEM(MIB_REG_PRV, 0x4c, 1)),
+ MIB_LIST_ITEM("LengthFieldError", MIB_ITEM(MIB_REG_PRV, 0x48, 1)),
+ MIB_LIST_ITEM("FalseCarrierTimes", MIB_ITEM(MIB_REG_PRV, 0x44, 1)),
+ MIB_LIST_ITEM("UndersizeOctets", MIB_ITEM(MIB_REG_PRV, 0x40, 1)),
+ MIB_LIST_ITEM("FramingErrors", MIB_ITEM(MIB_REG_PRV, 0x3c, 1)),
+ MIB_LIST_ITEM("ParserErrors", MIB_ITEM(MIB_REG_PRV, 0x38, 1)),
+ MIB_LIST_ITEM("rx_MacDiscards", MIB_ITEM(MIB_REG_PRV, 0x34, 1)),
+ MIB_LIST_ITEM("rx_MacIPGShortDrop", MIB_ITEM(MIB_REG_PRV, 0x30, 1))
+};
+
+const struct rtldsa_mib_desc rtldsa_930x_mib_desc = {
+ .symbol_errors = MIB_ITEM(MIB_REG_STD, 0xa0, 1),
+
+ .if_in_octets = MIB_ITEM(MIB_REG_STD, 0xf8, 2),
+ .if_out_octets = MIB_ITEM(MIB_REG_STD, 0xf0, 2),
+ .if_in_ucast_pkts = MIB_ITEM(MIB_REG_STD, 0xe8, 2),
+ .if_in_mcast_pkts = MIB_ITEM(MIB_REG_STD, 0xe0, 2),
+ .if_in_bcast_pkts = MIB_ITEM(MIB_REG_STD, 0xd8, 2),
+ .if_out_ucast_pkts = MIB_ITEM(MIB_REG_STD, 0xd0, 2),
+ .if_out_mcast_pkts = MIB_ITEM(MIB_REG_STD, 0xc8, 2),
+ .if_out_bcast_pkts = MIB_ITEM(MIB_REG_STD, 0xc0, 2),
+ .if_out_discards = MIB_ITEM(MIB_REG_STD, 0xbc, 1),
+ .single_collisions = MIB_ITEM(MIB_REG_STD, 0xb4, 1),
+ .multiple_collisions = MIB_ITEM(MIB_REG_STD, 0xb0, 1),
+ .deferred_transmissions = MIB_ITEM(MIB_REG_STD, 0xac, 1),
+ .late_collisions = MIB_ITEM(MIB_REG_STD, 0xa8, 1),
+ .excessive_collisions = MIB_ITEM(MIB_REG_STD, 0xa4, 1),
+ .crc_align_errors = MIB_ITEM(MIB_REG_STD, 0x80, 1),
+ .rx_pkts_over_max_octets = MIB_ITEM(MIB_REG_PRV, 0x6c, 1),
+
+ .unsupported_opcodes = MIB_ITEM(MIB_REG_STD, 0x9c, 1),
+
+ .rx_undersize_pkts = MIB_ITEM(MIB_REG_STD, 0x78, 1),
+ .rx_oversize_pkts = MIB_ITEM(MIB_REG_STD, 0x70, 1),
+ .rx_fragments = MIB_ITEM(MIB_REG_STD, 0x68, 1),
+ .rx_jabbers = MIB_ITEM(MIB_REG_STD, 0x60, 1),
+
+ .tx_pkts = {
+ MIB_ITEM(MIB_REG_STD, 0x58, 1),
+ MIB_ITEM(MIB_REG_STD, 0x50, 1),
+ MIB_ITEM(MIB_REG_STD, 0x48, 1),
+ MIB_ITEM(MIB_REG_STD, 0x40, 1),
+ MIB_ITEM(MIB_REG_STD, 0x38, 1),
+ MIB_ITEM(MIB_REG_STD, 0x30, 1),
+ MIB_ITEM(MIB_REG_PRV, 0x78, 1),
+ MIB_ITEM(MIB_REG_PRV, 0x70, 1)
+ },
+ .rx_pkts = {
+ MIB_ITEM(MIB_REG_STD, 0x54, 1),
+ MIB_ITEM(MIB_REG_STD, 0x4c, 1),
+ MIB_ITEM(MIB_REG_STD, 0x44, 1),
+ MIB_ITEM(MIB_REG_STD, 0x3c, 1),
+ MIB_ITEM(MIB_REG_STD, 0x34, 1),
+ MIB_ITEM(MIB_REG_STD, 0x2c, 1),
+ MIB_ITEM(MIB_REG_PRV, 0x74, 1),
+ MIB_ITEM(MIB_REG_PRV, 0x6c, 1),
+ },
+ .rmon_ranges = {
+ { 0, 64 },
+ { 65, 127 },
+ { 128, 255 },
+ { 256, 511 },
+ { 512, 1023 },
+ { 1024, 1518 },
+ { 1519, 12288 },
+ { 12289, 65535 }
+ },
+
+ .drop_events = MIB_ITEM(MIB_REG_STD, 0x90, 1),
+ .collisions = MIB_ITEM(MIB_REG_STD, 0x5c, 1),
+
+ .rx_pause_frames = MIB_ITEM(MIB_REG_STD, 0x98, 1),
+ .tx_pause_frames = MIB_ITEM(MIB_REG_STD, 0x94, 1),
+
+ .list_count = ARRAY_SIZE(rtldsa_930x_mib_list),
+ .list = rtldsa_930x_mib_list
+};
+
void rtldsa_930x_print_matrix(void)
{
struct table_reg *r = rtl_table_get(RTL9300_TBL_0, 6);
.stat_rst = RTL930X_STAT_RST,
.stat_port_std_mib = RTL930X_STAT_PORT_MIB_CNTR,
.stat_port_prv_mib = RTL930X_STAT_PORT_PRVTE_CNTR,
+ .mib_desc = &rtldsa_930x_mib_desc,
.stat_counters_lock = rtldsa_counters_lock_register,
.stat_counters_unlock = rtldsa_counters_unlock_register,
.stat_update_counters_atomically = rtldsa_update_counters_atomically,
},
};
+const struct rtldsa_mib_list_item rtldsa_931x_mib_list[] = {
+ MIB_LIST_ITEM("ifOutDiscards", MIB_ITEM(MIB_TBL_STD, 36, 1)),
+ MIB_LIST_ITEM("dot1dTpPortInDiscards", MIB_ITEM(MIB_TBL_STD, 35, 1)),
+ MIB_LIST_ITEM("DropEvents", MIB_ITEM(MIB_TBL_STD, 25, 1)),
+ MIB_LIST_ITEM("tx_BroadcastPkts", MIB_ITEM(MIB_TBL_STD, 24, 1)),
+ MIB_LIST_ITEM("tx_MulticastPkts", MIB_ITEM(MIB_TBL_STD, 23, 1)),
+ MIB_LIST_ITEM("tx_CRCAlignErrors", MIB_ITEM(MIB_TBL_STD, 22, 1)),
+ MIB_LIST_ITEM("tx_UndersizePkts", MIB_ITEM(MIB_TBL_STD, 20, 1)),
+ MIB_LIST_ITEM("tx_OversizePkts", MIB_ITEM(MIB_TBL_STD, 18, 1)),
+ MIB_LIST_ITEM("tx_Fragments", MIB_ITEM(MIB_TBL_STD, 16, 1)),
+ MIB_LIST_ITEM("tx_Jabbers", MIB_ITEM(MIB_TBL_STD, 14, 1)),
+ MIB_LIST_ITEM("tx_Collisions", MIB_ITEM(MIB_TBL_STD, 12, 1)),
+
+ MIB_LIST_ITEM("rx_UndersizeDropPkts", MIB_ITEM(MIB_TBL_PRV, 27, 1)),
+ MIB_LIST_ITEM("tx_PktsFlexibleOctetsSet1", MIB_ITEM(MIB_TBL_PRV, 22, 1)),
+ MIB_LIST_ITEM("rx_PktsFlexibleOctetsSet1", MIB_ITEM(MIB_TBL_PRV, 21, 1)),
+ MIB_LIST_ITEM("tx_PktsFlexibleOctetsCRCSet1", MIB_ITEM(MIB_TBL_PRV, 28, 1)),
+ MIB_LIST_ITEM("rx_PktsFlexibleOctetsCRCSet1", MIB_ITEM(MIB_TBL_PRV, 27, 1)),
+ MIB_LIST_ITEM("tx_PktsFlexibleOctetsSet0", MIB_ITEM(MIB_TBL_PRV, 18, 1)),
+ MIB_LIST_ITEM("rx_PktsFlexibleOctetsSet0", MIB_ITEM(MIB_TBL_PRV, 17, 1)),
+ MIB_LIST_ITEM("tx_PktsFlexibleOctetsCRCSet0", MIB_ITEM(MIB_TBL_PRV, 16, 1)),
+ MIB_LIST_ITEM("rx_PktsFlexibleOctetsCRCSet0", MIB_ITEM(MIB_TBL_PRV, 15, 1)),
+ MIB_LIST_ITEM("LengthFieldError", MIB_ITEM(MIB_TBL_PRV, 14, 1)),
+ MIB_LIST_ITEM("FalseCarrierTimes", MIB_ITEM(MIB_TBL_PRV, 13, 1)),
+ MIB_LIST_ITEM("UndersizeOctets", MIB_ITEM(MIB_TBL_PRV, 12, 1)),
+ MIB_LIST_ITEM("FramingErrors", MIB_ITEM(MIB_TBL_PRV, 11, 1)),
+ MIB_LIST_ITEM("rx_MacDiscards", MIB_ITEM(MIB_TBL_PRV, 9, 1)),
+ MIB_LIST_ITEM("rx_MacIPGShortDrop", MIB_ITEM(MIB_TBL_PRV, 8, 1))
+};
+
+const struct rtldsa_mib_desc rtldsa_931x_mib_desc = {
+ .symbol_errors = MIB_ITEM(MIB_TBL_STD, 29, 1),
+
+ .if_in_octets = MIB_ITEM(MIB_TBL_STD, 51, 2),
+ .if_out_octets = MIB_ITEM(MIB_TBL_STD, 49, 2),
+ .if_in_ucast_pkts = MIB_ITEM(MIB_TBL_STD, 47, 2),
+ .if_in_mcast_pkts = MIB_ITEM(MIB_TBL_STD, 45, 2),
+ .if_in_bcast_pkts = MIB_ITEM(MIB_TBL_STD, 43, 2),
+ .if_out_ucast_pkts = MIB_ITEM(MIB_TBL_STD, 41, 2),
+ .if_out_mcast_pkts = MIB_ITEM(MIB_TBL_STD, 39, 2),
+ .if_out_bcast_pkts = MIB_ITEM(MIB_TBL_STD, 37, 2),
+ .if_out_discards = MIB_ITEM(MIB_TBL_STD, 36, 1),
+ .single_collisions = MIB_ITEM(MIB_TBL_STD, 35, 1),
+ .multiple_collisions = MIB_ITEM(MIB_TBL_STD, 33, 1),
+ .deferred_transmissions = MIB_ITEM(MIB_TBL_STD, 32, 1),
+ .late_collisions = MIB_ITEM(MIB_TBL_STD, 31, 1),
+ .excessive_collisions = MIB_ITEM(MIB_TBL_STD, 30, 1),
+ .crc_align_errors = MIB_ITEM(MIB_TBL_STD, 21, 1),
+ .rx_pkts_over_max_octets = MIB_ITEM(MIB_TBL_PRV, 23, 1),
+
+ .unsupported_opcodes = MIB_ITEM(MIB_TBL_STD, 28, 1),
+
+ .rx_undersize_pkts = MIB_ITEM(MIB_TBL_STD, 19, 1),
+ .rx_oversize_pkts = MIB_ITEM(MIB_TBL_STD, 17, 1),
+ .rx_fragments = MIB_ITEM(MIB_TBL_STD, 15, 1),
+ .rx_jabbers = MIB_ITEM(MIB_TBL_STD, 13, 1),
+
+ .tx_pkts = {
+ MIB_ITEM(MIB_TBL_STD, 11, 1),
+ MIB_ITEM(MIB_TBL_STD, 9, 1),
+ MIB_ITEM(MIB_TBL_STD, 7, 1),
+ MIB_ITEM(MIB_TBL_STD, 5, 1),
+ MIB_ITEM(MIB_TBL_STD, 3, 1),
+ MIB_ITEM(MIB_TBL_STD, 1, 1),
+ MIB_ITEM(MIB_TBL_PRV, 26, 1),
+ MIB_ITEM(MIB_TBL_PRV, 24, 1)
+ },
+ .rx_pkts = {
+ MIB_ITEM(MIB_TBL_STD, 10, 1),
+ MIB_ITEM(MIB_TBL_STD, 8, 1),
+ MIB_ITEM(MIB_TBL_STD, 6, 1),
+ MIB_ITEM(MIB_TBL_STD, 4, 1),
+ MIB_ITEM(MIB_TBL_STD, 2, 1),
+ MIB_ITEM(MIB_TBL_STD, 0, 1),
+ MIB_ITEM(MIB_TBL_PRV, 25, 1),
+ MIB_ITEM(MIB_TBL_PRV, 23, 1),
+ },
+ .rmon_ranges = {
+ { 0, 64 },
+ { 65, 127 },
+ { 128, 255 },
+ { 256, 511 },
+ { 512, 1023 },
+ { 1024, 1518 },
+ { 1519, 12288 },
+ { 12289, 65535 }
+ },
+
+ .drop_events = MIB_ITEM(MIB_TBL_STD, 25, 1),
+ .collisions = MIB_ITEM(MIB_TBL_STD, 12, 1),
+
+ .rx_pause_frames = MIB_ITEM(MIB_TBL_STD, 27, 1),
+ .tx_pause_frames = MIB_ITEM(MIB_TBL_STD, 26, 1),
+
+ .list_count = ARRAY_SIZE(rtldsa_931x_mib_list),
+ .list = rtldsa_931x_mib_list
+};
+
inline void rtl931x_exec_tbl0_cmd(u32 cmd)
{
sw_w32(cmd, RTL931X_TBL_ACCESS_CTRL_0);
.stat_port_rst = RTL931X_STAT_PORT_RST,
.stat_rst = RTL931X_STAT_RST,
.stat_port_std_mib = 0, /* Not defined */
+ .mib_desc = &rtldsa_931x_mib_desc,
.stat_port_table_read = rtldsa_931x_stat_port_table_read,
.stat_counters_lock = rtldsa_counters_lock_table,
.stat_counters_unlock = rtldsa_counters_unlock_table,