summaryrefslogtreecommitdiffstats
path: root/sys/dev/cy
diff options
context:
space:
mode:
authorpst <pst@FreeBSD.org>1995-02-25 20:09:44 +0000
committerpst <pst@FreeBSD.org>1995-02-25 20:09:44 +0000
commit1dcb420b646ff6fd0ab578e340fd7f26b32ed79d (patch)
tree1f0482b969de4dd457ac5b450c026dcaab6317e2 /sys/dev/cy
parent04958419e842202587df95082c8717fe0b164213 (diff)
downloadFreeBSD-src-1dcb420b646ff6fd0ab578e340fd7f26b32ed79d.zip
FreeBSD-src-1dcb420b646ff6fd0ab578e340fd7f26b32ed79d.tar.gz
(a) remove the pointer to each driver's tty structure array from cdevsw
(b) add a function callback vector to tty drivers that will return a pointer to a valid tty structure based upon a dev_t (c) make syscons structures the same size whether or not APM is enabled so utilities don't crash if NAPM changes (and make the damn kernel compile!) (d) rewrite /dev/snp ioctl interface so that it is device driver and i386 independant
Diffstat (limited to 'sys/dev/cy')
-rw-r--r--sys/dev/cy/cy.c19
-rw-r--r--sys/dev/cy/cy_isa.c19
2 files changed, 32 insertions, 6 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index 3bd203b..ff67eb4 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.1 1995/02/09 09:47:27 jkh Exp $
+ * $Id: cy.c,v 1.2 1995/02/15 18:41:41 bde Exp $
*/
/*
@@ -1500,13 +1500,26 @@ cystop(struct tty *tp, int flag)
return 0;
}
+struct tty *
+cydevtotty(dev_t dev)
+{
+ u_char unit = UNIT(dev);
+
+ if (unit >= /* NCY * ? */ PORTS_PER_CYCLOM)
+ return NULL;
+
+ return info[unit]->tty;
+}
int
cyselect(dev_t dev, int rw, struct proc *p)
{
- return (ttselect(UNIT(dev), rw, p));
-} /* end of cyselect() */
+ u_char unit = UNIT(dev);
+ if (unit >= /* NCY * ? */ PORTS_PER_CYCLOM)
+ return (ENXIO);
+ return (ttyselect(info[unit]->tty, rw, p));
+}
int
cyspeed(int speed, int *prescaler_io)
diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c
index 3bd203b..ff67eb4 100644
--- a/sys/dev/cy/cy_isa.c
+++ b/sys/dev/cy/cy_isa.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.1 1995/02/09 09:47:27 jkh Exp $
+ * $Id: cy.c,v 1.2 1995/02/15 18:41:41 bde Exp $
*/
/*
@@ -1500,13 +1500,26 @@ cystop(struct tty *tp, int flag)
return 0;
}
+struct tty *
+cydevtotty(dev_t dev)
+{
+ u_char unit = UNIT(dev);
+
+ if (unit >= /* NCY * ? */ PORTS_PER_CYCLOM)
+ return NULL;
+
+ return info[unit]->tty;
+}
int
cyselect(dev_t dev, int rw, struct proc *p)
{
- return (ttselect(UNIT(dev), rw, p));
-} /* end of cyselect() */
+ u_char unit = UNIT(dev);
+ if (unit >= /* NCY * ? */ PORTS_PER_CYCLOM)
+ return (ENXIO);
+ return (ttyselect(info[unit]->tty, rw, p));
+}
int
cyspeed(int speed, int *prescaler_io)
OpenPOWER on IntegriCloud