All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH 4/9] fddi: convert to new network device ops
Date: Thu, 20 Nov 2008 09:59:17 -0800	[thread overview]
Message-ID: <20081120175933.837997092@vyatta.com> (raw)
In-Reply-To: 20081120175913.943543638@vyatta.com

[-- Attachment #1: fddi-netdev_ops.patch --]
[-- Type: text/plain, Size: 2851 bytes --]

Similar to ethernet. Convert infrastructure and the one lone FDDI
driver (for the one lone user of that hardware??). Compile tested only.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
 drivers/net/skfp/skfddi.c  |   19 ++++++++++++-------
 include/linux/fddidevice.h |    1 +
 net/802/fddi.c             |    8 ++++++--
 3 files changed, 19 insertions(+), 9 deletions(-)

--- a/net/802/fddi.c	2008-11-20 09:08:10.000000000 -0800
+++ b/net/802/fddi.c	2008-11-20 09:16:02.000000000 -0800
@@ -167,23 +167,27 @@ __be16 fddi_type_trans(struct sk_buff *s
 
 EXPORT_SYMBOL(fddi_type_trans);
 
-static int fddi_change_mtu(struct net_device *dev, int new_mtu)
+int fddi_change_mtu(struct net_device *dev, int new_mtu)
 {
 	if ((new_mtu < FDDI_K_SNAP_HLEN) || (new_mtu > FDDI_K_SNAP_DLEN))
 		return(-EINVAL);
 	dev->mtu = new_mtu;
 	return(0);
 }
+EXPORT_SYMBOL(fddi_change_mtu);
 
 static const struct header_ops fddi_header_ops = {
 	.create		= fddi_header,
 	.rebuild	= fddi_rebuild_header,
 };
 
+
 static void fddi_setup(struct net_device *dev)
 {
-	dev->change_mtu		= fddi_change_mtu;
 	dev->header_ops		= &fddi_header_ops;
+#ifdef CONFIG_COMPAT_NET_DEV_OPS
+	dev->change_mtu		= fddi_change_mtu,
+#endif
 
 	dev->type		= ARPHRD_FDDI;
 	dev->hard_header_len	= FDDI_K_SNAP_HLEN+3;	/* Assume 802.2 SNAP hdr len + 3 pad bytes */
--- a/include/linux/fddidevice.h	2008-11-20 09:08:10.000000000 -0800
+++ b/include/linux/fddidevice.h	2008-11-20 09:16:02.000000000 -0800
@@ -27,6 +27,7 @@
 #ifdef __KERNEL__
 extern __be16	fddi_type_trans(struct sk_buff *skb,
 				struct net_device *dev);
+extern int fddi_change_mtu(struct net_device *dev, int new_mtu);
 extern struct net_device *alloc_fddidev(int sizeof_priv);
 #endif
 
--- a/drivers/net/skfp/skfddi.c	2008-11-20 09:08:10.000000000 -0800
+++ b/drivers/net/skfp/skfddi.c	2008-11-20 09:17:53.000000000 -0800
@@ -168,6 +168,17 @@ static int num_boards;	/* total number o
 #define PRINTK(s, args...)
 #endif				// DRIVERDEBUG
 
+static const struct net_device_ops skfp_netdev_ops = {
+	.ndo_open		= skfp_open,
+	.ndo_stop		= skfp_close,
+	.ndo_start_xmit		= skfp_send_pkt,
+	.ndo_get_stats		= skfp_ctl_get_stats,
+	.ndo_change_mtu		= fddi_change_mtu,
+	.ndo_set_multicast_list = skfp_ctl_set_multicast_list,
+	.ndo_set_mac_address	= skfp_ctl_set_mac_address,
+	.ndo_do_ioctl		= skfp_ioctl,
+};
+
 /*
  * =================
  * = skfp_init_one =
@@ -253,13 +264,7 @@ static int skfp_init_one(struct pci_dev 
 	}
 
 	dev->irq = pdev->irq;
-	dev->get_stats = &skfp_ctl_get_stats;
-	dev->open = &skfp_open;
-	dev->stop = &skfp_close;
-	dev->hard_start_xmit = &skfp_send_pkt;
-	dev->set_multicast_list = &skfp_ctl_set_multicast_list;
-	dev->set_mac_address = &skfp_ctl_set_mac_address;
-	dev->do_ioctl = &skfp_ioctl;
+	dev->netdev_ops = &skfp_netdev_ops;
 
 	SET_NETDEV_DEV(dev, &pdev->dev);
 

-- 


  parent reply	other threads:[~2008-11-20 18:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-20 17:59 [PATCH 0/9] Netdevice ops second wave Stephen Hemminger
2008-11-20 17:59 ` [PATCH 1/9] netdev: add more functions to netdevice ops Stephen Hemminger
2008-11-21  4:27   ` David Miller
2008-11-20 17:59 ` [PATCH 2/9] dummy: convert to net_device_ops Stephen Hemminger
2008-11-21  4:28   ` David Miller
2008-11-20 17:59 ` [PATCH 3/9] ipmr: convert ipmr virtual interface " Stephen Hemminger
2008-11-21  4:29   ` David Miller
2008-11-20 17:59 ` Stephen Hemminger [this message]
2008-11-21  4:31   ` [PATCH 4/9] fddi: convert to new network device ops David Miller
2008-11-20 17:59 ` [PATCH 5/9] defxx: convert driver to net_device_ops Stephen Hemminger
2008-11-21  4:31   ` David Miller
2008-11-20 17:59 ` [PATCH 6/9] hippi: " Stephen Hemminger
2008-11-21  4:32   ` David Miller
2008-11-20 17:59 ` [PATCH 7/9] ipip: convert " Stephen Hemminger
2008-11-21  4:33   ` David Miller
2008-11-20 17:59 ` [PATCH 8/9] ipv6: convert tunnels " Stephen Hemminger
2008-11-21  4:34   ` David Miller
2008-11-20 17:59 ` [PATCH 9/9] ipgre: convert to netdevice_ops Stephen Hemminger
2008-11-21  4:34   ` 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=20081120175933.837997092@vyatta.com \
    --to=shemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.