hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/tty/cyclades.c
....@@ -556,7 +556,7 @@
556556 }
557557 info->idle_stats.recv_idle = jiffies;
558558 }
559
- tty_schedule_flip(port);
559
+ tty_flip_buffer_push(port);
560560
561561 /* end of service */
562562 cyy_writeb(info, CyRIR, save_xir & 0x3f);
....@@ -996,7 +996,7 @@
996996 mod_timer(&info->rx_full_timer, jiffies + 1);
997997 #endif
998998 info->idle_stats.recv_idle = jiffies;
999
- tty_schedule_flip(&info->port);
999
+ tty_flip_buffer_push(&info->port);
10001000
10011001 /* Update rx_get */
10021002 cy_writel(&buf_ctrl->rx_get, new_rx_get);
....@@ -1172,7 +1172,7 @@
11721172 if (delta_count)
11731173 wake_up_interruptible(&info->port.delta_msr_wait);
11741174 if (special_count)
1175
- tty_schedule_flip(&info->port);
1175
+ tty_flip_buffer_push(&info->port);
11761176 }
11771177 }
11781178
....@@ -2257,44 +2257,45 @@
22572257 }
22582258 } /* set_line_char */
22592259
2260
-static int cy_get_serial_info(struct cyclades_port *info,
2261
- struct serial_struct __user *retinfo)
2260
+static int cy_get_serial_info(struct tty_struct *tty,
2261
+ struct serial_struct *ss)
22622262 {
2263
+ struct cyclades_port *info = tty->driver_data;
22632264 struct cyclades_card *cinfo = info->card;
2264
- struct serial_struct tmp = {
2265
- .type = info->type,
2266
- .line = info->line,
2267
- .port = (info->card - cy_card) * 0x100 + info->line -
2268
- cinfo->first_line,
2269
- .irq = cinfo->irq,
2270
- .flags = info->port.flags,
2271
- .close_delay = info->port.close_delay,
2272
- .closing_wait = info->port.closing_wait,
2273
- .baud_base = info->baud,
2274
- .custom_divisor = info->custom_divisor,
2275
- };
2276
- return copy_to_user(retinfo, &tmp, sizeof(*retinfo)) ? -EFAULT : 0;
2265
+
2266
+ if (serial_paranoia_check(info, tty->name, "cy_ioctl"))
2267
+ return -ENODEV;
2268
+ ss->type = info->type;
2269
+ ss->line = info->line;
2270
+ ss->port = (info->card - cy_card) * 0x100 + info->line -
2271
+ cinfo->first_line;
2272
+ ss->irq = cinfo->irq;
2273
+ ss->flags = info->port.flags;
2274
+ ss->close_delay = info->port.close_delay;
2275
+ ss->closing_wait = info->port.closing_wait;
2276
+ ss->baud_base = info->baud;
2277
+ ss->custom_divisor = info->custom_divisor;
2278
+ return 0;
22772279 }
22782280
2279
-static int
2280
-cy_set_serial_info(struct cyclades_port *info, struct tty_struct *tty,
2281
- struct serial_struct __user *new_info)
2281
+static int cy_set_serial_info(struct tty_struct *tty,
2282
+ struct serial_struct *ss)
22822283 {
2283
- struct serial_struct new_serial;
2284
+ struct cyclades_port *info = tty->driver_data;
22842285 int old_flags;
22852286 int ret;
22862287
2287
- if (copy_from_user(&new_serial, new_info, sizeof(new_serial)))
2288
- return -EFAULT;
2288
+ if (serial_paranoia_check(info, tty->name, "cy_ioctl"))
2289
+ return -ENODEV;
22892290
22902291 mutex_lock(&info->port.mutex);
22912292
22922293 old_flags = info->port.flags;
22932294
22942295 if (!capable(CAP_SYS_ADMIN)) {
2295
- if (new_serial.close_delay != info->port.close_delay ||
2296
- new_serial.baud_base != info->baud ||
2297
- (new_serial.flags & ASYNC_FLAGS &
2296
+ if (ss->close_delay != info->port.close_delay ||
2297
+ ss->baud_base != info->baud ||
2298
+ (ss->flags & ASYNC_FLAGS &
22982299 ~ASYNC_USR_MASK) !=
22992300 (info->port.flags & ASYNC_FLAGS & ~ASYNC_USR_MASK))
23002301 {
....@@ -2302,9 +2303,9 @@
23022303 return -EPERM;
23032304 }
23042305 info->port.flags = (info->port.flags & ~ASYNC_USR_MASK) |
2305
- (new_serial.flags & ASYNC_USR_MASK);
2306
- info->baud = new_serial.baud_base;
2307
- info->custom_divisor = new_serial.custom_divisor;
2306
+ (ss->flags & ASYNC_USR_MASK);
2307
+ info->baud = ss->baud_base;
2308
+ info->custom_divisor = ss->custom_divisor;
23082309 goto check_and_exit;
23092310 }
23102311
....@@ -2313,18 +2314,18 @@
23132314 * At this point, we start making changes.....
23142315 */
23152316
2316
- info->baud = new_serial.baud_base;
2317
- info->custom_divisor = new_serial.custom_divisor;
2317
+ info->baud = ss->baud_base;
2318
+ info->custom_divisor = ss->custom_divisor;
23182319 info->port.flags = (info->port.flags & ~ASYNC_FLAGS) |
2319
- (new_serial.flags & ASYNC_FLAGS);
2320
- info->port.close_delay = new_serial.close_delay * HZ / 100;
2321
- info->port.closing_wait = new_serial.closing_wait * HZ / 100;
2320
+ (ss->flags & ASYNC_FLAGS);
2321
+ info->port.close_delay = ss->close_delay * HZ / 100;
2322
+ info->port.closing_wait = ss->closing_wait * HZ / 100;
23222323
23232324 check_and_exit:
23242325 if (tty_port_initialized(&info->port)) {
2325
- if ((new_serial.flags ^ old_flags) & ASYNC_SPD_MASK) {
2326
+ if ((ss->flags ^ old_flags) & ASYNC_SPD_MASK) {
23262327 /* warn about deprecation unless clearing */
2327
- if (new_serial.flags & ASYNC_SPD_MASK)
2328
+ if (ss->flags & ASYNC_SPD_MASK)
23282329 dev_warn_ratelimited(tty->dev, "use of SPD flags is deprecated\n");
23292330 }
23302331 cy_set_line_char(info, tty);
....@@ -2697,12 +2698,6 @@
26972698 break;
26982699 case CYGETWAIT:
26992700 ret_val = info->port.closing_wait / (HZ / 100);
2700
- break;
2701
- case TIOCGSERIAL:
2702
- ret_val = cy_get_serial_info(info, argp);
2703
- break;
2704
- case TIOCSSERIAL:
2705
- ret_val = cy_set_serial_info(info, tty, argp);
27062701 break;
27072702 case TIOCSERGETLSR: /* Get line status register */
27082703 ret_val = get_lsr_info(info, argp);
....@@ -3261,7 +3256,7 @@
32613256 return nboard;
32623257
32633258 /* probe for CD1400... */
3264
- cy_isa_address = ioremap_nocache(isa_address, CyISA_Ywin);
3259
+ cy_isa_address = ioremap(isa_address, CyISA_Ywin);
32653260 if (cy_isa_address == NULL) {
32663261 printk(KERN_ERR "Cyclom-Y/ISA: can't remap base "
32673262 "address\n");
....@@ -3648,7 +3643,7 @@
36483643 struct cyclades_card *card;
36493644 void __iomem *addr0 = NULL, *addr2 = NULL;
36503645 char *card_name = NULL;
3651
- u32 uninitialized_var(mailbox);
3646
+ u32 mailbox;
36523647 unsigned int device_id, nchan = 0, card_no, i, j;
36533648 unsigned char plx_ver;
36543649 int retval, irq;
....@@ -3695,13 +3690,13 @@
36953690 device_id == PCI_DEVICE_ID_CYCLOM_Y_Hi) {
36963691 card_name = "Cyclom-Y";
36973692
3698
- addr0 = ioremap_nocache(pci_resource_start(pdev, 0),
3693
+ addr0 = ioremap(pci_resource_start(pdev, 0),
36993694 CyPCI_Yctl);
37003695 if (addr0 == NULL) {
37013696 dev_err(&pdev->dev, "can't remap ctl region\n");
37023697 goto err_reg;
37033698 }
3704
- addr2 = ioremap_nocache(pci_resource_start(pdev, 2),
3699
+ addr2 = ioremap(pci_resource_start(pdev, 2),
37053700 CyPCI_Ywin);
37063701 if (addr2 == NULL) {
37073702 dev_err(&pdev->dev, "can't remap base region\n");
....@@ -3717,7 +3712,7 @@
37173712 } else if (device_id == PCI_DEVICE_ID_CYCLOM_Z_Hi) {
37183713 struct RUNTIME_9060 __iomem *ctl_addr;
37193714
3720
- ctl_addr = addr0 = ioremap_nocache(pci_resource_start(pdev, 0),
3715
+ ctl_addr = addr0 = ioremap(pci_resource_start(pdev, 0),
37213716 CyPCI_Zctl);
37223717 if (addr0 == NULL) {
37233718 dev_err(&pdev->dev, "can't remap ctl region\n");
....@@ -3732,7 +3727,7 @@
37323727
37333728 mailbox = readl(&ctl_addr->mail_box_0);
37343729
3735
- addr2 = ioremap_nocache(pci_resource_start(pdev, 2),
3730
+ addr2 = ioremap(pci_resource_start(pdev, 2),
37363731 mailbox == ZE_V1 ? CyPCI_Ze_win : CyPCI_Zwin);
37373732 if (addr2 == NULL) {
37383733 dev_err(&pdev->dev, "can't remap base region\n");
....@@ -4011,6 +4006,8 @@
40114006 .tiocmget = cy_tiocmget,
40124007 .tiocmset = cy_tiocmset,
40134008 .get_icount = cy_get_icount,
4009
+ .set_serial = cy_set_serial_info,
4010
+ .get_serial = cy_get_serial_info,
40144011 .proc_show = cyclades_proc_show,
40154012 };
40164013