- if (ppp->mru != temp_i)
- ppp_changedmtu (ppp, ppp2dev (ppp)->mtu, temp_i);
- }
- break;
-/*
- * Fetch the flags
- */
- case PPPIOCGFLAGS:
- error = verify_area (VERIFY_WRITE, (void *) param3,
- sizeof (temp_i));
- if (error == 0) {
- temp_i = (ppp->flags & SC_MASK);
-#ifndef CHECK_CHARACTERS /* Don't generate errors if we don't check chars. */
- temp_i |= SC_RCV_B7_1 | SC_RCV_B7_0 |
- SC_RCV_ODDP | SC_RCV_EVNP;
-#endif
- put_user (temp_i, (int *) param3);
- }
- break;
-/*
- * Set the flags for the various options
- */
- case PPPIOCSFLAGS:
- error = verify_area (VERIFY_READ, (void *) param3,
- sizeof (temp_i));
- if (error == 0) {
- temp_i = get_user ((int *) param3) & SC_MASK;
- temp_i |= (ppp->flags & ~SC_MASK);
-
- if ((ppp->flags & SC_CCP_OPEN) &&
- (temp_i & SC_CCP_OPEN) == 0)
- ppp_ccp_closed (ppp);
-
- 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:
- error = verify_area (VERIFY_WRITE, (void *) param3,
- sizeof (temp_i));
- if (error == 0) {
- put_user (ppp->xmit_async_map[0], (int *) param3);
- }
- break;
-/*
- * Set the transmit async map
- */
- case PPPIOCSASYNCMAP:
- error = verify_area (VERIFY_READ, (void *) param3,
- sizeof (temp_i));
- if (error == 0) {
- ppp->xmit_async_map[0] = get_user ((int *) param3);
- 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:
- error = verify_area (VERIFY_READ, (void *) param3,
- sizeof (temp_i));
- if (error == 0) {
- ppp->recv_async_map = get_user ((int *) param3);
- 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:
- error = verify_area (VERIFY_WRITE, (void *) param3,
- sizeof (temp_i));
- if (error == 0) {
- put_user (ppp2dev (ppp)->base_addr, (int *) param3);
- 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:
- error = verify_area (VERIFY_READ, (void *) param3,
- sizeof (temp_i));
- if (error == 0) {
- temp_i = (get_user ((int *) param3) & 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:
- error = verify_area (VERIFY_WRITE, (void *) param3,
- sizeof (temp_i));
- if (error == 0) {
- temp_i = (ppp->flags >> 16) & 0x1F;
- put_user (temp_i, (int *) param3);
- }
- break;
-/*
- * Get the times since the last send/receive frame operation
- */
- case PPPIOCGIDLE:
- error = verify_area (VERIFY_WRITE, (void *) param3,
- sizeof (struct ppp_idle));
- if (error == 0) {
- struct ppp_idle cur_ddinfo;
- __u32 cur_jiffies = jiffies;
-
- /* change absolute times to relative times. */
- cur_ddinfo.xmit_idle = (cur_jiffies - ppp->ddinfo.xmit_idle) / HZ;
- cur_ddinfo.recv_idle = (cur_jiffies - ppp->ddinfo.recv_idle) / HZ;
- memcpy_tofs ((void *) param3, &cur_ddinfo,
- sizeof (cur_ddinfo));
- }
- break;
-/*
- * Retrieve the extended async map
- */
- case PPPIOCGXASYNCMAP:
- error = verify_area (VERIFY_WRITE,
- (void *) param3,
- sizeof (ppp->xmit_async_map));
- if (error == 0) {
- memcpy_tofs ((void *) param3,
- ppp->xmit_async_map,
- sizeof (ppp->xmit_async_map));
- }
- break;