rc = dgap_start();
if (rc < 0) {
- return(rc);
+ return rc;
}
/*
dgap_driver_state = DRIVER_READY;
}
- return (rc);
+ return rc;
}
*/
rc = register_chrdev(DIGI_DGAP_MAJOR, "dgap", &DgapBoardFops);
if (rc < 0)
- return (rc);
+ return rc;
dgap_class = class_create(THIS_MODULE, "dgap_mgmt");
device_create(dgap_class, NULL,
rc = dgap_tty_preinit();
if (rc < 0)
- return(rc);
+ return rc;
/* Start the poller */
DGAP_LOCK(dgap_poll_lock, flags);
dgap_driver_state = DRIVER_NEED_CONFIG_LOAD;
}
- return (rc);
+ return rc;
}
int i = 0;
if(!brd || brd->magic != DGAP_BOARD_MAGIC)
- return;
+ return;
if (brd->intr_used && brd->irq)
free_irq(brd->irq, brd);
brd = dgap_Board[dgap_NumBoards] =
(struct board_t *) kzalloc(sizeof(struct board_t), GFP_KERNEL);
if (!brd)
- return(-ENOMEM);
+ 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);
- return(-ENOMEM);
+ return -ENOMEM;
}
/* store the info for the board we've found */
else
brd->state = NEED_RESET;
- return(0);
+ return 0;
}
int rc;
if (!brd || brd->magic != DGAP_BOARD_MAGIC)
- return(-ENODEV);
+ return -ENODEV;
brd->use_interrupts = dgap_config_get_useintr(brd);
brd->intr_used = 0;
}
- return(0);
+ return 0;
}
static int dgap_firmware_load(struct pci_dev *pdev, int card_type)
{
current->state = TASK_INTERRUPTIBLE;
schedule_timeout((ms * HZ) / 1000);
- return (signal_pending(current));
+ return signal_pending(current);
}
if (!dgap_TmpWriteBuf) {
DGAP_UNLOCK(dgap_global_lock, flags);
- return (-ENOMEM);
+ return -ENOMEM;
}
DGAP_UNLOCK(dgap_global_lock, flags);
- return(0);
+ return 0;
}
/* The kernel wants space to store pointers to tty_structs */
brd->SerialDriver->ttys = kzalloc(MAXPORTS * sizeof(struct tty_struct *), GFP_KERNEL);
if (!brd->SerialDriver->ttys)
- return(-ENOMEM);
+ return -ENOMEM;
/*
* Entry points for driver. Called by the kernel from
/* The kernel wants space to store pointers to tty_structs */
brd->PrintDriver->ttys = kzalloc(MAXPORTS * sizeof(struct tty_struct *), GFP_KERNEL);
if (!brd->PrintDriver->ttys)
- return(-ENOMEM);
+ return -ENOMEM;
/*
* Entry points for driver. Called by the kernel from
/* Register tty devices */
rc = tty_register_driver(brd->SerialDriver);
if (rc < 0)
- return(rc);
+ return rc;
brd->dgap_Major_Serial_Registered = TRUE;
dgap_BoardsByMajor[brd->SerialDriver->major] = brd;
brd->dgap_Serial_Major = brd->SerialDriver->major;
/* Register Transparent Print devices */
rc = tty_register_driver(brd->PrintDriver);
if (rc < 0)
- return(rc);
+ return rc;
brd->dgap_Major_TransparentPrint_Registered = TRUE;
dgap_BoardsByMajor[brd->PrintDriver->major] = brd;
brd->dgap_TransparentPrint_Major = brd->PrintDriver->major;
}
- return (rc);
+ return rc;
}
struct cm_t *cm;
if (!brd)
- return (-ENXIO);
+ return -ENXIO;
/*
* Initialize board structure elements.
if (!brd->nasync) {
brd->state = BOARD_FAILED;
brd->dpastatus = BD_NOFEP;
- return(-ENXIO);
+ return -ENXIO;
}
}
writeb(1, &(ch->ch_bs->idata));
}
- return (0);
+ return 0;
}
un->un_flags |= (UN_ISOPEN);
DGAP_UNLOCK(ch->ch_lock, lock_flags);
- return (rc);
+ return rc;
}
int sleep_on_un_flags = 0;
if (!tty || tty->magic != TTY_MAGIC || !file || !ch || ch->magic != DGAP_CHANNEL_MAGIC) {
- return (-ENXIO);
+ return -ENXIO;
}
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC) {
- return (-ENXIO);
+ return -ENXIO;
}
DGAP_LOCK(ch->ch_lock, lock_flags);
DGAP_UNLOCK(ch->ch_lock, lock_flags);
if (retval)
- return(retval);
+ return retval;
- return(0);
+ return 0;
}
ulong lock_flags2 = 0;
if (tty == NULL)
- return(0);
+ return 0;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
bs = ch->ch_bs;
if (!bs)
- return (0);
+ return 0;
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
}
}
- return(chars);
+ return chars;
}
un->un_flags &= ~(UN_EMPTY);
DGAP_UNLOCK(ch->ch_lock, lock_flags);
- return (ret);
+ return ret;
}
struct un_t *un = NULL;
if (tty == NULL)
- return (bytes_available);
+ return bytes_available;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (bytes_available);
+ return bytes_available;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (bytes_available);
+ return bytes_available;
/*
* If its not the Transparent print device, return
* the full data amount.
*/
if (un->un_type != DGAP_PRINT)
- return (bytes_available);
+ return bytes_available;
if (ch->ch_digi.digi_maxcps > 0 && ch->ch_digi.digi_bufsize > 0 ) {
int cps_limit = 0;
bytes_available = min(cps_limit, bytes_available);
}
- return (bytes_available);
+ return bytes_available;
}
ulong lock_flags = 0;
if (tty == NULL || dgap_TmpWriteBuf == NULL)
- return(0);
+ return 0;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bs = ch->ch_bs;
if (!bs)
- return (0);
+ return 0;
DGAP_LOCK(ch->ch_lock, lock_flags);
dgap_set_firmware_event(un, UN_LOW | UN_EMPTY);
DGAP_UNLOCK(ch->ch_lock, lock_flags);
- return(ret);
+ return ret;
}
int from_user = 0;
if (tty == NULL || dgap_TmpWriteBuf == NULL)
- return(0);
+ return 0;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return(0);
+ return 0;
bs = ch->ch_bs;
if (!bs)
- return(0);
+ return 0;
if (!count)
- return(0);
+ return 0;
/*
* Store original amount of characters passed in.
if (count <= 0) {
dgap_set_firmware_event(un, UN_LOW | UN_EMPTY);
DGAP_UNLOCK(ch->ch_lock, lock_flags);
- return(0);
+ return 0;
}
/*
if (count <= 0) {
dgap_set_firmware_event(un, UN_LOW | UN_EMPTY);
DGAP_UNLOCK(ch->ch_lock, lock_flags);
- return(0);
+ return 0;
}
if (from_user) {
*/
/* we're allowed to block if it's from_user */
if (down_interruptible(&dgap_TmpWriteSem)) {
- return (-EINTR);
+ return -EINTR;
}
if (copy_from_user(dgap_TmpWriteBuf, (const uchar __user *) buf, count)) {
DGAP_UNLOCK(ch->ch_lock, lock_flags);
}
- return (count);
+ return count;
}
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return (0);
+ return 0;
}
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return (0);
+ return 0;
}
int rc = 0;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return(-ENXIO);
+ return -ENXIO;
DGAP_LOCK(ch->ch_lock, lock_flags);
rc = put_user(result, value);
- return(rc);
+ return rc;
}
ret = get_user(arg, value);
if (ret)
- return(ret);
+ return ret;
switch (command) {
case TIOCMBIS:
break;
default:
- return(-EINVAL);
+ return -EINVAL;
}
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return (0);
+ return 0;
}
ulong lock_flags;
if (!retinfo)
- return (-EFAULT);
+ return -EFAULT;
if (!tty || tty->magic != TTY_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
memset(&tmp, 0, sizeof(tmp));
DGAP_UNLOCK(ch->ch_lock, lock_flags);
if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
- return (-EFAULT);
+ return -EFAULT;
- return (0);
+ return 0;
}
unsigned long lock_flags2;
if (!tty || tty->magic != TTY_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
if (copy_from_user(&new_digi, new_info, sizeof(struct digi_t)))
return -EFAULT;
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(0);
+ return 0;
}
ulong lock_flags;
if (!retinfo)
- return (-EFAULT);
+ return -EFAULT;
if (!tty || tty->magic != TTY_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
memset(&tmp, 0, sizeof(tmp));
DGAP_UNLOCK(ch->ch_lock, lock_flags);
if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
- return (-EFAULT);
+ return -EFAULT;
- return (0);
+ return 0;
}
ulong lock_flags2;
if (!tty || tty->magic != TTY_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
if (copy_from_user(&new_digi, new_info, sizeof(int)))
return -EFAULT;
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(0);
+ return 0;
}
ulong lock_flags;
if (!retinfo)
- return (-EFAULT);
+ return -EFAULT;
if (!tty || tty->magic != TTY_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
memset(&tmp, 0, sizeof(tmp));
DGAP_UNLOCK(ch->ch_lock, lock_flags);
if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
- return (-EFAULT);
+ return -EFAULT;
- return (0);
+ return 0;
}
ulong lock_flags2;
if (!tty || tty->magic != TTY_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
if (copy_from_user(&new_rate, new_info, sizeof(unsigned int)))
- return(-EFAULT);
+ return -EFAULT;
if (bd->bd_flags & BD_FEP5PLUS) {
DGAP_UNLOCK(bd->bd_lock, lock_flags);
}
- return(0);
+ return 0;
}
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return;
+ return;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return;
+ return;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return;
+ return;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return;
+ return;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return;
+ return;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return;
+ return;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
void __user *uarg = (void __user *) arg;
if (!tty || tty->magic != TTY_MAGIC)
- return (-ENODEV);
+ return -ENODEV;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (-ENODEV);
+ return -ENODEV;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (-ENODEV);
+ return -ENODEV;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (-ENODEV);
+ return -ENODEV;
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
if (un->un_open_count <= 0) {
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(-EIO);
+ return -EIO;
}
switch (cmd) {
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
if (rc) {
- return(rc);
+ return rc;
}
rc = dgap_wait_for_drain(tty);
if (rc)
- return(-EINTR);
+ 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);
- return(0);
+ return 0;
case TCSBRKP:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
if (rc) {
- return(rc);
+ return rc;
}
rc = dgap_wait_for_drain(tty);
if (rc)
- return(-EINTR);
+ 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);
- return(0);
+ return 0;
case TIOCSBRK:
/*
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
if (rc) {
- return(rc);
+ return rc;
}
rc = dgap_wait_for_drain(tty);
if (rc)
- return(-EINTR);
+ return -EINTR;
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
rc = put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long __user *) arg);
- return(rc);
+ return rc;
case TIOCSSOFTCAR:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
rc = get_user(arg, (unsigned long __user *) arg);
if (rc)
- return(rc);
+ return rc;
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);
- return(0);
+ return 0;
case TIOCMGET:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(dgap_get_modem_info(ch, uarg));
+ return dgap_get_modem_info(ch, uarg);
case TIOCMBIS:
case TIOCMBIC:
case TIOCMSET:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(dgap_set_modem_info(tty, cmd, uarg));
+ return dgap_set_modem_info(tty, cmd, uarg);
/*
* Here are any additional ioctl's that we want to implement
if (rc) {
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(rc);
+ return rc;
}
if ((arg == TCIFLUSH) || (arg == TCIOFLUSH)) {
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(-ENOIOCTLCMD);
+ return -ENOIOCTLCMD;
case TCSETSF:
case TCSETSW:
DGAP_UNLOCK(bd->bd_lock, lock_flags);
rc = dgap_wait_for_drain(tty);
if (rc)
- return(-EINTR);
+ return -EINTR;
/* pretend we didn't recognize this */
- return(-ENOIOCTLCMD);
+ return -ENOIOCTLCMD;
case TCSETAW:
DGAP_UNLOCK(bd->bd_lock, lock_flags);
rc = dgap_wait_for_drain(tty);
if (rc)
- return(-EINTR);
+ return -EINTR;
/* pretend we didn't recognize this */
- return(-ENOIOCTLCMD);
+ return -ENOIOCTLCMD;
case TCXONC:
/*
if (rc) {
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(rc);
+ return rc;
}
switch (arg) {
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
dgap_tty_start(tty);
- return(0);
+ return 0;
case TCOOFF:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
dgap_tty_stop(tty);
- return(0);
+ return 0;
case TCION:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
/* Make the ld do it */
- return(-ENOIOCTLCMD);
+ return -ENOIOCTLCMD;
case TCIOFF:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
/* Make the ld do it */
- return(-ENOIOCTLCMD);
+ return -ENOIOCTLCMD;
default:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(-EINVAL);
+ return -EINVAL;
}
case DIGI_GETA:
/* get information for ditty */
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(dgap_tty_digigeta(tty, uarg));
+ return dgap_tty_digigeta(tty, uarg);
case DIGI_SETAW:
case DIGI_SETAF:
DGAP_UNLOCK(bd->bd_lock, lock_flags);
rc = dgap_wait_for_drain(tty);
if (rc)
- return(-EINTR);
+ return -EINTR;
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
}
case DIGI_SETA:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(dgap_tty_digiseta(tty, uarg));
+ return dgap_tty_digiseta(tty, uarg);
case DIGI_GEDELAY:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(dgap_tty_digigetedelay(tty, uarg));
+ return dgap_tty_digigetedelay(tty, uarg);
case DIGI_SEDELAY:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(dgap_tty_digisetedelay(tty, uarg));
+ return dgap_tty_digisetedelay(tty, uarg);
case DIGI_GETCUSTOMBAUD:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(dgap_tty_digigetcustombaud(tty, uarg));
+ return dgap_tty_digigetcustombaud(tty, uarg);
case DIGI_SETCUSTOMBAUD:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(dgap_tty_digisetcustombaud(tty, uarg));
+ return dgap_tty_digisetcustombaud(tty, uarg);
case DIGI_RESET_PORT:
dgap_firmware_reset_port(ch);
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(-ENOIOCTLCMD);
+ return -ENOIOCTLCMD;
}
}
#define DGAP_VERIFY_BOARD(p, bd) \
if (!p) \
- return (0); \
+ return 0; \
\
bd = dev_get_drvdata(p); \
if (!bd || bd->magic != DGAP_BOARD_MAGIC) \
- return (0); \
+ return 0; \
if (bd->state != BOARD_READY) \
- return (0); \
+ return 0; \
static ssize_t dgap_ports_state_show(struct device *p, struct device_attribute *attr, char *buf)
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
return snprintf(buf, PAGE_SIZE, "%s", un->un_open_count ? "Open" : "Closed");
}
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
return snprintf(buf, PAGE_SIZE, "%d\n", ch->ch_baud_info);
}
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
if (ch->ch_open_count) {
return snprintf(buf, PAGE_SIZE, "%s %s %s %s %s %s\n",
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_iflag);
}
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_cflag);
}
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_oflag);
}
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_lflag);
}
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_digi.digi_flags);
}
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
return snprintf(buf, PAGE_SIZE, "%ld\n", ch->ch_rxcount);
}
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
return snprintf(buf, PAGE_SIZE, "%ld\n", ch->ch_txcount);
}
int i = 0;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
bn = bd->boardnum;
cn = ch->ch_portnum;
while ( (rc = dgap_gettok(in,p)) != BEGIN ) {
if (rc == 0) {
dgap_err("unexpected EOF");
- return(-1);
+ return -1;
}
}
rc = dgap_gettok(in,p);
if (rc == 0) {
dgap_err("unexpected EOF");
- return(-1);
+ return -1;
}
switch (rc) {
case 0:
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
case BEGIN: /* should only be 1 begin */
dgap_err("unexpected config_begin\n");
- return(-1);
+ return -1;
case END:
- return(0);
+ return 0;
case BOARD: /* board info */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(BNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
case APORT2_920P: /* AccelePort_4 */
if (p->type != BNODE) {
dgap_err("unexpected Digi_2r_920 string");
- return(-1);
+ return -1;
}
p->u.board.type = APORT2_920P;
p->u.board.v_type = 1;
case APORT4_920P: /* AccelePort_4 */
if (p->type != BNODE) {
dgap_err("unexpected Digi_4r_920 string");
- return(-1);
+ return -1;
}
p->u.board.type = APORT4_920P;
p->u.board.v_type = 1;
case APORT8_920P: /* AccelePort_8 */
if (p->type != BNODE) {
dgap_err("unexpected Digi_8r_920 string");
- return(-1);
+ return -1;
}
p->u.board.type = APORT8_920P;
p->u.board.v_type = 1;
case PAPORT4: /* AccelePort_4 PCI */
if (p->type != BNODE) {
dgap_err("unexpected Digi_4r(PCI) string");
- return(-1);
+ return -1;
}
p->u.board.type = PAPORT4;
p->u.board.v_type = 1;
case PAPORT8: /* AccelePort_8 PCI */
if (p->type != BNODE) {
dgap_err("unexpected Digi_8r string");
- return(-1);
+ return -1;
}
p->u.board.type = PAPORT8;
p->u.board.v_type = 1;
case PCX: /* PCI C/X */
if (p->type != BNODE) {
dgap_err("unexpected Digi_C/X_(PCI) string");
- return(-1);
+ return -1;
}
p->u.board.type = PCX;
p->u.board.v_type = 1;
case PEPC: /* PCI EPC/X */
if (p->type != BNODE) {
dgap_err("unexpected \"Digi_EPC/X_(PCI)\" string");
- return(-1);
+ return -1;
}
p->u.board.type = PEPC;
p->u.board.v_type = 1;
case PPCM: /* PCI/Xem */
if (p->type != BNODE) {
dgap_err("unexpected PCI/Xem string");
- return(-1);
+ return -1;
}
p->u.board.type = PPCM;
p->u.board.v_type = 1;
case IO: /* i/o port */
if (p->type != BNODE) {
dgap_err("IO port only vaild for boards");
- return(-1);
+ return -1;
}
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.board.portstr = dgap_savestring(s);
p->u.board.port = (short)simple_strtol(s, &s2, 0);
if ((short)strlen(s) > (short)(s2 - s)) {
dgap_err("bad number for IO port");
- return(-1);
+ return -1;
}
p->u.board.v_port = 1;
break;
case MEM: /* memory address */
if (p->type != BNODE) {
dgap_err("memory address only vaild for boards");
- return(-1);
+ return -1;
}
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.board.addrstr = dgap_savestring(s);
p->u.board.addr = simple_strtoul(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for memory address");
- return(-1);
+ return -1;
}
p->u.board.v_addr = 1;
break;
case PCIINFO: /* pci information */
if (p->type != BNODE) {
dgap_err("memory address only vaild for boards");
- return(-1);
+ return -1;
}
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.board.pcibusstr = dgap_savestring(s);
p->u.board.pcibus = simple_strtoul(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for pci bus");
- return(-1);
+ return -1;
}
p->u.board.v_pcibus = 1;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.board.pcislotstr = dgap_savestring(s);
p->u.board.pcislot = simple_strtoul(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for pci slot");
- return(-1);
+ return -1;
}
p->u.board.v_pcislot = 1;
break;
case METHOD:
if (p->type != BNODE) {
dgap_err("install method only vaild for boards");
- return(-1);
+ return -1;
}
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.board.method = dgap_savestring(s);
p->u.board.v_method = 1;
case STATUS:
if (p->type != BNODE) {
dgap_err("config status only vaild for boards");
- return(-1);
+ return -1;
}
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.board.status = dgap_savestring(s);
break;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.board.nport = (char)simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for number of ports");
- return(-1);
+ return -1;
}
p->u.board.v_nport = 1;
} else if (p->type == CNODE) {
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.conc.nport = (char)simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for number of ports");
- return(-1);
+ return -1;
}
p->u.conc.v_nport = 1;
} else if (p->type == MNODE) {
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.module.nport = (char)simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for number of ports");
- return(-1);
+ return -1;
}
p->u.module.v_nport = 1;
} else {
dgap_err("nports only valid for concentrators or modules");
- return(-1);
+ return -1;
}
break;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.board.status = dgap_savestring(s);
p->u.module.v_id = 1;
} else {
dgap_err("id only valid for concentrators or modules");
- return(-1);
+ return -1;
}
break;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.board.start = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for start of tty count");
- return(-1);
+ return -1;
}
p->u.board.v_start = 1;
} else if (p->type == CNODE) {
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.conc.start = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for start of tty count");
- return(-1);
+ return -1;
}
p->u.conc.v_start = 1;
} else if (p->type == MNODE) {
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.module.start = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for start of tty count");
- return(-1);
+ return -1;
}
p->u.module.v_start = 1;
} else {
dgap_err("start only valid for concentrators or modules");
- return(-1);
+ return -1;
}
break;
case TTYN: /* tty name prefix */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(TNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
if ( (s = dgap_getword(in)) == NULL ) {
dgap_err("unexpeced end of file");
- return(-1);
+ return -1;
}
if ( (p->u.ttyname = dgap_savestring(s)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
break;
case CU: /* cu name prefix */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(CUNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
if ( (s = dgap_getword(in)) == NULL ) {
dgap_err("unexpeced end of file");
- return(-1);
+ return -1;
}
if ( (p->u.cuname = dgap_savestring(s)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
break;
case LINE: /* line information */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if (brd == NULL) {
dgap_err("must specify board before line info");
- return(-1);
+ return -1;
}
switch (brd->u.board.type) {
case PPCM:
dgap_err("line not vaild for PC/em");
- return(-1);
+ return -1;
}
if ( (p->next = dgap_newnode(LNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
conc = NULL;
case CONC: /* concentrator information */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if (line == NULL) {
dgap_err("must specify line info before concentrator");
- return(-1);
+ return -1;
}
if ( (p->next = dgap_newnode(CNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
conc = p;
case CX: /* c/x type concentrator */
if (p->type != CNODE) {
dgap_err("cx only valid for concentrators");
- return(-1);
+ return -1;
}
p->u.conc.type = CX;
p->u.conc.v_type = 1;
case EPC: /* epc type concentrator */
if (p->type != CNODE) {
dgap_err("cx only valid for concentrators");
- return(-1);
+ return -1;
}
p->u.conc.type = EPC;
p->u.conc.v_type = 1;
case MOD: /* EBI module */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if (brd == NULL) {
dgap_err("must specify board info before EBI modules");
- return(-1);
+ return -1;
}
switch (brd->u.board.type) {
case PPCM:
default:
if (conc == NULL) {
dgap_err("must specify concentrator info before EBI module");
- return(-1);
+ return -1;
}
}
if ( (p->next = dgap_newnode(MNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
if (linecnt)
case PORTS: /* ports type EBI module */
if (p->type != MNODE) {
dgap_err("ports only valid for EBI modules");
- return(-1);
+ return -1;
}
p->u.module.type = PORTS;
p->u.module.v_type = 1;
case MODEM: /* ports type EBI module */
if (p->type != MNODE) {
dgap_err("modem only valid for modem modules");
- return(-1);
+ return -1;
}
p->u.module.type = MODEM;
p->u.module.v_type = 1;
if (p->type == LNODE) {
if ((s = dgap_getword(in)) == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.line.cable = dgap_savestring(s);
p->u.line.v_cable = 1;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.line.speed = (char)simple_strtol(s, &s2, 0);
if ((short)strlen(s) > (short)(s2 - s)) {
dgap_err("bad number for line speed");
- return(-1);
+ return -1;
}
p->u.line.v_speed = 1;
} else if (p->type == CNODE) {
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.conc.speed = (char)simple_strtol(s, &s2, 0);
if ((short)strlen(s) > (short)(s2 - s)) {
dgap_err("bad number for line speed");
- return(-1);
+ return -1;
}
p->u.conc.v_speed = 1;
} else {
dgap_err("speed valid only for lines or concentrators.");
- return(-1);
+ return -1;
}
break;
if (p->type == CNODE) {
if ((s = dgap_getword(in)) == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.conc.connect = dgap_savestring(s);
p->u.conc.v_connect = 1;
break;
case PRINT: /* transparent print name prefix */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(PNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
if ( (s = dgap_getword(in)) == NULL ) {
dgap_err("unexpeced end of file");
- return(-1);
+ return -1;
}
if ( (p->u.printname = dgap_savestring(s)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
break;
case CMAJOR: /* major number */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(JNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.majornumber = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for major number");
- return(-1);
+ return -1;
}
break;
case ALTPIN: /* altpin setting */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(ANODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.altpin = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for altpin");
- return(-1);
+ return -1;
}
break;
case USEINTR: /* enable interrupt setting */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(INTRNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.useintr = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for useintr");
- return(-1);
+ return -1;
}
break;
case TTSIZ: /* size of tty structure */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(TSNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.ttysize = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for ttysize");
- return(-1);
+ return -1;
}
break;
case CHSIZ: /* channel structure size */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(CSNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.chsize = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for chsize");
- return(-1);
+ return -1;
}
break;
case BSSIZ: /* board structure size */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(BSNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.bssize = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for bssize");
- return(-1);
+ return -1;
}
break;
case UNTSIZ: /* sched structure size */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(USNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.unsize = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for schedsize");
- return(-1);
+ return -1;
}
break;
case F2SIZ: /* f2200 structure size */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(FSNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.f2size = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for f2200size");
- return(-1);
+ return -1;
}
break;
case VPSIZ: /* vpix structure size */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(VSNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.vpixsize = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for vpixsize");
- return(-1);
+ return -1;
}
break;
}
snprintf(dgap_cword, MAXCWORD, "%s", w);
for (t = dgap_tlist; t->token != 0; t++) {
if ( !strcmp(w, t->string)) {
- return(t->token);
+ return t->token;
}
}
dgap_err("board !!type not specified");
- return(1);
+ return 1;
}
else {
while ( (w = dgap_getword(in)) != NULL ) {
snprintf(dgap_cword, MAXCWORD, "%s", w);
for (t = dgap_tlist; t->token != 0; t++) {
if ( !strcmp(w, t->string) )
- return(t->token);
+ return t->token;
}
}
- return(0);
+ return 0;
}
}
memset((char *)n, 0, sizeof(struct cnode));
n->type = t;
}
- return(n);
+ return n;
}
case BNODE:
if (p->u.board.v_type == 0) {
dgap_err("board type !not specified");
- return(1);
+ return 1;
}
- return(0);
+ return 0;
case LNODE:
if (p->u.line.v_speed == 0) {
dgap_err("line speed not specified");
- return(1);
+ return 1;
}
- return(0);
+ return 0;
case CNODE:
if (p->u.conc.v_type == 0) {
dgap_err("concentrator type not specified");
- return(1);
+ return 1;
}
if (p->u.conc.v_speed == 0) {
dgap_err("concentrator line speed not specified");
- return(1);
+ return 1;
}
if (p->u.conc.v_nport == 0) {
dgap_err("number of ports on concentrator not specified");
- return(1);
+ return 1;
}
if (p->u.conc.v_id == 0) {
dgap_err("concentrator id letter not specified");
- return(1);
+ return 1;
}
- return(0);
+ return 0;
case MNODE:
if (p->u.module.v_type == 0) {
dgap_err("EBI module type not specified");
- return(1);
+ return 1;
}
if (p->u.module.v_nport == 0) {
dgap_err("number of ports on EBI module not specified");
- return(1);
+ return 1;
}
if (p->u.module.v_id == 0) {
dgap_err("EBI module id letter not specified");
- return(1);
+ return 1;
}
- return(0);
+ return 0;
}
- return(0);
+ return 0;
}
/*
if ( (p = kmalloc(strlen(s) + 1, GFP_ATOMIC) ) != NULL) {
strcpy(p, s);
}
- return(p);
+ return p;
}
struct cnode *p = NULL;
if (!bd)
- return(0);
+ return 0;
for (p = bd->bd_config; p; p = p->next) {
switch (p->type) {
struct cnode *p = NULL;
if (!bd)
- return(0);
+ return 0;
for (p = bd->bd_config; p; p = p->next) {
switch (p->type) {
struct cnode *p = NULL;
if (!bd)
- return(0);
+ return 0;
for (p = bd->bd_config; p; p = p->next) {
break;
}
}
- return (count);
+ return count;
}
static char *dgap_create_config_string(struct board_t *bd, char *string)