24 #define TXNIC_LINE_SIZE 128 27 #define TXNIC_VF_BAR_SIZE 0x200000UL 30 #define TXNIC_PF_BAR_SIZE 0x40000000UL 33 #define TXNIC_BGX_BAR_SIZE 0x400000UL 36 #define TXNIC_NUM_BGX 2 39 #define TXNIC_NUM_LMAC 4 42 #define TXNIC_NUM_DMAC 32 45 #define TXNIC_NUM_STEERING 8 56 return ( (
addr >> 44 ) & 0x3 );
68 return ( (
addr >> 24 ) & 0x1 );
79 #define TXNIC_QS_SQ_CFG(q) ( ( (q) << 18 ) | 0x010800 ) 80 #define TXNIC_QS_SQ_CFG_ENA ( 1ULL << 19 ) 81 #define TXNIC_QS_SQ_CFG_RESET ( 1ULL << 17 ) 82 #define TXNIC_QS_SQ_CFG_QSIZE(sz) ( ( ( uint64_t ) (sz) ) << 8 ) 83 #define TXNIC_QS_SQ_CFG_QSIZE_1K \ 84 TXNIC_QS_SQ_CFG_QSIZE ( 0 ) 87 #define TXNIC_QS_SQ_BASE(q) ( ( (q) << 18 ) | 0x010820 ) 90 #define TXNIC_QS_SQ_HEAD(q) ( ( (q) << 18 ) | 0x010828 ) 93 #define TXNIC_QS_SQ_TAIL(q) ( ( (q) << 18 ) | 0x010830 ) 96 #define TXNIC_QS_SQ_DOOR(q) ( ( (q) << 18 ) | 0x010838 ) 99 #define TXNIC_QS_SQ_STATUS(q) ( ( (q) << 18 ) | 0x010840 ) 100 #define TXNIC_QS_SQ_STATUS_STOPPED ( 1ULL << 21 ) 106 #define TXNIC_SQ_STOP_MAX_WAIT_MS 100 126 #define TXNIC_SEND_HDR_FLAGS 0x14 144 #define TXNIC_SEND_GATHER_FLAGS 0x40 159 #define TXNIC_SQE_SUBDESCS ( sizeof ( struct txnic_sqe ) / \ 160 sizeof ( struct txnic_send_header ) ) 166 #define TXNIC_SQES ( 1024 / TXNIC_SQE_SUBDESCS ) 172 #define TXNIC_SQ_FILL 32 175 #define TXNIC_SQ_ALIGN TXNIC_LINE_SIZE 178 #define TXNIC_SQ_STRIDE sizeof ( struct txnic_sqe ) 181 #define TXNIC_SQ_SIZE ( TXNIC_SQES * TXNIC_SQ_STRIDE ) 201 #define TXNIC_QS_RQ_CFG(q) ( ( (q) << 18 ) | 0x010600 ) 202 #define TXNIC_QS_RQ_CFG_ENA ( 1ULL << 1 ) 208 #define TXNIC_RQ_DISABLE_MAX_WAIT_MS 100 211 #define TXNIC_QS_RBDR_CFG(q) ( ( (q) << 18 ) | 0x010c00 ) 212 #define TXNIC_QS_RBDR_CFG_ENA ( 1ULL << 44 ) 213 #define TXNIC_QS_RBDR_CFG_RESET ( 1ULL << 43 ) 214 #define TXNIC_QS_RBDR_CFG_QSIZE(sz) ( ( ( uint64_t ) (sz) ) << 32 ) 215 #define TXNIC_QS_RBDR_CFG_QSIZE_8K \ 216 TXNIC_QS_RBDR_CFG_QSIZE ( 0 ) 217 #define TXNIC_QS_RBDR_CFG_LINES(sz) ( ( ( uint64_t ) (sz) ) << 0 ) 220 #define TXNIC_QS_RBDR_BASE(q) ( ( (q) << 18 ) | 0x010c20 ) 223 #define TXNIC_QS_RBDR_HEAD(q) ( ( (q) << 18 ) | 0x010c28 ) 226 #define TXNIC_QS_RBDR_TAIL(q) ( ( (q) << 18 ) | 0x010c30 ) 229 #define TXNIC_QS_RBDR_DOOR(q) ( ( (q) << 18 ) | 0x010c38 ) 232 #define TXNIC_QS_RBDR_STATUS0(q) ( ( (q) << 18 ) | 0x010c40 ) 250 #define TXNIC_RQES 8192 256 #define TXNIC_RQ_FILL 32 262 #define TXNIC_RQE_SIZE ( ( ETH_DATA_ALIGN + ETH_FRAME_LEN + \ 263 4 + TXNIC_LINE_SIZE - 1 ) \ 264 & ~( TXNIC_LINE_SIZE - 1 ) ) 267 #define TXNIC_RQ_ALIGN TXNIC_LINE_SIZE 270 #define TXNIC_RQ_STRIDE sizeof ( struct txnic_rqe ) 273 #define TXNIC_RQ_SIZE ( TXNIC_RQES * TXNIC_RQ_STRIDE ) 295 #define TXNIC_QS_CQ_CFG(q) ( ( (q) << 18 ) | 0x010400 ) 296 #define TXNIC_QS_CQ_CFG_ENA ( 1ULL << 42 ) 297 #define TXNIC_QS_CQ_CFG_RESET ( 1ULL << 41 ) 298 #define TXNIC_QS_CQ_CFG_QSIZE(sz) ( ( ( uint64_t ) (sz) ) << 32 ) 299 #define TXNIC_QS_CQ_CFG_QSIZE_256 \ 300 TXNIC_QS_CQ_CFG_QSIZE ( 7 ) 306 #define TXNIC_CQ_DISABLE_MAX_WAIT_MS 100 309 #define TXNIC_QS_CQ_BASE(q) ( ( (q) << 18 ) | 0x010420 ) 312 #define TXNIC_QS_CQ_HEAD(q) ( ( (q) << 18 ) | 0x010428 ) 315 #define TXNIC_QS_CQ_TAIL(q) ( ( (q) << 18 ) | 0x010430 ) 318 #define TXNIC_QS_CQ_DOOR(q) ( ( (q) << 18 ) | 0x010438 ) 321 #define TXNIC_QS_CQ_STATUS(q) ( ( (q) << 18 ) | 0x010440 ) 322 #define TXNIC_QS_CQ_STATUS_QCOUNT(status) \ 323 ( ( (status) >> 0 ) & 0xffff ) 326 #define TXNIC_QS_CQ_STATUS2(q) ( ( (q) << 18 ) | 0x010448 ) 341 #define TXNIC_CQE_TYPE_SEND 0x80 362 #define TXNIC_CQE_TYPE_RX 0x20 365 #define TXNIC_CQE_RX_APAD_LEN( apad ) ( (apad) >> 5 ) 391 #define TXNIC_CQES 256 394 #define TXNIC_CQ_ALIGN 512 397 #define TXNIC_CQ_STRIDE sizeof ( union txnic_cqe ) 400 #define TXNIC_CQ_SIZE ( TXNIC_CQES * TXNIC_CQ_STRIDE ) 442 #define TXNIC_PF_CFG 0x000000 443 #define TXNIC_PF_CFG_ENA ( 1ULL << 0 ) 446 #define TXNIC_PF_BP_CFG 0x000080 447 #define TXNIC_PF_BP_CFG_BP_POLL_ENA ( 1ULL << 6 ) 448 #define TXNIC_PF_BP_CFG_BP_POLL_DLY(dl) ( ( ( uint64_t ) (dl) ) << 0 ) 449 #define TXNIC_PF_BP_CFG_BP_POLL_DLY_DEFAULT \ 450 TXNIC_PF_BP_CFG_BP_POLL_DLY ( 3 ) 453 #define TXNIC_PF_INTF_SEND_CFG(in) ( ( (in) << 8 ) | 0x000200 ) 454 #define TXNIC_PF_INTF_SEND_CFG_BLOCK_BGX ( 1ULL << 3 ) 455 #define TXNIC_PF_INTF_SEND_CFG_BLOCK(bl) ( ( ( uint64_t ) (bl) ) << 0 ) 458 #define TXNIC_PF_INTF_BP_CFG(in) ( ( (in) << 8 ) | 0x000208 ) 459 #define TXNIC_PF_INTF_BP_CFG_BP_ENA ( 1ULL << 63 ) 460 #define TXNIC_PF_INTF_BP_CFG_BP_ID_BGX ( 1ULL << 3 ) 461 #define TXNIC_PF_INTF_BP_CFG_BP_ID(bp) ( ( ( uint64_t ) (bp) ) << 0 ) 464 #define TXNIC_PF_PKIND_CFG(pk) ( ( (pk) << 3 ) | 0x000600 ) 465 #define TXNIC_PF_PKIND_CFG_LENERR_EN ( 1ULL << 33 ) 466 #define TXNIC_PF_PKIND_CFG_MAXLEN(ct) ( ( ( uint64_t ) (ct) ) << 16 ) 467 #define TXNIC_PF_PKIND_CFG_MAXLEN_DISABLE \ 468 TXNIC_PF_PKIND_CFG_MAXLEN ( 0xffff ) 469 #define TXNIC_PF_PKIND_CFG_MINLEN(ct) ( ( ( uint64_t ) (ct) ) << 0 ) 470 #define TXNIC_PF_PKIND_CFG_MINLEN_DISABLE \ 471 TXNIC_PF_PKIND_CFG_MINLEN ( 0x0000 ) 474 #define TXNIC_PF_MPI_CFG(ix) ( ( (ix) << 3 ) | 0x210000 ) 475 #define TXNIC_PF_MPI_CFG_VNIC(vn) ( ( ( uint64_t ) (vn) ) << 24 ) 476 #define TXNIC_PF_MPI_CFG_RSSI_BASE(ix) ( ( ( uint64_t ) (ix) ) << 0 ) 479 #define TXNIC_PF_RSSI_RQ(ix) ( ( (ix) << 3 ) | 0x220000 ) 480 #define TXNIC_PF_RSSI_RQ_RQ_QS(qs) ( ( ( uint64_t ) (qs) ) << 3 ) 483 #define TXNIC_PF_LMAC(lm) ( ( (lm) << 3 ) | 0x240000 ) 486 #define TXNIC_PF_LMAC_CFG 0x000000 487 #define TXNIC_PF_LMAC_CFG_ADJUST(ad) ( ( ( uint64_t ) (ad) ) << 8 ) 488 #define TXNIC_PF_LMAC_CFG_ADJUST_DEFAULT \ 489 TXNIC_PF_LMAC_CFG_ADJUST ( 6 ) 490 #define TXNIC_PF_LMAC_CFG_MIN_PKT_SIZE(sz) ( ( ( uint64_t ) (sz) ) << 0 ) 493 #define TXNIC_PF_LMAC_CFG2 0x000100 494 #define TXNIC_PF_LMAC_CFG2_MAX_PKT_SIZE(sz) ( ( ( uint64_t ) (sz) ) << 0 ) 497 #define TXNIC_PF_LMAC_CREDIT 0x004000 498 #define TXNIC_PF_LMAC_CREDIT_CC_UNIT_CNT(ct) ( ( ( uint64_t ) (ct) ) << 12 ) 499 #define TXNIC_PF_LMAC_CREDIT_CC_UNIT_CNT_DEFAULT \ 500 TXNIC_PF_LMAC_CREDIT_CC_UNIT_CNT ( 192 ) 501 #define TXNIC_PF_LMAC_CREDIT_CC_PACKET_CNT(ct) ( ( ( uint64_t ) (ct) ) << 2 ) 502 #define TXNIC_PF_LMAC_CREDIT_CC_PACKET_CNT_DEFAULT \ 503 TXNIC_PF_LMAC_CREDIT_CC_PACKET_CNT ( 511 ) 504 #define TXNIC_PF_LMAC_CREDIT_CC_ENABLE ( 1ULL << 1 ) 507 #define TXNIC_PF_CHAN(ch) ( ( (ch) << 3 ) | 0x400000 ) 510 #define TXNIC_PF_CHAN_TX_CFG 0x000000 511 #define TXNIC_PF_CHAN_TX_CFG_BP_ENA ( 1ULL << 0 ) 514 #define TXNIC_PF_CHAN_RX_CFG 0x020000 515 #define TXNIC_PF_CHAN_RX_CFG_CPI_BASE(ix) ( ( ( uint64_t ) (ix) ) << 48 ) 518 #define TXNIC_PF_CHAN_RX_BP_CFG 0x080000 519 #define TXNIC_PF_CHAN_RX_BP_CFG_ENA ( 1ULL << 63 ) 520 #define TXNIC_PF_CHAN_RX_BP_CFG_BPID(bp) ( ( ( uint64_t ) (bp) ) << 0 ) 523 #define TXNIC_PF_TL2_CFG(tl) ( ( (tl) << 3 ) | 0x500000 ) 524 #define TXNIC_PF_TL2_CFG_RR_QUANTUM(rr) ( ( ( uint64_t ) (rr) ) << 0 ) 525 #define TXNIC_PF_TL2_CFG_RR_QUANTUM_DEFAULT \ 526 TXNIC_PF_TL2_CFG_RR_QUANTUM ( 0x905 ) 529 #define TXNIC_PF_TL3_CFG(tl) ( ( (tl) << 3 ) | 0x600000 ) 530 #define TXNIC_PF_TL3_CFG_RR_QUANTUM(rr) ( ( ( uint64_t ) (rr) ) << 0 ) 531 #define TXNIC_PF_TL3_CFG_RR_QUANTUM_DEFAULT \ 532 TXNIC_PF_TL3_CFG_RR_QUANTUM ( 0x905 ) 535 #define TXNIC_PF_TL3_CHAN(tl) ( ( (tl) << 3 ) | 0x620000 ) 536 #define TXNIC_PF_TL3_CHAN_CHAN(ch) ( ( (ch) & 0x7f ) << 0 ) 539 #define TXNIC_PF_TL4_CFG(tl) ( ( (tl) << 3 ) | 0x800000 ) 540 #define TXNIC_PF_TL4_CFG_SQ_QS(qs) ( ( ( uint64_t ) (qs) ) << 27 ) 541 #define TXNIC_PF_TL4_CFG_RR_QUANTUM(rr) ( ( ( uint64_t ) (rr) ) << 0 ) 542 #define TXNIC_PF_TL4_CFG_RR_QUANTUM_DEFAULT \ 543 TXNIC_PF_TL4_CFG_RR_QUANTUM ( 0x905 ) 546 #define TXNIC_PF_QS(qs) ( ( (qs) << 21 ) | 0x20000000UL ) 549 #define TXNIC_PF_QS_CFG 0x010000 550 #define TXNIC_PF_QS_CFG_ENA ( 1ULL << 31 ) 551 #define TXNIC_PF_QS_CFG_VNIC(vn) ( ( ( uint64_t ) (vn) ) << 0 ) 554 #define TXNIC_PF_QS_RQ_CFG(q) ( ( (q) << 18 ) | 0x010400 ) 555 #define TXNIC_PF_QS_RQ_CFG_CACHING(cx) ( ( ( uint64_t ) (cx) ) << 26 ) 556 #define TXNIC_PF_QS_RQ_CFG_CACHING_ALL \ 557 TXNIC_PF_QS_RQ_CFG_CACHING ( 1 ) 558 #define TXNIC_PF_QS_RQ_CFG_CQ_QS(qs) ( ( ( uint64_t ) (qs) ) << 19 ) 559 #define TXNIC_PF_QS_RQ_CFG_RBDR_CONT_QS(qs) ( ( ( uint64_t ) (qs) ) << 9 ) 560 #define TXNIC_PF_QS_RQ_CFG_RBDR_STRT_QS(qs) ( ( ( uint64_t ) (qs) ) << 1 ) 563 #define TXNIC_PF_QS_RQ_DROP_CFG(q) ( ( (q) << 18 ) | 0x010420 ) 566 #define TXNIC_PF_QS_RQ_BP_CFG(q) ( ( (q) << 18 ) | 0x010500 ) 567 #define TXNIC_PF_QS_RQ_BP_CFG_RBDR_BP_ENA ( 1ULL << 63 ) 568 #define TXNIC_PF_QS_RQ_BP_CFG_CQ_BP_ENA ( 1ULL << 62 ) 569 #define TXNIC_PF_QS_RQ_BP_CFG_BPID(bp) ( ( ( uint64_t ) (bp) ) << 0 ) 572 #define TXNIC_PF_QS_SQ_CFG(q) ( ( (q) << 18 ) | 0x010c00 ) 573 #define TXNIC_PF_QS_SQ_CFG_CQ_QS(qs) ( ( ( uint64_t ) (qs) ) << 3 ) 576 #define TXNIC_PF_QS_SQ_CFG2(q) ( ( (q) << 18 ) | 0x010c08 ) 577 #define TXNIC_PF_QS_SQ_CFG2_TL4(tl) ( ( ( uint64_t ) (tl) ) << 0 ) 606 #define TXNIC_VNIC_IDX( bgx_idx, lmac_idx ) \ 607 ( ( (bgx_idx) * TXNIC_NUM_LMAC ) + (lmac_idx) ) 615 #define TXNIC_BGX_IDX( vnic_idx ) ( (vnic_idx) / TXNIC_NUM_LMAC ) 623 #define TXNIC_LMAC_IDX( vnic_idx ) ( (vnic_idx) % TXNIC_NUM_LMAC ) 631 #define TXNIC_TL2_IDX( vnic_idx ) ( (vnic_idx) << 3 ) 639 #define TXNIC_TL3_IDX( vnic_idx ) ( (vnic_idx) << 5 ) 647 #define TXNIC_TL4_IDX( vnic_idx ) ( (vnic_idx) << 7 ) 655 #define TXNIC_CHAN_IDX( vnic_idx ) ( ( TXNIC_BGX_IDX (vnic_idx) << 7 ) | \ 656 ( TXNIC_LMAC_IDX (vnic_idx) << 4 ) ) 666 #define BGX_LMAC(lm) ( ( (lm) << 20 ) | 0x00000000UL ) 669 #define BGX_CMR_CONFIG 0x000000 670 #define BGX_CMR_CONFIG_ENABLE ( 1ULL << 15 ) 671 #define BGX_CMR_CONFIG_DATA_PKT_RX_EN ( 1ULL << 14 ) 672 #define BGX_CMR_CONFIG_DATA_PKT_TX_EN ( 1ULL << 13 ) 673 #define BGX_CMR_CONFIG_LMAC_TYPE_GET(config) \ 674 ( ( (config) >> 8 ) & 0x7 ) 675 #define BGX_CMR_CONFIG_LMAC_TYPE_SET(ty) ( ( ( uint64_t ) (ty) ) << 8 ) 676 #define BGX_CMR_CONFIG_LANE_TO_SDS(ls) ( ( ( uint64_t ) (ls) ) << 0 ) 679 #define BGX_CMR_GLOBAL_CONFIG 0x000008 680 #define BGX_CMR_GLOBAL_CONFIG_FCS_STRIP ( 1ULL << 6 ) 683 #define BGX_CMR_RX_STAT0 0x000070 686 #define BGX_CMR_RX_STAT1 0x000078 689 #define BGX_CMR_RX_STAT2 0x000080 692 #define BGX_CMR_RX_STAT3 0x000088 695 #define BGX_CMR_RX_STAT4 0x000090 698 #define BGX_CMR_RX_STAT5 0x000098 701 #define BGX_CMR_RX_STAT6 0x0000a0 704 #define BGX_CMR_RX_STAT7 0x0000a8 707 #define BGX_CMR_RX_STAT8 0x0000b0 710 #define BGX_CMR_RX_STAT9 0x0000b8 713 #define BGX_CMR_RX_STAT10 0x0000c0 716 #define BGX_CMR_RX_DMAC_CTL 0x0000e8 717 #define BGX_CMR_RX_DMAC_CTL_MCST_MODE(md) ( ( ( uint64_t ) (md) ) << 1 ) 718 #define BGX_CMR_RX_DMAC_CTL_MCST_MODE_ACCEPT \ 719 BGX_CMR_RX_DMAC_CTL_MCST_MODE ( 1 ) 720 #define BGX_CMR_RX_DMAC_CTL_BCST_ACCEPT ( 1ULL << 0 ) 723 #define BGX_CMR_RX_DMAC_CAM(i) ( ( (i) << 3 ) | 0x000200 ) 726 #define BGX_CMR_RX_STEERING(i) ( ( (i) << 3 ) | 0x000300 ) 729 #define BGX_CMR_CHAN_MSK_AND 0x000450 730 #define BGX_CMR_CHAN_MSK_AND_ALL(count) \ 731 ( 0xffffffffffffffffULL >> ( 16 * ( 4 - (count) ) ) ) 734 #define BGX_CMR_TX_STAT0 0x000600 737 #define BGX_CMR_TX_STAT1 0x000608 740 #define BGX_CMR_TX_STAT2 0x000610 743 #define BGX_CMR_TX_STAT3 0x000618 746 #define BGX_CMR_TX_STAT4 0x000620 749 #define BGX_CMR_TX_STAT5 0x000628 752 #define BGX_CMR_TX_STAT6 0x000630 755 #define BGX_CMR_TX_STAT7 0x000638 758 #define BGX_CMR_TX_STAT8 0x000640 761 #define BGX_CMR_TX_STAT9 0x000648 764 #define BGX_CMR_TX_STAT10 0x000650 767 #define BGX_CMR_TX_STAT11 0x000658 770 #define BGX_CMR_TX_STAT12 0x000660 773 #define BGX_CMR_TX_STAT13 0x000668 776 #define BGX_CMR_TX_STAT14 0x000670 779 #define BGX_CMR_TX_STAT15 0x000678 782 #define BGX_CMR_TX_STAT16 0x000680 785 #define BGX_CMR_TX_STAT17 0x000688 788 #define BGX_CMR_RX_LMACS 0x000468 789 #define BGX_CMR_RX_LMACS_LMACS_GET(lmacs) \ 790 ( ( (lmacs) >> 0 ) & 0x7 ) 791 #define BGX_CMR_RX_LMACS_LMACS_SET(ct) ( ( ( uint64_t ) (ct) ) << 0 ) 794 #define BGX_CMR_TX_LMACS 0x001000 795 #define BGX_CMR_TX_LMACS_LMACS_GET(lmacs) \ 796 ( ( (lmacs) >> 0 ) & 0x7 ) 797 #define BGX_CMR_TX_LMACS_LMACS_SET(ct) ( ( ( uint64_t ) (ct) ) << 0 ) 800 #define BGX_SPU_CONTROL1 0x010000 801 #define BGX_SPU_CONTROL1_RESET ( 1ULL << 15 ) 802 #define BGX_SPU_CONTROL1_LO_PWR ( 1ULL << 11 ) 805 #define BGX_SPU_RESET_DELAY_MS 10 808 #define BGX_SPU_STATUS1 0x010008 809 #define BGX_SPU_STATUS1_FLT ( 1ULL << 7 ) 810 #define BGX_SPU_STATUS1_RCV_LNK ( 1ULL << 2 ) 813 #define BGX_SPU_STATUS2 0x010020 814 #define BGX_SPU_STATUS2_RCVFLT ( 1ULL << 10 ) 817 #define BGX_SPU_BR_STATUS1 0x010030 818 #define BGX_SPU_BR_STATUS1_RCV_LNK ( 1ULL << 12 ) 819 #define BGX_SPU_BR_STATUS1_HI_BER ( 1ULL << 1 ) 820 #define BGX_SPU_BR_STATUS1_BLK_LOCK ( 1ULL << 0 ) 823 #define BGX_SPU_BR_STATUS2 0x010038 824 #define BGX_SPU_BR_STATUS2_LATCHED_LOCK ( 1ULL << 15 ) 825 #define BGX_SPU_BR_STATUS2_LATCHED_BER ( 1ULL << 14 ) 828 #define BGX_SPU_BR_ALGN_STATUS 0x010050 829 #define BGX_SPU_BR_ALGN_STATUS_ALIGND ( 1ULL << 12 ) 832 #define BGX_SPU_BR_PMD_CONTROL 0x010068 833 #define BGX_SPU_BR_PMD_CONTROL_TRAIN_EN ( 1ULL << 1 ) 836 #define BGX_SPU_BR_PMD_STATUS 0x010070 839 #define BGX_SPU_BR_PMD_LP_CUP 0x010078 842 #define BGX_SPU_BR_PMD_LD_CUP 0x010088 845 #define BGX_SPU_BR_PMD_LD_REP 0x010090 848 #define BGX_SPU_FEC_CONTROL 0x0100a0 851 #define BGX_SPU_AN_CONTROL 0x0100c8 854 #define BGX_SPU_AN_STATUS 0x0100d0 855 #define BGX_SPU_AN_STATUS_XNP_STAT ( 1ULL << 7 ) 856 #define BGX_SPU_AN_STATUS_PAGE_RX ( 1ULL << 6 ) 857 #define BGX_SPU_AN_STATUS_AN_COMPLETE ( 1ULL << 5 ) 858 #define BGX_SPU_AN_STATUS_LINK_STATUS ( 1ULL << 2 ) 859 #define BGX_SPU_AN_STATUS_LP_AN_ABLE ( 1ULL << 0 ) 862 #define BGX_SPU_INT 0x010220 863 #define BGX_SPU_INT_TRAINING_FAIL ( 1ULL << 14 ) 864 #define BGX_SPU_INT_TRAINING_DONE ( 1ULL << 13 ) 865 #define BGX_SPU_INT_AN_COMPLETE ( 1ULL << 12 ) 866 #define BGX_SPU_INT_AN_LINK_GOOD ( 1ULL << 11 ) 867 #define BGX_SPU_INT_AN_PAGE_RX ( 1ULL << 10 ) 868 #define BGX_SPU_INT_FEC_UNCORR ( 1ULL << 9 ) 869 #define BGX_SPU_INT_FEC_CORR ( 1ULL << 8 ) 870 #define BGX_SPU_INT_BIP_ERR ( 1ULL << 7 ) 871 #define BGX_SPU_INT_DBG_SYNC ( 1ULL << 6 ) 872 #define BGX_SPU_INT_ALGNLOS ( 1ULL << 5 ) 873 #define BGX_SPU_INT_SYNLOS ( 1ULL << 4 ) 874 #define BGX_SPU_INT_BITLCKLS ( 1ULL << 3 ) 875 #define BGX_SPU_INT_ERR_BLK ( 1ULL << 2 ) 876 #define BGX_SPU_INT_RX_LINK_DOWN ( 1ULL << 1 ) 877 #define BGX_SPU_INT_RX_LINK_UP ( 1ULL << 0 ) FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
unsigned int idx
BGX index.
A receive completion queue entry.
struct txnic * vnic
Virtual NIC (if applicable)
struct txnic_sqe * sqe
Send queue entries.
uint16_t sqe_ptr
Send queue entry pointer.
unsigned int count
Number of LMACs.
uint8_t unused_b[1]
Unused.
uint8_t unused_c[4]
Unused.
const char * name
Device name (for debugging)
A receive buffer descriptor ring entry.
uint8_t unused_a[6]
Unused.
#define TXNIC_NUM_BGX
Maximum number of BGX Ethernet interfaces (per node)
uint8_t unused_a[7]
Unused.
struct txnic_rqe * rqe
Receive queue entries.
unsigned long long uint64_t
uint8_t errop
Error opcode.
unsigned long vf_stride
Virtual function BAR stride.
struct txnic_rbdr_entry rbdre
Receive buffer descriptor ring entry.
union txnic_cqe * cqe
Completion queue entries.
struct txnic_sq sq
Send queue.
uint8_t send_status
Status.
unsigned int cons
Consumer counter.
unsigned int prod
Producer counter.
uint32_t lane_to_sds
Lane-to-SDS mapping.
A doubly-linked list entry (or list head)
Completion queue entry common fields.
struct txnic_pf * pf
Physical function (if known)
unsigned int cons
Consumer counter.
unsigned int node
Node ID.
struct pci_device * pci
PCI device.
unsigned int cons
Consumer counter.
struct txnic_rq rq
Receive queue.
A send completion queue entry.
struct list_head list
List of physical functions.
struct txnic_bgx * bgx[TXNIC_NUM_BGX]
BGX Ethernet interfaces (if known)
uint32_t addr
Buffer address.
#define TXNIC_RQ_FILL
Receive queue maximum fill level.
A BGX Ethernet interface.
struct txnic_lmac_type * type
LMAC type.
struct io_buffer * iobuf[TXNIC_RQ_FILL]
I/O buffers.
txnic_lmac_types
LMAC types.
struct txnic_send_header hdr
Send header descriptor.
static unsigned int txnic_address_node(uint64_t addr)
Calculate node ID.
struct txnic_cqe_common common
Common fields.
A send gather subdescriptor.
uint8_t count
Number of LMACs.
Network device management.
struct txnic_lmac lmac[TXNIC_NUM_LMAC]
Logical MACs.
unsigned int node
Node ID.
struct txnic_send_gather gather
Send gather descriptor.
unsigned long vf_membase
Virtual function BAR base.
struct pci_device * pci
PCI device.
struct txnic_cqe_send send
Send completion.
unsigned int idx
Virtual NIC index.
#define TXNIC_NUM_LMAC
Maximum number of Logical MACs (per BGX)
struct net_device * netdev
Network device.
int training
Link training is in use.
struct list_head list
List of BGX Ethernet interfaces.
struct txnic_cq cq
Completion queue.
A completion queue entry.
unsigned int prod
Producer counter.
union txnic_lmac_address mac
MAC address.
struct txnic_bgx * bgx
Containing BGX Ethernet interface.
struct txnic_cqe_rx rx
Receive completion.
static unsigned int txnic_address_bgx(uint64_t addr)
Calculate BGX Ethernet interface index.