This source file includes following definitions.
- znet_probe
- znet_open
- znet_send_packet
- znet_interrupt
- znet_rx
- znet_close
- net_get_stats
- set_multicast_list
- show_dma
- hardware_init
- update_stop_hit
1
2
3 static char *version = "znet.c:v1.02 9/23/94 becker@cesdis.gsfc.nasa.gov\n";
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65 #include <linux/kernel.h>
66 #include <linux/sched.h>
67 #include <linux/string.h>
68 #include <linux/ptrace.h>
69 #include <linux/errno.h>
70 #include <linux/interrupt.h>
71 #include <linux/ioport.h>
72 #include <asm/system.h>
73 #include <asm/bitops.h>
74 #include <asm/io.h>
75 #include <asm/dma.h>
76
77 #include <linux/netdevice.h>
78 #include <linux/etherdevice.h>
79 #include <linux/skbuff.h>
80 #include <linux/if_arp.h>
81
82 #ifndef ZNET_DEBUG
83 #define ZNET_DEBUG 1
84 #endif
85 static unsigned int znet_debug = ZNET_DEBUG;
86
87
88 #define DMA_RX_MODE 0x14
89 #define DMA_TX_MODE 0x18
90 #define dma_page_eq(ptr1, ptr2) ((long)(ptr1)>>17 == (long)(ptr2)>>17)
91 #define DMA_BUF_SIZE 8192
92 #define RX_BUF_SIZE 8192
93 #define TX_BUF_SIZE 8192
94
95
96 #define CMD0_CHNL_0 0x00
97 #define CMD0_CHNL_1 0x10
98 #define CMD0_NOP (CMD0_CHNL_0)
99 #define CMD0_PORT_1 CMD0_CHNL_1
100 #define CMD1_PORT_0 1
101 #define CMD0_IA_SETUP 1
102 #define CMD0_CONFIGURE 2
103 #define CMD0_MULTICAST_LIST 3
104 #define CMD0_TRANSMIT 4
105 #define CMD0_DUMP 6
106 #define CMD0_DIAGNOSE 7
107 #define CMD0_Rx_ENABLE 8
108 #define CMD0_Rx_DISABLE 10
109 #define CMD0_Rx_STOP 11
110 #define CMD0_RETRANSMIT 12
111 #define CMD0_ABORT 13
112 #define CMD0_RESET 14
113
114 #define CMD0_ACK 0x80
115
116 #define CMD0_STAT0 (0 << 5)
117 #define CMD0_STAT1 (1 << 5)
118 #define CMD0_STAT2 (2 << 5)
119 #define CMD0_STAT3 (3 << 5)
120
121 #define net_local znet_private
122 struct znet_private {
123 int rx_dma, tx_dma;
124 struct enet_statistics stats;
125
126 ushort *rx_start, *rx_cur, *rx_end;
127 ushort *tx_start, *tx_cur, *tx_end;
128 ushort tx_buf_len;
129 };
130
131
132 static struct znet_private zn;
133 static ushort dma_buffer1[DMA_BUF_SIZE/2];
134 static ushort dma_buffer2[DMA_BUF_SIZE/2];
135 static ushort dma_buffer3[DMA_BUF_SIZE/2 + 8];
136
137
138
139
140
141
142
143 static unsigned char i593_init[] = {
144 0xAA,
145
146 0x88,
147 0x2E,
148
149 0x00,
150 0x60,
151 0x00,
152 0xF2,
153 0x00,
154 0x00,
155 0x40,
156 0x5F,
157
158 0x00,
159 0x3F,
160 0x07,
161 0x31,
162
163 0x22,
164
165 };
166
167 struct netidblk {
168 char magic[8];
169 unsigned char netid[8];
170 char nettype, globalopt;
171 char vendor[8];
172 char product[8];
173 char irq1, irq2;
174 char dma1, dma2;
175 short dma_mem_misc[8];
176 short iobase1, iosize1;
177 short iobase2, iosize2;
178 char driver_options;
179 char pad;
180 };
181
182 int znet_probe(struct device *dev);
183 static int znet_open(struct device *dev);
184 static int znet_send_packet(struct sk_buff *skb, struct device *dev);
185 static void znet_interrupt(int irq, struct pt_regs *regs);
186 static void znet_rx(struct device *dev);
187 static int znet_close(struct device *dev);
188 static struct enet_statistics *net_get_stats(struct device *dev);
189 static void set_multicast_list(struct device *dev, int num_addrs, void *addrs);
190 static void hardware_init(struct device *dev);
191 static void update_stop_hit(short ioaddr, unsigned short rx_stop_offset);
192
193 #ifdef notdef
194 static struct sigaction znet_sigaction = { &znet_interrupt, 0, 0, NULL, };
195 #endif
196
197
198
199
200
201
202 int znet_probe(struct device *dev)
203 {
204 int i;
205 struct netidblk *netinfo;
206 char *p;
207
208
209 for(p = (char *)0xf0000; p < (char *)0x100000; p++)
210 if (*p == 'N' && strncmp(p, "NETIDBLK", 8) == 0)
211 break;
212
213 if (p >= (char *)0x100000) {
214 if (znet_debug > 1)
215 printk(KERN_INFO "No Z-Note ethernet adaptor found.\n");
216 return ENODEV;
217 }
218 netinfo = (struct netidblk *)p;
219 dev->base_addr = netinfo->iobase1;
220 dev->irq = netinfo->irq1;
221
222 printk(KERN_INFO "%s: ZNET at %#3x,", dev->name, dev->base_addr);
223
224
225 for (i = 0; i < 6; i++)
226 printk(" %2.2x", dev->dev_addr[i] = netinfo->netid[i]);
227
228 printk(", using IRQ %d DMA %d and %d.\n", dev->irq, netinfo->dma1,
229 netinfo->dma2);
230
231 if (znet_debug > 1) {
232 printk(KERN_INFO "%s: vendor '%16.16s' IRQ1 %d IRQ2 %d DMA1 %d DMA2 %d.\n",
233 dev->name, netinfo->vendor,
234 netinfo->irq1, netinfo->irq2,
235 netinfo->dma1, netinfo->dma2);
236 printk(KERN_INFO "%s: iobase1 %#x size %d iobase2 %#x size %d net type %2.2x.\n",
237 dev->name, netinfo->iobase1, netinfo->iosize1,
238 netinfo->iobase2, netinfo->iosize2, netinfo->nettype);
239 }
240
241 if (znet_debug > 0)
242 printk("%s%s", KERN_INFO, version);
243
244 dev->priv = (void *) &zn;
245 zn.rx_dma = netinfo->dma1;
246 zn.tx_dma = netinfo->dma2;
247
248
249 if (request_irq(dev->irq, &znet_interrupt, 0, "ZNet")
250 || request_dma(zn.rx_dma,"ZNet rx")
251 || request_dma(zn.tx_dma,"ZNet tx")) {
252 printk(KERN_WARNING "%s: Not opened -- resource busy?!?\n", dev->name);
253 return EBUSY;
254 }
255 irq2dev_map[dev->irq] = dev;
256
257
258
259 if (dma_page_eq(dma_buffer1, &dma_buffer1[RX_BUF_SIZE/2-1]))
260 zn.rx_start = dma_buffer1;
261 else
262 zn.rx_start = dma_buffer2;
263
264 if (dma_page_eq(dma_buffer3, &dma_buffer3[RX_BUF_SIZE/2-1]))
265 zn.tx_start = dma_buffer3;
266 else
267 zn.tx_start = dma_buffer2;
268 zn.rx_end = zn.rx_start + RX_BUF_SIZE/2;
269 zn.tx_buf_len = TX_BUF_SIZE/2;
270 zn.tx_end = zn.tx_start + zn.tx_buf_len;
271
272
273 dev->open = &znet_open;
274 dev->hard_start_xmit = &znet_send_packet;
275 dev->stop = &znet_close;
276 dev->get_stats = net_get_stats;
277 dev->set_multicast_list = &set_multicast_list;
278
279
280 ether_setup(dev);
281
282 return 0;
283 }
284
285
286 static int znet_open(struct device *dev)
287 {
288 int ioaddr = dev->base_addr;
289
290 if (znet_debug > 2)
291 printk(KERN_DEBUG "%s: znet_open() called.\n", dev->name);
292
293
294 outb(0x10, 0xe6);
295 outb(inb(0xe7) | 0x84, 0xe7);
296
297
298
299
300
301
302
303
304
305 if (inb(ioaddr) != 0x10 && inb(ioaddr) != 0x00)
306 printk(KERN_WARNING "%s: Problem turning on the transceiver power.\n",
307 dev->name);
308
309 dev->tbusy = 0;
310 dev->interrupt = 0;
311 hardware_init(dev);
312 dev->start = 1;
313
314 return 0;
315 }
316
317 static int znet_send_packet(struct sk_buff *skb, struct device *dev)
318 {
319 int ioaddr = dev->base_addr;
320
321 if (znet_debug > 4)
322 printk(KERN_DEBUG "%s: ZNet_send_packet(%d).\n", dev->name, dev->tbusy);
323
324
325 if (dev->tbusy) {
326 ushort event, tx_status, rx_offset, state;
327 int tickssofar = jiffies - dev->trans_start;
328 if (tickssofar < 10)
329 return 1;
330 outb(CMD0_STAT0, ioaddr); event = inb(ioaddr);
331 outb(CMD0_STAT1, ioaddr); tx_status = inw(ioaddr);
332 outb(CMD0_STAT2, ioaddr); rx_offset = inw(ioaddr);
333 outb(CMD0_STAT3, ioaddr); state = inb(ioaddr);
334 printk(KERN_WARNING "%s: transmit timed out, status %02x %04x %04x %02x,"
335 " resetting.\n", dev->name, event, tx_status, rx_offset, state);
336 if (tx_status == 0x0400)
337 printk(KERN_WARNING "%s: Tx carrier error, check transceiver cable.\n",
338 dev->name);
339 outb(CMD0_RESET, ioaddr);
340 hardware_init(dev);
341 }
342
343 if (skb == NULL) {
344 dev_tint(dev);
345 return 0;
346 }
347
348
349 outb(CMD0_STAT0, ioaddr);
350 if (inw(ioaddr) == 0x0010
351 && inw(ioaddr) == 0x0000
352 && inw(ioaddr) == 0x0010)
353 hardware_init(dev);
354
355
356
357 if (set_bit(0, (void*)&dev->tbusy) != 0)
358 printk(KERN_WARNING "%s: Transmitter access conflict.\n", dev->name);
359 else {
360 short length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN;
361 unsigned char *buf = (void *)(skb+1);
362 ushort *tx_link = zn.tx_cur - 1;
363 ushort rnd_len = (length + 1)>>1;
364
365 {
366 short dma_port = ((zn.tx_dma&3)<<2) + IO_DMA2_BASE;
367 unsigned addr = inb(dma_port);
368 addr |= inb(dma_port) << 8;
369 addr <<= 1;
370 if (((int)zn.tx_cur & 0x1ffff) != addr)
371 printk(KERN_WARNING "Address mismatch at Tx: %#x vs %#x.\n",
372 (int)zn.tx_cur & 0xffff, addr);
373 zn.tx_cur = (ushort *)(((int)zn.tx_cur & 0xfe0000) | addr);
374 }
375
376 if (zn.tx_cur >= zn.tx_end)
377 zn.tx_cur = zn.tx_start;
378 *zn.tx_cur++ = length;
379 if (zn.tx_cur + rnd_len + 1 > zn.tx_end) {
380 int semi_cnt = (zn.tx_end - zn.tx_cur)<<1;
381 memcpy(zn.tx_cur, buf, semi_cnt);
382 rnd_len -= semi_cnt>>1;
383 memcpy(zn.tx_start, buf + semi_cnt, length - semi_cnt);
384 zn.tx_cur = zn.tx_start + rnd_len;
385 } else {
386 memcpy(zn.tx_cur, buf, skb->len);
387 zn.tx_cur += rnd_len;
388 }
389 *zn.tx_cur++ = 0;
390 cli(); {
391 *tx_link = CMD0_TRANSMIT + CMD0_CHNL_1;
392
393 outb(CMD0_TRANSMIT + CMD0_CHNL_1,ioaddr);
394 } sti();
395
396 dev->trans_start = jiffies;
397 if (znet_debug > 4)
398 printk(KERN_DEBUG "%s: Transmitter queued, length %d.\n", dev->name, length);
399 }
400 dev_kfree_skb(skb, FREE_WRITE);
401 return 0;
402 }
403
404
405 static void znet_interrupt(int irq, struct pt_regs * regs)
406 {
407 struct device *dev = irq2dev_map[irq];
408 int ioaddr;
409 int boguscnt = 20;
410
411 if (dev == NULL) {
412 printk(KERN_WARNING "znet_interrupt(): IRQ %d for unknown device.\n", irq);
413 return;
414 }
415
416 dev->interrupt = 1;
417 ioaddr = dev->base_addr;
418
419 outb(CMD0_STAT0, ioaddr);
420 do {
421 ushort status = inb(ioaddr);
422 if (znet_debug > 5) {
423 ushort result, rx_ptr, running;
424 outb(CMD0_STAT1, ioaddr);
425 result = inw(ioaddr);
426 outb(CMD0_STAT2, ioaddr);
427 rx_ptr = inw(ioaddr);
428 outb(CMD0_STAT3, ioaddr);
429 running = inb(ioaddr);
430 printk(KERN_DEBUG "%s: interrupt, status %02x, %04x %04x %02x serial %d.\n",
431 dev->name, status, result, rx_ptr, running, boguscnt);
432 }
433 if ((status & 0x80) == 0)
434 break;
435
436 if ((status & 0x0F) == 4) {
437 struct net_local *lp = (struct net_local *)dev->priv;
438 int tx_status;
439 outb(CMD0_STAT1, ioaddr);
440 tx_status = inw(ioaddr);
441
442 if (tx_status & 0x2000) {
443 lp->stats.tx_packets++;
444 lp->stats.collisions += tx_status & 0xf;
445 } else {
446 if (tx_status & 0x0600) lp->stats.tx_carrier_errors++;
447 if (tx_status & 0x0100) lp->stats.tx_fifo_errors++;
448 if (!(tx_status & 0x0040)) lp->stats.tx_heartbeat_errors++;
449 if (tx_status & 0x0020) lp->stats.tx_aborted_errors++;
450
451 if (tx_status | 0x0760 != 0x0760)
452 lp->stats.tx_errors++;
453 }
454 dev->tbusy = 0;
455 mark_bh(NET_BH);
456 }
457
458 if ((status & 0x40)
459 || (status & 0x0f) == 11) {
460 znet_rx(dev);
461 }
462
463 outb(CMD0_ACK,ioaddr);
464 } while (boguscnt--);
465
466 dev->interrupt = 0;
467 return;
468 }
469
470 static void znet_rx(struct device *dev)
471 {
472 struct net_local *lp = (struct net_local *)dev->priv;
473 int ioaddr = dev->base_addr;
474 int boguscount = 1;
475 short next_frame_end_offset = 0;
476 short *cur_frame_end;
477 short cur_frame_end_offset;
478
479 outb(CMD0_STAT2, ioaddr);
480 cur_frame_end_offset = inw(ioaddr);
481
482 if (cur_frame_end_offset == zn.rx_cur - zn.rx_start) {
483 printk(KERN_WARNING "%s: Interrupted, but nothing to receive, offset %03x.\n",
484 dev->name, cur_frame_end_offset);
485 return;
486 }
487
488
489
490
491
492 while (zn.rx_start + cur_frame_end_offset != zn.rx_cur
493 && ++boguscount < 5) {
494 unsigned short hi_cnt, lo_cnt, hi_status, lo_status;
495 int count, status;
496
497 if (cur_frame_end_offset < 4) {
498
499
500
501 memcpy(zn.rx_end, zn.rx_start, 8);
502 cur_frame_end_offset += (RX_BUF_SIZE/2);
503 }
504 cur_frame_end = zn.rx_start + cur_frame_end_offset - 4;
505
506 lo_status = *cur_frame_end++;
507 hi_status = *cur_frame_end++;
508 status = ((hi_status & 0xff) << 8) + (lo_status & 0xff);
509 lo_cnt = *cur_frame_end++;
510 hi_cnt = *cur_frame_end++;
511 count = ((hi_cnt & 0xff) << 8) + (lo_cnt & 0xff);
512
513 if (znet_debug > 5)
514 printk(KERN_DEBUG "Constructing trailer at location %03x, %04x %04x %04x %04x"
515 " count %#x status %04x.\n",
516 cur_frame_end_offset<<1, lo_status, hi_status, lo_cnt, hi_cnt,
517 count, status);
518 cur_frame_end[-4] = status;
519 cur_frame_end[-3] = next_frame_end_offset;
520 cur_frame_end[-2] = count;
521 next_frame_end_offset = cur_frame_end_offset;
522 cur_frame_end_offset -= ((count + 1)>>1) + 3;
523 if (cur_frame_end_offset < 0)
524 cur_frame_end_offset += RX_BUF_SIZE/2;
525 };
526
527
528 do {
529 ushort *this_rfp_ptr = zn.rx_start + next_frame_end_offset;
530 int status = this_rfp_ptr[-4];
531 int pkt_len = this_rfp_ptr[-2];
532
533 if (znet_debug > 5)
534 printk(KERN_DEBUG "Looking at trailer ending at %04x status %04x length %03x"
535 " next %04x.\n", next_frame_end_offset<<1, status, pkt_len,
536 this_rfp_ptr[-3]<<1);
537
538 if ( ! (status & 0x2000)) {
539 lp->stats.rx_errors++;
540 if (status & 0x0800) lp->stats.rx_crc_errors++;
541 if (status & 0x0400) lp->stats.rx_frame_errors++;
542 if (status & 0x0200) lp->stats.rx_over_errors++;
543 if (status & 0x0100) lp->stats.rx_fifo_errors++;
544 if (status & 0x0080) lp->stats.rx_length_errors++;
545 } else if (pkt_len > 1536) {
546 lp->stats.rx_length_errors++;
547 } else {
548
549 struct sk_buff *skb;
550
551 skb = alloc_skb(pkt_len, GFP_ATOMIC);
552 if (skb == NULL) {
553 if (znet_debug)
554 printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name);
555 lp->stats.rx_dropped++;
556 break;
557 }
558 skb->len = pkt_len;
559 skb->dev = dev;
560
561 if (&zn.rx_cur[(pkt_len+1)>>1] > zn.rx_end) {
562 int semi_cnt = (zn.rx_end - zn.rx_cur)<<1;
563 memcpy((unsigned char *) (skb + 1), zn.rx_cur, semi_cnt);
564 memcpy((unsigned char *) (skb + 1) + semi_cnt, zn.rx_start,
565 pkt_len - semi_cnt);
566 } else {
567 memcpy((unsigned char *) (skb + 1), zn.rx_cur, pkt_len);
568 if (znet_debug > 6) {
569 unsigned int *packet = (unsigned int *) (skb + 1);
570 printk(KERN_DEBUG "Packet data is %08x %08x %08x %08x.\n", packet[0],
571 packet[1], packet[2], packet[3]);
572 }
573 }
574
575 #ifdef HAVE_NETIF_RX
576 netif_rx(skb);
577 #else
578 skb->lock = 0;
579 if (dev_rint((unsigned char*)skb, pkt_len, IN_SKBUFF, dev) != 0) {
580 kfree(skb);
581 lp->stats.rx_dropped++;
582 break;
583 }
584 #endif
585 lp->stats.rx_packets++;
586 }
587 zn.rx_cur = this_rfp_ptr;
588 if (zn.rx_cur >= zn.rx_end)
589 zn.rx_cur -= RX_BUF_SIZE/2;
590 update_stop_hit(ioaddr, (zn.rx_cur - zn.rx_start)<<1);
591 next_frame_end_offset = this_rfp_ptr[-3];
592 if (next_frame_end_offset == 0)
593 break;
594 this_rfp_ptr = zn.rx_start + next_frame_end_offset;
595 } while (--boguscount);
596
597
598
599
600 return;
601 }
602
603
604 static int znet_close(struct device *dev)
605 {
606 int ioaddr = dev->base_addr;
607
608 dev->tbusy = 1;
609 dev->start = 0;
610
611 outb(CMD0_RESET, ioaddr);
612
613 disable_dma(zn.rx_dma);
614 disable_dma(zn.tx_dma);
615
616 free_irq(dev->irq);
617
618 if (znet_debug > 1)
619 printk(KERN_DEBUG "%s: Shutting down ethercard.\n", dev->name);
620
621 outb(0x10, 0xe6);
622 outb(inb(0xe7) & ~0x84, 0xe7);
623
624 return 0;
625 }
626
627
628
629 static struct enet_statistics *net_get_stats(struct device *dev)
630 {
631 struct net_local *lp = (struct net_local *)dev->priv;
632
633 return &lp->stats;
634 }
635
636 #ifdef HAVE_MULTICAST
637
638
639
640
641
642
643
644
645
646
647
648
649 static void set_multicast_list(struct device *dev, int num_addrs, void *addrs)
650 {
651 short ioaddr = dev->base_addr;
652
653 if (num_addrs < 0) {
654
655 i593_init[7] &= ~3; i593_init[7] |= 1;
656 i593_init[13] &= ~8; i593_init[13] |= 8;
657 } else if (num_addrs > 0) {
658
659 i593_init[7] &= ~3; i593_init[7] |= 0;
660 i593_init[13] &= ~8; i593_init[13] |= 8;
661 } else {
662 i593_init[7] &= ~3; i593_init[7] |= 0;
663 i593_init[13] &= ~8; i593_init[13] |= 0;
664 }
665 *zn.tx_cur++ = sizeof(i593_init);
666 memcpy(zn.tx_cur, i593_init, sizeof(i593_init));
667 zn.tx_cur += sizeof(i593_init)/2;
668 outb(CMD0_CONFIGURE+CMD0_CHNL_1, ioaddr);
669 #ifdef not_tested
670 if (num_addrs > 0) {
671 int addrs_len = 6*num_addrs;
672 *zn.tx_cur++ = addrs_len;
673 memcpy(zn.tx_cur, addrs, addrs_len);
674 outb(CMD0_MULTICAST_LIST+CMD0_CHNL_1, ioaddr);
675 zn.tx_cur += addrs_len>>1;
676 }
677 #endif
678 }
679 #endif
680
681 void show_dma(void)
682 {
683 short dma_port = ((zn.tx_dma&3)<<2) + IO_DMA2_BASE;
684 unsigned addr = inb(dma_port);
685 addr |= inb(dma_port) << 8;
686 printk("Addr: %04x cnt:%3x...", addr<<1, get_dma_residue(zn.tx_dma));
687 }
688
689
690
691 static void hardware_init(struct device *dev)
692 {
693 short ioaddr = dev->base_addr;
694
695 zn.rx_cur = zn.rx_start;
696 zn.tx_cur = zn.tx_start;
697
698
699 outb(CMD0_RESET, ioaddr);
700
701 cli(); {
702 disable_dma(zn.rx_dma);
703 clear_dma_ff(zn.rx_dma);
704 set_dma_mode(zn.rx_dma, DMA_RX_MODE);
705 set_dma_addr(zn.rx_dma, (unsigned int) zn.rx_start);
706 set_dma_count(zn.rx_dma, RX_BUF_SIZE);
707 enable_dma(zn.rx_dma);
708
709 disable_dma(zn.tx_dma);
710 clear_dma_ff(zn.tx_dma);
711 set_dma_mode(zn.tx_dma, DMA_TX_MODE);
712 set_dma_addr(zn.tx_dma, (unsigned int) zn.tx_start);
713 set_dma_count(zn.tx_dma, zn.tx_buf_len<<1);
714 enable_dma(zn.tx_dma);
715 } sti();
716
717 if (znet_debug > 1)
718 printk(KERN_DEBUG "%s: Initializing the i82593, tx buf %p... ", dev->name,
719 zn.tx_start);
720
721
722 *zn.tx_cur++ = 0;
723 *zn.tx_cur++ = 0;
724 printk("stat:%02x ", inb(ioaddr)); show_dma();
725 outb(CMD0_CONFIGURE+CMD0_CHNL_1, ioaddr);
726 *zn.tx_cur++ = sizeof(i593_init);
727 memcpy(zn.tx_cur, i593_init, sizeof(i593_init));
728 zn.tx_cur += sizeof(i593_init)/2;
729 printk("stat:%02x ", inb(ioaddr)); show_dma();
730 outb(CMD0_CONFIGURE+CMD0_CHNL_1, ioaddr);
731 *zn.tx_cur++ = 6;
732 memcpy(zn.tx_cur, dev->dev_addr, 6);
733 zn.tx_cur += 3;
734 printk("stat:%02x ", inb(ioaddr)); show_dma();
735 outb(CMD0_IA_SETUP + CMD0_CHNL_1, ioaddr);
736 printk("stat:%02x ", inb(ioaddr)); show_dma();
737
738 update_stop_hit(ioaddr, 8192);
739 if (znet_debug > 1) printk("enabling Rx.\n");
740 outb(CMD0_Rx_ENABLE+CMD0_CHNL_0, ioaddr);
741 dev->tbusy = 0;
742 }
743
744 static void update_stop_hit(short ioaddr, unsigned short rx_stop_offset)
745 {
746 outb(CMD0_PORT_1, ioaddr);
747 if (znet_debug > 5)
748 printk(KERN_DEBUG "Updating stop hit with value %02x.\n",
749 (rx_stop_offset >> 6) | 0x80);
750 outb((rx_stop_offset >> 6) | 0x80, ioaddr);
751 outb(CMD1_PORT_0, ioaddr);
752 }
753
754
755
756
757
758
759
760
761
762