From owner-freebsd-current Fri Jul 13 4:17:46 2001 Delivered-To: freebsd-current@freebsd.org Received: from nasu.utsunomiya-u.ac.jp (nasu.utsunomiya-u.ac.jp [160.12.128.3]) by hub.freebsd.org (Postfix) with ESMTP id 2D7EB37B403 for ; Fri, 13 Jul 2001 04:17:41 -0700 (PDT) (envelope-from yokota@zodiac.mech.utsunomiya-u.ac.jp) Received: from nantai.utsunomiya-u.ac.jp by nasu.utsunomiya-u.ac.jp (8.11.2/1.1.29.3/26Jan01-1134AM) id f6DBHec73049; Fri, 13 Jul 2001 20:17:40 +0900 (JST) Received: from zodiac.mech.utsunomiya-u.ac.jp by nantai.utsunomiya-u.ac.jp (8.11.2/1.1.29.3/30Jan01-0241PM) id f6DBHdl171548; Fri, 13 Jul 2001 20:17:39 +0900 (JST) Received: from zodiac.mech.utsunomiya-u.ac.jp (IDENT:ANGiwAr5CjmZueGvhnK3iDxSbAjmTCJQ@zodiac.mech.utsunomiya-u.ac.jp [160.12.43.7]) by zodiac.mech.utsunomiya-u.ac.jp (8.9.3+3.2W/3.7W/zodiac-May2000) with ESMTP id UAA18366; Fri, 13 Jul 2001 20:27:16 +0900 (JST) Message-Id: <200107131127.UAA18366@zodiac.mech.utsunomiya-u.ac.jp> To: freebsd-current@freebsd.org Cc: yokota@zodiac.mech.utsunomiya-u.ac.jp Subject: Please review and test: rc driver patch Date: Fri, 13 Jul 2001 20:27:15 +0900 From: Kazutaka YOKOTA Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Would somebody please review and test the attached patch for the rc driver? I don't have hardware to test this. It will make the rc driver to use ttymalloc(), rather than to maintain static array of struct tty. Kazu Index: rc.c =================================================================== RCS file: /src/CVS/src/sys/i386/isa/rc.c,v retrieving revision 1.63 diff -u -r1.63 rc.c --- rc.c 2001/05/15 23:22:22 1.63 +++ rc.c 2001/07/06 01:23:05 @@ -142,10 +142,6 @@ static int rc_scheduled_event = 0; -/* for pstat -t */ -static struct tty rc_tty[NRC * CD180_NCHAN]; -static const int nrc_tty = NRC * CD180_NCHAN; - /* Flags */ #define RC_DTR_OFF 0x0001 /* DTR wait, for close/open */ #define RC_ACTOUT 0x0002 /* Dial-out port active */ @@ -259,15 +255,24 @@ rc->rc_dtrwait = 3 * hz; rc->rc_dcdwaits= 0; rc->rc_hotchar = 0; - tp = rc->rc_tp = &rc_tty[chan + (dvp->id_unit * CD180_NCHAN)]; + tp = rc->rc_tp = ttymalloc(rc->rc_tp); ttychars(tp); tp->t_lflag = tp->t_iflag = tp->t_oflag = 0; tp->t_cflag = TTYDEF_CFLAG; tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED; + if (!rc_started) { + make_dev(&rc_cdevsw, + rcb->rcb_unit*CD180_NCHAN + chan, + UID_ROOT, GID_WHEEL, 0600, "ttym%r", + rcb->rcb_unit*CD180_NCHAN + chan); + make_dev(&rc_cdevsw, + rcb->rcb_unit*CD180_NCHAN + chan + 128, + UID_ROOT, GID_WHEEL, 0660, "cuam%r", + rcb->rcb_unit*CD180_NCHAN + chan + 128); + } } rcb->rcb_probed = RC_ATTACHED; if (!rc_started) { - cdevsw_add(&rc_cdevsw); swi_add(&tty_ithd, "tty:rc", rcpoll, NULL, SWI_TTY, 0, &rc_ih); rc_wakeup((void *)NULL); rc_started = 1; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message