* NOTE: we use a set of macros to create the variables, which allows
* us to specify the variable type, name, initial value, and description.
*/
-PARM_INT(debug, 0x00, 0644, "Driver debugging level");
PARM_INT(rawreadok, 1, 0644, "Bypass flip buffers on input");
-PARM_INT(trcbuf_size, 0x100000, 0644, "Debugging trace buffer size.");
/**************************************************************************
static int dgap_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
static void dgap_remove_one(struct pci_dev *dev);
static int dgap_probe1(struct pci_dev *pdev, int card_type);
-static void dgap_mbuf(struct board_t *brd, const char *fmt, ...);
static int dgap_do_remap(struct board_t *brd);
static irqreturn_t dgap_intr(int irq, void *voidbrd);
{
int rc = 0;
- APR(("%s, Digi International Part Number %s\n", DG_NAME, DG_PART));
+ pr_info("%s, Digi International Part Number %s\n", DG_NAME, DG_PART);
dgap_driver_state = DRIVER_NEED_CONFIG_LOAD;
dgap_driver_state = DRIVER_READY;
}
- DPR_INIT(("Finished init_module. Returning %d\n", rc));
return (rc);
}
dgap_NumBoards = 0;
- APR(("For the tools package or updated drivers please visit http://www.digi.com\n"));
+ pr_info("For the tools package please visit http://www.digi.com\n");
/*
* Register our base character device into the kernel.
* Register management/dpa devices
*/
rc = register_chrdev(DIGI_DGAP_MAJOR, "dgap", &DgapBoardFops);
- if (rc < 0) {
- APR(("Can't register dgap driver device (%d)\n", rc));
+ if (rc < 0)
return (rc);
- }
dgap_class = class_create(THIS_MODULE, "dgap_mgmt");
device_create(dgap_class, NULL,
*/
rc = dgap_tty_preinit();
- if (rc < 0) {
- APR(("tty preinit - not enough memory (%d)\n", rc));
+ if (rc < 0)
return(rc);
- }
/* Start the poller */
DGAP_LOCK(dgap_poll_lock, flags);
rc = dgap_probe1(pdev, ent->driver_data);
if (rc == 0) {
dgap_NumBoards++;
- DPR_INIT(("Incrementing numboards to %d\n", dgap_NumBoards));
rc = dgap_firmware_load(pdev, ent->driver_data);
}
}
/* get the board structure and prep it */
brd = dgap_Board[dgap_NumBoards] =
(struct board_t *) kzalloc(sizeof(struct board_t), GFP_KERNEL);
- if (!brd) {
- APR(("memory allocation for board structure failed\n"));
+ if (!brd)
return(-ENOMEM);
- }
/* make a temporary message buffer for the boot messages */
brd->msgbuf = brd->msgbuf_head =
(char *) kzalloc(sizeof(char) * 8192, GFP_KERNEL);
if(!brd->msgbuf) {
kfree(brd);
- APR(("memory allocation for board msgbuf failed\n"));
return(-ENOMEM);
}
brd->membase_end = pci_resource_end(pdev, 0);
}
- if (!brd->membase) {
- APR(("card has no PCI IO resources, failing board.\n"));
+ if (!brd->membase)
return -ENODEV;
- }
if (brd->membase & 1)
brd->membase &= ~3;
/* init our poll helper tasklet */
tasklet_init(&brd->helper_tasklet, dgap_poll_tasklet, (unsigned long) brd);
- /* Log the information about the board */
- dgap_mbuf(brd, DRVSTR": board %d: %s (rev %d), irq %d\n",
- dgap_NumBoards, brd->name, brd->rev, brd->irq);
-
- DPR_INIT(("dgap_scan(%d) - printing out the msgbuf\n", i));
DGAP_LOCK(dgap_global_lock, flags);
brd->msgbuf = NULL;
printk("%s", brd->msgbuf_head);
int rc;
- DPR_INIT(("dgap_finalize_board_init() - start\n"));
-
if (!brd || brd->magic != DGAP_BOARD_MAGIC)
return(-ENODEV);
- DPR_INIT(("dgap_finalize_board_init() - start #2\n"));
-
brd->use_interrupts = dgap_config_get_useintr(brd);
/*
rc = request_irq(brd->irq, dgap_intr, IRQF_SHARED, "DGAP", brd);
- if (rc) {
- dgap_mbuf(brd, DRVSTR": Failed to hook IRQ %d. Board will work in poll mode.\n",
- brd->irq);
+ if (rc)
brd->intr_used = 0;
- }
else
brd->intr_used = 1;
} else {
ret = dgap_tty_init(brd);
if (ret < 0) {
dgap_tty_uninit(brd);
- pr_err("dgap: Can't init tty devices (%d)\n", ret);
return ret;
}
if (!brd || brd->magic != DGAP_BOARD_MAGIC)
return -ENXIO;
- if (!request_mem_region(brd->membase, 0x200000, "dgap")) {
- APR(("dgap: mem_region %lx already in use.\n", brd->membase));
+ if (!request_mem_region(brd->membase, 0x200000, "dgap"))
return -ENOMEM;
- }
if (!request_mem_region(brd->membase + PCI_IO_OFFSET, 0x200000, "dgap")) {
- APR(("dgap: mem_region IO %lx already in use.\n",
- brd->membase + PCI_IO_OFFSET));
release_mem_region(brd->membase, 0x200000);
return -ENOMEM;
}
brd->re_map_membase = ioremap(brd->membase, 0x200000);
if (!brd->re_map_membase) {
- APR(("dgap: ioremap mem %lx cannot be mapped.\n", brd->membase));
release_mem_region(brd->membase, 0x200000);
release_mem_region(brd->membase + PCI_IO_OFFSET, 0x200000);
return -ENOMEM;
release_mem_region(brd->membase, 0x200000);
release_mem_region(brd->membase + PCI_IO_OFFSET, 0x200000);
iounmap(brd->re_map_membase);
- APR(("dgap: ioremap IO mem %lx cannot be mapped.\n",
- brd->membase + PCI_IO_OFFSET));
return -ENOMEM;
}
- DPR_INIT(("remapped io: 0x%p remapped mem: 0x%p\n",
- brd->re_map_port, brd->re_map_membase));
return 0;
}
{
struct board_t *brd = (struct board_t *) voidbrd;
- if (!brd) {
- APR(("Received interrupt (%d) with null board associated\n", irq));
+ if (!brd)
return IRQ_NONE;
- }
/*
* Check to make sure its for us.
*/
- if (brd->magic != DGAP_BOARD_MAGIC) {
- APR(("Received interrupt (%d) with a board pointer that wasn't ours!\n", irq));
+ if (brd->magic != DGAP_BOARD_MAGIC)
return IRQ_NONE;
- }
brd->intr_count++;
int i = 0;
dgap_rawreadok = rawreadok;
- dgap_trcbuf_size = trcbuf_size;
- dgap_debug = debug;
for (i = 0; i < MAXBOARDS; i++) {
dgap_Board[i] = NULL;
*
************************************************************************/
-
-/*
- * dgap_mbuf()
- *
- * Used to print to the message buffer during board init.
- */
-static void dgap_mbuf(struct board_t *brd, const char *fmt, ...) {
- va_list ap;
- char buf[1024];
- int i;
- unsigned long flags;
- size_t length;
-
- DGAP_LOCK(dgap_global_lock, flags);
-
- /* Format buf using fmt and arguments contained in ap. */
- va_start(ap, fmt);
- i = vsnprintf(buf, sizeof(buf), fmt, ap);
- va_end(ap);
-
- DPR((buf));
-
- if (!brd || !brd->msgbuf) {
- printk("%s", buf);
- DGAP_UNLOCK(dgap_global_lock, flags);
- return;
- }
-
- length = strlen(buf) + 1;
- if (brd->msgbuf - brd->msgbuf_head < length)
- length = brd->msgbuf - brd->msgbuf_head;
- memcpy(brd->msgbuf, buf, length);
- brd->msgbuf += length;
-
- DGAP_UNLOCK(dgap_global_lock, flags);
-}
-
-
/*
* dgap_ms_sleep()
*
if (!dgap_TmpWriteBuf) {
DGAP_UNLOCK(dgap_global_lock, flags);
- DPR_INIT(("unable to allocate tmp write buf"));
return (-ENOMEM);
}
{
int rc = 0;
- DPR_INIT(("tty_register start"));
-
brd->SerialDriver = alloc_tty_driver(MAXPORTS);
snprintf(brd->SerialName, MAXTTYNAMELEN, "tty_dgap_%d_", brd->boardnum);
if (!brd->dgap_Major_Serial_Registered) {
/* Register tty devices */
rc = tty_register_driver(brd->SerialDriver);
- if (rc < 0) {
- APR(("Can't register tty device (%d)\n", rc));
+ if (rc < 0)
return(rc);
- }
brd->dgap_Major_Serial_Registered = TRUE;
dgap_BoardsByMajor[brd->SerialDriver->major] = brd;
brd->dgap_Serial_Major = brd->SerialDriver->major;
if (!brd->dgap_Major_TransparentPrint_Registered) {
/* Register Transparent Print devices */
rc = tty_register_driver(brd->PrintDriver);
- if (rc < 0) {
- APR(("Can't register Transparent Print device (%d)\n", rc));
+ if (rc < 0)
return(rc);
- }
brd->dgap_Major_TransparentPrint_Registered = TRUE;
dgap_BoardsByMajor[brd->PrintDriver->major] = brd;
brd->dgap_TransparentPrint_Major = brd->PrintDriver->major;
}
- DPR_INIT(("DGAP REGISTER TTY: MAJORS: %d %d\n", brd->SerialDriver->major,
- brd->PrintDriver->major));
-
return (rc);
}
if (!brd)
return (-ENXIO);
- DPR_INIT(("dgap_tty_init start\n"));
-
/*
* Initialize board structure elements.
*/
}
if (true_count != brd->nasync) {
- if ((brd->type == PPCM) && (true_count == 64)) {
- APR(("***WARNING**** %s configured for %d ports, has %d ports.\nPlease make SURE the EBI cable running from the card\nto each EM module is plugged into EBI IN!\n",
- brd->name, brd->nasync, true_count));
- }
- else if ((brd->type == PPCM) && (true_count == 0)) {
- APR(("***WARNING**** %s configured for %d ports, has %d ports.\nPlease make SURE the EBI cable running from the card\nto each EM module is plugged into EBI IN!\n",
- brd->name, brd->nasync, true_count));
- }
- else {
- APR(("***WARNING**** %s configured for %d ports, has %d ports.\n",
- brd->name, brd->nasync, true_count));
- }
+ if ((brd->type == PPCM) && (true_count == 64))
+ pr_warn("dgap: %s configured for %d ports, has %d ports.\nPlease make SURE the EBI cable running from the card\nto each EM module is plugged into EBI IN!\n",
+ brd->name, brd->nasync, true_count);
+ else if ((brd->type == PPCM) && (true_count == 0))
+ pr_warn("dgap: %s configured for %d ports, has %d ports.\nPlease make SURE the EBI cable running from the card\nto each EM module is plugged into EBI IN!\n",
+ brd->name, brd->nasync, true_count);
+ else
+ pr_warn("dgap: %s configured for %d ports, has %d ports.\n",
+ brd->name, brd->nasync, true_count);
brd->nasync = true_count;
for (i = 0; i < brd->nasync; i++) {
if (!brd->channels[i]) {
brd->channels[i] = kzalloc(sizeof(struct channel_t), GFP_ATOMIC);
- if (!brd->channels[i]) {
- DPR_CORE(("%s:%d Unable to allocate memory for channel struct\n",
- __FILE__, __LINE__));
- }
+ if (!brd->channels[i])
+ return -ENOMEM;
}
}
writeb(1, &(ch->ch_bs->idata));
}
-
- DPR_INIT(("dgap_tty_init finish\n"));
-
return (0);
}
if(!bd || bd->magic != DGAP_BOARD_MAGIC)
return;
- DPR_READ(("dgap_input start\n"));
-
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
writeb(1, &(bs->idata));
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- DPR_READ(("No data on port %d\n", ch->ch_portnum));
return;
}
!(ch->ch_tun.un_flags & UN_ISOPEN) || !(tp->termios.c_cflag & CREAD) ||
(ch->ch_tun.un_flags & UN_CLOSING)) {
- DPR_READ(("input. dropping %d bytes on port %d...\n", data_len, ch->ch_portnum));
- DPR_READ(("input. tp: %p tp->magic: %x MAGIC:%x ch flags: %x\n",
- tp, tp ? tp->magic : 0, TTY_MAGIC, ch->ch_tun.un_flags));
writew(head, &(bs->rx_tail));
writeb(1, &(bs->idata));
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
writeb(1, &(bs->idata));
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- DPR_READ(("Port %d throttled, not reading any data. head: %x tail: %x\n",
- ch->ch_portnum, head, tail));
return;
}
writeb(0, &(bs->orun));
}
- DPR_READ(("dgap_input start 2\n"));
-
/* Decide how much data we can send into the tty layer */
flip_len = TTY_FLIPBUF_SIZE;
writeb(1, &(bs->idata));
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- DPR_READ(("dgap_input 1 - finish\n"));
if (ld)
tty_ldisc_deref(ld);
return;
if (ld)
tty_ldisc_deref(ld);
- DPR_READ(("dgap_input - finish\n"));
}
int virt_carrier = 0;
int phys_carrier = 0;
- DPR_CARR(("dgap_carrier called...\n"));
-
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
return;
ch->ch_cd = DM_CD;
}
- if (ch->ch_mistat & D_CD(ch)) {
- DPR_CARR(("mistat: %x D_CD: %x\n", ch->ch_mistat, D_CD(ch)));
+ if (ch->ch_mistat & D_CD(ch))
phys_carrier = 1;
- }
if (ch->ch_digi.digi_flags & DIGI_FORCEDCD) {
virt_carrier = 1;
virt_carrier = 1;
}
-
- DPR_CARR(("DCD: physical: %d virt: %d\n", phys_carrier, virt_carrier));
-
/*
* Test for a VIRTUAL carrier transition to HIGH.
*/
* for carrier in the open routine.
*/
- DPR_CARR(("carrier: virt DCD rose\n"));
-
if (waitqueue_active(&(ch->ch_flags_wait)))
wake_up_interruptible(&ch->ch_flags_wait);
}
* for carrier in the open routine.
*/
- DPR_CARR(("carrier: physical DCD rose\n"));
-
if (waitqueue_active(&(ch->ch_flags_wait)))
wake_up_interruptible(&ch->ch_flags_wait);
}
if (waitqueue_active(&(ch->ch_flags_wait)))
wake_up_interruptible(&ch->ch_flags_wait);
- if (ch->ch_tun.un_open_count > 0) {
- DPR_CARR(("Sending tty hangup\n"));
+ if (ch->ch_tun.un_open_count > 0)
tty_hangup(ch->ch_tun.un_tty);
- }
- if (ch->ch_pun.un_open_count > 0) {
- DPR_CARR(("Sending pr hangup\n"));
+ if (ch->ch_pun.un_open_count > 0)
tty_hangup(ch->ch_pun.un_tty);
- }
}
/*
else {
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(brd->bd_lock, lock_flags);
- DPR_OPEN(("%d Unknown TYPE!\n", __LINE__));
return -ENXIO;
}
/* Store our unit into driver_data, so we always have it available. */
tty->driver_data = un;
- DPR_OPEN(("Open called. MAJOR: %d MINOR:%d unit: %p NAME: %s\n",
- MAJOR(tty_devnum(tty)), MINOR(tty_devnum(tty)), un, brd->name));
-
/*
* Error if channel info pointer is NULL.
*/
if (!bs) {
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(brd->bd_lock, lock_flags);
- DPR_OPEN(("%d BS is 0!\n", __LINE__));
return -ENXIO;
}
- DPR_OPEN(("%d: tflag=%x pflag=%x\n", __LINE__, ch->ch_tun.un_flags, ch->ch_pun.un_flags));
-
/*
* Initialize tty's
*/
*/
if (!((ch->ch_tun.un_flags | ch->ch_pun.un_flags) & UN_ISOPEN)) {
- DPR_OPEN(("dgap_open: initializing channel in open...\n"));
-
ch->ch_mforce = 0;
ch->ch_mval = 0;
return -ENODEV;
}
- if (rc) {
- DPR_OPEN(("dgap_tty_open returning after dgap_block_til_ready "
- "with %d\n", rc));
- }
-
/* No going back now, increment our unit and channel counters */
DGAP_LOCK(ch->ch_lock, lock_flags);
ch->ch_open_count++;
un->un_flags |= (UN_ISOPEN);
DGAP_UNLOCK(ch->ch_lock, lock_flags);
- DPR_OPEN(("dgap_tty_open finished\n"));
return (rc);
}
return (-ENXIO);
}
- DPR_OPEN(("dgap_block_til_ready - before block.\n"));
-
DGAP_LOCK(ch->ch_lock, lock_flags);
ch->ch_wopen++;
break;
}
- if (ch->ch_flags & CH_CD) {
- DPR_OPEN(("%d: ch_flags: %x\n", __LINE__, ch->ch_flags));
+ if (ch->ch_flags & CH_CD)
break;
- }
- if (ch->ch_flags & CH_FCAR) {
- DPR_OPEN(("%d: ch_flags: %x\n", __LINE__, ch->ch_flags));
+ if (ch->ch_flags & CH_FCAR)
break;
- }
}
else {
sleep_on_un_flags = 1;
* Leave loop with error set.
*/
if (signal_pending(current)) {
- DPR_OPEN(("%d: signal pending...\n", __LINE__));
retval = -ERESTARTSYS;
break;
}
- DPR_OPEN(("dgap_block_til_ready - blocking.\n"));
-
/*
* Store the flags before we let go of channel lock
*/
DGAP_UNLOCK(ch->ch_lock, lock_flags);
- DPR_OPEN(("Going to sleep on %s flags...\n",
- (sleep_on_un_flags ? "un" : "ch")));
-
/*
* Wait for something in the flags to change from the current value.
*/
(old_flags != ch->ch_flags));
}
- DPR_OPEN(("After sleep... retval: %x\n", retval));
-
/*
* We got woken up for some reason.
* Before looping around, grab our channel lock.
DGAP_UNLOCK(ch->ch_lock, lock_flags);
- DPR_OPEN(("dgap_block_til_ready - after blocking.\n"));
-
- if (retval) {
- DPR_OPEN(("dgap_block_til_ready - done. error. retval: %x\n", retval));
+ if (retval)
return(retval);
- }
-
- DPR_OPEN(("dgap_block_til_ready - done no error. jiffies: %lu\n", jiffies));
return(0);
}
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
return;
- DPR_CLOSE(("dgap_hangup called. ch->ch_open_count: %d un->un_open_count: %d\n",
- ch->ch_open_count, un->un_open_count));
-
/* flush the transmit queues */
dgap_tty_flush_buffer(tty);
- DPR_CLOSE(("dgap_hangup finished. ch->ch_open_count: %d un->un_open_count: %d\n",
- ch->ch_open_count, un->un_open_count));
}
ts = &tty->termios;
- DPR_CLOSE(("Close called\n"));
-
DGAP_LOCK(ch->ch_lock, lock_flags);
/*
* Determine if this is the last close or not - and if we agree about
* which type of close it is with the Line Discipline
*/
- if ((tty->count == 1) && (un->un_open_count != 1)) {
+ if ((tty->count == 1) && (un->un_open_count != 1))
/*
* Uh, oh. tty->count is 1, which means that the tty
* structure will be freed. un_open_count should always
* one, we've got real problems, since it means the
* serial port won't be shutdown.
*/
- APR(("tty->count is 1, un open count is %d\n", un->un_open_count));
un->un_open_count = 1;
- }
- if (--un->un_open_count < 0) {
- APR(("bad serial port open count of %d\n", un->un_open_count));
+ if (--un->un_open_count < 0)
un->un_open_count = 0;
- }
ch->ch_open_count--;
if (ch->ch_open_count && un->un_open_count) {
- DPR_CLOSE(("dgap_tty_close: not last close ch: %d un:%d\n",
- ch->ch_open_count, un->un_open_count));
-
DGAP_UNLOCK(ch->ch_lock, lock_flags);
return;
}
/* OK, its the last close on the unit */
- DPR_CLOSE(("dgap_tty_close - last close on unit procedures\n"));
un->un_flags |= UN_CLOSING;
/* wait for output to drain */
/* This will also return if we take an interrupt */
- DPR_CLOSE(("Calling wait_for_drain\n"));
rc = dgap_wait_for_drain(tty);
- DPR_CLOSE(("After calling wait_for_drain\n"));
-
- if (rc) {
- DPR_BASIC(("dgap_tty_close - bad return: %d ", rc));
- }
dgap_tty_flush_buffer(tty);
tty_ldisc_flush(tty);
* If we have HUPCL set, lower DTR and RTS
*/
if (ch->ch_c_cflag & HUPCL ) {
- DPR_CLOSE(("Close. HUPCL set, dropping DTR/RTS\n"));
ch->ch_mostat &= ~(D_RTS(ch)|D_DTR(ch));
dgap_cmdb( ch, SMODEM, 0, D_DTR(ch)|D_RTS(ch), 0 );
* have been dropped for modems to see it.
*/
if (ch->ch_close_delay) {
- DPR_CLOSE(("Close. Sleeping for RTS/DTR drop\n"));
-
DGAP_UNLOCK(ch->ch_lock, lock_flags);
dgap_ms_sleep(ch->ch_close_delay);
DGAP_LOCK(ch->ch_lock, lock_flags);
-
- DPR_CLOSE(("Close. After sleeping for RTS/DTR drop\n"));
}
}
un->un_flags &= ~(UN_ISOPEN | UN_CLOSING);
tty->driver_data = NULL;
- DPR_CLOSE(("Close. Doing wakeups\n"));
wake_up_interruptible(&ch->ch_flags_wait);
wake_up_interruptible(&un->un_flags_wait);
DGAP_UNLOCK(ch->ch_lock, lock_flags);
-
- DPR_BASIC(("dgap_tty_close - complete\n"));
}
}
}
- DPR_WRITE(("dgap_tty_chars_in_buffer. Port: %x - %d (head: %d tail: %d tsize: %d)\n",
- ch->ch_portnum, chars, thead, ttail, ch->ch_tsize));
return(chars);
}
ret = 0;
- DPR_DRAIN(("dgap_wait_for_drain start\n"));
-
/* Loop until data is drained */
while (count != 0) {
un->un_flags &= ~(UN_EMPTY);
DGAP_UNLOCK(ch->ch_lock, lock_flags);
- DPR_DRAIN(("dgap_wait_for_drain finish\n"));
return (ret);
}
dgap_set_firmware_event(un, UN_LOW | UN_EMPTY);
DGAP_UNLOCK(ch->ch_lock, lock_flags);
- DPR_WRITE(("dgap_tty_write_room - %d tail: %d head: %d\n", ret, tail, head));
-
return(ret);
}
/*
* Simply call tty_write.
*/
- DPR_WRITE(("dgap_tty_put_char called\n"));
dgap_tty_write(tty, &c, 1);
return 1;
}
if (!count)
return(0);
- DPR_WRITE(("dgap_tty_write: Port: %x tty=%p user=%d len=%d\n",
- ch->ch_portnum, tty, from_user, count));
-
/*
* Store original amount of characters passed in.
* This helps to figure out if we should ask the FEP
if ((bufcount = tail - head - 1) < 0)
bufcount += ch->ch_tsize;
- DPR_WRITE(("%d: bufcount: %x count: %x tail: %x head: %x tmask: %x\n",
- __LINE__, bufcount, count, tail, head, tmask));
-
/*
* Limit printer output to maxcps overall, with bursts allowed
* up to bufsize characters.
DGAP_UNLOCK(ch->ch_lock, lock_flags);
}
- DPR_WRITE(("Write finished - Write %d bytes of %d.\n", count, orig_count));
-
return (count);
}
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
return result;
- DPR_IOCTL(("dgap_tty_tiocmget start\n"));
-
DGAP_LOCK(ch->ch_lock, lock_flags);
mstat = readb(&(ch->ch_bs->m_stat));
if (mstat & D_CD(ch))
result |= TIOCM_CD;
- DPR_IOCTL(("dgap_tty_tiocmget finish\n"));
-
return result;
}
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
return ret;
- DPR_IOCTL(("dgap_tty_tiocmset start\n"));
-
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- DPR_IOCTL(("dgap_tty_tiocmset finish\n"));
-
return (0);
}
break;
}
- DPR_IOCTL(("dgap_tty_send_break start 1. %lx\n", jiffies));
-
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
#if 0
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- DPR_IOCTL(("dgap_tty_send_break finish\n"));
-
return (0);
}
*/
static void dgap_tty_wait_until_sent(struct tty_struct *tty, int timeout)
{
- int rc;
- rc = dgap_wait_for_drain(tty);
- if (rc) {
- DPR_IOCTL(("dgap_tty_ioctl - bad return: %d ", rc));
- return;
- }
- return;
+ dgap_wait_for_drain(tty);
}
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
return;
- DPR_IOCTL(("dgap_tty_send_xchar start 1. %lx\n", jiffies));
-
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- DPR_IOCTL(("dgap_tty_send_xchar finish\n"));
-
return;
}
ulong lock_flags;
int rc = 0;
- DPR_IOCTL(("dgap_get_modem_info start\n"));
-
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
return(-ENXIO);
rc = put_user(result, value);
- DPR_IOCTL(("dgap_get_modem_info finish\n"));
return(rc);
}
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
return ret;
- DPR_IOCTL(("dgap_set_modem_info() start\n"));
-
ret = get_user(arg, value);
- if (ret) {
- DPR_IOCTL(("dgap_set_modem_info %d ret: %x. finished.\n", __LINE__, ret));
+ if (ret)
return(ret);
- }
-
- DPR_IOCTL(("dgap_set_modem_info: command: %x arg: %x\n", command, arg));
switch (command) {
case TIOCMBIS:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- DPR_IOCTL(("dgap_set_modem_info finish\n"));
-
return (0);
}
ulong lock_flags = 0;
unsigned long lock_flags2;
- DPR_IOCTL(("DIGI_SETA start\n"));
-
if (!tty || tty->magic != TTY_MAGIC)
return (-EFAULT);
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
return (-EFAULT);
- if (copy_from_user(&new_digi, new_info, sizeof(struct digi_t))) {
- DPR_IOCTL(("DIGI_SETA failed copy_from_user\n"));
- return(-EFAULT);
- }
+ if (copy_from_user(&new_digi, new_info, sizeof(struct digi_t)))
+ return -EFAULT;
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- DPR_IOCTL(("DIGI_SETA finish\n"));
-
return(0);
}
ulong lock_flags;
ulong lock_flags2;
- DPR_IOCTL(("DIGI_SETA start\n"));
-
if (!tty || tty->magic != TTY_MAGIC)
return (-EFAULT);
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
return (-EFAULT);
- if (copy_from_user(&new_digi, new_info, sizeof(int))) {
- DPR_IOCTL(("DIGI_SETEDELAY failed copy_from_user\n"));
- return(-EFAULT);
- }
+ if (copy_from_user(&new_digi, new_info, sizeof(int)))
+ return -EFAULT;
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- DPR_IOCTL(("DIGI_SETA finish\n"));
-
return(0);
}
tmp = dgap_get_custom_baud(ch);
DGAP_UNLOCK(ch->ch_lock, lock_flags);
- DPR_IOCTL(("DIGI_GETCUSTOMBAUD. Returning %d\n", tmp));
-
if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
return (-EFAULT);
ulong lock_flags;
ulong lock_flags2;
- DPR_IOCTL(("DIGI_SETCUSTOMBAUD start\n"));
-
if (!tty || tty->magic != TTY_MAGIC)
return (-EFAULT);
return (-EFAULT);
- if (copy_from_user(&new_rate, new_info, sizeof(unsigned int))) {
- DPR_IOCTL(("DIGI_SETCUSTOMBAUD failed copy_from_user\n"));
+ if (copy_from_user(&new_rate, new_info, sizeof(unsigned int)))
return(-EFAULT);
- }
if (bd->bd_flags & BD_FEP5PLUS) {
- DPR_IOCTL(("DIGI_SETCUSTOMBAUD. Setting %d\n", new_rate));
-
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
}
- DPR_IOCTL(("DIGI_SETCUSTOMBAUD finish\n"));
-
return(0);
}
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
return;
- DPR_IOCTL(("dgap_tty_throttle start\n"));
-
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- DPR_IOCTL(("dgap_tty_throttle finish\n"));
}
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
return;
- DPR_IOCTL(("dgap_tty_unthrottle start\n"));
-
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
-
- DPR_IOCTL(("dgap_tty_unthrottle finish\n"));
}
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
return;
- DPR_IOCTL(("dgap_tty_start start\n"));
-
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- DPR_IOCTL(("dgap_tty_start finish\n"));
}
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
return;
- DPR_IOCTL(("dgap_tty_stop start\n"));
-
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- DPR_IOCTL(("dgap_tty_stop finish\n"));
}
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
return;
- DPR_IOCTL(("dgap_tty_flush_chars start\n"));
-
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
-
- DPR_IOCTL(("dgap_tty_flush_chars finish\n"));
}
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
return;
- DPR_IOCTL(("dgap_tty_flush_buffer on port: %d start\n", ch->ch_portnum));
-
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
if (waitqueue_active(&tty->write_wait))
wake_up_interruptible(&tty->write_wait);
tty_wakeup(tty);
-
- DPR_IOCTL(("dgap_tty_flush_buffer finish\n"));
}
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
return (-ENODEV);
- DPR_IOCTL(("dgap_tty_ioctl start on port %d - cmd %s (%x), arg %lx\n",
- ch->ch_portnum, dgap_ioctl_name(cmd), cmd, arg));
-
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
if (un->un_open_count <= 0) {
- DPR_BASIC(("dgap_tty_ioctl - unit not open.\n"));
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
return(-EIO);
rc = dgap_wait_for_drain(tty);
- if (rc) {
- DPR_IOCTL(("dgap_tty_ioctl - bad return: %d ", rc));
+ if (rc)
return(-EINTR);
- }
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- DPR_IOCTL(("dgap_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n",
- ch->ch_portnum, dgap_ioctl_name(cmd), cmd, arg));
-
return(0);
}
rc = dgap_wait_for_drain(tty);
- if (rc) {
- DPR_IOCTL(("dgap_tty_ioctl - bad return: %d ", rc));
+ if (rc)
return(-EINTR);
- }
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- DPR_IOCTL(("dgap_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n",
- ch->ch_portnum, dgap_ioctl_name(cmd), cmd, arg));
-
return(0);
case TIOCSBRK:
}
rc = dgap_wait_for_drain(tty);
- if (rc) {
- DPR_IOCTL(("dgap_tty_ioctl - bad return: %d ", rc));
+ if (rc)
return(-EINTR);
- }
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- DPR_IOCTL(("dgap_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n",
- ch->ch_portnum, dgap_ioctl_name(cmd), cmd, arg));
-
return 0;
case TIOCCBRK:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- DPR_IOCTL(("dgap_tty_ioctl (LINE:%d) finish on port %d - cmd %s (%x), arg %lx\n",
- __LINE__, ch->ch_portnum, dgap_ioctl_name(cmd), cmd, arg));
-
return(-ENOIOCTLCMD);
case TCSETSF:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
rc = dgap_wait_for_drain(tty);
- if (rc) {
- DPR_IOCTL(("dgap_tty_ioctl - bad return: %d ", rc));
+ if (rc)
return(-EINTR);
- }
-
- DPR_IOCTL(("dgap_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n",
- ch->ch_portnum, dgap_ioctl_name(cmd), cmd, arg));
/* pretend we didn't recognize this */
return(-ENOIOCTLCMD);
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
rc = dgap_wait_for_drain(tty);
- if (rc) {
- DPR_IOCTL(("dgap_tty_ioctl - bad return: %d ", rc));
+ if (rc)
return(-EINTR);
- }
/* pretend we didn't recognize this */
return(-ENOIOCTLCMD);
return(rc);
}
- DPR_IOCTL(("dgap_ioctl - in TCXONC - %d\n", cmd));
switch (arg) {
case TCOON:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
rc = dgap_wait_for_drain(tty);
- if (rc) {
- DPR_IOCTL(("dgap_tty_ioctl - bad return: %d ", rc));
+ if (rc)
return(-EINTR);
- }
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
}
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- DPR_IOCTL(("dgap_tty_ioctl - in default\n"));
- DPR_IOCTL(("dgap_tty_ioctl end - cmd %s (%x), arg %lx\n",
- dgap_ioctl_name(cmd), cmd, arg));
-
return(-ENOIOCTLCMD);
}
}
if (!brd || (brd->magic != DGAP_BOARD_MAGIC) || !brd->re_map_membase)
return;
- DPR_INIT(("dgap_do_bios_load() start\n"));
-
addr = brd->re_map_membase;
/*
while (brd->wait_for_bios < 1000) {
/* Check to see if BIOS thinks board is good. (GD). */
if (word == *(u16 *) "GD") {
- DPR_INIT(("GOT GD in memory, moving states.\n"));
brd->state = FINISHED_BIOS_LOAD;
return;
}
/* Gave up on board after too long of time taken */
err1 = readw(addr + SEQUENCE);
err2 = readw(addr + ERROR);
- APR(("***WARNING*** %s failed diagnostics. Error #(%x,%x).\n",
- brd->name, err1, err2));
+ pr_warn("dgap: %s failed diagnostics. Error #(%x,%x).\n",
+ brd->name, err1, err2);
brd->state = BOARD_FAILED;
brd->dpastatus = BD_NOBIOS;
}
addr = brd->re_map_membase;
- DPR_INIT(("dgap_do_fep_load() for board %s : start\n", brd->name));
-
/*
* Download FEP
*/
writel(0xbfc01004, (addr + 0xc34));
writel(0x3, (addr + 0xc30));
- DPR_INIT(("dgap_do_fep_load() for board %s : finish\n", brd->name));
-
}
/* Gave up on board after too long of time taken */
err1 = readw(addr + SEQUENCE);
err2 = readw(addr + ERROR);
- APR(("***WARNING*** FEPOS for %s not functioning. Error #(%x,%x).\n",
- brd->name, err1, err2));
+ pr_warn("dgap: FEPOS for %s not functioning. Error #(%x,%x).\n",
+ brd->name, err1, err2);
brd->state = BOARD_FAILED;
brd->dpastatus = BD_NOFEP;
-
- DPR_INIT(("dgap_do_wait_for_fep() for board %s : finish\n", brd->name));
}
int i = 0;
if (!brd || (brd->magic != DGAP_BOARD_MAGIC) || !brd->re_map_membase || !brd->re_map_port) {
- DPR_INIT(("dgap_do_reset_board() start. bad values. brd: %p mem: %p io: %p\n",
- brd, brd ? brd->re_map_membase : 0, brd ? brd->re_map_port : 0));
return;
}
- DPR_INIT(("dgap_do_reset_board() start. io: %p\n", brd->re_map_port));
-
/* FEPRST does not vary among supported boards */
writeb(FEPRST, brd->re_map_port);
}
if (i > 1000) {
- APR(("*** WARNING *** Board not resetting... Failing board.\n"));
+ pr_warn("dgap: Board not resetting... Failing board.\n");
brd->state = BOARD_FAILED;
brd->dpastatus = BD_NOFEP;
- goto failed;
+ return;
}
/*
check2 = readl(brd->re_map_membase + HIGHMEM);
if ((check1 != 0xa55a3cc3) || (check2 != 0x5aa5c33c)) {
- APR(("*** Warning *** No memory at %p for board.\n", brd->re_map_membase));
+ pr_warn("dgap: No memory at %p for board.\n",
+ brd->re_map_membase);
brd->state = BOARD_FAILED;
brd->dpastatus = BD_NOFEP;
- goto failed;
+ return;
}
if (brd->state != BOARD_FAILED)
brd->state = FINISHED_RESET;
-
-failed:
- DPR_INIT(("dgap_do_reset_board() finish\n"));
}
char *vaddr;
u16 head, tail;
- if (!bd || (bd->magic != DGAP_BOARD_MAGIC)) {
- APR(("dgap_poll_tasklet() - NULL or bad bd.\n"));
+ if (!bd || (bd->magic != DGAP_BOARD_MAGIC))
return;
- }
if (bd->inhibit_poller)
return;
if (rc < 0) {
dgap_tty_uninit(bd);
- APR(("Can't init tty devices (%d)\n", rc));
bd->state = BOARD_FAILED;
bd->dpastatus = BD_NOFEP;
}
/*
* Check if board is still alive.
*/
- if (ch->ch_bd->state == BOARD_FAILED) {
- DPR_CORE(("%s:%d board is in failed state.\n", __FILE__, __LINE__));
+ if (ch->ch_bd->state == BOARD_FAILED)
return;
- }
/*
* Make sure the pointers are in range before
* Forget it if pointers out of range.
*/
if (head >= (CMDMAX - CMDSTART) || (head & 03)) {
- DPR_CORE(("%s:%d pointers out of range, failing board!\n", __FILE__, __LINE__));
ch->ch_bd->state = BOARD_FAILED;
return;
}
break;
if (--count == 0) {
- DPR_CORE(("%s:%d failing board.\n",__FILE__, __LINE__));
ch->ch_bd->state = BOARD_FAILED;
return;
}
/*
* Check if board is still alive.
*/
- if (ch->ch_bd->state == BOARD_FAILED) {
- DPR_CORE(("%s:%d board is failed!\n", __FILE__, __LINE__));
+ if (ch->ch_bd->state == BOARD_FAILED)
return;
- }
/*
* Make sure the pointers are in range before
* Forget it if pointers out of range.
*/
if (head >= (CMDMAX - CMDSTART) || (head & 03)) {
- DPR_CORE(("%s:%d Pointers out of range. Failing board.\n",__FILE__, __LINE__));
ch->ch_bd->state = BOARD_FAILED;
return;
}
break;
if (--count == 0) {
- DPR_CORE(("%s:%d Failing board.\n",__FILE__, __LINE__));
ch->ch_bd->state = BOARD_FAILED;
return;
}
/*
* Check if board is still alive.
*/
- if (ch->ch_bd->state == BOARD_FAILED) {
- DPR_CORE(("%s:%d board is failed!\n", __FILE__, __LINE__));
+ if (ch->ch_bd->state == BOARD_FAILED)
return;
- }
/*
* Make sure the pointers are in range before
* Forget it if pointers out of range.
*/
if (head >= (CMDMAX - CMDSTART) || (head & 03)) {
- DPR_CORE(("%s:%d Pointers out of range. Failing board.\n",__FILE__, __LINE__));
ch->ch_bd->state = BOARD_FAILED;
return;
}
break;
if (--count == 0) {
- DPR_CORE(("%s:%d Failing board.\n",__FILE__, __LINE__));
ch->ch_bd->state = BOARD_FAILED;
return;
}
* If pointers are out of range, just return.
*/
if ((cnt > ch->ch_tsize) || (unsigned)(head - ch->ch_tstart) >= ch->ch_tsize) {
- DPR_CORE(("%s:%d pointer out of range", __FILE__, __LINE__));
return;
}
if (!bs)
return -ENXIO;
- DPR_PARAM(("param start: tdev: %x cflags: %x oflags: %x iflags: %x\n",
- ch->ch_tun.un_dev, ch->ch_c_cflag, ch->ch_c_oflag, ch->ch_c_iflag));
-
ts = &tty->termios;
/*
* Tell the fep to do the command
*/
- DPR_PARAM(("param: Want %d speed\n", ch->ch_custom_speed));
-
dgap_cmdw_ext(ch, 0xff01, ch->ch_custom_speed, 0);
/*
*/
ch->ch_baud_info = ch->ch_custom_speed = dgap_get_custom_baud(ch);
- DPR_PARAM(("param: Got %d speed\n", ch->ch_custom_speed));
-
/* Handle transition from B0 */
if (ch->ch_flags & CH_BAUD0) {
ch->ch_flags &= ~(CH_BAUD0);
if ((iindex >= 0) && (iindex < 4) && (jindex >= 0) && (jindex < 16)) {
baud = bauds[iindex][jindex];
- } else {
- DPR_IOCTL(("baud indices were out of range (%d)(%d)",
- iindex, jindex));
+ } else
baud = 0;
- }
if (baud == 0)
baud = 9600;
mval ^= ch->ch_mforce & (mval ^ ch->ch_mval);
- DPR_PARAM(("dgap_param: mval: %x ch_mforce: %x ch_mval: %x ch_mostat: %x\n",
- mval, ch->ch_mforce, ch->ch_mval, ch->ch_mostat));
-
if (ch->ch_mostat ^ mval) {
ch->ch_mostat = mval;
/* Okay to have channel and board locks held calling this */
- DPR_PARAM(("dgap_param: Sending SMODEM mval: %x\n", mval));
dgap_cmdb(ch, SMODEM, (uchar) mval, D_RTS(ch)|D_DTR(ch), 0);
}
dgap_cmdb(ch, SAFLOWC, ch->ch_fepastartc, ch->ch_fepastopc, 0);
}
- DPR_PARAM(("param finish\n"));
-
return 0;
}
cout = cbuf;
fout = fbuf;
- DPR_PSCAN(("dgap_parity_scan start\n"));
-
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
return;
if (ch->pscan_savechar == 0x0) {
if (c == 0x0) {
- DPR_PSCAN(("dgap_parity_scan in 3rd char of ff seq. c: %x setting break.\n", c));
ch->ch_err_break++;
*fout++ = TTY_BREAK;
}
else {
- DPR_PSCAN(("dgap_parity_scan in 3rd char of ff seq. c: %x setting parity.\n", c));
ch->ch_err_parity++;
*fout++ = TTY_PARITY;
}
}
- else {
- DPR_PSCAN(("%s:%d Logic Error.\n", __FILE__, __LINE__));
- }
count += 1;
ch->pscan_state = 0;
}
}
*len = count;
- DPR_PSCAN(("dgap_parity_scan finish\n"));
}
if (head >= EVMAX - EVSTART || tail >= EVMAX - EVSTART ||
(head | tail) & 03) {
- DPR_EVENT(("should be calling xxfail %d\n", __LINE__));
/* Let go of board lock */
DGAP_UNLOCK(bd->bd_lock, lock_flags);
return -ENXIO;
modem = event[2];
b1 = event[3];
- DPR_EVENT(("event: jiffies: %ld port: %d reason: %x modem: %x\n",
- jiffies, port, reason, modem));
-
/*
* Make sure the interrupt is valid.
*/
*/
if (reason & IFBREAK) {
- DPR_EVENT(("got IFBREAK\n"));
-
if (ch->ch_tun.un_tty) {
/* A break has been indicated */
ch->ch_err_break++;
*/
if (reason & IFTLW) {
- DPR_EVENT(("event: got low event\n"));
-
if (ch->ch_tun.un_flags & UN_LOW) {
ch->ch_tun.un_flags &= ~UN_LOW;
}
wake_up_interruptible(&ch->ch_tun.un_tty->write_wait);
wake_up_interruptible(&ch->ch_tun.un_flags_wait);
-
- DPR_EVENT(("event: Got low event. jiffies: %lu\n", jiffies));
}
}
* Process Transmit empty.
*/
if (reason & IFTEM) {
- DPR_EVENT(("event: got empty event\n"));
-
if (ch->ch_tun.un_flags & UN_EMPTY) {
ch->ch_tun.un_flags &= ~UN_EMPTY;
if (ch->ch_tun.un_flags & UN_ISOPEN) {
}
static DRIVER_ATTR(state, S_IRUSR, dgap_driver_state_show, NULL);
-
-static ssize_t dgap_driver_debug_show(struct device_driver *ddp, char *buf)
-{
- return snprintf(buf, PAGE_SIZE, "0x%x\n", dgap_debug);
-}
-
-static ssize_t dgap_driver_debug_store(struct device_driver *ddp, const char *buf, size_t count)
-{
- sscanf(buf, "0x%x\n", &dgap_debug);
- return count;
-}
-static DRIVER_ATTR(debug, (S_IRUSR | S_IWUSR), dgap_driver_debug_show, dgap_driver_debug_store);
-
-
static ssize_t dgap_driver_rawreadok_show(struct device_driver *ddp, char *buf)
{
return snprintf(buf, PAGE_SIZE, "0x%x\n", dgap_rawreadok);
rc |= driver_create_file(driverfs, &driver_attr_version);
rc |= driver_create_file(driverfs, &driver_attr_boards);
rc |= driver_create_file(driverfs, &driver_attr_maxboards);
- rc |= driver_create_file(driverfs, &driver_attr_debug);
rc |= driver_create_file(driverfs, &driver_attr_rawreadok);
rc |= driver_create_file(driverfs, &driver_attr_pollrate);
rc |= driver_create_file(driverfs, &driver_attr_pollcounter);
driver_remove_file(driverfs, &driver_attr_version);
driver_remove_file(driverfs, &driver_attr_boards);
driver_remove_file(driverfs, &driver_attr_maxboards);
- driver_remove_file(driverfs, &driver_attr_debug);
driver_remove_file(driverfs, &driver_attr_rawreadok);
driver_remove_file(driverfs, &driver_attr_pollrate);
driver_remove_file(driverfs, &driver_attr_pollcounter);
}
p->u.board.type = APORT2_920P;
p->u.board.v_type = 1;
- DPR_INIT(("Adding Digi_2r_920 PCI to config...\n"));
break;
case APORT4_920P: /* AccelePort_4 */
}
p->u.board.type = APORT4_920P;
p->u.board.v_type = 1;
- DPR_INIT(("Adding Digi_4r_920 PCI to config...\n"));
break;
case APORT8_920P: /* AccelePort_8 */
}
p->u.board.type = APORT8_920P;
p->u.board.v_type = 1;
- DPR_INIT(("Adding Digi_8r_920 PCI to config...\n"));
break;
case PAPORT4: /* AccelePort_4 PCI */
}
p->u.board.type = PAPORT4;
p->u.board.v_type = 1;
- DPR_INIT(("Adding Digi_4r PCI to config...\n"));
break;
case PAPORT8: /* AccelePort_8 PCI */
}
p->u.board.type = PAPORT8;
p->u.board.v_type = 1;
- DPR_INIT(("Adding Digi_8r PCI to config...\n"));
break;
case PCX: /* PCI C/X */
p->u.board.conc2 = 0;
p->u.board.module1 = 0;
p->u.board.module2 = 0;
- DPR_INIT(("Adding PCI C/X to config...\n"));
break;
case PEPC: /* PCI EPC/X */
p->u.board.conc2 = 0;
p->u.board.module1 = 0;
p->u.board.module2 = 0;
- DPR_INIT(("Adding PCI EPC/X to config...\n"));
break;
case PPCM: /* PCI/Xem */
p->u.board.v_type = 1;
p->u.board.conc1 = 0;
p->u.board.conc2 = 0;
- DPR_INIT(("Adding PCI XEM to config...\n"));
break;
case IO: /* i/o port */
return(-1);
}
p->u.board.v_port = 1;
- DPR_INIT(("Adding IO (%s) to config...\n", s));
break;
case MEM: /* memory address */
return(-1);
}
p->u.board.v_addr = 1;
- DPR_INIT(("Adding MEM (%s) to config...\n", s));
break;
case PCIINFO: /* pci information */
return(-1);
}
p->u.board.v_pcislot = 1;
-
- DPR_INIT(("Adding PCIINFO (%s %s) to config...\n", p->u.board.pcibusstr,
- p->u.board.pcislotstr));
break;
case METHOD:
}
p->u.board.method = dgap_savestring(s);
p->u.board.v_method = 1;
- DPR_INIT(("Adding METHOD (%s) to config...\n", s));
break;
case STATUS:
return(-1);
}
p->u.board.status = dgap_savestring(s);
- DPR_INIT(("Adding STATUS (%s) to config...\n", s));
break;
case NPORTS: /* number of ports */
dgap_err("nports only valid for concentrators or modules");
return(-1);
}
- DPR_INIT(("Adding NPORTS (%s) to config...\n", s));
break;
case ID: /* letter ID used in tty name */
dgap_err("id only valid for concentrators or modules");
return(-1);
}
- DPR_INIT(("Adding ID (%s) to config...\n", s));
break;
case STARTO: /* start offset of ID */
dgap_err("start only valid for concentrators or modules");
return(-1);
}
- DPR_INIT(("Adding START (%s) to config...\n", s));
break;
case TTYN: /* tty name prefix */
dgap_err("out of memory");
return(-1);
}
- DPR_INIT(("Adding TTY (%s) to config...\n", s));
break;
case CU: /* cu name prefix */
dgap_err("out of memory");
return(-1);
}
- DPR_INIT(("Adding CU (%s) to config...\n", s));
break;
case LINE: /* line information */
conc = NULL;
line = p;
linecnt++;
- DPR_INIT(("Adding LINE to config...\n"));
break;
case CONC: /* concentrator information */
else
brd->u.board.conc1++;
- DPR_INIT(("Adding CONC to config...\n"));
break;
case CX: /* c/x type concentrator */
}
p->u.conc.type = CX;
p->u.conc.v_type = 1;
- DPR_INIT(("Adding CX to config...\n"));
break;
case EPC: /* epc type concentrator */
}
p->u.conc.type = EPC;
p->u.conc.v_type = 1;
- DPR_INIT(("Adding EPC to config...\n"));
break;
case MOD: /* EBI module */
else
brd->u.board.module1++;
- DPR_INIT(("Adding MOD to config...\n"));
break;
case PORTS: /* ports type EBI module */
}
p->u.module.type = PORTS;
p->u.module.v_type = 1;
- DPR_INIT(("Adding PORTS to config...\n"));
break;
case MODEM: /* ports type EBI module */
}
p->u.module.type = MODEM;
p->u.module.v_type = 1;
- DPR_INIT(("Adding MODEM to config...\n"));
break;
case CABLE:
p->u.line.cable = dgap_savestring(s);
p->u.line.v_cable = 1;
}
- DPR_INIT(("Adding CABLE (%s) to config...\n", s));
break;
case SPEED: /* sync line speed indication */
dgap_err("speed valid only for lines or concentrators.");
return(-1);
}
- DPR_INIT(("Adding SPEED (%s) to config...\n", s));
break;
case CONNECT:
p->u.conc.connect = dgap_savestring(s);
p->u.conc.v_connect = 1;
}
- DPR_INIT(("Adding CONNECT (%s) to config...\n", s));
break;
case PRINT: /* transparent print name prefix */
if (dgap_checknode(p))
dgap_err("out of memory");
return(-1);
}
- DPR_INIT(("Adding PRINT (%s) to config...\n", s));
break;
case CMAJOR: /* major number */
dgap_err("bad number for major number");
return(-1);
}
- DPR_INIT(("Adding CMAJOR (%s) to config...\n", s));
break;
case ALTPIN: /* altpin setting */
dgap_err("bad number for altpin");
return(-1);
}
- DPR_INIT(("Adding ALTPIN (%s) to config...\n", s));
break;
case USEINTR: /* enable interrupt setting */
dgap_err("bad number for useintr");
return(-1);
}
- DPR_INIT(("Adding USEINTR (%s) to config...\n", s));
break;
case TTSIZ: /* size of tty structure */
dgap_err("bad number for ttysize");
return(-1);
}
- DPR_INIT(("Adding TTSIZ (%s) to config...\n", s));
break;
case CHSIZ: /* channel structure size */
dgap_err("bad number for chsize");
return(-1);
}
- DPR_INIT(("Adding CHSIZE (%s) to config...\n", s));
break;
case BSSIZ: /* board structure size */
dgap_err("bad number for bssize");
return(-1);
}
- DPR_INIT(("Adding BSSIZ (%s) to config...\n", s));
break;
case UNTSIZ: /* sched structure size */
dgap_err("bad number for schedsize");
return(-1);
}
- DPR_INIT(("Adding UNTSIZ (%s) to config...\n", s));
break;
case F2SIZ: /* f2200 structure size */
dgap_err("bad number for f2200size");
return(-1);
}
- DPR_INIT(("Adding F2SIZ (%s) to config...\n", s));
break;
case VPSIZ: /* vpix structure size */
dgap_err("bad number for vpixsize");
return(-1);
}
- DPR_INIT(("Adding VPSIZ (%s) to config...\n", s));
break;
}
}
if (p->u.board.type == type) {
if (p->u.board.v_pcibus && p->u.board.pcibus != bus) {
- DPR(("Found matching board, but wrong bus position. System says bus %d, we want bus %ld\n",
- bus, p->u.board.pcibus));
continue;
}
if (p->u.board.v_pcislot && p->u.board.pcislot != slot) {
- DPR_INIT(("Found matching board, but wrong slot position. System says slot %d, we want slot %ld\n",
- slot, p->u.board.pcislot));
continue;
}
- DPR_INIT(("Matched type in config file\n"));
-
found = p;
/*
* Keep walking thru the list till we find the next board.