aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/falcon.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sfc/falcon.c')
-rw-r--r--drivers/net/sfc/falcon.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index 4f96ce4c3532..e02f1d1728aa 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -145,7 +145,7 @@ MODULE_PARM_DESC(rx_xon_thresh_bytes, "RX fifo XON threshold");
145#define PCI_EXP_LNKSTA_LNK_WID_LBN 4 145#define PCI_EXP_LNKSTA_LNK_WID_LBN 4
146 146
147#define FALCON_IS_DUAL_FUNC(efx) \ 147#define FALCON_IS_DUAL_FUNC(efx) \
148 (FALCON_REV(efx) < FALCON_REV_B0) 148 (falcon_rev(efx) < FALCON_REV_B0)
149 149
150/************************************************************************** 150/**************************************************************************
151 * 151 *
@@ -465,7 +465,7 @@ int falcon_init_tx(struct efx_tx_queue *tx_queue)
465 TX_DESCQ_TYPE, 0, 465 TX_DESCQ_TYPE, 0,
466 TX_NON_IP_DROP_DIS_B0, 1); 466 TX_NON_IP_DROP_DIS_B0, 1);
467 467
468 if (FALCON_REV(efx) >= FALCON_REV_B0) { 468 if (falcon_rev(efx) >= FALCON_REV_B0) {
469 int csum = !(efx->net_dev->features & NETIF_F_IP_CSUM); 469 int csum = !(efx->net_dev->features & NETIF_F_IP_CSUM);
470 EFX_SET_OWORD_FIELD(tx_desc_ptr, TX_IP_CHKSM_DIS_B0, csum); 470 EFX_SET_OWORD_FIELD(tx_desc_ptr, TX_IP_CHKSM_DIS_B0, csum);
471 EFX_SET_OWORD_FIELD(tx_desc_ptr, TX_TCP_CHKSM_DIS_B0, csum); 471 EFX_SET_OWORD_FIELD(tx_desc_ptr, TX_TCP_CHKSM_DIS_B0, csum);
@@ -474,7 +474,7 @@ int falcon_init_tx(struct efx_tx_queue *tx_queue)
474 falcon_write_table(efx, &tx_desc_ptr, efx->type->txd_ptr_tbl_base, 474 falcon_write_table(efx, &tx_desc_ptr, efx->type->txd_ptr_tbl_base,
475 tx_queue->queue); 475 tx_queue->queue);
476 476
477 if (FALCON_REV(efx) < FALCON_REV_B0) { 477 if (falcon_rev(efx) < FALCON_REV_B0) {
478 efx_oword_t reg; 478 efx_oword_t reg;
479 479
480 BUG_ON(tx_queue->queue >= 128); /* HW limit */ 480 BUG_ON(tx_queue->queue >= 128); /* HW limit */
@@ -635,7 +635,7 @@ int falcon_init_rx(struct efx_rx_queue *rx_queue)
635 efx_oword_t rx_desc_ptr; 635 efx_oword_t rx_desc_ptr;
636 struct efx_nic *efx = rx_queue->efx; 636 struct efx_nic *efx = rx_queue->efx;
637 int rc; 637 int rc;
638 int is_b0 = FALCON_REV(efx) >= FALCON_REV_B0; 638 int is_b0 = falcon_rev(efx) >= FALCON_REV_B0;
639 int iscsi_digest_en = is_b0; 639 int iscsi_digest_en = is_b0;
640 640
641 EFX_LOG(efx, "RX queue %d ring in special buffers %d-%d\n", 641 EFX_LOG(efx, "RX queue %d ring in special buffers %d-%d\n",
@@ -822,10 +822,10 @@ static inline void falcon_handle_tx_event(struct efx_channel *channel,
822 tx_ev_q_label = EFX_QWORD_FIELD(*event, TX_EV_Q_LABEL); 822 tx_ev_q_label = EFX_QWORD_FIELD(*event, TX_EV_Q_LABEL);
823 tx_queue = &efx->tx_queue[tx_ev_q_label]; 823 tx_queue = &efx->tx_queue[tx_ev_q_label];
824 824
825 if (NET_DEV_REGISTERED(efx)) 825 if (efx_dev_registered(efx))
826 netif_tx_lock(efx->net_dev); 826 netif_tx_lock(efx->net_dev);
827 falcon_notify_tx_desc(tx_queue); 827 falcon_notify_tx_desc(tx_queue);
828 if (NET_DEV_REGISTERED(efx)) 828 if (efx_dev_registered(efx))
829 netif_tx_unlock(efx->net_dev); 829 netif_tx_unlock(efx->net_dev);
830 } else if (EFX_QWORD_FIELD(*event, TX_EV_PKT_ERR) && 830 } else if (EFX_QWORD_FIELD(*event, TX_EV_PKT_ERR) &&
831 EFX_WORKAROUND_10727(efx)) { 831 EFX_WORKAROUND_10727(efx)) {
@@ -884,7 +884,7 @@ static void falcon_handle_rx_not_ok(struct efx_rx_queue *rx_queue,
884 RX_EV_TCP_UDP_CHKSUM_ERR); 884 RX_EV_TCP_UDP_CHKSUM_ERR);
885 rx_ev_eth_crc_err = EFX_QWORD_FIELD(*event, RX_EV_ETH_CRC_ERR); 885 rx_ev_eth_crc_err = EFX_QWORD_FIELD(*event, RX_EV_ETH_CRC_ERR);
886 rx_ev_frm_trunc = EFX_QWORD_FIELD(*event, RX_EV_FRM_TRUNC); 886 rx_ev_frm_trunc = EFX_QWORD_FIELD(*event, RX_EV_FRM_TRUNC);
887 rx_ev_drib_nib = ((FALCON_REV(efx) >= FALCON_REV_B0) ? 887 rx_ev_drib_nib = ((falcon_rev(efx) >= FALCON_REV_B0) ?
888 0 : EFX_QWORD_FIELD(*event, RX_EV_DRIB_NIB)); 888 0 : EFX_QWORD_FIELD(*event, RX_EV_DRIB_NIB));
889 rx_ev_pause_frm = EFX_QWORD_FIELD(*event, RX_EV_PAUSE_FRM_ERR); 889 rx_ev_pause_frm = EFX_QWORD_FIELD(*event, RX_EV_PAUSE_FRM_ERR);
890 890
@@ -1065,7 +1065,7 @@ static void falcon_handle_global_event(struct efx_channel *channel,
1065 EFX_QWORD_FIELD(*event, XG_PHY_INTR)) 1065 EFX_QWORD_FIELD(*event, XG_PHY_INTR))
1066 is_phy_event = 1; 1066 is_phy_event = 1;
1067 1067
1068 if ((FALCON_REV(efx) >= FALCON_REV_B0) && 1068 if ((falcon_rev(efx) >= FALCON_REV_B0) &&
1069 EFX_OWORD_FIELD(*event, XG_MNT_INTR_B0)) 1069 EFX_OWORD_FIELD(*event, XG_MNT_INTR_B0))
1070 is_phy_event = 1; 1070 is_phy_event = 1;
1071 1071
@@ -1572,7 +1572,7 @@ static void falcon_setup_rss_indir_table(struct efx_nic *efx)
1572 unsigned long offset; 1572 unsigned long offset;
1573 efx_dword_t dword; 1573 efx_dword_t dword;
1574 1574
1575 if (FALCON_REV(efx) < FALCON_REV_B0) 1575 if (falcon_rev(efx) < FALCON_REV_B0)
1576 return; 1576 return;
1577 1577
1578 for (offset = RX_RSS_INDIR_TBL_B0; 1578 for (offset = RX_RSS_INDIR_TBL_B0;
@@ -1595,7 +1595,7 @@ int falcon_init_interrupt(struct efx_nic *efx)
1595 1595
1596 if (!EFX_INT_MODE_USE_MSI(efx)) { 1596 if (!EFX_INT_MODE_USE_MSI(efx)) {
1597 irq_handler_t handler; 1597 irq_handler_t handler;
1598 if (FALCON_REV(efx) >= FALCON_REV_B0) 1598 if (falcon_rev(efx) >= FALCON_REV_B0)
1599 handler = falcon_legacy_interrupt_b0; 1599 handler = falcon_legacy_interrupt_b0;
1600 else 1600 else
1601 handler = falcon_legacy_interrupt_a1; 1601 handler = falcon_legacy_interrupt_a1;
@@ -1642,7 +1642,7 @@ void falcon_fini_interrupt(struct efx_nic *efx)
1642 } 1642 }
1643 1643
1644 /* ACK legacy interrupt */ 1644 /* ACK legacy interrupt */
1645 if (FALCON_REV(efx) >= FALCON_REV_B0) 1645 if (falcon_rev(efx) >= FALCON_REV_B0)
1646 falcon_read(efx, &reg, INT_ISR0_B0); 1646 falcon_read(efx, &reg, INT_ISR0_B0);
1647 else 1647 else
1648 falcon_irq_ack_a1(efx); 1648 falcon_irq_ack_a1(efx);
@@ -1733,7 +1733,7 @@ void falcon_drain_tx_fifo(struct efx_nic *efx)
1733 efx_oword_t temp; 1733 efx_oword_t temp;
1734 int count; 1734 int count;
1735 1735
1736 if ((FALCON_REV(efx) < FALCON_REV_B0) || 1736 if ((falcon_rev(efx) < FALCON_REV_B0) ||
1737 (efx->loopback_mode != LOOPBACK_NONE)) 1737 (efx->loopback_mode != LOOPBACK_NONE))
1738 return; 1738 return;
1739 1739
@@ -1786,7 +1786,7 @@ void falcon_deconfigure_mac_wrapper(struct efx_nic *efx)
1786{ 1786{
1787 efx_oword_t temp; 1787 efx_oword_t temp;
1788 1788
1789 if (FALCON_REV(efx) < FALCON_REV_B0) 1789 if (falcon_rev(efx) < FALCON_REV_B0)
1790 return; 1790 return;
1791 1791
1792 /* Isolate the MAC -> RX */ 1792 /* Isolate the MAC -> RX */
@@ -1824,7 +1824,7 @@ void falcon_reconfigure_mac_wrapper(struct efx_nic *efx)
1824 MAC_SPEED, link_speed); 1824 MAC_SPEED, link_speed);
1825 /* On B0, MAC backpressure can be disabled and packets get 1825 /* On B0, MAC backpressure can be disabled and packets get
1826 * discarded. */ 1826 * discarded. */
1827 if (FALCON_REV(efx) >= FALCON_REV_B0) { 1827 if (falcon_rev(efx) >= FALCON_REV_B0) {
1828 EFX_SET_OWORD_FIELD(reg, TXFIFO_DRAIN_EN_B0, 1828 EFX_SET_OWORD_FIELD(reg, TXFIFO_DRAIN_EN_B0,
1829 !efx->link_up); 1829 !efx->link_up);
1830 } 1830 }
@@ -1842,7 +1842,7 @@ void falcon_reconfigure_mac_wrapper(struct efx_nic *efx)
1842 EFX_SET_OWORD_FIELD_VER(efx, reg, RX_XOFF_MAC_EN, tx_fc); 1842 EFX_SET_OWORD_FIELD_VER(efx, reg, RX_XOFF_MAC_EN, tx_fc);
1843 1843
1844 /* Unisolate the MAC -> RX */ 1844 /* Unisolate the MAC -> RX */
1845 if (FALCON_REV(efx) >= FALCON_REV_B0) 1845 if (falcon_rev(efx) >= FALCON_REV_B0)
1846 EFX_SET_OWORD_FIELD(reg, RX_INGR_EN_B0, 1); 1846 EFX_SET_OWORD_FIELD(reg, RX_INGR_EN_B0, 1);
1847 falcon_write(efx, &reg, RX_CFG_REG_KER); 1847 falcon_write(efx, &reg, RX_CFG_REG_KER);
1848} 1848}
@@ -1857,7 +1857,7 @@ int falcon_dma_stats(struct efx_nic *efx, unsigned int done_offset)
1857 return 0; 1857 return 0;
1858 1858
1859 /* Statistics fetch will fail if the MAC is in TX drain */ 1859 /* Statistics fetch will fail if the MAC is in TX drain */
1860 if (FALCON_REV(efx) >= FALCON_REV_B0) { 1860 if (falcon_rev(efx) >= FALCON_REV_B0) {
1861 efx_oword_t temp; 1861 efx_oword_t temp;
1862 falcon_read(efx, &temp, MAC0_CTRL_REG_KER); 1862 falcon_read(efx, &temp, MAC0_CTRL_REG_KER);
1863 if (EFX_OWORD_FIELD(temp, TXFIFO_DRAIN_EN_B0)) 1863 if (EFX_OWORD_FIELD(temp, TXFIFO_DRAIN_EN_B0))
@@ -2114,7 +2114,7 @@ int falcon_probe_port(struct efx_nic *efx)
2114 falcon_init_mdio(&efx->mii); 2114 falcon_init_mdio(&efx->mii);
2115 2115
2116 /* Hardware flow ctrl. FalconA RX FIFO too small for pause generation */ 2116 /* Hardware flow ctrl. FalconA RX FIFO too small for pause generation */
2117 if (FALCON_REV(efx) >= FALCON_REV_B0) 2117 if (falcon_rev(efx) >= FALCON_REV_B0)
2118 efx->flow_control = EFX_FC_RX | EFX_FC_TX; 2118 efx->flow_control = EFX_FC_RX | EFX_FC_TX;
2119 else 2119 else
2120 efx->flow_control = EFX_FC_RX; 2120 efx->flow_control = EFX_FC_RX;
@@ -2374,7 +2374,7 @@ static int falcon_probe_nic_variant(struct efx_nic *efx)
2374 return -ENODEV; 2374 return -ENODEV;
2375 } 2375 }
2376 2376
2377 switch (FALCON_REV(efx)) { 2377 switch (falcon_rev(efx)) {
2378 case FALCON_REV_A0: 2378 case FALCON_REV_A0:
2379 case 0xff: 2379 case 0xff:
2380 EFX_ERR(efx, "Falcon rev A0 not supported\n"); 2380 EFX_ERR(efx, "Falcon rev A0 not supported\n");
@@ -2400,7 +2400,7 @@ static int falcon_probe_nic_variant(struct efx_nic *efx)
2400 break; 2400 break;
2401 2401
2402 default: 2402 default:
2403 EFX_ERR(efx, "Unknown Falcon rev %d\n", FALCON_REV(efx)); 2403 EFX_ERR(efx, "Unknown Falcon rev %d\n", falcon_rev(efx));
2404 return -ENODEV; 2404 return -ENODEV;
2405 } 2405 }
2406 2406
@@ -2563,7 +2563,7 @@ int falcon_init_nic(struct efx_nic *efx)
2563 2563
2564 /* Set number of RSS queues for receive path. */ 2564 /* Set number of RSS queues for receive path. */
2565 falcon_read(efx, &temp, RX_FILTER_CTL_REG); 2565 falcon_read(efx, &temp, RX_FILTER_CTL_REG);
2566 if (FALCON_REV(efx) >= FALCON_REV_B0) 2566 if (falcon_rev(efx) >= FALCON_REV_B0)
2567 EFX_SET_OWORD_FIELD(temp, NUM_KER, 0); 2567 EFX_SET_OWORD_FIELD(temp, NUM_KER, 0);
2568 else 2568 else
2569 EFX_SET_OWORD_FIELD(temp, NUM_KER, efx->rss_queues - 1); 2569 EFX_SET_OWORD_FIELD(temp, NUM_KER, efx->rss_queues - 1);
@@ -2601,7 +2601,7 @@ int falcon_init_nic(struct efx_nic *efx)
2601 /* Prefetch threshold 2 => fetch when descriptor cache half empty */ 2601 /* Prefetch threshold 2 => fetch when descriptor cache half empty */
2602 EFX_SET_OWORD_FIELD(temp, TX_PREF_THRESHOLD, 2); 2602 EFX_SET_OWORD_FIELD(temp, TX_PREF_THRESHOLD, 2);
2603 /* Squash TX of packets of 16 bytes or less */ 2603 /* Squash TX of packets of 16 bytes or less */
2604 if (FALCON_REV(efx) >= FALCON_REV_B0 && EFX_WORKAROUND_9141(efx)) 2604 if (falcon_rev(efx) >= FALCON_REV_B0 && EFX_WORKAROUND_9141(efx))
2605 EFX_SET_OWORD_FIELD(temp, TX_FLUSH_MIN_LEN_EN_B0, 1); 2605 EFX_SET_OWORD_FIELD(temp, TX_FLUSH_MIN_LEN_EN_B0, 1);
2606 falcon_write(efx, &temp, TX_CFG2_REG_KER); 2606 falcon_write(efx, &temp, TX_CFG2_REG_KER);
2607 2607
@@ -2618,7 +2618,7 @@ int falcon_init_nic(struct efx_nic *efx)
2618 if (EFX_WORKAROUND_7575(efx)) 2618 if (EFX_WORKAROUND_7575(efx))
2619 EFX_SET_OWORD_FIELD_VER(efx, temp, RX_USR_BUF_SIZE, 2619 EFX_SET_OWORD_FIELD_VER(efx, temp, RX_USR_BUF_SIZE,
2620 (3 * 4096) / 32); 2620 (3 * 4096) / 32);
2621 if (FALCON_REV(efx) >= FALCON_REV_B0) 2621 if (falcon_rev(efx) >= FALCON_REV_B0)
2622 EFX_SET_OWORD_FIELD(temp, RX_INGR_EN_B0, 1); 2622 EFX_SET_OWORD_FIELD(temp, RX_INGR_EN_B0, 1);
2623 2623
2624 /* RX FIFO flow control thresholds */ 2624 /* RX FIFO flow control thresholds */
@@ -2634,7 +2634,7 @@ int falcon_init_nic(struct efx_nic *efx)
2634 falcon_write(efx, &temp, RX_CFG_REG_KER); 2634 falcon_write(efx, &temp, RX_CFG_REG_KER);
2635 2635
2636 /* Set destination of both TX and RX Flush events */ 2636 /* Set destination of both TX and RX Flush events */
2637 if (FALCON_REV(efx) >= FALCON_REV_B0) { 2637 if (falcon_rev(efx) >= FALCON_REV_B0) {
2638 EFX_POPULATE_OWORD_1(temp, FLS_EVQ_ID, 0); 2638 EFX_POPULATE_OWORD_1(temp, FLS_EVQ_ID, 0);
2639 falcon_write(efx, &temp, DP_CTRL_REG); 2639 falcon_write(efx, &temp, DP_CTRL_REG);
2640 } 2640 }