mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Sync with sys/i386/isa/sio.c revision up to 1.233.
This commit is contained in:
parent
8ee56ad2ed
commit
812d50e7a5
2 changed files with 44 additions and 4 deletions
|
|
@ -31,7 +31,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||
* $Id: sio.c,v 1.82 1999/03/04 10:37:30 kato Exp $
|
||||
* $Id: sio.c,v 1.83 1999/03/25 08:26:50 kato Exp $
|
||||
*/
|
||||
|
||||
#include "opt_comconsole.h"
|
||||
|
|
@ -151,6 +151,7 @@
|
|||
#ifdef DEVFS
|
||||
#include <sys/devfsext.h>
|
||||
#endif
|
||||
#include <sys/timepps.h>
|
||||
|
||||
#include <machine/clock.h>
|
||||
#include <machine/ipl.h>
|
||||
|
|
@ -381,6 +382,7 @@ struct com_s {
|
|||
bool_t do_dcd_timestamp;
|
||||
struct timeval timestamp;
|
||||
struct timeval dcd_timestamp;
|
||||
struct pps_state pps;
|
||||
|
||||
u_long bytes_in; /* statistics */
|
||||
u_long bytes_out;
|
||||
|
|
@ -1810,6 +1812,8 @@ determined_type: ;
|
|||
UID_UUCP, GID_DIALER, 0660, "cuala%r", unit);
|
||||
#endif
|
||||
com->id_flags = isdp->id_flags; /* Heritate id_flags for later */
|
||||
com->pps.ppscap = PPS_CAPTUREASSERT | PPS_CAPTURECLEAR;
|
||||
pps_init(&com->pps);
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
|
@ -2118,6 +2122,7 @@ comhardclose(com)
|
|||
com->poll_output = FALSE;
|
||||
com->do_timestamp = FALSE;
|
||||
com->do_dcd_timestamp = FALSE;
|
||||
com->pps.ppsparam.mode = 0;
|
||||
#ifdef PC98
|
||||
if (IS_8251(com->pc98_if_type))
|
||||
com_send_break_off(com);
|
||||
|
|
@ -2473,6 +2478,8 @@ siointr1(com)
|
|||
u_char recv_data;
|
||||
u_char int_ctl;
|
||||
u_char int_ctl_new;
|
||||
struct timecounter *tc;
|
||||
u_int count;
|
||||
|
||||
#ifdef PC98
|
||||
u_char tmp=0;
|
||||
|
|
@ -2500,6 +2507,16 @@ more_intr:
|
|||
if (tmp & STS8251_BD_SD) line_status |= LSR_BI;
|
||||
} else
|
||||
#endif /* PC98 */
|
||||
if (com->pps.ppsparam.mode & PPS_CAPTUREBOTH) {
|
||||
modem_status = inb(com->modem_status_port);
|
||||
if ((modem_status ^ com->last_modem_status) & MSR_DCD) {
|
||||
tc = timecounter;
|
||||
count = tc->tc_get_timecount(tc);
|
||||
pps_event(&com->pps, tc, count,
|
||||
(modem_status & MSR_DCD) ?
|
||||
PPS_CAPTUREASSERT : PPS_CAPTURECLEAR);
|
||||
}
|
||||
}
|
||||
line_status = inb(com->line_status_port);
|
||||
#ifdef PC98
|
||||
if (com->pc98_if_type == COM_IF_RSA98III)
|
||||
|
|
@ -2981,7 +2998,10 @@ sioioctl(dev, cmd, data, flag, p)
|
|||
break;
|
||||
default:
|
||||
splx(s);
|
||||
return (ENOTTY);
|
||||
error = pps_ioctl(cmd, data, &com->pps);
|
||||
if (error == ENODEV)
|
||||
error = ENOTTY;
|
||||
return (error);
|
||||
}
|
||||
#ifdef PC98
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||
* $Id: sio.c,v 1.82 1999/03/04 10:37:30 kato Exp $
|
||||
* $Id: sio.c,v 1.83 1999/03/25 08:26:50 kato Exp $
|
||||
*/
|
||||
|
||||
#include "opt_comconsole.h"
|
||||
|
|
@ -151,6 +151,7 @@
|
|||
#ifdef DEVFS
|
||||
#include <sys/devfsext.h>
|
||||
#endif
|
||||
#include <sys/timepps.h>
|
||||
|
||||
#include <machine/clock.h>
|
||||
#include <machine/ipl.h>
|
||||
|
|
@ -381,6 +382,7 @@ struct com_s {
|
|||
bool_t do_dcd_timestamp;
|
||||
struct timeval timestamp;
|
||||
struct timeval dcd_timestamp;
|
||||
struct pps_state pps;
|
||||
|
||||
u_long bytes_in; /* statistics */
|
||||
u_long bytes_out;
|
||||
|
|
@ -1810,6 +1812,8 @@ determined_type: ;
|
|||
UID_UUCP, GID_DIALER, 0660, "cuala%r", unit);
|
||||
#endif
|
||||
com->id_flags = isdp->id_flags; /* Heritate id_flags for later */
|
||||
com->pps.ppscap = PPS_CAPTUREASSERT | PPS_CAPTURECLEAR;
|
||||
pps_init(&com->pps);
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
|
@ -2118,6 +2122,7 @@ comhardclose(com)
|
|||
com->poll_output = FALSE;
|
||||
com->do_timestamp = FALSE;
|
||||
com->do_dcd_timestamp = FALSE;
|
||||
com->pps.ppsparam.mode = 0;
|
||||
#ifdef PC98
|
||||
if (IS_8251(com->pc98_if_type))
|
||||
com_send_break_off(com);
|
||||
|
|
@ -2473,6 +2478,8 @@ siointr1(com)
|
|||
u_char recv_data;
|
||||
u_char int_ctl;
|
||||
u_char int_ctl_new;
|
||||
struct timecounter *tc;
|
||||
u_int count;
|
||||
|
||||
#ifdef PC98
|
||||
u_char tmp=0;
|
||||
|
|
@ -2500,6 +2507,16 @@ more_intr:
|
|||
if (tmp & STS8251_BD_SD) line_status |= LSR_BI;
|
||||
} else
|
||||
#endif /* PC98 */
|
||||
if (com->pps.ppsparam.mode & PPS_CAPTUREBOTH) {
|
||||
modem_status = inb(com->modem_status_port);
|
||||
if ((modem_status ^ com->last_modem_status) & MSR_DCD) {
|
||||
tc = timecounter;
|
||||
count = tc->tc_get_timecount(tc);
|
||||
pps_event(&com->pps, tc, count,
|
||||
(modem_status & MSR_DCD) ?
|
||||
PPS_CAPTUREASSERT : PPS_CAPTURECLEAR);
|
||||
}
|
||||
}
|
||||
line_status = inb(com->line_status_port);
|
||||
#ifdef PC98
|
||||
if (com->pc98_if_type == COM_IF_RSA98III)
|
||||
|
|
@ -2981,7 +2998,10 @@ sioioctl(dev, cmd, data, flag, p)
|
|||
break;
|
||||
default:
|
||||
splx(s);
|
||||
return (ENOTTY);
|
||||
error = pps_ioctl(cmd, data, &com->pps);
|
||||
if (error == ENODEV)
|
||||
error = ENOTTY;
|
||||
return (error);
|
||||
}
|
||||
#ifdef PC98
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue