2 * linux/drivers/acorn/net/etherh.c
4 * Copyright (C) 2000-2002 Russell King
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * NS8390 I-cubed EtherH and ANT EtherM specific driver
11 * Thanks to I-Cubed for information on their cards.
12 * EtherM conversion (C) 1999 Chris Kemp and Tim Watterton
13 * EtherM integration (C) 2000 Aleph One Ltd (Tak-Shing Chan)
14 * EtherM integration re-engineered by Russell King.
17 * 08-12-1996 RMK 1.00 Created
18 * RMK 1.03 Added support for EtherLan500 cards
19 * 23-11-1997 RMK 1.04 Added media autodetection
20 * 16-04-1998 RMK 1.05 Improved media autodetection
21 * 10-02-2000 RMK 1.06 Updated for 2.3.43
22 * 13-05-2000 RMK 1.07 Updated for 2.3.99-pre8
23 * 12-10-1999 CK/TEW EtherM driver first release
24 * 21-12-2000 TTC EtherH/EtherM integration
25 * 25-12-2000 RMK 1.08 Clean integration of EtherM into this driver.
26 * 03-01-2002 RMK 1.09 Always enable IRQs if we're in the nic slot.
29 #include <linux/module.h>
30 #include <linux/kernel.h>
31 #include <linux/types.h>
32 #include <linux/fcntl.h>
33 #include <linux/interrupt.h>
34 #include <linux/ioport.h>
36 #include <linux/string.h>
37 #include <linux/errno.h>
38 #include <linux/netdevice.h>
39 #include <linux/etherdevice.h>
40 #include <linux/ethtool.h>
41 #include <linux/skbuff.h>
42 #include <linux/delay.h>
43 #include <linux/device.h>
44 #include <linux/init.h>
45 #include <linux/bitops.h>
46 #include <linux/jiffies.h>
48 #include <asm/ecard.h>
50 #include <asm/system_info.h>
52 #define EI_SHIFT(x) (ei_local->reg_offset[x])
54 #define ei_inb(_p) readb((void __iomem *)_p)
55 #define ei_outb(_v,_p) writeb(_v,(void __iomem *)_p)
56 #define ei_inb_p(_p) readb((void __iomem *)_p)
57 #define ei_outb_p(_v,_p) writeb(_v,(void __iomem *)_p)
59 #define DRV_NAME "etherh"
60 #define DRV_VERSION "1.11"
62 static char version
[] =
63 "EtherH/EtherM Driver (c) 2002-2004 Russell King " DRV_VERSION
"\n";
68 void __iomem
*ioc_fast
;
70 void __iomem
*dma_base
;
72 void __iomem
*ctrl_port
;
78 unsigned long ns8390_offset
;
79 unsigned long dataport_offset
;
80 unsigned long ctrlport_offset
;
84 unsigned char tx_start_page
;
85 unsigned char stop_page
;
88 MODULE_AUTHOR("Russell King");
89 MODULE_DESCRIPTION("EtherH/EtherM driver");
90 MODULE_LICENSE("GPL");
92 #define ETHERH500_DATAPORT 0x800 /* MEMC */
93 #define ETHERH500_NS8390 0x000 /* MEMC */
94 #define ETHERH500_CTRLPORT 0x800 /* IOC */
96 #define ETHERH600_DATAPORT 0x040 /* MEMC */
97 #define ETHERH600_NS8390 0x800 /* MEMC */
98 #define ETHERH600_CTRLPORT 0x200 /* MEMC */
100 #define ETHERH_CP_IE 1
101 #define ETHERH_CP_IF 2
102 #define ETHERH_CP_HEARTBEAT 2
104 #define ETHERH_TX_START_PAGE 1
105 #define ETHERH_STOP_PAGE 127
108 * These came from CK/TEW
110 #define ETHERM_DATAPORT 0x200 /* MEMC */
111 #define ETHERM_NS8390 0x800 /* MEMC */
112 #define ETHERM_CTRLPORT 0x23c /* MEMC */
114 #define ETHERM_TX_START_PAGE 64
115 #define ETHERM_STOP_PAGE 127
117 /* ------------------------------------------------------------------------ */
119 #define etherh_priv(dev) \
120 ((struct etherh_priv *)(((char *)netdev_priv(dev)) + sizeof(struct ei_device)))
122 static inline void etherh_set_ctrl(struct etherh_priv
*eh
, unsigned char mask
)
124 unsigned char ctrl
= eh
->ctrl
| mask
;
126 writeb(ctrl
, eh
->ctrl_port
);
129 static inline void etherh_clr_ctrl(struct etherh_priv
*eh
, unsigned char mask
)
131 unsigned char ctrl
= eh
->ctrl
& ~mask
;
133 writeb(ctrl
, eh
->ctrl_port
);
136 static inline unsigned int etherh_get_stat(struct etherh_priv
*eh
)
138 return readb(eh
->ctrl_port
);
144 static void etherh_irq_enable(ecard_t
*ec
, int irqnr
)
146 struct etherh_priv
*eh
= ec
->irq_data
;
148 etherh_set_ctrl(eh
, ETHERH_CP_IE
);
151 static void etherh_irq_disable(ecard_t
*ec
, int irqnr
)
153 struct etherh_priv
*eh
= ec
->irq_data
;
155 etherh_clr_ctrl(eh
, ETHERH_CP_IE
);
158 static expansioncard_ops_t etherh_ops
= {
159 .irqenable
= etherh_irq_enable
,
160 .irqdisable
= etherh_irq_disable
,
167 etherh_setif(struct net_device
*dev
)
169 struct ei_device
*ei_local
= netdev_priv(dev
);
173 local_irq_save(flags
);
175 /* set the interface type */
176 switch (etherh_priv(dev
)->id
) {
177 case PROD_I3_ETHERLAN600
:
178 case PROD_I3_ETHERLAN600A
:
179 addr
= (void __iomem
*)dev
->base_addr
+ EN0_RCNTHI
;
181 switch (dev
->if_port
) {
182 case IF_PORT_10BASE2
:
183 writeb((readb(addr
) & 0xf8) | 1, addr
);
185 case IF_PORT_10BASET
:
186 writeb((readb(addr
) & 0xf8), addr
);
191 case PROD_I3_ETHERLAN500
:
192 switch (dev
->if_port
) {
193 case IF_PORT_10BASE2
:
194 etherh_clr_ctrl(etherh_priv(dev
), ETHERH_CP_IF
);
197 case IF_PORT_10BASET
:
198 etherh_set_ctrl(etherh_priv(dev
), ETHERH_CP_IF
);
207 local_irq_restore(flags
);
211 etherh_getifstat(struct net_device
*dev
)
213 struct ei_device
*ei_local
= netdev_priv(dev
);
217 switch (etherh_priv(dev
)->id
) {
218 case PROD_I3_ETHERLAN600
:
219 case PROD_I3_ETHERLAN600A
:
220 addr
= (void __iomem
*)dev
->base_addr
+ EN0_RCNTHI
;
221 switch (dev
->if_port
) {
222 case IF_PORT_10BASE2
:
225 case IF_PORT_10BASET
:
226 stat
= readb(addr
) & 4;
231 case PROD_I3_ETHERLAN500
:
232 switch (dev
->if_port
) {
233 case IF_PORT_10BASE2
:
236 case IF_PORT_10BASET
:
237 stat
= etherh_get_stat(etherh_priv(dev
)) & ETHERH_CP_HEARTBEAT
;
251 * Configure the interface. Note that we ignore the other
252 * parts of ifmap, since its mostly meaningless for this driver.
254 static int etherh_set_config(struct net_device
*dev
, struct ifmap
*map
)
257 case IF_PORT_10BASE2
:
258 case IF_PORT_10BASET
:
260 * If the user explicitly sets the interface
261 * media type, turn off automedia detection.
263 dev
->flags
&= ~IFF_AUTOMEDIA
;
264 dev
->if_port
= map
->port
;
277 * Reset the 8390 (hard reset). Note that we can't actually do this.
280 etherh_reset(struct net_device
*dev
)
282 struct ei_device
*ei_local
= netdev_priv(dev
);
283 void __iomem
*addr
= (void __iomem
*)dev
->base_addr
;
285 writeb(E8390_NODMA
+E8390_PAGE0
+E8390_STOP
, addr
);
288 * See if we need to change the interface type.
289 * Note that we use 'interface_num' as a flag
290 * to indicate that we need to change the media.
292 if (dev
->flags
& IFF_AUTOMEDIA
&& ei_local
->interface_num
) {
293 ei_local
->interface_num
= 0;
295 if (dev
->if_port
== IF_PORT_10BASET
)
296 dev
->if_port
= IF_PORT_10BASE2
;
298 dev
->if_port
= IF_PORT_10BASET
;
305 * Write a block of data out to the 8390
308 etherh_block_output (struct net_device
*dev
, int count
, const unsigned char *buf
, int start_page
)
310 struct ei_device
*ei_local
= netdev_priv(dev
);
311 unsigned long dma_start
;
312 void __iomem
*dma_base
, *addr
;
314 if (ei_local
->dmaing
) {
315 netdev_err(dev
, "DMAing conflict in etherh_block_input: "
316 " DMAstat %d irqlock %d\n",
317 ei_local
->dmaing
, ei_local
->irqlock
);
322 * Make sure we have a round number of bytes if we're in word mode.
324 if (count
& 1 && ei_local
->word16
)
327 ei_local
->dmaing
= 1;
329 addr
= (void __iomem
*)dev
->base_addr
;
330 dma_base
= etherh_priv(dev
)->dma_base
;
332 count
= (count
+ 1) & ~1;
333 writeb (E8390_NODMA
| E8390_PAGE0
| E8390_START
, addr
+ E8390_CMD
);
335 writeb (0x42, addr
+ EN0_RCNTLO
);
336 writeb (0x00, addr
+ EN0_RCNTHI
);
337 writeb (0x42, addr
+ EN0_RSARLO
);
338 writeb (0x00, addr
+ EN0_RSARHI
);
339 writeb (E8390_RREAD
| E8390_START
, addr
+ E8390_CMD
);
343 writeb (ENISR_RDC
, addr
+ EN0_ISR
);
344 writeb (count
, addr
+ EN0_RCNTLO
);
345 writeb (count
>> 8, addr
+ EN0_RCNTHI
);
346 writeb (0, addr
+ EN0_RSARLO
);
347 writeb (start_page
, addr
+ EN0_RSARHI
);
348 writeb (E8390_RWRITE
| E8390_START
, addr
+ E8390_CMD
);
350 if (ei_local
->word16
)
351 writesw (dma_base
, buf
, count
>> 1);
353 writesb (dma_base
, buf
, count
);
357 while ((readb (addr
+ EN0_ISR
) & ENISR_RDC
) == 0)
358 if (time_after(jiffies
, dma_start
+ 2*HZ
/100)) { /* 20ms */
359 netdev_warn(dev
, "timeout waiting for TX RDC\n");
361 __NS8390_init (dev
, 1);
365 writeb (ENISR_RDC
, addr
+ EN0_ISR
);
366 ei_local
->dmaing
= 0;
370 * Read a block of data from the 8390
373 etherh_block_input (struct net_device
*dev
, int count
, struct sk_buff
*skb
, int ring_offset
)
375 struct ei_device
*ei_local
= netdev_priv(dev
);
377 void __iomem
*dma_base
, *addr
;
379 if (ei_local
->dmaing
) {
380 netdev_err(dev
, "DMAing conflict in etherh_block_input: "
381 " DMAstat %d irqlock %d\n",
382 ei_local
->dmaing
, ei_local
->irqlock
);
386 ei_local
->dmaing
= 1;
388 addr
= (void __iomem
*)dev
->base_addr
;
389 dma_base
= etherh_priv(dev
)->dma_base
;
392 writeb (E8390_NODMA
| E8390_PAGE0
| E8390_START
, addr
+ E8390_CMD
);
393 writeb (count
, addr
+ EN0_RCNTLO
);
394 writeb (count
>> 8, addr
+ EN0_RCNTHI
);
395 writeb (ring_offset
, addr
+ EN0_RSARLO
);
396 writeb (ring_offset
>> 8, addr
+ EN0_RSARHI
);
397 writeb (E8390_RREAD
| E8390_START
, addr
+ E8390_CMD
);
399 if (ei_local
->word16
) {
400 readsw (dma_base
, buf
, count
>> 1);
402 buf
[count
- 1] = readb (dma_base
);
404 readsb (dma_base
, buf
, count
);
406 writeb (ENISR_RDC
, addr
+ EN0_ISR
);
407 ei_local
->dmaing
= 0;
411 * Read a header from the 8390
414 etherh_get_header (struct net_device
*dev
, struct e8390_pkt_hdr
*hdr
, int ring_page
)
416 struct ei_device
*ei_local
= netdev_priv(dev
);
417 void __iomem
*dma_base
, *addr
;
419 if (ei_local
->dmaing
) {
420 netdev_err(dev
, "DMAing conflict in etherh_get_header: "
421 " DMAstat %d irqlock %d\n",
422 ei_local
->dmaing
, ei_local
->irqlock
);
426 ei_local
->dmaing
= 1;
428 addr
= (void __iomem
*)dev
->base_addr
;
429 dma_base
= etherh_priv(dev
)->dma_base
;
431 writeb (E8390_NODMA
| E8390_PAGE0
| E8390_START
, addr
+ E8390_CMD
);
432 writeb (sizeof (*hdr
), addr
+ EN0_RCNTLO
);
433 writeb (0, addr
+ EN0_RCNTHI
);
434 writeb (0, addr
+ EN0_RSARLO
);
435 writeb (ring_page
, addr
+ EN0_RSARHI
);
436 writeb (E8390_RREAD
| E8390_START
, addr
+ E8390_CMD
);
438 if (ei_local
->word16
)
439 readsw (dma_base
, hdr
, sizeof (*hdr
) >> 1);
441 readsb (dma_base
, hdr
, sizeof (*hdr
));
443 writeb (ENISR_RDC
, addr
+ EN0_ISR
);
444 ei_local
->dmaing
= 0;
448 * Open/initialize the board. This is called (in the current kernel)
449 * sometime after booting when the 'ifconfig' program is run.
451 * This routine should set everything up anew at each open, even
452 * registers that "should" only need to be set once at boot, so that
453 * there is non-reboot way to recover if something goes wrong.
456 etherh_open(struct net_device
*dev
)
458 struct ei_device
*ei_local
= netdev_priv(dev
);
460 if (request_irq(dev
->irq
, __ei_interrupt
, 0, dev
->name
, dev
))
464 * Make sure that we aren't going to change the
465 * media type on the next reset - we are about to
466 * do automedia manually now.
468 ei_local
->interface_num
= 0;
471 * If we are doing automedia detection, do it now.
472 * This is more reliable than the 8390's detection.
474 if (dev
->flags
& IFF_AUTOMEDIA
) {
475 dev
->if_port
= IF_PORT_10BASET
;
478 if (!etherh_getifstat(dev
)) {
479 dev
->if_port
= IF_PORT_10BASE2
;
492 * The inverse routine to etherh_open().
495 etherh_close(struct net_device
*dev
)
498 free_irq (dev
->irq
, dev
);
503 * Read the ethernet address string from the on board rom.
504 * This is an ascii string...
506 static int etherh_addr(char *addr
, struct expansion_card
*ec
)
508 struct in_chunk_dir cd
;
511 if (!ecard_readchunk(&cd
, ec
, 0xf5, 0)) {
512 printk(KERN_ERR
"%s: unable to read module description string\n",
517 s
= strchr(cd
.d
.string
, '(');
521 for (i
= 0; i
< 6; i
++) {
522 addr
[i
] = simple_strtoul(s
+ 1, &s
, 0x10);
523 if (*s
!= (i
== 5? ')' : ':'))
531 printk(KERN_ERR
"%s: unable to parse MAC address: %s\n",
532 dev_name(&ec
->dev
), cd
.d
.string
);
539 * Create an ethernet address from the system serial number.
541 static int __init
etherm_addr(char *addr
)
545 if (system_serial_low
== 0 && system_serial_high
== 0)
548 serial
= system_serial_low
| system_serial_high
;
553 addr
[3] = 0x10 + (serial
>> 24);
554 addr
[4] = serial
>> 16;
555 addr
[5] = serial
>> 8;
559 static void etherh_get_drvinfo(struct net_device
*dev
, struct ethtool_drvinfo
*info
)
561 strlcpy(info
->driver
, DRV_NAME
, sizeof(info
->driver
));
562 strlcpy(info
->version
, DRV_VERSION
, sizeof(info
->version
));
563 strlcpy(info
->bus_info
, dev_name(dev
->dev
.parent
),
564 sizeof(info
->bus_info
));
567 static int etherh_get_settings(struct net_device
*dev
, struct ethtool_cmd
*cmd
)
569 cmd
->supported
= etherh_priv(dev
)->supported
;
570 ethtool_cmd_speed_set(cmd
, SPEED_10
);
571 cmd
->duplex
= DUPLEX_HALF
;
572 cmd
->port
= dev
->if_port
== IF_PORT_10BASET
? PORT_TP
: PORT_BNC
;
573 cmd
->autoneg
= (dev
->flags
& IFF_AUTOMEDIA
?
574 AUTONEG_ENABLE
: AUTONEG_DISABLE
);
578 static int etherh_set_settings(struct net_device
*dev
, struct ethtool_cmd
*cmd
)
580 switch (cmd
->autoneg
) {
582 dev
->flags
|= IFF_AUTOMEDIA
;
585 case AUTONEG_DISABLE
:
588 dev
->if_port
= IF_PORT_10BASET
;
592 dev
->if_port
= IF_PORT_10BASE2
;
598 dev
->flags
&= ~IFF_AUTOMEDIA
;
610 static u32
etherh_get_msglevel(struct net_device
*dev
)
612 struct ei_device
*ei_local
= netdev_priv(dev
);
614 return ei_local
->msg_enable
;
617 static void etherh_set_msglevel(struct net_device
*dev
, u32 v
)
619 struct ei_device
*ei_local
= netdev_priv(dev
);
621 ei_local
->msg_enable
= v
;
624 static const struct ethtool_ops etherh_ethtool_ops
= {
625 .get_settings
= etherh_get_settings
,
626 .set_settings
= etherh_set_settings
,
627 .get_drvinfo
= etherh_get_drvinfo
,
628 .get_ts_info
= ethtool_op_get_ts_info
,
629 .get_msglevel
= etherh_get_msglevel
,
630 .set_msglevel
= etherh_set_msglevel
,
633 static const struct net_device_ops etherh_netdev_ops
= {
634 .ndo_open
= etherh_open
,
635 .ndo_stop
= etherh_close
,
636 .ndo_set_config
= etherh_set_config
,
637 .ndo_start_xmit
= __ei_start_xmit
,
638 .ndo_tx_timeout
= __ei_tx_timeout
,
639 .ndo_get_stats
= __ei_get_stats
,
640 .ndo_set_rx_mode
= __ei_set_multicast_list
,
641 .ndo_validate_addr
= eth_validate_addr
,
642 .ndo_set_mac_address
= eth_mac_addr
,
643 #ifdef CONFIG_NET_POLL_CONTROLLER
644 .ndo_poll_controller
= __ei_poll
,
648 static u32 etherh_regoffsets
[16];
649 static u32 etherm_regoffsets
[16];
652 etherh_probe(struct expansion_card
*ec
, const struct ecard_id
*id
)
654 const struct etherh_data
*data
= id
->data
;
655 struct ei_device
*ei_local
;
656 struct net_device
*dev
;
657 struct etherh_priv
*eh
;
660 ret
= ecard_request_resources(ec
);
664 dev
= ____alloc_ei_netdev(sizeof(struct etherh_priv
));
670 SET_NETDEV_DEV(dev
, &ec
->dev
);
672 dev
->netdev_ops
= ðerh_netdev_ops
;
674 dev
->ethtool_ops
= ðerh_ethtool_ops
;
676 if (data
->supported
& SUPPORTED_Autoneg
)
677 dev
->flags
|= IFF_AUTOMEDIA
;
678 if (data
->supported
& SUPPORTED_TP
) {
679 dev
->flags
|= IFF_PORTSEL
;
680 dev
->if_port
= IF_PORT_10BASET
;
681 } else if (data
->supported
& SUPPORTED_BNC
) {
682 dev
->flags
|= IFF_PORTSEL
;
683 dev
->if_port
= IF_PORT_10BASE2
;
685 dev
->if_port
= IF_PORT_UNKNOWN
;
687 eh
= etherh_priv(dev
);
688 eh
->supported
= data
->supported
;
690 eh
->id
= ec
->cid
.product
;
691 eh
->memc
= ecardm_iomap(ec
, ECARD_RES_MEMC
, 0, PAGE_SIZE
);
697 eh
->ctrl_port
= eh
->memc
;
698 if (data
->ctrl_ioc
) {
699 eh
->ioc_fast
= ecardm_iomap(ec
, ECARD_RES_IOCFAST
, 0, PAGE_SIZE
);
704 eh
->ctrl_port
= eh
->ioc_fast
;
707 dev
->base_addr
= (unsigned long)eh
->memc
+ data
->ns8390_offset
;
708 eh
->dma_base
= eh
->memc
+ data
->dataport_offset
;
709 eh
->ctrl_port
+= data
->ctrlport_offset
;
712 * IRQ and control port handling - only for non-NIC slot cards.
714 if (ec
->slot_no
!= 8) {
715 ecard_setirq(ec
, ðerh_ops
, eh
);
718 * If we're in the NIC slot, make sure the IRQ is enabled
720 etherh_set_ctrl(eh
, ETHERH_CP_IE
);
723 ei_local
= netdev_priv(dev
);
724 spin_lock_init(&ei_local
->page_lock
);
726 if (ec
->cid
.product
== PROD_ANT_ETHERM
) {
727 etherm_addr(dev
->dev_addr
);
728 ei_local
->reg_offset
= etherm_regoffsets
;
730 etherh_addr(dev
->dev_addr
, ec
);
731 ei_local
->reg_offset
= etherh_regoffsets
;
734 ei_local
->name
= dev
->name
;
735 ei_local
->word16
= 1;
736 ei_local
->tx_start_page
= data
->tx_start_page
;
737 ei_local
->rx_start_page
= ei_local
->tx_start_page
+ TX_PAGES
;
738 ei_local
->stop_page
= data
->stop_page
;
739 ei_local
->reset_8390
= etherh_reset
;
740 ei_local
->block_input
= etherh_block_input
;
741 ei_local
->block_output
= etherh_block_output
;
742 ei_local
->get_8390_hdr
= etherh_get_header
;
743 ei_local
->interface_num
= 0;
746 __NS8390_init(dev
, 0);
748 ret
= register_netdev(dev
);
752 netdev_info(dev
, "%s in slot %d, %pM\n",
753 data
->name
, ec
->slot_no
, dev
->dev_addr
);
755 ecard_set_drvdata(ec
, dev
);
762 ecard_release_resources(ec
);
767 static void etherh_remove(struct expansion_card
*ec
)
769 struct net_device
*dev
= ecard_get_drvdata(ec
);
771 ecard_set_drvdata(ec
, NULL
);
773 unregister_netdev(dev
);
777 ecard_release_resources(ec
);
780 static struct etherh_data etherm_data
= {
781 .ns8390_offset
= ETHERM_NS8390
,
782 .dataport_offset
= ETHERM_NS8390
+ ETHERM_DATAPORT
,
783 .ctrlport_offset
= ETHERM_NS8390
+ ETHERM_CTRLPORT
,
784 .name
= "ANT EtherM",
785 .supported
= SUPPORTED_10baseT_Half
,
786 .tx_start_page
= ETHERM_TX_START_PAGE
,
787 .stop_page
= ETHERM_STOP_PAGE
,
790 static struct etherh_data etherlan500_data
= {
791 .ns8390_offset
= ETHERH500_NS8390
,
792 .dataport_offset
= ETHERH500_NS8390
+ ETHERH500_DATAPORT
,
793 .ctrlport_offset
= ETHERH500_CTRLPORT
,
795 .name
= "i3 EtherH 500",
796 .supported
= SUPPORTED_10baseT_Half
,
797 .tx_start_page
= ETHERH_TX_START_PAGE
,
798 .stop_page
= ETHERH_STOP_PAGE
,
801 static struct etherh_data etherlan600_data
= {
802 .ns8390_offset
= ETHERH600_NS8390
,
803 .dataport_offset
= ETHERH600_NS8390
+ ETHERH600_DATAPORT
,
804 .ctrlport_offset
= ETHERH600_NS8390
+ ETHERH600_CTRLPORT
,
805 .name
= "i3 EtherH 600",
806 .supported
= SUPPORTED_10baseT_Half
| SUPPORTED_TP
| SUPPORTED_BNC
| SUPPORTED_Autoneg
,
807 .tx_start_page
= ETHERH_TX_START_PAGE
,
808 .stop_page
= ETHERH_STOP_PAGE
,
811 static struct etherh_data etherlan600a_data
= {
812 .ns8390_offset
= ETHERH600_NS8390
,
813 .dataport_offset
= ETHERH600_NS8390
+ ETHERH600_DATAPORT
,
814 .ctrlport_offset
= ETHERH600_NS8390
+ ETHERH600_CTRLPORT
,
815 .name
= "i3 EtherH 600A",
816 .supported
= SUPPORTED_10baseT_Half
| SUPPORTED_TP
| SUPPORTED_BNC
| SUPPORTED_Autoneg
,
817 .tx_start_page
= ETHERH_TX_START_PAGE
,
818 .stop_page
= ETHERH_STOP_PAGE
,
821 static const struct ecard_id etherh_ids
[] = {
822 { MANU_ANT
, PROD_ANT_ETHERM
, ðerm_data
},
823 { MANU_I3
, PROD_I3_ETHERLAN500
, ðerlan500_data
},
824 { MANU_I3
, PROD_I3_ETHERLAN600
, ðerlan600_data
},
825 { MANU_I3
, PROD_I3_ETHERLAN600A
, ðerlan600a_data
},
829 static struct ecard_driver etherh_driver
= {
830 .probe
= etherh_probe
,
831 .remove
= etherh_remove
,
832 .id_table
= etherh_ids
,
838 static int __init
etherh_init(void)
842 for (i
= 0; i
< 16; i
++) {
843 etherh_regoffsets
[i
] = i
<< 2;
844 etherm_regoffsets
[i
] = i
<< 5;
847 return ecard_register_driver(ðerh_driver
);
850 static void __exit
etherh_exit(void)
852 ecard_remove_driver(ðerh_driver
);
855 module_init(etherh_init
);
856 module_exit(etherh_exit
);