return 0;
}
+/* should become broadcast later */
static int
slot_in_dhup(struct fsm_inst *fi, int pr, void *arg)
{
+ struct isdn_slot *slot = fi->userdata;
+ isdn_ctrl *ctrl = arg;
+
fsm_change_state(fi, ST_SLOT_NULL);
+ do_stat_cb(slot, ctrl);
return 0;
}
return ret;
for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
- if (copy_to_user(p, dev->mdm.info[i].emu.profile,
+ if (copy_to_user(p, isdn_mdm.info[i].emu.profile,
ISDN_MODEM_NUMREG))
return -EFAULT;
p += ISDN_MODEM_NUMREG;
- if (copy_to_user(p, dev->mdm.info[i].emu.pmsn, ISDN_MSNLEN))
+ if (copy_to_user(p, isdn_mdm.info[i].emu.pmsn, ISDN_MSNLEN))
return -EFAULT;
p += ISDN_MSNLEN;
- if (copy_to_user(p, dev->mdm.info[i].emu.plmsn, ISDN_LMSNLEN))
+ if (copy_to_user(p, isdn_mdm.info[i].emu.plmsn, ISDN_LMSNLEN))
return -EFAULT;
p += ISDN_LMSNLEN;
}
return ret;
for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
- if (copy_from_user(dev->mdm.info[i].emu.profile, p,
+ if (copy_from_user(isdn_mdm.info[i].emu.profile, p,
ISDN_MODEM_NUMREG))
return -EFAULT;
p += ISDN_MODEM_NUMREG;
- if (copy_from_user(dev->mdm.info[i].emu.plmsn, p, ISDN_LMSNLEN))
+ if (copy_from_user(isdn_mdm.info[i].emu.plmsn, p, ISDN_LMSNLEN))
return -EFAULT;
p += ISDN_LMSNLEN;
- if (copy_from_user(dev->mdm.info[i].emu.pmsn, p, ISDN_MSNLEN))
+ if (copy_from_user(isdn_mdm.info[i].emu.pmsn, p, ISDN_MSNLEN))
return -EFAULT;
p += ISDN_MSNLEN;
}
return fsm_event(&slots[sl].fi, EV_SLOT_CMD_HANGUP, ctrl);
}
HERE;
-// return isdn_command(ctrl);
return -1;
}
slots[i].ch = -1;
slots[i].m_idx = -1;
strcpy(isdn_slot_num(i), "???");
- init_waitqueue_head(&dev->mdm.info[i].open_wait);
- init_waitqueue_head(&dev->mdm.info[i].close_wait);
+ init_waitqueue_head(&isdn_mdm.info[i].open_wait);
+ init_waitqueue_head(&isdn_mdm.info[i].close_wait);
slots[i].fi.fsm = &slot_fsm;
slots[i].fi.state = ST_SLOT_NULL;
slots[i].fi.debug = 1;
mlp->hupflags = ISDN_INHUP;
mlp->onhtime = 10;
mlp->dialmax = 1;
- mlp->flags = ISDN_NET_CBHUP | ISDN_NET_DM_MANUAL;
+ mlp->flags = ISDN_NET_CBHUP | ISDN_NET_DM_MANUAL | ISDN_NET_SECURE;
mlp->cbdelay = 5 * HZ; /* Wait 5 secs before call-back */
mlp->dialtimeout = 60 * HZ;/* Wait 1 min for connection */
mlp->dialwait = 5 * HZ; /* Wait 5 sec. after failed dial */
static char *isdn_ttyname_cui = "cui";
#endif
+struct isdn_modem isdn_mdm;
+
static int bit2si[8] =
{1, 5, 7, 7, 7, 7, 7, 7};
static int si2bit[8] =
for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
if ((midx = isdn_slot_m_idx(i)) >= 0) {
- info = &dev->mdm.info[midx];
+ info = &isdn_mdm.info[midx];
if (info->online) {
r = 0;
#ifdef CONFIG_ISDN_AUDIO
line = minor(tty->device) - tty->driver.minor_start;
if (line < 0 || line > ISDN_MAX_CHANNELS)
return -ENODEV;
- info = &dev->mdm.info[line];
+ info = &isdn_mdm.info[line];
if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_open"))
return -ENODEV;
#ifdef ISDN_DEBUG_MODEM_OPEN
int
isdn_tty_init(void)
{
- modem *m;
+ struct isdn_modem *m;
int i, retval;
modem_info *info;
- m = &dev->mdm;
+ m = &isdn_mdm;
memset(&m->tty_modem, 0, sizeof(struct tty_driver));
m->tty_modem.magic = TTY_DRIVER_MAGIC;
m->tty_modem.name = isdn_ttyname_ttyI;
#endif
kfree(info->xmit_buf - 4);
}
- tty_unregister_driver(&dev->mdm.cua_modem);
+ tty_unregister_driver(&isdn_mdm.cua_modem);
err_unregister_tty:
- tty_unregister_driver(&dev->mdm.tty_modem);
+ tty_unregister_driver(&isdn_mdm.tty_modem);
err:
return retval;
}
void
isdn_tty_exit(void)
{
- modem *m = &dev->mdm;
modem_info *info;
int i;
for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
- info = &m->info[i];
+ info = &isdn_mdm.info[i];
isdn_tty_cleanup_xmit(info);
#ifdef CONFIG_ISDN_TTY_FAX
kfree(info->fax);
#endif
kfree(info->xmit_buf - 4);
}
- tty_unregister_driver(&dev->mdm.cua_modem);
- tty_unregister_driver(&dev->mdm.tty_modem);
+ tty_unregister_driver(&isdn_mdm.cua_modem);
+ tty_unregister_driver(&isdn_mdm.tty_modem);
}
/*
save_flags(flags);
cli();
for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
- modem_info *info = &dev->mdm.info[i];
+ modem_info *info = &isdn_mdm.info[i];
if (info->count == 0)
continue;
printk(KERN_DEBUG "tty_STAT_UNLOAD ttyI%d\n", info->line);
#endif
for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
- info = &dev->mdm.info[i];
+ info = &isdn_mdm.info[i];
if (isdn_slot_driver(info->isdn_slot) == c->driver) {
if (info->online)
isdn_tty_modem_hup(info, 1);
for (i = 0; i < ISDN_MAX_CHANNELS; i++)
if (USG_MODEM(isdn_slot_usage(i)))
if ((midx = isdn_slot_m_idx(i)) >= 0) {
- modem_info *info = &dev->mdm.info[midx];
+ modem_info *info = &isdn_mdm.info[midx];
if (info->online) {
ton = 1;
if ((info->emu.pluscount == 3) &&
int i;
for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
- modem_info *info = &dev->mdm.info[i];
+ modem_info *info = &isdn_mdm.info[i];
if (info->msr & UART_MSR_RI) {
ton = 1;
isdn_tty_modem_result(RESULT_RING, info);
int i;
for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
- modem_info *info = &dev->mdm.info[i];
+ modem_info *info = &isdn_mdm.info[i];
if (info->online) {
ton = 1;
isdn_tty_senddown(info);
int i;
for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
- modem_info *info = &dev->mdm.info[i];
+ modem_info *info = &isdn_mdm.info[i];
if (info->dialing) {
if (info->emu.carrierwait++ > info->emu.mdmreg[REG_WAITC]) {
info->dialing = 0;
extern int isdn_tty_init(void);
extern void isdn_tty_exit(void);
+
+struct isdn_modem {
+ int refcount; /* Number of opens */
+ struct tty_driver tty_modem; /* tty-device */
+ struct tty_driver cua_modem; /* cua-device */
+ struct tty_struct *modem_table[ISDN_MAX_CHANNELS]; /* ?? copied from Orig */
+ struct termios *modem_termios[ISDN_MAX_CHANNELS];
+ struct termios *modem_termios_locked[ISDN_MAX_CHANNELS];
+ modem_info info[ISDN_MAX_CHANNELS]; /* Private data */
+};
+
+extern struct isdn_modem isdn_mdm;
#define ISDN_MODEM_WINSIZE 8
-/* Description of one ISDN-tty */
-typedef struct {
- int refcount; /* Number of opens */
- struct tty_driver tty_modem; /* tty-device */
- struct tty_driver cua_modem; /* cua-device */
- struct tty_struct *modem_table[ISDN_MAX_CHANNELS]; /* ?? copied from Orig */
- struct termios *modem_termios[ISDN_MAX_CHANNELS];
- struct termios *modem_termios_locked[ISDN_MAX_CHANNELS];
- modem_info info[ISDN_MAX_CHANNELS]; /* Private data */
-} modem;
-
/*======================= End of ISDN-tty stuff ============================*/
/*======================== Start of V.110 stuff ============================*/
wait_queue_head_t info_waitq; /* Wait-Queue for isdninfo */
struct timer_list timer; /* Misc.-function Timer */
struct task_struct *profd; /* For iprofd */
- modem mdm; /* tty-driver-data */
struct semaphore sem; /* serialize list access*/
unsigned long global_features;
#ifdef CONFIG_DEVFS_FS