patch-2.0.26 linux/drivers/isdn/isdn_tty.c
Next file: linux/drivers/isdn/pcbit/drv.c
Previous file: linux/drivers/isdn/isdn_ppp.h
Back to the patch index
Back to the overall index
- Lines: 172
- Date:
Wed Nov 13 08:36:20 1996
- Orig file:
v2.0.25/linux/drivers/isdn/isdn_tty.c
- Orig date:
Sat Jun 29 20:36:22 1996
diff -u --recursive --new-file v2.0.25/linux/drivers/isdn/isdn_tty.c linux/drivers/isdn/isdn_tty.c
@@ -1,4 +1,4 @@
-/* $Id: isdn_tty.c,v 1.21 1996/06/24 17:40:28 fritz Exp $
+/* $Id: isdn_tty.c,v 1.23 1996/10/22 23:14:02 fritz Exp $
*
* Linux ISDN subsystem, tty functions and AT-command emulator (linklevel).
*
@@ -20,6 +20,12 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: isdn_tty.c,v $
+ * Revision 1.23 1996/10/22 23:14:02 fritz
+ * Changes for compatibility to 2.0.X and 2.1.X kernels.
+ *
+ * Revision 1.22 1996/10/19 18:56:43 fritz
+ * ATZ did not change the xmitbuf size.
+ *
* Revision 1.21 1996/06/24 17:40:28 fritz
* Bugfix: Did not compile without CONFIG_ISDN_AUDIO
*
@@ -125,7 +131,7 @@
static int isdn_tty_edit_at(const char *, int, modem_info *, int);
static void isdn_tty_check_esc(const u_char *, u_char, int, int *, int *, int);
-static void isdn_tty_modem_reset_regs(atemu *, int);
+static void isdn_tty_modem_reset_regs(modem_info *, int);
static void isdn_tty_cmd_ATA(modem_info *);
static void isdn_tty_at_cout(char *, modem_info *);
static void isdn_tty_flush_buffer(struct tty_struct *);
@@ -139,7 +145,7 @@
static int bit2si[8] = {1,5,7,7,7,7,7,7};
static int si2bit[8] = {4,1,4,4,4,4,4,4};
-char *isdn_tty_revision = "$Revision: 1.21 $";
+char *isdn_tty_revision = "$Revision: 1.23 $";
#define DLE 0x10
#define ETX 0x03
@@ -375,7 +381,7 @@
return 1;
}
if (from_user) {
- memcpy_fromfs(tmpbuf, buf, c);
+ copy_from_user(tmpbuf, buf, c);
p = tmpbuf;
} else
p = (char *)buf;
@@ -710,7 +716,7 @@
#endif
if (info->online)
info->ncarrier = 1;
- isdn_tty_modem_reset_regs(&info->emu, 0);
+ isdn_tty_modem_reset_regs(info, 0);
isdn_tty_modem_hup(info);
}
return;
@@ -785,7 +791,7 @@
if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) {
info->mcr &= ~(UART_MCR_DTR | UART_MCR_RTS);
if (info->emu.mdmreg[13] & 4) {
- isdn_tty_modem_reset_regs(&info->emu, 0);
+ isdn_tty_modem_reset_regs(info, 0);
#ifdef ISDN_DEBUG_MODEM_HUP
printk(KERN_DEBUG "Mhup in isdn_tty_shutdown\n");
#endif
@@ -836,7 +842,7 @@
&(m->lastplus),
from_user);
if (from_user)
- memcpy_fromfs(&(info->xmit_buf[info->xmit_count]), buf, c);
+ copy_from_user(&(info->xmit_buf[info->xmit_count]), buf, c);
else
memcpy(&(info->xmit_buf[info->xmit_count]), buf, c);
#ifdef CONFIG_ISDN_AUDIO
@@ -1041,9 +1047,10 @@
static int isdn_tty_set_modem_info(modem_info * info, uint cmd, uint * value)
{
- uint arg = get_user((uint *) value);
+ uint arg;
int pre_dtr;
+ GET_USER(arg, (uint *)value);
switch (cmd) {
case TIOCMBIS:
#ifdef ISDN_DEBUG_MODEM_IOCTL
@@ -1067,7 +1074,7 @@
if (arg & TIOCM_DTR) {
info->mcr &= ~UART_MCR_DTR;
if (info->emu.mdmreg[13] & 4) {
- isdn_tty_modem_reset_regs(&info->emu, 0);
+ isdn_tty_modem_reset_regs(info, 0);
#ifdef ISDN_DEBUG_MODEM_HUP
printk(KERN_DEBUG "Mhup in TIOCMBIC\n");
#endif
@@ -1088,7 +1095,7 @@
if (pre_dtr |= (info->mcr & UART_MCR_DTR)) {
if (!(info->mcr & UART_MCR_DTR)) {
if (info->emu.mdmreg[13] & 4) {
- isdn_tty_modem_reset_regs(&info->emu, 0);
+ isdn_tty_modem_reset_regs(info, 0);
#ifdef ISDN_DEBUG_MODEM_HUP
printk(KERN_DEBUG "Mhup in TIOCMSET\n");
#endif
@@ -1152,7 +1159,7 @@
error = verify_area(VERIFY_READ, (void *) arg, sizeof(long));
if (error)
return error;
- arg = get_user((ulong *) arg);
+ GET_USER(arg, (ulong *) arg);
tty->termios->c_cflag =
((tty->termios->c_cflag & ~CLOCAL) |
(arg ? CLOCAL : 0));
@@ -1546,11 +1553,13 @@
m->vpar[3] = 2; /* Compression type (1 = ADPCM-2 ) */
}
-static void isdn_tty_modem_reset_regs(atemu * m, int force)
+static void isdn_tty_modem_reset_regs(modem_info *info, int force)
{
+ atemu *m = &info->emu;
if ((m->mdmreg[12] & 32) || force) {
memcpy(m->mdmreg, m->profile, ISDN_MODEM_ANZREG);
memcpy(m->msn, m->pmsn, ISDN_MSNLEN);
+ info->xmit_size = m->mdmreg[16] * 16;
}
isdn_tty_modem_reset_vpar(m);
m->mdmcmdl = 0;
@@ -1622,7 +1631,7 @@
for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
info = &m->info[i];
isdn_tty_reset_profile(&info->emu);
- isdn_tty_modem_reset_regs(&info->emu, 1);
+ isdn_tty_modem_reset_regs(info, 1);
info->magic = ISDN_ASYNC_MAGIC;
info->line = i;
info->tty = 0;
@@ -1840,7 +1849,7 @@
*pluscount = 0;
}
if (from_user) {
- memcpy_fromfs(cbuf, p, count);
+ copy_from_user(cbuf, p, count);
p = cbuf;
}
while (count > 0) {
@@ -2054,7 +2063,7 @@
/* &F -Set Factory-Defaults */
p[0]++;
isdn_tty_reset_profile(m);
- isdn_tty_modem_reset_regs(m, 1);
+ isdn_tty_modem_reset_regs(info, 1);
break;
case 'S':
/* &S - Set Windowsize */
@@ -2612,7 +2621,7 @@
case 'Z':
/* Z - Load Registers from Profile */
p++;
- isdn_tty_modem_reset_regs(m, 1);
+ isdn_tty_modem_reset_regs(info, 1);
break;
#ifdef CONFIG_ISDN_AUDIO
case '+':
@@ -2670,7 +2679,7 @@
for (cnt = count; cnt > 0; p++, cnt--) {
if (user)
- c = get_user(p);
+ GET_USER(c, p);
else
c = *p;
total++;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov