62 lines
2.4 KiB
Diff
62 lines
2.4 KiB
Diff
diff --git a/drivers/net/ethernet/qualcomm/ipqess/ipqess.h b/drivers/net/ethernet/qualcomm/ipqess/ipqess.h
|
|
--- a/drivers/net/ethernet/qualcomm/ipqess/ipqess.h
|
|
+++ b/drivers/net/ethernet/qualcomm/ipqess/ipqess.h
|
|
@@ -162,7 +162,8 @@ struct ipqess_rx_ring {
|
|
struct ipqess {
|
|
- struct net_device *netdev;
|
|
+ struct net_device *netdev;
|
|
+ int gmac_id;
|
|
void __iomem *hw_addr;
|
|
|
|
struct clk *ess_clk;
|
|
diff --git a/drivers/net/ethernet/qualcomm/ipqess/ipqess.c b/drivers/net/ethernet/qualcomm/ipqess/ipqess.c
|
|
--- a/drivers/net/ethernet/qualcomm/ipqess/ipqess.c
|
|
+++ b/drivers/net/ethernet/qualcomm/ipqess/ipqess.c
|
|
@@ -101,7 +101,7 @@ static int ipqess_tx_ring_alloc(struct ipqess *ess)
|
|
tx_ring->ess = ess;
|
|
tx_ring->ring_id = i;
|
|
tx_ring->idx = i * 4;
|
|
tx_ring->count = IPQESS_TX_RING_SIZE;
|
|
- tx_ring->nq = netdev_get_tx_queue(ess->netdev, i);
|
|
+ tx_ring->nq = netdev_get_tx_queue(ess->netdev[ess->gmac_id], i);
|
|
|
|
size = sizeof(struct ipqess_buf) * IPQESS_TX_RING_SIZE;
|
|
tx_ring->buf = devm_kzalloc(dev, size, GFP_KERNEL);
|
|
@@ -474,7 +474,7 @@ static void ipqess_tx_complete(struct ipqess_tx_ring *tx_ring)
|
|
if (netif_tx_queue_stopped(tx_ring->nq)) {
|
|
- netdev_dbg(tx_ring->ess->netdev, "waking up tx queue %d\n",
|
|
+ netdev_dbg(tx_ring->ess->netdev[tx_ring->ess->gmac_id], "waking up tx queue %d\n",
|
|
tx_ring->idx);
|
|
netif_tx_wake_queue(tx_ring->nq);
|
|
}
|
|
@@ -968,7 +968,10 @@ static int ipqess_netdevice_event(struct notifier_block *nb,
|
|
struct ipqess *ess = container_of(nb, struct ipqess, netdev_notifier);
|
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
|
struct netdev_notifier_changeupper_info *info;
|
|
+ int i;
|
|
|
|
- if (dev != ess->netdev)
|
|
+ for (i = 0; i < 2; i++)
|
|
+ if (dev == ess->netdev[i])
|
|
+ break;
|
|
+ if (i == 2)
|
|
return NOTIFY_DONE;
|
|
|
|
switch (event) {
|
|
@@ -1180,8 +1180,9 @@ static int ipqess_axi_probe(struct platform_device *pdev)
|
|
ess = netdev_priv(netdev);
|
|
- ess->netdev = netdev;
|
|
+ ess->netdev = netdev;
|
|
+ ess->gmac_id = 0;
|
|
ess->pdev = pdev;
|
|
spin_lock_init(&ess->stats_lock);
|
|
SET_NETDEV_DEV(netdev, &pdev->dev);
|
|
@@ -1301,7 +1301,7 @@ static void ipqess_axi_remove(struct platform_device *pdev)
|
|
const struct net_device *netdev = platform_get_drvdata(pdev);
|
|
struct ipqess *ess = netdev_priv(netdev);
|
|
|
|
- unregister_netdev(ess->netdev);
|
|
+ unregister_netdev(ess->netdev[ess->gmac_id]);
|
|
ipqess_hw_stop(ess);
|
|
|
|
ipqess_tx_ring_free(ess);
|