25 #define TXNIC_LINE_SIZE 128 28 #define TXNIC_VF_BAR_SIZE 0x200000UL 31 #define TXNIC_PF_BAR_SIZE 0x40000000UL 34 #define TXNIC_BGX_BAR_SIZE 0x400000UL 37 #define TXNIC_NUM_BGX 2 40 #define TXNIC_NUM_LMAC 4 43 #define TXNIC_NUM_DMAC 32 46 #define TXNIC_NUM_STEERING 8 57 return ( (
addr >> 44 ) & 0x3 );
69 return ( (
addr >> 24 ) & 0x1 );
80 #define TXNIC_QS_SQ_CFG(q) ( ( (q) << 18 ) | 0x010800 ) 81 #define TXNIC_QS_SQ_CFG_ENA ( 1ULL << 19 ) 82 #define TXNIC_QS_SQ_CFG_RESET ( 1ULL << 17 ) 83 #define TXNIC_QS_SQ_CFG_QSIZE(sz) ( ( ( uint64_t ) (sz) ) << 8 ) 84 #define TXNIC_QS_SQ_CFG_QSIZE_1K \ 85 TXNIC_QS_SQ_CFG_QSIZE ( 0 ) 88 #define TXNIC_QS_SQ_BASE(q) ( ( (q) << 18 ) | 0x010820 ) 91 #define TXNIC_QS_SQ_HEAD(q) ( ( (q) << 18 ) | 0x010828 ) 94 #define TXNIC_QS_SQ_TAIL(q) ( ( (q) << 18 ) | 0x010830 ) 97 #define TXNIC_QS_SQ_DOOR(q) ( ( (q) << 18 ) | 0x010838 ) 100 #define TXNIC_QS_SQ_STATUS(q) ( ( (q) << 18 ) | 0x010840 ) 101 #define TXNIC_QS_SQ_STATUS_STOPPED ( 1ULL << 21 ) 107 #define TXNIC_SQ_STOP_MAX_WAIT_MS 100 127 #define TXNIC_SEND_HDR_FLAGS 0x14 145 #define TXNIC_SEND_GATHER_FLAGS 0x40 160 #define TXNIC_SQE_SUBDESCS ( sizeof ( struct txnic_sqe ) / \ 161 sizeof ( struct txnic_send_header ) ) 167 #define TXNIC_SQES ( 1024 / TXNIC_SQE_SUBDESCS ) 173 #define TXNIC_SQ_FILL 32 176 #define TXNIC_SQ_ALIGN TXNIC_LINE_SIZE 179 #define TXNIC_SQ_STRIDE sizeof ( struct txnic_sqe ) 182 #define TXNIC_SQ_SIZE ( TXNIC_SQES * TXNIC_SQ_STRIDE ) 202 #define TXNIC_QS_RQ_CFG(q) ( ( (q) << 18 ) | 0x010600 ) 203 #define TXNIC_QS_RQ_CFG_ENA ( 1ULL << 1 ) 209 #define TXNIC_RQ_DISABLE_MAX_WAIT_MS 100 212 #define TXNIC_QS_RBDR_CFG(q) ( ( (q) << 18 ) | 0x010c00 ) 213 #define TXNIC_QS_RBDR_CFG_ENA ( 1ULL << 44 ) 214 #define TXNIC_QS_RBDR_CFG_RESET ( 1ULL << 43 ) 215 #define TXNIC_QS_RBDR_CFG_QSIZE(sz) ( ( ( uint64_t ) (sz) ) << 32 ) 216 #define TXNIC_QS_RBDR_CFG_QSIZE_8K \ 217 TXNIC_QS_RBDR_CFG_QSIZE ( 0 ) 218 #define TXNIC_QS_RBDR_CFG_LINES(sz) ( ( ( uint64_t ) (sz) ) << 0 ) 221 #define TXNIC_QS_RBDR_BASE(q) ( ( (q) << 18 ) | 0x010c20 ) 224 #define TXNIC_QS_RBDR_HEAD(q) ( ( (q) << 18 ) | 0x010c28 ) 227 #define TXNIC_QS_RBDR_TAIL(q) ( ( (q) << 18 ) | 0x010c30 ) 230 #define TXNIC_QS_RBDR_DOOR(q) ( ( (q) << 18 ) | 0x010c38 ) 233 #define TXNIC_QS_RBDR_STATUS0(q) ( ( (q) << 18 ) | 0x010c40 ) 251 #define TXNIC_RQES 8192 257 #define TXNIC_RQ_FILL 32 263 #define TXNIC_RQE_SIZE ( ( ETH_DATA_ALIGN + ETH_FRAME_LEN + \ 264 4 + TXNIC_LINE_SIZE - 1 ) \ 265 & ~( TXNIC_LINE_SIZE - 1 ) ) 268 #define TXNIC_RQ_ALIGN TXNIC_LINE_SIZE 271 #define TXNIC_RQ_STRIDE sizeof ( struct txnic_rqe ) 274 #define TXNIC_RQ_SIZE ( TXNIC_RQES * TXNIC_RQ_STRIDE ) 296 #define TXNIC_QS_CQ_CFG(q) ( ( (q) << 18 ) | 0x010400 ) 297 #define TXNIC_QS_CQ_CFG_ENA ( 1ULL << 42 ) 298 #define TXNIC_QS_CQ_CFG_RESET ( 1ULL << 41 ) 299 #define TXNIC_QS_CQ_CFG_QSIZE(sz) ( ( ( uint64_t ) (sz) ) << 32 ) 300 #define TXNIC_QS_CQ_CFG_QSIZE_256 \ 301 TXNIC_QS_CQ_CFG_QSIZE ( 7 ) 307 #define TXNIC_CQ_DISABLE_MAX_WAIT_MS 100 310 #define TXNIC_QS_CQ_BASE(q) ( ( (q) << 18 ) | 0x010420 ) 313 #define TXNIC_QS_CQ_HEAD(q) ( ( (q) << 18 ) | 0x010428 ) 316 #define TXNIC_QS_CQ_TAIL(q) ( ( (q) << 18 ) | 0x010430 ) 319 #define TXNIC_QS_CQ_DOOR(q) ( ( (q) << 18 ) | 0x010438 ) 322 #define TXNIC_QS_CQ_STATUS(q) ( ( (q) << 18 ) | 0x010440 ) 323 #define TXNIC_QS_CQ_STATUS_QCOUNT(status) \ 324 ( ( (status) >> 0 ) & 0xffff ) 327 #define TXNIC_QS_CQ_STATUS2(q) ( ( (q) << 18 ) | 0x010448 ) 342 #define TXNIC_CQE_TYPE_SEND 0x80 363 #define TXNIC_CQE_TYPE_RX 0x20 366 #define TXNIC_CQE_RX_APAD_LEN( apad ) ( (apad) >> 5 ) 390 #define TXNIC_CQES 256 393 #define TXNIC_CQ_ALIGN 512 396 #define TXNIC_CQ_STRIDE 512 399 #define TXNIC_CQ_SIZE ( TXNIC_CQES * TXNIC_CQ_STRIDE ) 441 #define TXNIC_PF_CFG 0x000000 442 #define TXNIC_PF_CFG_ENA ( 1ULL << 0 ) 445 #define TXNIC_PF_BP_CFG 0x000080 446 #define TXNIC_PF_BP_CFG_BP_POLL_ENA ( 1ULL << 6 ) 447 #define TXNIC_PF_BP_CFG_BP_POLL_DLY(dl) ( ( ( uint64_t ) (dl) ) << 0 ) 448 #define TXNIC_PF_BP_CFG_BP_POLL_DLY_DEFAULT \ 449 TXNIC_PF_BP_CFG_BP_POLL_DLY ( 3 ) 452 #define TXNIC_PF_INTF_SEND_CFG(in) ( ( (in) << 8 ) | 0x000200 ) 453 #define TXNIC_PF_INTF_SEND_CFG_BLOCK_BGX ( 1ULL << 3 ) 454 #define TXNIC_PF_INTF_SEND_CFG_BLOCK(bl) ( ( ( uint64_t ) (bl) ) << 0 ) 457 #define TXNIC_PF_INTF_BP_CFG(in) ( ( (in) << 8 ) | 0x000208 ) 458 #define TXNIC_PF_INTF_BP_CFG_BP_ENA ( 1ULL << 63 ) 459 #define TXNIC_PF_INTF_BP_CFG_BP_ID_BGX ( 1ULL << 3 ) 460 #define TXNIC_PF_INTF_BP_CFG_BP_ID(bp) ( ( ( uint64_t ) (bp) ) << 0 ) 463 #define TXNIC_PF_PKIND_CFG(pk) ( ( (pk) << 3 ) | 0x000600 ) 464 #define TXNIC_PF_PKIND_CFG_LENERR_EN ( 1ULL << 33 ) 465 #define TXNIC_PF_PKIND_CFG_MAXLEN(ct) ( ( ( uint64_t ) (ct) ) << 16 ) 466 #define TXNIC_PF_PKIND_CFG_MAXLEN_DISABLE \ 467 TXNIC_PF_PKIND_CFG_MAXLEN ( 0xffff ) 468 #define TXNIC_PF_PKIND_CFG_MINLEN(ct) ( ( ( uint64_t ) (ct) ) << 0 ) 469 #define TXNIC_PF_PKIND_CFG_MINLEN_DISABLE \ 470 TXNIC_PF_PKIND_CFG_MINLEN ( 0x0000 ) 473 #define TXNIC_PF_MPI_CFG(ix) ( ( (ix) << 3 ) | 0x210000 ) 474 #define TXNIC_PF_MPI_CFG_VNIC(vn) ( ( ( uint64_t ) (vn) ) << 24 ) 475 #define TXNIC_PF_MPI_CFG_RSSI_BASE(ix) ( ( ( uint64_t ) (ix) ) << 0 ) 478 #define TXNIC_PF_RSSI_RQ(ix) ( ( (ix) << 3 ) | 0x220000 ) 479 #define TXNIC_PF_RSSI_RQ_RQ_QS(qs) ( ( ( uint64_t ) (qs) ) << 3 ) 482 #define TXNIC_PF_LMAC(lm) ( ( (lm) << 3 ) | 0x240000 ) 485 #define TXNIC_PF_LMAC_CFG 0x000000 486 #define TXNIC_PF_LMAC_CFG_ADJUST(ad) ( ( ( uint64_t ) (ad) ) << 8 ) 487 #define TXNIC_PF_LMAC_CFG_ADJUST_DEFAULT \ 488 TXNIC_PF_LMAC_CFG_ADJUST ( 6 ) 489 #define TXNIC_PF_LMAC_CFG_MIN_PKT_SIZE(sz) ( ( ( uint64_t ) (sz) ) << 0 ) 492 #define TXNIC_PF_LMAC_CFG2 0x000100 493 #define TXNIC_PF_LMAC_CFG2_MAX_PKT_SIZE(sz) ( ( ( uint64_t ) (sz) ) << 0 ) 496 #define TXNIC_PF_LMAC_CREDIT 0x004000 497 #define TXNIC_PF_LMAC_CREDIT_CC_UNIT_CNT(ct) ( ( ( uint64_t ) (ct) ) << 12 ) 498 #define TXNIC_PF_LMAC_CREDIT_CC_UNIT_CNT_DEFAULT \ 499 TXNIC_PF_LMAC_CREDIT_CC_UNIT_CNT ( 192 ) 500 #define TXNIC_PF_LMAC_CREDIT_CC_PACKET_CNT(ct) ( ( ( uint64_t ) (ct) ) << 2 ) 501 #define TXNIC_PF_LMAC_CREDIT_CC_PACKET_CNT_DEFAULT \ 502 TXNIC_PF_LMAC_CREDIT_CC_PACKET_CNT ( 511 ) 503 #define TXNIC_PF_LMAC_CREDIT_CC_ENABLE ( 1ULL << 1 ) 506 #define TXNIC_PF_CHAN(ch) ( ( (ch) << 3 ) | 0x400000 ) 509 #define TXNIC_PF_CHAN_TX_CFG 0x000000 510 #define TXNIC_PF_CHAN_TX_CFG_BP_ENA ( 1ULL << 0 ) 513 #define TXNIC_PF_CHAN_RX_CFG 0x020000 514 #define TXNIC_PF_CHAN_RX_CFG_CPI_BASE(ix) ( ( ( uint64_t ) (ix) ) << 48 ) 517 #define TXNIC_PF_CHAN_RX_BP_CFG 0x080000 518 #define TXNIC_PF_CHAN_RX_BP_CFG_ENA ( 1ULL << 63 ) 519 #define TXNIC_PF_CHAN_RX_BP_CFG_BPID(bp) ( ( ( uint64_t ) (bp) ) << 0 ) 522 #define TXNIC_PF_TL2_CFG(tl) ( ( (tl) << 3 ) | 0x500000 ) 523 #define TXNIC_PF_TL2_CFG_RR_QUANTUM(rr) ( ( ( uint64_t ) (rr) ) << 0 ) 524 #define TXNIC_PF_TL2_CFG_RR_QUANTUM_DEFAULT \ 525 TXNIC_PF_TL2_CFG_RR_QUANTUM ( 0x905 ) 528 #define TXNIC_PF_TL3_CFG(tl) ( ( (tl) << 3 ) | 0x600000 ) 529 #define TXNIC_PF_TL3_CFG_RR_QUANTUM(rr) ( ( ( uint64_t ) (rr) ) << 0 ) 530 #define TXNIC_PF_TL3_CFG_RR_QUANTUM_DEFAULT \ 531 TXNIC_PF_TL3_CFG_RR_QUANTUM ( 0x905 ) 534 #define TXNIC_PF_TL3_CHAN(tl) ( ( (tl) << 3 ) | 0x620000 ) 535 #define TXNIC_PF_TL3_CHAN_CHAN(ch) ( ( (ch) & 0x7f ) << 0 ) 538 #define TXNIC_PF_TL4_CFG(tl) ( ( (tl) << 3 ) | 0x800000 ) 539 #define TXNIC_PF_TL4_CFG_SQ_QS(qs) ( ( ( uint64_t ) (qs) ) << 27 ) 540 #define TXNIC_PF_TL4_CFG_RR_QUANTUM(rr) ( ( ( uint64_t ) (rr) ) << 0 ) 541 #define TXNIC_PF_TL4_CFG_RR_QUANTUM_DEFAULT \ 542 TXNIC_PF_TL4_CFG_RR_QUANTUM ( 0x905 ) 545 #define TXNIC_PF_QS(qs) ( ( (qs) << 21 ) | 0x20000000UL ) 548 #define TXNIC_PF_QS_CFG 0x010000 549 #define TXNIC_PF_QS_CFG_ENA ( 1ULL << 31 ) 550 #define TXNIC_PF_QS_CFG_VNIC(vn) ( ( ( uint64_t ) (vn) ) << 0 ) 553 #define TXNIC_PF_QS_RQ_CFG(q) ( ( (q) << 18 ) | 0x010400 ) 554 #define TXNIC_PF_QS_RQ_CFG_CACHING(cx) ( ( ( uint64_t ) (cx) ) << 26 ) 555 #define TXNIC_PF_QS_RQ_CFG_CACHING_ALL \ 556 TXNIC_PF_QS_RQ_CFG_CACHING ( 1 ) 557 #define TXNIC_PF_QS_RQ_CFG_CQ_QS(qs) ( ( ( uint64_t ) (qs) ) << 19 ) 558 #define TXNIC_PF_QS_RQ_CFG_RBDR_CONT_QS(qs) ( ( ( uint64_t ) (qs) ) << 9 ) 559 #define TXNIC_PF_QS_RQ_CFG_RBDR_STRT_QS(qs) ( ( ( uint64_t ) (qs) ) << 1 ) 562 #define TXNIC_PF_QS_RQ_DROP_CFG(q) ( ( (q) << 18 ) | 0x010420 ) 565 #define TXNIC_PF_QS_RQ_BP_CFG(q) ( ( (q) << 18 ) | 0x010500 ) 566 #define TXNIC_PF_QS_RQ_BP_CFG_RBDR_BP_ENA ( 1ULL << 63 ) 567 #define TXNIC_PF_QS_RQ_BP_CFG_CQ_BP_ENA ( 1ULL << 62 ) 568 #define TXNIC_PF_QS_RQ_BP_CFG_BPID(bp) ( ( ( uint64_t ) (bp) ) << 0 ) 571 #define TXNIC_PF_QS_SQ_CFG(q) ( ( (q) << 18 ) | 0x010c00 ) 572 #define TXNIC_PF_QS_SQ_CFG_CQ_QS(qs) ( ( ( uint64_t ) (qs) ) << 3 ) 575 #define TXNIC_PF_QS_SQ_CFG2(q) ( ( (q) << 18 ) | 0x010c08 ) 576 #define TXNIC_PF_QS_SQ_CFG2_TL4(tl) ( ( ( uint64_t ) (tl) ) << 0 ) 605 #define TXNIC_VNIC_IDX( bgx_idx, lmac_idx ) \ 606 ( ( (bgx_idx) * TXNIC_NUM_LMAC ) + (lmac_idx) ) 614 #define TXNIC_BGX_IDX( vnic_idx ) ( (vnic_idx) / TXNIC_NUM_LMAC ) 622 #define TXNIC_LMAC_IDX( vnic_idx ) ( (vnic_idx) % TXNIC_NUM_LMAC ) 630 #define TXNIC_TL2_IDX( vnic_idx ) ( (vnic_idx) << 3 ) 638 #define TXNIC_TL3_IDX( vnic_idx ) ( (vnic_idx) << 5 ) 646 #define TXNIC_TL4_IDX( vnic_idx ) ( (vnic_idx) << 7 ) 654 #define TXNIC_CHAN_IDX( vnic_idx ) ( ( TXNIC_BGX_IDX (vnic_idx) << 7 ) | \ 655 ( TXNIC_LMAC_IDX (vnic_idx) << 4 ) ) 665 #define BGX_LMAC(lm) ( ( (lm) << 20 ) | 0x00000000UL ) 668 #define BGX_CMR_CONFIG 0x000000 669 #define BGX_CMR_CONFIG_ENABLE ( 1ULL << 15 ) 670 #define BGX_CMR_CONFIG_DATA_PKT_RX_EN ( 1ULL << 14 ) 671 #define BGX_CMR_CONFIG_DATA_PKT_TX_EN ( 1ULL << 13 ) 672 #define BGX_CMR_CONFIG_LMAC_TYPE_GET(config) \ 673 ( ( (config) >> 8 ) & 0x7 ) 674 #define BGX_CMR_CONFIG_LMAC_TYPE_SET(ty) ( ( ( uint64_t ) (ty) ) << 8 ) 675 #define BGX_CMR_CONFIG_LANE_TO_SDS(ls) ( ( ( uint64_t ) (ls) ) << 0 ) 678 #define BGX_CMR_GLOBAL_CONFIG 0x000008 679 #define BGX_CMR_GLOBAL_CONFIG_FCS_STRIP ( 1ULL << 6 ) 682 #define BGX_CMR_RX_STAT0 0x000070 685 #define BGX_CMR_RX_STAT1 0x000078 688 #define BGX_CMR_RX_STAT2 0x000080 691 #define BGX_CMR_RX_STAT3 0x000088 694 #define BGX_CMR_RX_STAT4 0x000090 697 #define BGX_CMR_RX_STAT5 0x000098 700 #define BGX_CMR_RX_STAT6 0x0000a0 703 #define BGX_CMR_RX_STAT7 0x0000a8 706 #define BGX_CMR_RX_STAT8 0x0000b0 709 #define BGX_CMR_RX_STAT9 0x0000b8 712 #define BGX_CMR_RX_STAT10 0x0000c0 715 #define BGX_CMR_RX_DMAC_CTL 0x0000e8 716 #define BGX_CMR_RX_DMAC_CTL_MCST_MODE(md) ( ( ( uint64_t ) (md) ) << 1 ) 717 #define BGX_CMR_RX_DMAC_CTL_MCST_MODE_ACCEPT \ 718 BGX_CMR_RX_DMAC_CTL_MCST_MODE ( 1 ) 719 #define BGX_CMR_RX_DMAC_CTL_BCST_ACCEPT ( 1ULL << 0 ) 722 #define BGX_CMR_RX_DMAC_CAM(i) ( ( (i) << 3 ) | 0x000200 ) 725 #define BGX_CMR_RX_STEERING(i) ( ( (i) << 3 ) | 0x000300 ) 728 #define BGX_CMR_CHAN_MSK_AND 0x000450 729 #define BGX_CMR_CHAN_MSK_AND_ALL(count) \ 730 ( 0xffffffffffffffffULL >> ( 16 * ( 4 - (count) ) ) ) 733 #define BGX_CMR_TX_STAT0 0x000600 736 #define BGX_CMR_TX_STAT1 0x000608 739 #define BGX_CMR_TX_STAT2 0x000610 742 #define BGX_CMR_TX_STAT3 0x000618 745 #define BGX_CMR_TX_STAT4 0x000620 748 #define BGX_CMR_TX_STAT5 0x000628 751 #define BGX_CMR_TX_STAT6 0x000630 754 #define BGX_CMR_TX_STAT7 0x000638 757 #define BGX_CMR_TX_STAT8 0x000640 760 #define BGX_CMR_TX_STAT9 0x000648 763 #define BGX_CMR_TX_STAT10 0x000650 766 #define BGX_CMR_TX_STAT11 0x000658 769 #define BGX_CMR_TX_STAT12 0x000660 772 #define BGX_CMR_TX_STAT13 0x000668 775 #define BGX_CMR_TX_STAT14 0x000670 778 #define BGX_CMR_TX_STAT15 0x000678 781 #define BGX_CMR_TX_STAT16 0x000680 784 #define BGX_CMR_TX_STAT17 0x000688 787 #define BGX_CMR_RX_LMACS 0x000468 788 #define BGX_CMR_RX_LMACS_LMACS_GET(lmacs) \ 789 ( ( (lmacs) >> 0 ) & 0x7 ) 790 #define BGX_CMR_RX_LMACS_LMACS_SET(ct) ( ( ( uint64_t ) (ct) ) << 0 ) 793 #define BGX_CMR_TX_LMACS 0x001000 794 #define BGX_CMR_TX_LMACS_LMACS_GET(lmacs) \ 795 ( ( (lmacs) >> 0 ) & 0x7 ) 796 #define BGX_CMR_TX_LMACS_LMACS_SET(ct) ( ( ( uint64_t ) (ct) ) << 0 ) 799 #define BGX_SPU_CONTROL1 0x010000 800 #define BGX_SPU_CONTROL1_RESET ( 1ULL << 15 ) 801 #define BGX_SPU_CONTROL1_LO_PWR ( 1ULL << 11 ) 804 #define BGX_SPU_RESET_DELAY_MS 10 807 #define BGX_SPU_STATUS1 0x010008 808 #define BGX_SPU_STATUS1_FLT ( 1ULL << 7 ) 809 #define BGX_SPU_STATUS1_RCV_LNK ( 1ULL << 2 ) 812 #define BGX_SPU_STATUS2 0x010020 813 #define BGX_SPU_STATUS2_RCVFLT ( 1ULL << 10 ) 816 #define BGX_SPU_BR_STATUS1 0x010030 817 #define BGX_SPU_BR_STATUS1_RCV_LNK ( 1ULL << 12 ) 818 #define BGX_SPU_BR_STATUS1_HI_BER ( 1ULL << 1 ) 819 #define BGX_SPU_BR_STATUS1_BLK_LOCK ( 1ULL << 0 ) 822 #define BGX_SPU_BR_STATUS2 0x010038 823 #define BGX_SPU_BR_STATUS2_LATCHED_LOCK ( 1ULL << 15 ) 824 #define BGX_SPU_BR_STATUS2_LATCHED_BER ( 1ULL << 14 ) 827 #define BGX_SPU_BR_ALGN_STATUS 0x010050 828 #define BGX_SPU_BR_ALGN_STATUS_ALIGND ( 1ULL << 12 ) 831 #define BGX_SPU_BR_PMD_CONTROL 0x010068 832 #define BGX_SPU_BR_PMD_CONTROL_TRAIN_EN ( 1ULL << 1 ) 835 #define BGX_SPU_BR_PMD_STATUS 0x010070 838 #define BGX_SPU_BR_PMD_LP_CUP 0x010078 841 #define BGX_SPU_BR_PMD_LD_CUP 0x010088 844 #define BGX_SPU_BR_PMD_LD_REP 0x010090 847 #define BGX_SPU_FEC_CONTROL 0x0100a0 850 #define BGX_SPU_AN_CONTROL 0x0100c8 853 #define BGX_SPU_AN_STATUS 0x0100d0 854 #define BGX_SPU_AN_STATUS_XNP_STAT ( 1ULL << 7 ) 855 #define BGX_SPU_AN_STATUS_PAGE_RX ( 1ULL << 6 ) 856 #define BGX_SPU_AN_STATUS_AN_COMPLETE ( 1ULL << 5 ) 857 #define BGX_SPU_AN_STATUS_LINK_STATUS ( 1ULL << 2 ) 858 #define BGX_SPU_AN_STATUS_LP_AN_ABLE ( 1ULL << 0 ) 861 #define BGX_SPU_INT 0x010220 862 #define BGX_SPU_INT_TRAINING_FAIL ( 1ULL << 14 ) 863 #define BGX_SPU_INT_TRAINING_DONE ( 1ULL << 13 ) 864 #define BGX_SPU_INT_AN_COMPLETE ( 1ULL << 12 ) 865 #define BGX_SPU_INT_AN_LINK_GOOD ( 1ULL << 11 ) 866 #define BGX_SPU_INT_AN_PAGE_RX ( 1ULL << 10 ) 867 #define BGX_SPU_INT_FEC_UNCORR ( 1ULL << 9 ) 868 #define BGX_SPU_INT_FEC_CORR ( 1ULL << 8 ) 869 #define BGX_SPU_INT_BIP_ERR ( 1ULL << 7 ) 870 #define BGX_SPU_INT_DBG_SYNC ( 1ULL << 6 ) 871 #define BGX_SPU_INT_ALGNLOS ( 1ULL << 5 ) 872 #define BGX_SPU_INT_SYNLOS ( 1ULL << 4 ) 873 #define BGX_SPU_INT_BITLCKLS ( 1ULL << 3 ) 874 #define BGX_SPU_INT_ERR_BLK ( 1ULL << 2 ) 875 #define BGX_SPU_INT_RX_LINK_DOWN ( 1ULL << 1 ) 876 #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)
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.
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.
struct txnic_sq sq
Send queue.
uint8_t send_status
Status.
unsigned int cons
Consumer counter.
unsigned int prod
Producer counter.
Access to external ("user") memory.
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.
uint32_t userptr_t
A pointer to a user buffer.
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)
userptr_t cqe
Completion queue entries.
#define TXNIC_RQ_FILL
Receive queue maximum fill level.
A BGX Ethernet interface.
userptr_t sqe
Send queue entries.
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.
userptr_t rqe
Receive queue entries.
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.