Example #1
0
#define BVMBURSTLEN	16	/* max number of bytes to write in one chunk */

static tsw_open_t bvm_tty_open;
static tsw_close_t bvm_tty_close;
static tsw_outwakeup_t bvm_tty_outwakeup;

static struct ttydevsw bvm_ttydevsw = {
	.tsw_flags	= TF_NOPREFIX,
	.tsw_open	= bvm_tty_open,
	.tsw_close	= bvm_tty_close,
	.tsw_outwakeup	= bvm_tty_outwakeup,
};

static int			polltime;
static struct callout_handle	bvm_timeouthandle
    = CALLOUT_HANDLE_INITIALIZER(&bvm_timeouthandle);

#if defined(KDB)
static int			alt_break_state;
#endif

#define	BVM_CONS_PORT	0x220
static int bvm_cons_port = BVM_CONS_PORT;

#define BVM_CONS_SIG	('b' << 8 | 'v')

static void	bvm_timeout(void *);

static cn_probe_t	bvm_cnprobe;
static cn_init_t	bvm_cninit;
static cn_term_t	bvm_cnterm;
Example #2
0
File: aarp.c Project: MarginC/kame
extern u_char			etherbroadcastaddr[6];
# endif /* __FreeBSD__ */

static u_char atmulticastaddr[ 6 ] = {
    0x09, 0x00, 0x07, 0xff, 0xff, 0xff,
};

u_char	at_org_code[ 3 ] = {
    0x08, 0x00, 0x07,
};
u_char	aarp_org_code[ 3 ] = {
    0x00, 0x00, 0x00,
};

static struct callout_handle aarptimer_ch =
    CALLOUT_HANDLE_INITIALIZER(&aarptimer_ch);

static void
aarptimer(void *ignored)
{
    struct aarptab	*aat;
    int			i, s;

    aarptimer_ch = timeout( aarptimer, (caddr_t)0, AARPT_AGE * hz );
    aat = aarptab;
    for ( i = 0; i < AARPTAB_SIZE; i++, aat++ ) {
	if ( aat->aat_flags == 0 || ( aat->aat_flags & ATF_PERM ))
	    continue;
	if ( ++aat->aat_timer < (( aat->aat_flags & ATF_COM ) ?
		AARPT_KILLC : AARPT_KILLI ))
	    continue;
Example #3
0
	struct apmhook sc_resume;
#ifdef DEVFS
	void 	*sc_devfs_token;
#endif
};

static struct apm_softc apm_softc;
static struct apmhook	*hook[NAPM_HOOK];		/* XXX */

#define is_enabled(foo) ((foo) ? "enabled" : "disabled")

/* Map version number to integer (keeps ordering of version numbers) */
#define INTVERSION(major, minor)	((major)*100 + (minor))

static struct callout_handle apm_timeout_ch = 
    CALLOUT_HANDLE_INITIALIZER(&apm_timeout_ch);

static timeout_t apm_timeout;
static d_open_t apmopen;
static d_close_t apmclose;
static d_ioctl_t apmioctl;

#define CDEV_MAJOR 39
static struct cdevsw apm_cdevsw = 
	{ apmopen,	apmclose,	noread,		nowrite,	/*39*/
	  apmioctl,	nostop,		nullreset,	nodevtotty,/* APM */
	  seltrue,	nommap,		NULL ,	"apm"	,NULL,	-1};

/* setup APM GDT discriptors */
static void
setup_apm_gdt(u_int code32_base, u_int code16_base, u_int data_base, u_int code32_limit, u_int code16_limit, u_int data_limit)
Example #4
0
#define MECIA_DEVICE2SOFTC(dev)	((struct mecia_slot *) device_get_softc(dev))

/*
 *	Prototypes for interrupt handler.
 */
static driver_intr_t	meciaintr;
static int		mecia_ioctl(struct slot *, int, caddr_t);
static int		mecia_power(struct slot *);
static void		mecia_mapirq(struct slot *, int);
static timeout_t 	mecia_reset;
static void		mecia_resume(struct slot *);
static void		mecia_disable(struct slot *);
static timeout_t 	meciatimeout;
static struct callout_handle meciatimeout_ch
    = CALLOUT_HANDLE_INITIALIZER(&meciatimeout_ch);
static int		mecia_memory(struct slot *, int);
static int		mecia_io(struct slot *, int);

/*
 *	Per-slot data table.
 */
struct mecia_slot {
	int		unit;		/* Unit number */
	int		slotnum;	/* My slot number */
	struct slot	*slt;		/* Back ptr to slot */
	device_t	dev;		/* My device */
	u_char		last_reg1;	/* Last value of change reg */
};

static struct slot_ctrl mecia_cinfo = {
	.tsw_open	= hvcn_open,
	.tsw_outwakeup	= hvcn_outwakeup,
	.tsw_close	= hvcn_close,
};

#define PCBURST 16
static struct tty		*hvcn_tp = NULL;
static struct resource          *hvcn_irq;
static void                     *hvcn_intrhand;

static int bufindex;
static int buflen;
static u_char buf[PCBURST];
static int			polltime;
static struct callout_handle	hvcn_timeouthandle
    = CALLOUT_HANDLE_INITIALIZER(&hvcn_timeouthandle);

#if defined(KDB)
static int			alt_break_state;
#endif

static void     hvcn_timeout(void *);

static cn_probe_t	hvcn_cnprobe;
static cn_init_t	hvcn_cninit;
static cn_getc_t	hvcn_cngetc;
static cn_putc_t	hvcn_cnputc;
static cn_term_t	hvcn_cnterm;


CONSOLE_DRIVER(hvcn);