aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/cy/cy.c
diff options
context:
space:
mode:
authorPaul Traina <pst@FreeBSD.org>1995-02-25 20:09:44 +0000
committerPaul Traina <pst@FreeBSD.org>1995-02-25 20:09:44 +0000
commit77f77631e75f6858d00b61473e49b7c8906c5aa8 (patch)
tree1f0482b969de4dd457ac5b450c026dcaab6317e2 /sys/dev/cy/cy.c
parent686c46d225921363fb8749fd74457ecbf8a9e987 (diff)
downloadsrc-77f77631e75f6858d00b61473e49b7c8906c5aa8.tar.gz
src-77f77631e75f6858d00b61473e49b7c8906c5aa8.zip
(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
Notes
Notes: svn path=/head/; revision=6712
Diffstat (limited to 'sys/dev/cy/cy.c')
-rw-r--r--sys/dev/cy/cy.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index 3bd203bcb2aa..ff67eb436198 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)