/* the real citty_ioctl function. * The above is done to get the small functions*/ static int citty_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) { struct file *file = NULL; F_ENTER(); switch (cmd) { case TIOCGSERIAL: return citty_ioctl_tiocgserial(tty, file, cmd, arg); case TIOCMIWAIT: return citty_ioctl_tiocmiwait(tty, file, cmd, arg); case TIOCGICOUNT: return citty_ioctl_tiocgicount(tty, file, cmd, arg); case TCSETS: return citty_ioctl_tcsets(tty, file, cmd, arg); case TCGETS: /* 0x5401 ioctls.h */ return citty_ioctl_tcgets(tty, file, cmd, arg); case TCSETSF: /* 0x5404 */ case TCSETAF: /* 0x5408 */ return 0; /* has to return zero for qtopia to work */ default: PDEBUG("citty_ioctl cmd: %d.\n", cmd); return -ENOIOCTLCMD; /* for PPPD to work? */ break; } F_LEAVE(); }
static int citty_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) #endif { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) struct file *file = NULL; #endif F_ENTER(); switch (cmd) { case TIOCGSERIAL: return citty_ioctl_tiocgserial(tty, file, cmd, arg); case TIOCMIWAIT: return citty_ioctl_tiocmiwait(tty, file, cmd, arg); case TIOCGICOUNT: return citty_ioctl_tiocgicount(tty, file, cmd, arg); case TCSETS: return citty_ioctl_tcsets(tty, file, cmd, arg); case TCGETS: //0x5401 ioctls.h return citty_ioctl_tcgets(tty, file, cmd, arg); case TCSETSF: //0x5404 case TCSETAF: //0x5408 return 0; //has to return zero for qtopia to work default: PDEBUG("citty_ioctl cmd: %d.\n", cmd); return -ENOIOCTLCMD; // for PPPD to work? break; } F_LEAVE(); }
/* the real citty_ioctl function. * The above is done to get the small functions*/ static int citty_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) { struct file *file = NULL; F_ENTER(); switch (cmd) { case TIOCGSERIAL: return citty_ioctl_tiocgserial(tty, file, cmd, arg); case TIOCMIWAIT: return citty_ioctl_tiocmiwait(tty, file, cmd, arg); case TIOCGICOUNT: return citty_ioctl_tiocgicount(tty, file, cmd, arg); #ifndef TCGETS2 case TCSETS: if (user_termios_to_kernel_termios(&tty->termios, (struct termios __user *) arg)) return -EFAULT; else return 0; case TCGETS: if (kernel_termios_to_user_termios( (struct termios __user *)arg, &tty->termios)) return -EFAULT; else return 0; #else case TCSETS: if (user_termios_to_kernel_termios_1(&tty->termios, (struct termios __user *) arg)) return -EFAULT; else return 0; case TCSETS2: if (user_termios_to_kernel_termios(&tty->termios, (struct termios2 __user *) arg)) return -EFAULT; else return 0; case TCGETS: if (kernel_termios_to_user_termios_1( (struct termios __user *)arg, &tty->termios)) return -EFAULT; else return 0; case TCGETS2: if (kernel_termios_to_user_termios( (struct termios2 __user *)arg, &tty->termios)) return -EFAULT; else return 0; #endif case TCSETSF: /* 0x5404 */ case TCSETAF: /* 0x5408 */ return 0; /* has to return zero for qtopia to work */ default: PDEBUG("citty_ioctl cmd: %d.\n", cmd); return -ENOIOCTLCMD; /* for PPPD to work? */ break; } F_LEAVE(); }