* [PATCH 0/3] More embedded 8390 netdevice ops conversions
@ 2008-12-03 20:10 Stephen Hemminger
2008-12-03 20:10 ` [PATCH 1/3] zorro8390: convert to net_device_ops Stephen Hemminger
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Stephen Hemminger @ 2008-12-03 20:10 UTC (permalink / raw)
To: David Miller; +Cc: netdev
--
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/3] zorro8390: convert to net_device_ops
2008-12-03 20:10 [PATCH 0/3] More embedded 8390 netdevice ops conversions Stephen Hemminger
@ 2008-12-03 20:10 ` Stephen Hemminger
2008-12-04 6:09 ` David Miller
2008-12-03 20:10 ` [PATCH 2/3] hydra: " Stephen Hemminger
2008-12-03 20:10 ` [PATCH 3/3] ne-h8300: " Stephen Hemminger
2 siblings, 1 reply; 8+ messages in thread
From: Stephen Hemminger @ 2008-12-03 20:10 UTC (permalink / raw)
To: David Miller; +Cc: netdev
[-- Attachment #1: zorro.patch --]
[-- Type: text/plain, Size: 2184 bytes --]
Another device using 8390 library that needs converting.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/Makefile 2008-12-03 11:56:50.000000000 -0800
+++ b/drivers/net/Makefile 2008-12-03 11:56:59.000000000 -0800
@@ -190,7 +190,7 @@ obj-$(CONFIG_SC92031) += sc92031.o
obj-$(CONFIG_LP486E) += lp486e.o
obj-$(CONFIG_ETH16I) += eth16i.o
-obj-$(CONFIG_ZORRO8390) += zorro8390.o
+obj-$(CONFIG_ZORRO8390) += zorro8390.o 8390.o
obj-$(CONFIG_HPLANCE) += hplance.o 7990.o
obj-$(CONFIG_MVME147_NET) += mvme147.o 7990.o
obj-$(CONFIG_EQUALIZER) += eql.o
--- a/drivers/net/zorro8390.c 2008-12-03 11:56:42.000000000 -0800
+++ b/drivers/net/zorro8390.c 2008-12-03 11:59:24.000000000 -0800
@@ -122,7 +122,7 @@ static int __devinit zorro8390_init_one(
break;
board = z->resource.start;
ioaddr = board+cards[i].offset;
- dev = ____alloc_ei_netdev(0);
+ dev = alloc_ei_netdev();
if (!dev)
return -ENOMEM;
if (!request_mem_region(ioaddr, NE_IO_EXTENT*2, DRV_NAME)) {
@@ -139,6 +139,20 @@ static int __devinit zorro8390_init_one(
return 0;
}
+static const struct net_device_ops zorro8390_netdev_ops = {
+ .ndo_open = zorro8390_open,
+ .ndo_stop = zorro8390_close,
+ .ndo_start_xmit = ei_start_xmit,
+ .ndo_tx_timeout = ei_tx_timeout,
+ .ndo_get_stats = ei_get_stats,
+ .ndo_set_multicast_list = ei_set_multicast_list,
+ .ndo_validate_addr = eth_validate_addr,
+ .ndo_change_mtu = eth_change_mtu,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = ei_poll,
+#endif
+};
+
static int __devinit zorro8390_init(struct net_device *dev,
unsigned long board, const char *name,
unsigned long ioaddr)
@@ -230,12 +244,8 @@ static int __devinit zorro8390_init(stru
ei_status.block_output = &zorro8390_block_output;
ei_status.get_8390_hdr = &zorro8390_get_8390_hdr;
ei_status.reg_offset = zorro8390_offsets;
- dev->open = &zorro8390_open;
- dev->stop = &zorro8390_close;
-#ifdef CONFIG_NET_POLL_CONTROLLER
- dev->poll_controller = __ei_poll;
-#endif
+ dev->netdev_ops = &zorro8390_netdev_ops;
__NS8390_init(dev, 0);
err = register_netdev(dev);
if (err) {
--
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/3] hydra: convert to net_device_ops
2008-12-03 20:10 [PATCH 0/3] More embedded 8390 netdevice ops conversions Stephen Hemminger
2008-12-03 20:10 ` [PATCH 1/3] zorro8390: convert to net_device_ops Stephen Hemminger
@ 2008-12-03 20:10 ` Stephen Hemminger
2008-12-04 6:10 ` David Miller
2008-12-03 20:10 ` [PATCH 3/3] ne-h8300: " Stephen Hemminger
2 siblings, 1 reply; 8+ messages in thread
From: Stephen Hemminger @ 2008-12-03 20:10 UTC (permalink / raw)
To: David Miller; +Cc: netdev
[-- Attachment #1: hydra.patch --]
[-- Type: text/plain, Size: 2002 bytes --]
Another device using 8390 library that needs converting.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/Makefile 2008-12-03 12:02:31.000000000 -0800
+++ b/drivers/net/Makefile 2008-12-03 12:02:39.000000000 -0800
@@ -202,7 +202,7 @@ obj-$(CONFIG_SGI_IOC3_ETH) += ioc3-eth.o
obj-$(CONFIG_DECLANCE) += declance.o
obj-$(CONFIG_ATARILANCE) += atarilance.o
obj-$(CONFIG_A2065) += a2065.o
-obj-$(CONFIG_HYDRA) += hydra.o
+obj-$(CONFIG_HYDRA) += hydra.o 8390.o
obj-$(CONFIG_ARIADNE) += ariadne.o
obj-$(CONFIG_CS89x0) += cs89x0.o
obj-$(CONFIG_MACSONIC) += macsonic.o
--- a/drivers/net/hydra.c 2008-12-03 12:00:55.000000000 -0800
+++ b/drivers/net/hydra.c 2008-12-03 12:02:22.000000000 -0800
@@ -94,6 +94,21 @@ static int __devinit hydra_init_one(stru
return 0;
}
+static const struct net_device_ops etherh_netdev_ops = {
+ .ndo_open = hydra_open,
+ .ndo_stop = hydra_close,
+
+ .ndo_start_xmit = ei_start_xmit,
+ .ndo_tx_timeout = ei_tx_timeout,
+ .ndo_get_stats = ei_get_stats,
+ .ndo_set_multicast_list = ei_set_multicast_list,
+ .ndo_validate_addr = eth_validate_addr,
+ .ndo_change_mtu = eth_change_mtu,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = ei_poll,
+#endif
+};
+
static int __devinit hydra_init(struct zorro_dev *z)
{
struct net_device *dev;
@@ -109,7 +124,7 @@ static int __devinit hydra_init(struct z
0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e,
};
- dev = ____alloc_ei_netdev(0);
+ dev = alloc_ei_netdev();
if (!dev)
return -ENOMEM;
@@ -144,12 +159,8 @@ static int __devinit hydra_init(struct z
ei_status.block_output = &hydra_block_output;
ei_status.get_8390_hdr = &hydra_get_8390_hdr;
ei_status.reg_offset = hydra_offsets;
- dev->open = &hydra_open;
- dev->stop = &hydra_close;
-#ifdef CONFIG_NET_POLL_CONTROLLER
- dev->poll_controller = __ei_poll;
-#endif
+ dev->netdev_ops = &hydra_netdev_ops;
__NS8390_init(dev, 0);
err = register_netdev(dev);
--
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/3] ne-h8300: convert to net_device_ops
2008-12-03 20:10 [PATCH 0/3] More embedded 8390 netdevice ops conversions Stephen Hemminger
2008-12-03 20:10 ` [PATCH 1/3] zorro8390: convert to net_device_ops Stephen Hemminger
2008-12-03 20:10 ` [PATCH 2/3] hydra: " Stephen Hemminger
@ 2008-12-03 20:10 ` Stephen Hemminger
2008-12-04 6:10 ` David Miller
2009-01-14 6:37 ` Magnus Damm
2 siblings, 2 replies; 8+ messages in thread
From: Stephen Hemminger @ 2008-12-03 20:10 UTC (permalink / raw)
To: David Miller; +Cc: netdev
[-- Attachment #1: ne-h300.patch --]
[-- Type: text/plain, Size: 2160 bytes --]
Another device using 8390 library that needs converting.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/Makefile 2008-12-03 12:04:17.000000000 -0800
+++ b/drivers/net/Makefile 2008-12-03 12:07:25.000000000 -0800
@@ -124,7 +124,7 @@ obj-$(CONFIG_NE3210) += ne3210.o 8390.o
obj-$(CONFIG_SB1250_MAC) += sb1250-mac.o
obj-$(CONFIG_B44) += b44.o
obj-$(CONFIG_FORCEDETH) += forcedeth.o
-obj-$(CONFIG_NE_H8300) += ne-h8300.o
+obj-$(CONFIG_NE_H8300) += ne-h8300.o 8390.o
obj-$(CONFIG_AX88796) += ax88796.o
obj-$(CONFIG_TSI108_ETH) += tsi108_eth.o
--- a/drivers/net/ne-h8300.c 2008-12-03 12:04:13.000000000 -0800
+++ b/drivers/net/ne-h8300.c 2008-12-03 12:07:17.000000000 -0800
@@ -167,7 +167,7 @@ static void cleanup_card(struct net_devi
#ifndef MODULE
struct net_device * __init ne_probe(int unit)
{
- struct net_device *dev = ____alloc_ei_netdev(0);
+ struct net_device *dev = alloc_ei_netdev();
int err;
if (!dev)
@@ -193,6 +193,21 @@ out:
}
#endif
+static const struct net_device_ops ne_netdev_ops = {
+ .ndo_open = ne_open,
+ .ndo_stop = ne_close,
+
+ .ndo_start_xmit = ei_start_xmit,
+ .ndo_tx_timeout = ei_tx_timeout,
+ .ndo_get_stats = ei_get_stats,
+ .ndo_set_multicast_list = ei_set_multicast_list,
+ .ndo_validate_addr = eth_validate_addr,
+ .ndo_change_mtu = eth_change_mtu,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = ei_poll,
+#endif
+};
+
static int __init ne_probe1(struct net_device *dev, int ioaddr)
{
int i;
@@ -319,11 +334,9 @@ static int __init ne_probe1(struct net_d
ei_status.block_output = &ne_block_output;
ei_status.get_8390_hdr = &ne_get_8390_hdr;
ei_status.priv = 0;
- dev->open = &ne_open;
- dev->stop = &ne_close;
-#ifdef CONFIG_NET_POLL_CONTROLLER
- dev->poll_controller = __ei_poll;
-#endif
+
+ dev->netdev_ops = &ne_netdev_ops;
+
__NS8390_init(dev, 0);
ret = register_netdev(dev);
@@ -624,7 +637,7 @@ int init_module(void)
int err;
for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
- struct net_device *dev = ____alloc_ei_netdev(0);
+ struct net_device *dev = alloc_ei_netdev();
if (!dev)
break;
if (io[this_dev]) {
--
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] zorro8390: convert to net_device_ops
2008-12-03 20:10 ` [PATCH 1/3] zorro8390: convert to net_device_ops Stephen Hemminger
@ 2008-12-04 6:09 ` David Miller
0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2008-12-04 6:09 UTC (permalink / raw)
To: shemminger; +Cc: netdev
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 03 Dec 2008 12:10:14 -0800
> Another device using 8390 library that needs converting.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] hydra: convert to net_device_ops
2008-12-03 20:10 ` [PATCH 2/3] hydra: " Stephen Hemminger
@ 2008-12-04 6:10 ` David Miller
0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2008-12-04 6:10 UTC (permalink / raw)
To: shemminger; +Cc: netdev
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 03 Dec 2008 12:10:15 -0800
> Another device using 8390 library that needs converting.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] ne-h8300: convert to net_device_ops
2008-12-03 20:10 ` [PATCH 3/3] ne-h8300: " Stephen Hemminger
@ 2008-12-04 6:10 ` David Miller
2009-01-14 6:37 ` Magnus Damm
1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2008-12-04 6:10 UTC (permalink / raw)
To: shemminger; +Cc: netdev
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 03 Dec 2008 12:10:16 -0800
> Another device using 8390 library that needs converting.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Also applied, thanks Stephen.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] ne-h8300: convert to net_device_ops
2008-12-03 20:10 ` [PATCH 3/3] ne-h8300: " Stephen Hemminger
2008-12-04 6:10 ` David Miller
@ 2009-01-14 6:37 ` Magnus Damm
1 sibling, 0 replies; 8+ messages in thread
From: Magnus Damm @ 2009-01-14 6:37 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, Ben Dooks, Paul Mundt, netdev
On Thu, Dec 4, 2008 at 5:10 AM, Stephen Hemminger <shemminger@vyatta.com> wrote:
> Another device using 8390 library that needs converting.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> --- a/drivers/net/Makefile 2008-12-03 12:04:17.000000000 -0800
> +++ b/drivers/net/Makefile 2008-12-03 12:07:25.000000000 -0800
> @@ -124,7 +124,7 @@ obj-$(CONFIG_NE3210) += ne3210.o 8390.o
> obj-$(CONFIG_SB1250_MAC) += sb1250-mac.o
> obj-$(CONFIG_B44) += b44.o
> obj-$(CONFIG_FORCEDETH) += forcedeth.o
> -obj-$(CONFIG_NE_H8300) += ne-h8300.o
> +obj-$(CONFIG_NE_H8300) += ne-h8300.o 8390.o
Are you sure this will work? The ne-h8300 driver includes "lib8390.c"
in the main source with special configuration parameters such as
EI_SHIFT, but with this patch 8390.o contains another lib8390 instance
with a different configuration that gets tied into the net_device_ops.
I have no hardware and I may misunderstand the code, but please double
check.
I came across this when trying to fix another problem with ax88796.
Basically, another lib8390 patch (link below) forgets the case with
all drivers that include "lib8390.c" which in the ax88796 case results
in a missing start_xmit callback.
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9a4a84294b0d60b8c287131478f743ba2bc68949
Paul, Ben, I have a fix for ax88796 that I'll post in a little while.
Cheers,
/ magnus
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-01-14 6:37 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-03 20:10 [PATCH 0/3] More embedded 8390 netdevice ops conversions Stephen Hemminger
2008-12-03 20:10 ` [PATCH 1/3] zorro8390: convert to net_device_ops Stephen Hemminger
2008-12-04 6:09 ` David Miller
2008-12-03 20:10 ` [PATCH 2/3] hydra: " Stephen Hemminger
2008-12-04 6:10 ` David Miller
2008-12-03 20:10 ` [PATCH 3/3] ne-h8300: " Stephen Hemminger
2008-12-04 6:10 ` David Miller
2009-01-14 6:37 ` Magnus Damm
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).