static void cplog_work_func(struct work_struct *work) { struct pdp_info *dev = pdp_get_serdev("ttyCPLOG"); struct sk_buff *skb; int ret = 0; int reschedule = 0; if (fp_vsCPLOG > 0) { while ((skb = skb_dequeue(&cplog_sk_buf_rx_q))) { ret = multipdp_tty_insert_data(dev->vs_dev.tty, skb->data, skb->len); if (ret == 0) { skb_queue_head(&cplog_sk_buf_rx_q, skb); reschedule = 1; pr_err("[MULTIPDP] insert_data_size is ZERO!!\n"); break; } else if (ret != skb->len) { skb_pull(skb, ret); skb_queue_head(&cplog_sk_buf_rx_q, skb); tty_flip_buffer_push(dev->vs_dev.tty); break; } else { tty_flip_buffer_push(dev->vs_dev.tty); dev_kfree_skb_any(skb); } } if (reschedule == 1) queue_work(cplog_rx_wq, &cplog_work); } else { /* Do Something */ pr_err("[MULTIPDP] RIL didn't open CPLop node (ch.29)\n"); return; } }
static int vs_open(struct tty_struct *tty, struct file *filp) { struct pdp_info *dev; DPRINTK(1, "into => tty[%s]\n", tty->name); /* 2.6 kernel porting */ dev = pdp_get_serdev(tty->driver->name); if (dev == NULL) { pr_err("[MULTIPDP] dev is null\n"); return -ENODEV; } switch (dev->id) { case 1: fp_vsCSD = 1; break; case 5: fp_vsGPS = 1; break; case 6: fp_vsEXGPS = 1; break; case 8: fp_vsEFS = 1; break; case 25: fp_vsSMD = 1; break; case 29: fp_vsCPLOG = 1; break; case 31: fp_vsLOOPBACK = 1; break; default: break; } tty->driver_data = (void *)dev; /* change 1 to 0 */ tty->low_latency = 0; dev->vs_dev.tty = tty; return 0; }
static int vs_open(struct tty_struct *tty, struct file *filp) { struct pdp_info *dev; dev = pdp_get_serdev(tty->driver->name); // 2.6 kernel porting if (dev == NULL) { return -ENODEV; } switch (dev->id) { case 1: fp_vsCSD = 1; break; case 5: fp_vsGPS = 1; break; case 6: fp_vsEXGPS = 1; break; case 8 : fp_vsEFS = 1; break; case 25 : fp_vsSMD = 1; break; #ifdef CONFIG_ENABLE_TTY_CIQ case 9 : fp_vsCIQ1 = 1; break; case 26 : fp_vsCIQ0 = 1; break; #endif default: break; } tty->driver_data = (void *)dev; /* change 1 to 0 */ tty->low_latency = 0; dev->vs_dev.tty = tty; dev->vs_dev.refcount++; return 0; }
static int vs_close(struct tty_struct *tty, struct file *filp) { struct pdp_info *dev; dev = pdp_get_serdev(tty->driver->name); // 2.6 kernel porting if (dev == NULL) { return -ENODEV; } dev->vs_dev.tty = NULL; printk("========================> vs_close : %s\n", tty->driver->name); return 0; }
static void vs_close(struct tty_struct *tty, struct file *filp) { struct pdp_info *dev; dev = pdp_get_serdev(tty->driver->name); // 2.6 kernel porting if (dev == NULL) { return; // -ENODEV; } dev->vs_dev.tty = NULL; printk("========================> vs_close : %s\n", tty->driver->name); printk(KERN_ERR "MULTIPDP (%s) Virtual serial device closed\n",__func__); return; // 0; }
static int vs_open(struct tty_struct *tty, struct file *filp) { struct pdp_info *dev; dev = pdp_get_serdev(tty->driver->name); // 2.6 kernel porting if (dev == NULL) { return -ENODEV; } tty->driver_data = (void *)dev; tty->low_latency = 1; dev->vs_dev.tty = tty; printk("========================> vs_open : %s\n", tty->driver->name); return 0; }
static int vs_open(struct tty_struct *tty, struct file *filp) { struct pdp_info *dev; DPRINTK(2, "BEGIN\n"); dev = pdp_get_serdev(tty->driver->name); // 2.6 kernel porting if (dev == NULL) { return -ENODEV; } switch (dev->id) { case 1: fp_vsCSD = 1; break; case 5: fp_vsGPS = 1; break; case 6: fp_vsEXGPS = 1; break; case 8 : fp_vsEFS = 1; break; case 25 : fp_vsSMD = 1; break; default: break; } tty->driver_data = (void *)dev; tty->low_latency = 1; dev->vs_dev.tty = tty; DPRINTK(2, "END\n"); return 0; }
static int vs_open(struct tty_struct *tty, struct file *filp) { struct pdp_info *dev; dev = pdp_get_serdev(tty->driver->name); // 2.6 kernel porting if (dev == NULL) { return -ENODEV; } tty->driver_data = (void *)dev; tty->low_latency = 1; dev->vs_dev.tty = tty; printk("========================> vs_open : %s\n", tty->driver->name); printk(KERN_ERR "MULTIPDP (%s) Virtual serial device opened\n",__func__); return 0; }