Lines Matching refs:fp

206 	const struct funeth_priv *fp = netdev_priv(netdev);  in fun_get_link_ksettings()  local
217 seq = read_seqcount_begin(&fp->link_seq); in fun_get_link_ksettings()
219 speed = fp->link_speed; in fun_get_link_ksettings()
220 xcvr = fp->xcvr_type; in fun_get_link_ksettings()
221 lp_advertising = fp->lp_advertising; in fun_get_link_ksettings()
222 } while (read_seqcount_retry(&fp->link_seq, seq)); in fun_get_link_ksettings()
234 ks->base.autoneg = (fp->advertising & FUN_PORT_CAP_AUTONEG) ? in fun_get_link_ksettings()
238 fun_link_modes_to_ethtool(fp->port_caps, ks->link_modes.supported); in fun_get_link_ksettings()
239 if (fp->port_caps & (FUN_PORT_CAP_RX_PAUSE | FUN_PORT_CAP_TX_PAUSE)) in fun_get_link_ksettings()
242 fun_link_modes_to_ethtool(fp->advertising, ks->link_modes.advertising); in fun_get_link_ksettings()
243 set_asym_pause(fp->advertising, ks); in fun_get_link_ksettings()
300 static int fun_change_advert(struct funeth_priv *fp, u64 new_advert) in fun_change_advert() argument
304 if (new_advert == fp->advertising) in fun_change_advert()
307 err = fun_port_write_cmd(fp, FUN_ADMIN_PORT_KEY_ADVERT, new_advert); in fun_change_advert()
309 fp->advertising = new_advert; in fun_change_advert()
320 struct funeth_priv *fp = netdev_priv(netdev); in fun_set_link_ksettings() local
324 if (fp->port_caps & FUN_PORT_CAP_VPORT) in fun_set_link_ksettings()
330 !(fp->port_caps & FUN_PORT_CAP_AUTONEG)) in fun_set_link_ksettings()
337 fun_link_modes_to_ethtool(fp->port_caps, supported); in fun_set_link_ksettings()
344 new_advert &= fp->port_caps; in fun_set_link_ksettings()
348 new_advert |= fp->advertising & in fun_set_link_ksettings()
351 return fun_change_advert(fp, new_advert); in fun_set_link_ksettings()
357 const struct funeth_priv *fp = netdev_priv(netdev); in fun_get_pauseparam() local
358 u8 active_pause = fp->active_fc; in fun_get_pauseparam()
362 pause->autoneg = !!(fp->advertising & FUN_PORT_CAP_AUTONEG); in fun_get_pauseparam()
368 struct funeth_priv *fp = netdev_priv(netdev); in fun_set_pauseparam() local
371 if (fp->port_caps & FUN_PORT_CAP_VPORT) in fun_set_pauseparam()
374 if (!pause->autoneg && (fp->advertising & FUN_PORT_CAP_AUTONEG)) in fun_set_pauseparam()
376 if (pause->autoneg && !(fp->advertising & FUN_PORT_CAP_AUTONEG)) in fun_set_pauseparam()
378 if (pause->tx_pause && !(fp->port_caps & FUN_PORT_CAP_TX_PAUSE)) in fun_set_pauseparam()
380 if (pause->rx_pause && !(fp->port_caps & FUN_PORT_CAP_RX_PAUSE)) in fun_set_pauseparam()
383 new_advert = fp->advertising & ~FUN_PORT_CAP_PAUSE_MASK; in fun_set_pauseparam()
389 return fun_change_advert(fp, new_advert); in fun_set_pauseparam()
394 struct funeth_priv *fp = netdev_priv(netdev); in fun_restart_an() local
396 if (!(fp->advertising & FUN_PORT_CAP_AUTONEG)) in fun_restart_an()
399 return fun_port_write_cmd(fp, FUN_ADMIN_PORT_KEY_ADVERT, in fun_restart_an()
406 struct funeth_priv *fp = netdev_priv(netdev); in fun_set_phys_id() local
409 if (fp->port_caps & FUN_PORT_CAP_VPORT) in fun_set_phys_id()
416 return fun_port_write_cmd(fp, FUN_ADMIN_PORT_KEY_LED, beacon); in fun_set_phys_id()
422 const struct funeth_priv *fp = netdev_priv(netdev); in fun_get_drvinfo() local
425 strscpy(info->bus_info, pci_name(fp->pdev), sizeof(info->bus_info)); in fun_get_drvinfo()
430 const struct funeth_priv *fp = netdev_priv(netdev); in fun_get_msglevel() local
432 return fp->msg_enable; in fun_get_msglevel()
437 struct funeth_priv *fp = netdev_priv(netdev); in fun_set_msglevel() local
439 fp->msg_enable = value; in fun_set_msglevel()
450 const struct funeth_priv *fp = netdev_priv(dev); in fun_get_regs() local
451 void __iomem *bar = fp->fdev->bar; in fun_get_regs()
470 const struct funeth_priv *fp = netdev_priv(netdev); in fun_get_coalesce() local
472 coal->rx_coalesce_usecs = fp->rx_coal_usec; in fun_get_coalesce()
473 coal->rx_max_coalesced_frames = fp->rx_coal_count; in fun_get_coalesce()
474 coal->use_adaptive_rx_coalesce = !fp->cq_irq_db; in fun_get_coalesce()
475 coal->tx_coalesce_usecs = fp->tx_coal_usec; in fun_get_coalesce()
476 coal->tx_max_coalesced_frames = fp->tx_coal_count; in fun_get_coalesce()
485 struct funeth_priv *fp = netdev_priv(netdev); in fun_set_coalesce() local
502 fp->rx_coal_usec = coal->rx_coalesce_usecs; in fun_set_coalesce()
503 fp->rx_coal_count = coal->rx_max_coalesced_frames; in fun_set_coalesce()
504 fp->tx_coal_usec = coal->tx_coalesce_usecs; in fun_set_coalesce()
505 fp->tx_coal_count = coal->tx_max_coalesced_frames; in fun_set_coalesce()
507 db_val = FUN_IRQ_CQ_DB(fp->rx_coal_usec, fp->rx_coal_count); in fun_set_coalesce()
508 WRITE_ONCE(fp->cq_irq_db, db_val); in fun_set_coalesce()
510 rxqs = rtnl_dereference(fp->rxqs); in fun_set_coalesce()
517 db_val = FUN_IRQ_SQ_DB(fp->tx_coal_usec, fp->tx_coal_count); in fun_set_coalesce()
519 WRITE_ONCE(fp->txqs[i]->irq_db_val, db_val); in fun_set_coalesce()
557 const struct funeth_priv *fp = netdev_priv(netdev); in fun_get_ringparam() local
558 unsigned int max_depth = fp->fdev->q_depth; in fun_get_ringparam()
566 ring->rx_pending = fp->rq_depth; in fun_get_ringparam()
567 ring->tx_pending = fp->sq_depth; in fun_get_ringparam()
578 struct funeth_priv *fp = netdev_priv(netdev); in fun_set_ringparam() local
593 if (fp->sq_depth == ring->tx_pending && in fun_set_ringparam()
594 fp->rq_depth == ring->rx_pending) in fun_set_ringparam()
609 fp->sq_depth = ring->tx_pending; in fun_set_ringparam()
610 fp->rq_depth = ring->rx_pending; in fun_set_ringparam()
611 fp->cq_depth = 2 * fp->rq_depth; in fun_set_ringparam()
617 const struct funeth_priv *fp = netdev_priv(dev); in fun_get_sset_count() local
624 (fp->num_xdpqs + 1) * ARRAY_SIZE(xdpq_stat_names) + in fun_get_sset_count()
626 if (fp->port_caps & FUN_PORT_CAP_STATS) { in fun_get_sset_count()
639 const struct funeth_priv *fp = netdev_priv(netdev); in fun_get_strings() local
645 if (fp->port_caps & FUN_PORT_CAP_STATS) { in fun_get_strings()
660 for (i = 0; i < fp->num_xdpqs; i++) { in fun_get_strings()
684 static u64 *get_mac_stats(const struct funeth_priv *fp, u64 *data) in get_mac_stats() argument
687 *data++ = be64_to_cpu(fp->stats[PORT_MAC_RX_STATS_MAX + PORT_MAC_TX_##s]) in get_mac_stats()
713 #define RX_STAT(s) *data++ = be64_to_cpu(fp->stats[PORT_MAC_RX_##s]) in get_mac_stats()
750 const struct funeth_priv *fp = netdev_priv(netdev); in fun_get_ethtool_stats() local
758 if (fp->port_caps & FUN_PORT_CAP_STATS) in fun_get_ethtool_stats()
759 data = get_mac_stats(fp, data); in fun_get_ethtool_stats()
761 rxqs = rtnl_dereference(fp->rxqs); in fun_get_ethtool_stats()
775 FUN_QSTAT_READ(fp->txqs[i], start, txs); in fun_get_ethtool_stats()
795 xdpqs = rtnl_dereference(fp->xdpqs); in fun_get_ethtool_stats()
796 totals = data + fp->num_xdpqs * ARRAY_SIZE(xdpq_stat_names); in fun_get_ethtool_stats()
798 for (i = 0; i < fp->num_xdpqs; i++) { in fun_get_ethtool_stats()
835 *data++ = atomic64_read(&fp->tx_tls_add); in fun_get_ethtool_stats()
836 *data++ = atomic64_read(&fp->tx_tls_del); in fun_get_ethtool_stats()
837 *data++ = atomic64_read(&fp->tx_tls_resync); in fun_get_ethtool_stats()
840 #define RX_STAT(fp, s) be64_to_cpu((fp)->stats[PORT_MAC_RX_##s]) argument
841 #define TX_STAT(fp, s) \ argument
842 be64_to_cpu((fp)->stats[PORT_MAC_RX_STATS_MAX + PORT_MAC_TX_##s])
843 #define FEC_STAT(fp, s) \ argument
844 be64_to_cpu((fp)->stats[PORT_MAC_RX_STATS_MAX + \
850 const struct funeth_priv *fp = netdev_priv(netdev); in fun_get_pause_stats() local
852 if (!(fp->port_caps & FUN_PORT_CAP_STATS)) in fun_get_pause_stats()
855 stats->tx_pause_frames = TX_STAT(fp, aPAUSEMACCtrlFramesTransmitted); in fun_get_pause_stats()
856 stats->rx_pause_frames = RX_STAT(fp, aPAUSEMACCtrlFramesReceived); in fun_get_pause_stats()
862 const struct funeth_priv *fp = netdev_priv(netdev); in fun_get_802_3_stats() local
864 if (!(fp->port_caps & FUN_PORT_CAP_STATS)) in fun_get_802_3_stats()
867 stats->FramesTransmittedOK = TX_STAT(fp, aFramesTransmittedOK); in fun_get_802_3_stats()
868 stats->FramesReceivedOK = RX_STAT(fp, aFramesReceivedOK); in fun_get_802_3_stats()
869 stats->FrameCheckSequenceErrors = RX_STAT(fp, aFrameCheckSequenceErrors); in fun_get_802_3_stats()
870 stats->OctetsTransmittedOK = TX_STAT(fp, OctetsTransmittedOK); in fun_get_802_3_stats()
871 stats->OctetsReceivedOK = RX_STAT(fp, OctetsReceivedOK); in fun_get_802_3_stats()
872 stats->InRangeLengthErrors = RX_STAT(fp, aInRangeLengthErrors); in fun_get_802_3_stats()
873 stats->FrameTooLongErrors = RX_STAT(fp, aFrameTooLongErrors); in fun_get_802_3_stats()
879 const struct funeth_priv *fp = netdev_priv(netdev); in fun_get_802_3_ctrl_stats() local
881 if (!(fp->port_caps & FUN_PORT_CAP_STATS)) in fun_get_802_3_ctrl_stats()
884 stats->MACControlFramesTransmitted = TX_STAT(fp, MACControlFramesTransmitted); in fun_get_802_3_ctrl_stats()
885 stats->MACControlFramesReceived = RX_STAT(fp, MACControlFramesReceived); in fun_get_802_3_ctrl_stats()
903 const struct funeth_priv *fp = netdev_priv(netdev); in fun_get_rmon_stats() local
905 if (!(fp->port_caps & FUN_PORT_CAP_STATS)) in fun_get_rmon_stats()
908 stats->undersize_pkts = RX_STAT(fp, etherStatsUndersizePkts); in fun_get_rmon_stats()
909 stats->oversize_pkts = RX_STAT(fp, etherStatsOversizePkts); in fun_get_rmon_stats()
910 stats->fragments = RX_STAT(fp, etherStatsFragments); in fun_get_rmon_stats()
911 stats->jabbers = RX_STAT(fp, etherStatsJabbers); in fun_get_rmon_stats()
913 stats->hist[0] = RX_STAT(fp, etherStatsPkts64Octets); in fun_get_rmon_stats()
914 stats->hist[1] = RX_STAT(fp, etherStatsPkts65to127Octets); in fun_get_rmon_stats()
915 stats->hist[2] = RX_STAT(fp, etherStatsPkts128to255Octets); in fun_get_rmon_stats()
916 stats->hist[3] = RX_STAT(fp, etherStatsPkts256to511Octets); in fun_get_rmon_stats()
917 stats->hist[4] = RX_STAT(fp, etherStatsPkts512to1023Octets); in fun_get_rmon_stats()
918 stats->hist[5] = RX_STAT(fp, etherStatsPkts1024to1518Octets); in fun_get_rmon_stats()
919 stats->hist[6] = RX_STAT(fp, etherStatsPkts1519toMaxOctets); in fun_get_rmon_stats()
921 stats->hist_tx[0] = TX_STAT(fp, etherStatsPkts64Octets); in fun_get_rmon_stats()
922 stats->hist_tx[1] = TX_STAT(fp, etherStatsPkts65to127Octets); in fun_get_rmon_stats()
923 stats->hist_tx[2] = TX_STAT(fp, etherStatsPkts128to255Octets); in fun_get_rmon_stats()
924 stats->hist_tx[3] = TX_STAT(fp, etherStatsPkts256to511Octets); in fun_get_rmon_stats()
925 stats->hist_tx[4] = TX_STAT(fp, etherStatsPkts512to1023Octets); in fun_get_rmon_stats()
926 stats->hist_tx[5] = TX_STAT(fp, etherStatsPkts1024to1518Octets); in fun_get_rmon_stats()
927 stats->hist_tx[6] = TX_STAT(fp, etherStatsPkts1519toMaxOctets); in fun_get_rmon_stats()
935 const struct funeth_priv *fp = netdev_priv(netdev); in fun_get_fec_stats() local
937 if (!(fp->port_caps & FUN_PORT_CAP_STATS)) in fun_get_fec_stats()
940 stats->corrected_blocks.total = FEC_STAT(fp, Correctable); in fun_get_fec_stats()
941 stats->uncorrectable_blocks.total = FEC_STAT(fp, Uncorrectable); in fun_get_fec_stats()
968 const struct funeth_priv *fp = netdev_priv(netdev); in fun_get_rxfh_indir_size() local
970 return fp->indir_table_nentries; in fun_get_rxfh_indir_size()
975 const struct funeth_priv *fp = netdev_priv(netdev); in fun_get_rxfh_key_size() local
977 return sizeof(fp->rss_key); in fun_get_rxfh_key_size()
983 const struct funeth_priv *fp = netdev_priv(netdev); in fun_get_rxfh() local
985 if (!fp->rss_cfg) in fun_get_rxfh()
989 memcpy(indir, fp->indir_table, in fun_get_rxfh()
990 sizeof(u32) * fp->indir_table_nentries); in fun_get_rxfh()
993 memcpy(key, fp->rss_key, sizeof(fp->rss_key)); in fun_get_rxfh()
996 *hfunc = fp->hash_algo == FUN_ETH_RSS_ALG_TOEPLITZ ? in fun_get_rxfh()
1005 struct funeth_priv *fp = netdev_priv(netdev); in fun_set_rxfh() local
1006 const u32 *rss_indir = indir ? indir : fp->indir_table; in fun_set_rxfh()
1007 const u8 *rss_key = key ? key : fp->rss_key; in fun_set_rxfh()
1010 if (!fp->rss_cfg) in fun_set_rxfh()
1014 algo = fp->hash_algo; in fun_set_rxfh()
1033 fp->hash_algo = algo; in fun_set_rxfh()
1035 memcpy(fp->rss_key, key, sizeof(fp->rss_key)); in fun_set_rxfh()
1037 memcpy(fp->indir_table, indir, in fun_set_rxfh()
1038 sizeof(u32) * fp->indir_table_nentries); in fun_set_rxfh()
1076 struct funeth_priv *fp = netdev_priv(netdev); in fun_get_fecparam() local
1080 rc = fun_port_read_cmd(fp, FUN_ADMIN_PORT_KEY_FEC, &fec_data); in fun_get_fecparam()
1092 struct funeth_priv *fp = netdev_priv(netdev); in fun_set_fecparam() local
1100 if (!(fp->port_caps & FUN_PORT_CAP_FEC_NONE)) in fun_set_fecparam()
1105 if (!(fp->port_caps & FUN_PORT_CAP_FEC_FC)) in fun_set_fecparam()
1110 if (!(fp->port_caps & FUN_PORT_CAP_FEC_RS)) in fun_set_fecparam()
1118 return fun_port_write_cmd(fp, FUN_ADMIN_PORT_KEY_FEC, fec_mode); in fun_set_fecparam()
1129 struct funeth_priv *fp = netdev_priv(netdev); in fun_get_port_module_page() local
1132 if (fp->port_caps & FUN_PORT_CAP_VPORT) { in fun_get_port_module_page()
1145 rc = fun_submit_admin_sync_cmd(fp->fdev, &cmd.req.common, &cmd.rsp, in fun_get_port_module_page()