Lines Matching full:si

17 static void enetc_pf_get_primary_mac_addr(struct enetc_hw *hw, int si, u8 *addr)  in enetc_pf_get_primary_mac_addr()  argument
19 u32 upper = __raw_readl(hw->port + ENETC_PSIPMAR0(si)); in enetc_pf_get_primary_mac_addr()
20 u16 lower = __raw_readw(hw->port + ENETC_PSIPMAR1(si)); in enetc_pf_get_primary_mac_addr()
26 static void enetc_pf_set_primary_mac_addr(struct enetc_hw *hw, int si, in enetc_pf_set_primary_mac_addr() argument
32 __raw_writel(upper, hw->port + ENETC_PSIPMAR0(si)); in enetc_pf_set_primary_mac_addr()
33 __raw_writew(lower, hw->port + ENETC_PSIPMAR1(si)); in enetc_pf_set_primary_mac_addr()
45 enetc_pf_set_primary_mac_addr(&priv->si->hw, 0, saddr->sa_data); in enetc_pf_set_mac_addr()
61 enetc_set_vlan_promisc(&pf->si->hw, pf->vlan_promisc_simap); in enetc_enable_si_vlan_promisc()
67 enetc_set_vlan_promisc(&pf->si->hw, pf->vlan_promisc_simap); in enetc_disable_si_vlan_promisc()
70 static void enetc_set_isol_vlan(struct enetc_hw *hw, int si, u16 vlan, u8 qos) in enetc_set_isol_vlan() argument
77 enetc_port_wr(hw, ENETC_PSIVLANR(si), val); in enetc_set_isol_vlan()
122 static void enetc_clear_mac_ht_flt(struct enetc_si *si, int si_idx, int type) in enetc_clear_mac_ht_flt() argument
124 bool err = si->errata & ENETC_ERR_UCMCSWP; in enetc_clear_mac_ht_flt()
127 enetc_port_wr(&si->hw, ENETC_PSIUMHFR0(si_idx, err), 0); in enetc_clear_mac_ht_flt()
128 enetc_port_wr(&si->hw, ENETC_PSIUMHFR1(si_idx), 0); in enetc_clear_mac_ht_flt()
130 enetc_port_wr(&si->hw, ENETC_PSIMMHFR0(si_idx, err), 0); in enetc_clear_mac_ht_flt()
131 enetc_port_wr(&si->hw, ENETC_PSIMMHFR1(si_idx), 0); in enetc_clear_mac_ht_flt()
135 static void enetc_set_mac_ht_flt(struct enetc_si *si, int si_idx, int type, in enetc_set_mac_ht_flt() argument
138 bool err = si->errata & ENETC_ERR_UCMCSWP; in enetc_set_mac_ht_flt()
141 enetc_port_wr(&si->hw, ENETC_PSIUMHFR0(si_idx, err), in enetc_set_mac_ht_flt()
143 enetc_port_wr(&si->hw, ENETC_PSIUMHFR1(si_idx), in enetc_set_mac_ht_flt()
146 enetc_port_wr(&si->hw, ENETC_PSIMMHFR0(si_idx, err), in enetc_set_mac_ht_flt()
148 enetc_port_wr(&si->hw, ENETC_PSIMMHFR1(si_idx), in enetc_set_mac_ht_flt()
156 struct enetc_si *si = pf->si; in enetc_sync_mac_filters() local
167 enetc_clear_mac_flt_entry(si, pos); in enetc_sync_mac_filters()
169 enetc_clear_mac_ht_flt(si, 0, i); in enetc_sync_mac_filters()
177 enetc_clear_mac_ht_flt(si, 0, UC); in enetc_sync_mac_filters()
179 err = enetc_set_mac_flt_entry(si, pos, f->mac_addr, in enetc_sync_mac_filters()
185 dev_warn(&si->pdev->dev, "fallback to HT filt (%d)\n", in enetc_sync_mac_filters()
191 enetc_clear_mac_flt_entry(si, pos); in enetc_sync_mac_filters()
193 enetc_set_mac_ht_flt(si, 0, i, *f->mac_hash_table); in enetc_sync_mac_filters()
200 struct enetc_pf *pf = enetc_si_priv(priv->si); in enetc_pf_set_rx_mode()
201 struct enetc_hw *hw = &priv->si->hw; in enetc_pf_set_rx_mode()
290 enetc_set_vlan_ht_filter(&pf->si->hw, 0, *pf->vlan_ht_filter); in enetc_sync_vlan_ht_filter()
296 struct enetc_pf *pf = enetc_si_priv(priv->si); in enetc_vlan_rx_add_vid()
311 struct enetc_pf *pf = enetc_si_priv(priv->si); in enetc_vlan_rx_del_vid()
322 struct enetc_hw *hw = &priv->si->hw; in enetc_set_loopback()
346 struct enetc_pf *pf = enetc_si_priv(priv->si); in enetc_pf_set_vf_mac()
357 enetc_pf_set_primary_mac_addr(&priv->si->hw, vf + 1, mac); in enetc_pf_set_vf_mac()
365 struct enetc_pf *pf = enetc_si_priv(priv->si); in enetc_pf_set_vf_vlan()
367 if (priv->si->errata & ENETC_ERR_VLAN_ISOL) in enetc_pf_set_vf_vlan()
377 enetc_set_isol_vlan(&priv->si->hw, vf + 1, vlan, qos); in enetc_pf_set_vf_vlan()
384 struct enetc_pf *pf = enetc_si_priv(priv->si); in enetc_pf_set_vf_spoofchk()
390 cfgr = enetc_port_rd(&priv->si->hw, ENETC_PSICFGR0(vf + 1)); in enetc_pf_set_vf_spoofchk()
392 enetc_port_wr(&priv->si->hw, ENETC_PSICFGR0(vf + 1), cfgr); in enetc_pf_set_vf_spoofchk()
398 int si) in enetc_setup_mac_address() argument
400 struct device *dev = &pf->si->pdev->dev; in enetc_setup_mac_address()
401 struct enetc_hw *hw = &pf->si->hw; in enetc_setup_mac_address()
414 enetc_pf_get_primary_mac_addr(hw, si, mac_addr); in enetc_setup_mac_address()
419 dev_info(dev, "no MAC address specified for SI%d, using %pM\n", in enetc_setup_mac_address()
420 si, mac_addr); in enetc_setup_mac_address()
423 enetc_pf_set_primary_mac_addr(hw, si, mac_addr); in enetc_setup_mac_address()
447 static void enetc_port_assign_rfs_entries(struct enetc_si *si) in enetc_port_assign_rfs_entries() argument
449 struct enetc_pf *pf = enetc_si_priv(si); in enetc_port_assign_rfs_entries()
450 struct enetc_hw *hw = &si->hw; in enetc_port_assign_rfs_entries()
468 static void enetc_port_si_configure(struct enetc_si *si) in enetc_port_si_configure() argument
470 struct enetc_pf *pf = enetc_si_priv(si); in enetc_port_si_configure()
471 struct enetc_hw *hw = &si->hw; in enetc_port_si_configure()
485 dev_warn(&si->pdev->dev, "Found %d rings, expected %d!\n", in enetc_port_si_configure()
605 struct enetc_hw *hw = &pf->si->hw; in enetc_configure_port()
611 enetc_port_si_configure(pf->si); in enetc_configure_port()
618 enetc_port_assign_rfs_entries(pf->si); in enetc_configure_port()
637 struct device *dev = &pf->si->pdev->dev; in enetc_msg_pf_set_vf_primary_mac_addr()
651 enetc_pf_set_primary_mac_addr(&pf->si->hw, vf_id + 1, addr); in enetc_msg_pf_set_vf_primary_mac_addr()
659 struct device *dev = &pf->si->pdev->dev; in enetc_msg_handle_rxmsg()
680 struct enetc_si *si = pci_get_drvdata(pdev); in enetc_sriov_configure() local
681 struct enetc_pf *pf = enetc_si_priv(si); in enetc_sriov_configure()
740 struct enetc_pf *pf = enetc_si_priv(priv->si); in enetc_pf_set_features()
796 static void enetc_pf_netdev_setup(struct enetc_si *si, struct net_device *ndev, in enetc_pf_netdev_setup() argument
801 SET_NETDEV_DEV(ndev, &si->pdev->dev); in enetc_pf_netdev_setup()
803 priv->si = si; in enetc_pf_netdev_setup()
804 priv->dev = &si->pdev->dev; in enetc_pf_netdev_setup()
805 si->ndev = ndev; in enetc_pf_netdev_setup()
824 if (si->num_rss) in enetc_pf_netdev_setup()
829 if (si->hw_features & ENETC_SI_F_PSFP && !enetc_psfp_enable(priv)) { in enetc_pf_netdev_setup()
835 /* pick up primary MAC address from SI */ in enetc_pf_netdev_setup()
836 enetc_load_primary_mac_addr(&si->hw, ndev); in enetc_pf_netdev_setup()
841 struct device *dev = &pf->si->pdev->dev; in enetc_mdio_probe()
855 mdio_priv->hw = &pf->si->hw; in enetc_mdio_probe()
876 struct device *dev = &pf->si->pdev->dev; in enetc_imdio_create()
893 mdio_priv->hw = &pf->si->hw; in enetc_imdio_create()
997 enetc_mac_config(&pf->si->hw, state->interface); in enetc_pl_mac_config()
1036 struct enetc_hw *hw = &pf->si->hw; in enetc_pl_mac_link_up()
1041 priv = netdev_priv(pf->si->ndev); in enetc_pl_mac_link_up()
1043 if (pf->si->hw_features & ENETC_SI_F_QBV) in enetc_pl_mac_link_up()
1110 enetc_mac_enable(&pf->si->hw, false); in enetc_pl_mac_link_down()
1124 struct enetc_pf *pf = enetc_si_priv(priv->si); in enetc_phylink_create()
1163 static int enetc_init_port_rfs_memory(struct enetc_si *si) in enetc_init_port_rfs_memory() argument
1166 struct enetc_hw *hw = &si->hw; in enetc_init_port_rfs_memory()
1174 err = enetc_set_fs_entry(si, &rfse, i); in enetc_init_port_rfs_memory()
1182 static int enetc_init_port_rss_memory(struct enetc_si *si) in enetc_init_port_rss_memory() argument
1184 struct enetc_hw *hw = &si->hw; in enetc_init_port_rss_memory()
1198 err = enetc_set_rss_table(si, rss_table, num_rss); in enetc_init_port_rss_memory()
1235 struct enetc_si *si; in enetc_pf_probe() local
1251 si = pci_get_drvdata(pdev); in enetc_pf_probe()
1252 if (!si->hw.port || !si->hw.global) { in enetc_pf_probe()
1258 err = enetc_setup_cbdr(&pdev->dev, &si->hw, ENETC_CBDR_DEFAULT_SIZE, in enetc_pf_probe()
1259 &si->cbd_ring); in enetc_pf_probe()
1263 err = enetc_init_port_rfs_memory(si); in enetc_pf_probe()
1269 err = enetc_init_port_rss_memory(si); in enetc_pf_probe()
1281 pf = enetc_si_priv(si); in enetc_pf_probe()
1282 pf->si = si; in enetc_pf_probe()
1291 enetc_get_si_caps(si); in enetc_pf_probe()
1300 enetc_pf_netdev_setup(si, ndev, &enetc_ndev_ops); in enetc_pf_probe()
1308 dev_err(&pdev->dev, "SI resource alloc failed\n"); in enetc_pf_probe()
1314 dev_err(&pdev->dev, "Failed to configure SI\n"); in enetc_pf_probe()
1355 si->ndev = NULL; in enetc_pf_probe()
1362 enetc_teardown_cbdr(&si->cbd_ring); in enetc_pf_probe()
1372 struct enetc_si *si = pci_get_drvdata(pdev); in enetc_pf_remove() local
1373 struct enetc_pf *pf = enetc_si_priv(si); in enetc_pf_remove()
1376 priv = netdev_priv(si->ndev); in enetc_pf_remove()
1381 unregister_netdev(si->ndev); in enetc_pf_remove()
1389 enetc_teardown_cbdr(&si->cbd_ring); in enetc_pf_remove()
1391 free_netdev(si->ndev); in enetc_pf_remove()