Commit e3972399 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by David S. Miller

net: enetc: build common object files into a separate module

The build system is complaining about the following:

enetc.o is added to multiple modules: fsl-enetc fsl-enetc-vf
enetc_cbdr.o is added to multiple modules: fsl-enetc fsl-enetc-vf
enetc_ethtool.o is added to multiple modules: fsl-enetc fsl-enetc-vf
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f3c6e128
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
config FSL_ENETC_CORE
tristate
help
This module supports common functionality between the PF and VF
drivers for the NXP ENETC controller.
If compiled as module (M), the module name is fsl-enetc-core.
config FSL_ENETC config FSL_ENETC
tristate "ENETC PF driver" tristate "ENETC PF driver"
depends on PCI_MSI depends on PCI_MSI
select FSL_ENETC_CORE
select FSL_ENETC_IERB select FSL_ENETC_IERB
select FSL_ENETC_MDIO select FSL_ENETC_MDIO
select PHYLINK select PHYLINK
...@@ -17,6 +26,7 @@ config FSL_ENETC ...@@ -17,6 +26,7 @@ config FSL_ENETC
config FSL_ENETC_VF config FSL_ENETC_VF
tristate "ENETC VF driver" tristate "ENETC VF driver"
depends on PCI_MSI depends on PCI_MSI
select FSL_ENETC_CORE
select FSL_ENETC_MDIO select FSL_ENETC_MDIO
select PHYLINK select PHYLINK
select DIMLIB select DIMLIB
......
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
common-objs := enetc.o enetc_cbdr.o enetc_ethtool.o obj-$(CONFIG_FSL_ENETC_CORE) += fsl-enetc-core.o
fsl-enetc-core-y := enetc.o enetc_cbdr.o enetc_ethtool.o
obj-$(CONFIG_FSL_ENETC) += fsl-enetc.o obj-$(CONFIG_FSL_ENETC) += fsl-enetc.o
fsl-enetc-y := enetc_pf.o $(common-objs) fsl-enetc-y := enetc_pf.o
fsl-enetc-$(CONFIG_PCI_IOV) += enetc_msg.o fsl-enetc-$(CONFIG_PCI_IOV) += enetc_msg.o
fsl-enetc-$(CONFIG_FSL_ENETC_QOS) += enetc_qos.o fsl-enetc-$(CONFIG_FSL_ENETC_QOS) += enetc_qos.o
obj-$(CONFIG_FSL_ENETC_VF) += fsl-enetc-vf.o obj-$(CONFIG_FSL_ENETC_VF) += fsl-enetc-vf.o
fsl-enetc-vf-y := enetc_vf.o $(common-objs) fsl-enetc-vf-y := enetc_vf.o
obj-$(CONFIG_FSL_ENETC_IERB) += fsl-enetc-ierb.o obj-$(CONFIG_FSL_ENETC_IERB) += fsl-enetc-ierb.o
fsl-enetc-ierb-y := enetc_ierb.o fsl-enetc-ierb-y := enetc_ierb.o
......
...@@ -651,6 +651,7 @@ netdev_tx_t enetc_xmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -651,6 +651,7 @@ netdev_tx_t enetc_xmit(struct sk_buff *skb, struct net_device *ndev)
return enetc_start_xmit(skb, ndev); return enetc_start_xmit(skb, ndev);
} }
EXPORT_SYMBOL_GPL(enetc_xmit);
static irqreturn_t enetc_msix(int irq, void *data) static irqreturn_t enetc_msix(int irq, void *data)
{ {
...@@ -1388,6 +1389,7 @@ int enetc_xdp_xmit(struct net_device *ndev, int num_frames, ...@@ -1388,6 +1389,7 @@ int enetc_xdp_xmit(struct net_device *ndev, int num_frames,
return xdp_tx_frm_cnt; return xdp_tx_frm_cnt;
} }
EXPORT_SYMBOL_GPL(enetc_xdp_xmit);
static void enetc_map_rx_buff_to_xdp(struct enetc_bdr *rx_ring, int i, static void enetc_map_rx_buff_to_xdp(struct enetc_bdr *rx_ring, int i,
struct xdp_buff *xdp_buff, u16 size) struct xdp_buff *xdp_buff, u16 size)
...@@ -1714,6 +1716,7 @@ void enetc_get_si_caps(struct enetc_si *si) ...@@ -1714,6 +1716,7 @@ void enetc_get_si_caps(struct enetc_si *si)
if (val & ENETC_SIPCAPR0_PSFP) if (val & ENETC_SIPCAPR0_PSFP)
si->hw_features |= ENETC_SI_F_PSFP; si->hw_features |= ENETC_SI_F_PSFP;
} }
EXPORT_SYMBOL_GPL(enetc_get_si_caps);
static int enetc_dma_alloc_bdr(struct enetc_bdr_resource *res) static int enetc_dma_alloc_bdr(struct enetc_bdr_resource *res)
{ {
...@@ -2029,6 +2032,7 @@ int enetc_configure_si(struct enetc_ndev_priv *priv) ...@@ -2029,6 +2032,7 @@ int enetc_configure_si(struct enetc_ndev_priv *priv)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(enetc_configure_si);
void enetc_init_si_rings_params(struct enetc_ndev_priv *priv) void enetc_init_si_rings_params(struct enetc_ndev_priv *priv)
{ {
...@@ -2048,6 +2052,7 @@ void enetc_init_si_rings_params(struct enetc_ndev_priv *priv) ...@@ -2048,6 +2052,7 @@ void enetc_init_si_rings_params(struct enetc_ndev_priv *priv)
priv->ic_mode = ENETC_IC_RX_ADAPTIVE | ENETC_IC_TX_MANUAL; priv->ic_mode = ENETC_IC_RX_ADAPTIVE | ENETC_IC_TX_MANUAL;
priv->tx_ictt = ENETC_TXIC_TIMETHR; priv->tx_ictt = ENETC_TXIC_TIMETHR;
} }
EXPORT_SYMBOL_GPL(enetc_init_si_rings_params);
int enetc_alloc_si_resources(struct enetc_ndev_priv *priv) int enetc_alloc_si_resources(struct enetc_ndev_priv *priv)
{ {
...@@ -2060,11 +2065,13 @@ int enetc_alloc_si_resources(struct enetc_ndev_priv *priv) ...@@ -2060,11 +2065,13 @@ int enetc_alloc_si_resources(struct enetc_ndev_priv *priv)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(enetc_alloc_si_resources);
void enetc_free_si_resources(struct enetc_ndev_priv *priv) void enetc_free_si_resources(struct enetc_ndev_priv *priv)
{ {
kfree(priv->cls_rules); kfree(priv->cls_rules);
} }
EXPORT_SYMBOL_GPL(enetc_free_si_resources);
static void enetc_setup_txbdr(struct enetc_hw *hw, struct enetc_bdr *tx_ring) static void enetc_setup_txbdr(struct enetc_hw *hw, struct enetc_bdr *tx_ring)
{ {
...@@ -2426,6 +2433,7 @@ void enetc_start(struct net_device *ndev) ...@@ -2426,6 +2433,7 @@ void enetc_start(struct net_device *ndev)
netif_tx_start_all_queues(ndev); netif_tx_start_all_queues(ndev);
} }
EXPORT_SYMBOL_GPL(enetc_start);
int enetc_open(struct net_device *ndev) int enetc_open(struct net_device *ndev)
{ {
...@@ -2487,6 +2495,7 @@ int enetc_open(struct net_device *ndev) ...@@ -2487,6 +2495,7 @@ int enetc_open(struct net_device *ndev)
return err; return err;
} }
EXPORT_SYMBOL_GPL(enetc_open);
void enetc_stop(struct net_device *ndev) void enetc_stop(struct net_device *ndev)
{ {
...@@ -2510,6 +2519,7 @@ void enetc_stop(struct net_device *ndev) ...@@ -2510,6 +2519,7 @@ void enetc_stop(struct net_device *ndev)
enetc_clear_interrupts(priv); enetc_clear_interrupts(priv);
} }
EXPORT_SYMBOL_GPL(enetc_stop);
int enetc_close(struct net_device *ndev) int enetc_close(struct net_device *ndev)
{ {
...@@ -2534,6 +2544,7 @@ int enetc_close(struct net_device *ndev) ...@@ -2534,6 +2544,7 @@ int enetc_close(struct net_device *ndev)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(enetc_close);
static int enetc_reconfigure(struct enetc_ndev_priv *priv, bool extended, static int enetc_reconfigure(struct enetc_ndev_priv *priv, bool extended,
int (*cb)(struct enetc_ndev_priv *priv, void *ctx), int (*cb)(struct enetc_ndev_priv *priv, void *ctx),
...@@ -2642,6 +2653,7 @@ int enetc_setup_tc_mqprio(struct net_device *ndev, void *type_data) ...@@ -2642,6 +2653,7 @@ int enetc_setup_tc_mqprio(struct net_device *ndev, void *type_data)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(enetc_setup_tc_mqprio);
static int enetc_reconfigure_xdp_cb(struct enetc_ndev_priv *priv, void *ctx) static int enetc_reconfigure_xdp_cb(struct enetc_ndev_priv *priv, void *ctx)
{ {
...@@ -2691,6 +2703,7 @@ int enetc_setup_bpf(struct net_device *ndev, struct netdev_bpf *bpf) ...@@ -2691,6 +2703,7 @@ int enetc_setup_bpf(struct net_device *ndev, struct netdev_bpf *bpf)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(enetc_setup_bpf);
struct net_device_stats *enetc_get_stats(struct net_device *ndev) struct net_device_stats *enetc_get_stats(struct net_device *ndev)
{ {
...@@ -2722,6 +2735,7 @@ struct net_device_stats *enetc_get_stats(struct net_device *ndev) ...@@ -2722,6 +2735,7 @@ struct net_device_stats *enetc_get_stats(struct net_device *ndev)
return stats; return stats;
} }
EXPORT_SYMBOL_GPL(enetc_get_stats);
static int enetc_set_rss(struct net_device *ndev, int en) static int enetc_set_rss(struct net_device *ndev, int en)
{ {
...@@ -2774,6 +2788,7 @@ void enetc_set_features(struct net_device *ndev, netdev_features_t features) ...@@ -2774,6 +2788,7 @@ void enetc_set_features(struct net_device *ndev, netdev_features_t features)
enetc_enable_txvlan(ndev, enetc_enable_txvlan(ndev,
!!(features & NETIF_F_HW_VLAN_CTAG_TX)); !!(features & NETIF_F_HW_VLAN_CTAG_TX));
} }
EXPORT_SYMBOL_GPL(enetc_set_features);
#ifdef CONFIG_FSL_ENETC_PTP_CLOCK #ifdef CONFIG_FSL_ENETC_PTP_CLOCK
static int enetc_hwtstamp_set(struct net_device *ndev, struct ifreq *ifr) static int enetc_hwtstamp_set(struct net_device *ndev, struct ifreq *ifr)
...@@ -2861,6 +2876,7 @@ int enetc_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) ...@@ -2861,6 +2876,7 @@ int enetc_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
return phylink_mii_ioctl(priv->phylink, rq, cmd); return phylink_mii_ioctl(priv->phylink, rq, cmd);
} }
EXPORT_SYMBOL_GPL(enetc_ioctl);
int enetc_alloc_msix(struct enetc_ndev_priv *priv) int enetc_alloc_msix(struct enetc_ndev_priv *priv)
{ {
...@@ -2962,6 +2978,7 @@ int enetc_alloc_msix(struct enetc_ndev_priv *priv) ...@@ -2962,6 +2978,7 @@ int enetc_alloc_msix(struct enetc_ndev_priv *priv)
return err; return err;
} }
EXPORT_SYMBOL_GPL(enetc_alloc_msix);
void enetc_free_msix(struct enetc_ndev_priv *priv) void enetc_free_msix(struct enetc_ndev_priv *priv)
{ {
...@@ -2991,6 +3008,7 @@ void enetc_free_msix(struct enetc_ndev_priv *priv) ...@@ -2991,6 +3008,7 @@ void enetc_free_msix(struct enetc_ndev_priv *priv)
/* disable all MSIX for this device */ /* disable all MSIX for this device */
pci_free_irq_vectors(priv->si->pdev); pci_free_irq_vectors(priv->si->pdev);
} }
EXPORT_SYMBOL_GPL(enetc_free_msix);
static void enetc_kfree_si(struct enetc_si *si) static void enetc_kfree_si(struct enetc_si *si)
{ {
...@@ -3080,6 +3098,7 @@ int enetc_pci_probe(struct pci_dev *pdev, const char *name, int sizeof_priv) ...@@ -3080,6 +3098,7 @@ int enetc_pci_probe(struct pci_dev *pdev, const char *name, int sizeof_priv)
return err; return err;
} }
EXPORT_SYMBOL_GPL(enetc_pci_probe);
void enetc_pci_remove(struct pci_dev *pdev) void enetc_pci_remove(struct pci_dev *pdev)
{ {
...@@ -3091,3 +3110,6 @@ void enetc_pci_remove(struct pci_dev *pdev) ...@@ -3091,3 +3110,6 @@ void enetc_pci_remove(struct pci_dev *pdev)
pci_release_mem_regions(pdev); pci_release_mem_regions(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
} }
EXPORT_SYMBOL_GPL(enetc_pci_remove);
MODULE_LICENSE("Dual BSD/GPL");
...@@ -44,6 +44,7 @@ int enetc_setup_cbdr(struct device *dev, struct enetc_hw *hw, int bd_count, ...@@ -44,6 +44,7 @@ int enetc_setup_cbdr(struct device *dev, struct enetc_hw *hw, int bd_count,
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(enetc_setup_cbdr);
void enetc_teardown_cbdr(struct enetc_cbdr *cbdr) void enetc_teardown_cbdr(struct enetc_cbdr *cbdr)
{ {
...@@ -57,6 +58,7 @@ void enetc_teardown_cbdr(struct enetc_cbdr *cbdr) ...@@ -57,6 +58,7 @@ void enetc_teardown_cbdr(struct enetc_cbdr *cbdr)
cbdr->bd_base = NULL; cbdr->bd_base = NULL;
cbdr->dma_dev = NULL; cbdr->dma_dev = NULL;
} }
EXPORT_SYMBOL_GPL(enetc_teardown_cbdr);
static void enetc_clean_cbdr(struct enetc_cbdr *ring) static void enetc_clean_cbdr(struct enetc_cbdr *ring)
{ {
...@@ -127,6 +129,7 @@ int enetc_send_cmd(struct enetc_si *si, struct enetc_cbd *cbd) ...@@ -127,6 +129,7 @@ int enetc_send_cmd(struct enetc_si *si, struct enetc_cbd *cbd)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(enetc_send_cmd);
int enetc_clear_mac_flt_entry(struct enetc_si *si, int index) int enetc_clear_mac_flt_entry(struct enetc_si *si, int index)
{ {
...@@ -140,6 +143,7 @@ int enetc_clear_mac_flt_entry(struct enetc_si *si, int index) ...@@ -140,6 +143,7 @@ int enetc_clear_mac_flt_entry(struct enetc_si *si, int index)
return enetc_send_cmd(si, &cbd); return enetc_send_cmd(si, &cbd);
} }
EXPORT_SYMBOL_GPL(enetc_clear_mac_flt_entry);
int enetc_set_mac_flt_entry(struct enetc_si *si, int index, int enetc_set_mac_flt_entry(struct enetc_si *si, int index,
char *mac_addr, int si_map) char *mac_addr, int si_map)
...@@ -165,6 +169,7 @@ int enetc_set_mac_flt_entry(struct enetc_si *si, int index, ...@@ -165,6 +169,7 @@ int enetc_set_mac_flt_entry(struct enetc_si *si, int index,
return enetc_send_cmd(si, &cbd); return enetc_send_cmd(si, &cbd);
} }
EXPORT_SYMBOL_GPL(enetc_set_mac_flt_entry);
/* Set entry in RFS table */ /* Set entry in RFS table */
int enetc_set_fs_entry(struct enetc_si *si, struct enetc_cmd_rfse *rfse, int enetc_set_fs_entry(struct enetc_si *si, struct enetc_cmd_rfse *rfse,
...@@ -197,6 +202,7 @@ int enetc_set_fs_entry(struct enetc_si *si, struct enetc_cmd_rfse *rfse, ...@@ -197,6 +202,7 @@ int enetc_set_fs_entry(struct enetc_si *si, struct enetc_cmd_rfse *rfse,
return err; return err;
} }
EXPORT_SYMBOL_GPL(enetc_set_fs_entry);
static int enetc_cmd_rss_table(struct enetc_si *si, u32 *table, int count, static int enetc_cmd_rss_table(struct enetc_si *si, u32 *table, int count,
bool read) bool read)
...@@ -242,9 +248,11 @@ int enetc_get_rss_table(struct enetc_si *si, u32 *table, int count) ...@@ -242,9 +248,11 @@ int enetc_get_rss_table(struct enetc_si *si, u32 *table, int count)
{ {
return enetc_cmd_rss_table(si, table, count, true); return enetc_cmd_rss_table(si, table, count, true);
} }
EXPORT_SYMBOL_GPL(enetc_get_rss_table);
/* Set RSS table */ /* Set RSS table */
int enetc_set_rss_table(struct enetc_si *si, const u32 *table, int count) int enetc_set_rss_table(struct enetc_si *si, const u32 *table, int count)
{ {
return enetc_cmd_rss_table(si, (u32 *)table, count, false); return enetc_cmd_rss_table(si, (u32 *)table, count, false);
} }
EXPORT_SYMBOL_GPL(enetc_set_rss_table);
...@@ -649,6 +649,7 @@ void enetc_set_rss_key(struct enetc_hw *hw, const u8 *bytes) ...@@ -649,6 +649,7 @@ void enetc_set_rss_key(struct enetc_hw *hw, const u8 *bytes)
for (i = 0; i < ENETC_RSSHASH_KEY_SIZE / 4; i++) for (i = 0; i < ENETC_RSSHASH_KEY_SIZE / 4; i++)
enetc_port_wr(hw, ENETC_PRSSK(i), ((u32 *)bytes)[i]); enetc_port_wr(hw, ENETC_PRSSK(i), ((u32 *)bytes)[i]);
} }
EXPORT_SYMBOL_GPL(enetc_set_rss_key);
static int enetc_set_rxfh(struct net_device *ndev, const u32 *indir, static int enetc_set_rxfh(struct net_device *ndev, const u32 *indir,
const u8 *key, const u8 hfunc) const u8 *key, const u8 hfunc)
...@@ -924,3 +925,4 @@ void enetc_set_ethtool_ops(struct net_device *ndev) ...@@ -924,3 +925,4 @@ void enetc_set_ethtool_ops(struct net_device *ndev)
else else
ndev->ethtool_ops = &enetc_vf_ethtool_ops; ndev->ethtool_ops = &enetc_vf_ethtool_ops;
} }
EXPORT_SYMBOL_GPL(enetc_set_ethtool_ops);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment