struct mii_regs {
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
-@@ -269,7 +269,10 @@ static int socfpga_dwmac_set_phy_mode(st
+@@ -270,7 +270,10 @@ static int socfpga_dwmac_set_phy_mode(st
ctrl &= ~(SYSMGR_EMACGRP_CTRL_PHYSEL_MASK << reg_shift);
ctrl |= val << reg_shift;
}
static void print_pkt(unsigned char *buf, int len)
-@@ -783,7 +794,7 @@ static void stmmac_adjust_link(struct ne
+@@ -789,7 +800,7 @@ static void stmmac_adjust_link(struct ne
struct stmmac_priv *priv = netdev_priv(dev);
struct phy_device *phydev = dev->phydev;
unsigned long flags;
if (!phydev)
return;
-@@ -796,8 +807,8 @@ static void stmmac_adjust_link(struct ne
+@@ -802,8 +813,8 @@ static void stmmac_adjust_link(struct ne
/* Now we make sure that we can be in full duplex mode.
* If not, we operate in half-duplex mode. */
if (phydev->duplex != priv->oldduplex) {
ctrl &= ~priv->hw->link.duplex;
else
ctrl |= priv->hw->link.duplex;
-@@ -808,30 +819,17 @@ static void stmmac_adjust_link(struct ne
+@@ -814,30 +825,17 @@ static void stmmac_adjust_link(struct ne
stmmac_mac_flow_ctrl(priv, phydev->duplex);
if (phydev->speed != priv->speed) {
break;
default:
netif_warn(priv, link, priv->dev,
-@@ -847,12 +845,12 @@ static void stmmac_adjust_link(struct ne
+@@ -853,12 +851,12 @@ static void stmmac_adjust_link(struct ne
writel(ctrl, priv->ioaddr + MAC_CTRL_REG);
if (!priv->oldlink) {
priv->speed = SPEED_UNKNOWN;
priv->oldduplex = DUPLEX_UNKNOWN;
}
-@@ -915,7 +913,7 @@ static int stmmac_init_phy(struct net_de
+@@ -921,7 +919,7 @@ static int stmmac_init_phy(struct net_de
char bus_id[MII_BUS_ID_SIZE];
int interface = priv->plat->interface;
int max_speed = priv->plat->max_speed;
priv->speed = SPEED_UNKNOWN;
priv->oldduplex = DUPLEX_UNKNOWN;
-@@ -1450,7 +1448,7 @@ static void free_dma_rx_desc_resources(s
+@@ -1456,7 +1454,7 @@ static void free_dma_rx_desc_resources(s
static void free_dma_tx_desc_resources(struct stmmac_priv *priv)
{
u32 tx_count = priv->plat->tx_queues_to_use;
/* Free TX queue resources */
for (queue = 0; queue < tx_count; queue++) {
-@@ -1499,7 +1497,7 @@ static int alloc_dma_rx_desc_resources(s
+@@ -1505,7 +1503,7 @@ static int alloc_dma_rx_desc_resources(s
sizeof(dma_addr_t),
GFP_KERNEL);
if (!rx_q->rx_skbuff_dma)
rx_q->rx_skbuff = kmalloc_array(DMA_RX_SIZE,
sizeof(struct sk_buff *),
-@@ -1562,13 +1560,13 @@ static int alloc_dma_tx_desc_resources(s
+@@ -1568,13 +1566,13 @@ static int alloc_dma_tx_desc_resources(s
sizeof(*tx_q->tx_skbuff_dma),
GFP_KERNEL);
if (!tx_q->tx_skbuff_dma)
if (priv->extend_desc) {
tx_q->dma_etx = dma_zalloc_coherent(priv->device,
-@@ -1578,7 +1576,7 @@ static int alloc_dma_tx_desc_resources(s
+@@ -1584,7 +1582,7 @@ static int alloc_dma_tx_desc_resources(s
&tx_q->dma_tx_phy,
GFP_KERNEL);
if (!tx_q->dma_etx)
} else {
tx_q->dma_tx = dma_zalloc_coherent(priv->device,
DMA_TX_SIZE *
-@@ -1587,13 +1585,13 @@ static int alloc_dma_tx_desc_resources(s
+@@ -1593,13 +1591,13 @@ static int alloc_dma_tx_desc_resources(s
&tx_q->dma_tx_phy,
GFP_KERNEL);
if (!tx_q->dma_tx)
free_dma_tx_desc_resources(priv);
return ret;
-@@ -2895,8 +2893,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -2907,8 +2905,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
priv->xstats.tx_set_ic_bit++;
}
if (unlikely((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) &&
priv->hwts_tx_en)) {
-@@ -2974,7 +2971,7 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -2993,7 +2990,7 @@ static netdev_tx_t stmmac_xmit(struct sk
/* Manage oversized TCP frames for GMAC4 device */
if (skb_is_gso(skb) && priv->tso) {
return stmmac_tso_xmit(skb, dev);
}
-@@ -3105,8 +3102,7 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -3124,8 +3121,7 @@ static netdev_tx_t stmmac_xmit(struct sk
priv->xstats.tx_set_ic_bit++;
}
/* Ready to fill the first descriptor and set the OWN bit w/o any
* problems because all the descriptors are actually ready to be
-@@ -3983,7 +3979,9 @@ static int stmmac_hw_init(struct stmmac_
+@@ -4002,7 +3998,9 @@ static int stmmac_hw_init(struct stmmac_
struct mac_device_info *mac;
/* Identify the MAC HW device */
priv->dev->priv_flags |= IFF_UNICAST_FLT;
mac = dwmac1000_setup(priv->ioaddr,
priv->plat->multicast_filter_bins,
-@@ -4003,6 +4001,10 @@ static int stmmac_hw_init(struct stmmac_
+@@ -4022,6 +4020,10 @@ static int stmmac_hw_init(struct stmmac_
priv->hw = mac;
/* To use the chained or ring mode */
if (priv->synopsys_id >= DWMAC_CORE_4_00) {
priv->hw->mode = &dwmac4_ring_mode_ops;
-@@ -4131,8 +4133,15 @@ int stmmac_dvr_probe(struct device *devi
+@@ -4150,8 +4152,15 @@ int stmmac_dvr_probe(struct device *devi
if ((phyaddr >= 0) && (phyaddr <= 31))
priv->plat->phy_addr = phyaddr;
/* Init MAC and get the capabilities */
ret = stmmac_hw_init(priv);
-@@ -4149,7 +4158,7 @@ int stmmac_dvr_probe(struct device *devi
+@@ -4168,7 +4177,7 @@ int stmmac_dvr_probe(struct device *devi
NETIF_F_RXCSUM;
if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) {
priv->tso = true;
dev_info(priv->device, "TSO feature enabled\n");
}
-@@ -4311,7 +4320,7 @@ int stmmac_suspend(struct device *dev)
+@@ -4330,7 +4339,7 @@ int stmmac_suspend(struct device *dev)
}
spin_unlock_irqrestore(&priv->lock, flags);
int phy_addr;
};
--struct stmmac_pci_info {
++struct stmmac_pci_dmi_data {
++ const struct stmmac_pci_func_data *func;
++ size_t nfuncs;
++};
++
+ struct stmmac_pci_info {
- struct pci_dev *pdev;
- int (*setup)(struct plat_stmmacenet_data *plat,
- struct stmmac_pci_info *info);
- struct stmmac_pci_dmi_data *dmi;
-+struct stmmac_pci_dmi_data {
-+ const struct stmmac_pci_func_data *func;
-+ size_t nfuncs;
++ int (*setup)(struct pci_dev *pdev, struct plat_stmmacenet_data *plat);
};
-static int stmmac_pci_find_phy_addr(struct stmmac_pci_info *info)
--{
++static int stmmac_pci_find_phy_addr(struct pci_dev *pdev,
++ const struct dmi_system_id *dmi_list)
+ {
- const char *name = dmi_get_system_info(DMI_BOARD_NAME);
- const char *asset_tag = dmi_get_system_info(DMI_BOARD_ASSET_TAG);
- unsigned int func = PCI_FUNC(info->pdev->devfn);
- */
- if (!name)
- return 1;
-+struct stmmac_pci_info {
-+ int (*setup)(struct pci_dev *pdev, struct plat_stmmacenet_data *plat);
-+};
-
+-
- for (dmi = info->dmi; dmi->name && *dmi->name; dmi++) {
- if (!strcmp(dmi->name, name) && dmi->func == func) {
- /* If asset tag is provided, match on it as well. */
- return dmi->phy_addr;
- }
- }
-+static int stmmac_pci_find_phy_addr(struct pci_dev *pdev,
-+ const struct dmi_system_id *dmi_list)
-+{
+ const struct stmmac_pci_func_data *func_data;
+ const struct stmmac_pci_dmi_data *dmi_data;
+ const struct dmi_system_id *dmi_id;
pci_enable_msi(pdev);
-@@ -270,14 +304,21 @@ static void stmmac_pci_remove(struct pci
+@@ -306,14 +340,21 @@ static int stmmac_pci_resume(struct devi
- static SIMPLE_DEV_PM_OPS(stmmac_pm_ops, stmmac_suspend, stmmac_resume);
+ static SIMPLE_DEV_PM_OPS(stmmac_pm_ops, stmmac_pci_suspend, stmmac_pci_resume);
-#define STMMAC_VENDOR_ID 0x700
+/* synthetic ID, no official vendor */