From: Stephen Hemminger <shemminger@vyatta.com>
To: Roland Dreier <rdreier@cisco.com>
Cc: netdev@vger.kernel.org, general@lists.openfabrics.org,
David Miller <davem@davemloft.net>
Subject: [ofa-general] [PATCH 1/3] infiniband: amso100 convert to net_device_ops
Date: Mon, 5 Jan 2009 13:22:11 -0800 [thread overview]
Message-ID: <20090105132211.70baefb9@extreme> (raw)
In-Reply-To: <adawsd9mppk.fsf@cisco.com>
Convert to net_device_ops and remove leftover last_rx.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/infiniband/hw/amso1100/c2.c 2009-01-05 13:14:20.990323888 -0800
+++ b/drivers/infiniband/hw/amso1100/c2.c 2009-01-05 13:16:48.581570680 -0800
@@ -76,7 +76,6 @@ static irqreturn_t c2_interrupt(int irq,
static void c2_tx_timeout(struct net_device *netdev);
static int c2_change_mtu(struct net_device *netdev, int new_mtu);
static void c2_reset(struct c2_port *c2_port);
-static struct net_device_stats *c2_get_stats(struct net_device *netdev);
static struct pci_device_id c2_pci_table[] = {
{ PCI_DEVICE(0x18b8, 0xb001) },
@@ -531,7 +530,6 @@ static void c2_rx_interrupt(struct net_d
netif_rx(skb);
- netdev->last_rx = jiffies;
c2_port->netstats.rx_packets++;
c2_port->netstats.rx_bytes += buflen;
}
@@ -880,6 +878,17 @@ static int c2_change_mtu(struct net_devi
return ret;
}
+static const struct net_device_ops c2_netdev_ops = {
+ .ndo_open = c2_up,
+ .ndo_stop = c2_down,
+ .ndo_start_xmit = c2_xmit_frame,
+ .ndo_get_stats = c2_get_stats,
+ .ndo_tx_timeout = c2_tx_timeout,
+ .ndo_change_mtu = c2_change_mtu,
+ .ndo_set_mac_address = eth_mac_addr,
+ .ndo_validate_addr = eth_validate_addr,
+};
+
/* Initialize network device */
static struct net_device *c2_devinit(struct c2_dev *c2dev,
void __iomem * mmio_addr)
@@ -894,12 +903,7 @@ static struct net_device *c2_devinit(str
SET_NETDEV_DEV(netdev, &c2dev->pcidev->dev);
- netdev->open = c2_up;
- netdev->stop = c2_down;
- netdev->hard_start_xmit = c2_xmit_frame;
- netdev->get_stats = c2_get_stats;
- netdev->tx_timeout = c2_tx_timeout;
- netdev->change_mtu = c2_change_mtu;
+ netdev->netdev_ops = &c2_netdev_ops;
netdev->watchdog_timeo = C2_TX_TIMEOUT;
netdev->irq = c2dev->pcidev->irq;
--- a/drivers/infiniband/hw/amso1100/c2_provider.c 2009-01-05 13:14:20.978323767 -0800
+++ b/drivers/infiniband/hw/amso1100/c2_provider.c 2009-01-05 13:17:09.911803913 -0800
@@ -719,15 +719,16 @@ static int c2_pseudo_change_mtu(struct n
return ret;
}
+static const struct net_device_ops c2_netdev_ops = {
+ .ndo_open = c2_pseudo_up,
+ .ndo_stop = c2_pseudo_down,
+ .ndo_start_xmit = c2_pseudo_xmit_frame,
+ .ndo_change_mtu = c2_pseudo_change_mtu,
+};
+
static void setup(struct net_device *netdev)
{
- netdev->open = c2_pseudo_up;
- netdev->stop = c2_pseudo_down;
- netdev->hard_start_xmit = c2_pseudo_xmit_frame;
- netdev->get_stats = NULL;
- netdev->tx_timeout = NULL;
- netdev->set_mac_address = NULL;
- netdev->change_mtu = c2_pseudo_change_mtu;
+ netdev->netdev_ops = &c2_netdev_ops;
netdev->watchdog_timeo = 0;
netdev->type = ARPHRD_ETHER;
netdev->mtu = 1500;
next prev parent reply other threads:[~2009-01-05 21:22 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-05 20:14 [PATCH 0/8] More net_device ops Stephen Hemminger
2009-01-05 20:14 ` [PATCH 2/8] bonding: use net_device_ops Stephen Hemminger
2009-01-06 18:42 ` David Miller
2009-01-05 20:14 ` [PATCH 3/8] wireless: convert wireless ioctl to net_device_ops Stephen Hemminger
[not found] ` <20090105201514.442703045-ZtmgI6mnKB3QT0dZR+AlfA@public.gmane.org>
2009-01-06 18:42 ` David Miller
2009-01-05 20:14 ` [PATCH 4/8] dsa: convert " Stephen Hemminger
[not found] ` <20090106060705.GG4414@server.marvell.com>
2009-01-06 18:43 ` David Miller
2009-01-06 22:51 ` Stephen Hemminger
2009-01-07 0:45 ` David Miller
2009-01-05 20:14 ` [PATCH 5/8] virtio: " Stephen Hemminger
2009-01-06 9:40 ` Mark McLoughlin
2009-01-06 18:44 ` David Miller
2009-01-05 20:14 ` [PATCH 6/8] xen-netfront: " Stephen Hemminger
2009-01-06 0:17 ` Jeremy Fitzhardinge
2009-01-06 18:45 ` David Miller
2009-01-05 20:14 ` [PATCH 7/8] infiniband: driver API update Stephen Hemminger
2009-01-05 21:02 ` Roland Dreier
2009-01-05 21:22 ` Stephen Hemminger [this message]
2009-01-05 21:22 ` [ofa-general] [PATCH 2/3] infiniband: nes_nic convert to net_device_ops Stephen Hemminger
2009-01-05 21:23 ` [ofa-general] [PATCH 3/3] infiniband: ipoib " Stephen Hemminger
2009-01-06 5:07 ` Roland Dreier
2009-01-06 18:46 ` [ofa-general] " David Miller
2009-01-06 18:45 ` [ofa-general] Re: [PATCH 7/8] infiniband: driver API update David Miller
2009-01-05 20:14 ` [PATCH 8/8] sch_teql: convert to net_device_ops Stephen Hemminger
2009-01-06 18:46 ` David Miller
[not found] ` <20090105201514.192918670@vyatta.com>
2009-01-06 18:41 ` [PATCH 1/8] irda: convert to internal stats 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=20090105132211.70baefb9@extreme \
--to=shemminger@vyatta.com \
--cc=davem@davemloft.net \
--cc=general@lists.openfabrics.org \
--cc=netdev@vger.kernel.org \
--cc=rdreier@cisco.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).