* [PATCH] ucc_geth: Convert to net_device_ops
@ 2009-03-23 10:17 Joakim Tjernlund
2009-03-23 18:49 ` David Miller
0 siblings, 1 reply; 11+ messages in thread
From: Joakim Tjernlund @ 2009-03-23 10:17 UTC (permalink / raw)
To: leoli, netdev, linuxppc-dev, Anton Vorontsov
[-- Attachment #1: Type: text/plain, Size: 2497 bytes --]
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
---
Sorry for the WS damaged patch, but my current company mailer cannot
handle inline patches. Due to this we are setting up a new mail system
but it will be a few days before this is ready.
Therefore I am attaching this patch as well, use that one
to apply instaed of the inline variant.
drivers/net/ucc_geth.c | 28 +++++++++++++++++++---------
1 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 12e5c3d..d3f6eee 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3503,6 +3503,24 @@ static phy_interface_t to_phy_interface(const char
*phy_connection_type)
return PHY_INTERFACE_MODE_MII;
}
+static const struct net_device_ops ucc_geth_netdev_ops = {
+ .ndo_open = ucc_geth_open,
+ .ndo_stop = ucc_geth_close,
+ .ndo_start_xmit = ucc_geth_start_xmit,
+ .ndo_validate_addr = eth_validate_addr,
+ .ndo_set_multicast_list = ucc_geth_set_multi,
+#if 0
+/* not yet */
+ .ndo_set_mac_address = ucc_geth_set_mac_address,
+ .ndo_change_mtu = ucc_geth_change_mtu,
+ .ndo_do_ioctl = ucc_geth_do_ioctl,
+#endif
+ .ndo_tx_timeout = ucc_geth_timeout,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = ucc_netpoll,
+#endif
+};
+
static int ucc_geth_probe(struct of_device* ofdev, const struct
of_device_id *match)
{
struct device *device = &ofdev->dev;
@@ -3715,19 +3733,11 @@ static int ucc_geth_probe(struct of_device* ofdev,
const struct of_device_id *ma
/* Fill in the dev structure */
uec_set_ethtool_ops(dev);
- dev->open = ucc_geth_open;
- dev->hard_start_xmit = ucc_geth_start_xmit;
- dev->tx_timeout = ucc_geth_timeout;
+ dev->netdev_ops = &ucc_geth_netdev_ops;
dev->watchdog_timeo = TX_TIMEOUT;
INIT_WORK(&ugeth->timeout_work, ucc_geth_timeout_work);
netif_napi_add(dev, &ugeth->napi, ucc_geth_poll,
UCC_GETH_DEV_WEIGHT);
-#ifdef CONFIG_NET_POLL_CONTROLLER
- dev->poll_controller = ucc_netpoll;
-#endif
- dev->stop = ucc_geth_close;
-// dev->change_mtu = ucc_geth_change_mtu;
dev->mtu = 1500;
- dev->set_multicast_list = ucc_geth_set_multi;
ugeth->msg_enable = netif_msg_init(debug.msg_enable,
UGETH_MSG_DEFAULT);
ugeth->phy_interface = phy_interface;
--
1.6.1.3
[-- Attachment #2: 0001-ucc_geth-Convert-to-net_device_ops.patch --]
[-- Type: application/octet-stream, Size: 2195 bytes --]
From a92c389ba9cd7eb674bfa58882ddc5fdf93e11d0 Mon Sep 17 00:00:00 2001
From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Date: Fri, 20 Mar 2009 21:09:14 +0100
Subject: [PATCH] ucc_geth: Convert to net_device_ops
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
---
drivers/net/ucc_geth.c | 28 +++++++++++++++++++---------
1 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 12e5c3d..d3f6eee 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3503,6 +3503,24 @@ static phy_interface_t to_phy_interface(const char *phy_connection_type)
return PHY_INTERFACE_MODE_MII;
}
+static const struct net_device_ops ucc_geth_netdev_ops = {
+ .ndo_open = ucc_geth_open,
+ .ndo_stop = ucc_geth_close,
+ .ndo_start_xmit = ucc_geth_start_xmit,
+ .ndo_validate_addr = eth_validate_addr,
+ .ndo_set_multicast_list = ucc_geth_set_multi,
+#if 0
+/* not yet */
+ .ndo_set_mac_address = ucc_geth_set_mac_address,
+ .ndo_change_mtu = ucc_geth_change_mtu,
+ .ndo_do_ioctl = ucc_geth_do_ioctl,
+#endif
+ .ndo_tx_timeout = ucc_geth_timeout,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = ucc_netpoll,
+#endif
+};
+
static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *match)
{
struct device *device = &ofdev->dev;
@@ -3715,19 +3733,11 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
/* Fill in the dev structure */
uec_set_ethtool_ops(dev);
- dev->open = ucc_geth_open;
- dev->hard_start_xmit = ucc_geth_start_xmit;
- dev->tx_timeout = ucc_geth_timeout;
+ dev->netdev_ops = &ucc_geth_netdev_ops;
dev->watchdog_timeo = TX_TIMEOUT;
INIT_WORK(&ugeth->timeout_work, ucc_geth_timeout_work);
netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, UCC_GETH_DEV_WEIGHT);
-#ifdef CONFIG_NET_POLL_CONTROLLER
- dev->poll_controller = ucc_netpoll;
-#endif
- dev->stop = ucc_geth_close;
-// dev->change_mtu = ucc_geth_change_mtu;
dev->mtu = 1500;
- dev->set_multicast_list = ucc_geth_set_multi;
ugeth->msg_enable = netif_msg_init(debug.msg_enable, UGETH_MSG_DEFAULT);
ugeth->phy_interface = phy_interface;
--
1.6.1.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] ucc_geth: Convert to net_device_ops
2009-03-23 10:17 [PATCH] ucc_geth: Convert to net_device_ops Joakim Tjernlund
@ 2009-03-23 18:49 ` David Miller
2009-03-24 10:37 ` Joakim Tjernlund
0 siblings, 1 reply; 11+ messages in thread
From: David Miller @ 2009-03-23 18:49 UTC (permalink / raw)
To: Joakim.Tjernlund; +Cc: netdev, leoli, linuxppc-dev
From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Date: Mon, 23 Mar 2009 11:17:39 +0100
> Sorry for the WS damaged patch, but my current company mailer cannot
> handle inline patches. Due to this we are setting up a new mail system
> but it will be a few days before this is ready.
> Therefore I am attaching this patch as well, use that one
> to apply instaed of the inline variant.
This patch has other problems, anyways.
> +#if 0
> +/* not yet */
> + .ndo_set_mac_address = ucc_geth_set_mac_address,
> + .ndo_change_mtu = ucc_geth_change_mtu,
> + .ndo_do_ioctl = ucc_geth_do_ioctl,
> +#endif
Don't do stuff like this, please. Even the code you are
copying from doesn't have the set_mac_address method
assignment proceted by #if 0 stuff.
Just get rid of all the unused stuff completely.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] ucc_geth: Convert to net_device_ops
2009-03-23 18:49 ` David Miller
@ 2009-03-24 10:37 ` Joakim Tjernlund
2009-03-24 21:22 ` David Miller
0 siblings, 1 reply; 11+ messages in thread
From: Joakim Tjernlund @ 2009-03-24 10:37 UTC (permalink / raw)
To: David Miller; +Cc: linuxppc-dev, leoli, netdev
[-- Attachment #1: Type: text/plain, Size: 1027 bytes --]
David Miller <davem@davemloft.net> wrote on 23/03/2009 19:49:28:
>
> From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> Date: Mon, 23 Mar 2009 11:17:39 +0100
>
> > Sorry for the WS damaged patch, but my current company mailer cannot
> > handle inline patches. Due to this we are setting up a new mail system
> > but it will be a few days before this is ready.
> > Therefore I am attaching this patch as well, use that one
> > to apply instaed of the inline variant.
>
> This patch has other problems, anyways.
>
> > +#if 0
> > +/* not yet */
> > + .ndo_set_mac_address = ucc_geth_set_mac_address,
> > + .ndo_change_mtu = ucc_geth_change_mtu,
> > + .ndo_do_ioctl = ucc_geth_do_ioctl,
> > +#endif
>
> Don't do stuff like this, please. Even the code you are
> copying from doesn't have the set_mac_address method
> assignment proceted by #if 0 stuff.
>
> Just get rid of all the unused stuff completely.
OK, here is a new version. The #if 0 ..#endif has been removed.
Jocke
[-- Attachment #2: 0001-ucc_geth-Convert-to-net_device_ops.patch --]
[-- Type: application/octet-stream, Size: 1963 bytes --]
From 7f1c6f32df114cfda750049be4d2601af74174a8 Mon Sep 17 00:00:00 2001
From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Date: Fri, 20 Mar 2009 21:09:14 +0100
Subject: [PATCH] ucc_geth: Convert to net_device_ops
---
drivers/net/ucc_geth.c | 22 +++++++++++++---------
1 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 7716239..42b1a50 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3501,6 +3501,18 @@ static phy_interface_t to_phy_interface(const char *phy_connection_type)
return PHY_INTERFACE_MODE_MII;
}
+static const struct net_device_ops ucc_geth_netdev_ops = {
+ .ndo_open = ucc_geth_open,
+ .ndo_stop = ucc_geth_close,
+ .ndo_start_xmit = ucc_geth_start_xmit,
+ .ndo_validate_addr = eth_validate_addr,
+ .ndo_set_multicast_list = ucc_geth_set_multi,
+ .ndo_tx_timeout = ucc_geth_timeout,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = ucc_netpoll,
+#endif
+};
+
static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *match)
{
struct device *device = &ofdev->dev;
@@ -3716,19 +3728,11 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
/* Fill in the dev structure */
uec_set_ethtool_ops(dev);
- dev->open = ucc_geth_open;
- dev->hard_start_xmit = ucc_geth_start_xmit;
- dev->tx_timeout = ucc_geth_timeout;
+ dev->netdev_ops = &ucc_geth_netdev_ops;
dev->watchdog_timeo = TX_TIMEOUT;
INIT_WORK(&ugeth->timeout_work, ucc_geth_timeout_work);
netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, UCC_GETH_DEV_WEIGHT);
-#ifdef CONFIG_NET_POLL_CONTROLLER
- dev->poll_controller = ucc_netpoll;
-#endif
- dev->stop = ucc_geth_close;
-// dev->change_mtu = ucc_geth_change_mtu;
dev->mtu = 1500;
- dev->set_multicast_list = ucc_geth_set_multi;
ugeth->msg_enable = netif_msg_init(debug.msg_enable, UGETH_MSG_DEFAULT);
ugeth->phy_interface = phy_interface;
--
1.6.1.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] ucc_geth: Convert to net_device_ops
2009-03-24 10:37 ` Joakim Tjernlund
@ 2009-03-24 21:22 ` David Miller
2009-03-24 22:45 ` Joakim Tjernlund
0 siblings, 1 reply; 11+ messages in thread
From: David Miller @ 2009-03-24 21:22 UTC (permalink / raw)
To: Joakim.Tjernlund; +Cc: linuxppc-dev, leoli, netdev
From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Date: Tue, 24 Mar 2009 11:37:11 +0100
> David Miller <davem@davemloft.net> wrote on 23/03/2009 19:49:28:
> >
> > From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> > Date: Mon, 23 Mar 2009 11:17:39 +0100
> >
> > > Sorry for the WS damaged patch, but my current company mailer cannot
> > > handle inline patches. Due to this we are setting up a new mail system
> > > but it will be a few days before this is ready.
> > > Therefore I am attaching this patch as well, use that one
> > > to apply instaed of the inline variant.
> >
> > This patch has other problems, anyways.
> >
> > > +#if 0
> > > +/* not yet */
> > > + .ndo_set_mac_address = ucc_geth_set_mac_address,
> > > + .ndo_change_mtu = ucc_geth_change_mtu,
> > > + .ndo_do_ioctl = ucc_geth_do_ioctl,
> > > +#endif
> >
> > Don't do stuff like this, please. Even the code you are
> > copying from doesn't have the set_mac_address method
> > assignment proceted by #if 0 stuff.
> >
> > Just get rid of all the unused stuff completely.
>
> OK, here is a new version. The #if 0 ..#endif has been removed.
Missing ".ndo_set_mac_address = eth_set_mac_address," and
also ".ndo_change_mtu = eth_change_mtu".
Also please inline your patches so that people can quote them in
replies.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] ucc_geth: Convert to net_device_ops
2009-03-24 21:22 ` David Miller
@ 2009-03-24 22:45 ` Joakim Tjernlund
2009-03-24 22:49 ` David Miller
0 siblings, 1 reply; 11+ messages in thread
From: Joakim Tjernlund @ 2009-03-24 22:45 UTC (permalink / raw)
To: David Miller; +Cc: linuxppc-dev, leoli, netdev
David Miller <davem@davemloft.net> wrote on 24/03/2009 22:22:09:
>
> From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> Date: Tue, 24 Mar 2009 11:37:11 +0100
>
> > David Miller <davem@davemloft.net> wrote on 23/03/2009 19:49:28:
> > >
> > > From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> > > Date: Mon, 23 Mar 2009 11:17:39 +0100
> > >
> > > > Sorry for the WS damaged patch, but my current company mailer
cannot
> > > > handle inline patches. Due to this we are setting up a new mail
system
> > > > but it will be a few days before this is ready.
> > > > Therefore I am attaching this patch as well, use that one
> > > > to apply instaed of the inline variant.
> > >
> > > This patch has other problems, anyways.
> > >
> > > > +#if 0
> > > > +/* not yet */
> > > > + .ndo_set_mac_address = ucc_geth_set_mac_address,
> > > > + .ndo_change_mtu = ucc_geth_change_mtu,
> > > > + .ndo_do_ioctl = ucc_geth_do_ioctl,
> > > > +#endif
> > >
> > > Don't do stuff like this, please. Even the code you are
> > > copying from doesn't have the set_mac_address method
> > > assignment proceted by #if 0 stuff.
> > >
> > > Just get rid of all the unused stuff completely.
> >
> > OK, here is a new version. The #if 0 ..#endif has been removed.
>
> Missing ".ndo_set_mac_address = eth_set_mac_address," and
> also ".ndo_change_mtu = eth_change_mtu".
I don't follow. Are these mandatory now? They were not in the old
impl. either.
>
> Also please inline your patches so that people can quote them in
> replies.
I know, but my mail system is screwing up WS ATM so I can't. Working
on it though.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] ucc_geth: Convert to net_device_ops
2009-03-24 22:45 ` Joakim Tjernlund
@ 2009-03-24 22:49 ` David Miller
2009-03-24 23:08 ` Joakim Tjernlund
0 siblings, 1 reply; 11+ messages in thread
From: David Miller @ 2009-03-24 22:49 UTC (permalink / raw)
To: Joakim.Tjernlund; +Cc: linuxppc-dev, leoli, netdev
From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Date: Tue, 24 Mar 2009 23:45:13 +0100
> I don't follow. Are these mandatory now? They were not in the old
> impl. either.
See ether_setup() which is called indirectly via alloc_etherdev().
Yawn...
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] ucc_geth: Convert to net_device_ops
2009-03-24 22:49 ` David Miller
@ 2009-03-24 23:08 ` Joakim Tjernlund
2009-03-24 23:29 ` David Miller
2009-03-27 18:50 ` Timur Tabi
0 siblings, 2 replies; 11+ messages in thread
From: Joakim Tjernlund @ 2009-03-24 23:08 UTC (permalink / raw)
To: David Miller; +Cc: linuxppc-dev, leoli, netdev
[-- Attachment #1: Type: text/plain, Size: 2715 bytes --]
David Miller <davem@davemloft.net> wrote on 24/03/2009 23:49:02:
>
> From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> Date: Tue, 24 Mar 2009 23:45:13 +0100
>
> > I don't follow. Are these mandatory now? They were not in the old
> > impl. either.
>
> See ether_setup() which is called indirectly via alloc_etherdev().
>
> Yawn...
Same here, getting tiered. Should have seen that. Here goes,
attatched as well as explained earlier.
Jocke
>From 651fcd7d1ba494f2e2f20da51196b1b3dccdcd68 Mon Sep 17 00:00:00 2001
From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Date: Fri, 20 Mar 2009 21:09:14 +0100
Subject: [PATCH] ucc_geth: Convert to net_device_ops
---
drivers/net/ucc_geth.c | 24 +++++++++++++++---------
1 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 7716239..097aed8 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3501,6 +3501,20 @@ static phy_interface_t to_phy_interface(const char
*phy_connection_type)
return PHY_INTERFACE_MODE_MII;
}
+static const struct net_device_ops ucc_geth_netdev_ops = {
+ .ndo_open = ucc_geth_open,
+ .ndo_stop = ucc_geth_close,
+ .ndo_start_xmit = ucc_geth_start_xmit,
+ .ndo_validate_addr = eth_validate_addr,
+ .ndo_set_mac_address = eth_mac_addr,
+ .ndo_change_mtu = eth_change_mtu,
+ .ndo_set_multicast_list = ucc_geth_set_multi,
+ .ndo_tx_timeout = ucc_geth_timeout,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = ucc_netpoll,
+#endif
+};
+
static int ucc_geth_probe(struct of_device* ofdev, const struct
of_device_id *match)
{
struct device *device = &ofdev->dev;
@@ -3716,19 +3730,11 @@ static int ucc_geth_probe(struct of_device* ofdev,
const struct of_device_id *ma
/* Fill in the dev structure */
uec_set_ethtool_ops(dev);
- dev->open = ucc_geth_open;
- dev->hard_start_xmit = ucc_geth_start_xmit;
- dev->tx_timeout = ucc_geth_timeout;
+ dev->netdev_ops = &ucc_geth_netdev_ops;
dev->watchdog_timeo = TX_TIMEOUT;
INIT_WORK(&ugeth->timeout_work, ucc_geth_timeout_work);
netif_napi_add(dev, &ugeth->napi, ucc_geth_poll,
UCC_GETH_DEV_WEIGHT);
-#ifdef CONFIG_NET_POLL_CONTROLLER
- dev->poll_controller = ucc_netpoll;
-#endif
- dev->stop = ucc_geth_close;
-// dev->change_mtu = ucc_geth_change_mtu;
dev->mtu = 1500;
- dev->set_multicast_list = ucc_geth_set_multi;
ugeth->msg_enable = netif_msg_init(debug.msg_enable,
UGETH_MSG_DEFAULT);
ugeth->phy_interface = phy_interface;
--
1.6.1.3
[-- Attachment #2: 0001-ucc_geth-Convert-to-net_device_ops.patch --]
[-- Type: application/octet-stream, Size: 2041 bytes --]
From 651fcd7d1ba494f2e2f20da51196b1b3dccdcd68 Mon Sep 17 00:00:00 2001
From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Date: Fri, 20 Mar 2009 21:09:14 +0100
Subject: [PATCH] ucc_geth: Convert to net_device_ops
---
drivers/net/ucc_geth.c | 24 +++++++++++++++---------
1 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 7716239..097aed8 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3501,6 +3501,20 @@ static phy_interface_t to_phy_interface(const char *phy_connection_type)
return PHY_INTERFACE_MODE_MII;
}
+static const struct net_device_ops ucc_geth_netdev_ops = {
+ .ndo_open = ucc_geth_open,
+ .ndo_stop = ucc_geth_close,
+ .ndo_start_xmit = ucc_geth_start_xmit,
+ .ndo_validate_addr = eth_validate_addr,
+ .ndo_set_mac_address = eth_mac_addr,
+ .ndo_change_mtu = eth_change_mtu,
+ .ndo_set_multicast_list = ucc_geth_set_multi,
+ .ndo_tx_timeout = ucc_geth_timeout,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = ucc_netpoll,
+#endif
+};
+
static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *match)
{
struct device *device = &ofdev->dev;
@@ -3716,19 +3730,11 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
/* Fill in the dev structure */
uec_set_ethtool_ops(dev);
- dev->open = ucc_geth_open;
- dev->hard_start_xmit = ucc_geth_start_xmit;
- dev->tx_timeout = ucc_geth_timeout;
+ dev->netdev_ops = &ucc_geth_netdev_ops;
dev->watchdog_timeo = TX_TIMEOUT;
INIT_WORK(&ugeth->timeout_work, ucc_geth_timeout_work);
netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, UCC_GETH_DEV_WEIGHT);
-#ifdef CONFIG_NET_POLL_CONTROLLER
- dev->poll_controller = ucc_netpoll;
-#endif
- dev->stop = ucc_geth_close;
-// dev->change_mtu = ucc_geth_change_mtu;
dev->mtu = 1500;
- dev->set_multicast_list = ucc_geth_set_multi;
ugeth->msg_enable = netif_msg_init(debug.msg_enable, UGETH_MSG_DEFAULT);
ugeth->phy_interface = phy_interface;
--
1.6.1.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] ucc_geth: Convert to net_device_ops
2009-03-24 23:08 ` Joakim Tjernlund
@ 2009-03-24 23:29 ` David Miller
2009-03-24 23:35 ` Joakim Tjernlund
2009-03-27 18:50 ` Timur Tabi
1 sibling, 1 reply; 11+ messages in thread
From: David Miller @ 2009-03-24 23:29 UTC (permalink / raw)
To: Joakim.Tjernlund; +Cc: linuxppc-dev, leoli, netdev
From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Date: Wed, 25 Mar 2009 00:08:53 +0100
> David Miller <davem@davemloft.net> wrote on 24/03/2009 23:49:02:
> >
> > From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> > Date: Tue, 24 Mar 2009 23:45:13 +0100
> >
> > > I don't follow. Are these mandatory now? They were not in the old
> > > impl. either.
> >
> > See ether_setup() which is called indirectly via alloc_etherdev().
> >
> > Yawn...
>
> Same here, getting tiered. Should have seen that. Here goes,
> attatched as well as explained earlier.
I'll apply this, thanks.
Please provide a proper "Signed-off-by:" line with future
patch submissions, thanks.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] ucc_geth: Convert to net_device_ops
2009-03-24 23:29 ` David Miller
@ 2009-03-24 23:35 ` Joakim Tjernlund
0 siblings, 0 replies; 11+ messages in thread
From: Joakim Tjernlund @ 2009-03-24 23:35 UTC (permalink / raw)
To: David Miller; +Cc: linuxppc-dev, leoli, netdev
David Miller <davem@davemloft.net> wrote on 25/03/2009 00:29:13:
> From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> Date: Wed, 25 Mar 2009 00:08:53 +0100
>
> > David Miller <davem@davemloft.net> wrote on 24/03/2009 23:49:02:
> > >
> > > From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> > > Date: Tue, 24 Mar 2009 23:45:13 +0100
> > >
> > > > I don't follow. Are these mandatory now? They were not in the old
> > > > impl. either.
> > >
> > > See ether_setup() which is called indirectly via alloc_etherdev().
> > >
> > > Yawn...
> >
> > Same here, getting tiered. Should have seen that. Here goes,
> > attatched as well as explained earlier.
>
> I'll apply this, thanks.
Thanks.
>
> Please provide a proper "Signed-off-by:" line with future
> patch submissions, thanks.
Yep, getting tiered ...
Hopefully I will have something more coming your way the next few days.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] ucc_geth: Convert to net_device_ops
2009-03-24 23:08 ` Joakim Tjernlund
2009-03-24 23:29 ` David Miller
@ 2009-03-27 18:50 ` Timur Tabi
2009-03-28 11:27 ` Joakim Tjernlund
1 sibling, 1 reply; 11+ messages in thread
From: Timur Tabi @ 2009-03-27 18:50 UTC (permalink / raw)
To: Joakim Tjernlund; +Cc: leoli, linuxppc-dev, David Miller, netdev
On Tue, Mar 24, 2009 at 6:08 PM, Joakim Tjernlund
<Joakim.Tjernlund@transmode.se> wrote:
> + =A0 =A0 =A0 .ndo_change_mtu =A0 =A0 =A0 =A0 =3D eth_change_mtu,
I have an old patch for change_mtu support for ucc_geth which I've
been meaning to push upstream. This patch uses this function instead
of eth_change_mtu():
+static int ucc_geth_change_mtu(struct net_device *dev, int new_mtu)
+{
+ int max_rx_buf_length;
+ struct ucc_geth_private *ugeth =3D netdev_priv(dev);
+ int frame_size =3D new_mtu + 18;
+ struct ucc_geth_info *ug_info;
+ struct ucc_fast_info *uf_info;
+
+ if (ugeth->p_rx_glbl_pram) {
+ printk("%s: Interface is active!\n", __FUNCTION__);
+ } else {
+
+ ug_info =3D ugeth->ug_info;
+ uf_info =3D &ug_info->uf_info;
+
+ if ((frame_size < 64) || (frame_size > JUMBO_FRAME_SIZE)) {
+ printk(KERN_ERR "%s: Invalid MTU setting\n", dev->name);
+ return -EINVAL;
+ }
+
+ max_rx_buf_length =3D
+ (frame_size & ~(UCC_GETH_MRBLR_ALIGNMENT - 1)) +
+ UCC_GETH_MRBLR_ALIGNMENT;
+
+ ugeth->ug_info->uf_info.max_rx_buf_length =3D max_rx_buf_length;
+ dev->mtu =3D new_mtu;
+
+ /* Set the max. rx buffer size (MRBLR) */
+ uf_info->max_rx_buf_length =3D max_rx_buf_length;
+
+ /* set the max. frame length (MFLR) */
+ ug_info->maxFrameLength =3D frame_size;
+
+ ugeth_info("%s: MTU =3D %d (frame size=3D%d)\n", dev->name,
+ dev->mtu, frame_size);
+ }
+ return 0;
+}
Do you think this is how it should be done? I don't know enough about
ucc_geth and MTUs to know off-hand.
--=20
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] ucc_geth: Convert to net_device_ops
2009-03-27 18:50 ` Timur Tabi
@ 2009-03-28 11:27 ` Joakim Tjernlund
0 siblings, 0 replies; 11+ messages in thread
From: Joakim Tjernlund @ 2009-03-28 11:27 UTC (permalink / raw)
To: Timur Tabi; +Cc: netdev, linuxppc-dev, timur.tabi, leoli, David Miller
timur.tabi@gmail.com wrote on 27/03/2009 19:50:30:
>
> On Tue, Mar 24, 2009 at 6:08 PM, Joakim Tjernlund
> <Joakim.Tjernlund@transmode.se> wrote:
>
> > + .ndo_change_mtu = eth_change_mtu,
>
> I have an old patch for change_mtu support for ucc_geth which I've
> been meaning to push upstream. This patch uses this function instead
> of eth_change_mtu():
>
> +static int ucc_geth_change_mtu(struct net_device *dev, int new_mtu)
> +{
> + int max_rx_buf_length;
> + struct ucc_geth_private *ugeth = netdev_priv(dev);
> + int frame_size = new_mtu + 18;
> + struct ucc_geth_info *ug_info;
> + struct ucc_fast_info *uf_info;
> +
> + if (ugeth->p_rx_glbl_pram) {
> + printk("%s: Interface is active!\n", __FUNCTION__);
> + } else {
> +
> + ug_info = ugeth->ug_info;
> + uf_info = &ug_info->uf_info;
> +
> + if ((frame_size < 64) || (frame_size > JUMBO_FRAME_SIZE)) {
> + printk(KERN_ERR "%s: Invalid MTU setting\n", dev->name);
> + return -EINVAL;
> + }
> +
> + max_rx_buf_length =
> + (frame_size & ~(UCC_GETH_MRBLR_ALIGNMENT - 1)) +
> + UCC_GETH_MRBLR_ALIGNMENT;
> +
> + ugeth->ug_info->uf_info.max_rx_buf_length = max_rx_buf_length;
> + dev->mtu = new_mtu;
> +
> + /* Set the max. rx buffer size (MRBLR) */
> + uf_info->max_rx_buf_length = max_rx_buf_length;
> +
> + /* set the max. frame length (MFLR) */
> + ug_info->maxFrameLength = frame_size;
> +
> + ugeth_info("%s: MTU = %d (frame size=%d)\n", dev->name,
> + dev->mtu, frame_size);
> + }
> + return 0;
> +}
>
> Do you think this is how it should be done? I don't know enough about
> ucc_geth and MTUs to know off-hand.
Not quite so. I don't think you can support JUMBO frames with just one big
RX buffer.
Also, maxframe & RX buffer should be somewhat bigger than the actual mtu
so you can
support VLAN(4) and PPPOE(8) = 12 bytes.
You need to add 12 bytes to the default values too.
Jocke
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2009-03-28 11:27 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-23 10:17 [PATCH] ucc_geth: Convert to net_device_ops Joakim Tjernlund
2009-03-23 18:49 ` David Miller
2009-03-24 10:37 ` Joakim Tjernlund
2009-03-24 21:22 ` David Miller
2009-03-24 22:45 ` Joakim Tjernlund
2009-03-24 22:49 ` David Miller
2009-03-24 23:08 ` Joakim Tjernlund
2009-03-24 23:29 ` David Miller
2009-03-24 23:35 ` Joakim Tjernlund
2009-03-27 18:50 ` Timur Tabi
2009-03-28 11:27 ` Joakim Tjernlund
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).