From: Grant Likely <grant.likely@secretlab.ca>
To: netdev@vger.kernel.org, linuxppc-dev@ozlabs.org
Cc: olof@lixom.net, afleming@freescale.com,
Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Subject: [PATCH 02/14] net/fec_mpc52xx: Migrate to net_device_ops.
Date: Tue, 31 Mar 2009 02:26:54 -0600 [thread overview]
Message-ID: <20090331082654.1427.66471.stgit@localhost.localdomain> (raw)
In-Reply-To: <20090331075537.1427.7819.stgit@localhost.localdomain>
From: Grant Likely <grant.likely@secretlab.ca>
Since not using net_device_ops gets you shunned out the cool crowd,
this patch modifies the fec_mpc52xx Ethernet driver to provide the
management hooks via a struct net_device_ops.
Reported-by: Henk Stegeman <henk.stegeman@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
drivers/net/fec_mpc52xx.c | 35 +++++++++++++++++++----------------
1 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index f99463f..75d0569 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -371,7 +371,7 @@ static int mpc52xx_fec_close(struct net_device *dev)
* invariant will hold if you make sure that the netif_*_queue()
* calls are done at the proper times.
*/
-static int mpc52xx_fec_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
+static int mpc52xx_fec_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct mpc52xx_fec_priv *priv = netdev_priv(dev);
struct bcom_fec_bd *bd;
@@ -379,7 +379,7 @@ static int mpc52xx_fec_hard_start_xmit(struct sk_buff *skb, struct net_device *d
if (bcom_queue_full(priv->tx_dmatsk)) {
if (net_ratelimit())
dev_err(&dev->dev, "transmit queue overrun\n");
- return 1;
+ return NETDEV_TX_BUSY;
}
spin_lock_irq(&priv->lock);
@@ -400,7 +400,7 @@ static int mpc52xx_fec_hard_start_xmit(struct sk_buff *skb, struct net_device *d
spin_unlock_irq(&priv->lock);
- return 0;
+ return NETDEV_TX_OK;
}
#ifdef CONFIG_NET_POLL_CONTROLLER
@@ -890,6 +890,21 @@ static int mpc52xx_fec_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
return mpc52xx_fec_phy_mii_ioctl(priv, if_mii(rq), cmd);
}
+static const struct net_device_ops mpc52xx_fec_netdev_ops = {
+ .ndo_open = mpc52xx_fec_open,
+ .ndo_stop = mpc52xx_fec_close,
+ .ndo_start_xmit = mpc52xx_fec_start_xmit,
+ .ndo_set_multicast_list = mpc52xx_fec_set_multicast_list,
+ .ndo_set_mac_address = mpc52xx_fec_set_mac_address,
+ .ndo_validate_addr = eth_validate_addr,
+ .ndo_do_ioctl = mpc52xx_fec_ioctl,
+ .ndo_tx_timeout = mpc52xx_fec_tx_timeout,
+ .ndo_get_stats = mpc52xx_fec_get_stats,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = mpc52xx_fec_poll_controller,
+#endif
+};
+
/* ======================================================================== */
/* OF Driver */
/* ======================================================================== */
@@ -934,22 +949,10 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
return -EBUSY;
/* Init ether ndev with what we have */
- ndev->open = mpc52xx_fec_open;
- ndev->stop = mpc52xx_fec_close;
- ndev->hard_start_xmit = mpc52xx_fec_hard_start_xmit;
- ndev->do_ioctl = mpc52xx_fec_ioctl;
+ ndev->netdev_ops = &mpc52xx_fec_netdev_ops;
ndev->ethtool_ops = &mpc52xx_fec_ethtool_ops;
- ndev->get_stats = mpc52xx_fec_get_stats;
- ndev->set_mac_address = mpc52xx_fec_set_mac_address;
- ndev->set_multicast_list = mpc52xx_fec_set_multicast_list;
- ndev->tx_timeout = mpc52xx_fec_tx_timeout;
ndev->watchdog_timeo = FEC_WATCHDOG_TIMEOUT;
ndev->base_addr = mem.start;
-#ifdef CONFIG_NET_POLL_CONTROLLER
- ndev->poll_controller = mpc52xx_fec_poll_controller;
-#endif
-
- priv->t_irq = priv->r_irq = ndev->irq = NO_IRQ; /* IRQ are free for now */
spin_lock_init(&priv->lock);
WARNING: multiple messages have this Message-ID (diff)
From: Grant Likely <grant.likely@secretlab.ca>
To: netdev@vger.kernel.org, linuxppc-dev@ozlabs.org
Cc: olof@lixom.net, afleming@freescale.com,
galak@kernel.crashing.org,
Anton Vorontsov <avorontsov@ru.mvista.com>,
Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Subject: [PATCH 02/14] net/fec_mpc52xx: Migrate to net_device_ops.
Date: Tue, 31 Mar 2009 02:26:54 -0600 [thread overview]
Message-ID: <20090331082654.1427.66471.stgit@localhost.localdomain> (raw)
In-Reply-To: <20090331075537.1427.7819.stgit@localhost.localdomain>
From: Grant Likely <grant.likely@secretlab.ca>
Since not using net_device_ops gets you shunned out the cool crowd,
this patch modifies the fec_mpc52xx Ethernet driver to provide the
management hooks via a struct net_device_ops.
Reported-by: Henk Stegeman <henk.stegeman@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
drivers/net/fec_mpc52xx.c | 35 +++++++++++++++++++----------------
1 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index f99463f..75d0569 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -371,7 +371,7 @@ static int mpc52xx_fec_close(struct net_device *dev)
* invariant will hold if you make sure that the netif_*_queue()
* calls are done at the proper times.
*/
-static int mpc52xx_fec_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
+static int mpc52xx_fec_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct mpc52xx_fec_priv *priv = netdev_priv(dev);
struct bcom_fec_bd *bd;
@@ -379,7 +379,7 @@ static int mpc52xx_fec_hard_start_xmit(struct sk_buff *skb, struct net_device *d
if (bcom_queue_full(priv->tx_dmatsk)) {
if (net_ratelimit())
dev_err(&dev->dev, "transmit queue overrun\n");
- return 1;
+ return NETDEV_TX_BUSY;
}
spin_lock_irq(&priv->lock);
@@ -400,7 +400,7 @@ static int mpc52xx_fec_hard_start_xmit(struct sk_buff *skb, struct net_device *d
spin_unlock_irq(&priv->lock);
- return 0;
+ return NETDEV_TX_OK;
}
#ifdef CONFIG_NET_POLL_CONTROLLER
@@ -890,6 +890,21 @@ static int mpc52xx_fec_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
return mpc52xx_fec_phy_mii_ioctl(priv, if_mii(rq), cmd);
}
+static const struct net_device_ops mpc52xx_fec_netdev_ops = {
+ .ndo_open = mpc52xx_fec_open,
+ .ndo_stop = mpc52xx_fec_close,
+ .ndo_start_xmit = mpc52xx_fec_start_xmit,
+ .ndo_set_multicast_list = mpc52xx_fec_set_multicast_list,
+ .ndo_set_mac_address = mpc52xx_fec_set_mac_address,
+ .ndo_validate_addr = eth_validate_addr,
+ .ndo_do_ioctl = mpc52xx_fec_ioctl,
+ .ndo_tx_timeout = mpc52xx_fec_tx_timeout,
+ .ndo_get_stats = mpc52xx_fec_get_stats,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = mpc52xx_fec_poll_controller,
+#endif
+};
+
/* ======================================================================== */
/* OF Driver */
/* ======================================================================== */
@@ -934,22 +949,10 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
return -EBUSY;
/* Init ether ndev with what we have */
- ndev->open = mpc52xx_fec_open;
- ndev->stop = mpc52xx_fec_close;
- ndev->hard_start_xmit = mpc52xx_fec_hard_start_xmit;
- ndev->do_ioctl = mpc52xx_fec_ioctl;
+ ndev->netdev_ops = &mpc52xx_fec_netdev_ops;
ndev->ethtool_ops = &mpc52xx_fec_ethtool_ops;
- ndev->get_stats = mpc52xx_fec_get_stats;
- ndev->set_mac_address = mpc52xx_fec_set_mac_address;
- ndev->set_multicast_list = mpc52xx_fec_set_multicast_list;
- ndev->tx_timeout = mpc52xx_fec_tx_timeout;
ndev->watchdog_timeo = FEC_WATCHDOG_TIMEOUT;
ndev->base_addr = mem.start;
-#ifdef CONFIG_NET_POLL_CONTROLLER
- ndev->poll_controller = mpc52xx_fec_poll_controller;
-#endif
-
- priv->t_irq = priv->r_irq = ndev->irq = NO_IRQ; /* IRQ are free for now */
spin_lock_init(&priv->lock);
next prev parent reply other threads:[~2009-03-31 8:26 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-31 8:26 [PATCH 00/14] Add common OF device tree support for MDIO busses Grant Likely
2009-03-31 8:26 ` [PATCH 01/14] of: add of_parse_phandle() helper for parsing phandle properties Grant Likely
2009-03-31 8:26 ` Grant Likely
2009-03-31 8:26 ` Grant Likely [this message]
2009-03-31 8:26 ` [PATCH 02/14] net/fec_mpc52xx: Migrate to net_device_ops Grant Likely
2009-03-31 8:26 ` [PATCH 03/14] net/fec_mpc52xx: Don't dereference phy_device if it is NULL Grant Likely
2009-03-31 8:26 ` Grant Likely
2009-03-31 8:27 ` [PATCH 04/14] phylib: rework to prepare for OF registration of PHYs Grant Likely
2009-03-31 8:27 ` Grant Likely
2009-03-31 8:27 ` [PATCH 05/14] phylib: add *_direct() variants of phy_connect and phy_attach functions Grant Likely
2009-03-31 8:27 ` Grant Likely
2009-04-15 21:10 ` Andy Fleming
2009-04-18 6:08 ` Grant Likely
2009-04-18 6:08 ` Grant Likely
2009-04-18 6:18 ` Grant Likely
2009-04-18 6:18 ` Grant Likely
2009-03-31 8:27 ` [PATCH 06/14] openfirmware: Add OF phylib support code Grant Likely
2009-03-31 8:27 ` Grant Likely
2009-03-31 8:27 ` [PATCH 07/14] net: Rework mpc5200 fec driver to use of_mdio infrastructure Grant Likely
2009-03-31 8:27 ` Grant Likely
2009-03-31 8:27 ` [PATCH 08/14] net: rework fsl_pq_mdio " Grant Likely
2009-03-31 8:27 ` Grant Likely
2009-03-31 8:27 ` [PATCH 09/14] net: Rework gianfar " Grant Likely
2009-03-31 8:27 ` Grant Likely
2009-04-15 23:01 ` Andy Fleming
2009-04-18 6:34 ` Grant Likely
2009-04-18 6:34 ` Grant Likely
2009-03-31 8:27 ` [PATCH 10/14] net: Rework ucc_geth " Grant Likely
2009-03-31 8:27 ` Grant Likely
2009-03-31 8:27 ` [PATCH 11/14] net: Rework pasemi_mac " Grant Likely
2009-03-31 8:27 ` Grant Likely
2009-03-31 8:27 ` [PATCH 12/14] powerpc/82xx: Rework Embedded Planet ep8248e platform to use of_mdio Grant Likely
2009-03-31 8:27 ` Grant Likely
2009-03-31 8:27 ` [PATCH 13/14] net: Rework fs_enet driver to use of_mdio infrastructure Grant Likely
2009-03-31 8:27 ` Grant Likely
2009-03-31 8:27 ` [PATCH 14/14] net: add Xilinx ll_temac device driver Grant Likely
2009-03-31 8:27 ` Grant Likely
2009-03-31 21:57 ` [PATCH 00/14] Add common OF device tree support for MDIO busses David Miller
2009-03-31 22:19 ` Grant Likely
2009-03-31 22:19 ` Grant Likely
2009-03-31 22:22 ` David Miller
2009-03-31 22:22 ` David Miller
2009-04-01 1:45 ` Grant Likely
2009-04-01 1:45 ` Grant Likely
2009-04-01 3:38 ` David Miller
2009-04-01 3:38 ` David Miller
2009-04-01 4:56 ` Grant Likely
2009-04-01 4:56 ` Grant Likely
2009-04-01 5:16 ` David Miller
2009-04-01 5:16 ` David Miller
2009-04-01 5:21 ` Grant Likely
2009-04-01 5:21 ` Grant Likely
2009-04-15 23:06 ` Andy Fleming
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=20090331082654.1427.66471.stgit@localhost.localdomain \
--to=grant.likely@secretlab.ca \
--cc=Joakim.Tjernlund@transmode.se \
--cc=afleming@freescale.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=olof@lixom.net \
/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.