]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: bcmasp: clean up some legacy logic
authorJustin Chen <justin.chen@broadcom.com>
Thu, 22 Jan 2026 19:49:48 +0000 (11:49 -0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 27 Jan 2026 02:58:22 +0000 (18:58 -0800)
Removed wol_irq check. This was needed for brcm,asp-v2.0, which was
removed in previous commits.

Removed bcmasp_intf_ops. These function pointers were added to make
it easier to implement pseudo channels. These channels were removed
in newer versions of the hardware and were never implemented.

Signed-off-by: Justin Chen <justin.chen@broadcom.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20260122194949.1145107-2-justin.chen@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/asp2/bcmasp.c
drivers/net/ethernet/broadcom/asp2/bcmasp.h
drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c

index 014340f33345a0e1f475a64b56dec268e92c1ca5..36df7d1a9be35b2e0a0be8497d93d3bb8c19947f 100644 (file)
@@ -1081,15 +1081,10 @@ static irqreturn_t bcmasp_isr_wol(int irq, void *data)
        struct bcmasp_priv *priv = data;
        u32 status;
 
-       /* No L3 IRQ, so we good */
-       if (priv->wol_irq <= 0)
-               goto irq_handled;
-
        status = wakeup_intr2_core_rl(priv, ASP_WAKEUP_INTR2_STATUS) &
                ~wakeup_intr2_core_rl(priv, ASP_WAKEUP_INTR2_MASK_STATUS);
        wakeup_intr2_core_wl(priv, status, ASP_WAKEUP_INTR2_CLEAR);
 
-irq_handled:
        pm_wakeup_event(&priv->pdev->dev, 0);
        return IRQ_HANDLED;
 }
index e238507be40afd211a3247a950402881c9fbc401..29cd87335ec8007a4356e0db974cc7884ecb0ca4 100644 (file)
@@ -268,13 +268,6 @@ struct bcmasp_mib_counters {
        u32     tx_timeout_cnt;
 };
 
-struct bcmasp_intf_ops {
-       unsigned long (*rx_desc_read)(struct bcmasp_intf *intf);
-       void (*rx_buffer_write)(struct bcmasp_intf *intf, dma_addr_t addr);
-       void (*rx_desc_write)(struct bcmasp_intf *intf, dma_addr_t addr);
-       unsigned long (*tx_read)(struct bcmasp_intf *intf);
-       void (*tx_write)(struct bcmasp_intf *intf, dma_addr_t addr);
-};
 
 struct bcmasp_priv;
 
@@ -286,7 +279,6 @@ struct bcmasp_intf {
        /* ASP Ch */
        int                             channel;
        int                             port;
-       const struct bcmasp_intf_ops    *ops;
 
        /* Used for splitting shared resources */
        int                             index;
@@ -407,34 +399,6 @@ struct bcmasp_priv {
        struct mutex                    net_lock;
 };
 
-static inline unsigned long bcmasp_intf_rx_desc_read(struct bcmasp_intf *intf)
-{
-       return intf->ops->rx_desc_read(intf);
-}
-
-static inline void bcmasp_intf_rx_buffer_write(struct bcmasp_intf *intf,
-                                              dma_addr_t addr)
-{
-       intf->ops->rx_buffer_write(intf, addr);
-}
-
-static inline void bcmasp_intf_rx_desc_write(struct bcmasp_intf *intf,
-                                            dma_addr_t addr)
-{
-       intf->ops->rx_desc_write(intf, addr);
-}
-
-static inline unsigned long bcmasp_intf_tx_read(struct bcmasp_intf *intf)
-{
-       return intf->ops->tx_read(intf);
-}
-
-static inline void bcmasp_intf_tx_write(struct bcmasp_intf *intf,
-                                       dma_addr_t addr)
-{
-       intf->ops->tx_write(intf, addr);
-}
-
 #define __BCMASP_IO_MACRO(name, m)                                     \
 static inline u32 name##_rl(struct bcmasp_intf *intf, u32 off)         \
 {                                                                      \
index b9973956c48095347abddef457136c0fbd6278d6..6cddd3280cb8ad434e9f363b2879ef61a8e290d6 100644 (file)
@@ -231,39 +231,6 @@ help:
        return skb;
 }
 
-static unsigned long bcmasp_rx_edpkt_dma_rq(struct bcmasp_intf *intf)
-{
-       return rx_edpkt_dma_rq(intf, RX_EDPKT_DMA_VALID);
-}
-
-static void bcmasp_rx_edpkt_cfg_wq(struct bcmasp_intf *intf, dma_addr_t addr)
-{
-       rx_edpkt_cfg_wq(intf, addr, RX_EDPKT_RING_BUFFER_READ);
-}
-
-static void bcmasp_rx_edpkt_dma_wq(struct bcmasp_intf *intf, dma_addr_t addr)
-{
-       rx_edpkt_dma_wq(intf, addr, RX_EDPKT_DMA_READ);
-}
-
-static unsigned long bcmasp_tx_spb_dma_rq(struct bcmasp_intf *intf)
-{
-       return tx_spb_dma_rq(intf, TX_SPB_DMA_READ);
-}
-
-static void bcmasp_tx_spb_dma_wq(struct bcmasp_intf *intf, dma_addr_t addr)
-{
-       tx_spb_dma_wq(intf, addr, TX_SPB_DMA_VALID);
-}
-
-static const struct bcmasp_intf_ops bcmasp_intf_ops = {
-       .rx_desc_read = bcmasp_rx_edpkt_dma_rq,
-       .rx_buffer_write = bcmasp_rx_edpkt_cfg_wq,
-       .rx_desc_write = bcmasp_rx_edpkt_dma_wq,
-       .tx_read = bcmasp_tx_spb_dma_rq,
-       .tx_write = bcmasp_tx_spb_dma_wq,
-};
-
 static netdev_tx_t bcmasp_xmit(struct sk_buff *skb, struct net_device *dev)
 {
        struct bcmasp_intf *intf = netdev_priv(dev);
@@ -368,7 +335,7 @@ static netdev_tx_t bcmasp_xmit(struct sk_buff *skb, struct net_device *dev)
 
        skb_tx_timestamp(skb);
 
-       bcmasp_intf_tx_write(intf, intf->tx_spb_dma_valid);
+       tx_spb_dma_wq(intf, intf->tx_spb_dma_valid, TX_SPB_DMA_VALID);
 
        if (tx_spb_ring_full(intf, MAX_SKB_FRAGS + 1))
                netif_stop_queue(dev);
@@ -449,7 +416,7 @@ static int bcmasp_tx_reclaim(struct bcmasp_intf *intf)
        struct bcmasp_desc *desc;
        dma_addr_t mapping;
 
-       read = bcmasp_intf_tx_read(intf);
+       read = tx_spb_dma_rq(intf, TX_SPB_DMA_READ);
        while (intf->tx_spb_dma_read != read) {
                txcb = &intf->tx_cbs[intf->tx_spb_clean_index];
                mapping = dma_unmap_addr(txcb, dma_addr);
@@ -519,7 +486,7 @@ static int bcmasp_rx_poll(struct napi_struct *napi, int budget)
        u64 flags;
        u32 len;
 
-       valid = bcmasp_intf_rx_desc_read(intf) + 1;
+       valid = rx_edpkt_dma_rq(intf, RX_EDPKT_DMA_VALID) + 1;
        if (valid == intf->rx_edpkt_dma_addr + DESC_RING_SIZE)
                valid = intf->rx_edpkt_dma_addr;
 
@@ -591,8 +558,8 @@ static int bcmasp_rx_poll(struct napi_struct *napi, int budget)
                u64_stats_update_end(&stats->syncp);
 
 next:
-               bcmasp_intf_rx_buffer_write(intf, (DESC_ADDR(desc->buf) +
-                                           desc->size));
+               rx_edpkt_cfg_wq(intf, (DESC_ADDR(desc->buf) + desc->size),
+                               RX_EDPKT_RING_BUFFER_READ);
 
                processed++;
                intf->rx_edpkt_dma_read =
@@ -603,7 +570,7 @@ next:
                                                 DESC_RING_COUNT);
        }
 
-       bcmasp_intf_rx_desc_write(intf, intf->rx_edpkt_dma_read);
+       rx_edpkt_dma_wq(intf, intf->rx_edpkt_dma_read, RX_EDPKT_DMA_READ);
 
        if (processed < budget && napi_complete_done(&intf->rx_napi, processed))
                bcmasp_enable_rx_irq(intf, 1);
@@ -1271,7 +1238,6 @@ struct bcmasp_intf *bcmasp_interface_create(struct bcmasp_priv *priv,
        }
 
        SET_NETDEV_DEV(ndev, dev);
-       intf->ops = &bcmasp_intf_ops;
        ndev->netdev_ops = &bcmasp_netdev_ops;
        ndev->ethtool_ops = &bcmasp_ethtool_ops;
        intf->msg_enable = netif_msg_init(-1, NETIF_MSG_DRV |
@@ -1333,10 +1299,8 @@ static void bcmasp_suspend_to_wol(struct bcmasp_intf *intf)
 
        umac_enable_set(intf, UMC_CMD_RX_EN, 1);
 
-       if (intf->parent->wol_irq > 0) {
-               wakeup_intr2_core_wl(intf->parent, 0xffffffff,
-                                    ASP_WAKEUP_INTR2_MASK_CLEAR);
-       }
+       wakeup_intr2_core_wl(intf->parent, 0xffffffff,
+                            ASP_WAKEUP_INTR2_MASK_CLEAR);
 
        if (ndev->phydev && ndev->phydev->eee_cfg.eee_enabled &&
            intf->parent->eee_fixup)
@@ -1389,10 +1353,8 @@ static void bcmasp_resume_from_wol(struct bcmasp_intf *intf)
        reg &= ~UMC_MPD_CTRL_MPD_EN;
        umac_wl(intf, reg, UMC_MPD_CTRL);
 
-       if (intf->parent->wol_irq > 0) {
-               wakeup_intr2_core_wl(intf->parent, 0xffffffff,
-                                    ASP_WAKEUP_INTR2_MASK_SET);
-       }
+       wakeup_intr2_core_wl(intf->parent, 0xffffffff,
+                            ASP_WAKEUP_INTR2_MASK_SET);
 }
 
 int bcmasp_interface_resume(struct bcmasp_intf *intf)