diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/applicom.c | 1 | ||||
-rw-r--r-- | drivers/char/hvc_console.c | 1 | ||||
-rw-r--r-- | drivers/char/ip2/Makefile | 2 | ||||
-rw-r--r-- | drivers/char/ipmi/Makefile | 2 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_devintf.c | 4 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 4 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 14 | ||||
-rw-r--r-- | drivers/char/mmtimer.c | 60 | ||||
-rw-r--r-- | drivers/char/mwave/Makefile | 4 | ||||
-rw-r--r-- | drivers/char/mxser.c | 4 | ||||
-rw-r--r-- | drivers/char/pcmcia/ipwireless/Makefile | 2 | ||||
-rw-r--r-- | drivers/char/ppdev.c | 1 | ||||
-rw-r--r-- | drivers/char/ramoops.c | 30 | ||||
-rw-r--r-- | drivers/char/rio/Makefile | 2 | ||||
-rw-r--r-- | drivers/char/rocket.c | 5 | ||||
-rw-r--r-- | drivers/char/synclink_gt.c | 142 | ||||
-rw-r--r-- | drivers/char/vt_ioctl.c | 11 |
17 files changed, 219 insertions, 70 deletions
diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c index e7ba774beda6..25373df1dcf8 100644 --- a/drivers/char/applicom.c +++ b/drivers/char/applicom.c | |||
@@ -566,6 +566,7 @@ static ssize_t ac_read (struct file *filp, char __user *buf, size_t count, loff_ | |||
566 | struct mailbox mailbox; | 566 | struct mailbox mailbox; |
567 | 567 | ||
568 | /* Got a packet for us */ | 568 | /* Got a packet for us */ |
569 | memset(&st_loc, 0, sizeof(st_loc)); | ||
569 | ret = do_ac_read(i, buf, &st_loc, &mailbox); | 570 | ret = do_ac_read(i, buf, &st_loc, &mailbox); |
570 | spin_unlock_irqrestore(&apbs[i].mutex, flags); | 571 | spin_unlock_irqrestore(&apbs[i].mutex, flags); |
571 | set_current_state(TASK_RUNNING); | 572 | set_current_state(TASK_RUNNING); |
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c index 3afd62e856eb..e9cba13ee800 100644 --- a/drivers/char/hvc_console.c +++ b/drivers/char/hvc_console.c | |||
@@ -713,7 +713,6 @@ static int khvcd(void *unused) | |||
713 | struct hvc_struct *hp; | 713 | struct hvc_struct *hp; |
714 | 714 | ||
715 | set_freezable(); | 715 | set_freezable(); |
716 | __set_current_state(TASK_RUNNING); | ||
717 | do { | 716 | do { |
718 | poll_mask = 0; | 717 | poll_mask = 0; |
719 | hvc_kicked = 0; | 718 | hvc_kicked = 0; |
diff --git a/drivers/char/ip2/Makefile b/drivers/char/ip2/Makefile index bc397d92b499..7b78e0dfc5b0 100644 --- a/drivers/char/ip2/Makefile +++ b/drivers/char/ip2/Makefile | |||
@@ -4,5 +4,5 @@ | |||
4 | 4 | ||
5 | obj-$(CONFIG_COMPUTONE) += ip2.o | 5 | obj-$(CONFIG_COMPUTONE) += ip2.o |
6 | 6 | ||
7 | ip2-objs := ip2main.o | 7 | ip2-y := ip2main.o |
8 | 8 | ||
diff --git a/drivers/char/ipmi/Makefile b/drivers/char/ipmi/Makefile index eb8a1a8c188e..16a93648d54e 100644 --- a/drivers/char/ipmi/Makefile +++ b/drivers/char/ipmi/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | # Makefile for the ipmi drivers. | 2 | # Makefile for the ipmi drivers. |
3 | # | 3 | # |
4 | 4 | ||
5 | ipmi_si-objs := ipmi_si_intf.o ipmi_kcs_sm.o ipmi_smic_sm.o ipmi_bt_sm.o | 5 | ipmi_si-y := ipmi_si_intf.o ipmi_kcs_sm.o ipmi_smic_sm.o ipmi_bt_sm.o |
6 | 6 | ||
7 | obj-$(CONFIG_IPMI_HANDLER) += ipmi_msghandler.o | 7 | obj-$(CONFIG_IPMI_HANDLER) += ipmi_msghandler.o |
8 | obj-$(CONFIG_IPMI_DEVICE_INTERFACE) += ipmi_devintf.o | 8 | obj-$(CONFIG_IPMI_DEVICE_INTERFACE) += ipmi_devintf.o |
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c index 1fc8876af1f5..2aa3977aae5e 100644 --- a/drivers/char/ipmi/ipmi_devintf.c +++ b/drivers/char/ipmi/ipmi_devintf.c | |||
@@ -916,7 +916,7 @@ static struct ipmi_smi_watcher smi_watcher = | |||
916 | .smi_gone = ipmi_smi_gone, | 916 | .smi_gone = ipmi_smi_gone, |
917 | }; | 917 | }; |
918 | 918 | ||
919 | static __init int init_ipmi_devintf(void) | 919 | static int __init init_ipmi_devintf(void) |
920 | { | 920 | { |
921 | int rv; | 921 | int rv; |
922 | 922 | ||
@@ -954,7 +954,7 @@ static __init int init_ipmi_devintf(void) | |||
954 | } | 954 | } |
955 | module_init(init_ipmi_devintf); | 955 | module_init(init_ipmi_devintf); |
956 | 956 | ||
957 | static __exit void cleanup_ipmi(void) | 957 | static void __exit cleanup_ipmi(void) |
958 | { | 958 | { |
959 | struct ipmi_reg_list *entry, *entry2; | 959 | struct ipmi_reg_list *entry, *entry2; |
960 | mutex_lock(®_list_mutex); | 960 | mutex_lock(®_list_mutex); |
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 4f3f8c9ec262..2fe72f8edf44 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -4442,13 +4442,13 @@ static int ipmi_init_msghandler(void) | |||
4442 | return 0; | 4442 | return 0; |
4443 | } | 4443 | } |
4444 | 4444 | ||
4445 | static __init int ipmi_init_msghandler_mod(void) | 4445 | static int __init ipmi_init_msghandler_mod(void) |
4446 | { | 4446 | { |
4447 | ipmi_init_msghandler(); | 4447 | ipmi_init_msghandler(); |
4448 | return 0; | 4448 | return 0; |
4449 | } | 4449 | } |
4450 | 4450 | ||
4451 | static __exit void cleanup_ipmi(void) | 4451 | static void __exit cleanup_ipmi(void) |
4452 | { | 4452 | { |
4453 | int count; | 4453 | int count; |
4454 | 4454 | ||
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index b293d57d30a7..035da9e64a17 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -1846,7 +1846,7 @@ static int hotmod_handler(const char *val, struct kernel_param *kp) | |||
1846 | return rv; | 1846 | return rv; |
1847 | } | 1847 | } |
1848 | 1848 | ||
1849 | static __devinit void hardcode_find_bmc(void) | 1849 | static void __devinit hardcode_find_bmc(void) |
1850 | { | 1850 | { |
1851 | int i; | 1851 | int i; |
1852 | struct smi_info *info; | 1852 | struct smi_info *info; |
@@ -2029,7 +2029,7 @@ struct SPMITable { | |||
2029 | s8 spmi_id[1]; /* A '\0' terminated array starts here. */ | 2029 | s8 spmi_id[1]; /* A '\0' terminated array starts here. */ |
2030 | }; | 2030 | }; |
2031 | 2031 | ||
2032 | static __devinit int try_init_spmi(struct SPMITable *spmi) | 2032 | static int __devinit try_init_spmi(struct SPMITable *spmi) |
2033 | { | 2033 | { |
2034 | struct smi_info *info; | 2034 | struct smi_info *info; |
2035 | 2035 | ||
@@ -2112,7 +2112,7 @@ static __devinit int try_init_spmi(struct SPMITable *spmi) | |||
2112 | return 0; | 2112 | return 0; |
2113 | } | 2113 | } |
2114 | 2114 | ||
2115 | static __devinit void spmi_find_bmc(void) | 2115 | static void __devinit spmi_find_bmc(void) |
2116 | { | 2116 | { |
2117 | acpi_status status; | 2117 | acpi_status status; |
2118 | struct SPMITable *spmi; | 2118 | struct SPMITable *spmi; |
@@ -2325,7 +2325,7 @@ static int __devinit decode_dmi(const struct dmi_header *dm, | |||
2325 | return 0; | 2325 | return 0; |
2326 | } | 2326 | } |
2327 | 2327 | ||
2328 | static __devinit void try_init_dmi(struct dmi_ipmi_data *ipmi_data) | 2328 | static void __devinit try_init_dmi(struct dmi_ipmi_data *ipmi_data) |
2329 | { | 2329 | { |
2330 | struct smi_info *info; | 2330 | struct smi_info *info; |
2331 | 2331 | ||
@@ -3012,7 +3012,7 @@ static __devinitdata struct ipmi_default_vals | |||
3012 | { .port = 0 } | 3012 | { .port = 0 } |
3013 | }; | 3013 | }; |
3014 | 3014 | ||
3015 | static __devinit void default_find_bmc(void) | 3015 | static void __devinit default_find_bmc(void) |
3016 | { | 3016 | { |
3017 | struct smi_info *info; | 3017 | struct smi_info *info; |
3018 | int i; | 3018 | int i; |
@@ -3312,7 +3312,7 @@ static int try_smi_init(struct smi_info *new_smi) | |||
3312 | return rv; | 3312 | return rv; |
3313 | } | 3313 | } |
3314 | 3314 | ||
3315 | static __devinit int init_ipmi_si(void) | 3315 | static int __devinit init_ipmi_si(void) |
3316 | { | 3316 | { |
3317 | int i; | 3317 | int i; |
3318 | char *str; | 3318 | char *str; |
@@ -3525,7 +3525,7 @@ static void cleanup_one_si(struct smi_info *to_clean) | |||
3525 | kfree(to_clean); | 3525 | kfree(to_clean); |
3526 | } | 3526 | } |
3527 | 3527 | ||
3528 | static __exit void cleanup_ipmi_si(void) | 3528 | static void __exit cleanup_ipmi_si(void) |
3529 | { | 3529 | { |
3530 | struct smi_info *e, *tmp_e; | 3530 | struct smi_info *e, *tmp_e; |
3531 | 3531 | ||
diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c index c070b53984e4..e6d75627c6c8 100644 --- a/drivers/char/mmtimer.c +++ b/drivers/char/mmtimer.c | |||
@@ -176,9 +176,9 @@ static void mmtimer_setup_int_2(int cpu, u64 expires) | |||
176 | * in order to insure that the setup succeeds in a deterministic time frame. | 176 | * in order to insure that the setup succeeds in a deterministic time frame. |
177 | * It will check if the interrupt setup succeeded. | 177 | * It will check if the interrupt setup succeeded. |
178 | */ | 178 | */ |
179 | static int mmtimer_setup(int cpu, int comparator, unsigned long expires) | 179 | static int mmtimer_setup(int cpu, int comparator, unsigned long expires, |
180 | u64 *set_completion_time) | ||
180 | { | 181 | { |
181 | |||
182 | switch (comparator) { | 182 | switch (comparator) { |
183 | case 0: | 183 | case 0: |
184 | mmtimer_setup_int_0(cpu, expires); | 184 | mmtimer_setup_int_0(cpu, expires); |
@@ -191,7 +191,8 @@ static int mmtimer_setup(int cpu, int comparator, unsigned long expires) | |||
191 | break; | 191 | break; |
192 | } | 192 | } |
193 | /* We might've missed our expiration time */ | 193 | /* We might've missed our expiration time */ |
194 | if (rtc_time() <= expires) | 194 | *set_completion_time = rtc_time(); |
195 | if (*set_completion_time <= expires) | ||
195 | return 1; | 196 | return 1; |
196 | 197 | ||
197 | /* | 198 | /* |
@@ -227,6 +228,8 @@ static int mmtimer_disable_int(long nasid, int comparator) | |||
227 | #define TIMER_OFF 0xbadcabLL /* Timer is not setup */ | 228 | #define TIMER_OFF 0xbadcabLL /* Timer is not setup */ |
228 | #define TIMER_SET 0 /* Comparator is set for this timer */ | 229 | #define TIMER_SET 0 /* Comparator is set for this timer */ |
229 | 230 | ||
231 | #define MMTIMER_INTERVAL_RETRY_INCREMENT_DEFAULT 40 | ||
232 | |||
230 | /* There is one of these for each timer */ | 233 | /* There is one of these for each timer */ |
231 | struct mmtimer { | 234 | struct mmtimer { |
232 | struct rb_node list; | 235 | struct rb_node list; |
@@ -242,6 +245,11 @@ struct mmtimer_node { | |||
242 | }; | 245 | }; |
243 | static struct mmtimer_node *timers; | 246 | static struct mmtimer_node *timers; |
244 | 247 | ||
248 | static unsigned mmtimer_interval_retry_increment = | ||
249 | MMTIMER_INTERVAL_RETRY_INCREMENT_DEFAULT; | ||
250 | module_param(mmtimer_interval_retry_increment, uint, 0644); | ||
251 | MODULE_PARM_DESC(mmtimer_interval_retry_increment, | ||
252 | "RTC ticks to add to expiration on interval retry (default 40)"); | ||
245 | 253 | ||
246 | /* | 254 | /* |
247 | * Add a new mmtimer struct to the node's mmtimer list. | 255 | * Add a new mmtimer struct to the node's mmtimer list. |
@@ -289,7 +297,8 @@ static void mmtimer_set_next_timer(int nodeid) | |||
289 | struct mmtimer_node *n = &timers[nodeid]; | 297 | struct mmtimer_node *n = &timers[nodeid]; |
290 | struct mmtimer *x; | 298 | struct mmtimer *x; |
291 | struct k_itimer *t; | 299 | struct k_itimer *t; |
292 | int o; | 300 | u64 expires, exp, set_completion_time; |
301 | int i; | ||
293 | 302 | ||
294 | restart: | 303 | restart: |
295 | if (n->next == NULL) | 304 | if (n->next == NULL) |
@@ -300,7 +309,8 @@ restart: | |||
300 | if (!t->it.mmtimer.incr) { | 309 | if (!t->it.mmtimer.incr) { |
301 | /* Not an interval timer */ | 310 | /* Not an interval timer */ |
302 | if (!mmtimer_setup(x->cpu, COMPARATOR, | 311 | if (!mmtimer_setup(x->cpu, COMPARATOR, |
303 | t->it.mmtimer.expires)) { | 312 | t->it.mmtimer.expires, |
313 | &set_completion_time)) { | ||
304 | /* Late setup, fire now */ | 314 | /* Late setup, fire now */ |
305 | tasklet_schedule(&n->tasklet); | 315 | tasklet_schedule(&n->tasklet); |
306 | } | 316 | } |
@@ -308,14 +318,23 @@ restart: | |||
308 | } | 318 | } |
309 | 319 | ||
310 | /* Interval timer */ | 320 | /* Interval timer */ |
311 | o = 0; | 321 | i = 0; |
312 | while (!mmtimer_setup(x->cpu, COMPARATOR, t->it.mmtimer.expires)) { | 322 | expires = exp = t->it.mmtimer.expires; |
313 | unsigned long e, e1; | 323 | while (!mmtimer_setup(x->cpu, COMPARATOR, expires, |
314 | struct rb_node *next; | 324 | &set_completion_time)) { |
315 | t->it.mmtimer.expires += t->it.mmtimer.incr << o; | 325 | int to; |
316 | t->it_overrun += 1 << o; | 326 | |
317 | o++; | 327 | i++; |
318 | if (o > 20) { | 328 | expires = set_completion_time + |
329 | mmtimer_interval_retry_increment + (1 << i); | ||
330 | /* Calculate overruns as we go. */ | ||
331 | to = ((u64)(expires - exp) / t->it.mmtimer.incr); | ||
332 | if (to) { | ||
333 | t->it_overrun += to; | ||
334 | t->it.mmtimer.expires += t->it.mmtimer.incr * to; | ||
335 | exp = t->it.mmtimer.expires; | ||
336 | } | ||
337 | if (i > 20) { | ||
319 | printk(KERN_ALERT "mmtimer: cannot reschedule timer\n"); | 338 | printk(KERN_ALERT "mmtimer: cannot reschedule timer\n"); |
320 | t->it.mmtimer.clock = TIMER_OFF; | 339 | t->it.mmtimer.clock = TIMER_OFF; |
321 | n->next = rb_next(&x->list); | 340 | n->next = rb_next(&x->list); |
@@ -323,21 +342,6 @@ restart: | |||
323 | kfree(x); | 342 | kfree(x); |
324 | goto restart; | 343 | goto restart; |
325 | } | 344 | } |
326 | |||
327 | e = t->it.mmtimer.expires; | ||
328 | next = rb_next(&x->list); | ||
329 | |||
330 | if (next == NULL) | ||
331 | continue; | ||
332 | |||
333 | e1 = rb_entry(next, struct mmtimer, list)-> | ||
334 | timer->it.mmtimer.expires; | ||
335 | if (e > e1) { | ||
336 | n->next = next; | ||
337 | rb_erase(&x->list, &n->timer_head); | ||
338 | mmtimer_add_list(x); | ||
339 | goto restart; | ||
340 | } | ||
341 | } | 345 | } |
342 | } | 346 | } |
343 | 347 | ||
diff --git a/drivers/char/mwave/Makefile b/drivers/char/mwave/Makefile index 754c9e2058ed..26b4fce217b6 100644 --- a/drivers/char/mwave/Makefile +++ b/drivers/char/mwave/Makefile | |||
@@ -6,10 +6,10 @@ | |||
6 | 6 | ||
7 | obj-$(CONFIG_MWAVE) += mwave.o | 7 | obj-$(CONFIG_MWAVE) += mwave.o |
8 | 8 | ||
9 | mwave-objs := mwavedd.o smapi.o tp3780i.o 3780i.o | 9 | mwave-y := mwavedd.o smapi.o tp3780i.o 3780i.o |
10 | 10 | ||
11 | # To have the mwave driver disable other uarts if necessary | 11 | # To have the mwave driver disable other uarts if necessary |
12 | # EXTRA_CFLAGS += -DMWAVE_FUTZ_WITH_OTHER_DEVICES | 12 | # EXTRA_CFLAGS += -DMWAVE_FUTZ_WITH_OTHER_DEVICES |
13 | 13 | ||
14 | # To compile in lots (~20 KiB) of run-time enablable printk()s for debugging: | 14 | # To compile in lots (~20 KiB) of run-time enablable printk()s for debugging: |
15 | EXTRA_CFLAGS += -DMW_TRACE | 15 | ccflags-y := -DMW_TRACE |
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index 463df27494bd..dd9d75351cd6 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c | |||
@@ -303,6 +303,7 @@ static void mxser_enable_must_enchance_mode(unsigned long baseio) | |||
303 | outb(oldlcr, baseio + UART_LCR); | 303 | outb(oldlcr, baseio + UART_LCR); |
304 | } | 304 | } |
305 | 305 | ||
306 | #ifdef CONFIG_PCI | ||
306 | static void mxser_disable_must_enchance_mode(unsigned long baseio) | 307 | static void mxser_disable_must_enchance_mode(unsigned long baseio) |
307 | { | 308 | { |
308 | u8 oldlcr; | 309 | u8 oldlcr; |
@@ -317,6 +318,7 @@ static void mxser_disable_must_enchance_mode(unsigned long baseio) | |||
317 | outb(efr, baseio + MOXA_MUST_EFR_REGISTER); | 318 | outb(efr, baseio + MOXA_MUST_EFR_REGISTER); |
318 | outb(oldlcr, baseio + UART_LCR); | 319 | outb(oldlcr, baseio + UART_LCR); |
319 | } | 320 | } |
321 | #endif | ||
320 | 322 | ||
321 | static void mxser_set_must_xon1_value(unsigned long baseio, u8 value) | 323 | static void mxser_set_must_xon1_value(unsigned long baseio, u8 value) |
322 | { | 324 | { |
@@ -388,6 +390,7 @@ static void mxser_set_must_enum_value(unsigned long baseio, u8 value) | |||
388 | outb(oldlcr, baseio + UART_LCR); | 390 | outb(oldlcr, baseio + UART_LCR); |
389 | } | 391 | } |
390 | 392 | ||
393 | #ifdef CONFIG_PCI | ||
391 | static void mxser_get_must_hardware_id(unsigned long baseio, u8 *pId) | 394 | static void mxser_get_must_hardware_id(unsigned long baseio, u8 *pId) |
392 | { | 395 | { |
393 | u8 oldlcr; | 396 | u8 oldlcr; |
@@ -404,6 +407,7 @@ static void mxser_get_must_hardware_id(unsigned long baseio, u8 *pId) | |||
404 | *pId = inb(baseio + MOXA_MUST_HWID_REGISTER); | 407 | *pId = inb(baseio + MOXA_MUST_HWID_REGISTER); |
405 | outb(oldlcr, baseio + UART_LCR); | 408 | outb(oldlcr, baseio + UART_LCR); |
406 | } | 409 | } |
410 | #endif | ||
407 | 411 | ||
408 | static void SET_MOXA_MUST_NO_SOFTWARE_FLOW_CONTROL(unsigned long baseio) | 412 | static void SET_MOXA_MUST_NO_SOFTWARE_FLOW_CONTROL(unsigned long baseio) |
409 | { | 413 | { |
diff --git a/drivers/char/pcmcia/ipwireless/Makefile b/drivers/char/pcmcia/ipwireless/Makefile index b71eb593643d..db80873d7f20 100644 --- a/drivers/char/pcmcia/ipwireless/Makefile +++ b/drivers/char/pcmcia/ipwireless/Makefile | |||
@@ -6,5 +6,5 @@ | |||
6 | 6 | ||
7 | obj-$(CONFIG_IPWIRELESS) += ipwireless.o | 7 | obj-$(CONFIG_IPWIRELESS) += ipwireless.o |
8 | 8 | ||
9 | ipwireless-objs := hardware.o main.o network.o tty.o | 9 | ipwireless-y := hardware.o main.o network.o tty.o |
10 | 10 | ||
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index 723152d978a9..f176dbaeb15a 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c | |||
@@ -613,6 +613,7 @@ static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
613 | 613 | ||
614 | case PPGETTIME: | 614 | case PPGETTIME: |
615 | to_jiffies = pp->pdev->timeout; | 615 | to_jiffies = pp->pdev->timeout; |
616 | memset(&par_timeout, 0, sizeof(par_timeout)); | ||
616 | par_timeout.tv_sec = to_jiffies / HZ; | 617 | par_timeout.tv_sec = to_jiffies / HZ; |
617 | par_timeout.tv_usec = (to_jiffies % (long)HZ) * (1000000/HZ); | 618 | par_timeout.tv_usec = (to_jiffies % (long)HZ) * (1000000/HZ); |
618 | if (copy_to_user (argp, &par_timeout, sizeof(struct timeval))) | 619 | if (copy_to_user (argp, &par_timeout, sizeof(struct timeval))) |
diff --git a/drivers/char/ramoops.c b/drivers/char/ramoops.c index 74f00b5ffa36..73dcb0ee41fd 100644 --- a/drivers/char/ramoops.c +++ b/drivers/char/ramoops.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #include <linux/time.h> | 25 | #include <linux/time.h> |
26 | #include <linux/io.h> | 26 | #include <linux/io.h> |
27 | #include <linux/ioport.h> | 27 | #include <linux/ioport.h> |
28 | #include <linux/platform_device.h> | ||
29 | #include <linux/ramoops.h> | ||
28 | 30 | ||
29 | #define RAMOOPS_KERNMSG_HDR "====" | 31 | #define RAMOOPS_KERNMSG_HDR "====" |
30 | #define RAMOOPS_HEADER_SIZE (5 + sizeof(struct timeval)) | 32 | #define RAMOOPS_HEADER_SIZE (5 + sizeof(struct timeval)) |
@@ -91,11 +93,17 @@ static void ramoops_do_dump(struct kmsg_dumper *dumper, | |||
91 | cxt->count = (cxt->count + 1) % cxt->max_count; | 93 | cxt->count = (cxt->count + 1) % cxt->max_count; |
92 | } | 94 | } |
93 | 95 | ||
94 | static int __init ramoops_init(void) | 96 | static int __init ramoops_probe(struct platform_device *pdev) |
95 | { | 97 | { |
98 | struct ramoops_platform_data *pdata = pdev->dev.platform_data; | ||
96 | struct ramoops_context *cxt = &oops_cxt; | 99 | struct ramoops_context *cxt = &oops_cxt; |
97 | int err = -EINVAL; | 100 | int err = -EINVAL; |
98 | 101 | ||
102 | if (pdata) { | ||
103 | mem_size = pdata->mem_size; | ||
104 | mem_address = pdata->mem_address; | ||
105 | } | ||
106 | |||
99 | if (!mem_size) { | 107 | if (!mem_size) { |
100 | printk(KERN_ERR "ramoops: invalid size specification"); | 108 | printk(KERN_ERR "ramoops: invalid size specification"); |
101 | goto fail3; | 109 | goto fail3; |
@@ -142,7 +150,7 @@ fail3: | |||
142 | return err; | 150 | return err; |
143 | } | 151 | } |
144 | 152 | ||
145 | static void __exit ramoops_exit(void) | 153 | static int __exit ramoops_remove(struct platform_device *pdev) |
146 | { | 154 | { |
147 | struct ramoops_context *cxt = &oops_cxt; | 155 | struct ramoops_context *cxt = &oops_cxt; |
148 | 156 | ||
@@ -151,8 +159,26 @@ static void __exit ramoops_exit(void) | |||
151 | 159 | ||
152 | iounmap(cxt->virt_addr); | 160 | iounmap(cxt->virt_addr); |
153 | release_mem_region(cxt->phys_addr, cxt->size); | 161 | release_mem_region(cxt->phys_addr, cxt->size); |
162 | return 0; | ||
154 | } | 163 | } |
155 | 164 | ||
165 | static struct platform_driver ramoops_driver = { | ||
166 | .remove = __exit_p(ramoops_remove), | ||
167 | .driver = { | ||
168 | .name = "ramoops", | ||
169 | .owner = THIS_MODULE, | ||
170 | }, | ||
171 | }; | ||
172 | |||
173 | static int __init ramoops_init(void) | ||
174 | { | ||
175 | return platform_driver_probe(&ramoops_driver, ramoops_probe); | ||
176 | } | ||
177 | |||
178 | static void __exit ramoops_exit(void) | ||
179 | { | ||
180 | platform_driver_unregister(&ramoops_driver); | ||
181 | } | ||
156 | 182 | ||
157 | module_init(ramoops_init); | 183 | module_init(ramoops_init); |
158 | module_exit(ramoops_exit); | 184 | module_exit(ramoops_exit); |
diff --git a/drivers/char/rio/Makefile b/drivers/char/rio/Makefile index 2d1c5a7cba7d..1661875883fb 100644 --- a/drivers/char/rio/Makefile +++ b/drivers/char/rio/Makefile | |||
@@ -8,5 +8,5 @@ | |||
8 | 8 | ||
9 | obj-$(CONFIG_RIO) += rio.o | 9 | obj-$(CONFIG_RIO) += rio.o |
10 | 10 | ||
11 | rio-objs := rio_linux.o rioinit.o rioboot.o riocmd.o rioctrl.o riointr.o \ | 11 | rio-y := rio_linux.o rioinit.o rioboot.o riocmd.o rioctrl.o riointr.o \ |
12 | rioparam.o rioroute.o riotable.o riotty.o | 12 | rioparam.o rioroute.o riotable.o riotty.o |
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index 7c79d243acc9..86308830ac42 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c | |||
@@ -2345,7 +2345,7 @@ static int __init rp_init(void) | |||
2345 | ret = tty_register_driver(rocket_driver); | 2345 | ret = tty_register_driver(rocket_driver); |
2346 | if (ret < 0) { | 2346 | if (ret < 0) { |
2347 | printk(KERN_ERR "Couldn't install tty RocketPort driver\n"); | 2347 | printk(KERN_ERR "Couldn't install tty RocketPort driver\n"); |
2348 | goto err_tty; | 2348 | goto err_controller; |
2349 | } | 2349 | } |
2350 | 2350 | ||
2351 | #ifdef ROCKET_DEBUG_OPEN | 2351 | #ifdef ROCKET_DEBUG_OPEN |
@@ -2380,6 +2380,9 @@ static int __init rp_init(void) | |||
2380 | return 0; | 2380 | return 0; |
2381 | err_ttyu: | 2381 | err_ttyu: |
2382 | tty_unregister_driver(rocket_driver); | 2382 | tty_unregister_driver(rocket_driver); |
2383 | err_controller: | ||
2384 | if (controller) | ||
2385 | release_region(controller, 4); | ||
2383 | err_tty: | 2386 | err_tty: |
2384 | put_tty_driver(rocket_driver); | 2387 | put_tty_driver(rocket_driver); |
2385 | err: | 2388 | err: |
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index 1746d91205f7..d01fffeac951 100644 --- a/drivers/char/synclink_gt.c +++ b/drivers/char/synclink_gt.c | |||
@@ -301,6 +301,8 @@ struct slgt_info { | |||
301 | unsigned int rx_pio; | 301 | unsigned int rx_pio; |
302 | unsigned int if_mode; | 302 | unsigned int if_mode; |
303 | unsigned int base_clock; | 303 | unsigned int base_clock; |
304 | unsigned int xsync; | ||
305 | unsigned int xctrl; | ||
304 | 306 | ||
305 | /* device status */ | 307 | /* device status */ |
306 | 308 | ||
@@ -405,6 +407,8 @@ static MGSL_PARAMS default_params = { | |||
405 | #define TDCSR 0x94 /* tx DMA control/status */ | 407 | #define TDCSR 0x94 /* tx DMA control/status */ |
406 | #define RDDAR 0x98 /* rx DMA descriptor address */ | 408 | #define RDDAR 0x98 /* rx DMA descriptor address */ |
407 | #define TDDAR 0x9c /* tx DMA descriptor address */ | 409 | #define TDDAR 0x9c /* tx DMA descriptor address */ |
410 | #define XSR 0x40 /* extended sync pattern */ | ||
411 | #define XCR 0x44 /* extended control */ | ||
408 | 412 | ||
409 | #define RXIDLE BIT14 | 413 | #define RXIDLE BIT14 |
410 | #define RXBREAK BIT14 | 414 | #define RXBREAK BIT14 |
@@ -517,6 +521,10 @@ static int set_interface(struct slgt_info *info, int if_mode); | |||
517 | static int set_gpio(struct slgt_info *info, struct gpio_desc __user *gpio); | 521 | static int set_gpio(struct slgt_info *info, struct gpio_desc __user *gpio); |
518 | static int get_gpio(struct slgt_info *info, struct gpio_desc __user *gpio); | 522 | static int get_gpio(struct slgt_info *info, struct gpio_desc __user *gpio); |
519 | static int wait_gpio(struct slgt_info *info, struct gpio_desc __user *gpio); | 523 | static int wait_gpio(struct slgt_info *info, struct gpio_desc __user *gpio); |
524 | static int get_xsync(struct slgt_info *info, int __user *if_mode); | ||
525 | static int set_xsync(struct slgt_info *info, int if_mode); | ||
526 | static int get_xctrl(struct slgt_info *info, int __user *if_mode); | ||
527 | static int set_xctrl(struct slgt_info *info, int if_mode); | ||
520 | 528 | ||
521 | /* | 529 | /* |
522 | * driver functions | 530 | * driver functions |
@@ -1056,6 +1064,14 @@ static int ioctl(struct tty_struct *tty, struct file *file, | |||
1056 | return get_gpio(info, argp); | 1064 | return get_gpio(info, argp); |
1057 | case MGSL_IOCWAITGPIO: | 1065 | case MGSL_IOCWAITGPIO: |
1058 | return wait_gpio(info, argp); | 1066 | return wait_gpio(info, argp); |
1067 | case MGSL_IOCGXSYNC: | ||
1068 | return get_xsync(info, argp); | ||
1069 | case MGSL_IOCSXSYNC: | ||
1070 | return set_xsync(info, (int)arg); | ||
1071 | case MGSL_IOCGXCTRL: | ||
1072 | return get_xctrl(info, argp); | ||
1073 | case MGSL_IOCSXCTRL: | ||
1074 | return set_xctrl(info, (int)arg); | ||
1059 | } | 1075 | } |
1060 | mutex_lock(&info->port.mutex); | 1076 | mutex_lock(&info->port.mutex); |
1061 | switch (cmd) { | 1077 | switch (cmd) { |
@@ -1132,6 +1148,7 @@ static long get_params32(struct slgt_info *info, struct MGSL_PARAMS32 __user *us | |||
1132 | struct MGSL_PARAMS32 tmp_params; | 1148 | struct MGSL_PARAMS32 tmp_params; |
1133 | 1149 | ||
1134 | DBGINFO(("%s get_params32\n", info->device_name)); | 1150 | DBGINFO(("%s get_params32\n", info->device_name)); |
1151 | memset(&tmp_params, 0, sizeof(tmp_params)); | ||
1135 | tmp_params.mode = (compat_ulong_t)info->params.mode; | 1152 | tmp_params.mode = (compat_ulong_t)info->params.mode; |
1136 | tmp_params.loopback = info->params.loopback; | 1153 | tmp_params.loopback = info->params.loopback; |
1137 | tmp_params.flags = info->params.flags; | 1154 | tmp_params.flags = info->params.flags; |
@@ -1212,12 +1229,16 @@ static long slgt_compat_ioctl(struct tty_struct *tty, struct file *file, | |||
1212 | case MGSL_IOCSGPIO: | 1229 | case MGSL_IOCSGPIO: |
1213 | case MGSL_IOCGGPIO: | 1230 | case MGSL_IOCGGPIO: |
1214 | case MGSL_IOCWAITGPIO: | 1231 | case MGSL_IOCWAITGPIO: |
1232 | case MGSL_IOCGXSYNC: | ||
1233 | case MGSL_IOCGXCTRL: | ||
1215 | case MGSL_IOCSTXIDLE: | 1234 | case MGSL_IOCSTXIDLE: |
1216 | case MGSL_IOCTXENABLE: | 1235 | case MGSL_IOCTXENABLE: |
1217 | case MGSL_IOCRXENABLE: | 1236 | case MGSL_IOCRXENABLE: |
1218 | case MGSL_IOCTXABORT: | 1237 | case MGSL_IOCTXABORT: |
1219 | case TIOCMIWAIT: | 1238 | case TIOCMIWAIT: |
1220 | case MGSL_IOCSIF: | 1239 | case MGSL_IOCSIF: |
1240 | case MGSL_IOCSXSYNC: | ||
1241 | case MGSL_IOCSXCTRL: | ||
1221 | rc = ioctl(tty, file, cmd, arg); | 1242 | rc = ioctl(tty, file, cmd, arg); |
1222 | break; | 1243 | break; |
1223 | } | 1244 | } |
@@ -1617,6 +1638,8 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1617 | if (cmd != SIOCWANDEV) | 1638 | if (cmd != SIOCWANDEV) |
1618 | return hdlc_ioctl(dev, ifr, cmd); | 1639 | return hdlc_ioctl(dev, ifr, cmd); |
1619 | 1640 | ||
1641 | memset(&new_line, 0, sizeof(new_line)); | ||
1642 | |||
1620 | switch(ifr->ifr_settings.type) { | 1643 | switch(ifr->ifr_settings.type) { |
1621 | case IF_GET_IFACE: /* return current sync_serial_settings */ | 1644 | case IF_GET_IFACE: /* return current sync_serial_settings */ |
1622 | 1645 | ||
@@ -1958,6 +1981,7 @@ static void bh_handler(struct work_struct *work) | |||
1958 | case MGSL_MODE_RAW: | 1981 | case MGSL_MODE_RAW: |
1959 | case MGSL_MODE_MONOSYNC: | 1982 | case MGSL_MODE_MONOSYNC: |
1960 | case MGSL_MODE_BISYNC: | 1983 | case MGSL_MODE_BISYNC: |
1984 | case MGSL_MODE_XSYNC: | ||
1961 | while(rx_get_buf(info)); | 1985 | while(rx_get_buf(info)); |
1962 | break; | 1986 | break; |
1963 | } | 1987 | } |
@@ -2357,26 +2381,27 @@ static irqreturn_t slgt_interrupt(int dummy, void *dev_id) | |||
2357 | 2381 | ||
2358 | DBGISR(("slgt_interrupt irq=%d entry\n", info->irq_level)); | 2382 | DBGISR(("slgt_interrupt irq=%d entry\n", info->irq_level)); |
2359 | 2383 | ||
2360 | spin_lock(&info->lock); | ||
2361 | |||
2362 | while((gsr = rd_reg32(info, GSR) & 0xffffff00)) { | 2384 | while((gsr = rd_reg32(info, GSR) & 0xffffff00)) { |
2363 | DBGISR(("%s gsr=%08x\n", info->device_name, gsr)); | 2385 | DBGISR(("%s gsr=%08x\n", info->device_name, gsr)); |
2364 | info->irq_occurred = true; | 2386 | info->irq_occurred = true; |
2365 | for(i=0; i < info->port_count ; i++) { | 2387 | for(i=0; i < info->port_count ; i++) { |
2366 | if (info->port_array[i] == NULL) | 2388 | if (info->port_array[i] == NULL) |
2367 | continue; | 2389 | continue; |
2390 | spin_lock(&info->port_array[i]->lock); | ||
2368 | if (gsr & (BIT8 << i)) | 2391 | if (gsr & (BIT8 << i)) |
2369 | isr_serial(info->port_array[i]); | 2392 | isr_serial(info->port_array[i]); |
2370 | if (gsr & (BIT16 << (i*2))) | 2393 | if (gsr & (BIT16 << (i*2))) |
2371 | isr_rdma(info->port_array[i]); | 2394 | isr_rdma(info->port_array[i]); |
2372 | if (gsr & (BIT17 << (i*2))) | 2395 | if (gsr & (BIT17 << (i*2))) |
2373 | isr_tdma(info->port_array[i]); | 2396 | isr_tdma(info->port_array[i]); |
2397 | spin_unlock(&info->port_array[i]->lock); | ||
2374 | } | 2398 | } |
2375 | } | 2399 | } |
2376 | 2400 | ||
2377 | if (info->gpio_present) { | 2401 | if (info->gpio_present) { |
2378 | unsigned int state; | 2402 | unsigned int state; |
2379 | unsigned int changed; | 2403 | unsigned int changed; |
2404 | spin_lock(&info->lock); | ||
2380 | while ((changed = rd_reg32(info, IOSR)) != 0) { | 2405 | while ((changed = rd_reg32(info, IOSR)) != 0) { |
2381 | DBGISR(("%s iosr=%08x\n", info->device_name, changed)); | 2406 | DBGISR(("%s iosr=%08x\n", info->device_name, changed)); |
2382 | /* read latched state of GPIO signals */ | 2407 | /* read latched state of GPIO signals */ |
@@ -2388,22 +2413,24 @@ static irqreturn_t slgt_interrupt(int dummy, void *dev_id) | |||
2388 | isr_gpio(info->port_array[i], changed, state); | 2413 | isr_gpio(info->port_array[i], changed, state); |
2389 | } | 2414 | } |
2390 | } | 2415 | } |
2416 | spin_unlock(&info->lock); | ||
2391 | } | 2417 | } |
2392 | 2418 | ||
2393 | for(i=0; i < info->port_count ; i++) { | 2419 | for(i=0; i < info->port_count ; i++) { |
2394 | struct slgt_info *port = info->port_array[i]; | 2420 | struct slgt_info *port = info->port_array[i]; |
2395 | 2421 | if (port == NULL) | |
2396 | if (port && (port->port.count || port->netcount) && | 2422 | continue; |
2423 | spin_lock(&port->lock); | ||
2424 | if ((port->port.count || port->netcount) && | ||
2397 | port->pending_bh && !port->bh_running && | 2425 | port->pending_bh && !port->bh_running && |
2398 | !port->bh_requested) { | 2426 | !port->bh_requested) { |
2399 | DBGISR(("%s bh queued\n", port->device_name)); | 2427 | DBGISR(("%s bh queued\n", port->device_name)); |
2400 | schedule_work(&port->task); | 2428 | schedule_work(&port->task); |
2401 | port->bh_requested = true; | 2429 | port->bh_requested = true; |
2402 | } | 2430 | } |
2431 | spin_unlock(&port->lock); | ||
2403 | } | 2432 | } |
2404 | 2433 | ||
2405 | spin_unlock(&info->lock); | ||
2406 | |||
2407 | DBGISR(("slgt_interrupt irq=%d exit\n", info->irq_level)); | 2434 | DBGISR(("slgt_interrupt irq=%d exit\n", info->irq_level)); |
2408 | return IRQ_HANDLED; | 2435 | return IRQ_HANDLED; |
2409 | } | 2436 | } |
@@ -2883,6 +2910,69 @@ static int set_interface(struct slgt_info *info, int if_mode) | |||
2883 | return 0; | 2910 | return 0; |
2884 | } | 2911 | } |
2885 | 2912 | ||
2913 | static int get_xsync(struct slgt_info *info, int __user *xsync) | ||
2914 | { | ||
2915 | DBGINFO(("%s get_xsync=%x\n", info->device_name, info->xsync)); | ||
2916 | if (put_user(info->xsync, xsync)) | ||
2917 | return -EFAULT; | ||
2918 | return 0; | ||
2919 | } | ||
2920 | |||
2921 | /* | ||
2922 | * set extended sync pattern (1 to 4 bytes) for extended sync mode | ||
2923 | * | ||
2924 | * sync pattern is contained in least significant bytes of value | ||
2925 | * most significant byte of sync pattern is oldest (1st sent/detected) | ||
2926 | */ | ||
2927 | static int set_xsync(struct slgt_info *info, int xsync) | ||
2928 | { | ||
2929 | unsigned long flags; | ||
2930 | |||
2931 | DBGINFO(("%s set_xsync=%x)\n", info->device_name, xsync)); | ||
2932 | spin_lock_irqsave(&info->lock, flags); | ||
2933 | info->xsync = xsync; | ||
2934 | wr_reg32(info, XSR, xsync); | ||
2935 | spin_unlock_irqrestore(&info->lock, flags); | ||
2936 | return 0; | ||
2937 | } | ||
2938 | |||
2939 | static int get_xctrl(struct slgt_info *info, int __user *xctrl) | ||
2940 | { | ||
2941 | DBGINFO(("%s get_xctrl=%x\n", info->device_name, info->xctrl)); | ||
2942 | if (put_user(info->xctrl, xctrl)) | ||
2943 | return -EFAULT; | ||
2944 | return 0; | ||
2945 | } | ||
2946 | |||
2947 | /* | ||
2948 | * set extended control options | ||
2949 | * | ||
2950 | * xctrl[31:19] reserved, must be zero | ||
2951 | * xctrl[18:17] extended sync pattern length in bytes | ||
2952 | * 00 = 1 byte in xsr[7:0] | ||
2953 | * 01 = 2 bytes in xsr[15:0] | ||
2954 | * 10 = 3 bytes in xsr[23:0] | ||
2955 | * 11 = 4 bytes in xsr[31:0] | ||
2956 | * xctrl[16] 1 = enable terminal count, 0=disabled | ||
2957 | * xctrl[15:0] receive terminal count for fixed length packets | ||
2958 | * value is count minus one (0 = 1 byte packet) | ||
2959 | * when terminal count is reached, receiver | ||
2960 | * automatically returns to hunt mode and receive | ||
2961 | * FIFO contents are flushed to DMA buffers with | ||
2962 | * end of frame (EOF) status | ||
2963 | */ | ||
2964 | static int set_xctrl(struct slgt_info *info, int xctrl) | ||
2965 | { | ||
2966 | unsigned long flags; | ||
2967 | |||
2968 | DBGINFO(("%s set_xctrl=%x)\n", info->device_name, xctrl)); | ||
2969 | spin_lock_irqsave(&info->lock, flags); | ||
2970 | info->xctrl = xctrl; | ||
2971 | wr_reg32(info, XCR, xctrl); | ||
2972 | spin_unlock_irqrestore(&info->lock, flags); | ||
2973 | return 0; | ||
2974 | } | ||
2975 | |||
2886 | /* | 2976 | /* |
2887 | * set general purpose IO pin state and direction | 2977 | * set general purpose IO pin state and direction |
2888 | * | 2978 | * |
@@ -2906,7 +2996,7 @@ static int set_gpio(struct slgt_info *info, struct gpio_desc __user *user_gpio) | |||
2906 | info->device_name, gpio.state, gpio.smask, | 2996 | info->device_name, gpio.state, gpio.smask, |
2907 | gpio.dir, gpio.dmask)); | 2997 | gpio.dir, gpio.dmask)); |
2908 | 2998 | ||
2909 | spin_lock_irqsave(&info->lock,flags); | 2999 | spin_lock_irqsave(&info->port_array[0]->lock, flags); |
2910 | if (gpio.dmask) { | 3000 | if (gpio.dmask) { |
2911 | data = rd_reg32(info, IODR); | 3001 | data = rd_reg32(info, IODR); |
2912 | data |= gpio.dmask & gpio.dir; | 3002 | data |= gpio.dmask & gpio.dir; |
@@ -2919,7 +3009,7 @@ static int set_gpio(struct slgt_info *info, struct gpio_desc __user *user_gpio) | |||
2919 | data &= ~(gpio.smask & ~gpio.state); | 3009 | data &= ~(gpio.smask & ~gpio.state); |
2920 | wr_reg32(info, IOVR, data); | 3010 | wr_reg32(info, IOVR, data); |
2921 | } | 3011 | } |
2922 | spin_unlock_irqrestore(&info->lock,flags); | 3012 | spin_unlock_irqrestore(&info->port_array[0]->lock, flags); |
2923 | 3013 | ||
2924 | return 0; | 3014 | return 0; |
2925 | } | 3015 | } |
@@ -3020,7 +3110,7 @@ static int wait_gpio(struct slgt_info *info, struct gpio_desc __user *user_gpio) | |||
3020 | return -EINVAL; | 3110 | return -EINVAL; |
3021 | init_cond_wait(&wait, gpio.smask); | 3111 | init_cond_wait(&wait, gpio.smask); |
3022 | 3112 | ||
3023 | spin_lock_irqsave(&info->lock, flags); | 3113 | spin_lock_irqsave(&info->port_array[0]->lock, flags); |
3024 | /* enable interrupts for watched pins */ | 3114 | /* enable interrupts for watched pins */ |
3025 | wr_reg32(info, IOER, rd_reg32(info, IOER) | gpio.smask); | 3115 | wr_reg32(info, IOER, rd_reg32(info, IOER) | gpio.smask); |
3026 | /* get current pin states */ | 3116 | /* get current pin states */ |
@@ -3032,20 +3122,20 @@ static int wait_gpio(struct slgt_info *info, struct gpio_desc __user *user_gpio) | |||
3032 | } else { | 3122 | } else { |
3033 | /* wait for target state */ | 3123 | /* wait for target state */ |
3034 | add_cond_wait(&info->gpio_wait_q, &wait); | 3124 | add_cond_wait(&info->gpio_wait_q, &wait); |
3035 | spin_unlock_irqrestore(&info->lock, flags); | 3125 | spin_unlock_irqrestore(&info->port_array[0]->lock, flags); |
3036 | schedule(); | 3126 | schedule(); |
3037 | if (signal_pending(current)) | 3127 | if (signal_pending(current)) |
3038 | rc = -ERESTARTSYS; | 3128 | rc = -ERESTARTSYS; |
3039 | else | 3129 | else |
3040 | gpio.state = wait.data; | 3130 | gpio.state = wait.data; |
3041 | spin_lock_irqsave(&info->lock, flags); | 3131 | spin_lock_irqsave(&info->port_array[0]->lock, flags); |
3042 | remove_cond_wait(&info->gpio_wait_q, &wait); | 3132 | remove_cond_wait(&info->gpio_wait_q, &wait); |
3043 | } | 3133 | } |
3044 | 3134 | ||
3045 | /* disable all GPIO interrupts if no waiting processes */ | 3135 | /* disable all GPIO interrupts if no waiting processes */ |
3046 | if (info->gpio_wait_q == NULL) | 3136 | if (info->gpio_wait_q == NULL) |
3047 | wr_reg32(info, IOER, 0); | 3137 | wr_reg32(info, IOER, 0); |
3048 | spin_unlock_irqrestore(&info->lock,flags); | 3138 | spin_unlock_irqrestore(&info->port_array[0]->lock, flags); |
3049 | 3139 | ||
3050 | if ((rc == 0) && copy_to_user(user_gpio, &gpio, sizeof(gpio))) | 3140 | if ((rc == 0) && copy_to_user(user_gpio, &gpio, sizeof(gpio))) |
3051 | rc = -EFAULT; | 3141 | rc = -EFAULT; |
@@ -3578,7 +3668,6 @@ static void device_init(int adapter_num, struct pci_dev *pdev) | |||
3578 | 3668 | ||
3579 | /* copy resource information from first port to others */ | 3669 | /* copy resource information from first port to others */ |
3580 | for (i = 1; i < port_count; ++i) { | 3670 | for (i = 1; i < port_count; ++i) { |
3581 | port_array[i]->lock = port_array[0]->lock; | ||
3582 | port_array[i]->irq_level = port_array[0]->irq_level; | 3671 | port_array[i]->irq_level = port_array[0]->irq_level; |
3583 | port_array[i]->reg_addr = port_array[0]->reg_addr; | 3672 | port_array[i]->reg_addr = port_array[0]->reg_addr; |
3584 | alloc_dma_bufs(port_array[i]); | 3673 | alloc_dma_bufs(port_array[i]); |
@@ -3763,7 +3852,9 @@ module_exit(slgt_exit); | |||
3763 | #define CALC_REGADDR() \ | 3852 | #define CALC_REGADDR() \ |
3764 | unsigned long reg_addr = ((unsigned long)info->reg_addr) + addr; \ | 3853 | unsigned long reg_addr = ((unsigned long)info->reg_addr) + addr; \ |
3765 | if (addr >= 0x80) \ | 3854 | if (addr >= 0x80) \ |
3766 | reg_addr += (info->port_num) * 32; | 3855 | reg_addr += (info->port_num) * 32; \ |
3856 | else if (addr >= 0x40) \ | ||
3857 | reg_addr += (info->port_num) * 16; | ||
3767 | 3858 | ||
3768 | static __u8 rd_reg8(struct slgt_info *info, unsigned int addr) | 3859 | static __u8 rd_reg8(struct slgt_info *info, unsigned int addr) |
3769 | { | 3860 | { |
@@ -4182,7 +4273,13 @@ static void sync_mode(struct slgt_info *info) | |||
4182 | 4273 | ||
4183 | /* TCR (tx control) | 4274 | /* TCR (tx control) |
4184 | * | 4275 | * |
4185 | * 15..13 mode, 000=HDLC 001=raw 010=async 011=monosync 100=bisync | 4276 | * 15..13 mode |
4277 | * 000=HDLC/SDLC | ||
4278 | * 001=raw bit synchronous | ||
4279 | * 010=asynchronous/isochronous | ||
4280 | * 011=monosync byte synchronous | ||
4281 | * 100=bisync byte synchronous | ||
4282 | * 101=xsync byte synchronous | ||
4186 | * 12..10 encoding | 4283 | * 12..10 encoding |
4187 | * 09 CRC enable | 4284 | * 09 CRC enable |
4188 | * 08 CRC32 | 4285 | * 08 CRC32 |
@@ -4197,6 +4294,9 @@ static void sync_mode(struct slgt_info *info) | |||
4197 | val = BIT2; | 4294 | val = BIT2; |
4198 | 4295 | ||
4199 | switch(info->params.mode) { | 4296 | switch(info->params.mode) { |
4297 | case MGSL_MODE_XSYNC: | ||
4298 | val |= BIT15 + BIT13; | ||
4299 | break; | ||
4200 | case MGSL_MODE_MONOSYNC: val |= BIT14 + BIT13; break; | 4300 | case MGSL_MODE_MONOSYNC: val |= BIT14 + BIT13; break; |
4201 | case MGSL_MODE_BISYNC: val |= BIT15; break; | 4301 | case MGSL_MODE_BISYNC: val |= BIT15; break; |
4202 | case MGSL_MODE_RAW: val |= BIT13; break; | 4302 | case MGSL_MODE_RAW: val |= BIT13; break; |
@@ -4251,7 +4351,13 @@ static void sync_mode(struct slgt_info *info) | |||
4251 | 4351 | ||
4252 | /* RCR (rx control) | 4352 | /* RCR (rx control) |
4253 | * | 4353 | * |
4254 | * 15..13 mode, 000=HDLC 001=raw 010=async 011=monosync 100=bisync | 4354 | * 15..13 mode |
4355 | * 000=HDLC/SDLC | ||
4356 | * 001=raw bit synchronous | ||
4357 | * 010=asynchronous/isochronous | ||
4358 | * 011=monosync byte synchronous | ||
4359 | * 100=bisync byte synchronous | ||
4360 | * 101=xsync byte synchronous | ||
4255 | * 12..10 encoding | 4361 | * 12..10 encoding |
4256 | * 09 CRC enable | 4362 | * 09 CRC enable |
4257 | * 08 CRC32 | 4363 | * 08 CRC32 |
@@ -4263,6 +4369,9 @@ static void sync_mode(struct slgt_info *info) | |||
4263 | val = 0; | 4369 | val = 0; |
4264 | 4370 | ||
4265 | switch(info->params.mode) { | 4371 | switch(info->params.mode) { |
4372 | case MGSL_MODE_XSYNC: | ||
4373 | val |= BIT15 + BIT13; | ||
4374 | break; | ||
4266 | case MGSL_MODE_MONOSYNC: val |= BIT14 + BIT13; break; | 4375 | case MGSL_MODE_MONOSYNC: val |= BIT14 + BIT13; break; |
4267 | case MGSL_MODE_BISYNC: val |= BIT15; break; | 4376 | case MGSL_MODE_BISYNC: val |= BIT15; break; |
4268 | case MGSL_MODE_RAW: val |= BIT13; break; | 4377 | case MGSL_MODE_RAW: val |= BIT13; break; |
@@ -4679,6 +4788,7 @@ static bool rx_get_buf(struct slgt_info *info) | |||
4679 | switch(info->params.mode) { | 4788 | switch(info->params.mode) { |
4680 | case MGSL_MODE_MONOSYNC: | 4789 | case MGSL_MODE_MONOSYNC: |
4681 | case MGSL_MODE_BISYNC: | 4790 | case MGSL_MODE_BISYNC: |
4791 | case MGSL_MODE_XSYNC: | ||
4682 | /* ignore residue in byte synchronous modes */ | 4792 | /* ignore residue in byte synchronous modes */ |
4683 | if (desc_residue(info->rbufs[i])) | 4793 | if (desc_residue(info->rbufs[i])) |
4684 | count--; | 4794 | count--; |
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c index 38df8c19e74c..6b68a0fb4611 100644 --- a/drivers/char/vt_ioctl.c +++ b/drivers/char/vt_ioctl.c | |||
@@ -503,6 +503,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
503 | struct kbd_struct * kbd; | 503 | struct kbd_struct * kbd; |
504 | unsigned int console; | 504 | unsigned int console; |
505 | unsigned char ucval; | 505 | unsigned char ucval; |
506 | unsigned int uival; | ||
506 | void __user *up = (void __user *)arg; | 507 | void __user *up = (void __user *)arg; |
507 | int i, perm; | 508 | int i, perm; |
508 | int ret = 0; | 509 | int ret = 0; |
@@ -657,7 +658,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
657 | break; | 658 | break; |
658 | 659 | ||
659 | case KDGETMODE: | 660 | case KDGETMODE: |
660 | ucval = vc->vc_mode; | 661 | uival = vc->vc_mode; |
661 | goto setint; | 662 | goto setint; |
662 | 663 | ||
663 | case KDMAPDISP: | 664 | case KDMAPDISP: |
@@ -695,7 +696,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
695 | break; | 696 | break; |
696 | 697 | ||
697 | case KDGKBMODE: | 698 | case KDGKBMODE: |
698 | ucval = ((kbd->kbdmode == VC_RAW) ? K_RAW : | 699 | uival = ((kbd->kbdmode == VC_RAW) ? K_RAW : |
699 | (kbd->kbdmode == VC_MEDIUMRAW) ? K_MEDIUMRAW : | 700 | (kbd->kbdmode == VC_MEDIUMRAW) ? K_MEDIUMRAW : |
700 | (kbd->kbdmode == VC_UNICODE) ? K_UNICODE : | 701 | (kbd->kbdmode == VC_UNICODE) ? K_UNICODE : |
701 | K_XLATE); | 702 | K_XLATE); |
@@ -717,9 +718,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
717 | break; | 718 | break; |
718 | 719 | ||
719 | case KDGKBMETA: | 720 | case KDGKBMETA: |
720 | ucval = (vc_kbd_mode(kbd, VC_META) ? K_ESCPREFIX : K_METABIT); | 721 | uival = (vc_kbd_mode(kbd, VC_META) ? K_ESCPREFIX : K_METABIT); |
721 | setint: | 722 | setint: |
722 | ret = put_user(ucval, (int __user *)arg); | 723 | ret = put_user(uival, (int __user *)arg); |
723 | break; | 724 | break; |
724 | 725 | ||
725 | case KDGETKEYCODE: | 726 | case KDGETKEYCODE: |
@@ -949,7 +950,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
949 | for (i = 0; i < MAX_NR_CONSOLES; ++i) | 950 | for (i = 0; i < MAX_NR_CONSOLES; ++i) |
950 | if (! VT_IS_IN_USE(i)) | 951 | if (! VT_IS_IN_USE(i)) |
951 | break; | 952 | break; |
952 | ucval = i < MAX_NR_CONSOLES ? (i+1) : -1; | 953 | uival = i < MAX_NR_CONSOLES ? (i+1) : -1; |
953 | goto setint; | 954 | goto setint; |
954 | 955 | ||
955 | /* | 956 | /* |