linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Beregalov <a.beregalov@gmail.com>
To: David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org, Josh Boyer <jwboyer@linux.vnet.ibm.com>
Cc: Kumar Gala <galak@kernel.crashing.org>,
	subrata@linux.vnet.ibm.com,
	Linuxppc-dev <Linuxppc-dev@ozlabs.org>,
	linux-next <linux-next@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-net@vger.kernel.org, Greg KH <greg@kroah.com>,
	sachinp <sachinp@linux.vnet.ibm.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [BUILD FAILURE 04] Next April 9 : PPC64 randconfig [drivers/net/ibm_newemac/core.c]
Date: Fri, 10 Apr 2009 05:56:14 +0400	[thread overview]
Message-ID: <20090410015614.GA5781@orion> (raw)
In-Reply-To: <20090409143112.GA7538@yoda.jdub.homelinux.org>

On Thu, Apr 09, 2009 at 10:31:12AM -0400, Josh Boyer wrote:
> On Thu, Apr 09, 2009 at 09:28:23AM -0500, Kumar Gala wrote:
> >
> > On Apr 9, 2009, at 8:52 AM, Subrata Modak wrote:
> >
> >> Observed the following build error:
> >>
> >> CC      drivers/net/ibm_newemac/core.o
> >> drivers/net/ibm_newemac/core.c: In function ???emac_probe???:
> >> drivers/net/ibm_newemac/core.c:2831: error: ???struct net_device??? has no
> >> member named ???open???
> >> drivers/net/ibm_newemac/core.c:2834: error: ???struct net_device??? has no
> >> member named ???tx_timeout???
> >> drivers/net/ibm_newemac/core.c:2836: error: ???struct net_device??? has no
> >> member named ???stop???
> >> drivers/net/ibm_newemac/core.c:2837: error: ???struct net_device??? has no
> >> member named ???get_stats???
> >> drivers/net/ibm_newemac/core.c:2838: error: ???struct net_device??? has no
> >> member named ???set_multicast_list???
> >> drivers/net/ibm_newemac/core.c:2839: error: ???struct net_device??? has no
> >> member named ???do_ioctl???
> >> drivers/net/ibm_newemac/core.c:2841: error: ???struct net_device??? has no
> >> member named ???hard_start_xmit???
> >> drivers/net/ibm_newemac/core.c:2842: error: ???struct net_device??? has no
> >> member named ???change_mtu???
> >> drivers/net/ibm_newemac/core.c:2845: error: ???struct net_device??? has no
> >> member named ???hard_start_xmit???
> >> make[3]: *** [drivers/net/ibm_newemac/core.o] Error 1
> >> make[2]: *** [drivers/net/ibm_newemac] Error 2
> >> make[1]: *** [drivers/net] Error 2
> >> make: *** [drivers] Error 2
> >>
> >> Regards--
> >> Subrata
> >>
> >> <randconfig4-ppc64-next20090409.txt>
> >
> > This is because CONFIG_COMPAT_NET_DEV_OPS isnt set and needs to be for  
> > this driver to build.  I've asked the netdev guys about either fixing  
> > the driver or adding the proper thing to Kconfig to select  
> > CONFIG_COMPAT_NET_DEV_OPS.
> 
> Thanks!
> 
> If someone has pointers on what needs to be done to fix it, let me know.
> 

From: Alexander Beregalov <a.beregalov@gmail.com>
Subject: [PATCH] ibm_newemac: convert to netdev_ops


Reported-by: Subrata Modak <subrata@linux.vnet.ibm.com>
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
---

 drivers/net/ibm_newemac/core.c |   41 ++++++++++++++++++++++++++++-----------
 1 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c
index 77e4b5b..806533c 100644
--- a/drivers/net/ibm_newemac/core.c
+++ b/drivers/net/ibm_newemac/core.c
@@ -2686,6 +2686,32 @@ static int __devinit emac_init_config(struct emac_instance *dev)
 	return 0;
 }
 
+static const struct net_device_ops emac_netdev_ops = {
+	.ndo_open		= emac_open,
+	.ndo_stop		= emac_close,
+	.ndo_get_stats		= emac_stats,
+	.ndo_set_multicast_list	= emac_set_multicast_list,
+	.ndo_do_ioctl		= emac_ioctl,
+	.ndo_tx_timeout		= emac_tx_timeout,
+	.ndo_validate_addr	= eth_validate_addr,
+	.ndo_set_mac_address	= eth_mac_addr,
+	.ndo_start_xmit		= emac_start_xmit,
+	.ndo_change_mtu		= eth_change_mtu,
+};
+
+static const struct net_device_ops emac_gige_netdev_ops = {
+	.ndo_open		= emac_open,
+	.ndo_stop		= emac_close,
+	.ndo_get_stats		= emac_stats,
+	.ndo_set_multicast_list	= emac_set_multicast_list,
+	.ndo_do_ioctl		= emac_ioctl,
+	.ndo_tx_timeout		= emac_tx_timeout,
+	.ndo_validate_addr	= eth_validate_addr,
+	.ndo_set_mac_address	= eth_mac_addr,
+	.ndo_start_xmit		= emac_start_xmit_sg,
+	.ndo_change_mtu		= emac_change_mtu,
+};
+
 static int __devinit emac_probe(struct of_device *ofdev,
 				const struct of_device_id *match)
 {
@@ -2827,23 +2853,14 @@ static int __devinit emac_probe(struct of_device *ofdev,
 	if (err != 0)
 		goto err_detach_tah;
 
-	/* Fill in the driver function table */
-	ndev->open = &emac_open;
 	if (dev->tah_dev)
 		ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
-	ndev->tx_timeout = &emac_tx_timeout;
 	ndev->watchdog_timeo = 5 * HZ;
-	ndev->stop = &emac_close;
-	ndev->get_stats = &emac_stats;
-	ndev->set_multicast_list = &emac_set_multicast_list;
-	ndev->do_ioctl = &emac_ioctl;
 	if (emac_phy_supports_gige(dev->phy_mode)) {
-		ndev->hard_start_xmit = &emac_start_xmit_sg;
-		ndev->change_mtu = &emac_change_mtu;
+		ndev->netdev_ops = &emac_gige_netdev_ops;
 		dev->commac.ops = &emac_commac_sg_ops;
-	} else {
-		ndev->hard_start_xmit = &emac_start_xmit;
-	}
+	} else
+		ndev->netdev_ops = &emac_netdev_ops;
 	SET_ETHTOOL_OPS(ndev, &emac_ethtool_ops);
 
 	netif_carrier_off(ndev);

  reply	other threads:[~2009-04-10  1:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-09 13:52 [BUILD FAILURE 04] Next April 9 : PPC64 randconfig [drivers/net/ibm_newemac/core.c] Subrata Modak
2009-04-09 13:57 ` [BUILD FAILURE 05] Next April 9 : PPC64 randconfig [drivers/net/wan/wanxlfw.inc] Subrata Modak
2009-04-09 14:51   ` Geert Uytterhoeven
2009-04-09 15:24   ` [BUILD FAILURE 06] Next April 9 : PPC64 randconfig [drivers/usb/musb/musb_core.c] Subrata Modak
2009-04-09 15:24   ` [BUILD FAILURE 07] Next April 9 : PPC64 randconfig [drivers/scsi/aha1542.o] Subrata Modak
2009-04-09 15:28     ` [BUILD FAILURE 08] Next April 9 : PPC64 randconfig [drivers/net/pasemi_mac_driver.ko] Subrata Modak
2009-04-09 15:34       ` [BUILD FAILURE 09] Next April 9 : PPC64 randconfig [drivers/char/hvcs.ko] Subrata Modak
2009-04-09 14:28 ` [BUILD FAILURE 04] Next April 9 : PPC64 randconfig [drivers/net/ibm_newemac/core.c] Kumar Gala
2009-04-09 14:31   ` Josh Boyer
2009-04-10  1:56     ` Alexander Beregalov [this message]
2009-04-11  9:44       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090410015614.GA5781@orion \
    --to=a.beregalov@gmail.com \
    --cc=Linuxppc-dev@ozlabs.org \
    --cc=davem@davemloft.net \
    --cc=galak@kernel.crashing.org \
    --cc=greg@kroah.com \
    --cc=jwboyer@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-net@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sachinp@linux.vnet.ibm.com \
    --cc=sfr@canb.auug.org.au \
    --cc=subrata@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).