From patchwork Tue Jul 17 16:29:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Wu X-Patchwork-Id: 171476 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 C8ED62C008A for ; Wed, 18 Jul 2012 02:29:49 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752444Ab2GQQ3r (ORCPT ); Tue, 17 Jul 2012 12:29:47 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:50177 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751944Ab2GQQ3p (ORCPT ); Tue, 17 Jul 2012 12:29:45 -0400 Received: by eaak11 with SMTP id k11so241234eaa.19 for ; Tue, 17 Jul 2012 09:29:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:user-agent:mime-version :content-transfer-encoding:content-type; bh=4YLuxThqCIqPWTwesONBNYxoC224eVfWuyMvDgPyonM=; b=Wlv8aJv1CcogWTlMyIuQA5kmHVHUgJK9bCwyNZZjDglD3eixxNLjsDsaBMc6AKw9GT r6EPev+O6Q5f2YoMKot2H2yzFaWGuFvuFpnZIue/MmcI5htouDBazJdeR0VEirhcsR75 YpokUUyH1jW3TSVFU9ezK1g3DeEweWIU0DQBHfjS3DbSkFVuic22SPPejUQ+JCUxZSwq rZfi09niigp9jaqcdNe3TT1tWcaiPjN830R9PV3Pa5Gji4rwCOTzl9+6AE36eJJu3PeJ H9H1/gZQmgHIX+qMSKFN/QWxOgLbOqVmJswpqQXqqOhIRz0QNtJ3IUQJSQ8r/STYMY+k aOqA== Received: by 10.14.212.72 with SMTP id x48mr3873351eeo.26.1342542584694; Tue, 17 Jul 2012 09:29:44 -0700 (PDT) Received: from al.localnet (svr.lekensteyn.nl. [178.21.112.251]) by mx.google.com with ESMTPS id f45sm28959603eep.12.2012.07.17.09.29.42 (version=SSLv3 cipher=OTHER); Tue, 17 Jul 2012 09:29:43 -0700 (PDT) From: Lekensteyn To: Guo-Fu Tseng Cc: netdev@vger.kernel.org Subject: [PATCH] jme: netpoll support Date: Tue, 17 Jul 2012 18:29:34 +0200 Message-ID: <18143736.brt1iGhlQ1@al> User-Agent: KMail/4.8.4 (Linux/3.5.0-1-custom; KDE/4.8.4; x86_64; ; ) MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Peter Wu This patch adds the netpoll function to support netconsole. Tested and works fine on my "JMC250 PCI Express Gigabit Ethernet Controller" (PCI ID 0250). Signed-off-by: Peter Wu --- drivers/net/ethernet/jme.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c index 4ea6580..c911d88 100644 --- a/drivers/net/ethernet/jme.c +++ b/drivers/net/ethernet/jme.c @@ -2743,6 +2743,17 @@ jme_set_features(struct net_device *netdev, netdev_features_t features) return 0; } +#ifdef CONFIG_NET_POLL_CONTROLLER +static void jme_netpoll(struct net_device *dev) +{ + unsigned long flags; + + local_irq_save(flags); + jme_intr(dev->irq, dev); + local_irq_restore(flags); +} +#endif + static int jme_nway_reset(struct net_device *netdev) { @@ -2944,6 +2955,9 @@ static const struct net_device_ops jme_netdev_ops = { .ndo_tx_timeout = jme_tx_timeout, .ndo_fix_features = jme_fix_features, .ndo_set_features = jme_set_features, +#ifdef CONFIG_NET_POLL_CONTROLLER + .ndo_poll_controller = jme_netpoll, +#endif }; static int __devinit