From patchwork Mon Jan 4 18:32:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Ceuleers X-Patchwork-Id: 42082 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 51392B7B71 for ; Tue, 5 Jan 2010 05:32:44 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753534Ab0ADScj (ORCPT ); Mon, 4 Jan 2010 13:32:39 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753409Ab0ADScj (ORCPT ); Mon, 4 Jan 2010 13:32:39 -0500 Received: from mailrelay006.isp.belgacom.be ([195.238.6.172]:23099 "EHLO mailrelay006.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752457Ab0ADSci (ORCPT ); Mon, 4 Jan 2010 13:32:38 -0500 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArMEADvCQUtXQJaf/2dsb2JhbACBRdQphDAE Received: from 159.150-64-87.adsl-dyn.isp.belgacom.be (HELO via.xperim.be) ([87.64.150.159]) by relay.skynet.be with ESMTP; 04 Jan 2010 19:32:36 +0100 Received: from [192.168.1.6] (wendy.xperim.be [192.168.1.6]) by via.xperim.be (8.14.2/8.14.2/Debian-2build1) with ESMTP id o04IWWlY015691; Mon, 4 Jan 2010 19:32:33 +0100 Message-ID: <4B423440.6060807@computer.org> Date: Mon, 04 Jan 2010 19:32:32 +0100 From: Jan Ceuleers User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: netdev@vger.kernel.org CC: David Miller , =?ISO-8859-1?Q?St=E9phane_Berth?= =?ISO-8859-1?Q?elot?= Subject: [PATCH] via-velocity: add netpoll functionality for the benefit of netconsole Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In February 2008, Stéphane Bertelot submitted a patch to netdev adding netpoll functionality to the via-velocity driver so that netconsole could be used with it. There was no discussion at the time and the patch was not committed to mainline. I'd like to try again with this version, which has been ported to the current code base. --------------------- This patch is a port to net-next-2.6 of a submission by Stéphane Bertelot in February 2008. Signed-off-by: Stéphane Berthelot Signed-off-by: Jan Ceuleers --- drivers/net/via-velocity.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 4ceb441..90718f5 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c @@ -2216,6 +2216,20 @@ static irqreturn_t velocity_intr(int irq, void *dev_instance) } /** + * velocity_poll_controller - netpoll controller + * @dev: network device + * + * Used by netconsole and other diagnostic tools to allow network + * i/o with interrupts disabled. + */ +static void velocity_poll_controller(struct net_device *dev) +{ + disable_irq(dev->irq); + velocity_intr(dev->irq, dev); + enable_irq(dev->irq); +} + +/** * velocity_open - interface activation callback * @dev: network layer device to open * @@ -2628,6 +2642,9 @@ static const struct net_device_ops velocity_netdev_ops = { .ndo_vlan_rx_add_vid = velocity_vlan_rx_add_vid, .ndo_vlan_rx_kill_vid = velocity_vlan_rx_kill_vid, .ndo_vlan_rx_register = velocity_vlan_rx_register, +#ifdef CONFIG_NET_POLL_CONTROLLER + .ndo_poll_controller = velocity_poll_controller, +#endif }; /**