1 /* atari_pamsnet.c PAMsNet device driver for linux68k.
3 * Version: @(#)PAMsNet.c 0.2ß 03/31/96
5 * Author: Torsten Lang <Torsten.Lang@ap.physik.uni-giessen.de>
6 * <Torsten.Lang@jung.de>
8 * This driver is based on my driver PAMSDMA.c for MiNT-Net and
9 * on the driver bionet.c written by
10 * Hartmut Laue <laue@ifk-mp.uni-kiel.de>
11 * and Torsten Narjes <narjes@ifk-mp.uni-kiel.de>
13 * Little adaptions for integration into pl7 by Roman Hodek
17 This driver controls the PAMsNet LAN-Adapter which connects
18 an ATARI ST/TT via the ACSI-port to an Ethernet-based network.
20 This version can be compiled as a loadable module (See the
21 compile command at the bottom of this file).
22 At load time, you can optionally set the debugging level and the
23 fastest response time on the command line of 'insmod'.
26 controls the amount of diagnostic messages:
28 >0 : see code for meaning of printed messages
30 'pamsnet_min_poll_time' (always >=1)
31 gives the time (in jiffies) between polls. Low values
32 increase the system load (beware!)
34 When loaded, a net device with the name 'eth?' becomes available,
35 which can be controlled with the usual 'ifconfig' command.
37 It is possible to compile this driver into the kernel like other
38 (net) drivers. For this purpose, some source files (e.g. config-files
39 makefiles, Space.c) must be changed accordingly. (You may refer to
40 other drivers how to do it.) In this case, the device will be detected
41 at boot time and (probably) appear as 'eth0'.
45 Because the ATARI DMA port is usually shared between several
46 devices (eg. harddisk, floppy) we cannot block the ACSI bus
47 while waiting for interrupts. Therefore we use a polling mechanism
48 to fetch packets from the adapter. For the same reason, we send
49 packets without checking that the previous packet has been sent to
50 the LAN. We rely on the higher levels of the networking code to detect
51 missing packets and resend them.
53 Before we access the ATARI DMA controller, we check if another
54 process is using the DMA. If not, we lock the DMA, perform one or
55 more packet transfers and unlock the DMA before returning.
56 We do not use 'stdma_lock' unconditionally because it is unclear
57 if the networking code can be set to sleep, which will happen if
58 another (possibly slow) device is using the DMA controller.
60 The polling is done via timer interrupts which periodically
61 'simulate' an interrupt from the Ethernet adapter. The time (in jiffies)
62 between polls varies depending on an estimate of the net activity.
63 The allowed range is given by the variable 'bionet_min_poll_time'
64 for the lower (fastest) limit and the constant 'MAX_POLL_TIME'
65 for the higher (slowest) limit.
67 Whenever a packet arrives, we switch to fastest response by setting
68 the polling time to its lowest limit. If the following poll fails,
69 because no packets have arrived, we increase the time for the next
70 poll. When the net activity is low, the polling time effectively
71 stays at its maximum value, resulting in the lowest load for the
75 #define MAX_POLL_TIME 10
77 static char *version
=
78 "pamsnet.c:v0.2beta 30-mar-96 (c) Torsten Lang.\n";
80 #include <linux/module.h>
82 #include <linux/kernel.h>
83 #include <linux/jiffies.h>
84 #include <linux/types.h>
85 #include <linux/fcntl.h>
86 #include <linux/interrupt.h>
87 #include <linux/ioport.h>
89 #include <linux/slab.h>
90 #include <linux/string.h>
91 #include <linux/bitops.h>
92 #include <asm/system.h>
93 #include <asm/pgtable.h>
96 #include <linux/errno.h>
97 #include <asm/atarihw.h>
98 #include <asm/atariints.h>
99 #include <asm/atari_stdma.h>
100 #include <asm/atari_acsi.h>
102 #include <linux/delay.h>
103 #include <linux/timer.h>
104 #include <linux/init.h>
106 #include <linux/netdevice.h>
107 #include <linux/etherdevice.h>
108 #include <linux/skbuff.h>
113 /* use 0 for production, 1 for verification, >2 for debug
119 * Global variable 'pamsnet_debug'. Can be set at load time by 'insmod'
121 unsigned int pamsnet_debug
= NET_DEBUG
;
122 module_param(pamsnet_debug
, int, 0);
123 MODULE_PARM_DESC(pamsnet_debug
, "pamsnet debug enable (0-1)");
124 MODULE_LICENSE("GPL");
126 static unsigned int pamsnet_min_poll_time
= 2;
129 /* Information that need to be kept for each board.
132 struct net_device_stats stats
;
133 long open_time
; /* for debugging */
134 int poll_time
; /* polling time varies with net load */
137 static struct nic_pkt_s
{ /* packet format */
138 unsigned char buffer
[2048];
140 unsigned char *phys_nic_packet
;
142 typedef unsigned char HADDR
[6]; /* 6-byte hardware address of lance */
144 /* Index to functions, as function prototypes.
146 static void start (int target
);
147 static int stop (int target
);
148 static int testpkt (int target
);
149 static int sendpkt (int target
, unsigned char *buffer
, int length
);
150 static int receivepkt (int target
, unsigned char *buffer
);
151 static int inquiry (int target
, unsigned char *buffer
);
152 static HADDR
*read_hw_addr(int target
, unsigned char *buffer
);
153 static void setup_dma (void *address
, unsigned rw_flag
, int num_blocks
);
154 static int send_first (int target
, unsigned char byte
);
155 static int send_1_5 (int lun
, unsigned char *command
, int dma
);
156 static int get_status (void);
157 static int calc_received (void *start_address
);
159 static int pamsnet_open(struct net_device
*dev
);
160 static int pamsnet_send_packet(struct sk_buff
*skb
, struct net_device
*dev
);
161 static void pamsnet_poll_rx(struct net_device
*);
162 static int pamsnet_close(struct net_device
*dev
);
163 static struct net_device_stats
*net_get_stats(struct net_device
*dev
);
164 static void pamsnet_tick(unsigned long);
166 static irqreturn_t
pamsnet_intr(int irq
, void *data
);
168 static DEFINE_TIMER(pamsnet_timer
, pamsnet_tick
, 0, 0);
170 #define STRAM_ADDR(a) (((a) & 0xff000000) == 0)
174 unsigned char reserved1
[0x38];
176 unsigned char reserved2
[0x1c2];
180 * Definitions of commands understood by the PAMs DMA adaptor.
182 * In general the DMA adaptor uses LUN 0, 5, 6 and 7 on one ID changeable
183 * by the PAM's Net software.
185 * LUN 0 works as a harddisk. You can boot the PAM's Net driver there.
186 * LUN 5 works as a harddisk and lets you access the RAM and some I/O HW
187 * area. In sector 0, bytes 0x38-0x3d you find the ethernet HW address
189 * LUN 6 works as a harddisk and lets you access the firmware ROM.
190 * LUN 7 lets you send and receive packets.
192 * Some commands like the INQUIRY command work identical on all used LUNs.
194 * UNKNOWN1 seems to read some data.
195 * Command length is 6 bytes.
196 * UNKNOWN2 seems to read some data (command byte 1 must be !=0). The
197 * following bytes seem to be something like an allocation length.
198 * Command length is 6 bytes.
199 * READPKT reads a packet received by the DMA adaptor.
200 * Command length is 6 bytes.
201 * WRITEPKT sends a packet transferred by the following DMA phase. The length
202 * of the packet is transferred in command bytes 3 and 4.
203 * The adaptor automatically replaces the src hw address in an ethernet
204 * packet by its own hw address.
205 * Command length is 6 bytes.
206 * INQUIRY has the same function as the INQUIRY command supported by harddisks
207 * and other SCSI devices. It lets you detect which device you found
208 * at a given address.
209 * Command length is 6 bytes.
210 * START initializes the DMA adaptor. After this command it is able to send
211 * and receive packets. There is no status byte returned!
212 * Command length is 1 byte.
213 * NUMPKTS gives back the number of received packets waiting in the queue in
215 * Command length is 1 byte.
217 * UNKNOWN4 Function of these three commands is unknown.
218 * UNKNOWN5 The command length of these three commands is 1 byte.
219 * DESELECT immediately deselects the DMA adaptor. May important with interrupt
221 * Command length is 1 byte.
222 * STOP resets the DMA adaptor. After this command packets can no longer
223 * be received or transferred.
224 * Command length is 6 byte.
227 enum {UNKNOWN1
=3, READPKT
=8, UNKNOWN2
, WRITEPKT
=10, INQUIRY
=18, START
,
228 NUMPKTS
=22, UNKNOWN3
, UNKNOWN4
, UNKNOWN5
, DESELECT
, STOP
};
230 #define READSECTOR READPKT
231 #define WRITESECTOR WRITEPKT
233 u_char
*inquire8
="MV PAM's NET/GK";
235 #define DMALOW dma_wd.dma_lo
236 #define DMAMID dma_wd.dma_md
237 #define DMAHIGH dma_wd.dma_hi
238 #define DACCESS dma_wd.fdc_acces_seccount
240 #define MFP_GPIP mfp.par_dt_reg
242 /* Some useful functions */
244 #define INT (!(MFP_GPIP & 0x20))
245 #define DELAY ({MFP_GPIP; MFP_GPIP; MFP_GPIP;})
246 #define WRITEMODE(value) \
247 ({ u_short dummy = value; \
248 __asm__ volatile("movew %0, 0xFFFF8606" : : "d"(dummy)); \
251 #define WRITEBOTH(value1, value2) \
252 ({ u_long dummy = (u_long)(value1)<<16 | (u_short)(value2); \
253 __asm__ volatile("movel %0, 0xFFFF8604" : : "d"(dummy)); \
257 /* Definitions for DMODE */
262 #define DMA_FDC 0x080
263 #define DMA_ACSI 0x000
265 #define DMA_DISABLE 0x040
267 #define SEC_COUNT 0x010
268 #define DMA_WINDOW 0x000
270 #define REG_ACSI 0x008
271 #define REG_FDC 0x000
275 /* Timeout constants */
277 #define TIMEOUTCMD HZ/2 /* ca. 500ms */
278 #define TIMEOUTDMA HZ /* ca. 1s */
279 #define COMMAND_DELAY 500 /* ca. 0.5ms */
282 int lance_target
= -1;
285 /* The following routines access the ethernet board connected to the
286 * ACSI port via the st_dma chip.
289 /* The following lowlevel routines work on physical addresses only and assume
290 * that eventually needed buffers are
291 * - completely located in ST RAM
292 * - are contigous in the physical address space
295 /* Setup the DMA counter */
298 setup_dma (void *address
, unsigned rw_flag
, int num_blocks
)
300 WRITEMODE((unsigned) rw_flag
| DMA_FDC
| SEC_COUNT
| REG_ACSI
|
302 WRITEMODE((unsigned)(rw_flag
^ WRITE
) | DMA_FDC
| SEC_COUNT
| REG_ACSI
|
304 WRITEMODE((unsigned) rw_flag
| DMA_FDC
| SEC_COUNT
| REG_ACSI
|
306 DMALOW
= (unsigned char)((unsigned long)address
& 0xFF);
307 DMAMID
= (unsigned char)(((unsigned long)address
>> 8) & 0xFF);
308 DMAHIGH
= (unsigned char)(((unsigned long)address
>> 16) & 0xFF);
309 WRITEBOTH((unsigned)num_blocks
& 0xFF,
310 rw_flag
| DMA_FDC
| DMA_WINDOW
| REG_ACSI
| A1
);
314 /* Send the first byte of an command block */
317 send_first (int target
, unsigned char byte
)
320 acsi_delay_end(COMMAND_DELAY
);
324 WRITEMODE(DMA_FDC
| DMA_WINDOW
| REG_ACSI
);
328 WRITEBOTH((target
<< 5) | (byte
& 0x1F), DMA_FDC
|
329 DMA_WINDOW
| REG_ACSI
| A1
);
330 return (!acsi_wait_for_IRQ(TIMEOUTCMD
));
333 /* Send the rest of an command block */
336 send_1_5 (int lun
, unsigned char *command
, int dma
)
340 for (i
=0; i
<5; i
++) {
341 WRITEBOTH((!i
? (((lun
& 0x7) << 5) | (command
[i
] & 0x1F))
343 rw
| REG_ACSI
| DMA_WINDOW
|
347 if (i
< 4 && (j
= !acsi_wait_for_IRQ(TIMEOUTCMD
)))
353 /* Read a status byte */
358 WRITEMODE(DMA_FDC
| DMA_WINDOW
| REG_ACSI
| A1
);
360 return ((int)(DACCESS
& 0xFF));
363 /* Calculate the number of received bytes */
366 calc_received (void *start_address
)
369 (((unsigned long)DMAHIGH
<< 16) | ((unsigned)DMAMID
<< 8) | DMALOW
)
370 - (unsigned long)start_address
);
373 /* The following midlevel routines still work on physical addresses ... */
375 /* start() starts the PAM's DMA adaptor */
380 send_first(target
, START
);
383 /* stop() stops the PAM's DMA adaptor and returns a value of zero in case of success */
389 unsigned char cmd_buffer
[5];
391 if (send_first(target
, STOP
))
393 cmd_buffer
[0] = cmd_buffer
[1] = cmd_buffer
[2] =
394 cmd_buffer
[3] = cmd_buffer
[4] = 0;
395 if (send_1_5(7, cmd_buffer
, 0) ||
396 !acsi_wait_for_IRQ(TIMEOUTDMA
) ||
404 /* testpkt() returns the number of received packets waiting in the queue */
411 if (send_first(target
, NUMPKTS
))
418 /* inquiry() returns 0 when PAM's DMA found, -1 when timeout, -2 otherwise */
419 /* Please note: The buffer is for internal use only but must be defined! */
422 inquiry (int target
, unsigned char *buffer
)
425 unsigned char *vbuffer
= phys_to_virt((unsigned long)buffer
);
426 unsigned char cmd_buffer
[5];
428 if (send_first(target
, INQUIRY
))
430 setup_dma(buffer
, READ
, 1);
431 vbuffer
[8] = vbuffer
[27] = 0; /* Avoid confusion with previous read data */
432 cmd_buffer
[0] = cmd_buffer
[1] = cmd_buffer
[2] = cmd_buffer
[4] = 0;
434 if (send_1_5(5, cmd_buffer
, 1) ||
435 !acsi_wait_for_IRQ(TIMEOUTDMA
) ||
437 (calc_received(buffer
) < 32))
439 dma_cache_maintenance((unsigned long)(buffer
+8), 20, 0);
440 if (memcmp(inquire8
, vbuffer
+8, 20))
446 printk("inquiry of target %d: %s\n", target
, vbuffer
+8);
452 * read_hw_addr() reads the sector containing the hwaddr and returns
453 * a pointer to it (virtual address!) or 0 in case of an error
457 *read_hw_addr(int target
, unsigned char *buffer
)
460 unsigned char cmd_buffer
[5];
462 if (send_first(target
, READSECTOR
))
464 setup_dma(buffer
, READ
, 1);
465 cmd_buffer
[0] = cmd_buffer
[1] = cmd_buffer
[2] = cmd_buffer
[4] = 0;
467 if (send_1_5(5, cmd_buffer
, 1) ||
468 !acsi_wait_for_IRQ(TIMEOUTDMA
) ||
471 ret
= phys_to_virt((unsigned long)&(((DMAHWADDR
*)buffer
)->hwaddr
));
472 dma_cache_maintenance((unsigned long)buffer
, 512, 0);
478 pamsnet_intr(int irq
, void *data
)
483 /* receivepkt() loads a packet to a given buffer and returns its length */
486 receivepkt (int target
, unsigned char *buffer
)
489 unsigned char cmd_buffer
[5];
491 if (send_first(target
, READPKT
))
493 setup_dma(buffer
, READ
, 3);
494 cmd_buffer
[0] = cmd_buffer
[1] = cmd_buffer
[2] = cmd_buffer
[4] = 0;
496 if (send_1_5(7, cmd_buffer
, 1) ||
497 !acsi_wait_for_IRQ(TIMEOUTDMA
) ||
500 ret
= calc_received(buffer
);
505 /* sendpkt() sends a packet and returns a value of zero when the packet was sent
509 sendpkt (int target
, unsigned char *buffer
, int length
)
512 unsigned char cmd_buffer
[5];
514 if (send_first(target
, WRITEPKT
))
516 setup_dma(buffer
, WRITE
, 3);
517 cmd_buffer
[0] = cmd_buffer
[1] = cmd_buffer
[4] = 0;
518 cmd_buffer
[2] = length
>> 8;
519 cmd_buffer
[3] = length
& 0xFF;
520 if (send_1_5(7, cmd_buffer
, 1) ||
521 !acsi_wait_for_IRQ(TIMEOUTDMA
) ||
529 /* The following higher level routines work on virtual addresses and convert them to
530 * physical addresses when passed to the lowlevel routines. It's up to the higher level
531 * routines to copy data from Alternate RAM to ST RAM if neccesary!
534 /* Check for a network adaptor of this type, and return '0' if one exists.
537 struct net_device
* __init
pamsnet_probe (int unit
)
539 struct net_device
*dev
;
544 unsigned char station_addr
[6];
545 static unsigned version_printed
;
546 /* avoid "Probing for..." printed 4 times - the driver is supporting only one adapter now! */
547 static int no_more_found
;
550 return ERR_PTR(-ENODEV
);
553 dev
= alloc_etherdev(sizeof(struct net_local
));
555 return ERR_PTR(-ENOMEM
);
557 sprintf(dev
->name
, "eth%d", unit
);
558 netdev_boot_setup_check(dev
);
560 SET_MODULE_OWNER(dev
);
562 printk("Probing for PAM's Net/GK Adapter...\n");
564 /* Allocate the DMA buffer here since we need it for probing! */
566 nic_packet
= (struct nic_pkt_s
*)acsi_buffer
;
567 phys_nic_packet
= (unsigned char *)phys_acsi_buffer
;
568 if (pamsnet_debug
> 0) {
569 printk("nic_packet at 0x%p, phys at 0x%p\n",
570 nic_packet
, phys_nic_packet
);
573 stdma_lock(pamsnet_intr
, NULL
);
576 for (i
=0; i
<8; i
++) {
577 /* Do two inquiries to cover cases with strange equipment on previous ID */
578 /* blocking the ACSI bus (like the SLMC804 laser printer controller... */
579 inquiry(i
, phys_nic_packet
);
580 if (!inquiry(i
, phys_nic_packet
)) {
587 printk("ID: %d\n",i
);
589 if (lance_target
>= 0) {
590 if (!(hwaddr
= read_hw_addr(lance_target
, phys_nic_packet
)))
593 memcpy (station_addr
, hwaddr
, ETH_ALEN
);
599 if (lance_target
< 0) {
600 printk("No PAM's Net/GK found.\n");
602 return ERR_PTR(-ENODEV
);
605 if (pamsnet_debug
> 0 && version_printed
++ == 0)
608 printk("%s: %s found on target %01d, eth-addr: %02x:%02x:%02x:%02x:%02x:%02x.\n",
609 dev
->name
, "PAM's Net/GK", lance_target
,
610 station_addr
[0], station_addr
[1], station_addr
[2],
611 station_addr
[3], station_addr
[4], station_addr
[5]);
613 /* Initialize the device structure. */
614 dev
->open
= pamsnet_open
;
615 dev
->stop
= pamsnet_close
;
616 dev
->hard_start_xmit
= pamsnet_send_packet
;
617 dev
->get_stats
= net_get_stats
;
619 /* Fill in the fields of the device structure with ethernet-generic
620 * values. This should be in a common file instead of per-driver.
623 for (i
= 0; i
< ETH_ALEN
; i
++) {
625 dev
->broadcast
[i
] = 0xff;
627 dev
->dev_addr
[i
] = station_addr
[i
];
629 err
= register_netdev(dev
);
637 /* Open/initialize the board. This is called (in the current kernel)
638 sometime after booting when the 'ifconfig' program is run.
640 This routine should set everything up anew at each open, even
641 registers that "should" only need to be set once at boot, so that
642 there is non-reboot way to recover if something goes wrong.
645 pamsnet_open(struct net_device
*dev
)
647 struct net_local
*lp
= netdev_priv(dev
);
649 if (pamsnet_debug
> 0)
650 printk("pamsnet_open\n");
651 stdma_lock(pamsnet_intr
, NULL
);
654 /* Reset the hardware here.
659 lp
->open_time
= 0; /*jiffies*/
660 lp
->poll_time
= MAX_POLL_TIME
;
668 pamsnet_timer
.data
= (long)dev
;
669 pamsnet_timer
.expires
= jiffies
+ lp
->poll_time
;
670 add_timer(&pamsnet_timer
);
675 pamsnet_send_packet(struct sk_buff
*skb
, struct net_device
*dev
)
677 struct net_local
*lp
= netdev_priv(dev
);
680 /* Block a timer-based transmit from overlapping. This could better be
681 * done with atomic_swap(1, dev->tbusy), but set_bit() works as well.
683 local_irq_save(flags
);
685 if (stdma_islocked()) {
686 local_irq_restore(flags
);
687 lp
->stats
.tx_errors
++;
690 int length
= ETH_ZLEN
< skb
->len
? skb
->len
: ETH_ZLEN
;
691 unsigned long buf
= virt_to_phys(skb
->data
);
694 stdma_lock(pamsnet_intr
, NULL
);
697 local_irq_restore(flags
);
698 if( !STRAM_ADDR(buf
+length
-1) ) {
699 skb_copy_from_linear_data(skb
, nic_packet
->buffer
,
701 buf
= (unsigned long)phys_nic_packet
;
704 dma_cache_maintenance(buf
, length
, 1);
706 stat
= sendpkt(lance_target
, (unsigned char *)buf
, length
);
710 dev
->trans_start
= jiffies
;
712 lp
->stats
.tx_packets
++;
713 lp
->stats
.tx_bytes
+=length
;
720 /* We have a good packet(s), get it/them out of the buffers.
723 pamsnet_poll_rx(struct net_device
*dev
)
725 struct net_local
*lp
= netdev_priv(dev
);
731 local_irq_save(flags
);
732 /* ++roman: Take care at locking the ST-DMA... This must be done with ints
733 * off, since otherwise an int could slip in between the question and the
734 * locking itself, and then we'd go to sleep... And locking itself is
735 * necessary to keep the floppy_change timer from working with ST-DMA
737 if (stdma_islocked()) {
738 local_irq_restore(flags
);
741 stdma_lock(pamsnet_intr
, NULL
);
743 local_irq_restore(flags
);
745 boguscount
= testpkt(lance_target
);
746 if( lp
->poll_time
< MAX_POLL_TIME
) lp
->poll_time
++;
748 while(boguscount
--) {
749 pkt_len
= receivepkt(lance_target
, phys_nic_packet
);
751 if( pkt_len
< 60 ) break;
755 dma_cache_maintenance((unsigned long)phys_nic_packet
, pkt_len
, 0);
757 lp
->poll_time
= pamsnet_min_poll_time
; /* fast poll */
758 if( pkt_len
>= 60 && pkt_len
<= 2048 ) {
762 /* Malloc up new buffer.
764 skb
= alloc_skb(pkt_len
, GFP_ATOMIC
);
766 printk("%s: Memory squeeze, dropping packet.\n",
768 lp
->stats
.rx_dropped
++;
774 /* 'skb->data' points to the start of sk_buff data area.
776 skb_copy_to_linear_data(skb
, nic_packet
->buffer
,
779 dev
->last_rx
= jiffies
;
780 lp
->stats
.rx_packets
++;
781 lp
->stats
.rx_bytes
+=pkt_len
;
785 /* If any worth-while packets have been received, dev_rint()
786 has done a mark_bh(INET_BH) for us and will work on them
787 when we get to the bottom-half routine.
795 /* pamsnet_tick: called by pamsnet_timer. Reads packets from the adapter,
796 * passes them to the higher layers and restarts the timer.
799 pamsnet_tick(unsigned long data
)
801 struct net_device
*dev
= (struct net_device
*)data
;
802 struct net_local
*lp
= netdev_priv(dev
);
804 if( pamsnet_debug
> 0 && (lp
->open_time
++ & 7) == 8 )
805 printk("pamsnet_tick: %ld\n", lp
->open_time
);
807 pamsnet_poll_rx(dev
);
809 pamsnet_timer
.expires
= jiffies
+ lp
->poll_time
;
810 add_timer(&pamsnet_timer
);
813 /* The inverse routine to pamsnet_open().
816 pamsnet_close(struct net_device
*dev
)
818 struct net_local
*lp
= netdev_priv(dev
);
820 if (pamsnet_debug
> 0)
821 printk("pamsnet_close, open_time=%ld\n", lp
->open_time
);
822 del_timer(&pamsnet_timer
);
823 stdma_lock(pamsnet_intr
, NULL
);
840 /* Get the current statistics.
841 This may be called with the card open or closed.
843 static struct net_device_stats
*net_get_stats(struct net_device
*dev
)
845 struct net_local
*lp
= netdev_priv(dev
);
852 static struct net_device
*pam_dev
;
854 int init_module(void)
856 pam_dev
= pamsnet_probe(-1);
858 return PTR_ERR(pam_dev
);
862 void cleanup_module(void)
864 unregister_netdev(pam_dev
);
865 free_netdev(pam_dev
);
871 * compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/include
872 -b m68k-linuxaout -Wall -Wstrict-prototypes -O2
873 -fomit-frame-pointer -pipe -DMODULE -I../../net/inet -c atari_pamsnet.c"
875 * kept-new-versions: 5