[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063cc941fd2fac3d999b0020c1dce7bcc96e93c9.1555158087.git.igor.russkikh@aquantia.com>
Date: Sat, 13 Apr 2019 12:31:50 +0000
From: Igor Russkikh <Igor.Russkikh@...antia.com>
To: "David S . Miller" <davem@...emloft.net>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Nikita Danilov <Nikita.Danilov@...antia.com>,
Dmitry Bogdanov <Dmitry.Bogdanov@...antia.com>,
Igor Russkikh <Igor.Russkikh@...antia.com>,
Nikita Danilov <Nikita.Danilov@...antia.com>
Subject: [PATCH netnext 04/16] net: aquantia: link interrupt handling
functions
Define link interrupt handler and work task.
Signed-off-by: Nikita Danilov <ndanilov@...antia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@...antia.com>
---
.../net/ethernet/aquantia/atlantic/aq_nic.c | 25 +++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
index 059df86e8e37..da4916195655 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
@@ -161,6 +161,28 @@ static int aq_nic_update_link_status(struct aq_nic_s *self)
return 0;
}
+static void aq_nic_update_link_task_cb(struct work_struct *w)
+{
+ struct aq_nic_s *self = container_of(w, struct aq_nic_s,
+ link_update_task);
+
+ aq_nic_update_link_status(self);
+
+ self->aq_hw_ops->hw_irq_enable(self->aq_hw,
+ BIT(self->aq_nic_cfg.link_irq_vec));
+}
+
+static irqreturn_t aq_linkstate_isr(int irq, void *private)
+{
+ struct aq_nic_s *self = private;
+
+ if (!self)
+ return IRQ_NONE;
+
+ schedule_work(&self->link_update_task);
+ return IRQ_HANDLED;
+}
+
static void aq_nic_service_timer_cb(struct timer_list *t)
{
struct aq_nic_s *self = from_timer(self, t, service_timer);
@@ -297,6 +319,8 @@ int aq_nic_init(struct aq_nic_s *self)
self->aq_vecs > i; ++i, aq_vec = self->aq_vec[i])
aq_vec_init(aq_vec, self->aq_hw_ops, self->aq_hw);
+ INIT_WORK(&self->link_update_task, aq_nic_update_link_task_cb);
+
netif_carrier_off(self->ndev);
err_exit:
@@ -873,6 +897,7 @@ int aq_nic_stop(struct aq_nic_s *self)
netif_carrier_off(self->ndev);
del_timer_sync(&self->service_timer);
+ cancel_work_sync(&self->link_update_task);
self->aq_hw_ops->hw_irq_disable(self->aq_hw, AQ_CFG_IRQ_MASK);
--
2.17.1
Powered by blists - more mailing lists