/* 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();

}