Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site lsuc.UUCP Path: utzoo!lsuc!dave From: dave@lsuc.UUCP (David Sherman) Newsgroups: net.unix-wizards,pe.cust.wanted Subject: How to open a modem which isn't asserting carrier-detect? Message-ID: <340@lsuc.UUCP> Date: Wed, 30-Jan-85 14:17:28 EST Article-I.D.: lsuc.340 Posted: Wed Jan 30 14:17:28 1985 Date-Received: Wed, 30-Jan-85 16:30:41 EST Reply-To: dave@lsuc.UUCP (David Sherman) Organization: Law Society of Upper Canada, Toronto Lines: 53 Scenario: a Perkin-Elmer 3220 running v7, with source. Various lines to modems and similar DCE devices. Normally, init waits on an open(2) call; when a call comes in to the modem, the modem raises CXR (carrier detect), the open succeeds, and init starts up a getty. Fine. Occasionally, I want an open to succeed whether or not CXR is asserted by the modem. For example, I want to call out with cu(1). I am *not* interested in solutions which involve changing a setting on the modem, or jumpers within the cable. This change has to be possible from the software, on any line at any time. Looking at the code in /usr/sys/dev/vdu.c, I find: vduopen(dev) { ... vduenab(tp); ... while (!(tp->t_state&CARR_ON)) sleep(&tp->t_rawq, TTIPRI); ... } vduenab(atp) { ... stat = ss(radd); if ((stat&CARR_OFF) == 0) tp->t_state |= CARR_ON; ... } So it looks like the change is fairly simple: given an indication that we don't care about the CARR_OFF (hardware) bit, vduenab can simply turn on the CARR_ON indicator in t_state and we're off to the races. Question (for those who are still with me): how do I get that indication to the kernel - that is, that I want the open to work whether or not the carrier is asserted? I can't use an ioctl, because you have to get the device open first before you can ioctl. Do I have to go through the hassle and overhead of another, almost identical, device driver, which points to the same address? Is there a better way? All ideas greatly appreciated. Dave Sherman The Law Society of Upper Canada Toronto -- {utzoo pesnta nrcaero utcs}!lsuc!dave {allegra decvax ihnp4 linus}!utcsrgv!lsuc!dave