static long modem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
	int status = 0;

	printk(KERN_DEBUG "ACM_dun modem_ioctl: cmd=0x%x, arg=%lu\n", cmd, arg);

	if (!atomic_read(&link_state)) {
		printk(KERN_DEBUG "Cannot ioctl ACM_dun(not connected)\n");
		return -ENODEV;
	}

	/* handle ioctls */
	switch (cmd) {
	case GS_CDC_NOTIFY_SERIAL_STATE:
		status = acm_notify(s_acm_dev->acm_data,
					__constant_cpu_to_le16(arg));
		break;

	case GS_IOC_NOTIFY_DTR_TEST:
		printk(KERN_ALERT"DUN : DTR %d\n", (int)arg);
		notify_control_line_state((int)arg);
		break;

	default:
		printk(KERN_ERR "ACM_dun: Unknown ioctl cmd(0x%x).\n", cmd);
		status = -ENOIOCTLCMD;
	}

	return status;
}
static long
modem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
    int ret = 0;
    printk(KERN_INFO "modem_ioctl: cmd=0x%x, arg=%lu\n", cmd, arg);

    /* handle ioctls */
    switch (cmd) {
    case GS_CDC_NOTIFY_SERIAL_STATE:
        ret = acm_notify(acm_data, __constant_cpu_to_le16(arg));
        return ret;

    case GS_IOC_NOTIFY_DTR_TEST:
    {
        printk(KERN_ALERT"DUN : DTR %d\n", (int)arg);
        notify_control_line_state((int)arg);
        break;
    }

    default:
        printk(KERN_INFO "modem_ioctl: Unknown ioctl cmd(0x%x).\n",
               cmd);
        return -ENOIOCTLCMD;
    }
    return 0;
}
Beispiel #3
0
static int 
modem_ioctl (struct inode *inode, struct file *file, unsigned int  cmd,unsigned long arg)
{
	//hdlnc_ysyim_2010-4-26: remove log for popupnois when usb unmout	
	//printk("modem_ioctl: cmd=0x%x, arg=%lu\n", cmd, arg);

	/* handle ioctls */
	switch (cmd) 
	{
		case GS_CDC_NOTIFY_SERIAL_STATE:
			acm_notify(acm_data, __constant_cpu_to_le16(arg));
			break;

		case GS_IOC_NOTIFY_DTR_TEST:
			{
			printk(KERN_ALERT"DUN : DTR %d\n",(int)arg);
			notify_control_line_state((int)arg);
			break;
			}
		
		default:
			printk("modem_ioctl: Unknown ioctl cmd(0x%x).\n", cmd);
			return -ENOIOCTLCMD;
	}
	return 0;
}