- if ((ppp->flags | temp_i) & SC_DEBUG)
- printk (KERN_INFO
- "ppp_tty_ioctl: set flags to %x\n", temp_i);
- ppp->flags = temp_i;
- break;
-/*
- * Set the compression mode
- */
- case PPPIOCSCOMPRESS:
- error = ppp_set_compression (ppp,
- (struct ppp_option_data *) param3);
- break;
-/*
- * Retrieve the transmit async map
- */
- case PPPIOCGASYNCMAP:
- PUT_USER (error, ppp->xmit_async_map[0], (int *) param3);
- break;
-/*
- * Set the transmit async map
- */
- case PPPIOCSASYNCMAP:
- GET_USER (error, temp_i, (int *) param3);
- if (error != 0)
- break;
- ppp->xmit_async_map[0] = temp_i;
- if (ppp->flags & SC_DEBUG)
- printk (KERN_INFO
- "ppp_tty_ioctl: set xmit asyncmap %x\n",
- ppp->xmit_async_map[0]);
- break;
-/*
- * Set the receive async map
- */
- case PPPIOCSRASYNCMAP:
- GET_USER (error, temp_i, (int *) param3);
- if (error != 0)
- break;
- ppp->recv_async_map = temp_i;
- if (ppp->flags & SC_DEBUG)
- printk (KERN_INFO
- "ppp_tty_ioctl: set rcv asyncmap %x\n",
- ppp->recv_async_map);
- break;
-/*
- * Obtain the unit number for this device.
- */
- case PPPIOCGUNIT:
- PUT_USER (error, ppp2dev (ppp)->base_addr, (int *) param3);
- if (error != 0)
- break;
- if (ppp->flags & SC_DEBUG)
- printk (KERN_INFO
- "ppp_tty_ioctl: get unit: %ld\n",
- ppp2dev (ppp)->base_addr);
- break;
-/*
- * Set the debug level
- */
- case PPPIOCSDEBUG:
- GET_USER (error, temp_i, (int *) param3);
- if (error != 0)
- break;
- temp_i = (temp_i & 0x1F) << 16;
- temp_i |= (ppp->flags & ~0x1F0000);
-
- if ((ppp->flags | temp_i) & SC_DEBUG)
- printk (KERN_INFO
- "ppp_tty_ioctl: set flags to %x\n", temp_i);
- ppp->flags = temp_i;
- break;
-/*
- * Get the debug level
- */
- case PPPIOCGDEBUG:
- temp_i = (ppp->flags >> 16) & 0x1F;
- PUT_USER (error, temp_i, (int *) param3);
- break;
-/*
- * Get the times since the last send/receive frame operation
- */
- case PPPIOCGIDLE:
- {
- struct ppp_idle cur_ddinfo;
-
- /* change absolute times to relative times. */
- cur_ddinfo.xmit_idle = (jiffies - ppp->last_xmit) / HZ;
- cur_ddinfo.recv_idle = (jiffies - ppp->last_recv) / HZ;
- COPY_TO_USER (error, (void *) param3, &cur_ddinfo,
- sizeof (cur_ddinfo));
- }
- break;
-/*
- * Retrieve the extended async map
- */
- case PPPIOCGXASYNCMAP:
- COPY_TO_USER (error, (void *) param3, ppp->xmit_async_map,
- sizeof (ppp->xmit_async_map));
- break;
-/*
- * Set the async extended map
- */
- case PPPIOCSXASYNCMAP:
- {
- __u32 temp_tbl[8];
-
- COPY_FROM_USER (error, temp_tbl, (void *) param3,
- sizeof (temp_tbl));
- if (error != 0)
- break;
-
- temp_tbl[1] = 0x00000000;
- temp_tbl[2] &= ~0x40000000;
- temp_tbl[3] |= 0x60000000;
-
- if ((temp_tbl[2] & temp_tbl[3]) != 0 ||
- (temp_tbl[4] & temp_tbl[5]) != 0 ||
- (temp_tbl[6] & temp_tbl[7]) != 0)
- error = -EINVAL;
- else {
- memcpy (ppp->xmit_async_map,
- temp_tbl,
- sizeof (ppp->xmit_async_map));
-
- if (ppp->flags & SC_DEBUG)
- printk (KERN_INFO
- "ppp_tty_ioctl: set xasyncmap\n");
- }
- }
- break;
-/*
- * Set the maximum VJ header compression slot number.
- */
- case PPPIOCSMAXCID:
- GET_USER (error, temp_i, (int *) param3);
- if (error != 0)
- break;
- temp_i = (temp_i & 255) + 1;
- if (ppp->flags & SC_DEBUG)
- printk (KERN_INFO
- "ppp_tty_ioctl: set maxcid to %d\n",
- temp_i);
- if (ppp->slcomp != NULL)
- slhc_free (ppp->slcomp);
- ppp->slcomp = slhc_init (16, temp_i);
-
- if (ppp->slcomp == NULL) {
- if (ppp->flags & SC_DEBUG)
- printk (KERN_ERR
- "ppp: no space for compression buffers!\n");
- ppp_release (ppp);
- error = -ENOMEM;