From 660fea4dcddeffa723546f14a00d9bddbfd2ea77 Mon Sep 17 00:00:00 2001 From: pefo Date: Wed, 1 May 1996 16:59:32 +0000 Subject: [PATCH] Updated to new configure. --- sys/arch/pica/dev/dma.c | 45 +++++- sys/arch/pica/dev/dma.h | 5 +- sys/arch/pica/dev/fd.c | 36 +++-- sys/arch/pica/dev/if_sn.c | 88 ++++++----- sys/arch/pica/dev/if_sn.h | 6 +- sys/arch/pica/dev/lpt.c | 15 +- sys/arch/pica/dev/pccons.c | 302 +++++++++++++++++++------------------ 7 files changed, 282 insertions(+), 215 deletions(-) diff --git a/sys/arch/pica/dev/dma.c b/sys/arch/pica/dev/dma.c index 34c313d3d71..cb3dfb3d2f0 100644 --- a/sys/arch/pica/dev/dma.c +++ b/sys/arch/pica/dev/dma.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)rz.c 8.1 (Berkeley) 7/29/93 - * $Id: dma.c,v 1.2 1995/10/28 15:47:06 deraadt Exp $ + * $Id: dma.c,v 1.3 1996/05/01 16:59:32 pefo Exp $ */ /* @@ -54,6 +54,7 @@ #include #include #include +#include #include #include @@ -207,7 +208,6 @@ picaDmaTLBMap(dma_softc_t *sc) va += PICA_DMA_PAGE_SIZE; nbytes -= PICA_DMA_PAGE_SIZE; } - out32(PICA_SYS_TL_IVALID, 0); /* Flush dma map cache */ } /* @@ -235,6 +235,7 @@ picaDmaStart(sc, addr, size, datain) /* Map up the request viritual dma space */ picaDmaTLBMap(sc); + out32(PICA_SYS_TL_IVALID, 0); /* Flush dma map cache */ /* Load new transfer parameters */ regs->dma_addr = sc->next_va; @@ -274,6 +275,19 @@ picaDmaMap(sc, addr, size, offset) picaDmaTLBMap(sc); } +/* + * Prepare for new dma by flushing + */ +void +picaDmaFlush(sc, addr, size, datain) + struct dma_softc *sc; + char *addr; + size_t size; + int datain; +{ + out32(PICA_SYS_TL_IVALID, 0); /* Flush dma map cache */ +} + /* * Stop/Reset a DMA channel */ @@ -288,6 +302,25 @@ picaDmaReset(dma_softc_t *sc) sc->sc_active = 0; } +/* + * End dma operation, return byte count left. + */ +int +picaDmaEnd(dma_softc_t *sc) +{ + pDmaReg regs = sc->dma_reg; + int res; + + res = regs->dma_count = sc->next_size; + + /* Halt DMA */ + regs->dma_enab = 0; + regs->dma_mode = 0; + sc->sc_active = 0; + + return res; +} + /* * Null call rathole! */ @@ -312,10 +345,11 @@ asc_dma_init(dma_softc_t *sc) sc->map = picaDmaMap; sc->isintr = picaDmaNull; sc->intr = picaDmaNull; + sc->end = picaDmaEnd; sc->dma_reg = (pDmaReg)PICA_SYS_DMA0_REGS; sc->pte_size = 32; - sc->mode = PICA_DMA_MODE_80NS | PICA_DMA_MODE_16; + sc->mode = PICA_DMA_MODE_160NS | PICA_DMA_MODE_16; picaDmaTLBAlloc(sc); } /* @@ -328,8 +362,10 @@ fdc_dma_init(dma_softc_t *sc) sc->reset = picaDmaReset; sc->enintr = picaDmaNull; sc->start = picaDmaStart; + sc->map = picaDmaMap; sc->isintr = picaDmaNull; sc->intr = picaDmaNull; + sc->end = picaDmaEnd; sc->dma_reg = (pDmaReg)PICA_SYS_DMA1_REGS; sc->pte_size = 32; @@ -345,10 +381,11 @@ sn_dma_init(dma_softc_t *sc, int pages) { sc->reset = picaDmaNull; sc->enintr = picaDmaNull; + sc->start = picaDmaFlush; sc->map = picaDmaMap; - sc->start = picaDmaNull; sc->isintr = picaDmaNull; sc->intr = picaDmaNull; + sc->end = picaDmaNull; sc->dma_reg = (pDmaReg)NULL; sc->pte_size = pages; diff --git a/sys/arch/pica/dev/dma.h b/sys/arch/pica/dev/dma.h index 991d3ec8bcb..92f6a9436c9 100644 --- a/sys/arch/pica/dev/dma.h +++ b/sys/arch/pica/dev/dma.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)dma.h 8.1 (Berkeley) 6/10/93 - * $Id: dma.h,v 1.2 1995/10/28 15:47:07 deraadt Exp $ + * $Id: dma.h,v 1.3 1996/05/01 16:59:35 pefo Exp $ */ /* @@ -133,6 +133,7 @@ typedef struct dma_softc { /* Start routine pointer */ int (*isintr)(struct dma_softc *); /* Int check routine pointer */ int (*intr)(struct dma_softc *); /* Interrupt routine pointer */ + int (*end)(struct dma_softc *); /* Interrupt routine pointer */ } dma_softc_t; #define DMA_TO_DEV 0 @@ -146,4 +147,4 @@ typedef struct dma_softc { #define DMA_MAP(a, b, c, d) ((a->map)(a, b, c, d)) #define DMA_INTR(r) ((r->intr)(r)) #define DMA_DRAIN(r) -#define DMA_END(r) ((r->reset)(r)) +#define DMA_END(r) ((r->end)(r)) diff --git a/sys/arch/pica/dev/fd.c b/sys/arch/pica/dev/fd.c index caa9769a7ea..df19f546b8c 100644 --- a/sys/arch/pica/dev/fd.c +++ b/sys/arch/pica/dev/fd.c @@ -106,8 +106,11 @@ struct fdc_softc { int fdcprobe __P((struct device *, void *, void *)); void fdcattach __P((struct device *, struct device *, void *)); -struct cfdriver fdccd = { - NULL, "fdc", fdcprobe, fdcattach, DV_DULL, sizeof(struct fdc_softc) +struct cfattach fdc_ca = { + sizeof(struct fdc_softc), fdcprobe, fdcattach +}; +struct cfdriver fdc_cd = { + NULL, "fdc", DV_DULL, NULL, 0 }; /* @@ -144,7 +147,7 @@ struct fd_type fd_types[] = { /* software state, per disk (with up to 4 disks per ctlr) */ struct fd_softc { struct device sc_dev; - struct dkdevice sc_dk; + struct disk sc_dk; struct fd_type *sc_deftype; /* default type descriptor */ struct fd_type *sc_type; /* current type descriptor */ @@ -162,6 +165,8 @@ struct fd_softc { #define FD_MOTOR_WAIT 0x04 /* motor coming up */ int sc_cylin; /* where we think the head is */ + void *sc_sdhook; /* saved shutdown hook for drive. */ + TAILQ_ENTRY(fd_softc) sc_drivechain; int sc_ops; /* I/O ops since last switch */ struct buf sc_q; /* head of buf chain */ @@ -171,8 +176,11 @@ struct fd_softc { int fdprobe __P((struct device *, void *, void *)); void fdattach __P((struct device *, struct device *, void *)); -struct cfdriver fdcd = { - NULL, "fd", fdprobe, fdattach, DV_DISK, sizeof(struct fd_softc) +struct cfattach fd_ca = { + sizeof(struct fd_softc), fdprobe, fdattach +}; +struct cfdriver fd_cd = { + NULL, "fd", DV_DISK, NULL, 0 }; void fdgetdisklabel __P((struct fd_softc *)); @@ -354,9 +362,13 @@ fdattach(parent, self, aux) fd->sc_drive = drive; fd->sc_deftype = type; fdc->sc_fd[drive] = fd; + fd->sc_dk.dk_name = fd->sc_dev.dv_xname; fd->sc_dk.dk_driver = &fddkdriver; /* XXX Need to do some more fiddling with sc_dk. */ dk_establish(&fd->sc_dk, &fd->sc_dev); + + /* Needed to power off if the motor is on when we halt. */ + fd->sc_sdhook = shutdownhook_establish(fd_motor_off, fd); } /* @@ -418,8 +430,8 @@ fdstrategy(bp) int s; /* Valid unit, controller, and request? */ - if (unit >= fdcd.cd_ndevs || - (fd = fdcd.cd_devs[unit]) == 0 || + if (unit >= fd_cd.cd_ndevs || + (fd = fd_cd.cd_devs[unit]) == 0 || bp->b_blkno < 0 || (bp->b_bcount % FDC_BSIZE) != 0) { bp->b_error = EINVAL; @@ -637,7 +649,7 @@ out_fdc(iobase, x) } int -Fdopen(dev, flags) +fdopen(dev, flags) dev_t dev; int flags; { @@ -646,9 +658,9 @@ Fdopen(dev, flags) struct fd_type *type; unit = FDUNIT(dev); - if (unit >= fdcd.cd_ndevs) + if (unit >= fd_cd.cd_ndevs) return ENXIO; - fd = fdcd.cd_devs[unit]; + fd = fd_cd.cd_devs[unit]; if (fd == 0) return ENXIO; type = fd_dev_to_type(fd, dev); @@ -671,7 +683,7 @@ fdclose(dev, flags) dev_t dev; int flags; { - struct fd_softc *fd = fdcd.cd_devs[FDUNIT(dev)]; + struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)]; fd->sc_flags &= ~FD_OPEN; return 0; @@ -1081,7 +1093,7 @@ fdioctl(dev, cmd, addr, flag) caddr_t addr; int flag; { - struct fd_softc *fd = fdcd.cd_devs[FDUNIT(dev)]; + struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)]; struct disklabel buffer; int error; diff --git a/sys/arch/pica/dev/if_sn.c b/sys/arch/pica/dev/if_sn.c index dc48444a0b7..12f815a7d63 100644 --- a/sys/arch/pica/dev/if_sn.c +++ b/sys/arch/pica/dev/if_sn.c @@ -116,8 +116,11 @@ struct sn_softc { int snmatch __P((struct device *, void *, void *)); void snattach __P((struct device *, struct device *, void *)); -struct cfdriver sncd = { - NULL, "sn", snmatch, snattach, DV_IFNET, sizeof(struct sn_softc) +struct cfattach sn_ca = { + sizeof(struct sn_softc), snmatch, snattach +}; +struct cfdriver sn_cd = { + NULL, "sn", DV_IFNET, NULL, 0 }; #include @@ -189,15 +192,6 @@ void snreset __P((struct sn_softc *sc)); #define UPPER(x) ((unsigned)(x) >> 16) #define LOWER(x) ((unsigned)(x) & 0xffff) -/* - * buffer sizes in 32 bit mode - * 1 TXpkt is 4 hdr words + (3 * FRAGMAX) + 1 link word - * FRAGMAX == 16 => 54 words == 216 bytes - * - * 1 RxPkt is 7 words == 28 bytes - * 1 Rda is 4 words == 16 bytes - */ - #define NRRA 32 /* # receive resource descriptors */ #define RRAMASK 0x1f /* why it must be poer of two */ @@ -314,27 +308,27 @@ snattach(parent, self, aux) p = SONICBUF; pp = SONICBUF - (FRAGMAX * NTDA * PICA_DMA_PAGE_SIZE); + if ((p ^ (p + TDASIZE)) & 0x10000) + p = (p + 0x10000) & ~0xffff; + p_tda = (struct TXpkt *) p; + v_tda = (struct TXpkt *)(p - pp + sc->dma->dma_va); + p += TDASIZE; + if ((p ^ (p + RRASIZE + CDASIZE)) & 0x10000) p = (p + 0x10000) & ~0xffff; p_rra = (struct RXrsrc *) p; v_rra = (struct RXrsrc *)(p - pp + sc->dma->dma_va); p += RRASIZE; - p_cda = (struct CDA *) p; - v_cda = (struct CDA *)(p - pp + sc->dma->dma_va); - p += CDASIZE; - if ((p ^ (p + RDASIZE)) & 0x10000) p = (p + 0x10000) & ~0xffff; p_rda = (struct RXpkt *) p; v_rda = (struct RXpkt *)(p - pp + sc->dma->dma_va); p += RDASIZE; - if ((p ^ (p + TDASIZE)) & 0x10000) - p = (p + 0x10000) & ~0xffff; - p_tda = (struct TXpkt *) p; - v_tda = (struct TXpkt *)(p - pp + sc->dma->dma_va); - p += TDASIZE; + p_cda = (struct CDA *) p; + v_cda = (struct CDA *)(p - pp + sc->dma->dma_va); + p += CDASIZE; p += PICA_DMA_PAGE_SIZE - (p & (PICA_DMA_PAGE_SIZE -1)); p_rba = (char *)p; @@ -379,7 +373,7 @@ snioctl(ifp, cmd, data) caddr_t data; { struct ifaddr *ifa; - struct sn_softc *sc = sncd.cd_devs[ifp->if_unit]; + struct sn_softc *sc = sn_cd.cd_devs[ifp->if_unit]; int s = splnet(), err = 0; int temp; @@ -475,7 +469,7 @@ void snstart(ifp) struct ifnet *ifp; { - struct sn_softc *sc = sncd.cd_devs[ifp->if_unit]; + struct sn_softc *sc = sn_cd.cd_devs[ifp->if_unit]; struct mbuf *m; int len; @@ -490,7 +484,9 @@ snstart(ifp) * the Tx ring, then send the packet directly. Otherwise append * it to the o/p queue. */ - len = sonicput(sc, m); + if (!sonicput(sc, m)) { /* not enough space */ + IF_PREPEND(&sc->sc_if.if_snd, m); + } #if NBPFILTER > 0 /* * If bpf is listening on this interface, let it @@ -532,7 +528,7 @@ int sninit(unit) int unit; { - struct sn_softc *sc = sncd.cd_devs[unit]; + struct sn_softc *sc = sn_cd.cd_devs[unit]; struct sonic_reg *csr = sc->sc_csr; int s, error; @@ -601,7 +597,7 @@ int snstop(unit) int unit; { - struct sn_softc *sc = sncd.cd_devs[unit]; + struct sn_softc *sc = sn_cd.cd_devs[unit]; struct mtd *mtd; int s = splnet(); @@ -637,7 +633,7 @@ void snwatchdog(unit) int unit; { - struct sn_softc *sc = sncd.cd_devs[unit]; + struct sn_softc *sc = sn_cd.cd_devs[unit]; int temp; if (mtdhead && mtdhead->mtd_mbuf) { @@ -690,9 +686,11 @@ sonicput(sc, m0) unsigned va = (unsigned) mtod(m, caddr_t); int resid = m->m_len; - MachHitFlushDCache(va, resid); + if(resid != 0) { + MachHitFlushDCache(va, resid); + DMA_MAP(sc->dma, (caddr_t)va, resid, fragoffset); + } len += resid; - DMA_MAP(sc->dma, (caddr_t)va, resid, fragoffset); while (resid) { unsigned pa; @@ -714,6 +712,25 @@ sonicput(sc, m0) fragoffset += PICA_DMA_PAGE_SIZE; } } + /* + * pad out last fragment for minimum size + */ + if (len < ETHERMIN + sizeof(struct ether_header) && fr < FRAGMAX) { + int pad = ETHERMIN + sizeof(struct ether_header) - len; + static char zeros[64]; + unsigned pa; + + DMA_MAP(sc->dma, (caddr_t)zeros, pad, fragoffset); + pa = sc->dma->dma_va + ((unsigned)zeros & PGOFSET) + fragoffset; + SWR(txp->u[fr].frag_ptrlo, LOWER(pa)); + SWR(txp->u[fr].frag_ptrhi, UPPER(pa)); + SWR(txp->u[fr].frag_size, pad); + fr++; + len = ETHERMIN + sizeof(struct ether_header); + } + + DMA_START(sc->dma, (caddr_t)0, 0, 0); /* Flush dma tlb */ + if (fr > FRAGMAX) { mtd_free(mtdnew); m_freem(m0); @@ -723,18 +740,6 @@ sonicput(sc, m0) return (len); } - /* - * pad out last fragment for minimum size - * - * XXX is this incorrectly done? does it cause random bytes of - * mem to be sent? if so, it should instead point to a zero'd - * zone of mem. - */ - if (len < ETHERMIN + sizeof(struct ether_header)) { - int pad = ETHERMIN + sizeof(struct ether_header) - len; - SWR(txp->u[fr - 1].frag_size, pad + SRD(txp->u[fr - 1].frag_size)); - len = ETHERMIN + sizeof(struct ether_header); - } SWR(txp->frag_count, fr); SWR(txp->pkt_size, len); @@ -982,6 +987,7 @@ initialise_rra(sc) csr->s_rsa = LOWER(v_rra); csr->s_rea = LOWER(&v_rra[NRRA]); csr->s_rrp = LOWER(v_rra); + csr->s_rsc = 0; /* fill up SOME of the rra with buffers */ for (i = 0; i < NRBA; i++) { @@ -1153,6 +1159,8 @@ sonicrxint(sc) assert(SRD(rxp->pkt_ptrhi) == SRD(p_rra[orra].buff_ptrhi)); assert(SRD(rxp->pkt_ptrlo) == SRD(p_rra[orra].buff_ptrlo)); +if(SRD(rxp->pkt_ptrlo) != SRD(p_rra[orra].buff_ptrlo)) +printf("%x,%x\n",SRD(rxp->pkt_ptrlo),SRD(p_rra[orra].buff_ptrlo)); assert(SRD(p_rra[orra].buff_wclo)); /* diff --git a/sys/arch/pica/dev/if_sn.h b/sys/arch/pica/dev/if_sn.h index 9b2789ea244..a5cd835cfcf 100644 --- a/sys/arch/pica/dev/if_sn.h +++ b/sys/arch/pica/dev/if_sn.h @@ -43,6 +43,7 @@ struct RXpkt { u_long seq_no; /* + RBA sequence numbers */ u_long rlink; /* link to next receive descriptor */ u_long in_use; /* + packet available to SONIC */ + u_long pad; /* pad to multiple of 16 bytes */ }; #endif #define RBASEQ(x) (((x)>>8)&0xff) @@ -52,7 +53,7 @@ struct RXpkt { * Transmit Descriptor * This structure holds information about packets to be transmitted. */ -#define FRAGMAX 32 /* maximum number of fragments in a packet */ +#define FRAGMAX 31 /* maximum number of fragments in a packet */ #if SONICDW == 32 struct TXpkt { u_long status; /* + transmitted packet status */ @@ -68,8 +69,7 @@ struct TXpkt { struct { u_long _tlink; /* link to next transmit descriptor */ } u_link; - } u[FRAGMAX]; - u_long :32; /* This makes tcp->u[FRAGMAX].u_link.link valid! */ + } u[FRAGMAX+1]; /* +1 makes tcp->u[FRAGMAX].u_link.link valid! */ }; #endif diff --git a/sys/arch/pica/dev/lpt.c b/sys/arch/pica/dev/lpt.c index 75c220bc09e..22809699cab 100644 --- a/sys/arch/pica/dev/lpt.c +++ b/sys/arch/pica/dev/lpt.c @@ -107,8 +107,11 @@ int lptprobe __P((struct device *, void *, void *)); void lptattach __P((struct device *, struct device *, void *)); int lptintr __P((void *)); -struct cfdriver lptcd = { - NULL, "lpt", lptprobe, lptattach, DV_TTY, sizeof(struct lpt_softc) +struct cfattach lpt_ca = { + sizeof(struct lpt_softc), lptprobe, lptattach +}; +struct cfdriver lpt_cd = { + NULL, "lpt", DV_TTY, NULL, 0 }; #define LPTUNIT(s) (minor(s) & 0x1f) @@ -251,9 +254,9 @@ lptopen(dev, flag) int error; int spin; - if (unit >= lptcd.cd_ndevs) + if (unit >= lpt_cd.cd_ndevs) return ENXIO; - sc = lptcd.cd_devs[unit]; + sc = lpt_cd.cd_devs[unit]; if (!sc) return ENXIO; @@ -354,7 +357,7 @@ lptclose(dev, flag) int flag; { int unit = LPTUNIT(dev); - struct lpt_softc *sc = lptcd.cd_devs[unit]; + struct lpt_softc *sc = lpt_cd.cd_devs[unit]; int iobase = sc->sc_iobase; if (sc->sc_count) @@ -404,7 +407,7 @@ lptwrite(dev, uio) dev_t dev; struct uio *uio; { - struct lpt_softc *sc = lptcd.cd_devs[LPTUNIT(dev)]; + struct lpt_softc *sc = lpt_cd.cd_devs[LPTUNIT(dev)]; size_t n; int error = 0; diff --git a/sys/arch/pica/dev/pccons.c b/sys/arch/pica/dev/pccons.c index 9b5e0ace965..f7ee0774e62 100644 --- a/sys/arch/pica/dev/pccons.c +++ b/sys/arch/pica/dev/pccons.c @@ -66,6 +66,7 @@ #include #include +#include #include #include #include @@ -140,16 +141,22 @@ int pcmatch __P((struct device *, void *, void *)); void pcattach __P((struct device *, struct device *, void *)); int pcintr __P((void *)); -struct cfdriver pccd = { - NULL, "pc", pcmatch, pcattach, DV_TTY, sizeof(struct pc_softc) +struct cfattach pc_ca = { + sizeof(struct pc_softc), pcmatch, pcattach +}; +struct cfdriver pc_cd = { + NULL, "pc", DV_TTY, NULL, 0 }; int pmsprobe __P((struct device *, void *, void *)); void pmsattach __P((struct device *, struct device *, void *)); int pmsintr __P((void *)); -struct cfdriver pmscd = { - NULL, "pms", pmsprobe, pmsattach, DV_TTY, sizeof(struct pms_softc) +struct cfattach pms_ca = { + sizeof(struct pms_softc), pmsprobe, pmsattach +}; +struct cfdriver pms_cd = { + NULL, "pms", DV_TTY, NULL, 0 }; #define PMSUNIT(dev) (minor(dev)) @@ -513,9 +520,9 @@ pcopen(dev, flag, mode, p) int unit = PCUNIT(dev); struct tty *tp; - if (unit >= pccd.cd_ndevs) + if (unit >= pc_cd.cd_ndevs) return ENXIO; - sc = pccd.cd_devs[unit]; + sc = pc_cd.cd_devs[unit]; if (sc == 0) return ENXIO; @@ -552,7 +559,7 @@ pcclose(dev, flag, mode, p) int flag, mode; struct proc *p; { - struct pc_softc *sc = pccd.cd_devs[PCUNIT(dev)]; + struct pc_softc *sc = pc_cd.cd_devs[PCUNIT(dev)]; struct tty *tp = sc->sc_tty; (*linesw[tp->t_line].l_close)(tp, flag); @@ -569,7 +576,7 @@ pcread(dev, uio, flag) struct uio *uio; int flag; { - struct pc_softc *sc = pccd.cd_devs[PCUNIT(dev)]; + struct pc_softc *sc = pc_cd.cd_devs[PCUNIT(dev)]; struct tty *tp = sc->sc_tty; return ((*linesw[tp->t_line].l_read)(tp, uio, flag)); @@ -581,7 +588,7 @@ pcwrite(dev, uio, flag) struct uio *uio; int flag; { - struct pc_softc *sc = pccd.cd_devs[PCUNIT(dev)]; + struct pc_softc *sc = pc_cd.cd_devs[PCUNIT(dev)]; struct tty *tp = sc->sc_tty; return ((*linesw[tp->t_line].l_write)(tp, uio, flag)); @@ -591,7 +598,7 @@ struct tty * pctty(dev) dev_t dev; { - struct pc_softc *sc = pccd.cd_devs[PCUNIT(dev)]; + struct pc_softc *sc = pc_cd.cd_devs[PCUNIT(dev)]; struct tty *tp = sc->sc_tty; return (tp); @@ -634,7 +641,7 @@ pcioctl(dev, cmd, data, flag, p) int flag; struct proc *p; { - struct pc_softc *sc = pccd.cd_devs[PCUNIT(dev)]; + struct pc_softc *sc = pc_cd.cd_devs[PCUNIT(dev)]; struct tty *tp = sc->sc_tty; int error; @@ -817,8 +824,8 @@ pccnpollc(dev, on) * interrupts. */ unit = PCUNIT(dev); - if (pccd.cd_ndevs > unit) { - sc = pccd.cd_devs[unit]; + if (pc_cd.cd_ndevs > unit) { + sc = pc_cd.cd_devs[unit]; if (sc != 0) { s = spltty(); pcintr(sc); @@ -1456,135 +1463,134 @@ static Scan_def us_scan_codes[] = { }; static Scan_def sw_scan_codes[] = { - NONE, "", "", "", "", /* 0 unused */ - ASCII, "\033", "\033", "\033", "\033", /* 1 ESCape */ - ASCII, "1", "!", "", "0xa1", /* 2 1 */ - ASCII, "2", "\"", "\000", "@", /* 3 2 */ - ASCII, "3", "#", "", "0xa3", /* 4 3 */ - ASCII, "4", "$", "", "$", /* 5 4 */ - ASCII, "5", "%", "\034", "\\", /* 6 5 */ - ASCII, "6", "&", "\034", "|", /* 7 6 */ - ASCII, "7", "/", "\033", "{", /* 8 7 */ - ASCII, "9", ")", "\035", "]", /* 10 9 */ - ASCII, "0", "=", "\035", "}", /* 11 0 */ - ASCII, "+", "?", "\037", "0xbf", /* 12 - */ - ASCII, "\\", "`", "\034", "'", /* 13 = */ - ASCII, "\177", "\177", "\010", "\177", /* 14 backspace */ - ASCII, "\t", "\177\t", "\t", "\t", /* 15 tab */ - ASCII, "q", "Q", "\021", "q", /* 16 q */ - ASCII, "w", "W", "\027", "w", /* 17 w */ - ASCII, "e", "E", "\005", "0xeb", /* 18 e */ - ASCII, "r", "R", "\022", "r", /* 19 r */ - ASCII, "t", "T", "\024", "t", /* 20 t */ - ASCII, "y", "Y", "\031", "y", /* 21 y */ - ASCII, "u", "U", "\025", "0xfc", /* 22 u */ - ASCII, "i", "I", "\011", "i", /* 23 i */ - ASCII, "o", "O", "\017", "0xf6", /* 24 o */ - ASCII, "p", "P", "\020", "p", /* 25 p */ - ASCII, "0xe5", "0xc5", "0xdc", "0xfc", /* 26 [ */ - ASCII, "~", "^", "\036", "", /* 27 ] */ - ASCII, "\r", "\r", "\n", "\r", /* 28 return */ - CTL, "", "", "", "", /* 29 control */ - ASCII, "a", "A", "\001", "0xe4", /* 30 a */ - ASCII, "s", "S", "\023", "0xdf", /* 31 s */ - ASCII, "d", "D", "\004", "d", /* 32 d */ - ASCII, "f", "F", "\006", "f", /* 33 f */ - ASCII, "g", "G", "\007", "g", /* 34 g */ - ASCII, "h", "H", "\010", "h", /* 35 h */ - ASCII, "j", "J", "\n", "j", /* 36 j */ - ASCII, "k", "K", "\013", "k", /* 37 k */ - ASCII, "l", "L", "\014", "l", /* 38 l */ - ASCII, "0xf6", "0xd6", "0xd6", "0xf6", /* 39 ; */ - ASCII, "0xe4", "0xc4", "0xc4", "0xe4", /* 40 ' */ - ASCII, "|", "@", "\034", "0xa7", /* 41 ` */ - SHIFT, "", "", "", "", /* 42 shift */ - ASCII, "'", "*", "'", "'", /* 43 \ */ - ASCII, "z", "Z", "\032", "z", /* 44 z */ - ASCII, "x", "X", "\030", "x", /* 45 x */ - ASCII, "c", "C", "\003", "c", /* 46 c */ - ASCII, "v", "V", "\026", "v", /* 47 v */ - ASCII, "b", "B", "\002", "b", /* 48 b */ - ASCII, "n", "N", "\016", "n", /* 49 n */ - ASCII, "m", "M", "\015", "m", /* 50 m */ - ASCII, ",", ";", ",", ",", /* 51 , */ - ASCII, ".", ":", ".", ".", /* 52 . */ - ASCII, "-", "_", "\037", "-", /* 53 / */ - SHIFT, "", "", "", "", /* 54 shift */ - KP, "*", "*", "*", "*", /* 55 kp * */ - ALT, "", "", "", "", /* 56 alt */ - ASCII, " ", " ", "\000", " ", /* 57 space */ - CAPS, "", "", "", "", /* 58 caps */ - FUNC, "\033[M", "\033[Y", "\033[k", "", /* 59 f1 */ - FUNC, "\033[N", "\033[Z", "\033[l", "", /* 60 f2 */ - FUNC, "\033[O", "\033[a", "\033[m", "", /* 61 f3 */ - FUNC, "\033[P", "\033[b", "\033[n", "", /* 62 f4 */ - FUNC, "\033[Q", "\033[c", "\033[o", "", /* 63 f5 */ - FUNC, "\033[R", "\033[d", "\033[p", "", /* 64 f6 */ - FUNC, "\033[S", "\033[e", "\033[q", "", /* 65 f7 */ - FUNC, "\033[T", "\033[f", "\033[r", "", /* 66 f8 */ - FUNC, "\033[U", "\033[g", "\033[s", "", /* 67 f9 */ - FUNC, "\033[V", "\033[h", "\033[t", "", /* 68 f10 */ - NUM, "", "", "", "", /* 69 num lo - - SCROLL, "", "", "", "", /* 70 scroll - - KP, "7", "\033[H", "7", "", /* 71 kp 7 */ - KP, "8", "\033[A", "8", "", /* 72 kp 8 */ - KP, "9", "\033[I", "9", "", /* 73 kp 9 */ - KP, "-", "-", "-", "", /* 74 kp - */ - KP, "4", "\033[D", "4", "", /* 75 kp 4 */ - KP, "5", "\033[E", "5", "", /* 76 kp 5 */ - KP, "6", "\033[C", "6", "", /* 77 kp 6 */ - KP, "+", "+", "+", "", /* 78 kp + */ - KP, "1", "\033[F", "1", "", /* 79 kp 1 */ - KP, "2", "\033[B", "2", "", /* 80 kp 2 */ - KP, "3", "\033[G", "3", "", /* 81 kp 3 */ - KP, "0", "\033[L", "0", "", /* 82 kp 0 */ - KP, ".", "\177", ".", "", /* 83 kp . */ - NONE, "", "", "", "", /* 84 0 */ - NONE, "100", "", "", "", /* 85 0 */ - ASCII, "<", ">", "0xbb", "0xab", /* 86 < > */ - FUNC, "\033[W", "\033[i", "\033[u","", /* 87 f11 */ - FUNC, "\033[X", "\033[j", "\033[v","", /* 88 f12 */ - NONE, "102", "", "", "", /* 89 0 */ - NONE, "103", "", "", "", /* 90 0 */ - NONE, "", "", "", "", /* 91 0 */ - NONE, "", "", "", "", /* 92 0 */ - NONE, "", "", "", "", /* 93 0 */ - NONE, "", "", "", "", /* 94 0 */ - NONE, "", "", "", "", /* 95 0 */ - NONE, "", "", "", "", /* 96 0 */ - NONE, "", "", "", "", /* 97 0 */ - NONE, "", "", "", "", /* 98 0 */ - NONE, "", "", "", "", /* 99 0 */ - NONE, "", "", "", "", /* 100 */ - NONE, "", "", "", "", /* 101 */ - NONE, "", "", "", "", /* 102 */ - NONE, "", "", "", "", /* 103 */ - NONE, "", "", "", "", /* 104 */ - NONE, "", "", "", "", /* 105 */ - NONE, "", "", "", "", /* 106 */ - NONE, "", "", "", "", /* 107 */ - NONE, "", "", "", "", /* 108 */ - NONE, "", "", "", "", /* 109 */ - NONE, "", "", "", "", /* 110 */ - NONE, "", "", "", "", /* 111 */ - NONE, "", "", "", "", /* 112 */ - NONE, "", "", "", "", /* 113 */ - NONE, "", "", "", "", /* 114 */ - NONE, "", "", "", "", /* 115 */ - NONE, "", "", "", "", /* 116 */ - NONE, "", "", "", "", /* 117 */ - NONE, "", "", "", "", /* 118 */ - NONE, "", "", "", "", /* 119 */ - NONE, "", "", "", "", /* 120 */ - NONE, "", "", "", "", /* 121 */ - NONE, "", "", "", "", /* 122 */ - NONE, "", "", "", "", /* 123 */ - NONE, "", "", "", "", /* 124 */ - NONE, "", "", "", "", /* 125 */ - NONE, "", "", "", "", /* 126 */ - NONE, "", "", "", "", /* 127 */ + NONE, "", "", "", "", /* 0 unused */ + ASCII, "\033", "\033", "\033", "\033", /* 1 ESCape */ + ASCII, "1", "!", "", "\241", /* 2 1 */ + ASCII, "2", "\"", "\000", "@", /* 3 2 */ + ASCII, "3", "#", "", "\243", /* 4 3 */ + ASCII, "4", "$", "", "$", /* 5 4 */ + ASCII, "5", "%", "\034", "\\", /* 6 5 */ + ASCII, "6", "&", "\034", "|", /* 7 6 */ + ASCII, "7", "/", "\033", "{", /* 8 7 */ + ASCII, "8", "(", "\036", "[", /* 9 8 */ + ASCII, "9", ")", "\035", "]", /* 10 9 */ + ASCII, "0", "=", "\035", "}", /* 11 0 */ + ASCII, "+", "?", "\037", "\\", /* 12 - */ + ASCII, "'", "`", "\034", "'", /* 13 = */ + ASCII, "\177", "\177", "\010", "\177", /* 14 backspace */ + ASCII, "\t", "\177\t", "\t", "\t", /* 15 tab */ + ASCII, "q", "Q", "\021", "q", /* 16 q */ + ASCII, "w", "W", "\027", "w", /* 17 w */ + ASCII, "e", "E", "\005", "\353", /* 18 e */ + ASCII, "r", "R", "\022", "r", /* 19 r */ + ASCII, "t", "T", "\024", "t", /* 20 t */ + ASCII, "y", "Y", "\031", "y", /* 21 y */ + ASCII, "u", "U", "\025", "\374", /* 22 u */ + ASCII, "i", "I", "\011", "i", /* 23 i */ + ASCII, "o", "O", "\017", "\364", /* 24 o */ + ASCII, "p", "P", "\020", "p", /* 25 p */ + ASCII, "\345", "\305", "\334", "\374", /* 26 [ */ + ASCII, "~", "^", "\036", "", /* 27 ] */ + ASCII, "\r", "\r", "\n", "\r", /* 28 return */ + CTL, "", "", "", "", /* 29 control */ + ASCII, "a", "A", "\001", "\344", /* 30 a */ + ASCII, "s", "S", "\023", "\337", /* 31 s */ + ASCII, "d", "D", "\004", "d", /* 32 d */ + ASCII, "f", "F", "\006", "f", /* 33 f */ + ASCII, "g", "G", "\007", "g", /* 34 g */ + ASCII, "h", "H", "\010", "h", /* 35 h */ + ASCII, "j", "J", "\n", "j", /* 36 j */ + ASCII, "k", "K", "\013", "k", /* 37 k */ + ASCII, "l", "L", "\014", "l", /* 38 l */ + ASCII, "\366", "\326", "\326", "\366", /* 39 ; */ + ASCII, "\344", "\304", "\304", "\344", /* 40 ' */ + ASCII, "|", "@", "\034", "\247", /* 41 ` */ + SHIFT, "", "", "", "", /* 42 shift */ + ASCII, "'", "*", "'", "'", /* 43 \ */ + ASCII, "z", "Z", "\032", "z", /* 44 z */ + ASCII, "x", "X", "\030", "x", /* 45 x */ + ASCII, "c", "C", "\003", "c", /* 46 c */ + ASCII, "v", "V", "\026", "v", /* 47 v */ + ASCII, "b", "B", "\002", "b", /* 48 b */ + ASCII, "n", "N", "\016", "n", /* 49 n */ + ASCII, "m", "M", "\015", "m", /* 50 m */ + ASCII, ",", ";", ",", ",", /* 51 , */ + ASCII, ".", ":", ".", ".", /* 52 . */ + ASCII, "-", "_", "\037", "-", /* 53 / */ + SHIFT, "", "", "", "", /* 54 shift */ + KP, "*", "*", "*", "*", /* 55 kp * */ + ALT, "", "", "", "", /* 56 alt */ + ASCII, " ", " ", "\000", " ", /* 57 space */ + CAPS, "", "", "", "", /* 58 caps */ + FUNC, "\033[M", "\033[Y", "\033[k", "", /* 59 f1 */ + FUNC, "\033[N", "\033[Z", "\033[l", "", /* 60 f2 */ + FUNC, "\033[O", "\033[a", "\033[m", "", /* 61 f3 */ + FUNC, "\033[P", "\033[b", "\033[n", "", /* 62 f4 */ + FUNC, "\033[Q", "\033[c", "\033[o", "", /* 63 f5 */ + FUNC, "\033[R", "\033[d", "\033[p", "", /* 64 f6 */ + FUNC, "\033[S", "\033[e", "\033[q", "", /* 65 f7 */ + FUNC, "\033[T", "\033[f", "\033[r", "", /* 66 f8 */ + FUNC, "\033[U", "\033[g", "\033[s", "", /* 67 f9 */ + FUNC, "\033[V", "\033[h", "\033[t", "", /* 68 f10 */ + NUM, "", "", "", "", /* 69 num lo */ + SCROLL, "", "", "", "", /* 70 scroll */ + KP, "7", "\033[H", "7", "", /* 71 kp 7 */ + KP, "8", "\033[A", "8", "", /* 72 kp 8 */ + KP, "9", "\033[I", "9", "", /* 73 kp 9 */ + KP, "-", "-", "-", "", /* 74 kp - */ + KP, "4", "\033[D", "4", "", /* 75 kp 4 */ + KP, "5", "\033[E", "5", "", /* 76 kp 5 */ + KP, "6", "\033[C", "6", "", /* 77 kp 6 */ + KP, "+", "+", "+", "", /* 78 kp + */ + KP, "1", "\033[F", "1", "", /* 79 kp 1 */ + KP, "2", "\033[B", "2", "", /* 80 kp 2 */ + KP, "3", "\033[G", "3", "", /* 81 kp 3 */ + KP, "0", "\033[L", "0", "", /* 82 kp 0 */ + KP, ".", "\177", ".", "", /* 83 kp . */ + NONE, "", "", "", "", /* 84 0 */ + NONE, "100", "", "", "", /* 85 0 */ + ASCII, "<", ">", "\273", "|", /* 86 < > */ + FUNC, "\033[W", "\033[i", "\033[u", "", /* 87 f11 */ + FUNC, "\033[X", "\033[j", "\033[v", "", /* 88 f12 */ + NONE, "102", "", "", "", /* 89 0 */ + NONE, "103", "", "", "", /* 90 0 */ + NONE, "", "", "", "", /* 91 0 */ + NONE, "", "", "", "", /* 92 0 */ + NONE, "", "", "", "", /* 93 0 */ + NONE, "", "", "", "", /* 94 0 */ + NONE, "", "", "", "", /* 95 0 */ + NONE, "", "", "", "", /* 96 0 */ + NONE, "", "", "", "", /* 97 0 */ + NONE, "", "", "", "", /* 98 0 */ + NONE, "", "", "", "", /* 99 0 */ + NONE, "", "", "", "", /* 100 */ + NONE, "", "", "", "", /* 101 */ + NONE, "", "", "", "", /* 102 */ + NONE, "", "", "", "", /* 103 */ + NONE, "", "", "", "", /* 104 */ + NONE, "", "", "", "", /* 105 */ + NONE, "", "", "", "", /* 106 */ + NONE, "", "", "", "", /* 107 */ + NONE, "", "", "", "", /* 108 */ + NONE, "", "", "", "", /* 109 */ + NONE, "", "", "", "", /* 110 */ + NONE, "", "", "", "", /* 111 */ + NONE, "", "", "", "", /* 112 */ + NONE, "", "", "", "", /* 113 */ + NONE, "", "", "", "", /* 114 */ + NONE, "", "", "", "", /* 115 */ + NONE, "", "", "", "", /* 116 */ + NONE, "", "", "", "", /* 117 */ + NONE, "", "", "", "", /* 118 */ + NONE, "", "", "", "", /* 119 */ + NONE, "", "", "", "", /* 120 */ + NONE, "", "", "", "", /* 121 */ + NONE, "", "", "", "", /* 122 */ + NONE, "", "", "", "", /* 123 */ + NONE, "", "", "", "", /* 124 */ + NONE, "", "", "", "", /* 125 */ + NONE, "", "", "", "", /* 126 */ + NONE, "", "", "", "", /* 127 */ }; @@ -1966,9 +1972,9 @@ pmsopen(dev, flag) int unit = PMSUNIT(dev); struct pms_softc *sc; - if (unit >= pmscd.cd_ndevs) + if (unit >= pms_cd.cd_ndevs) return ENXIO; - sc = pmscd.cd_devs[unit]; + sc = pms_cd.cd_devs[unit]; if (!sc) return ENXIO; @@ -2003,7 +2009,7 @@ pmsclose(dev, flag) dev_t dev; int flag; { - struct pms_softc *sc = pmscd.cd_devs[PMSUNIT(dev)]; + struct pms_softc *sc = pms_cd.cd_devs[PMSUNIT(dev)]; /* Disable interrupts. */ pms_dev_cmd(PMS_DEV_DISABLE); @@ -2023,7 +2029,7 @@ pmsread(dev, uio, flag) struct uio *uio; int flag; { - struct pms_softc *sc = pmscd.cd_devs[PMSUNIT(dev)]; + struct pms_softc *sc = pms_cd.cd_devs[PMSUNIT(dev)]; int s; int error; size_t length; @@ -2071,7 +2077,7 @@ pmsioctl(dev, cmd, addr, flag) caddr_t addr; int flag; { - struct pms_softc *sc = pmscd.cd_devs[PMSUNIT(dev)]; + struct pms_softc *sc = pms_cd.cd_devs[PMSUNIT(dev)]; struct mouseinfo info; int s; int error; @@ -2200,7 +2206,7 @@ pmsselect(dev, rw, p) int rw; struct proc *p; { - struct pms_softc *sc = pmscd.cd_devs[PMSUNIT(dev)]; + struct pms_softc *sc = pms_cd.cd_devs[PMSUNIT(dev)]; int s; int ret; -- 2.20.1