1 /* $NetBSD: smc90cx6.c,v 1.38 2001/07/07 15:57:53 thorpej Exp $ */
5 * Copyright (c) 1994, 1995, 1998 The NetBSD Foundation, Inc.
8 * This code is derived from software contributed to The NetBSD Foundation
9 * by Ignatios Souvatzis.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 * This product includes software developed by the NetBSD
22 * Foundation, Inc. and its contributors.
23 * 4. Neither the name of The NetBSD Foundation nor the names of its
24 * contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
27 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
31 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGE.
41 * Chip core driver for the SMC90c26 / SMC90c56 (and SMC90c66 in '56
42 * compatibility mode) boards
45 /* #define CMSOFTCOPY */
46 #define CMRETRANSMIT /**/
49 #include <sys/param.h>
50 #include <sys/systm.h>
51 #include <sys/sockio.h>
53 #include <sys/module.h>
54 #include <sys/kernel.h>
55 #include <sys/socket.h>
56 #include <sys/syslog.h>
59 #include <machine/bus.h>
61 #include <machine/resource.h>
63 #if __FreeBSD_version < 500000
64 #include <machine/clock.h>
68 #include <net/if_dl.h>
69 #include <net/if_types.h>
70 #include <net/if_arc.h>
75 #include <net/bpfdesc.h>
79 #include <dev/cm/smc90cx6reg.h>
80 #include <dev/cm/smc90cx6var.h>
82 MODULE_DEPEND(if_cm, arcnet, 1, 1, 1);
84 /* these should be elsewhere */
87 #define ARC_MIN_FORBID_LEN 254
88 #define ARC_MAX_FORBID_LEN 256
89 #define ARC_MAX_LEN 508
90 #define ARC_ADDR_LEN 1
92 /* for watchdog timer. This should be more than enough. */
93 #define ARCTIMEOUT (5*IFNET_SLOWHZ)
98 bus_space_read_1(rman_get_bustag((sc)->port_res), \
99 rman_get_bushandle((sc)->port_res), \
101 #define PUTREG(off, value) \
102 bus_space_write_1(rman_get_bustag((sc)->port_res), \
103 rman_get_bushandle((sc)->port_res), \
105 #define GETMEM(off) \
106 bus_space_read_1(rman_get_bustag((sc)->mem_res), \
107 rman_get_bushandle((sc)->mem_res), \
109 #define PUTMEM(off, value) \
110 bus_space_write_1(rman_get_bustag((sc)->mem_res), \
111 rman_get_bushandle((sc)->mem_res), \
114 devclass_t cm_devclass;
117 * This currently uses 2 bufs for tx, 2 for rx
121 * rx has a fillcount variable. If fillcount > (NRXBUF-1),
122 * rx can be switched off from rx hard int.
123 * Else rx is restarted on the other receiver.
124 * rx soft int counts down. if it is == (NRXBUF-1), it restarts
126 * To ensure packet ordering (we need that for 1201 later), we have a counter
127 * which is incremented modulo 256 on each receive and a per buffer
128 * variable, which is set to the counter on filling. The soft int can
129 * compare both values to determine the older packet.
131 * Transmit direction:
133 * cm_start checks tx_fillcount
136 * else fill tx_act ^ 1 && inc tx_fillcount
138 * check tx_fillcount again.
139 * case 2: set IFF_OACTIVE to stop arc_output from filling us.
142 * tint clears IFF_OCATIVE, decrements and checks tx_fillcount
143 * case 1: start tx on tx_act ^ 1, softcall cm_start
144 * case 0: softcall cm_start
146 * #define fill(i) get mbuf && copy mbuf to chip(i)
149 void cm_init(void *);
150 void cm_reset(struct cm_softc *);
151 void cm_start(struct ifnet *);
152 int cm_ioctl(struct ifnet *, unsigned long, caddr_t);
153 void cm_watchdog(struct ifnet *);
154 void cm_srint(void *vsc);
155 static void cm_tint(struct cm_softc *, int);
156 void cm_reconwatch(void *);
163 struct cm_softc *sc = device_get_softc(dev);
165 error = cm_alloc_port(dev, 0, CM_IO_PORTS);
169 if (GETREG(CMSTAT) == 0xff)
172 error = cm_alloc_memory(dev, 0, 0x800);
180 * Allocate a port resource with the given resource id.
183 cm_alloc_port(dev, rid, size)
188 struct cm_softc *sc = device_get_softc(dev);
189 struct resource *res;
191 res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
192 0ul, ~0ul, size, RF_ACTIVE);
196 sc->port_used = size;
204 * Allocate a memory resource with the given resource id.
207 cm_alloc_memory(dev, rid, size)
212 struct cm_softc *sc = device_get_softc(dev);
213 struct resource *res;
215 res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid,
216 0ul, ~0ul, size, RF_ACTIVE);
228 * Allocate an irq resource with the given resource id.
231 cm_alloc_irq(dev, rid)
235 struct cm_softc *sc = device_get_softc(dev);
236 struct resource *res;
238 res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid,
239 0ul, ~0ul, 1, RF_ACTIVE);
250 * Release all resources
253 cm_release_resources(dev)
256 struct cm_softc *sc = device_get_softc(dev);
259 bus_deactivate_resource(dev, SYS_RES_IOPORT,
260 sc->port_rid, sc->port_res);
261 bus_release_resource(dev, SYS_RES_IOPORT,
262 sc->port_rid, sc->port_res);
266 bus_deactivate_resource(dev, SYS_RES_MEMORY,
267 sc->mem_rid, sc->mem_res);
268 bus_release_resource(dev, SYS_RES_MEMORY,
269 sc->mem_rid, sc->mem_res);
273 bus_deactivate_resource(dev, SYS_RES_IRQ,
274 sc->irq_rid, sc->irq_res);
275 bus_release_resource(dev, SYS_RES_IRQ,
276 sc->irq_rid, sc->irq_res);
286 struct ifnet *ifp = &sc->sc_arccom.ac_if;
288 u_int8_t linkaddress;
293 * read the arcnet address from the board
299 } while (!(GETREG(CMSTAT) & CM_POR));
301 linkaddress = GETMEM(CMMACOFF);
303 /* clear the int mask... */
308 PUTREG(CMCMD, CM_CONF(CONF_LONG));
309 PUTREG(CMCMD, CM_CLR(CLR_POR|CLR_RECONFIG));
310 sc->sc_recontime = sc->sc_reconcount = 0;
312 /* and reenable kernel int level */
316 * set interface to stopped condition (reset)
324 ifp->if_output = arc_output;
325 ifp->if_start = cm_start;
326 ifp->if_ioctl = cm_ioctl;
327 ifp->if_watchdog = cm_watchdog;
328 ifp->if_init = cm_init;
329 /* XXX IFQ_SET_READY(&ifp->if_snd); */
330 ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
332 ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX;
334 arc_ifattach(ifp, linkaddress);
337 sc->sc_rxcookie = softintr_establish(IPL_SOFTNET, cm_srint, sc);
338 sc->sc_txcookie = softintr_establish(IPL_SOFTNET,
339 (void (*)(void *))cm_start, ifp);
342 #if __FreeBSD_version < 500000
343 callout_init(&sc->sc_recon_ch);
345 callout_init(&sc->sc_recon_ch, 0);
349 if_printf(ifp, "link addr 0x%02x(%d)\n", linkaddress, linkaddress);
361 struct cm_softc *sc = (struct cm_softc *)xsc;
365 ifp = &sc->sc_arccom.ac_if;
367 if ((ifp->if_flags & IFF_RUNNING) == 0) {
369 ifp->if_flags |= IFF_RUNNING;
377 * Reset the interface...
379 * this assumes that it is called inside a critical section...
389 ifp = &sc->sc_arccom.ac_if;
392 if_printf(ifp, "reset\n");
394 /* stop and restart hardware */
399 } while (!(GETREG(CMSTAT) & CM_POR));
401 linkaddress = GETMEM(CMMACOFF);
403 #if defined(CM_DEBUG) && (CM_DEBUG > 2)
404 if_printf(ifp, "reset: card reset, link addr = 0x%02x (%d)\n",
405 linkaddress, linkaddress);
408 /* tell the routing level about the (possibly changed) link address */
409 arc_storelladdr(ifp, linkaddress);
412 /* POR is NMI, but we need it below: */
413 sc->sc_intmask = CM_RECON|CM_POR;
414 PUTREG(CMSTAT, sc->sc_intmask);
415 PUTREG(CMCMD, CM_CONF(CONF_LONG));
418 if_printf(ifp, "reset: chip configured, status=0x%02x\n",
421 PUTREG(CMCMD, CM_CLR(CLR_POR|CLR_RECONFIG));
424 if_printf(ifp, "reset: bits cleared, status=0x%02x\n",
428 sc->sc_reconcount_excessive = ARC_EXCESSIVE_RECONS;
432 sc->sc_intmask |= CM_RI;
433 sc->sc_rx_fillcount = 0;
436 PUTREG(CMCMD, CM_RXBC(2));
437 PUTREG(CMSTAT, sc->sc_intmask);
440 if_printf(ifp, "reset: started receiver, status=0x%02x\n",
444 /* and init transmitter status */
446 sc->sc_tx_fillcount = 0;
448 ifp->if_flags |= IFF_RUNNING;
449 ifp->if_flags &= ~IFF_OACTIVE;
455 * Take interface offline
461 /* Stop the interrupts */
464 /* Stop the interface */
467 /* Stop watchdog timer */
468 sc->sc_arccom.ac_if.if_timer = 0;
472 * Start output on interface. Get another datagram to send
473 * off the interface queue, and copy it to the
474 * interface becore starting the output
476 * this assumes that it is called inside a critical section...
477 * XXX hm... does it still?
484 struct cm_softc *sc = ifp->if_softc;
488 int len, tlen, offset, s, buffer;
490 u_long copystart, lencopy, perbyte;
493 #if defined(CM_DEBUG) && (CM_DEBUG > 3)
494 if_printf(ifp, "start(%p)\n", ifp);
497 if ((ifp->if_flags & IFF_RUNNING) == 0)
502 if (sc->sc_tx_fillcount >= 2) {
507 m = arc_frag_next(ifp);
508 buffer = sc->sc_tx_act ^ 1;
516 * If bpf is listening on this interface, let it
517 * see the packet before we commit it to the wire
519 * (can't give the copy in A2060 card RAM to bpf, because
520 * that RAM is just accessed as on every other byte)
525 if (m->m_len < ARC_HDRLEN)
526 m = m_pullup(m, ARC_HDRLEN);/* gcc does structure padding */
527 if_printf(ifp, "start: filling %d from %d to %d type %d\n",
528 buffer, mtod(m, u_char *)[0],
529 mtod(m, u_char *)[1], mtod(m, u_char *)[2]);
534 cm_ram_ptr = buffer*512;
539 /* write the addresses to RAM and throw them away */
542 * Hardware does this: Yet Another Microsecond Saved.
543 * (btw, timing code says usually 2 microseconds)
544 * PUTMEM(cm_ram_ptr + 0, mtod(m, u_char *)[0]);
547 PUTMEM(cm_ram_ptr + 1, mtod(m, u_char *)[1]);
550 /* get total length left at this point */
551 tlen = m->m_pkthdr.len;
552 if (tlen < ARC_MIN_FORBID_LEN) {
554 PUTMEM(cm_ram_ptr + 2, offset);
556 PUTMEM(cm_ram_ptr + 2, 0);
557 if (tlen <= ARC_MAX_FORBID_LEN)
558 offset = 255; /* !!! */
560 if (tlen > ARC_MAX_LEN)
564 PUTMEM(cm_ram_ptr + 3, offset);
567 cm_ram_ptr += offset;
569 /* lets loop through the mbuf chain */
571 for (mp = m; mp; mp = mp->m_next) {
572 if ((len = mp->m_len)) { /* YAMS */
573 bus_space_write_region_1(
574 rman_get_bustag(sc->mem_res),
575 rman_get_bushandle(sc->mem_res),
576 cm_ram_ptr, mtod(mp, caddr_t), len);
582 sc->sc_broadcast[buffer] = (m->m_flags & M_BCAST) != 0;
583 sc->sc_retransmits[buffer] = (m->m_flags & M_BCAST) ? 1 : 5;
585 /* actually transmit the packet */
588 if (++sc->sc_tx_fillcount > 1) {
590 * We are filled up to the rim. No more bufs for the moment,
593 ifp->if_flags |= IFF_OACTIVE;
596 if_printf(ifp, "start: starting transmitter on buffer %d\n",
599 /* Transmitter was off, start it */
600 sc->sc_tx_act = buffer;
603 * We still can accept another buf, so don't:
604 * ifp->if_flags |= IFF_OACTIVE;
606 sc->sc_intmask |= CM_TA;
607 PUTREG(CMCMD, CM_TX(buffer));
608 PUTREG(CMSTAT, sc->sc_intmask);
610 sc->sc_arccom.ac_if.if_timer = ARCTIMEOUT;
616 * After 10 times reading the docs, I realized
617 * that in the case the receiver NAKs the buffer request,
618 * the hardware retries till shutdown.
619 * This is integrated now in the code above.
626 * Arcnet interface receiver soft interrupt:
627 * get the stuff out of any filled buffer we find.
633 struct cm_softc *sc = (struct cm_softc *)vsc;
634 int buffer, len, offset, s, type;
637 struct arc_header *ah;
640 ifp = &sc->sc_arccom.ac_if;
643 buffer = sc->sc_rx_act ^ 1;
646 /* Allocate header mbuf */
647 MGETHDR(m, M_DONTWAIT, MT_DATA);
651 * in case s.th. goes wrong with mem, drop it
652 * to make sure the receiver can be started again
653 * count it as input error (we dont have any other
660 m->m_pkthdr.rcvif = ifp;
663 * Align so that IP packet will be longword aligned. Here we
664 * assume that m_data of new packet is longword aligned.
665 * When implementing PHDS, we might have to change it to 2,
666 * (2*sizeof(ulong) - CM_HDRNEWLEN)), packet type dependent.
669 cm_ram_ptr = buffer*512;
670 offset = GETMEM(cm_ram_ptr + 2);
674 offset = GETMEM(cm_ram_ptr + 3);
679 * first +2 bytes for align fixup below
680 * second +2 bytes are for src/dst addresses
682 if ((len + 2 + 2) > MHLEN) {
683 /* attach an mbuf cluster */
684 MCLGET(m, M_DONTWAIT);
686 /* Insist on getting a cluster */
687 if ((m->m_flags & M_EXT) == 0) {
698 type = GETMEM(cm_ram_ptr + offset);
699 m->m_data += 1 + arc_isphds(type);
700 /* mbuf filled with ARCnet addresses */
701 m->m_pkthdr.len = m->m_len = len + 2;
703 ah = mtod(m, struct arc_header *);
704 ah->arc_shost = GETMEM(cm_ram_ptr + 0);
705 ah->arc_dhost = GETMEM(cm_ram_ptr + 1);
707 bus_space_read_region_1(
708 rman_get_bustag(sc->mem_res), rman_get_bushandle(sc->mem_res),
709 cm_ram_ptr + offset, mtod(m, u_char *) + 2, len);
721 /* mark buffer as invalid by source id 0 */
722 PUTMEM(buffer << 9, 0);
725 if (--sc->sc_rx_fillcount == 2 - 1) {
727 /* was off, restart it on buffer just emptied */
728 sc->sc_rx_act = buffer;
729 sc->sc_intmask |= CM_RI;
731 /* this also clears the RI flag interupt: */
732 PUTREG(CMCMD, CM_RXBC(buffer));
733 PUTREG(CMSTAT, sc->sc_intmask);
736 if_printf(ifp, "srint: restarted rx on buf %d\n", buffer);
754 ifp = &(sc->sc_arccom.ac_if);
755 buffer = sc->sc_tx_act;
759 * Normal situtations first for fast path:
760 * If acknowledgement received ok or broadcast, we're ok.
764 if (isr & CM_TMA || sc->sc_broadcast[buffer])
765 sc->sc_arccom.ac_if.if_opackets++;
767 else if (ifp->if_flags & IFF_LINK2 && ifp->if_timer > 0
768 && --sc->sc_retransmits[buffer] > 0) {
769 /* retransmit same buffer */
770 PUTREG(CMCMD, CM_TX(buffer));
778 /* We know we can accept another buffer at this point. */
779 ifp->if_flags &= ~IFF_OACTIVE;
781 if (--sc->sc_tx_fillcount > 0) {
784 * start tx on other buffer.
785 * This also clears the int flag
788 sc->sc_tx_act = buffer;
792 * sc->sc_intmask |= CM_TA;
793 * PUTREG(CMSTAT, sc->sc_intmask);
795 PUTREG(CMCMD, CM_TX(buffer));
796 /* init watchdog timer */
797 ifp->if_timer = ARCTIMEOUT;
799 #if defined(CM_DEBUG) && (CM_DEBUG > 1)
801 "tint: starting tx on buffer %d, status 0x%02x\n",
802 buffer, GETREG(CMSTAT));
805 /* have to disable TX interrupt */
806 sc->sc_intmask &= ~CM_TA;
807 PUTREG(CMSTAT, sc->sc_intmask);
808 /* ... and watchdog timer */
812 if_printf(ifp, "tint: no more buffers to send, status 0x%02x\n",
819 /* schedule soft int to fill a new buffer for us */
820 softintr_schedule(sc->sc_txcookie);
822 /* call it directly */
828 * Our interrupt routine
834 struct cm_softc *sc = arg;
835 struct ifnet *ifp = &sc->sc_arccom.ac_if;
837 u_char isr, maskedisr;
841 isr = GETREG(CMSTAT);
842 maskedisr = isr & sc->sc_intmask;
847 #if defined(CM_DEBUG) && (CM_DEBUG>1)
848 if_printf(ifp, "intr: status 0x%02x, intmask 0x%02x\n",
849 isr, sc->sc_intmask);
852 if (maskedisr & CM_POR) {
854 * XXX We should never see this. Don't bother to store
856 * sc->sc_arccom.ac_anaddr = GETMEM(CMMACOFF);
858 PUTREG(CMCMD, CM_CLR(CLR_POR));
860 "%s%d: intr: got spurious power on reset int\n",
861 ifp->if_name, ifp->if_unit);
864 if (maskedisr & CM_RECON) {
867 * PUTREG(CMCMD, CM_CONF(CONF_LONG));
869 PUTREG(CMCMD, CM_CLR(CLR_RECONFIG));
870 sc->sc_arccom.ac_if.if_collisions++;
873 * If less than 2 seconds per reconfig:
874 * If ARC_EXCESSIVE_RECONFIGS
875 * since last burst, complain and set treshold for
876 * warnings to ARC_EXCESSIVE_RECONS_REWARN.
878 * This allows for, e.g., new stations on the cable, or
879 * cable switching as long as it is over after
880 * (normally) 16 seconds.
882 * XXX TODO: check timeout bits in status word and
883 * double time if necessary.
886 callout_stop(&sc->sc_recon_ch);
887 newsec = time_second;
888 if ((newsec - sc->sc_recontime <= 2) &&
889 (++sc->sc_reconcount == ARC_EXCESSIVE_RECONS)) {
891 "%s%d: excessive token losses, "
893 ifp->if_name, ifp->if_unit);
895 sc->sc_recontime = newsec;
896 callout_reset(&sc->sc_recon_ch, 15 * hz,
897 cm_reconwatch, (void *)sc);
900 if (maskedisr & CM_RI) {
901 #if defined(CM_DEBUG) && (CM_DEBUG > 1)
902 if_printf(ifp, "intr: hard rint, act %d\n",
906 buffer = sc->sc_rx_act;
907 /* look if buffer is marked invalid: */
908 if (GETMEM(buffer*512) == 0) {
910 * invalid marked buffer (or illegally
914 "%s%d: spurious RX interupt or sender 0 "
915 " (ignored)\n", ifp->if_name, ifp->if_unit);
917 * restart receiver on same buffer.
918 * XXX maybe better reset interface?
920 PUTREG(CMCMD, CM_RXBC(buffer));
922 if (++sc->sc_rx_fillcount > 1) {
923 sc->sc_intmask &= ~CM_RI;
924 PUTREG(CMSTAT, sc->sc_intmask);
927 sc->sc_rx_act = buffer;
930 * Start receiver on other receive
931 * buffer. This also clears the RI
934 PUTREG(CMCMD, CM_RXBC(buffer));
935 /* in RX intr, so mask is ok for RX */
938 if_printf(ifp, "strt rx for buf %d, "
940 sc->sc_rx_act, GETREG(CMSTAT));
946 * this one starts a soft int to copy out
949 softintr_schedule(sc->sc_rxcookie);
951 /* this one does the copy here */
956 if (maskedisr & CM_TA) {
959 isr = GETREG(CMSTAT);
960 maskedisr = isr & sc->sc_intmask;
962 #if defined(CM_DEBUG) && (CM_DEBUG>1)
963 if_printf(ifp, "intr (exit): status 0x%02x, intmask 0x%02x\n",
964 isr, sc->sc_intmask);
972 struct cm_softc *sc = arg;
973 struct ifnet *ifp = &sc->sc_arccom.ac_if;
975 if (sc->sc_reconcount >= ARC_EXCESSIVE_RECONS) {
976 sc->sc_reconcount = 0;
977 log(LOG_WARNING, "%s%d: token valid again.\n",
978 ifp->if_name, ifp->if_unit);
980 sc->sc_reconcount = 0;
985 * Process an ioctl request.
986 * This code needs some work - it looks pretty ugly.
989 cm_ioctl(ifp, command, data)
1001 ifa = (struct ifaddr *)data;
1002 ifr = (struct ifreq *)data;
1005 #if defined(CM_DEBUG) && (CM_DEBUG > 2)
1006 if_printf(ifp, "ioctl() called, cmd = 0x%lx\n", command);
1014 error = arc_ioctl(ifp, command, data);
1018 if ((ifp->if_flags & IFF_UP) == 0 &&
1019 (ifp->if_flags & IFF_RUNNING) != 0) {
1021 * If interface is marked down and it is running,
1025 ifp->if_flags &= ~IFF_RUNNING;
1026 } else if ((ifp->if_flags & IFF_UP) != 0 &&
1027 (ifp->if_flags & IFF_RUNNING) == 0) {
1029 * If interface is marked up and it is stopped, then
1046 * watchdog routine for transmitter.
1048 * We need this, because else a receiver whose hardware is alive, but whose
1049 * software has not enabled the Receiver, would make our hardware wait forever
1050 * Discovered this after 20 times reading the docs.
1052 * Only thing we do is disable transmitter. We'll get an transmit timeout,
1053 * and the int handler will have to decide not to retransmit (in case
1054 * retransmission is implemented).
1056 * This one assumes being called inside splimp()
1063 struct cm_softc *sc = ifp->if_softc;
1065 PUTREG(CMCMD, CM_TXDIS);