aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/agp/intel-agp.c3
-rw-r--r--drivers/char/applicom.c1
-rw-r--r--drivers/char/bsr.c2
-rw-r--r--drivers/char/cyclades.c2
-rw-r--r--drivers/char/esp.c2
-rw-r--r--drivers/char/hpet.c22
-rw-r--r--drivers/char/hw_random/timeriomem-rng.c39
-rw-r--r--drivers/char/isicom.c1
-rw-r--r--drivers/char/mem.c27
-rw-r--r--drivers/char/moxa.c9
-rw-r--r--drivers/char/mxser.c1
-rw-r--r--drivers/char/random.c3
-rw-r--r--drivers/char/rio/rio_linux.c2
-rw-r--r--drivers/char/riscom8.c2
-rw-r--r--drivers/char/specialix.c1
-rw-r--r--drivers/char/synclink_gt.c58
-rw-r--r--drivers/char/sysrq.c3
-rw-r--r--drivers/char/tty_audit.c2
-rw-r--r--drivers/char/tty_io.c6
-rw-r--r--drivers/char/tty_ldisc.c1
-rw-r--r--drivers/char/vt.c2
21 files changed, 119 insertions, 70 deletions
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 9d9490e22e07..3686912427ba 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -2131,6 +2131,8 @@ static const struct intel_driver_description {
2131 { PCI_DEVICE_ID_INTEL_82845G_HB, PCI_DEVICE_ID_INTEL_82845G_IG, 0, "830M", 2131 { PCI_DEVICE_ID_INTEL_82845G_HB, PCI_DEVICE_ID_INTEL_82845G_IG, 0, "830M",
2132 &intel_845_driver, &intel_830_driver }, 2132 &intel_845_driver, &intel_830_driver },
2133 { PCI_DEVICE_ID_INTEL_82850_HB, 0, 0, "i850", &intel_850_driver, NULL }, 2133 { PCI_DEVICE_ID_INTEL_82850_HB, 0, 0, "i850", &intel_850_driver, NULL },
2134 { PCI_DEVICE_ID_INTEL_82854_HB, PCI_DEVICE_ID_INTEL_82854_IG, 0, "854",
2135 &intel_845_driver, &intel_830_driver },
2134 { PCI_DEVICE_ID_INTEL_82855PM_HB, 0, 0, "855PM", &intel_845_driver, NULL }, 2136 { PCI_DEVICE_ID_INTEL_82855PM_HB, 0, 0, "855PM", &intel_845_driver, NULL },
2135 { PCI_DEVICE_ID_INTEL_82855GM_HB, PCI_DEVICE_ID_INTEL_82855GM_IG, 0, "855GM", 2137 { PCI_DEVICE_ID_INTEL_82855GM_HB, PCI_DEVICE_ID_INTEL_82855GM_IG, 0, "855GM",
2136 &intel_845_driver, &intel_830_driver }, 2138 &intel_845_driver, &intel_830_driver },
@@ -2355,6 +2357,7 @@ static struct pci_device_id agp_intel_pci_table[] = {
2355 ID(PCI_DEVICE_ID_INTEL_82845_HB), 2357 ID(PCI_DEVICE_ID_INTEL_82845_HB),
2356 ID(PCI_DEVICE_ID_INTEL_82845G_HB), 2358 ID(PCI_DEVICE_ID_INTEL_82845G_HB),
2357 ID(PCI_DEVICE_ID_INTEL_82850_HB), 2359 ID(PCI_DEVICE_ID_INTEL_82850_HB),
2360 ID(PCI_DEVICE_ID_INTEL_82854_HB),
2358 ID(PCI_DEVICE_ID_INTEL_82855PM_HB), 2361 ID(PCI_DEVICE_ID_INTEL_82855PM_HB),
2359 ID(PCI_DEVICE_ID_INTEL_82855GM_HB), 2362 ID(PCI_DEVICE_ID_INTEL_82855GM_HB),
2360 ID(PCI_DEVICE_ID_INTEL_82860_HB), 2363 ID(PCI_DEVICE_ID_INTEL_82860_HB),
diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index 05674febb0c6..73a0765344b6 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -75,6 +75,7 @@ MODULE_DEVICE_TABLE(pci, applicom_pci_tbl);
75MODULE_AUTHOR("David Woodhouse & Applicom International"); 75MODULE_AUTHOR("David Woodhouse & Applicom International");
76MODULE_DESCRIPTION("Driver for Applicom Profibus card"); 76MODULE_DESCRIPTION("Driver for Applicom Profibus card");
77MODULE_LICENSE("GPL"); 77MODULE_LICENSE("GPL");
78MODULE_ALIAS_MISCDEV(AC_MINOR);
78 79
79MODULE_SUPPORTED_DEVICE("ac"); 80MODULE_SUPPORTED_DEVICE("ac");
80 81
diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c
index f6094ae0ef33..140ea10ecb88 100644
--- a/drivers/char/bsr.c
+++ b/drivers/char/bsr.c
@@ -140,7 +140,7 @@ static int bsr_open(struct inode * inode, struct file * filp)
140 return 0; 140 return 0;
141} 141}
142 142
143const static struct file_operations bsr_fops = { 143static const struct file_operations bsr_fops = {
144 .owner = THIS_MODULE, 144 .owner = THIS_MODULE,
145 .mmap = bsr_mmap, 145 .mmap = bsr_mmap,
146 .open = bsr_open, 146 .open = bsr_open,
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index 272db0e2b491..1fdb9f657d8f 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -646,6 +646,7 @@
646#include <linux/spinlock.h> 646#include <linux/spinlock.h>
647#include <linux/bitops.h> 647#include <linux/bitops.h>
648#include <linux/firmware.h> 648#include <linux/firmware.h>
649#include <linux/device.h>
649 650
650#include <asm/system.h> 651#include <asm/system.h>
651#include <linux/io.h> 652#include <linux/io.h>
@@ -5408,3 +5409,4 @@ module_exit(cy_cleanup_module);
5408 5409
5409MODULE_LICENSE("GPL"); 5410MODULE_LICENSE("GPL");
5410MODULE_VERSION(CY_VERSION); 5411MODULE_VERSION(CY_VERSION);
5412MODULE_ALIAS_CHARDEV_MAJOR(CYCLADES_MAJOR);
diff --git a/drivers/char/esp.c b/drivers/char/esp.c
index 45ec263ec012..a5c59fc2b0ff 100644
--- a/drivers/char/esp.c
+++ b/drivers/char/esp.c
@@ -2258,7 +2258,7 @@ static int esp_open(struct tty_struct *tty, struct file *filp)
2258 * driver. 2258 * driver.
2259 */ 2259 */
2260 2260
2261static void show_serial_version(void) 2261static void __init show_serial_version(void)
2262{ 2262{
2263 printk(KERN_INFO "%s version %s (DMA %u)\n", 2263 printk(KERN_INFO "%s version %s (DMA %u)\n",
2264 serial_name, serial_version, dma); 2264 serial_name, serial_version, dma);
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index 32b8bbf5003e..50dfa3bc71ce 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -713,7 +713,7 @@ static struct ctl_table_header *sysctl_header;
713 */ 713 */
714#define TICK_CALIBRATE (1000UL) 714#define TICK_CALIBRATE (1000UL)
715 715
716static unsigned long hpet_calibrate(struct hpets *hpetp) 716static unsigned long __hpet_calibrate(struct hpets *hpetp)
717{ 717{
718 struct hpet_timer __iomem *timer = NULL; 718 struct hpet_timer __iomem *timer = NULL;
719 unsigned long t, m, count, i, flags, start; 719 unsigned long t, m, count, i, flags, start;
@@ -750,6 +750,26 @@ static unsigned long hpet_calibrate(struct hpets *hpetp)
750 return (m - start) / i; 750 return (m - start) / i;
751} 751}
752 752
753static unsigned long hpet_calibrate(struct hpets *hpetp)
754{
755 unsigned long ret = -1;
756 unsigned long tmp;
757
758 /*
759 * Try to calibrate until return value becomes stable small value.
760 * If SMI interruption occurs in calibration loop, the return value
761 * will be big. This avoids its impact.
762 */
763 for ( ; ; ) {
764 tmp = __hpet_calibrate(hpetp);
765 if (ret <= tmp)
766 break;
767 ret = tmp;
768 }
769
770 return ret;
771}
772
753int hpet_alloc(struct hpet_data *hdp) 773int hpet_alloc(struct hpet_data *hdp)
754{ 774{
755 u64 cap, mcfg; 775 u64 cap, mcfg;
diff --git a/drivers/char/hw_random/timeriomem-rng.c b/drivers/char/hw_random/timeriomem-rng.c
index 10ad41be5897..dcd352ad0e7f 100644
--- a/drivers/char/hw_random/timeriomem-rng.c
+++ b/drivers/char/hw_random/timeriomem-rng.c
@@ -90,10 +90,30 @@ static struct hwrng timeriomem_rng_ops = {
90 90
91static int __init timeriomem_rng_probe(struct platform_device *pdev) 91static int __init timeriomem_rng_probe(struct platform_device *pdev)
92{ 92{
93 struct resource *res, *mem;
93 int ret; 94 int ret;
94 95
96 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
97
98 if (!res)
99 return -ENOENT;
100
101 mem = request_mem_region(res->start, res->end - res->start + 1,
102 pdev->name);
103 if (mem == NULL)
104 return -EBUSY;
105
106 dev_set_drvdata(&pdev->dev, mem);
107
95 timeriomem_rng_data = pdev->dev.platform_data; 108 timeriomem_rng_data = pdev->dev.platform_data;
96 109
110 timeriomem_rng_data->address = ioremap(res->start,
111 res->end - res->start + 1);
112 if (!timeriomem_rng_data->address) {
113 ret = -ENOMEM;
114 goto err_ioremap;
115 }
116
97 if (timeriomem_rng_data->period != 0 117 if (timeriomem_rng_data->period != 0
98 && usecs_to_jiffies(timeriomem_rng_data->period) > 0) { 118 && usecs_to_jiffies(timeriomem_rng_data->period) > 0) {
99 timeriomem_rng_timer.expires = jiffies; 119 timeriomem_rng_timer.expires = jiffies;
@@ -104,23 +124,34 @@ static int __init timeriomem_rng_probe(struct platform_device *pdev)
104 timeriomem_rng_data->present = 1; 124 timeriomem_rng_data->present = 1;
105 125
106 ret = hwrng_register(&timeriomem_rng_ops); 126 ret = hwrng_register(&timeriomem_rng_ops);
107 if (ret) { 127 if (ret)
108 dev_err(&pdev->dev, "problem registering\n"); 128 goto err_register;
109 return ret;
110 }
111 129
112 dev_info(&pdev->dev, "32bits from 0x%p @ %dus\n", 130 dev_info(&pdev->dev, "32bits from 0x%p @ %dus\n",
113 timeriomem_rng_data->address, 131 timeriomem_rng_data->address,
114 timeriomem_rng_data->period); 132 timeriomem_rng_data->period);
115 133
116 return 0; 134 return 0;
135
136err_register:
137 dev_err(&pdev->dev, "problem registering\n");
138 iounmap(timeriomem_rng_data->address);
139err_ioremap:
140 release_resource(mem);
141
142 return ret;
117} 143}
118 144
119static int __devexit timeriomem_rng_remove(struct platform_device *pdev) 145static int __devexit timeriomem_rng_remove(struct platform_device *pdev)
120{ 146{
147 struct resource *mem = dev_get_drvdata(&pdev->dev);
148
121 del_timer_sync(&timeriomem_rng_timer); 149 del_timer_sync(&timeriomem_rng_timer);
122 hwrng_unregister(&timeriomem_rng_ops); 150 hwrng_unregister(&timeriomem_rng_ops);
123 151
152 iounmap(timeriomem_rng_data->address);
153 release_resource(mem);
154
124 return 0; 155 return 0;
125} 156}
126 157
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index 24aa6e88e223..a59eac584d16 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -925,6 +925,7 @@ static void isicom_shutdown_port(struct isi_port *port)
925 if (!card->count) 925 if (!card->count)
926 isicom_shutdown_board(card); 926 isicom_shutdown_board(card);
927 } 927 }
928 tty_kref_put(tty);
928} 929}
929 930
930static void isicom_flush_buffer(struct tty_struct *tty) 931static void isicom_flush_buffer(struct tty_struct *tty)
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 3586b3b3df3f..8f05c38c2f06 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -301,33 +301,7 @@ static inline int private_mapping_ok(struct vm_area_struct *vma)
301} 301}
302#endif 302#endif
303 303
304void __attribute__((weak))
305map_devmem(unsigned long pfn, unsigned long len, pgprot_t prot)
306{
307 /* nothing. architectures can override. */
308}
309
310void __attribute__((weak))
311unmap_devmem(unsigned long pfn, unsigned long len, pgprot_t prot)
312{
313 /* nothing. architectures can override. */
314}
315
316static void mmap_mem_open(struct vm_area_struct *vma)
317{
318 map_devmem(vma->vm_pgoff, vma->vm_end - vma->vm_start,
319 vma->vm_page_prot);
320}
321
322static void mmap_mem_close(struct vm_area_struct *vma)
323{
324 unmap_devmem(vma->vm_pgoff, vma->vm_end - vma->vm_start,
325 vma->vm_page_prot);
326}
327
328static struct vm_operations_struct mmap_mem_ops = { 304static struct vm_operations_struct mmap_mem_ops = {
329 .open = mmap_mem_open,
330 .close = mmap_mem_close,
331#ifdef CONFIG_HAVE_IOREMAP_PROT 305#ifdef CONFIG_HAVE_IOREMAP_PROT
332 .access = generic_access_phys 306 .access = generic_access_phys
333#endif 307#endif
@@ -362,7 +336,6 @@ static int mmap_mem(struct file * file, struct vm_area_struct * vma)
362 vma->vm_pgoff, 336 vma->vm_pgoff,
363 size, 337 size,
364 vma->vm_page_prot)) { 338 vma->vm_page_prot)) {
365 unmap_devmem(vma->vm_pgoff, size, vma->vm_page_prot);
366 return -EAGAIN; 339 return -EAGAIN;
367 } 340 }
368 return 0; 341 return 0;
diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
index 8b0da97d5293..4a4cab73d0be 100644
--- a/drivers/char/moxa.c
+++ b/drivers/char/moxa.c
@@ -1486,11 +1486,11 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle,
1486 } 1486 }
1487 1487
1488 if (!handle) /* nothing else to do */ 1488 if (!handle) /* nothing else to do */
1489 return 0; 1489 goto put;
1490 1490
1491 intr = readw(ip); /* port irq status */ 1491 intr = readw(ip); /* port irq status */
1492 if (intr == 0) 1492 if (intr == 0)
1493 return 0; 1493 goto put;
1494 1494
1495 writew(0, ip); /* ACK port */ 1495 writew(0, ip); /* ACK port */
1496 ofsAddr = p->tableAddr; 1496 ofsAddr = p->tableAddr;
@@ -1499,16 +1499,17 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle,
1499 ofsAddr + HostStat); 1499 ofsAddr + HostStat);
1500 1500
1501 if (!inited) 1501 if (!inited)
1502 return 0; 1502 goto put;
1503 1503
1504 if (tty && (intr & IntrBreak) && !I_IGNBRK(tty)) { /* BREAK */ 1504 if (tty && (intr & IntrBreak) && !I_IGNBRK(tty)) { /* BREAK */
1505 tty_insert_flip_char(tty, 0, TTY_BREAK); 1505 tty_insert_flip_char(tty, 0, TTY_BREAK);
1506 tty_schedule_flip(tty); 1506 tty_schedule_flip(tty);
1507 } 1507 }
1508 tty_kref_put(tty);
1509 1508
1510 if (intr & IntrLine) 1509 if (intr & IntrLine)
1511 moxa_new_dcdstate(p, readb(ofsAddr + FlagStat) & DCD_state); 1510 moxa_new_dcdstate(p, readb(ofsAddr + FlagStat) & DCD_state);
1511put:
1512 tty_kref_put(tty);
1512 1513
1513 return 0; 1514 return 0;
1514} 1515}
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index 402c9f217f83..a420e8d437dd 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -820,7 +820,6 @@ static void mxser_check_modem_status(struct tty_struct *tty,
820 wake_up_interruptible(&port->port.open_wait); 820 wake_up_interruptible(&port->port.open_wait);
821 } 821 }
822 822
823 tty = tty_port_tty_get(&port->port);
824 if (port->port.flags & ASYNC_CTS_FLOW) { 823 if (port->port.flags & ASYNC_CTS_FLOW) {
825 if (tty->hw_stopped) { 824 if (tty->hw_stopped) {
826 if (status & UART_MSR_CTS) { 825 if (status & UART_MSR_CTS) {
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 7c43ae782b26..f824ef8a9273 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1488,7 +1488,8 @@ static void rekey_seq_generator(struct work_struct *work)
1488 keyptr->count = (ip_cnt & COUNT_MASK) << HASH_BITS; 1488 keyptr->count = (ip_cnt & COUNT_MASK) << HASH_BITS;
1489 smp_wmb(); 1489 smp_wmb();
1490 ip_cnt++; 1490 ip_cnt++;
1491 schedule_delayed_work(&rekey_work, REKEY_INTERVAL); 1491 schedule_delayed_work(&rekey_work,
1492 round_jiffies_relative(REKEY_INTERVAL));
1492} 1493}
1493 1494
1494static inline struct keydata *get_keyptr(void) 1495static inline struct keydata *get_keyptr(void)
diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c
index 2e8a6eed34be..ce81da5b2da9 100644
--- a/drivers/char/rio/rio_linux.c
+++ b/drivers/char/rio/rio_linux.c
@@ -333,7 +333,7 @@ void rio_copy_to_card(void *from, void __iomem *to, int len)
333 333
334int rio_minor(struct tty_struct *tty) 334int rio_minor(struct tty_struct *tty)
335{ 335{
336 return tty->index + (tty->driver == rio_driver) ? 0 : 256; 336 return tty->index + ((tty->driver == rio_driver) ? 0 : 256);
337} 337}
338 338
339static int rio_set_real_termios(void *ptr) 339static int rio_set_real_termios(void *ptr)
diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
index 9af8d74875bc..217660451237 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -48,6 +48,7 @@
48#include <linux/delay.h> 48#include <linux/delay.h>
49#include <linux/tty_flip.h> 49#include <linux/tty_flip.h>
50#include <linux/spinlock.h> 50#include <linux/spinlock.h>
51#include <linux/device.h>
51 52
52#include <linux/uaccess.h> 53#include <linux/uaccess.h>
53 54
@@ -1524,6 +1525,7 @@ module_param(iobase2, int, 0);
1524module_param(iobase3, int, 0); 1525module_param(iobase3, int, 0);
1525 1526
1526MODULE_LICENSE("GPL"); 1527MODULE_LICENSE("GPL");
1528MODULE_ALIAS_CHARDEV_MAJOR(RISCOM8_NORMAL_MAJOR);
1527#endif /* MODULE */ 1529#endif /* MODULE */
1528 1530
1529/* 1531/*
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
index 3c67c3d83de9..e72be4190a44 100644
--- a/drivers/char/specialix.c
+++ b/drivers/char/specialix.c
@@ -2365,3 +2365,4 @@ module_init(specialix_init_module);
2365module_exit(specialix_exit_module); 2365module_exit(specialix_exit_module);
2366 2366
2367MODULE_LICENSE("GPL"); 2367MODULE_LICENSE("GPL");
2368MODULE_ALIAS_CHARDEV_MAJOR(SPECIALIX_NORMAL_MAJOR);
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c
index 6ec6e13d47d7..5e256494686a 100644
--- a/drivers/char/synclink_gt.c
+++ b/drivers/char/synclink_gt.c
@@ -298,6 +298,7 @@ struct slgt_info {
298 298
299 unsigned int rbuf_fill_level; 299 unsigned int rbuf_fill_level;
300 unsigned int if_mode; 300 unsigned int if_mode;
301 unsigned int base_clock;
301 302
302 /* device status */ 303 /* device status */
303 304
@@ -1156,22 +1157,26 @@ static long set_params32(struct slgt_info *info, struct MGSL_PARAMS32 __user *ne
1156 return -EFAULT; 1157 return -EFAULT;
1157 1158
1158 spin_lock(&info->lock); 1159 spin_lock(&info->lock);
1159 info->params.mode = tmp_params.mode; 1160 if (tmp_params.mode == MGSL_MODE_BASE_CLOCK) {
1160 info->params.loopback = tmp_params.loopback; 1161 info->base_clock = tmp_params.clock_speed;
1161 info->params.flags = tmp_params.flags; 1162 } else {
1162 info->params.encoding = tmp_params.encoding; 1163 info->params.mode = tmp_params.mode;
1163 info->params.clock_speed = tmp_params.clock_speed; 1164 info->params.loopback = tmp_params.loopback;
1164 info->params.addr_filter = tmp_params.addr_filter; 1165 info->params.flags = tmp_params.flags;
1165 info->params.crc_type = tmp_params.crc_type; 1166 info->params.encoding = tmp_params.encoding;
1166 info->params.preamble_length = tmp_params.preamble_length; 1167 info->params.clock_speed = tmp_params.clock_speed;
1167 info->params.preamble = tmp_params.preamble; 1168 info->params.addr_filter = tmp_params.addr_filter;
1168 info->params.data_rate = tmp_params.data_rate; 1169 info->params.crc_type = tmp_params.crc_type;
1169 info->params.data_bits = tmp_params.data_bits; 1170 info->params.preamble_length = tmp_params.preamble_length;
1170 info->params.stop_bits = tmp_params.stop_bits; 1171 info->params.preamble = tmp_params.preamble;
1171 info->params.parity = tmp_params.parity; 1172 info->params.data_rate = tmp_params.data_rate;
1173 info->params.data_bits = tmp_params.data_bits;
1174 info->params.stop_bits = tmp_params.stop_bits;
1175 info->params.parity = tmp_params.parity;
1176 }
1172 spin_unlock(&info->lock); 1177 spin_unlock(&info->lock);
1173 1178
1174 change_params(info); 1179 program_hw(info);
1175 1180
1176 return 0; 1181 return 0;
1177} 1182}
@@ -2559,10 +2564,13 @@ static int set_params(struct slgt_info *info, MGSL_PARAMS __user *new_params)
2559 return -EFAULT; 2564 return -EFAULT;
2560 2565
2561 spin_lock_irqsave(&info->lock, flags); 2566 spin_lock_irqsave(&info->lock, flags);
2562 memcpy(&info->params, &tmp_params, sizeof(MGSL_PARAMS)); 2567 if (tmp_params.mode == MGSL_MODE_BASE_CLOCK)
2568 info->base_clock = tmp_params.clock_speed;
2569 else
2570 memcpy(&info->params, &tmp_params, sizeof(MGSL_PARAMS));
2563 spin_unlock_irqrestore(&info->lock, flags); 2571 spin_unlock_irqrestore(&info->lock, flags);
2564 2572
2565 change_params(info); 2573 program_hw(info);
2566 2574
2567 return 0; 2575 return 0;
2568} 2576}
@@ -3432,6 +3440,7 @@ static struct slgt_info *alloc_dev(int adapter_num, int port_num, struct pci_dev
3432 info->magic = MGSL_MAGIC; 3440 info->magic = MGSL_MAGIC;
3433 INIT_WORK(&info->task, bh_handler); 3441 INIT_WORK(&info->task, bh_handler);
3434 info->max_frame_size = 4096; 3442 info->max_frame_size = 4096;
3443 info->base_clock = 14745600;
3435 info->rbuf_fill_level = DMABUFSIZE; 3444 info->rbuf_fill_level = DMABUFSIZE;
3436 info->port.close_delay = 5*HZ/10; 3445 info->port.close_delay = 5*HZ/10;
3437 info->port.closing_wait = 30*HZ; 3446 info->port.closing_wait = 30*HZ;
@@ -3779,7 +3788,7 @@ static void enable_loopback(struct slgt_info *info)
3779static void set_rate(struct slgt_info *info, u32 rate) 3788static void set_rate(struct slgt_info *info, u32 rate)
3780{ 3789{
3781 unsigned int div; 3790 unsigned int div;
3782 static unsigned int osc = 14745600; 3791 unsigned int osc = info->base_clock;
3783 3792
3784 /* div = osc/rate - 1 3793 /* div = osc/rate - 1
3785 * 3794 *
@@ -4083,18 +4092,27 @@ static void async_mode(struct slgt_info *info)
4083 * 06 CTS IRQ enable 4092 * 06 CTS IRQ enable
4084 * 05 DCD IRQ enable 4093 * 05 DCD IRQ enable
4085 * 04 RI IRQ enable 4094 * 04 RI IRQ enable
4086 * 03 reserved, must be zero 4095 * 03 0=16x sampling, 1=8x sampling
4087 * 02 1=txd->rxd internal loopback enable 4096 * 02 1=txd->rxd internal loopback enable
4088 * 01 reserved, must be zero 4097 * 01 reserved, must be zero
4089 * 00 1=master IRQ enable 4098 * 00 1=master IRQ enable
4090 */ 4099 */
4091 val = BIT15 + BIT14 + BIT0; 4100 val = BIT15 + BIT14 + BIT0;
4101 /* JCR[8] : 1 = x8 async mode feature available */
4102 if ((rd_reg32(info, JCR) & BIT8) && info->params.data_rate &&
4103 ((info->base_clock < (info->params.data_rate * 16)) ||
4104 (info->base_clock % (info->params.data_rate * 16)))) {
4105 /* use 8x sampling */
4106 val |= BIT3;
4107 set_rate(info, info->params.data_rate * 8);
4108 } else {
4109 /* use 16x sampling */
4110 set_rate(info, info->params.data_rate * 16);
4111 }
4092 wr_reg16(info, SCR, val); 4112 wr_reg16(info, SCR, val);
4093 4113
4094 slgt_irq_on(info, IRQ_RXBREAK | IRQ_RXOVER); 4114 slgt_irq_on(info, IRQ_RXBREAK | IRQ_RXOVER);
4095 4115
4096 set_rate(info, info->params.data_rate * 16);
4097
4098 if (info->params.loopback) 4116 if (info->params.loopback)
4099 enable_loopback(info); 4117 enable_loopback(info);
4100} 4118}
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c
index ebea9b2c30a5..b0a6a3e51924 100644
--- a/drivers/char/sysrq.c
+++ b/drivers/char/sysrq.c
@@ -35,7 +35,6 @@
35#include <linux/vt_kern.h> 35#include <linux/vt_kern.h>
36#include <linux/workqueue.h> 36#include <linux/workqueue.h>
37#include <linux/kexec.h> 37#include <linux/kexec.h>
38#include <linux/interrupt.h>
39#include <linux/hrtimer.h> 38#include <linux/hrtimer.h>
40#include <linux/oom.h> 39#include <linux/oom.h>
41 40
@@ -283,7 +282,7 @@ static void sysrq_ftrace_dump(int key, struct tty_struct *tty)
283} 282}
284static struct sysrq_key_op sysrq_ftrace_dump_op = { 283static struct sysrq_key_op sysrq_ftrace_dump_op = {
285 .handler = sysrq_ftrace_dump, 284 .handler = sysrq_ftrace_dump,
286 .help_msg = "dumpZ-ftrace-buffer", 285 .help_msg = "dump-ftrace-buffer(Z)",
287 .action_msg = "Dump ftrace buffer", 286 .action_msg = "Dump ftrace buffer",
288 .enable_mask = SYSRQ_ENABLE_DUMP, 287 .enable_mask = SYSRQ_ENABLE_DUMP,
289}; 288};
diff --git a/drivers/char/tty_audit.c b/drivers/char/tty_audit.c
index 34ab6d798f81..55ba6f142883 100644
--- a/drivers/char/tty_audit.c
+++ b/drivers/char/tty_audit.c
@@ -10,8 +10,6 @@
10 */ 10 */
11 11
12#include <linux/audit.h> 12#include <linux/audit.h>
13#include <linux/file.h>
14#include <linux/fdtable.h>
15#include <linux/tty.h> 13#include <linux/tty.h>
16 14
17struct tty_audit_buf { 15struct tty_audit_buf {
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 33dac94922a7..66b99a2049e3 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -1758,7 +1758,7 @@ static int __tty_open(struct inode *inode, struct file *filp)
1758 struct tty_driver *driver; 1758 struct tty_driver *driver;
1759 int index; 1759 int index;
1760 dev_t device = inode->i_rdev; 1760 dev_t device = inode->i_rdev;
1761 unsigned short saved_flags = filp->f_flags; 1761 unsigned saved_flags = filp->f_flags;
1762 1762
1763 nonseekable_open(inode, filp); 1763 nonseekable_open(inode, filp);
1764 1764
@@ -2681,7 +2681,7 @@ void __do_SAK(struct tty_struct *tty)
2681 /* Kill the entire session */ 2681 /* Kill the entire session */
2682 do_each_pid_task(session, PIDTYPE_SID, p) { 2682 do_each_pid_task(session, PIDTYPE_SID, p) {
2683 printk(KERN_NOTICE "SAK: killed process %d" 2683 printk(KERN_NOTICE "SAK: killed process %d"
2684 " (%s): task_session_nr(p)==tty->session\n", 2684 " (%s): task_session(p)==tty->session\n",
2685 task_pid_nr(p), p->comm); 2685 task_pid_nr(p), p->comm);
2686 send_sig(SIGKILL, p, 1); 2686 send_sig(SIGKILL, p, 1);
2687 } while_each_pid_task(session, PIDTYPE_SID, p); 2687 } while_each_pid_task(session, PIDTYPE_SID, p);
@@ -2691,7 +2691,7 @@ void __do_SAK(struct tty_struct *tty)
2691 do_each_thread(g, p) { 2691 do_each_thread(g, p) {
2692 if (p->signal->tty == tty) { 2692 if (p->signal->tty == tty) {
2693 printk(KERN_NOTICE "SAK: killed process %d" 2693 printk(KERN_NOTICE "SAK: killed process %d"
2694 " (%s): task_session_nr(p)==tty->session\n", 2694 " (%s): task_session(p)==tty->session\n",
2695 task_pid_nr(p), p->comm); 2695 task_pid_nr(p), p->comm);
2696 send_sig(SIGKILL, p, 1); 2696 send_sig(SIGKILL, p, 1);
2697 continue; 2697 continue;
diff --git a/drivers/char/tty_ldisc.c b/drivers/char/tty_ldisc.c
index 7a84b406a952..f78f5b0127a8 100644
--- a/drivers/char/tty_ldisc.c
+++ b/drivers/char/tty_ldisc.c
@@ -10,7 +10,6 @@
10#include <linux/tty_flip.h> 10#include <linux/tty_flip.h>
11#include <linux/devpts_fs.h> 11#include <linux/devpts_fs.h>
12#include <linux/file.h> 12#include <linux/file.h>
13#include <linux/fdtable.h>
14#include <linux/console.h> 13#include <linux/console.h>
15#include <linux/timer.h> 14#include <linux/timer.h>
16#include <linux/ctype.h> 15#include <linux/ctype.h>
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 2c1d133819b5..08151d4de489 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2274,7 +2274,7 @@ rescan_last_byte:
2274 continue; /* nothing to display */ 2274 continue; /* nothing to display */
2275 } 2275 }
2276 /* Glyph not found */ 2276 /* Glyph not found */
2277 if ((!(vc->vc_utf && !vc->vc_disp_ctrl) && c < 128) && !(c & ~charmask)) { 2277 if ((!(vc->vc_utf && !vc->vc_disp_ctrl) || c < 128) && !(c & ~charmask)) {
2278 /* In legacy mode use the glyph we get by a 1:1 mapping. 2278 /* In legacy mode use the glyph we get by a 1:1 mapping.
2279 This would make absolutely no sense with Unicode in mind, 2279 This would make absolutely no sense with Unicode in mind,
2280 but do this for ASCII characters since a font may lack 2280 but do this for ASCII characters since a font may lack