ch->imodem = bc->mstat; 
ch->imodem = readb(&bc->mstat); 
static int pc_open(struct tty_struct *tty, struct file * filp){ /* Begin pc_open */	struct channel *ch;	unsigned long flags;	int line, retval, boardnum;	struct board_chan *bc;	unsigned int head;	line = tty->index;	if (line < 0 || line >= nbdevs)		return -ENODEV;	ch = &digi_channels[line];	boardnum = ch->boardnum;	/* Check status of board configured in system.  */	/* -----------------------------------------------------------------		I check to see if the epca_setup routine detected an user error.  		It might be better to put this in pc_init, but for the moment it		goes here.	---------------------------------------------------------------------- */	if (invalid_lilo_config) {		if (setup_error_code & INVALID_BOARD_TYPE)			printk(KERN_ERR "epca: pc_open: Invalid board type specified in kernel options.\n");		if (setup_error_code & INVALID_NUM_PORTS)			printk(KERN_ERR "epca: pc_open: Invalid number of ports specified in kernel options.\n");		if (setup_error_code & INVALID_MEM_BASE)			printk(KERN_ERR "epca: pc_open: Invalid board memory address specified in kernel options.\n");		if (setup_error_code & INVALID_PORT_BASE)			printk(KERN_ERR "epca; pc_open: Invalid board port address specified in kernel options.\n");		if (setup_error_code & INVALID_BOARD_STATUS)			printk(KERN_ERR "epca: pc_open: Invalid board status specified in kernel options.\n");		if (setup_error_code & INVALID_ALTPIN)			printk(KERN_ERR "epca: pc_open: Invalid board altpin specified in kernel options;\n");		tty->driver_data = NULL;   /* Mark this device as 'down' */		return -ENODEV;	}	if (boardnum >= num_cards || boards[boardnum].status == DISABLED)  {		tty->driver_data = NULL;   /* Mark this device as 'down' */		return(-ENODEV);	}		if ((bc = ch->brdchan) == 0) {		tty->driver_data = NULL;		return -ENODEV;	}	spin_lock_irqsave(&epca_lock, flags);	/* ------------------------------------------------------------------		Every time a channel is opened, increment a counter.  This is 		necessary because we do not wish to flush and shutdown the channel		until the last app holding the channel open, closes it.	 		--------------------------------------------------------------------- */	ch->count++;	/* ----------------------------------------------------------------		Set a kernel structures pointer to our local channel 		structure.  This way we can get to it when passed only		a tty struct.	------------------------------------------------------------------ */	tty->driver_data = ch;	/* ----------------------------------------------------------------		If this is the first time the channel has been opened, initialize		the tty->termios struct otherwise let pc_close handle it.	-------------------------------------------------------------------- */	globalwinon(ch);	ch->statusflags = 0;	/* Save boards current modem status */	ch->imodem = bc->mstat;	/* ----------------------------------------------------------------	   Set receive head and tail ptrs to each other.  This indicates	   no data available to read.	----------------------------------------------------------------- */	head = readw(&bc->rin);	writew(head, &bc->rout);	/* Set the channels associated tty structure */	ch->tty = tty;	/* -----------------------------------------------------------------		The below routine generally sets up parity, baud, flow control 		issues, etc.... It effect both control flags and input flags.	-------------------------------------------------------------------- */	epcaparam(tty,ch);	ch->asyncflags |= ASYNC_INITIALIZED;	memoff(ch);	spin_unlock_irqrestore(&epca_lock, flags);	retval = block_til_ready(tty, filp, ch);	if (retval)		return retval;	/* -------------------------------------------------------------		Set this again in case a hangup set it to zero while this 		open() was waiting for the line...	--------------------------------------------------------------- */	spin_lock_irqsave(&epca_lock, flags);	ch->tty = tty;	globalwinon(ch);	/* Enable Digi Data events */	writeb(1, &bc->idata);	memoff(ch);	spin_unlock_irqrestore(&epca_lock, flags);	return 0;} /* End pc_open */
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/bc9a5154a24d16d41cc79dbf1442de34454bc7db/epca.c/buggy/drivers/char/epca.c