| .. | .. |
|---|
| 556 | 556 | } |
|---|
| 557 | 557 | info->idle_stats.recv_idle = jiffies; |
|---|
| 558 | 558 | } |
|---|
| 559 | | - tty_schedule_flip(port); |
|---|
| 559 | + tty_flip_buffer_push(port); |
|---|
| 560 | 560 | |
|---|
| 561 | 561 | /* end of service */ |
|---|
| 562 | 562 | cyy_writeb(info, CyRIR, save_xir & 0x3f); |
|---|
| .. | .. |
|---|
| 996 | 996 | mod_timer(&info->rx_full_timer, jiffies + 1); |
|---|
| 997 | 997 | #endif |
|---|
| 998 | 998 | info->idle_stats.recv_idle = jiffies; |
|---|
| 999 | | - tty_schedule_flip(&info->port); |
|---|
| 999 | + tty_flip_buffer_push(&info->port); |
|---|
| 1000 | 1000 | |
|---|
| 1001 | 1001 | /* Update rx_get */ |
|---|
| 1002 | 1002 | cy_writel(&buf_ctrl->rx_get, new_rx_get); |
|---|
| .. | .. |
|---|
| 1172 | 1172 | if (delta_count) |
|---|
| 1173 | 1173 | wake_up_interruptible(&info->port.delta_msr_wait); |
|---|
| 1174 | 1174 | if (special_count) |
|---|
| 1175 | | - tty_schedule_flip(&info->port); |
|---|
| 1175 | + tty_flip_buffer_push(&info->port); |
|---|
| 1176 | 1176 | } |
|---|
| 1177 | 1177 | } |
|---|
| 1178 | 1178 | |
|---|
| .. | .. |
|---|
| 2257 | 2257 | } |
|---|
| 2258 | 2258 | } /* set_line_char */ |
|---|
| 2259 | 2259 | |
|---|
| 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) |
|---|
| 2262 | 2262 | { |
|---|
| 2263 | + struct cyclades_port *info = tty->driver_data; |
|---|
| 2263 | 2264 | 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; |
|---|
| 2277 | 2279 | } |
|---|
| 2278 | 2280 | |
|---|
| 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) |
|---|
| 2282 | 2283 | { |
|---|
| 2283 | | - struct serial_struct new_serial; |
|---|
| 2284 | + struct cyclades_port *info = tty->driver_data; |
|---|
| 2284 | 2285 | int old_flags; |
|---|
| 2285 | 2286 | int ret; |
|---|
| 2286 | 2287 | |
|---|
| 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; |
|---|
| 2289 | 2290 | |
|---|
| 2290 | 2291 | mutex_lock(&info->port.mutex); |
|---|
| 2291 | 2292 | |
|---|
| 2292 | 2293 | old_flags = info->port.flags; |
|---|
| 2293 | 2294 | |
|---|
| 2294 | 2295 | 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 & |
|---|
| 2298 | 2299 | ~ASYNC_USR_MASK) != |
|---|
| 2299 | 2300 | (info->port.flags & ASYNC_FLAGS & ~ASYNC_USR_MASK)) |
|---|
| 2300 | 2301 | { |
|---|
| .. | .. |
|---|
| 2302 | 2303 | return -EPERM; |
|---|
| 2303 | 2304 | } |
|---|
| 2304 | 2305 | 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; |
|---|
| 2308 | 2309 | goto check_and_exit; |
|---|
| 2309 | 2310 | } |
|---|
| 2310 | 2311 | |
|---|
| .. | .. |
|---|
| 2313 | 2314 | * At this point, we start making changes..... |
|---|
| 2314 | 2315 | */ |
|---|
| 2315 | 2316 | |
|---|
| 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; |
|---|
| 2318 | 2319 | 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; |
|---|
| 2322 | 2323 | |
|---|
| 2323 | 2324 | check_and_exit: |
|---|
| 2324 | 2325 | 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) { |
|---|
| 2326 | 2327 | /* warn about deprecation unless clearing */ |
|---|
| 2327 | | - if (new_serial.flags & ASYNC_SPD_MASK) |
|---|
| 2328 | + if (ss->flags & ASYNC_SPD_MASK) |
|---|
| 2328 | 2329 | dev_warn_ratelimited(tty->dev, "use of SPD flags is deprecated\n"); |
|---|
| 2329 | 2330 | } |
|---|
| 2330 | 2331 | cy_set_line_char(info, tty); |
|---|
| .. | .. |
|---|
| 2697 | 2698 | break; |
|---|
| 2698 | 2699 | case CYGETWAIT: |
|---|
| 2699 | 2700 | 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); |
|---|
| 2706 | 2701 | break; |
|---|
| 2707 | 2702 | case TIOCSERGETLSR: /* Get line status register */ |
|---|
| 2708 | 2703 | ret_val = get_lsr_info(info, argp); |
|---|
| .. | .. |
|---|
| 3261 | 3256 | return nboard; |
|---|
| 3262 | 3257 | |
|---|
| 3263 | 3258 | /* probe for CD1400... */ |
|---|
| 3264 | | - cy_isa_address = ioremap_nocache(isa_address, CyISA_Ywin); |
|---|
| 3259 | + cy_isa_address = ioremap(isa_address, CyISA_Ywin); |
|---|
| 3265 | 3260 | if (cy_isa_address == NULL) { |
|---|
| 3266 | 3261 | printk(KERN_ERR "Cyclom-Y/ISA: can't remap base " |
|---|
| 3267 | 3262 | "address\n"); |
|---|
| .. | .. |
|---|
| 3648 | 3643 | struct cyclades_card *card; |
|---|
| 3649 | 3644 | void __iomem *addr0 = NULL, *addr2 = NULL; |
|---|
| 3650 | 3645 | char *card_name = NULL; |
|---|
| 3651 | | - u32 uninitialized_var(mailbox); |
|---|
| 3646 | + u32 mailbox; |
|---|
| 3652 | 3647 | unsigned int device_id, nchan = 0, card_no, i, j; |
|---|
| 3653 | 3648 | unsigned char plx_ver; |
|---|
| 3654 | 3649 | int retval, irq; |
|---|
| .. | .. |
|---|
| 3695 | 3690 | device_id == PCI_DEVICE_ID_CYCLOM_Y_Hi) { |
|---|
| 3696 | 3691 | card_name = "Cyclom-Y"; |
|---|
| 3697 | 3692 | |
|---|
| 3698 | | - addr0 = ioremap_nocache(pci_resource_start(pdev, 0), |
|---|
| 3693 | + addr0 = ioremap(pci_resource_start(pdev, 0), |
|---|
| 3699 | 3694 | CyPCI_Yctl); |
|---|
| 3700 | 3695 | if (addr0 == NULL) { |
|---|
| 3701 | 3696 | dev_err(&pdev->dev, "can't remap ctl region\n"); |
|---|
| 3702 | 3697 | goto err_reg; |
|---|
| 3703 | 3698 | } |
|---|
| 3704 | | - addr2 = ioremap_nocache(pci_resource_start(pdev, 2), |
|---|
| 3699 | + addr2 = ioremap(pci_resource_start(pdev, 2), |
|---|
| 3705 | 3700 | CyPCI_Ywin); |
|---|
| 3706 | 3701 | if (addr2 == NULL) { |
|---|
| 3707 | 3702 | dev_err(&pdev->dev, "can't remap base region\n"); |
|---|
| .. | .. |
|---|
| 3717 | 3712 | } else if (device_id == PCI_DEVICE_ID_CYCLOM_Z_Hi) { |
|---|
| 3718 | 3713 | struct RUNTIME_9060 __iomem *ctl_addr; |
|---|
| 3719 | 3714 | |
|---|
| 3720 | | - ctl_addr = addr0 = ioremap_nocache(pci_resource_start(pdev, 0), |
|---|
| 3715 | + ctl_addr = addr0 = ioremap(pci_resource_start(pdev, 0), |
|---|
| 3721 | 3716 | CyPCI_Zctl); |
|---|
| 3722 | 3717 | if (addr0 == NULL) { |
|---|
| 3723 | 3718 | dev_err(&pdev->dev, "can't remap ctl region\n"); |
|---|
| .. | .. |
|---|
| 3732 | 3727 | |
|---|
| 3733 | 3728 | mailbox = readl(&ctl_addr->mail_box_0); |
|---|
| 3734 | 3729 | |
|---|
| 3735 | | - addr2 = ioremap_nocache(pci_resource_start(pdev, 2), |
|---|
| 3730 | + addr2 = ioremap(pci_resource_start(pdev, 2), |
|---|
| 3736 | 3731 | mailbox == ZE_V1 ? CyPCI_Ze_win : CyPCI_Zwin); |
|---|
| 3737 | 3732 | if (addr2 == NULL) { |
|---|
| 3738 | 3733 | dev_err(&pdev->dev, "can't remap base region\n"); |
|---|
| .. | .. |
|---|
| 4011 | 4006 | .tiocmget = cy_tiocmget, |
|---|
| 4012 | 4007 | .tiocmset = cy_tiocmset, |
|---|
| 4013 | 4008 | .get_icount = cy_get_icount, |
|---|
| 4009 | + .set_serial = cy_set_serial_info, |
|---|
| 4010 | + .get_serial = cy_get_serial_info, |
|---|
| 4014 | 4011 | .proc_show = cyclades_proc_show, |
|---|
| 4015 | 4012 | }; |
|---|
| 4016 | 4013 | |
|---|