[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5f47e2fb-2243-4aa6-4173-59e1ec014298@gmail.com>
Date: Thu, 21 Dec 2017 21:50:46 +0100
From: Heiner Kallweit <hkallweit1@...il.com>
To: Andrew Lunn <andrew@...n.ch>,
Realtek linux nic maintainers <nic_swsd@...ltek.com>,
Chun-Hao Lin <hau@...ltek.com>
Cc: David Miller <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: [PATCH RFC 15/18] r8168: remove rtl_phy_work and rtl8168_phy_timer
Remove further code which is replaced by phylib.
Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
---
drivers/net/ethernet/realtek/r8168.c | 60 ------------------------------------
1 file changed, 60 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8168.c b/drivers/net/ethernet/realtek/r8168.c
index f88fc0fa0..91191d178 100644
--- a/drivers/net/ethernet/realtek/r8168.c
+++ b/drivers/net/ethernet/realtek/r8168.c
@@ -752,7 +752,6 @@ enum rtl_flag {
RTL_FLAG_TASK_ENABLED,
RTL_FLAG_TASK_SLOW_PENDING,
RTL_FLAG_TASK_RESET_PENDING,
- RTL_FLAG_TASK_PHY_PENDING,
RTL_FLAG_MAX
};
@@ -781,7 +780,6 @@ struct rtl8168_private {
dma_addr_t RxPhyAddr;
void *Rx_databuff[NUM_RX_DESC]; /* Rx data buffers */
struct ring_info tx_skb[NUM_TX_DESC]; /* Tx data buffers */
- struct timer_list timer;
u16 cp_cmd;
u16 event_slow;
@@ -1559,24 +1557,6 @@ static void rtl8168_irq_mask_and_ack(struct rtl8168_private *tp)
RTL_R8(ChipCmd);
}
-static unsigned int rtl8168_xmii_reset_pending(struct rtl8168_private *tp)
-{
- return rtl_readphy(tp, MII_BMCR) & BMCR_RESET;
-}
-
-static unsigned int rtl8168_xmii_link_ok(void __iomem *ioaddr)
-{
- return RTL_R8(PHYstatus) & LinkStatus;
-}
-
-static void rtl8168_xmii_reset_enable(struct rtl8168_private *tp)
-{
- unsigned int val;
-
- val = rtl_readphy(tp, MII_BMCR) | BMCR_RESET;
- rtl_writephy(tp, MII_BMCR, val & 0xffff);
-}
-
static void rtl_link_chg_patch(struct rtl8168_private *tp)
{
void __iomem *ioaddr = tp->mmio_addr;
@@ -4131,47 +4111,12 @@ static void rtl_hw_phy_config(struct net_device *dev)
}
}
-static void rtl_phy_work(struct rtl8168_private *tp)
-{
- struct timer_list *timer = &tp->timer;
- void __iomem *ioaddr = tp->mmio_addr;
- unsigned long timeout = RTL8168_PHY_TIMEOUT;
-
- assert(tp->mac_version > RTL_GIGA_MAC_VER_01);
-
- if (rtl8168_xmii_reset_pending(tp)) {
- /*
- * A busy loop could burn quite a few cycles on nowadays CPU.
- * Let's delay the execution of the timer for a few ticks.
- */
- timeout = HZ/10;
- goto out_mod_timer;
- }
-
- if (rtl8168_xmii_link_ok(ioaddr))
- return;
-
- netif_dbg(tp, link, tp->dev, "PHY reset until link up\n");
-
- rtl8168_xmii_reset_enable(tp);
-
-out_mod_timer:
- mod_timer(timer, jiffies + timeout);
-}
-
static void rtl_schedule_task(struct rtl8168_private *tp, enum rtl_flag flag)
{
if (!test_and_set_bit(flag, tp->wk.flags))
schedule_work(&tp->wk.work);
}
-static void rtl8168_phy_timer(struct timer_list *t)
-{
- struct rtl8168_private *tp = from_timer(tp, t, timer);
-
- rtl_schedule_task(tp, RTL_FLAG_TASK_PHY_PENDING);
-}
-
static void rtl8168_init_phy(struct net_device *dev, struct rtl8168_private *tp)
{
rtl_hw_phy_config(dev);
@@ -7120,7 +7065,6 @@ static void rtl_task(struct work_struct *work)
/* XXX - keep rtl_slow_event_work() as first element. */
{ RTL_FLAG_TASK_SLOW_PENDING, rtl_slow_event_work },
{ RTL_FLAG_TASK_RESET_PENDING, rtl_reset_work },
- { RTL_FLAG_TASK_PHY_PENDING, rtl_phy_work }
};
struct rtl8168_private *tp =
container_of(work, struct rtl8168_private, wk.work);
@@ -7184,8 +7128,6 @@ static void rtl8168_down(struct net_device *dev)
phy_stop(dev->phydev);
- del_timer_sync(&tp->timer);
-
napi_disable(&tp->napi);
netif_stop_queue(dev);
@@ -8076,8 +8018,6 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
tp->opts1_mask = ~(RxBOVF | RxFOVF);
- timer_setup(&tp->timer, rtl8168_phy_timer, 0);
-
tp->rtl_fw = RTL_FIRMWARE_UNKNOWN;
tp->counters = dmam_alloc_coherent (&pdev->dev, sizeof(*tp->counters),
--
2.15.1
Powered by blists - more mailing lists