summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authornsouch <nsouch@FreeBSD.org>1999-02-14 16:19:16 +0000
committernsouch <nsouch@FreeBSD.org>1999-02-14 16:19:16 +0000
commit9f6adcd1d82fbfb6c8fcd9953213bbcdc1fd6cb7 (patch)
treef13e3889abb826ccb47d5b9f9920186e54e59161 /sys
parentc30e87e63a89b1265197a2373650e258bde477cb (diff)
downloadFreeBSD-src-9f6adcd1d82fbfb6c8fcd9953213bbcdc1fd6cb7.zip
FreeBSD-src-9f6adcd1d82fbfb6c8fcd9953213bbcdc1fd6cb7.tar.gz
Move away from lpt.h data structure definition that only lpt.c relies on.
Remove if_plip.c dependency to lpt.h.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ppbus/if_plip.c7
-rw-r--r--sys/dev/ppbus/lpt.c36
-rw-r--r--sys/dev/ppbus/lpt.h59
3 files changed, 59 insertions, 43 deletions
diff --git a/sys/dev/ppbus/if_plip.c b/sys/dev/ppbus/if_plip.c
index 488b461..cfae33d 100644
--- a/sys/dev/ppbus/if_plip.c
+++ b/sys/dev/ppbus/if_plip.c
@@ -24,7 +24,7 @@
* SUCH DAMAGE.
*
* From Id: lpt.c,v 1.55.2.1 1996/11/12 09:08:38 phk Exp
- * $Id: if_plip.c,v 1.10 1999/02/08 14:12:38 des Exp $
+ * $Id: if_plip.c,v 1.11 1999/02/14 11:59:59 nsouch Exp $
*/
/*
@@ -99,7 +99,6 @@
#endif
#include <dev/ppbus/ppbconf.h>
-#include <dev/ppbus/lpt.h>
#include "opt_plip.h"
@@ -359,7 +358,7 @@ lpioctl (struct ifnet *ifp, u_long cmd, caddr_t data)
return ENOBUFS;
}
- ppb_wctr(&sc->lp_dev, LPC_ENA);
+ ppb_wctr(&sc->lp_dev, IRQENABLE);
ifp->if_flags |= IFF_RUNNING;
}
break;
@@ -646,7 +645,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m,
s = splhigh();
/* Suspend (on laptops) or receive-errors might have taken us offline */
- ppb_wctr(&sc->lp_dev, LPC_ENA);
+ ppb_wctr(&sc->lp_dev, IRQENABLE);
if (ifp->if_flags & IFF_LINK0) {
diff --git a/sys/dev/ppbus/lpt.c b/sys/dev/ppbus/lpt.c
index 4fd67b8..2cbef0e 100644
--- a/sys/dev/ppbus/lpt.c
+++ b/sys/dev/ppbus/lpt.c
@@ -48,7 +48,7 @@
* from: unknown origin, 386BSD 0.1
* From Id: lpt.c,v 1.55.2.1 1996/11/12 09:08:38 phk Exp
* From Id: nlpt.c,v 1.14 1999/02/08 13:55:43 des Exp
- * $Id$
+ * $Id: lpt.c,v 1.1 1999/02/14 11:59:59 nsouch Exp $
*/
/*
@@ -108,6 +108,40 @@ static int volatile lptflag = 1;
#define LPTUNIT(s) ((s)&0x03)
#define LPTFLAGS(s) ((s)&0xfc)
+struct lpt_data {
+ unsigned short lpt_unit;
+
+ struct ppb_device lpt_dev;
+
+ short sc_state;
+ /* default case: negative prime, negative ack, handshake strobe,
+ prime once */
+ u_char sc_control;
+ char sc_flags;
+#define LP_POS_INIT 0x04 /* if we are a postive init signal */
+#define LP_POS_ACK 0x08 /* if we are a positive going ack */
+#define LP_NO_PRIME 0x10 /* don't prime the printer at all */
+#define LP_PRIMEOPEN 0x20 /* prime on every open */
+#define LP_AUTOLF 0x40 /* tell printer to do an automatic lf */
+#define LP_BYPASS 0x80 /* bypass printer ready checks */
+ struct buf *sc_inbuf;
+ struct buf *sc_statbuf;
+ short sc_xfercnt ;
+ char sc_primed;
+ char *sc_cp ;
+ u_short sc_irq ; /* IRQ status of port */
+#define LP_HAS_IRQ 0x01 /* we have an irq available */
+#define LP_USE_IRQ 0x02 /* we are using our irq */
+#define LP_ENABLE_IRQ 0x04 /* enable IRQ on open */
+#define LP_ENABLE_EXT 0x10 /* we shall use advanced mode when possible */
+ u_char sc_backoff ; /* time to call lptout() again */
+
+#ifdef DEVFS
+ void *devfs_token;
+ void *devfs_token_ctl;
+#endif
+};
+
static int nlpt = 0;
#define MAXLPT 8 /* XXX not much better! */
static struct lpt_data *lptdata[MAXLPT];
diff --git a/sys/dev/ppbus/lpt.h b/sys/dev/ppbus/lpt.h
index 6be7f73..a40035e 100644
--- a/sys/dev/ppbus/lpt.h
+++ b/sys/dev/ppbus/lpt.h
@@ -1,5 +1,11 @@
/*-
- * Copyright (c) 1997 Nicolas Souchu
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Copyright (c) 1997, 1999 Nicolas Souchu
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -28,10 +34,21 @@
* Id: lptreg.h,v 1.6 1997/02/22 09:36:52 peter Exp
* From Id: nlpt.h,v 1.3 1999/01/10 12:04:54 nsouch Exp
*
- * $Id$
+ * $Id: lpt.h,v 1.1 1999/02/14 11:59:59 nsouch Exp $
*/
-#ifndef __NLPT_H
-#define __NLPT_H
+
+/*
+ * AT Parallel Port (for lineprinter)
+ * Interface port and bit definitions
+ * Written by William Jolitz 12/18/90
+ * Copyright (C) William Jolitz 1990
+ */
+
+#ifndef __LPT_H
+#define __LPT_H
+
+/* machine independent definitions, it shall only depend on the ppbus
+ * parallel port model */
#define LPS_NERR 0x08 /* printer no error */
#define LPS_SEL 0x10 /* printer selected */
@@ -45,38 +62,4 @@
#define LPC_SEL 0x08 /* printer selected */
#define LPC_ENA 0x10 /* enable IRQ */
-struct lpt_data {
- unsigned short lpt_unit;
-
- struct ppb_device lpt_dev;
-
- short sc_state;
- /* default case: negative prime, negative ack, handshake strobe,
- prime once */
- u_char sc_control;
- char sc_flags;
-#define LP_POS_INIT 0x04 /* if we are a postive init signal */
-#define LP_POS_ACK 0x08 /* if we are a positive going ack */
-#define LP_NO_PRIME 0x10 /* don't prime the printer at all */
-#define LP_PRIMEOPEN 0x20 /* prime on every open */
-#define LP_AUTOLF 0x40 /* tell printer to do an automatic lf */
-#define LP_BYPASS 0x80 /* bypass printer ready checks */
- struct buf *sc_inbuf;
- struct buf *sc_statbuf;
- short sc_xfercnt ;
- char sc_primed;
- char *sc_cp ;
- u_short sc_irq ; /* IRQ status of port */
-#define LP_HAS_IRQ 0x01 /* we have an irq available */
-#define LP_USE_IRQ 0x02 /* we are using our irq */
-#define LP_ENABLE_IRQ 0x04 /* enable IRQ on open */
-#define LP_ENABLE_EXT 0x10 /* we shall use advanced mode when possible */
- u_char sc_backoff ; /* time to call lptout() again */
-
-#ifdef DEVFS
- void *devfs_token;
- void *devfs_token_ctl;
-#endif
-};
-
#endif
OpenPOWER on IntegriCloud