diff options
Diffstat (limited to 'drivers')
82 files changed, 953 insertions, 919 deletions
diff --git a/drivers/atm/Kconfig b/drivers/atm/Kconfig index 5b4fab24155f..bb4ae6281491 100644 --- a/drivers/atm/Kconfig +++ b/drivers/atm/Kconfig | |||
@@ -142,7 +142,7 @@ config ATM_ENI_BURST_RX_2W | |||
142 | 142 | ||
143 | config ATM_FIRESTREAM | 143 | config ATM_FIRESTREAM |
144 | tristate "Fujitsu FireStream (FS50/FS155) " | 144 | tristate "Fujitsu FireStream (FS50/FS155) " |
145 | depends on PCI | 145 | depends on PCI && VIRT_TO_BUS |
146 | help | 146 | help |
147 | Driver for the Fujitsu FireStream 155 (MB86697) and | 147 | Driver for the Fujitsu FireStream 155 (MB86697) and |
148 | FireStream 50 (MB86695) ATM PCI chips. | 148 | FireStream 50 (MB86695) ATM PCI chips. |
@@ -152,7 +152,7 @@ config ATM_FIRESTREAM | |||
152 | 152 | ||
153 | config ATM_ZATM | 153 | config ATM_ZATM |
154 | tristate "ZeitNet ZN1221/ZN1225" | 154 | tristate "ZeitNet ZN1221/ZN1225" |
155 | depends on PCI | 155 | depends on PCI && VIRT_TO_BUS |
156 | help | 156 | help |
157 | Driver for the ZeitNet ZN1221 (MMF) and ZN1225 (UTP-5) 155 Mbps ATM | 157 | Driver for the ZeitNet ZN1221 (MMF) and ZN1225 (UTP-5) 155 Mbps ATM |
158 | adapters. | 158 | adapters. |
@@ -240,7 +240,7 @@ config ATM_IDT77252_USE_SUNI | |||
240 | 240 | ||
241 | config ATM_AMBASSADOR | 241 | config ATM_AMBASSADOR |
242 | tristate "Madge Ambassador (Collage PCI 155 Server)" | 242 | tristate "Madge Ambassador (Collage PCI 155 Server)" |
243 | depends on PCI | 243 | depends on PCI && VIRT_TO_BUS |
244 | select BITREVERSE | 244 | select BITREVERSE |
245 | help | 245 | help |
246 | This is a driver for ATMizer based ATM card produced by Madge | 246 | This is a driver for ATMizer based ATM card produced by Madge |
@@ -265,7 +265,7 @@ config ATM_AMBASSADOR_DEBUG | |||
265 | 265 | ||
266 | config ATM_HORIZON | 266 | config ATM_HORIZON |
267 | tristate "Madge Horizon [Ultra] (Collage PCI 25 and Collage PCI 155 Client)" | 267 | tristate "Madge Horizon [Ultra] (Collage PCI 25 and Collage PCI 155 Client)" |
268 | depends on PCI | 268 | depends on PCI && VIRT_TO_BUS |
269 | help | 269 | help |
270 | This is a driver for the Horizon chipset ATM adapter cards once | 270 | This is a driver for the Horizon chipset ATM adapter cards once |
271 | produced by Madge Networks Ltd. Say Y (or M to compile as a module | 271 | produced by Madge Networks Ltd. Say Y (or M to compile as a module |
diff --git a/drivers/auxdisplay/Kconfig b/drivers/auxdisplay/Kconfig index ea4fe3e48f33..de2fcce10ba5 100644 --- a/drivers/auxdisplay/Kconfig +++ b/drivers/auxdisplay/Kconfig | |||
@@ -5,8 +5,11 @@ | |||
5 | # Auxiliary display drivers configuration. | 5 | # Auxiliary display drivers configuration. |
6 | # | 6 | # |
7 | 7 | ||
8 | menu "Auxiliary Display support" | 8 | menuconfig AUXDISPLAY |
9 | depends on PARPORT | 9 | depends on PARPORT |
10 | bool "Auxiliary Display support" | ||
11 | |||
12 | if AUXDISPLAY && PARPORT | ||
10 | 13 | ||
11 | config KS0108 | 14 | config KS0108 |
12 | tristate "KS0108 LCD Controller" | 15 | tristate "KS0108 LCD Controller" |
@@ -111,4 +114,5 @@ config CFAG12864B_RATE | |||
111 | 114 | ||
112 | If you compile this as a module, you can still override this | 115 | If you compile this as a module, you can still override this |
113 | value using the module parameters. | 116 | value using the module parameters. |
114 | endmenu | 117 | |
118 | endif # AUXDISPLAY | ||
diff --git a/drivers/base/dmapool.c b/drivers/base/dmapool.c index 91970e9bb05e..7647abfe1890 100644 --- a/drivers/base/dmapool.c +++ b/drivers/base/dmapool.c | |||
@@ -127,7 +127,7 @@ dma_pool_create (const char *name, struct device *dev, | |||
127 | } else if (allocation < size) | 127 | } else if (allocation < size) |
128 | return NULL; | 128 | return NULL; |
129 | 129 | ||
130 | if (!(retval = kmalloc (sizeof *retval, GFP_KERNEL))) | 130 | if (!(retval = kmalloc_node (sizeof *retval, GFP_KERNEL, dev_to_node(dev)))) |
131 | return retval; | 131 | return retval; |
132 | 132 | ||
133 | strlcpy (retval->name, name, sizeof retval->name); | 133 | strlcpy (retval->name, name, sizeof retval->name); |
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig index d9867fd2f2a5..e49162b15578 100644 --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig | |||
@@ -113,7 +113,7 @@ source "drivers/block/paride/Kconfig" | |||
113 | 113 | ||
114 | config BLK_CPQ_DA | 114 | config BLK_CPQ_DA |
115 | tristate "Compaq SMART2 support" | 115 | tristate "Compaq SMART2 support" |
116 | depends on PCI | 116 | depends on PCI && VIRT_TO_BUS |
117 | help | 117 | help |
118 | This is the driver for Compaq Smart Array controllers. Everyone | 118 | This is the driver for Compaq Smart Array controllers. Everyone |
119 | using these boards should say Y here. See the file | 119 | using these boards should say Y here. See the file |
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index c575fb1d585f..c12951024090 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c | |||
@@ -122,17 +122,12 @@ static int sock_xmit(struct socket *sock, int send, void *buf, int size, | |||
122 | int result; | 122 | int result; |
123 | struct msghdr msg; | 123 | struct msghdr msg; |
124 | struct kvec iov; | 124 | struct kvec iov; |
125 | unsigned long flags; | 125 | sigset_t blocked, oldset; |
126 | sigset_t oldset; | ||
127 | 126 | ||
128 | /* Allow interception of SIGKILL only | 127 | /* Allow interception of SIGKILL only |
129 | * Don't allow other signals to interrupt the transmission */ | 128 | * Don't allow other signals to interrupt the transmission */ |
130 | spin_lock_irqsave(¤t->sighand->siglock, flags); | 129 | siginitsetinv(&blocked, sigmask(SIGKILL)); |
131 | oldset = current->blocked; | 130 | sigprocmask(SIG_SETMASK, &blocked, &oldset); |
132 | sigfillset(¤t->blocked); | ||
133 | sigdelsetmask(¤t->blocked, sigmask(SIGKILL)); | ||
134 | recalc_sigpending(); | ||
135 | spin_unlock_irqrestore(¤t->sighand->siglock, flags); | ||
136 | 131 | ||
137 | do { | 132 | do { |
138 | sock->sk->sk_allocation = GFP_NOIO; | 133 | sock->sk->sk_allocation = GFP_NOIO; |
@@ -151,11 +146,9 @@ static int sock_xmit(struct socket *sock, int send, void *buf, int size, | |||
151 | 146 | ||
152 | if (signal_pending(current)) { | 147 | if (signal_pending(current)) { |
153 | siginfo_t info; | 148 | siginfo_t info; |
154 | spin_lock_irqsave(¤t->sighand->siglock, flags); | ||
155 | printk(KERN_WARNING "nbd (pid %d: %s) got signal %d\n", | 149 | printk(KERN_WARNING "nbd (pid %d: %s) got signal %d\n", |
156 | current->pid, current->comm, | 150 | current->pid, current->comm, |
157 | dequeue_signal(current, ¤t->blocked, &info)); | 151 | dequeue_signal_lock(current, ¤t->blocked, &info)); |
158 | spin_unlock_irqrestore(¤t->sighand->siglock, flags); | ||
159 | result = -EINTR; | 152 | result = -EINTR; |
160 | break; | 153 | break; |
161 | } | 154 | } |
@@ -169,10 +162,7 @@ static int sock_xmit(struct socket *sock, int send, void *buf, int size, | |||
169 | buf += result; | 162 | buf += result; |
170 | } while (size > 0); | 163 | } while (size > 0); |
171 | 164 | ||
172 | spin_lock_irqsave(¤t->sighand->siglock, flags); | 165 | sigprocmask(SIG_SETMASK, &oldset, NULL); |
173 | current->blocked = oldset; | ||
174 | recalc_sigpending(); | ||
175 | spin_unlock_irqrestore(¤t->sighand->siglock, flags); | ||
176 | 166 | ||
177 | return result; | 167 | return result; |
178 | } | 168 | } |
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index ce64e86d6ffb..7c294a40002e 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -1652,9 +1652,6 @@ static int kcdrwd(void *foobar) | |||
1652 | } | 1652 | } |
1653 | } | 1653 | } |
1654 | 1654 | ||
1655 | if (signal_pending(current)) { | ||
1656 | flush_signals(current); | ||
1657 | } | ||
1658 | if (kthread_should_stop()) | 1655 | if (kthread_should_stop()) |
1659 | break; | 1656 | break; |
1660 | } | 1657 | } |
diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c index 7cc2685ca84a..2abf94cc3137 100644 --- a/drivers/block/z2ram.c +++ b/drivers/block/z2ram.c | |||
@@ -44,9 +44,6 @@ | |||
44 | extern int m68k_realnum_memory; | 44 | extern int m68k_realnum_memory; |
45 | extern struct mem_info m68k_memory[NUM_MEMINFO]; | 45 | extern struct mem_info m68k_memory[NUM_MEMINFO]; |
46 | 46 | ||
47 | #define TRUE (1) | ||
48 | #define FALSE (0) | ||
49 | |||
50 | #define Z2MINOR_COMBINED (0) | 47 | #define Z2MINOR_COMBINED (0) |
51 | #define Z2MINOR_Z2ONLY (1) | 48 | #define Z2MINOR_Z2ONLY (1) |
52 | #define Z2MINOR_CHIPONLY (2) | 49 | #define Z2MINOR_CHIPONLY (2) |
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index f6648682b43a..ec9dc3d53f18 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
@@ -979,15 +979,14 @@ config GPIO_VR41XX | |||
979 | depends on CPU_VR41XX | 979 | depends on CPU_VR41XX |
980 | 980 | ||
981 | config RAW_DRIVER | 981 | config RAW_DRIVER |
982 | tristate "RAW driver (/dev/raw/rawN) (OBSOLETE)" | 982 | tristate "RAW driver (/dev/raw/rawN)" |
983 | depends on BLOCK | 983 | depends on BLOCK |
984 | help | 984 | help |
985 | The raw driver permits block devices to be bound to /dev/raw/rawN. | 985 | The raw driver permits block devices to be bound to /dev/raw/rawN. |
986 | Once bound, I/O against /dev/raw/rawN uses efficient zero-copy I/O. | 986 | Once bound, I/O against /dev/raw/rawN uses efficient zero-copy I/O. |
987 | See the raw(8) manpage for more details. | 987 | See the raw(8) manpage for more details. |
988 | 988 | ||
989 | The raw driver is deprecated and will be removed soon. | 989 | Applications should preferably open the device (eg /dev/hda1) |
990 | Applications should simply open the device (eg /dev/hda1) | ||
991 | with the O_DIRECT flag. | 990 | with the O_DIRECT flag. |
992 | 991 | ||
993 | config MAX_RAW_DEVS | 992 | config MAX_RAW_DEVS |
diff --git a/drivers/char/Makefile b/drivers/char/Makefile index 2f56ecc035aa..f2996a95eb07 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile | |||
@@ -15,6 +15,7 @@ obj-y += misc.o | |||
15 | obj-$(CONFIG_VT) += vt_ioctl.o vc_screen.o consolemap.o \ | 15 | obj-$(CONFIG_VT) += vt_ioctl.o vc_screen.o consolemap.o \ |
16 | consolemap_deftbl.o selection.o keyboard.o | 16 | consolemap_deftbl.o selection.o keyboard.o |
17 | obj-$(CONFIG_HW_CONSOLE) += vt.o defkeymap.o | 17 | obj-$(CONFIG_HW_CONSOLE) += vt.o defkeymap.o |
18 | obj-$(CONFIG_AUDIT) += tty_audit.o | ||
18 | obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o | 19 | obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o |
19 | obj-$(CONFIG_ESPSERIAL) += esp.o | 20 | obj-$(CONFIG_ESPSERIAL) += esp.o |
20 | obj-$(CONFIG_MVME147_SCC) += generic_serial.o vme_scc.o | 21 | obj-$(CONFIG_MVME147_SCC) += generic_serial.o vme_scc.o |
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c index 4eaceabd8cea..7b02bf1289a2 100644 --- a/drivers/char/amiserial.c +++ b/drivers/char/amiserial.c | |||
@@ -738,6 +738,7 @@ static void change_speed(struct async_struct *info, | |||
738 | } | 738 | } |
739 | /* If the quotient is zero refuse the change */ | 739 | /* If the quotient is zero refuse the change */ |
740 | if (!quot && old_termios) { | 740 | if (!quot && old_termios) { |
741 | /* FIXME: Will need updating for new tty in the end */ | ||
741 | info->tty->termios->c_cflag &= ~CBAUD; | 742 | info->tty->termios->c_cflag &= ~CBAUD; |
742 | info->tty->termios->c_cflag |= (old_termios->c_cflag & CBAUD); | 743 | info->tty->termios->c_cflag |= (old_termios->c_cflag & CBAUD); |
743 | baud = tty_get_baud_rate(info->tty); | 744 | baud = tty_get_baud_rate(info->tty); |
@@ -783,7 +784,6 @@ static void change_speed(struct async_struct *info, | |||
783 | /* | 784 | /* |
784 | * Set up parity check flag | 785 | * Set up parity check flag |
785 | */ | 786 | */ |
786 | #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) | ||
787 | 787 | ||
788 | info->read_status_mask = UART_LSR_OE | UART_LSR_DR; | 788 | info->read_status_mask = UART_LSR_OE | UART_LSR_DR; |
789 | if (I_INPCK(info->tty)) | 789 | if (I_INPCK(info->tty)) |
@@ -1367,11 +1367,6 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) | |||
1367 | unsigned long flags; | 1367 | unsigned long flags; |
1368 | unsigned int cflag = tty->termios->c_cflag; | 1368 | unsigned int cflag = tty->termios->c_cflag; |
1369 | 1369 | ||
1370 | if ( (cflag == old_termios->c_cflag) | ||
1371 | && ( RELEVANT_IFLAG(tty->termios->c_iflag) | ||
1372 | == RELEVANT_IFLAG(old_termios->c_iflag))) | ||
1373 | return; | ||
1374 | |||
1375 | change_speed(info, old_termios); | 1370 | change_speed(info, old_termios); |
1376 | 1371 | ||
1377 | /* Handle transition to B0 status */ | 1372 | /* Handle transition to B0 status */ |
diff --git a/drivers/char/consolemap.c b/drivers/char/consolemap.c index fd40b959afdd..4b3916f54909 100644 --- a/drivers/char/consolemap.c +++ b/drivers/char/consolemap.c | |||
@@ -177,6 +177,7 @@ struct uni_pagedir { | |||
177 | unsigned long refcount; | 177 | unsigned long refcount; |
178 | unsigned long sum; | 178 | unsigned long sum; |
179 | unsigned char *inverse_translations[4]; | 179 | unsigned char *inverse_translations[4]; |
180 | u16 *inverse_trans_unicode; | ||
180 | int readonly; | 181 | int readonly; |
181 | }; | 182 | }; |
182 | 183 | ||
@@ -207,6 +208,41 @@ static void set_inverse_transl(struct vc_data *conp, struct uni_pagedir *p, int | |||
207 | } | 208 | } |
208 | } | 209 | } |
209 | 210 | ||
211 | static void set_inverse_trans_unicode(struct vc_data *conp, | ||
212 | struct uni_pagedir *p) | ||
213 | { | ||
214 | int i, j, k, glyph; | ||
215 | u16 **p1, *p2; | ||
216 | u16 *q; | ||
217 | |||
218 | if (!p) return; | ||
219 | q = p->inverse_trans_unicode; | ||
220 | if (!q) { | ||
221 | q = p->inverse_trans_unicode = | ||
222 | kmalloc(MAX_GLYPH * sizeof(u16), GFP_KERNEL); | ||
223 | if (!q) | ||
224 | return; | ||
225 | } | ||
226 | memset(q, 0, MAX_GLYPH * sizeof(u16)); | ||
227 | |||
228 | for (i = 0; i < 32; i++) { | ||
229 | p1 = p->uni_pgdir[i]; | ||
230 | if (!p1) | ||
231 | continue; | ||
232 | for (j = 0; j < 32; j++) { | ||
233 | p2 = p1[j]; | ||
234 | if (!p2) | ||
235 | continue; | ||
236 | for (k = 0; k < 64; k++) { | ||
237 | glyph = p2[k]; | ||
238 | if (glyph >= 0 && glyph < MAX_GLYPH | ||
239 | && q[glyph] < 32) | ||
240 | q[glyph] = (i << 11) + (j << 6) + k; | ||
241 | } | ||
242 | } | ||
243 | } | ||
244 | } | ||
245 | |||
210 | unsigned short *set_translate(int m, struct vc_data *vc) | 246 | unsigned short *set_translate(int m, struct vc_data *vc) |
211 | { | 247 | { |
212 | inv_translate[vc->vc_num] = m; | 248 | inv_translate[vc->vc_num] = m; |
@@ -217,19 +253,29 @@ unsigned short *set_translate(int m, struct vc_data *vc) | |||
217 | * Inverse translation is impossible for several reasons: | 253 | * Inverse translation is impossible for several reasons: |
218 | * 1. The font<->character maps are not 1-1. | 254 | * 1. The font<->character maps are not 1-1. |
219 | * 2. The text may have been written while a different translation map | 255 | * 2. The text may have been written while a different translation map |
220 | * was active, or using Unicode. | 256 | * was active. |
221 | * Still, it is now possible to a certain extent to cut and paste non-ASCII. | 257 | * Still, it is now possible to a certain extent to cut and paste non-ASCII. |
222 | */ | 258 | */ |
223 | unsigned char inverse_translate(struct vc_data *conp, int glyph) | 259 | u16 inverse_translate(struct vc_data *conp, int glyph, int use_unicode) |
224 | { | 260 | { |
225 | struct uni_pagedir *p; | 261 | struct uni_pagedir *p; |
262 | int m; | ||
226 | if (glyph < 0 || glyph >= MAX_GLYPH) | 263 | if (glyph < 0 || glyph >= MAX_GLYPH) |
227 | return 0; | 264 | return 0; |
228 | else if (!(p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc) || | 265 | else if (!(p = (struct uni_pagedir *)*conp->vc_uni_pagedir_loc)) |
229 | !p->inverse_translations[inv_translate[conp->vc_num]]) | ||
230 | return glyph; | 266 | return glyph; |
231 | else | 267 | else if (use_unicode) { |
232 | return p->inverse_translations[inv_translate[conp->vc_num]][glyph]; | 268 | if (!p->inverse_trans_unicode) |
269 | return glyph; | ||
270 | else | ||
271 | return p->inverse_trans_unicode[glyph]; | ||
272 | } else { | ||
273 | m = inv_translate[conp->vc_num]; | ||
274 | if (!p->inverse_translations[m]) | ||
275 | return glyph; | ||
276 | else | ||
277 | return p->inverse_translations[m][glyph]; | ||
278 | } | ||
233 | } | 279 | } |
234 | 280 | ||
235 | static void update_user_maps(void) | 281 | static void update_user_maps(void) |
@@ -243,6 +289,7 @@ static void update_user_maps(void) | |||
243 | p = (struct uni_pagedir *)*vc_cons[i].d->vc_uni_pagedir_loc; | 289 | p = (struct uni_pagedir *)*vc_cons[i].d->vc_uni_pagedir_loc; |
244 | if (p && p != q) { | 290 | if (p && p != q) { |
245 | set_inverse_transl(vc_cons[i].d, p, USER_MAP); | 291 | set_inverse_transl(vc_cons[i].d, p, USER_MAP); |
292 | set_inverse_trans_unicode(vc_cons[i].d, p); | ||
246 | q = p; | 293 | q = p; |
247 | } | 294 | } |
248 | } | 295 | } |
@@ -353,6 +400,10 @@ static void con_release_unimap(struct uni_pagedir *p) | |||
353 | kfree(p->inverse_translations[i]); | 400 | kfree(p->inverse_translations[i]); |
354 | p->inverse_translations[i] = NULL; | 401 | p->inverse_translations[i] = NULL; |
355 | } | 402 | } |
403 | if (p->inverse_trans_unicode) { | ||
404 | kfree(p->inverse_trans_unicode); | ||
405 | p->inverse_trans_unicode = NULL; | ||
406 | } | ||
356 | } | 407 | } |
357 | 408 | ||
358 | void con_free_unimap(struct vc_data *vc) | 409 | void con_free_unimap(struct vc_data *vc) |
@@ -511,6 +562,7 @@ int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list) | |||
511 | 562 | ||
512 | for (i = 0; i <= 3; i++) | 563 | for (i = 0; i <= 3; i++) |
513 | set_inverse_transl(vc, p, i); /* Update all inverse translations */ | 564 | set_inverse_transl(vc, p, i); /* Update all inverse translations */ |
565 | set_inverse_trans_unicode(vc, p); | ||
514 | 566 | ||
515 | return err; | 567 | return err; |
516 | } | 568 | } |
@@ -561,6 +613,7 @@ int con_set_default_unimap(struct vc_data *vc) | |||
561 | 613 | ||
562 | for (i = 0; i <= 3; i++) | 614 | for (i = 0; i <= 3; i++) |
563 | set_inverse_transl(vc, p, i); /* Update all inverse translations */ | 615 | set_inverse_transl(vc, p, i); /* Update all inverse translations */ |
616 | set_inverse_trans_unicode(vc, p); | ||
564 | dflt = p; | 617 | dflt = p; |
565 | return err; | 618 | return err; |
566 | } | 619 | } |
@@ -617,6 +670,19 @@ void con_protect_unimap(struct vc_data *vc, int rdonly) | |||
617 | p->readonly = rdonly; | 670 | p->readonly = rdonly; |
618 | } | 671 | } |
619 | 672 | ||
673 | /* may be called during an interrupt */ | ||
674 | u32 conv_8bit_to_uni(unsigned char c) | ||
675 | { | ||
676 | /* | ||
677 | * Always use USER_MAP. This function is used by the keyboard, | ||
678 | * which shouldn't be affected by G0/G1 switching, etc. | ||
679 | * If the user map still contains default values, i.e. the | ||
680 | * direct-to-font mapping, then assume user is using Latin1. | ||
681 | */ | ||
682 | unsigned short uni = translations[USER_MAP][c]; | ||
683 | return uni == (0xf000 | c) ? c : uni; | ||
684 | } | ||
685 | |||
620 | int | 686 | int |
621 | conv_uni_to_pc(struct vc_data *conp, long ucs) | 687 | conv_uni_to_pc(struct vc_data *conp, long ucs) |
622 | { | 688 | { |
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index ca376b92162c..e04005b5f8a6 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c | |||
@@ -4127,10 +4127,6 @@ static void cy_set_termios(struct tty_struct *tty, struct ktermios *old_termios) | |||
4127 | printk(KERN_DEBUG "cyc:cy_set_termios ttyC%d\n", info->line); | 4127 | printk(KERN_DEBUG "cyc:cy_set_termios ttyC%d\n", info->line); |
4128 | #endif | 4128 | #endif |
4129 | 4129 | ||
4130 | if (tty->termios->c_cflag == old_termios->c_cflag && | ||
4131 | (tty->termios->c_iflag & (IXON | IXANY)) == | ||
4132 | (old_termios->c_iflag & (IXON | IXANY))) | ||
4133 | return; | ||
4134 | set_line_char(info); | 4130 | set_line_char(info); |
4135 | 4131 | ||
4136 | if ((old_termios->c_cflag & CRTSCTS) && | 4132 | if ((old_termios->c_cflag & CRTSCTS) && |
diff --git a/drivers/char/esp.c b/drivers/char/esp.c index d1bfbaa2aa02..74cd5118af57 100644 --- a/drivers/char/esp.c +++ b/drivers/char/esp.c | |||
@@ -1121,8 +1121,6 @@ static void change_speed(struct esp_struct *info) | |||
1121 | /* | 1121 | /* |
1122 | * Set up parity check flag | 1122 | * Set up parity check flag |
1123 | */ | 1123 | */ |
1124 | #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) | ||
1125 | |||
1126 | info->read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; | 1124 | info->read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; |
1127 | if (I_INPCK(info->tty)) | 1125 | if (I_INPCK(info->tty)) |
1128 | info->read_status_mask |= UART_LSR_FE | UART_LSR_PE; | 1126 | info->read_status_mask |= UART_LSR_FE | UART_LSR_PE; |
@@ -1920,11 +1918,6 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) | |||
1920 | struct esp_struct *info = (struct esp_struct *)tty->driver_data; | 1918 | struct esp_struct *info = (struct esp_struct *)tty->driver_data; |
1921 | unsigned long flags; | 1919 | unsigned long flags; |
1922 | 1920 | ||
1923 | if ( (tty->termios->c_cflag == old_termios->c_cflag) | ||
1924 | && ( RELEVANT_IFLAG(tty->termios->c_iflag) | ||
1925 | == RELEVANT_IFLAG(old_termios->c_iflag))) | ||
1926 | return; | ||
1927 | |||
1928 | change_speed(info); | 1921 | change_speed(info); |
1929 | 1922 | ||
1930 | spin_lock_irqsave(&info->lock, flags); | 1923 | spin_lock_irqsave(&info->lock, flags); |
diff --git a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c index 8ea02755b1c9..8facf3e25c49 100644 --- a/drivers/char/generic_serial.c +++ b/drivers/char/generic_serial.c | |||
@@ -43,16 +43,6 @@ static int gs_debug; | |||
43 | 43 | ||
44 | #define func_enter() gs_dprintk (GS_DEBUG_FLOW, "gs: enter %s\n", __FUNCTION__) | 44 | #define func_enter() gs_dprintk (GS_DEBUG_FLOW, "gs: enter %s\n", __FUNCTION__) |
45 | #define func_exit() gs_dprintk (GS_DEBUG_FLOW, "gs: exit %s\n", __FUNCTION__) | 45 | #define func_exit() gs_dprintk (GS_DEBUG_FLOW, "gs: exit %s\n", __FUNCTION__) |
46 | #define NEW_WRITE_LOCKING 1 | ||
47 | #if NEW_WRITE_LOCKING | ||
48 | #define DECL /* Nothing */ | ||
49 | #define LOCKIT mutex_lock(& port->port_write_mutex); | ||
50 | #define RELEASEIT mutex_unlock(&port->port_write_mutex); | ||
51 | #else | ||
52 | #define DECL unsigned long flags; | ||
53 | #define LOCKIT save_flags (flags);cli () | ||
54 | #define RELEASEIT restore_flags (flags) | ||
55 | #endif | ||
56 | 46 | ||
57 | #define RS_EVENT_WRITE_WAKEUP 1 | 47 | #define RS_EVENT_WRITE_WAKEUP 1 |
58 | 48 | ||
@@ -62,7 +52,6 @@ module_param(gs_debug, int, 0644); | |||
62 | void gs_put_char(struct tty_struct * tty, unsigned char ch) | 52 | void gs_put_char(struct tty_struct * tty, unsigned char ch) |
63 | { | 53 | { |
64 | struct gs_port *port; | 54 | struct gs_port *port; |
65 | DECL | ||
66 | 55 | ||
67 | func_enter (); | 56 | func_enter (); |
68 | 57 | ||
@@ -75,11 +64,11 @@ void gs_put_char(struct tty_struct * tty, unsigned char ch) | |||
75 | if (! (port->flags & ASYNC_INITIALIZED)) return; | 64 | if (! (port->flags & ASYNC_INITIALIZED)) return; |
76 | 65 | ||
77 | /* Take a lock on the serial tranmit buffer! */ | 66 | /* Take a lock on the serial tranmit buffer! */ |
78 | LOCKIT; | 67 | mutex_lock(& port->port_write_mutex); |
79 | 68 | ||
80 | if (port->xmit_cnt >= SERIAL_XMIT_SIZE - 1) { | 69 | if (port->xmit_cnt >= SERIAL_XMIT_SIZE - 1) { |
81 | /* Sorry, buffer is full, drop character. Update statistics???? -- REW */ | 70 | /* Sorry, buffer is full, drop character. Update statistics???? -- REW */ |
82 | RELEASEIT; | 71 | mutex_unlock(&port->port_write_mutex); |
83 | return; | 72 | return; |
84 | } | 73 | } |
85 | 74 | ||
@@ -87,13 +76,11 @@ void gs_put_char(struct tty_struct * tty, unsigned char ch) | |||
87 | port->xmit_head &= SERIAL_XMIT_SIZE - 1; | 76 | port->xmit_head &= SERIAL_XMIT_SIZE - 1; |
88 | port->xmit_cnt++; /* Characters in buffer */ | 77 | port->xmit_cnt++; /* Characters in buffer */ |
89 | 78 | ||
90 | RELEASEIT; | 79 | mutex_unlock(&port->port_write_mutex); |
91 | func_exit (); | 80 | func_exit (); |
92 | } | 81 | } |
93 | 82 | ||
94 | 83 | ||
95 | #ifdef NEW_WRITE_LOCKING | ||
96 | |||
97 | /* | 84 | /* |
98 | > Problems to take into account are: | 85 | > Problems to take into account are: |
99 | > -1- Interrupts that empty part of the buffer. | 86 | > -1- Interrupts that empty part of the buffer. |
@@ -166,90 +153,6 @@ int gs_write(struct tty_struct * tty, | |||
166 | func_exit (); | 153 | func_exit (); |
167 | return total; | 154 | return total; |
168 | } | 155 | } |
169 | #else | ||
170 | /* | ||
171 | > Problems to take into account are: | ||
172 | > -1- Interrupts that empty part of the buffer. | ||
173 | > -2- page faults on the access to userspace. | ||
174 | > -3- Other processes that are also trying to do a "write". | ||
175 | */ | ||
176 | |||
177 | int gs_write(struct tty_struct * tty, | ||
178 | const unsigned char *buf, int count) | ||
179 | { | ||
180 | struct gs_port *port; | ||
181 | int c, total = 0; | ||
182 | int t; | ||
183 | unsigned long flags; | ||
184 | |||
185 | func_enter (); | ||
186 | |||
187 | /* The standard serial driver returns 0 in this case. | ||
188 | That sounds to me as "No error, I just didn't get to writing any | ||
189 | bytes. Feel free to try again." | ||
190 | The "official" way to write n bytes from buf is: | ||
191 | |||
192 | for (nwritten = 0;nwritten < n;nwritten += rv) { | ||
193 | rv = write (fd, buf+nwritten, n-nwritten); | ||
194 | if (rv < 0) break; // Error: bail out. // | ||
195 | } | ||
196 | |||
197 | which will loop endlessly in this case. The manual page for write | ||
198 | agrees with me. In practise almost everybody writes | ||
199 | "write (fd, buf,n);" but some people might have had to deal with | ||
200 | incomplete writes in the past and correctly implemented it by now... | ||
201 | */ | ||
202 | |||
203 | if (!tty) return -EIO; | ||
204 | |||
205 | port = tty->driver_data; | ||
206 | if (!port || !port->xmit_buf) | ||
207 | return -EIO; | ||
208 | |||
209 | local_save_flags(flags); | ||
210 | while (1) { | ||
211 | cli(); | ||
212 | c = count; | ||
213 | |||
214 | /* This is safe because we "OWN" the "head". Noone else can | ||
215 | change the "head": we own the port_write_mutex. */ | ||
216 | /* Don't overrun the end of the buffer */ | ||
217 | t = SERIAL_XMIT_SIZE - port->xmit_head; | ||
218 | if (t < c) c = t; | ||
219 | |||
220 | /* This is safe because the xmit_cnt can only decrease. This | ||
221 | would increase "t", so we might copy too little chars. */ | ||
222 | /* Don't copy past the "head" of the buffer */ | ||
223 | t = SERIAL_XMIT_SIZE - 1 - port->xmit_cnt; | ||
224 | if (t < c) c = t; | ||
225 | |||
226 | /* Can't copy more? break out! */ | ||
227 | if (c <= 0) { | ||
228 | local_restore_flags(flags); | ||
229 | break; | ||
230 | } | ||
231 | memcpy(port->xmit_buf + port->xmit_head, buf, c); | ||
232 | port->xmit_head = ((port->xmit_head + c) & | ||
233 | (SERIAL_XMIT_SIZE-1)); | ||
234 | port->xmit_cnt += c; | ||
235 | local_restore_flags(flags); | ||
236 | buf += c; | ||
237 | count -= c; | ||
238 | total += c; | ||
239 | } | ||
240 | |||
241 | if (port->xmit_cnt && | ||
242 | !tty->stopped && | ||
243 | !tty->hw_stopped && | ||
244 | !(port->flags & GS_TX_INTEN)) { | ||
245 | port->flags |= GS_TX_INTEN; | ||
246 | port->rd->enable_tx_interrupts (port); | ||
247 | } | ||
248 | func_exit (); | ||
249 | return total; | ||
250 | } | ||
251 | |||
252 | #endif | ||
253 | 156 | ||
254 | 157 | ||
255 | 158 | ||
@@ -737,23 +640,6 @@ void gs_set_termios (struct tty_struct * tty, | |||
737 | gs_dprintk (GS_DEBUG_TERMIOS, "termios structure (%p):\n", tiosp); | 640 | gs_dprintk (GS_DEBUG_TERMIOS, "termios structure (%p):\n", tiosp); |
738 | } | 641 | } |
739 | 642 | ||
740 | /* This is an optimization that is only allowed for dumb cards */ | ||
741 | /* Smart cards require knowledge of iflags and oflags too: that | ||
742 | might change hardware cooking mode.... */ | ||
743 | if (old_termios) { | ||
744 | if( (tiosp->c_iflag == old_termios->c_iflag) | ||
745 | && (tiosp->c_oflag == old_termios->c_oflag) | ||
746 | && (tiosp->c_cflag == old_termios->c_cflag) | ||
747 | && (tiosp->c_lflag == old_termios->c_lflag) | ||
748 | && (tiosp->c_line == old_termios->c_line) | ||
749 | && (memcmp(tiosp->c_cc, old_termios->c_cc, NCC) == 0)) { | ||
750 | gs_dprintk(GS_DEBUG_TERMIOS, "gs_set_termios: optimized away\n"); | ||
751 | return /* 0 */; | ||
752 | } | ||
753 | } else | ||
754 | gs_dprintk(GS_DEBUG_TERMIOS, "gs_set_termios: no old_termios: " | ||
755 | "no optimization\n"); | ||
756 | |||
757 | if(old_termios && (gs_debug & GS_DEBUG_TERMIOS)) { | 643 | if(old_termios && (gs_debug & GS_DEBUG_TERMIOS)) { |
758 | if(tiosp->c_iflag != old_termios->c_iflag) printk("c_iflag changed\n"); | 644 | if(tiosp->c_iflag != old_termios->c_iflag) printk("c_iflag changed\n"); |
759 | if(tiosp->c_oflag != old_termios->c_oflag) printk("c_oflag changed\n"); | 645 | if(tiosp->c_oflag != old_termios->c_oflag) printk("c_oflag changed\n"); |
diff --git a/drivers/char/genrtc.c b/drivers/char/genrtc.c index 9e1fc02967ff..69f0a2993af0 100644 --- a/drivers/char/genrtc.c +++ b/drivers/char/genrtc.c | |||
@@ -173,7 +173,6 @@ static void gen_rtc_interrupt(unsigned long arg) | |||
173 | static ssize_t gen_rtc_read(struct file *file, char __user *buf, | 173 | static ssize_t gen_rtc_read(struct file *file, char __user *buf, |
174 | size_t count, loff_t *ppos) | 174 | size_t count, loff_t *ppos) |
175 | { | 175 | { |
176 | DECLARE_WAITQUEUE(wait, current); | ||
177 | unsigned long data; | 176 | unsigned long data; |
178 | ssize_t retval; | 177 | ssize_t retval; |
179 | 178 | ||
@@ -183,18 +182,10 @@ static ssize_t gen_rtc_read(struct file *file, char __user *buf, | |||
183 | if (file->f_flags & O_NONBLOCK && !gen_rtc_irq_data) | 182 | if (file->f_flags & O_NONBLOCK && !gen_rtc_irq_data) |
184 | return -EAGAIN; | 183 | return -EAGAIN; |
185 | 184 | ||
186 | add_wait_queue(&gen_rtc_wait, &wait); | 185 | retval = wait_event_interruptible(gen_rtc_wait, |
187 | retval = -ERESTARTSYS; | 186 | (data = xchg(&gen_rtc_irq_data, 0))); |
188 | 187 | if (retval) | |
189 | while (1) { | 188 | goto out; |
190 | set_current_state(TASK_INTERRUPTIBLE); | ||
191 | data = xchg(&gen_rtc_irq_data, 0); | ||
192 | if (data) | ||
193 | break; | ||
194 | if (signal_pending(current)) | ||
195 | goto out; | ||
196 | schedule(); | ||
197 | } | ||
198 | 189 | ||
199 | /* first test allows optimizer to nuke this case for 32-bit machines */ | 190 | /* first test allows optimizer to nuke this case for 32-bit machines */ |
200 | if (sizeof (int) != sizeof (long) && count == sizeof (unsigned int)) { | 191 | if (sizeof (int) != sizeof (long) && count == sizeof (unsigned int)) { |
@@ -206,10 +197,7 @@ static ssize_t gen_rtc_read(struct file *file, char __user *buf, | |||
206 | retval = put_user(data, (unsigned long __user *)buf) ?: | 197 | retval = put_user(data, (unsigned long __user *)buf) ?: |
207 | sizeof(unsigned long); | 198 | sizeof(unsigned long); |
208 | } | 199 | } |
209 | out: | 200 | out: |
210 | __set_current_state(TASK_RUNNING); | ||
211 | remove_wait_queue(&gen_rtc_wait, &wait); | ||
212 | |||
213 | return retval; | 201 | return retval; |
214 | } | 202 | } |
215 | 203 | ||
diff --git a/drivers/char/hw_random/intel-rng.c b/drivers/char/hw_random/intel-rng.c index 4ae9811d1a6c..753f46052b87 100644 --- a/drivers/char/hw_random/intel-rng.c +++ b/drivers/char/hw_random/intel-rng.c | |||
@@ -296,12 +296,10 @@ static int __init intel_init_hw_struct(struct intel_rng_hw *intel_rng_hw, | |||
296 | (BIOS_CNTL_LOCK_ENABLE_MASK|BIOS_CNTL_WRITE_ENABLE_MASK)) | 296 | (BIOS_CNTL_LOCK_ENABLE_MASK|BIOS_CNTL_WRITE_ENABLE_MASK)) |
297 | == BIOS_CNTL_LOCK_ENABLE_MASK) { | 297 | == BIOS_CNTL_LOCK_ENABLE_MASK) { |
298 | static __initdata /*const*/ char warning[] = | 298 | static __initdata /*const*/ char warning[] = |
299 | KERN_WARNING PFX "Firmware space is locked read-only. " | 299 | KERN_WARNING PFX "Firmware space is locked read-only. If you can't or\n" |
300 | KERN_WARNING PFX "If you can't or\n don't want to " | 300 | KERN_WARNING PFX "don't want to disable this in firmware setup, and if\n" |
301 | KERN_WARNING PFX "disable this in firmware setup, and " | 301 | KERN_WARNING PFX "you are certain that your system has a functional\n" |
302 | KERN_WARNING PFX "if\n you are certain that your " | 302 | KERN_WARNING PFX "RNG, try using the 'no_fwh_detect' option.\n"; |
303 | KERN_WARNING PFX "system has a functional\n RNG, try" | ||
304 | KERN_WARNING PFX "using the 'no_fwh_detect' option.\n"; | ||
305 | 303 | ||
306 | if (no_fwh_detect) | 304 | if (no_fwh_detect) |
307 | return -ENODEV; | 305 | return -ENODEV; |
diff --git a/drivers/char/ip2/i2ellis.c b/drivers/char/ip2/i2ellis.c index dd761a1e4f08..61ef013b8445 100644 --- a/drivers/char/ip2/i2ellis.c +++ b/drivers/char/ip2/i2ellis.c | |||
@@ -43,8 +43,6 @@ static void iiEnableMailIrqIIEX(i2eBordStrPtr); | |||
43 | static void iiWriteMaskII(i2eBordStrPtr, unsigned char); | 43 | static void iiWriteMaskII(i2eBordStrPtr, unsigned char); |
44 | static void iiWriteMaskIIEX(i2eBordStrPtr, unsigned char); | 44 | static void iiWriteMaskIIEX(i2eBordStrPtr, unsigned char); |
45 | 45 | ||
46 | static void ii2DelayTimer(unsigned int); | ||
47 | static void ii2DelayWakeup(unsigned long id); | ||
48 | static void ii2Nop(void); | 46 | static void ii2Nop(void); |
49 | 47 | ||
50 | //*************** | 48 | //*************** |
@@ -55,8 +53,6 @@ static int ii2Safe; // Safe I/O address for delay routine | |||
55 | 53 | ||
56 | static int iiDelayed; // Set when the iiResetDelay function is | 54 | static int iiDelayed; // Set when the iiResetDelay function is |
57 | // called. Cleared when ANY board is reset. | 55 | // called. Cleared when ANY board is reset. |
58 | static struct timer_list * pDelayTimer; // Used by iiDelayTimer | ||
59 | static wait_queue_head_t pDelayWait; // Used by iiDelayTimer | ||
60 | static rwlock_t Dl_spinlock; | 56 | static rwlock_t Dl_spinlock; |
61 | 57 | ||
62 | //******** | 58 | //******** |
@@ -86,9 +82,6 @@ static rwlock_t Dl_spinlock; | |||
86 | static void | 82 | static void |
87 | iiEllisInit(void) | 83 | iiEllisInit(void) |
88 | { | 84 | { |
89 | pDelayTimer = kmalloc ( sizeof (struct timer_list), GFP_KERNEL ); | ||
90 | init_timer(pDelayTimer); | ||
91 | init_waitqueue_head(&pDelayWait); | ||
92 | LOCK_INIT(&Dl_spinlock); | 85 | LOCK_INIT(&Dl_spinlock); |
93 | } | 86 | } |
94 | 87 | ||
@@ -106,7 +99,6 @@ iiEllisInit(void) | |||
106 | static void | 99 | static void |
107 | iiEllisCleanup(void) | 100 | iiEllisCleanup(void) |
108 | { | 101 | { |
109 | kfree(pDelayTimer); | ||
110 | } | 102 | } |
111 | 103 | ||
112 | //****************************************************************************** | 104 | //****************************************************************************** |
@@ -560,19 +552,6 @@ iiInitialize(i2eBordStrPtr pB) | |||
560 | COMPLETE(pB, I2EE_GOOD); | 552 | COMPLETE(pB, I2EE_GOOD); |
561 | } | 553 | } |
562 | 554 | ||
563 | //======================================================= | ||
564 | // Delay Routines | ||
565 | // | ||
566 | // iiDelayIO | ||
567 | // iiNop | ||
568 | //======================================================= | ||
569 | |||
570 | static void | ||
571 | ii2DelayWakeup(unsigned long id) | ||
572 | { | ||
573 | wake_up_interruptible ( &pDelayWait ); | ||
574 | } | ||
575 | |||
576 | //****************************************************************************** | 555 | //****************************************************************************** |
577 | // Function: ii2DelayTimer(mseconds) | 556 | // Function: ii2DelayTimer(mseconds) |
578 | // Parameters: mseconds - number of milliseconds to delay | 557 | // Parameters: mseconds - number of milliseconds to delay |
@@ -594,28 +573,7 @@ ii2DelayWakeup(unsigned long id) | |||
594 | static void | 573 | static void |
595 | ii2DelayTimer(unsigned int mseconds) | 574 | ii2DelayTimer(unsigned int mseconds) |
596 | { | 575 | { |
597 | wait_queue_t wait; | 576 | msleep_interruptible(mseconds); |
598 | |||
599 | init_waitqueue_entry(&wait, current); | ||
600 | |||
601 | init_timer ( pDelayTimer ); | ||
602 | |||
603 | add_wait_queue(&pDelayWait, &wait); | ||
604 | |||
605 | set_current_state( TASK_INTERRUPTIBLE ); | ||
606 | |||
607 | pDelayTimer->expires = jiffies + ( mseconds + 9 ) / 10; | ||
608 | pDelayTimer->function = ii2DelayWakeup; | ||
609 | pDelayTimer->data = 0; | ||
610 | |||
611 | add_timer ( pDelayTimer ); | ||
612 | |||
613 | schedule(); | ||
614 | |||
615 | set_current_state( TASK_RUNNING ); | ||
616 | remove_wait_queue(&pDelayWait, &wait); | ||
617 | |||
618 | del_timer ( pDelayTimer ); | ||
619 | } | 577 | } |
620 | 578 | ||
621 | #if 0 | 579 | #if 0 |
diff --git a/drivers/char/ipmi/Kconfig b/drivers/char/ipmi/Kconfig index b894f67fdf14..0baa8fab4ea7 100644 --- a/drivers/char/ipmi/Kconfig +++ b/drivers/char/ipmi/Kconfig | |||
@@ -2,11 +2,9 @@ | |||
2 | # IPMI device configuration | 2 | # IPMI device configuration |
3 | # | 3 | # |
4 | 4 | ||
5 | menu "IPMI" | 5 | menuconfig IPMI_HANDLER |
6 | depends on HAS_IOMEM | ||
7 | |||
8 | config IPMI_HANDLER | ||
9 | tristate 'IPMI top-level message handler' | 6 | tristate 'IPMI top-level message handler' |
7 | depends on HAS_IOMEM | ||
10 | help | 8 | help |
11 | This enables the central IPMI message handler, required for IPMI | 9 | This enables the central IPMI message handler, required for IPMI |
12 | to work. | 10 | to work. |
@@ -18,9 +16,10 @@ config IPMI_HANDLER | |||
18 | 16 | ||
19 | If unsure, say N. | 17 | If unsure, say N. |
20 | 18 | ||
19 | if IPMI_HANDLER | ||
20 | |||
21 | config IPMI_PANIC_EVENT | 21 | config IPMI_PANIC_EVENT |
22 | bool 'Generate a panic event to all BMCs on a panic' | 22 | bool 'Generate a panic event to all BMCs on a panic' |
23 | depends on IPMI_HANDLER | ||
24 | help | 23 | help |
25 | When a panic occurs, this will cause the IPMI message handler to | 24 | When a panic occurs, this will cause the IPMI message handler to |
26 | generate an IPMI event describing the panic to each interface | 25 | generate an IPMI event describing the panic to each interface |
@@ -40,14 +39,12 @@ config IPMI_PANIC_STRING | |||
40 | 39 | ||
41 | config IPMI_DEVICE_INTERFACE | 40 | config IPMI_DEVICE_INTERFACE |
42 | tristate 'Device interface for IPMI' | 41 | tristate 'Device interface for IPMI' |
43 | depends on IPMI_HANDLER | ||
44 | help | 42 | help |
45 | This provides an IOCTL interface to the IPMI message handler so | 43 | This provides an IOCTL interface to the IPMI message handler so |
46 | userland processes may use IPMI. It supports poll() and select(). | 44 | userland processes may use IPMI. It supports poll() and select(). |
47 | 45 | ||
48 | config IPMI_SI | 46 | config IPMI_SI |
49 | tristate 'IPMI System Interface handler' | 47 | tristate 'IPMI System Interface handler' |
50 | depends on IPMI_HANDLER | ||
51 | help | 48 | help |
52 | Provides a driver for System Interfaces (KCS, SMIC, BT). | 49 | Provides a driver for System Interfaces (KCS, SMIC, BT). |
53 | Currently, only KCS and SMIC are supported. If | 50 | Currently, only KCS and SMIC are supported. If |
@@ -55,15 +52,13 @@ config IPMI_SI | |||
55 | 52 | ||
56 | config IPMI_WATCHDOG | 53 | config IPMI_WATCHDOG |
57 | tristate 'IPMI Watchdog Timer' | 54 | tristate 'IPMI Watchdog Timer' |
58 | depends on IPMI_HANDLER | ||
59 | help | 55 | help |
60 | This enables the IPMI watchdog timer. | 56 | This enables the IPMI watchdog timer. |
61 | 57 | ||
62 | config IPMI_POWEROFF | 58 | config IPMI_POWEROFF |
63 | tristate 'IPMI Poweroff' | 59 | tristate 'IPMI Poweroff' |
64 | depends on IPMI_HANDLER | ||
65 | help | 60 | help |
66 | This enables a function to power off the system with IPMI if | 61 | This enables a function to power off the system with IPMI if |
67 | the IPMI management controller is capable of this. | 62 | the IPMI management controller is capable of this. |
68 | 63 | ||
69 | endmenu | 64 | endif # IPMI_HANDLER |
diff --git a/drivers/char/ipmi/ipmi_poweroff.c b/drivers/char/ipmi/ipmi_poweroff.c index e02893b7b300..b86186de7f07 100644 --- a/drivers/char/ipmi/ipmi_poweroff.c +++ b/drivers/char/ipmi/ipmi_poweroff.c | |||
@@ -679,7 +679,7 @@ static int ipmi_poweroff_init (void) | |||
679 | { | 679 | { |
680 | int rv; | 680 | int rv; |
681 | 681 | ||
682 | printk ("Copyright (C) 2004 MontaVista Software -" | 682 | printk (KERN_INFO "Copyright (C) 2004 MontaVista Software -" |
683 | " IPMI Powerdown via sys_reboot.\n"); | 683 | " IPMI Powerdown via sys_reboot.\n"); |
684 | 684 | ||
685 | if (poweroff_powercycle) | 685 | if (poweroff_powercycle) |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 78e1b962fe35..4edfdda0cf99 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -2857,7 +2857,7 @@ static int try_smi_init(struct smi_info *new_smi) | |||
2857 | 2857 | ||
2858 | mutex_unlock(&smi_infos_lock); | 2858 | mutex_unlock(&smi_infos_lock); |
2859 | 2859 | ||
2860 | printk(" IPMI %s interface initialized\n",si_to_str[new_smi->si_type]); | 2860 | printk(KERN_INFO "IPMI %s interface initialized\n",si_to_str[new_smi->si_type]); |
2861 | 2861 | ||
2862 | return 0; | 2862 | return 0; |
2863 | 2863 | ||
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c index 7b279d1de4a2..809409922996 100644 --- a/drivers/char/istallion.c +++ b/drivers/char/istallion.c | |||
@@ -1753,9 +1753,6 @@ static void stli_settermios(struct tty_struct *tty, struct ktermios *old) | |||
1753 | return; | 1753 | return; |
1754 | 1754 | ||
1755 | tiosp = tty->termios; | 1755 | tiosp = tty->termios; |
1756 | if ((tiosp->c_cflag == old->c_cflag) && | ||
1757 | (tiosp->c_iflag == old->c_iflag)) | ||
1758 | return; | ||
1759 | 1756 | ||
1760 | stli_mkasyport(portp, &aport, tiosp); | 1757 | stli_mkasyport(portp, &aport, tiosp); |
1761 | stli_cmdwait(brdp, portp, A_SETPORT, &aport, sizeof(asyport_t), 0); | 1758 | stli_cmdwait(brdp, portp, A_SETPORT, &aport, sizeof(asyport_t), 0); |
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index 90965b4def5c..2ce0af1bd588 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c | |||
@@ -24,6 +24,7 @@ | |||
24 | * 21-08-02: Converted to input API, major cleanup. (Vojtech Pavlik) | 24 | * 21-08-02: Converted to input API, major cleanup. (Vojtech Pavlik) |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include <linux/consolemap.h> | ||
27 | #include <linux/module.h> | 28 | #include <linux/module.h> |
28 | #include <linux/sched.h> | 29 | #include <linux/sched.h> |
29 | #include <linux/tty.h> | 30 | #include <linux/tty.h> |
@@ -308,10 +309,9 @@ static void applkey(struct vc_data *vc, int key, char mode) | |||
308 | * Many other routines do put_queue, but I think either | 309 | * Many other routines do put_queue, but I think either |
309 | * they produce ASCII, or they produce some user-assigned | 310 | * they produce ASCII, or they produce some user-assigned |
310 | * string, and in both cases we might assume that it is | 311 | * string, and in both cases we might assume that it is |
311 | * in utf-8 already. UTF-8 is defined for words of up to 31 bits, | 312 | * in utf-8 already. |
312 | * but we need only 16 bits here | ||
313 | */ | 313 | */ |
314 | static void to_utf8(struct vc_data *vc, ushort c) | 314 | static void to_utf8(struct vc_data *vc, uint c) |
315 | { | 315 | { |
316 | if (c < 0x80) | 316 | if (c < 0x80) |
317 | /* 0******* */ | 317 | /* 0******* */ |
@@ -320,11 +320,21 @@ static void to_utf8(struct vc_data *vc, ushort c) | |||
320 | /* 110***** 10****** */ | 320 | /* 110***** 10****** */ |
321 | put_queue(vc, 0xc0 | (c >> 6)); | 321 | put_queue(vc, 0xc0 | (c >> 6)); |
322 | put_queue(vc, 0x80 | (c & 0x3f)); | 322 | put_queue(vc, 0x80 | (c & 0x3f)); |
323 | } else { | 323 | } else if (c < 0x10000) { |
324 | if (c >= 0xD800 && c < 0xE000) | ||
325 | return; | ||
326 | if (c == 0xFFFF) | ||
327 | return; | ||
324 | /* 1110**** 10****** 10****** */ | 328 | /* 1110**** 10****** 10****** */ |
325 | put_queue(vc, 0xe0 | (c >> 12)); | 329 | put_queue(vc, 0xe0 | (c >> 12)); |
326 | put_queue(vc, 0x80 | ((c >> 6) & 0x3f)); | 330 | put_queue(vc, 0x80 | ((c >> 6) & 0x3f)); |
327 | put_queue(vc, 0x80 | (c & 0x3f)); | 331 | put_queue(vc, 0x80 | (c & 0x3f)); |
332 | } else if (c < 0x110000) { | ||
333 | /* 11110*** 10****** 10****** 10****** */ | ||
334 | put_queue(vc, 0xf0 | (c >> 18)); | ||
335 | put_queue(vc, 0x80 | ((c >> 12) & 0x3f)); | ||
336 | put_queue(vc, 0x80 | ((c >> 6) & 0x3f)); | ||
337 | put_queue(vc, 0x80 | (c & 0x3f)); | ||
328 | } | 338 | } |
329 | } | 339 | } |
330 | 340 | ||
@@ -393,7 +403,7 @@ static unsigned int handle_diacr(struct vc_data *vc, unsigned int ch) | |||
393 | return d; | 403 | return d; |
394 | 404 | ||
395 | if (kbd->kbdmode == VC_UNICODE) | 405 | if (kbd->kbdmode == VC_UNICODE) |
396 | to_utf8(vc, d); | 406 | to_utf8(vc, conv_8bit_to_uni(d)); |
397 | else if (d < 0x100) | 407 | else if (d < 0x100) |
398 | put_queue(vc, d); | 408 | put_queue(vc, d); |
399 | 409 | ||
@@ -407,7 +417,7 @@ static void fn_enter(struct vc_data *vc) | |||
407 | { | 417 | { |
408 | if (diacr) { | 418 | if (diacr) { |
409 | if (kbd->kbdmode == VC_UNICODE) | 419 | if (kbd->kbdmode == VC_UNICODE) |
410 | to_utf8(vc, diacr); | 420 | to_utf8(vc, conv_8bit_to_uni(diacr)); |
411 | else if (diacr < 0x100) | 421 | else if (diacr < 0x100) |
412 | put_queue(vc, diacr); | 422 | put_queue(vc, diacr); |
413 | diacr = 0; | 423 | diacr = 0; |
@@ -617,7 +627,7 @@ static void k_unicode(struct vc_data *vc, unsigned int value, char up_flag) | |||
617 | return; | 627 | return; |
618 | } | 628 | } |
619 | if (kbd->kbdmode == VC_UNICODE) | 629 | if (kbd->kbdmode == VC_UNICODE) |
620 | to_utf8(vc, value); | 630 | to_utf8(vc, conv_8bit_to_uni(value)); |
621 | else if (value < 0x100) | 631 | else if (value < 0x100) |
622 | put_queue(vc, value); | 632 | put_queue(vc, value); |
623 | } | 633 | } |
@@ -775,7 +785,7 @@ static void k_shift(struct vc_data *vc, unsigned char value, char up_flag) | |||
775 | /* kludge */ | 785 | /* kludge */ |
776 | if (up_flag && shift_state != old_state && npadch != -1) { | 786 | if (up_flag && shift_state != old_state && npadch != -1) { |
777 | if (kbd->kbdmode == VC_UNICODE) | 787 | if (kbd->kbdmode == VC_UNICODE) |
778 | to_utf8(vc, npadch & 0xffff); | 788 | to_utf8(vc, npadch); |
779 | else | 789 | else |
780 | put_queue(vc, npadch & 0xff); | 790 | put_queue(vc, npadch & 0xff); |
781 | npadch = -1; | 791 | npadch = -1; |
diff --git a/drivers/char/misc.c b/drivers/char/misc.c index 4e6fb9651a16..71c8cd7fa15f 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c | |||
@@ -67,25 +67,13 @@ extern int pmu_device_init(void); | |||
67 | #ifdef CONFIG_PROC_FS | 67 | #ifdef CONFIG_PROC_FS |
68 | static void *misc_seq_start(struct seq_file *seq, loff_t *pos) | 68 | static void *misc_seq_start(struct seq_file *seq, loff_t *pos) |
69 | { | 69 | { |
70 | struct miscdevice *p; | ||
71 | loff_t off = 0; | ||
72 | |||
73 | mutex_lock(&misc_mtx); | 70 | mutex_lock(&misc_mtx); |
74 | list_for_each_entry(p, &misc_list, list) { | 71 | return seq_list_start(&misc_list, *pos); |
75 | if (*pos == off++) | ||
76 | return p; | ||
77 | } | ||
78 | return NULL; | ||
79 | } | 72 | } |
80 | 73 | ||
81 | static void *misc_seq_next(struct seq_file *seq, void *v, loff_t *pos) | 74 | static void *misc_seq_next(struct seq_file *seq, void *v, loff_t *pos) |
82 | { | 75 | { |
83 | struct list_head *n = ((struct miscdevice *)v)->list.next; | 76 | return seq_list_next(v, &misc_list, pos); |
84 | |||
85 | ++*pos; | ||
86 | |||
87 | return (n != &misc_list) ? list_entry(n, struct miscdevice, list) | ||
88 | : NULL; | ||
89 | } | 77 | } |
90 | 78 | ||
91 | static void misc_seq_stop(struct seq_file *seq, void *v) | 79 | static void misc_seq_stop(struct seq_file *seq, void *v) |
@@ -95,7 +83,7 @@ static void misc_seq_stop(struct seq_file *seq, void *v) | |||
95 | 83 | ||
96 | static int misc_seq_show(struct seq_file *seq, void *v) | 84 | static int misc_seq_show(struct seq_file *seq, void *v) |
97 | { | 85 | { |
98 | const struct miscdevice *p = v; | 86 | const struct miscdevice *p = list_entry(v, struct miscdevice, list); |
99 | 87 | ||
100 | seq_printf(seq, "%3i %s\n", p->minor, p->name ? p->name : ""); | 88 | seq_printf(seq, "%3i %s\n", p->minor, p->name ? p->name : ""); |
101 | return 0; | 89 | return 0; |
diff --git a/drivers/char/mspec.c b/drivers/char/mspec.c index 7ac30612068b..c716ef0dd370 100644 --- a/drivers/char/mspec.c +++ b/drivers/char/mspec.c | |||
@@ -265,7 +265,7 @@ mspec_mmap(struct file *file, struct vm_area_struct *vma, int type) | |||
265 | vdata->refcnt = ATOMIC_INIT(1); | 265 | vdata->refcnt = ATOMIC_INIT(1); |
266 | vma->vm_private_data = vdata; | 266 | vma->vm_private_data = vdata; |
267 | 267 | ||
268 | vma->vm_flags |= (VM_IO | VM_LOCKED | VM_RESERVED | VM_PFNMAP); | 268 | vma->vm_flags |= (VM_IO | VM_RESERVED | VM_PFNMAP); |
269 | if (vdata->type == MSPEC_FETCHOP || vdata->type == MSPEC_UNCACHED) | 269 | if (vdata->type == MSPEC_FETCHOP || vdata->type == MSPEC_UNCACHED) |
270 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 270 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
271 | vma->vm_ops = &mspec_vm_ops; | 271 | vma->vm_ops = &mspec_vm_ops; |
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index 5953a45d7e96..2aee3fef0416 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c | |||
@@ -90,8 +90,6 @@ | |||
90 | #define UART_MCR_AFE 0x20 | 90 | #define UART_MCR_AFE 0x20 |
91 | #define UART_LSR_SPECIAL 0x1E | 91 | #define UART_LSR_SPECIAL 0x1E |
92 | 92 | ||
93 | #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK|\ | ||
94 | IXON|IXOFF)) | ||
95 | 93 | ||
96 | #define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? IRQF_SHARED : IRQF_DISABLED) | 94 | #define IRQ_T(info) ((info->flags & ASYNC_SHARE_IRQ) ? IRQF_SHARED : IRQF_DISABLED) |
97 | 95 | ||
@@ -1729,16 +1727,12 @@ static void mxser_set_termios(struct tty_struct *tty, struct ktermios *old_termi | |||
1729 | struct mxser_struct *info = tty->driver_data; | 1727 | struct mxser_struct *info = tty->driver_data; |
1730 | unsigned long flags; | 1728 | unsigned long flags; |
1731 | 1729 | ||
1732 | if ((tty->termios->c_cflag != old_termios->c_cflag) || | 1730 | mxser_change_speed(info, old_termios); |
1733 | (RELEVANT_IFLAG(tty->termios->c_iflag) != RELEVANT_IFLAG(old_termios->c_iflag))) { | ||
1734 | 1731 | ||
1735 | mxser_change_speed(info, old_termios); | 1732 | if ((old_termios->c_cflag & CRTSCTS) && |
1736 | 1733 | !(tty->termios->c_cflag & CRTSCTS)) { | |
1737 | if ((old_termios->c_cflag & CRTSCTS) && | 1734 | tty->hw_stopped = 0; |
1738 | !(tty->termios->c_cflag & CRTSCTS)) { | 1735 | mxser_start(tty); |
1739 | tty->hw_stopped = 0; | ||
1740 | mxser_start(tty); | ||
1741 | } | ||
1742 | } | 1736 | } |
1743 | 1737 | ||
1744 | /* Handle sw stopped */ | 1738 | /* Handle sw stopped */ |
diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c index 6cde448cd5b2..6a563932ba19 100644 --- a/drivers/char/mxser_new.c +++ b/drivers/char/mxser_new.c | |||
@@ -72,8 +72,6 @@ | |||
72 | #define UART_MCR_AFE 0x20 | 72 | #define UART_MCR_AFE 0x20 |
73 | #define UART_LSR_SPECIAL 0x1E | 73 | #define UART_LSR_SPECIAL 0x1E |
74 | 74 | ||
75 | #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK|\ | ||
76 | IXON|IXOFF)) | ||
77 | 75 | ||
78 | #define C168_ASIC_ID 1 | 76 | #define C168_ASIC_ID 1 |
79 | #define C104_ASIC_ID 2 | 77 | #define C104_ASIC_ID 2 |
@@ -1560,7 +1558,7 @@ static int mxser_ioctl_special(unsigned int cmd, void __user *argp) | |||
1560 | return -EFAULT; | 1558 | return -EFAULT; |
1561 | return 0; | 1559 | return 0; |
1562 | case MOXA_ASPP_MON_EXT: { | 1560 | case MOXA_ASPP_MON_EXT: { |
1563 | int status, p, shiftbit; | 1561 | int p, shiftbit; |
1564 | unsigned long opmode; | 1562 | unsigned long opmode; |
1565 | unsigned cflag, iflag; | 1563 | unsigned cflag, iflag; |
1566 | 1564 | ||
@@ -1990,18 +1988,14 @@ static void mxser_set_termios(struct tty_struct *tty, struct ktermios *old_termi | |||
1990 | struct mxser_port *info = tty->driver_data; | 1988 | struct mxser_port *info = tty->driver_data; |
1991 | unsigned long flags; | 1989 | unsigned long flags; |
1992 | 1990 | ||
1993 | if ((tty->termios->c_cflag != old_termios->c_cflag) || | 1991 | spin_lock_irqsave(&info->slock, flags); |
1994 | (RELEVANT_IFLAG(tty->termios->c_iflag) != RELEVANT_IFLAG(old_termios->c_iflag))) { | 1992 | mxser_change_speed(info, old_termios); |
1995 | 1993 | spin_unlock_irqrestore(&info->slock, flags); | |
1996 | spin_lock_irqsave(&info->slock, flags); | ||
1997 | mxser_change_speed(info, old_termios); | ||
1998 | spin_unlock_irqrestore(&info->slock, flags); | ||
1999 | 1994 | ||
2000 | if ((old_termios->c_cflag & CRTSCTS) && | 1995 | if ((old_termios->c_cflag & CRTSCTS) && |
2001 | !(tty->termios->c_cflag & CRTSCTS)) { | 1996 | !(tty->termios->c_cflag & CRTSCTS)) { |
2002 | tty->hw_stopped = 0; | 1997 | tty->hw_stopped = 0; |
2003 | mxser_start(tty); | 1998 | mxser_start(tty); |
2004 | } | ||
2005 | } | 1999 | } |
2006 | 2000 | ||
2007 | /* Handle sw stopped */ | 2001 | /* Handle sw stopped */ |
diff --git a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c index 337a87f86a3b..e8332f305d72 100644 --- a/drivers/char/n_hdlc.c +++ b/drivers/char/n_hdlc.c | |||
@@ -400,7 +400,12 @@ static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty) | |||
400 | /* Send the next block of data to device */ | 400 | /* Send the next block of data to device */ |
401 | tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); | 401 | tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); |
402 | actual = tty->driver->write(tty, tbuf->buf, tbuf->count); | 402 | actual = tty->driver->write(tty, tbuf->buf, tbuf->count); |
403 | 403 | ||
404 | /* rollback was possible and has been done */ | ||
405 | if (actual == -ERESTARTSYS) { | ||
406 | n_hdlc->tbuf = tbuf; | ||
407 | break; | ||
408 | } | ||
404 | /* if transmit error, throw frame away by */ | 409 | /* if transmit error, throw frame away by */ |
405 | /* pretending it was accepted by driver */ | 410 | /* pretending it was accepted by driver */ |
406 | if (actual < 0) | 411 | if (actual < 0) |
@@ -780,13 +785,14 @@ static unsigned int n_hdlc_tty_poll(struct tty_struct *tty, struct file *filp, | |||
780 | poll_wait(filp, &tty->write_wait, wait); | 785 | poll_wait(filp, &tty->write_wait, wait); |
781 | 786 | ||
782 | /* set bits for operations that won't block */ | 787 | /* set bits for operations that won't block */ |
783 | if(n_hdlc->rx_buf_list.head) | 788 | if (n_hdlc->rx_buf_list.head) |
784 | mask |= POLLIN | POLLRDNORM; /* readable */ | 789 | mask |= POLLIN | POLLRDNORM; /* readable */ |
785 | if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) | 790 | if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) |
786 | mask |= POLLHUP; | 791 | mask |= POLLHUP; |
787 | if(tty_hung_up_p(filp)) | 792 | if (tty_hung_up_p(filp)) |
788 | mask |= POLLHUP; | 793 | mask |= POLLHUP; |
789 | if(n_hdlc->tx_free_buf_list.head) | 794 | if (!tty_is_writelocked(tty) && |
795 | n_hdlc->tx_free_buf_list.head) | ||
790 | mask |= POLLOUT | POLLWRNORM; /* writable */ | 796 | mask |= POLLOUT | POLLWRNORM; /* writable */ |
791 | } | 797 | } |
792 | return mask; | 798 | return mask; |
@@ -861,7 +867,7 @@ static void n_hdlc_buf_put(struct n_hdlc_buf_list *list, | |||
861 | spin_lock_irqsave(&list->spinlock,flags); | 867 | spin_lock_irqsave(&list->spinlock,flags); |
862 | 868 | ||
863 | buf->link=NULL; | 869 | buf->link=NULL; |
864 | if(list->tail) | 870 | if (list->tail) |
865 | list->tail->link = buf; | 871 | list->tail->link = buf; |
866 | else | 872 | else |
867 | list->head = buf; | 873 | list->head = buf; |
diff --git a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c index 14557a4822c0..6b918b80f73e 100644 --- a/drivers/char/n_r3964.c +++ b/drivers/char/n_r3964.c | |||
@@ -1071,8 +1071,6 @@ static ssize_t r3964_read(struct tty_struct *tty, struct file *file, | |||
1071 | struct r3964_client_info *pClient; | 1071 | struct r3964_client_info *pClient; |
1072 | struct r3964_message *pMsg; | 1072 | struct r3964_message *pMsg; |
1073 | struct r3964_client_message theMsg; | 1073 | struct r3964_client_message theMsg; |
1074 | DECLARE_WAITQUEUE(wait, current); | ||
1075 | |||
1076 | int count; | 1074 | int count; |
1077 | 1075 | ||
1078 | TRACE_L("read()"); | 1076 | TRACE_L("read()"); |
@@ -1086,16 +1084,8 @@ static ssize_t r3964_read(struct tty_struct *tty, struct file *file, | |||
1086 | return -EAGAIN; | 1084 | return -EAGAIN; |
1087 | } | 1085 | } |
1088 | /* block until there is a message: */ | 1086 | /* block until there is a message: */ |
1089 | add_wait_queue(&pInfo->read_wait, &wait); | 1087 | wait_event_interruptible(pInfo->read_wait, |
1090 | repeat: | 1088 | (pMsg = remove_msg(pInfo, pClient))); |
1091 | __set_current_state(TASK_INTERRUPTIBLE); | ||
1092 | pMsg = remove_msg(pInfo, pClient); | ||
1093 | if (!pMsg && !signal_pending(current)) { | ||
1094 | schedule(); | ||
1095 | goto repeat; | ||
1096 | } | ||
1097 | __set_current_state(TASK_RUNNING); | ||
1098 | remove_wait_queue(&pInfo->read_wait, &wait); | ||
1099 | } | 1089 | } |
1100 | 1090 | ||
1101 | /* If we still haven't got a message, we must have been signalled */ | 1091 | /* If we still haven't got a message, we must have been signalled */ |
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c index 154f42203b05..038056911934 100644 --- a/drivers/char/n_tty.c +++ b/drivers/char/n_tty.c | |||
@@ -45,6 +45,8 @@ | |||
45 | #include <linux/slab.h> | 45 | #include <linux/slab.h> |
46 | #include <linux/poll.h> | 46 | #include <linux/poll.h> |
47 | #include <linux/bitops.h> | 47 | #include <linux/bitops.h> |
48 | #include <linux/audit.h> | ||
49 | #include <linux/file.h> | ||
48 | 50 | ||
49 | #include <asm/uaccess.h> | 51 | #include <asm/uaccess.h> |
50 | #include <asm/system.h> | 52 | #include <asm/system.h> |
@@ -78,6 +80,13 @@ static inline void free_buf(unsigned char *buf) | |||
78 | free_page((unsigned long) buf); | 80 | free_page((unsigned long) buf); |
79 | } | 81 | } |
80 | 82 | ||
83 | static inline int tty_put_user(struct tty_struct *tty, unsigned char x, | ||
84 | unsigned char __user *ptr) | ||
85 | { | ||
86 | tty_audit_add_data(tty, &x, 1); | ||
87 | return put_user(x, ptr); | ||
88 | } | ||
89 | |||
81 | /** | 90 | /** |
82 | * n_tty_set__room - receive space | 91 | * n_tty_set__room - receive space |
83 | * @tty: terminal | 92 | * @tty: terminal |
@@ -1153,6 +1162,7 @@ static int copy_from_read_buf(struct tty_struct *tty, | |||
1153 | if (n) { | 1162 | if (n) { |
1154 | retval = copy_to_user(*b, &tty->read_buf[tty->read_tail], n); | 1163 | retval = copy_to_user(*b, &tty->read_buf[tty->read_tail], n); |
1155 | n -= retval; | 1164 | n -= retval; |
1165 | tty_audit_add_data(tty, &tty->read_buf[tty->read_tail], n); | ||
1156 | spin_lock_irqsave(&tty->read_lock, flags); | 1166 | spin_lock_irqsave(&tty->read_lock, flags); |
1157 | tty->read_tail = (tty->read_tail + n) & (N_TTY_BUF_SIZE-1); | 1167 | tty->read_tail = (tty->read_tail + n) & (N_TTY_BUF_SIZE-1); |
1158 | tty->read_cnt -= n; | 1168 | tty->read_cnt -= n; |
@@ -1279,7 +1289,7 @@ do_it_again: | |||
1279 | break; | 1289 | break; |
1280 | cs = tty->link->ctrl_status; | 1290 | cs = tty->link->ctrl_status; |
1281 | tty->link->ctrl_status = 0; | 1291 | tty->link->ctrl_status = 0; |
1282 | if (put_user(cs, b++)) { | 1292 | if (tty_put_user(tty, cs, b++)) { |
1283 | retval = -EFAULT; | 1293 | retval = -EFAULT; |
1284 | b--; | 1294 | b--; |
1285 | break; | 1295 | break; |
@@ -1321,7 +1331,7 @@ do_it_again: | |||
1321 | 1331 | ||
1322 | /* Deal with packet mode. */ | 1332 | /* Deal with packet mode. */ |
1323 | if (tty->packet && b == buf) { | 1333 | if (tty->packet && b == buf) { |
1324 | if (put_user(TIOCPKT_DATA, b++)) { | 1334 | if (tty_put_user(tty, TIOCPKT_DATA, b++)) { |
1325 | retval = -EFAULT; | 1335 | retval = -EFAULT; |
1326 | b--; | 1336 | b--; |
1327 | break; | 1337 | break; |
@@ -1352,15 +1362,17 @@ do_it_again: | |||
1352 | spin_unlock_irqrestore(&tty->read_lock, flags); | 1362 | spin_unlock_irqrestore(&tty->read_lock, flags); |
1353 | 1363 | ||
1354 | if (!eol || (c != __DISABLED_CHAR)) { | 1364 | if (!eol || (c != __DISABLED_CHAR)) { |
1355 | if (put_user(c, b++)) { | 1365 | if (tty_put_user(tty, c, b++)) { |
1356 | retval = -EFAULT; | 1366 | retval = -EFAULT; |
1357 | b--; | 1367 | b--; |
1358 | break; | 1368 | break; |
1359 | } | 1369 | } |
1360 | nr--; | 1370 | nr--; |
1361 | } | 1371 | } |
1362 | if (eol) | 1372 | if (eol) { |
1373 | tty_audit_push(tty); | ||
1363 | break; | 1374 | break; |
1375 | } | ||
1364 | } | 1376 | } |
1365 | if (retval) | 1377 | if (retval) |
1366 | break; | 1378 | break; |
@@ -1538,7 +1550,8 @@ static unsigned int normal_poll(struct tty_struct * tty, struct file * file, pol | |||
1538 | else | 1550 | else |
1539 | tty->minimum_to_wake = 1; | 1551 | tty->minimum_to_wake = 1; |
1540 | } | 1552 | } |
1541 | if (tty->driver->chars_in_buffer(tty) < WAKEUP_CHARS && | 1553 | if (!tty_is_writelocked(tty) && |
1554 | tty->driver->chars_in_buffer(tty) < WAKEUP_CHARS && | ||
1542 | tty->driver->write_room(tty) > 0) | 1555 | tty->driver->write_room(tty) > 0) |
1543 | mask |= POLLOUT | POLLWRNORM; | 1556 | mask |= POLLOUT | POLLWRNORM; |
1544 | return mask; | 1557 | return mask; |
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c index 204deaa0de80..98dec380af49 100644 --- a/drivers/char/nvram.c +++ b/drivers/char/nvram.c | |||
@@ -42,19 +42,12 @@ | |||
42 | 42 | ||
43 | #define PC 1 | 43 | #define PC 1 |
44 | #define ATARI 2 | 44 | #define ATARI 2 |
45 | #define COBALT 3 | ||
46 | 45 | ||
47 | /* select machine configuration */ | 46 | /* select machine configuration */ |
48 | #if defined(CONFIG_ATARI) | 47 | #if defined(CONFIG_ATARI) |
49 | # define MACH ATARI | 48 | # define MACH ATARI |
50 | #elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) /* and others?? */ | 49 | #elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) /* and others?? */ |
51 | #define MACH PC | 50 | # define MACH PC |
52 | # if defined(CONFIG_COBALT) | ||
53 | # include <linux/cobalt-nvram.h> | ||
54 | # define MACH COBALT | ||
55 | # else | ||
56 | # define MACH PC | ||
57 | # endif | ||
58 | #else | 51 | #else |
59 | # error Cannot build nvram driver for this machine configuration. | 52 | # error Cannot build nvram driver for this machine configuration. |
60 | #endif | 53 | #endif |
@@ -76,18 +69,6 @@ | |||
76 | 69 | ||
77 | #endif | 70 | #endif |
78 | 71 | ||
79 | #if MACH == COBALT | ||
80 | |||
81 | #define CHECK_DRIVER_INIT() 1 | ||
82 | |||
83 | #define NVRAM_BYTES (128-NVRAM_FIRST_BYTE) | ||
84 | |||
85 | #define mach_check_checksum cobalt_check_checksum | ||
86 | #define mach_set_checksum cobalt_set_checksum | ||
87 | #define mach_proc_infos cobalt_proc_infos | ||
88 | |||
89 | #endif | ||
90 | |||
91 | #if MACH == ATARI | 72 | #if MACH == ATARI |
92 | 73 | ||
93 | /* Special parameters for RTC in Atari machines */ | 74 | /* Special parameters for RTC in Atari machines */ |
@@ -604,177 +585,6 @@ pc_proc_infos(unsigned char *nvram, char *buffer, int *len, | |||
604 | 585 | ||
605 | #endif /* MACH == PC */ | 586 | #endif /* MACH == PC */ |
606 | 587 | ||
607 | #if MACH == COBALT | ||
608 | |||
609 | /* the cobalt CMOS has a wider range of its checksum */ | ||
610 | static int cobalt_check_checksum(void) | ||
611 | { | ||
612 | int i; | ||
613 | unsigned short sum = 0; | ||
614 | unsigned short expect; | ||
615 | |||
616 | for (i = COBT_CMOS_CKS_START; i <= COBT_CMOS_CKS_END; ++i) { | ||
617 | if ((i == COBT_CMOS_CHECKSUM) || (i == (COBT_CMOS_CHECKSUM+1))) | ||
618 | continue; | ||
619 | |||
620 | sum += __nvram_read_byte(i); | ||
621 | } | ||
622 | expect = __nvram_read_byte(COBT_CMOS_CHECKSUM) << 8 | | ||
623 | __nvram_read_byte(COBT_CMOS_CHECKSUM+1); | ||
624 | return ((sum & 0xffff) == expect); | ||
625 | } | ||
626 | |||
627 | static void cobalt_set_checksum(void) | ||
628 | { | ||
629 | int i; | ||
630 | unsigned short sum = 0; | ||
631 | |||
632 | for (i = COBT_CMOS_CKS_START; i <= COBT_CMOS_CKS_END; ++i) { | ||
633 | if ((i == COBT_CMOS_CHECKSUM) || (i == (COBT_CMOS_CHECKSUM+1))) | ||
634 | continue; | ||
635 | |||
636 | sum += __nvram_read_byte(i); | ||
637 | } | ||
638 | |||
639 | __nvram_write_byte(sum >> 8, COBT_CMOS_CHECKSUM); | ||
640 | __nvram_write_byte(sum & 0xff, COBT_CMOS_CHECKSUM+1); | ||
641 | } | ||
642 | |||
643 | #ifdef CONFIG_PROC_FS | ||
644 | |||
645 | static int cobalt_proc_infos(unsigned char *nvram, char *buffer, int *len, | ||
646 | off_t *begin, off_t offset, int size) | ||
647 | { | ||
648 | int i; | ||
649 | unsigned int checksum; | ||
650 | unsigned int flags; | ||
651 | char sernum[14]; | ||
652 | char *key = "cNoEbTaWlOtR!"; | ||
653 | unsigned char bto_csum; | ||
654 | |||
655 | spin_lock_irq(&rtc_lock); | ||
656 | checksum = __nvram_check_checksum(); | ||
657 | spin_unlock_irq(&rtc_lock); | ||
658 | |||
659 | PRINT_PROC("Checksum status: %svalid\n", checksum ? "" : "not "); | ||
660 | |||
661 | flags = nvram[COBT_CMOS_FLAG_BYTE_0] << 8 | ||
662 | | nvram[COBT_CMOS_FLAG_BYTE_1]; | ||
663 | |||
664 | PRINT_PROC("Console: %s\n", | ||
665 | flags & COBT_CMOS_CONSOLE_FLAG ? "on": "off"); | ||
666 | |||
667 | PRINT_PROC("Firmware Debug Messages: %s\n", | ||
668 | flags & COBT_CMOS_DEBUG_FLAG ? "on": "off"); | ||
669 | |||
670 | PRINT_PROC("Auto Prompt: %s\n", | ||
671 | flags & COBT_CMOS_AUTO_PROMPT_FLAG ? "on": "off"); | ||
672 | |||
673 | PRINT_PROC("Shutdown Status: %s\n", | ||
674 | flags & COBT_CMOS_CLEAN_BOOT_FLAG ? "clean": "dirty"); | ||
675 | |||
676 | PRINT_PROC("Hardware Probe: %s\n", | ||
677 | flags & COBT_CMOS_HW_NOPROBE_FLAG ? "partial": "full"); | ||
678 | |||
679 | PRINT_PROC("System Fault: %sdetected\n", | ||
680 | flags & COBT_CMOS_SYSFAULT_FLAG ? "": "not "); | ||
681 | |||
682 | PRINT_PROC("Panic on OOPS: %s\n", | ||
683 | flags & COBT_CMOS_OOPSPANIC_FLAG ? "yes": "no"); | ||
684 | |||
685 | PRINT_PROC("Delayed Cache Initialization: %s\n", | ||
686 | flags & COBT_CMOS_DELAY_CACHE_FLAG ? "yes": "no"); | ||
687 | |||
688 | PRINT_PROC("Show Logo at Boot: %s\n", | ||
689 | flags & COBT_CMOS_NOLOGO_FLAG ? "no": "yes"); | ||
690 | |||
691 | PRINT_PROC("Boot Method: "); | ||
692 | switch (nvram[COBT_CMOS_BOOT_METHOD]) { | ||
693 | case COBT_CMOS_BOOT_METHOD_DISK: | ||
694 | PRINT_PROC("disk\n"); | ||
695 | break; | ||
696 | |||
697 | case COBT_CMOS_BOOT_METHOD_ROM: | ||
698 | PRINT_PROC("rom\n"); | ||
699 | break; | ||
700 | |||
701 | case COBT_CMOS_BOOT_METHOD_NET: | ||
702 | PRINT_PROC("net\n"); | ||
703 | break; | ||
704 | |||
705 | default: | ||
706 | PRINT_PROC("unknown\n"); | ||
707 | break; | ||
708 | } | ||
709 | |||
710 | PRINT_PROC("Primary Boot Device: %d:%d\n", | ||
711 | nvram[COBT_CMOS_BOOT_DEV0_MAJ], | ||
712 | nvram[COBT_CMOS_BOOT_DEV0_MIN] ); | ||
713 | PRINT_PROC("Secondary Boot Device: %d:%d\n", | ||
714 | nvram[COBT_CMOS_BOOT_DEV1_MAJ], | ||
715 | nvram[COBT_CMOS_BOOT_DEV1_MIN] ); | ||
716 | PRINT_PROC("Tertiary Boot Device: %d:%d\n", | ||
717 | nvram[COBT_CMOS_BOOT_DEV2_MAJ], | ||
718 | nvram[COBT_CMOS_BOOT_DEV2_MIN] ); | ||
719 | |||
720 | PRINT_PROC("Uptime: %d\n", | ||
721 | nvram[COBT_CMOS_UPTIME_0] << 24 | | ||
722 | nvram[COBT_CMOS_UPTIME_1] << 16 | | ||
723 | nvram[COBT_CMOS_UPTIME_2] << 8 | | ||
724 | nvram[COBT_CMOS_UPTIME_3]); | ||
725 | |||
726 | PRINT_PROC("Boot Count: %d\n", | ||
727 | nvram[COBT_CMOS_BOOTCOUNT_0] << 24 | | ||
728 | nvram[COBT_CMOS_BOOTCOUNT_1] << 16 | | ||
729 | nvram[COBT_CMOS_BOOTCOUNT_2] << 8 | | ||
730 | nvram[COBT_CMOS_BOOTCOUNT_3]); | ||
731 | |||
732 | /* 13 bytes of serial num */ | ||
733 | for (i=0 ; i<13 ; i++) { | ||
734 | sernum[i] = nvram[COBT_CMOS_SYS_SERNUM_0 + i]; | ||
735 | } | ||
736 | sernum[13] = '\0'; | ||
737 | |||
738 | checksum = 0; | ||
739 | for (i=0 ; i<13 ; i++) { | ||
740 | checksum += sernum[i] ^ key[i]; | ||
741 | } | ||
742 | checksum = ((checksum & 0x7f) ^ (0xd6)) & 0xff; | ||
743 | |||
744 | PRINT_PROC("Serial Number: %s", sernum); | ||
745 | if (checksum != nvram[COBT_CMOS_SYS_SERNUM_CSUM]) { | ||
746 | PRINT_PROC(" (invalid checksum)"); | ||
747 | } | ||
748 | PRINT_PROC("\n"); | ||
749 | |||
750 | PRINT_PROC("Rom Revison: %d.%d.%d\n", nvram[COBT_CMOS_ROM_REV_MAJ], | ||
751 | nvram[COBT_CMOS_ROM_REV_MIN], nvram[COBT_CMOS_ROM_REV_REV]); | ||
752 | |||
753 | PRINT_PROC("BTO Server: %d.%d.%d.%d", nvram[COBT_CMOS_BTO_IP_0], | ||
754 | nvram[COBT_CMOS_BTO_IP_1], nvram[COBT_CMOS_BTO_IP_2], | ||
755 | nvram[COBT_CMOS_BTO_IP_3]); | ||
756 | bto_csum = nvram[COBT_CMOS_BTO_IP_0] + nvram[COBT_CMOS_BTO_IP_1] | ||
757 | + nvram[COBT_CMOS_BTO_IP_2] + nvram[COBT_CMOS_BTO_IP_3]; | ||
758 | if (bto_csum != nvram[COBT_CMOS_BTO_IP_CSUM]) { | ||
759 | PRINT_PROC(" (invalid checksum)"); | ||
760 | } | ||
761 | PRINT_PROC("\n"); | ||
762 | |||
763 | if (flags & COBT_CMOS_VERSION_FLAG | ||
764 | && nvram[COBT_CMOS_VERSION] >= COBT_CMOS_VER_BTOCODE) { | ||
765 | PRINT_PROC("BTO Code: 0x%x\n", | ||
766 | nvram[COBT_CMOS_BTO_CODE_0] << 24 | | ||
767 | nvram[COBT_CMOS_BTO_CODE_1] << 16 | | ||
768 | nvram[COBT_CMOS_BTO_CODE_2] << 8 | | ||
769 | nvram[COBT_CMOS_BTO_CODE_3]); | ||
770 | } | ||
771 | |||
772 | return 1; | ||
773 | } | ||
774 | #endif /* CONFIG_PROC_FS */ | ||
775 | |||
776 | #endif /* MACH == COBALT */ | ||
777 | |||
778 | #if MACH == ATARI | 588 | #if MACH == ATARI |
779 | 589 | ||
780 | static int | 590 | static int |
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index a3fd7e7ba5a9..0270080ff0c0 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c | |||
@@ -1702,7 +1702,8 @@ static int rp_write(struct tty_struct *tty, | |||
1702 | if (count <= 0 || rocket_paranoia_check(info, "rp_write")) | 1702 | if (count <= 0 || rocket_paranoia_check(info, "rp_write")) |
1703 | return 0; | 1703 | return 0; |
1704 | 1704 | ||
1705 | mutex_lock_interruptible(&info->write_mtx); | 1705 | if (mutex_lock_interruptible(&info->write_mtx)) |
1706 | return -ERESTARTSYS; | ||
1706 | 1707 | ||
1707 | #ifdef ROCKET_DEBUG_WRITE | 1708 | #ifdef ROCKET_DEBUG_WRITE |
1708 | printk(KERN_INFO "rp_write %d chars...", count); | 1709 | printk(KERN_INFO "rp_write %d chars...", count); |
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index 20380a2c4dee..22cf7aa56cc4 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c | |||
@@ -1159,7 +1159,8 @@ static void rtc_dropped_irq(unsigned long data) | |||
1159 | 1159 | ||
1160 | spin_unlock_irq(&rtc_lock); | 1160 | spin_unlock_irq(&rtc_lock); |
1161 | 1161 | ||
1162 | printk(KERN_WARNING "rtc: lost some interrupts at %ldHz.\n", freq); | 1162 | if (printk_ratelimit()) |
1163 | printk(KERN_WARNING "rtc: lost some interrupts at %ldHz.\n", freq); | ||
1163 | 1164 | ||
1164 | /* Now we have new data */ | 1165 | /* Now we have new data */ |
1165 | wake_up_interruptible(&rtc_wait); | 1166 | wake_up_interruptible(&rtc_wait); |
diff --git a/drivers/char/selection.c b/drivers/char/selection.c index a69f094d1ed3..d63f5ccc29e6 100644 --- a/drivers/char/selection.c +++ b/drivers/char/selection.c | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
22 | 22 | ||
23 | #include <linux/kbd_kern.h> | ||
23 | #include <linux/vt_kern.h> | 24 | #include <linux/vt_kern.h> |
24 | #include <linux/consolemap.h> | 25 | #include <linux/consolemap.h> |
25 | #include <linux/selection.h> | 26 | #include <linux/selection.h> |
@@ -34,6 +35,7 @@ extern void poke_blanked_console(void); | |||
34 | /* Variables for selection control. */ | 35 | /* Variables for selection control. */ |
35 | /* Use a dynamic buffer, instead of static (Dec 1994) */ | 36 | /* Use a dynamic buffer, instead of static (Dec 1994) */ |
36 | struct vc_data *sel_cons; /* must not be deallocated */ | 37 | struct vc_data *sel_cons; /* must not be deallocated */ |
38 | static int use_unicode; | ||
37 | static volatile int sel_start = -1; /* cleared by clear_selection */ | 39 | static volatile int sel_start = -1; /* cleared by clear_selection */ |
38 | static int sel_end; | 40 | static int sel_end; |
39 | static int sel_buffer_lth; | 41 | static int sel_buffer_lth; |
@@ -54,10 +56,11 @@ static inline void highlight_pointer(const int where) | |||
54 | complement_pos(sel_cons, where); | 56 | complement_pos(sel_cons, where); |
55 | } | 57 | } |
56 | 58 | ||
57 | static unsigned char | 59 | static u16 |
58 | sel_pos(int n) | 60 | sel_pos(int n) |
59 | { | 61 | { |
60 | return inverse_translate(sel_cons, screen_glyph(sel_cons, n)); | 62 | return inverse_translate(sel_cons, screen_glyph(sel_cons, n), |
63 | use_unicode); | ||
61 | } | 64 | } |
62 | 65 | ||
63 | /* remove the current selection highlight, if any, | 66 | /* remove the current selection highlight, if any, |
@@ -86,8 +89,8 @@ static u32 inwordLut[8]={ | |||
86 | 0xFF7FFFFF /* latin-1 accented letters, not division sign */ | 89 | 0xFF7FFFFF /* latin-1 accented letters, not division sign */ |
87 | }; | 90 | }; |
88 | 91 | ||
89 | static inline int inword(const unsigned char c) { | 92 | static inline int inword(const u16 c) { |
90 | return ( inwordLut[c>>5] >> (c & 0x1F) ) & 1; | 93 | return c > 0xff || (( inwordLut[c>>5] >> (c & 0x1F) ) & 1); |
91 | } | 94 | } |
92 | 95 | ||
93 | /* set inwordLut contents. Invoked by ioctl(). */ | 96 | /* set inwordLut contents. Invoked by ioctl(). */ |
@@ -108,13 +111,36 @@ static inline unsigned short limit(const unsigned short v, const unsigned short | |||
108 | return (v > u) ? u : v; | 111 | return (v > u) ? u : v; |
109 | } | 112 | } |
110 | 113 | ||
114 | /* stores the char in UTF8 and returns the number of bytes used (1-3) */ | ||
115 | static int store_utf8(u16 c, char *p) | ||
116 | { | ||
117 | if (c < 0x80) { | ||
118 | /* 0******* */ | ||
119 | p[0] = c; | ||
120 | return 1; | ||
121 | } else if (c < 0x800) { | ||
122 | /* 110***** 10****** */ | ||
123 | p[0] = 0xc0 | (c >> 6); | ||
124 | p[1] = 0x80 | (c & 0x3f); | ||
125 | return 2; | ||
126 | } else { | ||
127 | /* 1110**** 10****** 10****** */ | ||
128 | p[0] = 0xe0 | (c >> 12); | ||
129 | p[1] = 0x80 | ((c >> 6) & 0x3f); | ||
130 | p[2] = 0x80 | (c & 0x3f); | ||
131 | return 3; | ||
132 | } | ||
133 | } | ||
134 | |||
111 | /* set the current selection. Invoked by ioctl() or by kernel code. */ | 135 | /* set the current selection. Invoked by ioctl() or by kernel code. */ |
112 | int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *tty) | 136 | int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *tty) |
113 | { | 137 | { |
114 | struct vc_data *vc = vc_cons[fg_console].d; | 138 | struct vc_data *vc = vc_cons[fg_console].d; |
115 | int sel_mode, new_sel_start, new_sel_end, spc; | 139 | int sel_mode, new_sel_start, new_sel_end, spc; |
116 | char *bp, *obp; | 140 | char *bp, *obp; |
117 | int i, ps, pe; | 141 | int i, ps, pe, multiplier; |
142 | u16 c; | ||
143 | struct kbd_struct *kbd = kbd_table + fg_console; | ||
118 | 144 | ||
119 | poke_blanked_console(); | 145 | poke_blanked_console(); |
120 | 146 | ||
@@ -158,6 +184,7 @@ int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *t | |||
158 | clear_selection(); | 184 | clear_selection(); |
159 | sel_cons = vc_cons[fg_console].d; | 185 | sel_cons = vc_cons[fg_console].d; |
160 | } | 186 | } |
187 | use_unicode = kbd && kbd->kbdmode == VC_UNICODE; | ||
161 | 188 | ||
162 | switch (sel_mode) | 189 | switch (sel_mode) |
163 | { | 190 | { |
@@ -240,7 +267,8 @@ int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *t | |||
240 | sel_end = new_sel_end; | 267 | sel_end = new_sel_end; |
241 | 268 | ||
242 | /* Allocate a new buffer before freeing the old one ... */ | 269 | /* Allocate a new buffer before freeing the old one ... */ |
243 | bp = kmalloc((sel_end-sel_start)/2+1, GFP_KERNEL); | 270 | multiplier = use_unicode ? 3 : 1; /* chars can take up to 3 bytes */ |
271 | bp = kmalloc((sel_end-sel_start)/2*multiplier+1, GFP_KERNEL); | ||
244 | if (!bp) { | 272 | if (!bp) { |
245 | printk(KERN_WARNING "selection: kmalloc() failed\n"); | 273 | printk(KERN_WARNING "selection: kmalloc() failed\n"); |
246 | clear_selection(); | 274 | clear_selection(); |
@@ -251,8 +279,12 @@ int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *t | |||
251 | 279 | ||
252 | obp = bp; | 280 | obp = bp; |
253 | for (i = sel_start; i <= sel_end; i += 2) { | 281 | for (i = sel_start; i <= sel_end; i += 2) { |
254 | *bp = sel_pos(i); | 282 | c = sel_pos(i); |
255 | if (!isspace(*bp++)) | 283 | if (use_unicode) |
284 | bp += store_utf8(c, bp); | ||
285 | else | ||
286 | *bp++ = c; | ||
287 | if (!isspace(c)) | ||
256 | obp = bp; | 288 | obp = bp; |
257 | if (! ((i + 2) % vc->vc_size_row)) { | 289 | if (! ((i + 2) % vc->vc_size_row)) { |
258 | /* strip trailing blanks from line and add newline, | 290 | /* strip trailing blanks from line and add newline, |
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index 3ef593a9015f..73037a4d3c50 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c | |||
@@ -885,53 +885,6 @@ found: | |||
885 | return IRQ_HANDLED; | 885 | return IRQ_HANDLED; |
886 | } | 886 | } |
887 | 887 | ||
888 | /* External camera command (exported to the motion eye v4l driver) */ | ||
889 | int sonypi_camera_command(int command, u8 value) | ||
890 | { | ||
891 | if (!camera) | ||
892 | return -EIO; | ||
893 | |||
894 | mutex_lock(&sonypi_device.lock); | ||
895 | |||
896 | switch (command) { | ||
897 | case SONYPI_COMMAND_SETCAMERA: | ||
898 | if (value) | ||
899 | sonypi_camera_on(); | ||
900 | else | ||
901 | sonypi_camera_off(); | ||
902 | break; | ||
903 | case SONYPI_COMMAND_SETCAMERABRIGHTNESS: | ||
904 | sonypi_set(SONYPI_CAMERA_BRIGHTNESS, value); | ||
905 | break; | ||
906 | case SONYPI_COMMAND_SETCAMERACONTRAST: | ||
907 | sonypi_set(SONYPI_CAMERA_CONTRAST, value); | ||
908 | break; | ||
909 | case SONYPI_COMMAND_SETCAMERAHUE: | ||
910 | sonypi_set(SONYPI_CAMERA_HUE, value); | ||
911 | break; | ||
912 | case SONYPI_COMMAND_SETCAMERACOLOR: | ||
913 | sonypi_set(SONYPI_CAMERA_COLOR, value); | ||
914 | break; | ||
915 | case SONYPI_COMMAND_SETCAMERASHARPNESS: | ||
916 | sonypi_set(SONYPI_CAMERA_SHARPNESS, value); | ||
917 | break; | ||
918 | case SONYPI_COMMAND_SETCAMERAPICTURE: | ||
919 | sonypi_set(SONYPI_CAMERA_PICTURE, value); | ||
920 | break; | ||
921 | case SONYPI_COMMAND_SETCAMERAAGC: | ||
922 | sonypi_set(SONYPI_CAMERA_AGC, value); | ||
923 | break; | ||
924 | default: | ||
925 | printk(KERN_ERR "sonypi: sonypi_camera_command invalid: %d\n", | ||
926 | command); | ||
927 | break; | ||
928 | } | ||
929 | mutex_unlock(&sonypi_device.lock); | ||
930 | return 0; | ||
931 | } | ||
932 | |||
933 | EXPORT_SYMBOL(sonypi_camera_command); | ||
934 | |||
935 | static int sonypi_misc_fasync(int fd, struct file *filp, int on) | 888 | static int sonypi_misc_fasync(int fd, struct file *filp, int on) |
936 | { | 889 | { |
937 | int retval; | 890 | int retval; |
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index f02a0795983f..f53e51ddb9d7 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c | |||
@@ -160,8 +160,6 @@ typedef struct _DMABUFFERENTRY | |||
160 | 160 | ||
161 | #define IO_PIN_SHUTDOWN_LIMIT 100 | 161 | #define IO_PIN_SHUTDOWN_LIMIT 100 |
162 | 162 | ||
163 | #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) | ||
164 | |||
165 | struct _input_signal_events { | 163 | struct _input_signal_events { |
166 | int ri_up; | 164 | int ri_up; |
167 | int ri_down; | 165 | int ri_down; |
@@ -3064,12 +3062,6 @@ static void mgsl_set_termios(struct tty_struct *tty, struct ktermios *old_termio | |||
3064 | printk("%s(%d):mgsl_set_termios %s\n", __FILE__,__LINE__, | 3062 | printk("%s(%d):mgsl_set_termios %s\n", __FILE__,__LINE__, |
3065 | tty->driver->name ); | 3063 | tty->driver->name ); |
3066 | 3064 | ||
3067 | /* just return if nothing has changed */ | ||
3068 | if ((tty->termios->c_cflag == old_termios->c_cflag) | ||
3069 | && (RELEVANT_IFLAG(tty->termios->c_iflag) | ||
3070 | == RELEVANT_IFLAG(old_termios->c_iflag))) | ||
3071 | return; | ||
3072 | |||
3073 | mgsl_change_params(info); | 3065 | mgsl_change_params(info); |
3074 | 3066 | ||
3075 | /* Handle transition to B0 status */ | 3067 | /* Handle transition to B0 status */ |
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index 02b49bc00028..428b514201f4 100644 --- a/drivers/char/synclink_gt.c +++ b/drivers/char/synclink_gt.c | |||
@@ -144,8 +144,6 @@ MODULE_PARM_DESC(dosyncppp, "Enable synchronous net device, 0=disable 1=enable") | |||
144 | /* | 144 | /* |
145 | * tty support and callbacks | 145 | * tty support and callbacks |
146 | */ | 146 | */ |
147 | #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) | ||
148 | |||
149 | static struct tty_driver *serial_driver; | 147 | static struct tty_driver *serial_driver; |
150 | 148 | ||
151 | static int open(struct tty_struct *tty, struct file * filp); | 149 | static int open(struct tty_struct *tty, struct file * filp); |
@@ -823,12 +821,6 @@ static void set_termios(struct tty_struct *tty, struct ktermios *old_termios) | |||
823 | 821 | ||
824 | DBGINFO(("%s set_termios\n", tty->driver->name)); | 822 | DBGINFO(("%s set_termios\n", tty->driver->name)); |
825 | 823 | ||
826 | /* just return if nothing has changed */ | ||
827 | if ((tty->termios->c_cflag == old_termios->c_cflag) | ||
828 | && (RELEVANT_IFLAG(tty->termios->c_iflag) | ||
829 | == RELEVANT_IFLAG(old_termios->c_iflag))) | ||
830 | return; | ||
831 | |||
832 | change_params(info); | 824 | change_params(info); |
833 | 825 | ||
834 | /* Handle transition to B0 status */ | 826 | /* Handle transition to B0 status */ |
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c index ef93d055bdd7..a65407b32079 100644 --- a/drivers/char/synclinkmp.c +++ b/drivers/char/synclinkmp.c | |||
@@ -135,8 +135,6 @@ typedef struct _SCADESC_EX | |||
135 | 135 | ||
136 | #define IO_PIN_SHUTDOWN_LIMIT 100 | 136 | #define IO_PIN_SHUTDOWN_LIMIT 100 |
137 | 137 | ||
138 | #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) | ||
139 | |||
140 | struct _input_signal_events { | 138 | struct _input_signal_events { |
141 | int ri_up; | 139 | int ri_up; |
142 | int ri_down; | 140 | int ri_down; |
@@ -927,12 +925,6 @@ static void set_termios(struct tty_struct *tty, struct ktermios *old_termios) | |||
927 | printk("%s(%d):%s set_termios()\n", __FILE__,__LINE__, | 925 | printk("%s(%d):%s set_termios()\n", __FILE__,__LINE__, |
928 | tty->driver->name ); | 926 | tty->driver->name ); |
929 | 927 | ||
930 | /* just return if nothing has changed */ | ||
931 | if ((tty->termios->c_cflag == old_termios->c_cflag) | ||
932 | && (RELEVANT_IFLAG(tty->termios->c_iflag) | ||
933 | == RELEVANT_IFLAG(old_termios->c_iflag))) | ||
934 | return; | ||
935 | |||
936 | change_params(info); | 928 | change_params(info); |
937 | 929 | ||
938 | /* Handle transition to B0 status */ | 930 | /* Handle transition to B0 status */ |
diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig index dc4e1ff7f56f..8f3f7620f95a 100644 --- a/drivers/char/tpm/Kconfig +++ b/drivers/char/tpm/Kconfig | |||
@@ -2,11 +2,9 @@ | |||
2 | # TPM device configuration | 2 | # TPM device configuration |
3 | # | 3 | # |
4 | 4 | ||
5 | menu "TPM devices" | 5 | menuconfig TCG_TPM |
6 | depends on HAS_IOMEM | ||
7 | |||
8 | config TCG_TPM | ||
9 | tristate "TPM Hardware Support" | 6 | tristate "TPM Hardware Support" |
7 | depends on HAS_IOMEM | ||
10 | depends on EXPERIMENTAL | 8 | depends on EXPERIMENTAL |
11 | ---help--- | 9 | ---help--- |
12 | If you have a TPM security chip in your system, which | 10 | If you have a TPM security chip in your system, which |
@@ -21,9 +19,11 @@ config TCG_TPM | |||
21 | Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI | 19 | Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI |
22 | and CONFIG_PNPACPI. | 20 | and CONFIG_PNPACPI. |
23 | 21 | ||
22 | if TCG_TPM | ||
23 | |||
24 | config TCG_TIS | 24 | config TCG_TIS |
25 | tristate "TPM Interface Specification 1.2 Interface" | 25 | tristate "TPM Interface Specification 1.2 Interface" |
26 | depends on TCG_TPM && PNPACPI | 26 | depends on PNPACPI |
27 | ---help--- | 27 | ---help--- |
28 | If you have a TPM security chip that is compliant with the | 28 | If you have a TPM security chip that is compliant with the |
29 | TCG TIS 1.2 TPM specification say Yes and it will be accessible | 29 | TCG TIS 1.2 TPM specification say Yes and it will be accessible |
@@ -32,7 +32,7 @@ config TCG_TIS | |||
32 | 32 | ||
33 | config TCG_NSC | 33 | config TCG_NSC |
34 | tristate "National Semiconductor TPM Interface" | 34 | tristate "National Semiconductor TPM Interface" |
35 | depends on TCG_TPM && PNPACPI | 35 | depends on PNPACPI |
36 | ---help--- | 36 | ---help--- |
37 | If you have a TPM security chip from National Semiconductor | 37 | If you have a TPM security chip from National Semiconductor |
38 | say Yes and it will be accessible from within Linux. To | 38 | say Yes and it will be accessible from within Linux. To |
@@ -41,7 +41,6 @@ config TCG_NSC | |||
41 | 41 | ||
42 | config TCG_ATMEL | 42 | config TCG_ATMEL |
43 | tristate "Atmel TPM Interface" | 43 | tristate "Atmel TPM Interface" |
44 | depends on TCG_TPM | ||
45 | ---help--- | 44 | ---help--- |
46 | If you have a TPM security chip from Atmel say Yes and it | 45 | If you have a TPM security chip from Atmel say Yes and it |
47 | will be accessible from within Linux. To compile this driver | 46 | will be accessible from within Linux. To compile this driver |
@@ -49,7 +48,7 @@ config TCG_ATMEL | |||
49 | 48 | ||
50 | config TCG_INFINEON | 49 | config TCG_INFINEON |
51 | tristate "Infineon Technologies TPM Interface" | 50 | tristate "Infineon Technologies TPM Interface" |
52 | depends on TCG_TPM && PNPACPI | 51 | depends on PNPACPI |
53 | ---help--- | 52 | ---help--- |
54 | If you have a TPM security chip from Infineon Technologies | 53 | If you have a TPM security chip from Infineon Technologies |
55 | (either SLD 9630 TT 1.1 or SLB 9635 TT 1.2) say Yes and it | 54 | (either SLD 9630 TT 1.1 or SLB 9635 TT 1.2) say Yes and it |
@@ -59,5 +58,4 @@ config TCG_INFINEON | |||
59 | Further information on this driver and the supported hardware | 58 | Further information on this driver and the supported hardware |
60 | can be found at http://www.prosec.rub.de/tpm | 59 | can be found at http://www.prosec.rub.de/tpm |
61 | 60 | ||
62 | endmenu | 61 | endif # TCG_TPM |
63 | |||
diff --git a/drivers/char/tty_audit.c b/drivers/char/tty_audit.c new file mode 100644 index 000000000000..d222012c1b0c --- /dev/null +++ b/drivers/char/tty_audit.c | |||
@@ -0,0 +1,345 @@ | |||
1 | /* | ||
2 | * Creating audit events from TTY input. | ||
3 | * | ||
4 | * Copyright (C) 2007 Red Hat, Inc. All rights reserved. This copyrighted | ||
5 | * material is made available to anyone wishing to use, modify, copy, or | ||
6 | * redistribute it subject to the terms and conditions of the GNU General | ||
7 | * Public License v.2. | ||
8 | * | ||
9 | * Authors: Miloslav Trmac <mitr@redhat.com> | ||
10 | */ | ||
11 | |||
12 | #include <linux/audit.h> | ||
13 | #include <linux/file.h> | ||
14 | #include <linux/tty.h> | ||
15 | |||
16 | struct tty_audit_buf { | ||
17 | atomic_t count; | ||
18 | struct mutex mutex; /* Protects all data below */ | ||
19 | int major, minor; /* The TTY which the data is from */ | ||
20 | unsigned icanon:1; | ||
21 | size_t valid; | ||
22 | unsigned char *data; /* Allocated size N_TTY_BUF_SIZE */ | ||
23 | }; | ||
24 | |||
25 | static struct tty_audit_buf *tty_audit_buf_alloc(int major, int minor, | ||
26 | int icanon) | ||
27 | { | ||
28 | struct tty_audit_buf *buf; | ||
29 | |||
30 | buf = kmalloc(sizeof (*buf), GFP_KERNEL); | ||
31 | if (!buf) | ||
32 | goto err; | ||
33 | if (PAGE_SIZE != N_TTY_BUF_SIZE) | ||
34 | buf->data = kmalloc(N_TTY_BUF_SIZE, GFP_KERNEL); | ||
35 | else | ||
36 | buf->data = (unsigned char *)__get_free_page(GFP_KERNEL); | ||
37 | if (!buf->data) | ||
38 | goto err_buf; | ||
39 | atomic_set(&buf->count, 1); | ||
40 | mutex_init(&buf->mutex); | ||
41 | buf->major = major; | ||
42 | buf->minor = minor; | ||
43 | buf->icanon = icanon; | ||
44 | buf->valid = 0; | ||
45 | return buf; | ||
46 | |||
47 | err_buf: | ||
48 | kfree(buf); | ||
49 | err: | ||
50 | return NULL; | ||
51 | } | ||
52 | |||
53 | static void tty_audit_buf_free(struct tty_audit_buf *buf) | ||
54 | { | ||
55 | WARN_ON(buf->valid != 0); | ||
56 | if (PAGE_SIZE != N_TTY_BUF_SIZE) | ||
57 | kfree(buf->data); | ||
58 | else | ||
59 | free_page((unsigned long)buf->data); | ||
60 | kfree(buf); | ||
61 | } | ||
62 | |||
63 | static void tty_audit_buf_put(struct tty_audit_buf *buf) | ||
64 | { | ||
65 | if (atomic_dec_and_test(&buf->count)) | ||
66 | tty_audit_buf_free(buf); | ||
67 | } | ||
68 | |||
69 | /** | ||
70 | * tty_audit_buf_push - Push buffered data out | ||
71 | * | ||
72 | * Generate an audit message from the contents of @buf, which is owned by | ||
73 | * @tsk with @loginuid. @buf->mutex must be locked. | ||
74 | */ | ||
75 | static void tty_audit_buf_push(struct task_struct *tsk, uid_t loginuid, | ||
76 | struct tty_audit_buf *buf) | ||
77 | { | ||
78 | struct audit_buffer *ab; | ||
79 | |||
80 | if (buf->valid == 0) | ||
81 | return; | ||
82 | if (audit_enabled == 0) | ||
83 | return; | ||
84 | ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_TTY); | ||
85 | if (ab) { | ||
86 | char name[sizeof(tsk->comm)]; | ||
87 | |||
88 | audit_log_format(ab, "tty pid=%u uid=%u auid=%u major=%d " | ||
89 | "minor=%d comm=", tsk->pid, tsk->uid, | ||
90 | loginuid, buf->major, buf->minor); | ||
91 | get_task_comm(name, tsk); | ||
92 | audit_log_untrustedstring(ab, name); | ||
93 | audit_log_format(ab, " data="); | ||
94 | audit_log_n_untrustedstring(ab, buf->valid, buf->data); | ||
95 | audit_log_end(ab); | ||
96 | } | ||
97 | buf->valid = 0; | ||
98 | } | ||
99 | |||
100 | /** | ||
101 | * tty_audit_buf_push_current - Push buffered data out | ||
102 | * | ||
103 | * Generate an audit message from the contents of @buf, which is owned by | ||
104 | * the current task. @buf->mutex must be locked. | ||
105 | */ | ||
106 | static void tty_audit_buf_push_current(struct tty_audit_buf *buf) | ||
107 | { | ||
108 | tty_audit_buf_push(current, audit_get_loginuid(current->audit_context), | ||
109 | buf); | ||
110 | } | ||
111 | |||
112 | /** | ||
113 | * tty_audit_exit - Handle a task exit | ||
114 | * | ||
115 | * Make sure all buffered data is written out and deallocate the buffer. | ||
116 | * Only needs to be called if current->signal->tty_audit_buf != %NULL. | ||
117 | */ | ||
118 | void tty_audit_exit(void) | ||
119 | { | ||
120 | struct tty_audit_buf *buf; | ||
121 | |||
122 | spin_lock_irq(¤t->sighand->siglock); | ||
123 | buf = current->signal->tty_audit_buf; | ||
124 | current->signal->tty_audit_buf = NULL; | ||
125 | spin_unlock_irq(¤t->sighand->siglock); | ||
126 | if (!buf) | ||
127 | return; | ||
128 | |||
129 | mutex_lock(&buf->mutex); | ||
130 | tty_audit_buf_push_current(buf); | ||
131 | mutex_unlock(&buf->mutex); | ||
132 | |||
133 | tty_audit_buf_put(buf); | ||
134 | } | ||
135 | |||
136 | /** | ||
137 | * tty_audit_fork - Copy TTY audit state for a new task | ||
138 | * | ||
139 | * Set up TTY audit state in @sig from current. @sig needs no locking. | ||
140 | */ | ||
141 | void tty_audit_fork(struct signal_struct *sig) | ||
142 | { | ||
143 | spin_lock_irq(¤t->sighand->siglock); | ||
144 | sig->audit_tty = current->signal->audit_tty; | ||
145 | spin_unlock_irq(¤t->sighand->siglock); | ||
146 | sig->tty_audit_buf = NULL; | ||
147 | } | ||
148 | |||
149 | /** | ||
150 | * tty_audit_push_task - Flush task's pending audit data | ||
151 | */ | ||
152 | void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid) | ||
153 | { | ||
154 | struct tty_audit_buf *buf; | ||
155 | |||
156 | spin_lock_irq(&tsk->sighand->siglock); | ||
157 | buf = tsk->signal->tty_audit_buf; | ||
158 | if (buf) | ||
159 | atomic_inc(&buf->count); | ||
160 | spin_unlock_irq(&tsk->sighand->siglock); | ||
161 | if (!buf) | ||
162 | return; | ||
163 | |||
164 | mutex_lock(&buf->mutex); | ||
165 | tty_audit_buf_push(tsk, loginuid, buf); | ||
166 | mutex_unlock(&buf->mutex); | ||
167 | |||
168 | tty_audit_buf_put(buf); | ||
169 | } | ||
170 | |||
171 | /** | ||
172 | * tty_audit_buf_get - Get an audit buffer. | ||
173 | * | ||
174 | * Get an audit buffer for @tty, allocate it if necessary. Return %NULL | ||
175 | * if TTY auditing is disabled or out of memory. Otherwise, return a new | ||
176 | * reference to the buffer. | ||
177 | */ | ||
178 | static struct tty_audit_buf *tty_audit_buf_get(struct tty_struct *tty) | ||
179 | { | ||
180 | struct tty_audit_buf *buf, *buf2; | ||
181 | |||
182 | buf = NULL; | ||
183 | buf2 = NULL; | ||
184 | spin_lock_irq(¤t->sighand->siglock); | ||
185 | if (likely(!current->signal->audit_tty)) | ||
186 | goto out; | ||
187 | buf = current->signal->tty_audit_buf; | ||
188 | if (buf) { | ||
189 | atomic_inc(&buf->count); | ||
190 | goto out; | ||
191 | } | ||
192 | spin_unlock_irq(¤t->sighand->siglock); | ||
193 | |||
194 | buf2 = tty_audit_buf_alloc(tty->driver->major, | ||
195 | tty->driver->minor_start + tty->index, | ||
196 | tty->icanon); | ||
197 | if (buf2 == NULL) { | ||
198 | audit_log_lost("out of memory in TTY auditing"); | ||
199 | return NULL; | ||
200 | } | ||
201 | |||
202 | spin_lock_irq(¤t->sighand->siglock); | ||
203 | if (!current->signal->audit_tty) | ||
204 | goto out; | ||
205 | buf = current->signal->tty_audit_buf; | ||
206 | if (!buf) { | ||
207 | current->signal->tty_audit_buf = buf2; | ||
208 | buf = buf2; | ||
209 | buf2 = NULL; | ||
210 | } | ||
211 | atomic_inc(&buf->count); | ||
212 | /* Fall through */ | ||
213 | out: | ||
214 | spin_unlock_irq(¤t->sighand->siglock); | ||
215 | if (buf2) | ||
216 | tty_audit_buf_free(buf2); | ||
217 | return buf; | ||
218 | } | ||
219 | |||
220 | /** | ||
221 | * tty_audit_add_data - Add data for TTY auditing. | ||
222 | * | ||
223 | * Audit @data of @size from @tty, if necessary. | ||
224 | */ | ||
225 | void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, | ||
226 | size_t size) | ||
227 | { | ||
228 | struct tty_audit_buf *buf; | ||
229 | int major, minor; | ||
230 | |||
231 | if (unlikely(size == 0)) | ||
232 | return; | ||
233 | |||
234 | buf = tty_audit_buf_get(tty); | ||
235 | if (!buf) | ||
236 | return; | ||
237 | |||
238 | mutex_lock(&buf->mutex); | ||
239 | major = tty->driver->major; | ||
240 | minor = tty->driver->minor_start + tty->index; | ||
241 | if (buf->major != major || buf->minor != minor | ||
242 | || buf->icanon != tty->icanon) { | ||
243 | tty_audit_buf_push_current(buf); | ||
244 | buf->major = major; | ||
245 | buf->minor = minor; | ||
246 | buf->icanon = tty->icanon; | ||
247 | } | ||
248 | do { | ||
249 | size_t run; | ||
250 | |||
251 | run = N_TTY_BUF_SIZE - buf->valid; | ||
252 | if (run > size) | ||
253 | run = size; | ||
254 | memcpy(buf->data + buf->valid, data, run); | ||
255 | buf->valid += run; | ||
256 | data += run; | ||
257 | size -= run; | ||
258 | if (buf->valid == N_TTY_BUF_SIZE) | ||
259 | tty_audit_buf_push_current(buf); | ||
260 | } while (size != 0); | ||
261 | mutex_unlock(&buf->mutex); | ||
262 | tty_audit_buf_put(buf); | ||
263 | } | ||
264 | |||
265 | /** | ||
266 | * tty_audit_push - Push buffered data out | ||
267 | * | ||
268 | * Make sure no audit data is pending for @tty on the current process. | ||
269 | */ | ||
270 | void tty_audit_push(struct tty_struct *tty) | ||
271 | { | ||
272 | struct tty_audit_buf *buf; | ||
273 | |||
274 | spin_lock_irq(¤t->sighand->siglock); | ||
275 | if (likely(!current->signal->audit_tty)) { | ||
276 | spin_unlock_irq(¤t->sighand->siglock); | ||
277 | return; | ||
278 | } | ||
279 | buf = current->signal->tty_audit_buf; | ||
280 | if (buf) | ||
281 | atomic_inc(&buf->count); | ||
282 | spin_unlock_irq(¤t->sighand->siglock); | ||
283 | |||
284 | if (buf) { | ||
285 | int major, minor; | ||
286 | |||
287 | major = tty->driver->major; | ||
288 | minor = tty->driver->minor_start + tty->index; | ||
289 | mutex_lock(&buf->mutex); | ||
290 | if (buf->major == major && buf->minor == minor) | ||
291 | tty_audit_buf_push_current(buf); | ||
292 | mutex_unlock(&buf->mutex); | ||
293 | tty_audit_buf_put(buf); | ||
294 | } | ||
295 | } | ||
296 | |||
297 | /** | ||
298 | * tty_audit_opening - A TTY is being opened. | ||
299 | * | ||
300 | * As a special hack, tasks that close all their TTYs and open new ones | ||
301 | * are assumed to be system daemons (e.g. getty) and auditing is | ||
302 | * automatically disabled for them. | ||
303 | */ | ||
304 | void tty_audit_opening(void) | ||
305 | { | ||
306 | int disable; | ||
307 | |||
308 | disable = 1; | ||
309 | spin_lock_irq(¤t->sighand->siglock); | ||
310 | if (current->signal->audit_tty == 0) | ||
311 | disable = 0; | ||
312 | spin_unlock_irq(¤t->sighand->siglock); | ||
313 | if (!disable) | ||
314 | return; | ||
315 | |||
316 | task_lock(current); | ||
317 | if (current->files) { | ||
318 | struct fdtable *fdt; | ||
319 | unsigned i; | ||
320 | |||
321 | /* | ||
322 | * We don't take a ref to the file, so we must hold ->file_lock | ||
323 | * instead. | ||
324 | */ | ||
325 | spin_lock(¤t->files->file_lock); | ||
326 | fdt = files_fdtable(current->files); | ||
327 | for (i = 0; i < fdt->max_fds; i++) { | ||
328 | struct file *filp; | ||
329 | |||
330 | filp = fcheck_files(current->files, i); | ||
331 | if (filp && is_tty(filp)) { | ||
332 | disable = 0; | ||
333 | break; | ||
334 | } | ||
335 | } | ||
336 | spin_unlock(¤t->files->file_lock); | ||
337 | } | ||
338 | task_unlock(current); | ||
339 | if (!disable) | ||
340 | return; | ||
341 | |||
342 | spin_lock_irq(¤t->sighand->siglock); | ||
343 | current->signal->audit_tty = 0; | ||
344 | spin_unlock_irq(¤t->sighand->siglock); | ||
345 | } | ||
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index a96f26a63fa2..de37ebc3a4cf 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -1503,6 +1503,15 @@ int tty_hung_up_p(struct file * filp) | |||
1503 | 1503 | ||
1504 | EXPORT_SYMBOL(tty_hung_up_p); | 1504 | EXPORT_SYMBOL(tty_hung_up_p); |
1505 | 1505 | ||
1506 | /** | ||
1507 | * is_tty - checker whether file is a TTY | ||
1508 | */ | ||
1509 | int is_tty(struct file *filp) | ||
1510 | { | ||
1511 | return filp->f_op->read == tty_read | ||
1512 | || filp->f_op->read == hung_up_tty_read; | ||
1513 | } | ||
1514 | |||
1506 | static void session_clear_tty(struct pid *session) | 1515 | static void session_clear_tty(struct pid *session) |
1507 | { | 1516 | { |
1508 | struct task_struct *p; | 1517 | struct task_struct *p; |
@@ -1726,6 +1735,23 @@ static ssize_t tty_read(struct file * file, char __user * buf, size_t count, | |||
1726 | return i; | 1735 | return i; |
1727 | } | 1736 | } |
1728 | 1737 | ||
1738 | void tty_write_unlock(struct tty_struct *tty) | ||
1739 | { | ||
1740 | mutex_unlock(&tty->atomic_write_lock); | ||
1741 | wake_up_interruptible(&tty->write_wait); | ||
1742 | } | ||
1743 | |||
1744 | int tty_write_lock(struct tty_struct *tty, int ndelay) | ||
1745 | { | ||
1746 | if (!mutex_trylock(&tty->atomic_write_lock)) { | ||
1747 | if (ndelay) | ||
1748 | return -EAGAIN; | ||
1749 | if (mutex_lock_interruptible(&tty->atomic_write_lock)) | ||
1750 | return -ERESTARTSYS; | ||
1751 | } | ||
1752 | return 0; | ||
1753 | } | ||
1754 | |||
1729 | /* | 1755 | /* |
1730 | * Split writes up in sane blocksizes to avoid | 1756 | * Split writes up in sane blocksizes to avoid |
1731 | * denial-of-service type attacks | 1757 | * denial-of-service type attacks |
@@ -1737,13 +1763,12 @@ static inline ssize_t do_tty_write( | |||
1737 | const char __user *buf, | 1763 | const char __user *buf, |
1738 | size_t count) | 1764 | size_t count) |
1739 | { | 1765 | { |
1740 | ssize_t ret = 0, written = 0; | 1766 | ssize_t ret, written = 0; |
1741 | unsigned int chunk; | 1767 | unsigned int chunk; |
1742 | 1768 | ||
1743 | /* FIXME: O_NDELAY ... */ | 1769 | ret = tty_write_lock(tty, file->f_flags & O_NDELAY); |
1744 | if (mutex_lock_interruptible(&tty->atomic_write_lock)) { | 1770 | if (ret < 0) |
1745 | return -ERESTARTSYS; | 1771 | return ret; |
1746 | } | ||
1747 | 1772 | ||
1748 | /* | 1773 | /* |
1749 | * We chunk up writes into a temporary buffer. This | 1774 | * We chunk up writes into a temporary buffer. This |
@@ -1776,8 +1801,8 @@ static inline ssize_t do_tty_write( | |||
1776 | 1801 | ||
1777 | buf = kmalloc(chunk, GFP_KERNEL); | 1802 | buf = kmalloc(chunk, GFP_KERNEL); |
1778 | if (!buf) { | 1803 | if (!buf) { |
1779 | mutex_unlock(&tty->atomic_write_lock); | 1804 | ret = -ENOMEM; |
1780 | return -ENOMEM; | 1805 | goto out; |
1781 | } | 1806 | } |
1782 | kfree(tty->write_buf); | 1807 | kfree(tty->write_buf); |
1783 | tty->write_cnt = chunk; | 1808 | tty->write_cnt = chunk; |
@@ -1812,7 +1837,8 @@ static inline ssize_t do_tty_write( | |||
1812 | inode->i_mtime = current_fs_time(inode->i_sb); | 1837 | inode->i_mtime = current_fs_time(inode->i_sb); |
1813 | ret = written; | 1838 | ret = written; |
1814 | } | 1839 | } |
1815 | mutex_unlock(&tty->atomic_write_lock); | 1840 | out: |
1841 | tty_write_unlock(tty); | ||
1816 | return ret; | 1842 | return ret; |
1817 | } | 1843 | } |
1818 | 1844 | ||
@@ -2016,11 +2042,9 @@ static int init_dev(struct tty_driver *driver, int idx, | |||
2016 | } | 2042 | } |
2017 | 2043 | ||
2018 | if (!*ltp_loc) { | 2044 | if (!*ltp_loc) { |
2019 | ltp = (struct ktermios *) kmalloc(sizeof(struct ktermios), | 2045 | ltp = kzalloc(sizeof(struct ktermios), GFP_KERNEL); |
2020 | GFP_KERNEL); | ||
2021 | if (!ltp) | 2046 | if (!ltp) |
2022 | goto free_mem_out; | 2047 | goto free_mem_out; |
2023 | memset(ltp, 0, sizeof(struct ktermios)); | ||
2024 | } | 2048 | } |
2025 | 2049 | ||
2026 | if (driver->type == TTY_DRIVER_TYPE_PTY) { | 2050 | if (driver->type == TTY_DRIVER_TYPE_PTY) { |
@@ -2049,11 +2073,9 @@ static int init_dev(struct tty_driver *driver, int idx, | |||
2049 | } | 2073 | } |
2050 | 2074 | ||
2051 | if (!*o_ltp_loc) { | 2075 | if (!*o_ltp_loc) { |
2052 | o_ltp = (struct ktermios *) | 2076 | o_ltp = kzalloc(sizeof(struct ktermios), GFP_KERNEL); |
2053 | kmalloc(sizeof(struct ktermios), GFP_KERNEL); | ||
2054 | if (!o_ltp) | 2077 | if (!o_ltp) |
2055 | goto free_mem_out; | 2078 | goto free_mem_out; |
2056 | memset(o_ltp, 0, sizeof(struct ktermios)); | ||
2057 | } | 2079 | } |
2058 | 2080 | ||
2059 | /* | 2081 | /* |
@@ -2660,6 +2682,7 @@ got_driver: | |||
2660 | __proc_set_tty(current, tty); | 2682 | __proc_set_tty(current, tty); |
2661 | spin_unlock_irq(¤t->sighand->siglock); | 2683 | spin_unlock_irq(¤t->sighand->siglock); |
2662 | mutex_unlock(&tty_mutex); | 2684 | mutex_unlock(&tty_mutex); |
2685 | tty_audit_opening(); | ||
2663 | return 0; | 2686 | return 0; |
2664 | } | 2687 | } |
2665 | 2688 | ||
@@ -2722,8 +2745,10 @@ static int ptmx_open(struct inode * inode, struct file * filp) | |||
2722 | 2745 | ||
2723 | check_tty_count(tty, "tty_open"); | 2746 | check_tty_count(tty, "tty_open"); |
2724 | retval = ptm_driver->open(tty, filp); | 2747 | retval = ptm_driver->open(tty, filp); |
2725 | if (!retval) | 2748 | if (!retval) { |
2749 | tty_audit_opening(); | ||
2726 | return 0; | 2750 | return 0; |
2751 | } | ||
2727 | out1: | 2752 | out1: |
2728 | release_dev(filp); | 2753 | release_dev(filp); |
2729 | return retval; | 2754 | return retval; |
@@ -3163,14 +3188,13 @@ static int tiocsetd(struct tty_struct *tty, int __user *p) | |||
3163 | 3188 | ||
3164 | static int send_break(struct tty_struct *tty, unsigned int duration) | 3189 | static int send_break(struct tty_struct *tty, unsigned int duration) |
3165 | { | 3190 | { |
3166 | if (mutex_lock_interruptible(&tty->atomic_write_lock)) | 3191 | if (tty_write_lock(tty, 0) < 0) |
3167 | return -EINTR; | 3192 | return -EINTR; |
3168 | tty->driver->break_ctl(tty, -1); | 3193 | tty->driver->break_ctl(tty, -1); |
3169 | if (!signal_pending(current)) { | 3194 | if (!signal_pending(current)) |
3170 | msleep_interruptible(duration); | 3195 | msleep_interruptible(duration); |
3171 | } | ||
3172 | tty->driver->break_ctl(tty, 0); | 3196 | tty->driver->break_ctl(tty, 0); |
3173 | mutex_unlock(&tty->atomic_write_lock); | 3197 | tty_write_unlock(tty); |
3174 | if (signal_pending(current)) | 3198 | if (signal_pending(current)) |
3175 | return -EINTR; | 3199 | return -EINTR; |
3176 | return 0; | 3200 | return 0; |
@@ -3739,9 +3763,8 @@ struct tty_driver *alloc_tty_driver(int lines) | |||
3739 | { | 3763 | { |
3740 | struct tty_driver *driver; | 3764 | struct tty_driver *driver; |
3741 | 3765 | ||
3742 | driver = kmalloc(sizeof(struct tty_driver), GFP_KERNEL); | 3766 | driver = kzalloc(sizeof(struct tty_driver), GFP_KERNEL); |
3743 | if (driver) { | 3767 | if (driver) { |
3744 | memset(driver, 0, sizeof(struct tty_driver)); | ||
3745 | driver->magic = TTY_DRIVER_MAGIC; | 3768 | driver->magic = TTY_DRIVER_MAGIC; |
3746 | driver->num = lines; | 3769 | driver->num = lines; |
3747 | /* later we'll move allocation of tables here */ | 3770 | /* later we'll move allocation of tables here */ |
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c index fd471cb3338f..3423e9ee6481 100644 --- a/drivers/char/tty_ioctl.c +++ b/drivers/char/tty_ioctl.c | |||
@@ -52,8 +52,6 @@ | |||
52 | 52 | ||
53 | void tty_wait_until_sent(struct tty_struct * tty, long timeout) | 53 | void tty_wait_until_sent(struct tty_struct * tty, long timeout) |
54 | { | 54 | { |
55 | DECLARE_WAITQUEUE(wait, current); | ||
56 | |||
57 | #ifdef TTY_DEBUG_WAIT_UNTIL_SENT | 55 | #ifdef TTY_DEBUG_WAIT_UNTIL_SENT |
58 | char buf[64]; | 56 | char buf[64]; |
59 | 57 | ||
@@ -61,26 +59,13 @@ void tty_wait_until_sent(struct tty_struct * tty, long timeout) | |||
61 | #endif | 59 | #endif |
62 | if (!tty->driver->chars_in_buffer) | 60 | if (!tty->driver->chars_in_buffer) |
63 | return; | 61 | return; |
64 | add_wait_queue(&tty->write_wait, &wait); | ||
65 | if (!timeout) | 62 | if (!timeout) |
66 | timeout = MAX_SCHEDULE_TIMEOUT; | 63 | timeout = MAX_SCHEDULE_TIMEOUT; |
67 | do { | 64 | if (wait_event_interruptible_timeout(tty->write_wait, |
68 | #ifdef TTY_DEBUG_WAIT_UNTIL_SENT | 65 | !tty->driver->chars_in_buffer(tty), timeout)) |
69 | printk(KERN_DEBUG "waiting %s...(%d)\n", tty_name(tty, buf), | 66 | return; |
70 | tty->driver->chars_in_buffer(tty)); | ||
71 | #endif | ||
72 | set_current_state(TASK_INTERRUPTIBLE); | ||
73 | if (signal_pending(current)) | ||
74 | goto stop_waiting; | ||
75 | if (!tty->driver->chars_in_buffer(tty)) | ||
76 | break; | ||
77 | timeout = schedule_timeout(timeout); | ||
78 | } while (timeout); | ||
79 | if (tty->driver->wait_until_sent) | 67 | if (tty->driver->wait_until_sent) |
80 | tty->driver->wait_until_sent(tty, timeout); | 68 | tty->driver->wait_until_sent(tty, timeout); |
81 | stop_waiting: | ||
82 | set_current_state(TASK_RUNNING); | ||
83 | remove_wait_queue(&tty->write_wait, &wait); | ||
84 | } | 69 | } |
85 | 70 | ||
86 | EXPORT_SYMBOL(tty_wait_until_sent); | 71 | EXPORT_SYMBOL(tty_wait_until_sent); |
@@ -276,13 +261,12 @@ void tty_termios_encode_baud_rate(struct ktermios *termios, speed_t ibaud, speed | |||
276 | termios->c_cflag |= (baud_bits[i] << IBSHIFT); | 261 | termios->c_cflag |= (baud_bits[i] << IBSHIFT); |
277 | ifound = i; | 262 | ifound = i; |
278 | } | 263 | } |
279 | } | 264 | } while (++i < n_baud_table); |
280 | while(++i < n_baud_table); | ||
281 | if (ofound == -1) | 265 | if (ofound == -1) |
282 | termios->c_cflag |= BOTHER; | 266 | termios->c_cflag |= BOTHER; |
283 | /* Set exact input bits only if the input and output differ or the | 267 | /* Set exact input bits only if the input and output differ or the |
284 | user already did */ | 268 | user already did */ |
285 | if (ifound == -1 && (ibaud != obaud || ibinput)) | 269 | if (ifound == -1 && (ibaud != obaud || ibinput)) |
286 | termios->c_cflag |= (BOTHER << IBSHIFT); | 270 | termios->c_cflag |= (BOTHER << IBSHIFT); |
287 | } | 271 | } |
288 | 272 | ||
@@ -575,7 +559,7 @@ static int set_sgttyb(struct tty_struct * tty, struct sgttyb __user * sgttyb) | |||
575 | return -EFAULT; | 559 | return -EFAULT; |
576 | 560 | ||
577 | mutex_lock(&tty->termios_mutex); | 561 | mutex_lock(&tty->termios_mutex); |
578 | termios = *tty->termios; | 562 | termios = *tty->termios; |
579 | termios.c_cc[VERASE] = tmp.sg_erase; | 563 | termios.c_cc[VERASE] = tmp.sg_erase; |
580 | termios.c_cc[VKILL] = tmp.sg_kill; | 564 | termios.c_cc[VKILL] = tmp.sg_kill; |
581 | set_sgflags(&termios, tmp.sg_flags); | 565 | set_sgflags(&termios, tmp.sg_flags); |
@@ -667,7 +651,7 @@ static int send_prio_char(struct tty_struct *tty, char ch) | |||
667 | return 0; | 651 | return 0; |
668 | } | 652 | } |
669 | 653 | ||
670 | if (mutex_lock_interruptible(&tty->atomic_write_lock)) | 654 | if (tty_write_lock(tty, 0) < 0) |
671 | return -ERESTARTSYS; | 655 | return -ERESTARTSYS; |
672 | 656 | ||
673 | if (was_stopped) | 657 | if (was_stopped) |
@@ -675,7 +659,7 @@ static int send_prio_char(struct tty_struct *tty, char ch) | |||
675 | tty->driver->write(tty, &ch, 1); | 659 | tty->driver->write(tty, &ch, 1); |
676 | if (was_stopped) | 660 | if (was_stopped) |
677 | stop_tty(tty); | 661 | stop_tty(tty); |
678 | mutex_unlock(&tty->atomic_write_lock); | 662 | tty_write_unlock(tty); |
679 | return 0; | 663 | return 0; |
680 | } | 664 | } |
681 | 665 | ||
diff --git a/drivers/connector/Kconfig b/drivers/connector/Kconfig index e0bdc0db9640..100bfd422066 100644 --- a/drivers/connector/Kconfig +++ b/drivers/connector/Kconfig | |||
@@ -1,6 +1,5 @@ | |||
1 | menu "Connector - unified userspace <-> kernelspace linker" | ||
2 | 1 | ||
3 | config CONNECTOR | 2 | menuconfig CONNECTOR |
4 | tristate "Connector - unified userspace <-> kernelspace linker" | 3 | tristate "Connector - unified userspace <-> kernelspace linker" |
5 | depends on NET | 4 | depends on NET |
6 | ---help--- | 5 | ---help--- |
@@ -10,6 +9,8 @@ config CONNECTOR | |||
10 | Connector support can also be built as a module. If so, the module | 9 | Connector support can also be built as a module. If so, the module |
11 | will be called cn.ko. | 10 | will be called cn.ko. |
12 | 11 | ||
12 | if CONNECTOR | ||
13 | |||
13 | config PROC_EVENTS | 14 | config PROC_EVENTS |
14 | boolean "Report process events to userspace" | 15 | boolean "Report process events to userspace" |
15 | depends on CONNECTOR=y | 16 | depends on CONNECTOR=y |
@@ -18,4 +19,4 @@ config PROC_EVENTS | |||
18 | Provide a connector that reports process events to userspace. Send | 19 | Provide a connector that reports process events to userspace. Send |
19 | events such as fork, exec, id change (uid, gid, suid, etc), and exit. | 20 | events such as fork, exec, id change (uid, gid, suid, etc), and exit. |
20 | 21 | ||
21 | endmenu | 22 | endif # CONNECTOR |
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index bb90cbd7ca51..84ebfcc1ffb4 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig | |||
@@ -1,4 +1,9 @@ | |||
1 | menu "Hardware crypto devices" | 1 | |
2 | menuconfig CRYPTO_HW | ||
3 | bool "Hardware crypto devices" | ||
4 | default y | ||
5 | |||
6 | if CRYPTO_HW | ||
2 | 7 | ||
3 | config CRYPTO_DEV_PADLOCK | 8 | config CRYPTO_DEV_PADLOCK |
4 | tristate "Support for VIA PadLock ACE" | 9 | tristate "Support for VIA PadLock ACE" |
@@ -78,4 +83,4 @@ config ZCRYPT_MONOLITHIC | |||
78 | that contains all parts of the crypto device driver (ap bus, | 83 | that contains all parts of the crypto device driver (ap bus, |
79 | request router and all the card drivers). | 84 | request router and all the card drivers). |
80 | 85 | ||
81 | endmenu | 86 | endif # CRYPTO_HW |
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index b31756d59978..8f670dae53bb 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | menu "DMA Engine support" | 5 | menu "DMA Engine support" |
6 | depends on !S390 | 6 | depends on HAS_DMA |
7 | 7 | ||
8 | config DMA_ENGINE | 8 | config DMA_ENGINE |
9 | bool "Support for DMA engines" | 9 | bool "Support for DMA engines" |
diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig index 807c402df049..debf1d8e8b41 100644 --- a/drivers/edac/Kconfig +++ b/drivers/edac/Kconfig | |||
@@ -6,11 +6,9 @@ | |||
6 | # $Id: Kconfig,v 1.4.2.7 2005/07/08 22:05:38 dsp_llnl Exp $ | 6 | # $Id: Kconfig,v 1.4.2.7 2005/07/08 22:05:38 dsp_llnl Exp $ |
7 | # | 7 | # |
8 | 8 | ||
9 | menu 'EDAC - error detection and reporting (RAS) (EXPERIMENTAL)' | 9 | menuconfig EDAC |
10 | tristate "EDAC - error detection and reporting (EXPERIMENTAL)" | ||
10 | depends on HAS_IOMEM | 11 | depends on HAS_IOMEM |
11 | |||
12 | config EDAC | ||
13 | tristate "EDAC core system error reporting (EXPERIMENTAL)" | ||
14 | depends on X86 && EXPERIMENTAL | 12 | depends on X86 && EXPERIMENTAL |
15 | help | 13 | help |
16 | EDAC is designed to report errors in the core system. | 14 | EDAC is designed to report errors in the core system. |
@@ -30,13 +28,12 @@ config EDAC | |||
30 | There is also a mailing list for the EDAC project, which can | 28 | There is also a mailing list for the EDAC project, which can |
31 | be found via the sourceforge page. | 29 | be found via the sourceforge page. |
32 | 30 | ||
31 | if EDAC | ||
33 | 32 | ||
34 | comment "Reporting subsystems" | 33 | comment "Reporting subsystems" |
35 | depends on EDAC | ||
36 | 34 | ||
37 | config EDAC_DEBUG | 35 | config EDAC_DEBUG |
38 | bool "Debugging" | 36 | bool "Debugging" |
39 | depends on EDAC | ||
40 | help | 37 | help |
41 | This turns on debugging information for the entire EDAC | 38 | This turns on debugging information for the entire EDAC |
42 | sub-system. You can insert module with "debug_level=x", current | 39 | sub-system. You can insert module with "debug_level=x", current |
@@ -45,7 +42,6 @@ config EDAC_DEBUG | |||
45 | 42 | ||
46 | config EDAC_MM_EDAC | 43 | config EDAC_MM_EDAC |
47 | tristate "Main Memory EDAC (Error Detection And Correction) reporting" | 44 | tristate "Main Memory EDAC (Error Detection And Correction) reporting" |
48 | depends on EDAC | ||
49 | default y | 45 | default y |
50 | help | 46 | help |
51 | Some systems are able to detect and correct errors in main | 47 | Some systems are able to detect and correct errors in main |
@@ -100,15 +96,13 @@ config EDAC_R82600 | |||
100 | 96 | ||
101 | choice | 97 | choice |
102 | prompt "Error detecting method" | 98 | prompt "Error detecting method" |
103 | depends on EDAC | ||
104 | default EDAC_POLL | 99 | default EDAC_POLL |
105 | 100 | ||
106 | config EDAC_POLL | 101 | config EDAC_POLL |
107 | bool "Poll for errors" | 102 | bool "Poll for errors" |
108 | depends on EDAC | ||
109 | help | 103 | help |
110 | Poll the chipset periodically to detect errors. | 104 | Poll the chipset periodically to detect errors. |
111 | 105 | ||
112 | endchoice | 106 | endchoice |
113 | 107 | ||
114 | endmenu | 108 | endif # EDAC |
diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c index 15232271d848..0fb730ee1da8 100644 --- a/drivers/firmware/edd.c +++ b/drivers/firmware/edd.c | |||
@@ -669,7 +669,7 @@ edd_get_pci_dev(struct edd_device *edev) | |||
669 | struct edd_info *info = edd_dev_get_info(edev); | 669 | struct edd_info *info = edd_dev_get_info(edev); |
670 | 670 | ||
671 | if (edd_dev_is_type(edev, "PCI")) { | 671 | if (edd_dev_is_type(edev, "PCI")) { |
672 | return pci_find_slot(info->params.interface_path.pci.bus, | 672 | return pci_get_bus_and_slot(info->params.interface_path.pci.bus, |
673 | PCI_DEVFN(info->params.interface_path.pci.slot, | 673 | PCI_DEVFN(info->params.interface_path.pci.slot, |
674 | info->params.interface_path.pci. | 674 | info->params.interface_path.pci. |
675 | function)); | 675 | function)); |
@@ -682,9 +682,12 @@ edd_create_symlink_to_pcidev(struct edd_device *edev) | |||
682 | { | 682 | { |
683 | 683 | ||
684 | struct pci_dev *pci_dev = edd_get_pci_dev(edev); | 684 | struct pci_dev *pci_dev = edd_get_pci_dev(edev); |
685 | int ret; | ||
685 | if (!pci_dev) | 686 | if (!pci_dev) |
686 | return 1; | 687 | return 1; |
687 | return sysfs_create_link(&edev->kobj,&pci_dev->dev.kobj,"pci_dev"); | 688 | ret = sysfs_create_link(&edev->kobj,&pci_dev->dev.kobj,"pci_dev"); |
689 | pci_dev_put(pci_dev); | ||
690 | return ret; | ||
688 | } | 691 | } |
689 | 692 | ||
690 | static inline void | 693 | static inline void |
diff --git a/drivers/firmware/pcdp.c b/drivers/firmware/pcdp.c index 2b4b76e8bd72..58e9f8e457f8 100644 --- a/drivers/firmware/pcdp.c +++ b/drivers/firmware/pcdp.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/console.h> | 15 | #include <linux/console.h> |
16 | #include <linux/efi.h> | 16 | #include <linux/efi.h> |
17 | #include <linux/serial.h> | 17 | #include <linux/serial.h> |
18 | #include <linux/serial_8250.h> | ||
18 | #include <asm/vga.h> | 19 | #include <asm/vga.h> |
19 | #include "pcdp.h" | 20 | #include "pcdp.h" |
20 | 21 | ||
@@ -27,7 +28,7 @@ setup_serial_console(struct pcdp_uart *uart) | |||
27 | char parity; | 28 | char parity; |
28 | 29 | ||
29 | mmio = (uart->addr.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY); | 30 | mmio = (uart->addr.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY); |
30 | p += sprintf(p, "console=uart,%s,0x%lx", | 31 | p += sprintf(p, "uart8250,%s,0x%lx", |
31 | mmio ? "mmio" : "io", uart->addr.address); | 32 | mmio ? "mmio" : "io", uart->addr.address); |
32 | if (uart->baud) { | 33 | if (uart->baud) { |
33 | p += sprintf(p, ",%lu", uart->baud); | 34 | p += sprintf(p, ",%lu", uart->baud); |
@@ -41,7 +42,8 @@ setup_serial_console(struct pcdp_uart *uart) | |||
41 | } | 42 | } |
42 | } | 43 | } |
43 | 44 | ||
44 | return early_serial_console_init(options); | 45 | add_preferred_console("uart", 8250, &options[9]); |
46 | return setup_early_serial8250_console(options); | ||
45 | #else | 47 | #else |
46 | return -ENODEV; | 48 | return -ENODEV; |
47 | #endif | 49 | #endif |
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c index adfea3c7c62a..bc77c5e2ca9f 100644 --- a/drivers/macintosh/adb.c +++ b/drivers/macintosh/adb.c | |||
@@ -248,21 +248,15 @@ static int adb_scan_bus(void) | |||
248 | static int | 248 | static int |
249 | adb_probe_task(void *x) | 249 | adb_probe_task(void *x) |
250 | { | 250 | { |
251 | sigset_t blocked; | ||
252 | |||
253 | strcpy(current->comm, "kadbprobe"); | 251 | strcpy(current->comm, "kadbprobe"); |
254 | 252 | ||
255 | sigfillset(&blocked); | ||
256 | sigprocmask(SIG_BLOCK, &blocked, NULL); | ||
257 | flush_signals(current); | ||
258 | |||
259 | printk(KERN_INFO "adb: starting probe task...\n"); | 253 | printk(KERN_INFO "adb: starting probe task...\n"); |
260 | do_adb_reset_bus(); | 254 | do_adb_reset_bus(); |
261 | printk(KERN_INFO "adb: finished probe task...\n"); | 255 | printk(KERN_INFO "adb: finished probe task...\n"); |
262 | 256 | ||
263 | adb_probe_task_pid = 0; | 257 | adb_probe_task_pid = 0; |
264 | up(&adb_probe_mutex); | 258 | up(&adb_probe_mutex); |
265 | 259 | ||
266 | return 0; | 260 | return 0; |
267 | } | 261 | } |
268 | 262 | ||
diff --git a/drivers/message/i2o/Kconfig b/drivers/message/i2o/Kconfig index f4ac21e5771e..5afa0e393ecf 100644 --- a/drivers/message/i2o/Kconfig +++ b/drivers/message/i2o/Kconfig | |||
@@ -1,9 +1,6 @@ | |||
1 | 1 | ||
2 | menu "I2O device support" | 2 | menuconfig I2O |
3 | depends on PCI | 3 | tristate "I2O device support" |
4 | |||
5 | config I2O | ||
6 | tristate "I2O support" | ||
7 | depends on PCI | 4 | depends on PCI |
8 | ---help--- | 5 | ---help--- |
9 | The Intelligent Input/Output (I2O) architecture allows hardware | 6 | The Intelligent Input/Output (I2O) architecture allows hardware |
@@ -25,9 +22,10 @@ config I2O | |||
25 | 22 | ||
26 | If unsure, say N. | 23 | If unsure, say N. |
27 | 24 | ||
25 | if I2O | ||
26 | |||
28 | config I2O_LCT_NOTIFY_ON_CHANGES | 27 | config I2O_LCT_NOTIFY_ON_CHANGES |
29 | bool "Enable LCT notification" | 28 | bool "Enable LCT notification" |
30 | depends on I2O | ||
31 | default y | 29 | default y |
32 | ---help--- | 30 | ---help--- |
33 | Only say N here if you have a I2O controller from SUN. The SUN | 31 | Only say N here if you have a I2O controller from SUN. The SUN |
@@ -39,7 +37,6 @@ config I2O_LCT_NOTIFY_ON_CHANGES | |||
39 | 37 | ||
40 | config I2O_EXT_ADAPTEC | 38 | config I2O_EXT_ADAPTEC |
41 | bool "Enable Adaptec extensions" | 39 | bool "Enable Adaptec extensions" |
42 | depends on I2O | ||
43 | default y | 40 | default y |
44 | ---help--- | 41 | ---help--- |
45 | Say Y for support of raidutils for Adaptec I2O controllers. You also | 42 | Say Y for support of raidutils for Adaptec I2O controllers. You also |
@@ -57,7 +54,7 @@ config I2O_EXT_ADAPTEC_DMA64 | |||
57 | 54 | ||
58 | config I2O_CONFIG | 55 | config I2O_CONFIG |
59 | tristate "I2O Configuration support" | 56 | tristate "I2O Configuration support" |
60 | depends on I2O | 57 | depends on VIRT_TO_BUS |
61 | ---help--- | 58 | ---help--- |
62 | Say Y for support of the configuration interface for the I2O adapters. | 59 | Say Y for support of the configuration interface for the I2O adapters. |
63 | If you have a RAID controller from Adaptec and you want to use the | 60 | If you have a RAID controller from Adaptec and you want to use the |
@@ -78,7 +75,6 @@ config I2O_CONFIG_OLD_IOCTL | |||
78 | 75 | ||
79 | config I2O_BUS | 76 | config I2O_BUS |
80 | tristate "I2O Bus Adapter OSM" | 77 | tristate "I2O Bus Adapter OSM" |
81 | depends on I2O | ||
82 | ---help--- | 78 | ---help--- |
83 | Include support for the I2O Bus Adapter OSM. The Bus Adapter OSM | 79 | Include support for the I2O Bus Adapter OSM. The Bus Adapter OSM |
84 | provides access to the busses on the I2O controller. The main purpose | 80 | provides access to the busses on the I2O controller. The main purpose |
@@ -89,7 +85,7 @@ config I2O_BUS | |||
89 | 85 | ||
90 | config I2O_BLOCK | 86 | config I2O_BLOCK |
91 | tristate "I2O Block OSM" | 87 | tristate "I2O Block OSM" |
92 | depends on I2O && BLOCK | 88 | depends on BLOCK |
93 | ---help--- | 89 | ---help--- |
94 | Include support for the I2O Block OSM. The Block OSM presents disk | 90 | Include support for the I2O Block OSM. The Block OSM presents disk |
95 | and other structured block devices to the operating system. If you | 91 | and other structured block devices to the operating system. If you |
@@ -102,7 +98,7 @@ config I2O_BLOCK | |||
102 | 98 | ||
103 | config I2O_SCSI | 99 | config I2O_SCSI |
104 | tristate "I2O SCSI OSM" | 100 | tristate "I2O SCSI OSM" |
105 | depends on I2O && SCSI | 101 | depends on SCSI |
106 | ---help--- | 102 | ---help--- |
107 | Allows direct SCSI access to SCSI devices on a SCSI or FibreChannel | 103 | Allows direct SCSI access to SCSI devices on a SCSI or FibreChannel |
108 | I2O controller. You can use both the SCSI and Block OSM together if | 104 | I2O controller. You can use both the SCSI and Block OSM together if |
@@ -114,7 +110,6 @@ config I2O_SCSI | |||
114 | 110 | ||
115 | config I2O_PROC | 111 | config I2O_PROC |
116 | tristate "I2O /proc support" | 112 | tristate "I2O /proc support" |
117 | depends on I2O | ||
118 | ---help--- | 113 | ---help--- |
119 | If you say Y here and to "/proc file system support", you will be | 114 | If you say Y here and to "/proc file system support", you will be |
120 | able to read I2O related information from the virtual directory | 115 | able to read I2O related information from the virtual directory |
@@ -123,5 +118,4 @@ config I2O_PROC | |||
123 | To compile this support as a module, choose M here: the | 118 | To compile this support as a module, choose M here: the |
124 | module will be called i2o_proc. | 119 | module will be called i2o_proc. |
125 | 120 | ||
126 | endmenu | 121 | endif # I2O |
127 | |||
diff --git a/drivers/message/i2o/device.c b/drivers/message/i2o/device.c index 611adc3c0f74..489d7c5c4965 100644 --- a/drivers/message/i2o/device.c +++ b/drivers/message/i2o/device.c | |||
@@ -62,7 +62,7 @@ int i2o_device_claim(struct i2o_device *dev) | |||
62 | { | 62 | { |
63 | int rc = 0; | 63 | int rc = 0; |
64 | 64 | ||
65 | down(&dev->lock); | 65 | mutex_lock(&dev->lock); |
66 | 66 | ||
67 | rc = i2o_device_issue_claim(dev, I2O_CMD_UTIL_CLAIM, I2O_CLAIM_PRIMARY); | 67 | rc = i2o_device_issue_claim(dev, I2O_CMD_UTIL_CLAIM, I2O_CLAIM_PRIMARY); |
68 | if (!rc) | 68 | if (!rc) |
@@ -72,7 +72,7 @@ int i2o_device_claim(struct i2o_device *dev) | |||
72 | pr_debug("i2o: claim of device %d failed %d\n", | 72 | pr_debug("i2o: claim of device %d failed %d\n", |
73 | dev->lct_data.tid, rc); | 73 | dev->lct_data.tid, rc); |
74 | 74 | ||
75 | up(&dev->lock); | 75 | mutex_unlock(&dev->lock); |
76 | 76 | ||
77 | return rc; | 77 | return rc; |
78 | } | 78 | } |
@@ -96,7 +96,7 @@ int i2o_device_claim_release(struct i2o_device *dev) | |||
96 | int tries; | 96 | int tries; |
97 | int rc = 0; | 97 | int rc = 0; |
98 | 98 | ||
99 | down(&dev->lock); | 99 | mutex_lock(&dev->lock); |
100 | 100 | ||
101 | /* | 101 | /* |
102 | * If the controller takes a nonblocking approach to | 102 | * If the controller takes a nonblocking approach to |
@@ -118,7 +118,7 @@ int i2o_device_claim_release(struct i2o_device *dev) | |||
118 | pr_debug("i2o: claim release of device %d failed %d\n", | 118 | pr_debug("i2o: claim release of device %d failed %d\n", |
119 | dev->lct_data.tid, rc); | 119 | dev->lct_data.tid, rc); |
120 | 120 | ||
121 | up(&dev->lock); | 121 | mutex_unlock(&dev->lock); |
122 | 122 | ||
123 | return rc; | 123 | return rc; |
124 | } | 124 | } |
@@ -198,7 +198,7 @@ static struct i2o_device *i2o_device_alloc(void) | |||
198 | return ERR_PTR(-ENOMEM); | 198 | return ERR_PTR(-ENOMEM); |
199 | 199 | ||
200 | INIT_LIST_HEAD(&dev->list); | 200 | INIT_LIST_HEAD(&dev->list); |
201 | init_MUTEX(&dev->lock); | 201 | mutex_init(&dev->lock); |
202 | 202 | ||
203 | dev->device.bus = &i2o_bus_type; | 203 | dev->device.bus = &i2o_bus_type; |
204 | dev->device.release = &i2o_device_release; | 204 | dev->device.release = &i2o_device_release; |
@@ -326,7 +326,7 @@ int i2o_device_parse_lct(struct i2o_controller *c) | |||
326 | u16 table_size; | 326 | u16 table_size; |
327 | u32 buf; | 327 | u32 buf; |
328 | 328 | ||
329 | down(&c->lct_lock); | 329 | mutex_lock(&c->lct_lock); |
330 | 330 | ||
331 | kfree(c->lct); | 331 | kfree(c->lct); |
332 | 332 | ||
@@ -335,7 +335,7 @@ int i2o_device_parse_lct(struct i2o_controller *c) | |||
335 | 335 | ||
336 | lct = c->lct = kmalloc(table_size * 4, GFP_KERNEL); | 336 | lct = c->lct = kmalloc(table_size * 4, GFP_KERNEL); |
337 | if (!lct) { | 337 | if (!lct) { |
338 | up(&c->lct_lock); | 338 | mutex_unlock(&c->lct_lock); |
339 | return -ENOMEM; | 339 | return -ENOMEM; |
340 | } | 340 | } |
341 | 341 | ||
@@ -408,7 +408,7 @@ int i2o_device_parse_lct(struct i2o_controller *c) | |||
408 | i2o_device_remove(dev); | 408 | i2o_device_remove(dev); |
409 | } | 409 | } |
410 | 410 | ||
411 | up(&c->lct_lock); | 411 | mutex_unlock(&c->lct_lock); |
412 | 412 | ||
413 | return 0; | 413 | return 0; |
414 | } | 414 | } |
diff --git a/drivers/message/i2o/exec-osm.c b/drivers/message/i2o/exec-osm.c index 5278aad92bc4..c13b9321e7ab 100644 --- a/drivers/message/i2o/exec-osm.c +++ b/drivers/message/i2o/exec-osm.c | |||
@@ -537,7 +537,7 @@ static int i2o_exec_lct_notify(struct i2o_controller *c, u32 change_ind) | |||
537 | struct device *dev; | 537 | struct device *dev; |
538 | struct i2o_message *msg; | 538 | struct i2o_message *msg; |
539 | 539 | ||
540 | down(&c->lct_lock); | 540 | mutex_lock(&c->lct_lock); |
541 | 541 | ||
542 | dev = &c->pdev->dev; | 542 | dev = &c->pdev->dev; |
543 | 543 | ||
@@ -561,7 +561,7 @@ static int i2o_exec_lct_notify(struct i2o_controller *c, u32 change_ind) | |||
561 | 561 | ||
562 | i2o_msg_post(c, msg); | 562 | i2o_msg_post(c, msg); |
563 | 563 | ||
564 | up(&c->lct_lock); | 564 | mutex_unlock(&c->lct_lock); |
565 | 565 | ||
566 | return 0; | 566 | return 0; |
567 | }; | 567 | }; |
diff --git a/drivers/message/i2o/iop.c b/drivers/message/i2o/iop.c index 3305c12372a2..a1ec16a075c6 100644 --- a/drivers/message/i2o/iop.c +++ b/drivers/message/i2o/iop.c | |||
@@ -1067,7 +1067,7 @@ struct i2o_controller *i2o_iop_alloc(void) | |||
1067 | 1067 | ||
1068 | INIT_LIST_HEAD(&c->devices); | 1068 | INIT_LIST_HEAD(&c->devices); |
1069 | spin_lock_init(&c->lock); | 1069 | spin_lock_init(&c->lock); |
1070 | init_MUTEX(&c->lct_lock); | 1070 | mutex_init(&c->lct_lock); |
1071 | 1071 | ||
1072 | device_initialize(&c->device); | 1072 | device_initialize(&c->device); |
1073 | 1073 | ||
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index bd601efa7bd1..a92b8728b90c 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig | |||
@@ -2,7 +2,11 @@ | |||
2 | # Misc strange devices | 2 | # Misc strange devices |
3 | # | 3 | # |
4 | 4 | ||
5 | menu "Misc devices" | 5 | menuconfig MISC_DEVICES |
6 | bool "Misc devices" | ||
7 | default y | ||
8 | |||
9 | if MISC_DEVICES | ||
6 | 10 | ||
7 | config IBM_ASM | 11 | config IBM_ASM |
8 | tristate "Device driver for IBM RSA service processor" | 12 | tristate "Device driver for IBM RSA service processor" |
@@ -192,4 +196,4 @@ config THINKPAD_ACPI_BAY | |||
192 | 196 | ||
193 | If you are not sure, say Y here. | 197 | If you are not sure, say Y here. |
194 | 198 | ||
195 | endmenu | 199 | endif # MISC_DEVICES |
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index 8ee0321ef1c8..9623eaf4f89f 100644 --- a/drivers/misc/sony-laptop.c +++ b/drivers/misc/sony-laptop.c | |||
@@ -1917,7 +1917,8 @@ end: | |||
1917 | */ | 1917 | */ |
1918 | static int sony_pic_disable(struct acpi_device *device) | 1918 | static int sony_pic_disable(struct acpi_device *device) |
1919 | { | 1919 | { |
1920 | if (ACPI_FAILURE(acpi_evaluate_object(device->handle, "_DIS", 0, NULL))) | 1920 | if (ACPI_FAILURE(acpi_evaluate_object(device->handle, |
1921 | "_DIS", NULL, NULL))) | ||
1921 | return -ENXIO; | 1922 | return -ENXIO; |
1922 | 1923 | ||
1923 | dprintk("Device disabled\n"); | 1924 | dprintk("Device disabled\n"); |
diff --git a/drivers/net/wan/Kconfig b/drivers/net/wan/Kconfig index 4fc8681bc110..a3df09ee729f 100644 --- a/drivers/net/wan/Kconfig +++ b/drivers/net/wan/Kconfig | |||
@@ -61,7 +61,7 @@ config COSA | |||
61 | # | 61 | # |
62 | config LANMEDIA | 62 | config LANMEDIA |
63 | tristate "LanMedia Corp. SSI/V.35, T1/E1, HSSI, T3 boards" | 63 | tristate "LanMedia Corp. SSI/V.35, T1/E1, HSSI, T3 boards" |
64 | depends on PCI | 64 | depends on PCI && VIRT_TO_BUS |
65 | ---help--- | 65 | ---help--- |
66 | Driver for the following Lan Media family of serial boards: | 66 | Driver for the following Lan Media family of serial boards: |
67 | 67 | ||
diff --git a/drivers/parport/Kconfig b/drivers/parport/Kconfig index f46c69e4ed82..09c93ff932b1 100644 --- a/drivers/parport/Kconfig +++ b/drivers/parport/Kconfig | |||
@@ -5,11 +5,9 @@ | |||
5 | # Parport configuration. | 5 | # Parport configuration. |
6 | # | 6 | # |
7 | 7 | ||
8 | menu "Parallel port support" | 8 | menuconfig PARPORT |
9 | depends on HAS_IOMEM | ||
10 | |||
11 | config PARPORT | ||
12 | tristate "Parallel port support" | 9 | tristate "Parallel port support" |
10 | depends on HAS_IOMEM | ||
13 | ---help--- | 11 | ---help--- |
14 | If you want to use devices connected to your machine's parallel port | 12 | If you want to use devices connected to your machine's parallel port |
15 | (the connector at the computer with 25 holes), e.g. printer, ZIP | 13 | (the connector at the computer with 25 holes), e.g. printer, ZIP |
@@ -33,9 +31,11 @@ config PARPORT | |||
33 | 31 | ||
34 | If unsure, say Y. | 32 | If unsure, say Y. |
35 | 33 | ||
34 | if PARPORT | ||
35 | |||
36 | config PARPORT_PC | 36 | config PARPORT_PC |
37 | tristate "PC-style hardware" | 37 | tristate "PC-style hardware" |
38 | depends on PARPORT && (!SPARC64 || PCI) && !SPARC32 && !M32R && !FRV | 38 | depends on (!SPARC64 || PCI) && !SPARC32 && !M32R && !FRV |
39 | ---help--- | 39 | ---help--- |
40 | You should say Y here if you have a PC-style parallel port. All | 40 | You should say Y here if you have a PC-style parallel port. All |
41 | IBM PC compatible computers and some Alphas have PC-style | 41 | IBM PC compatible computers and some Alphas have PC-style |
@@ -85,7 +85,7 @@ config PARPORT_PC_PCMCIA | |||
85 | 85 | ||
86 | config PARPORT_IP32 | 86 | config PARPORT_IP32 |
87 | tristate "SGI IP32 builtin port (EXPERIMENTAL)" | 87 | tristate "SGI IP32 builtin port (EXPERIMENTAL)" |
88 | depends on SGI_IP32 && PARPORT && EXPERIMENTAL | 88 | depends on SGI_IP32 && EXPERIMENTAL |
89 | select PARPORT_NOT_PC | 89 | select PARPORT_NOT_PC |
90 | help | 90 | help |
91 | Say Y here if you need support for the parallel port on | 91 | Say Y here if you need support for the parallel port on |
@@ -94,7 +94,7 @@ config PARPORT_IP32 | |||
94 | 94 | ||
95 | config PARPORT_AMIGA | 95 | config PARPORT_AMIGA |
96 | tristate "Amiga builtin port" | 96 | tristate "Amiga builtin port" |
97 | depends on AMIGA && PARPORT | 97 | depends on AMIGA |
98 | select PARPORT_NOT_PC | 98 | select PARPORT_NOT_PC |
99 | help | 99 | help |
100 | Say Y here if you need support for the parallel port hardware on | 100 | Say Y here if you need support for the parallel port hardware on |
@@ -103,7 +103,7 @@ config PARPORT_AMIGA | |||
103 | 103 | ||
104 | config PARPORT_MFC3 | 104 | config PARPORT_MFC3 |
105 | tristate "Multiface III parallel port" | 105 | tristate "Multiface III parallel port" |
106 | depends on ZORRO && PARPORT | 106 | depends on ZORRO |
107 | select PARPORT_NOT_PC | 107 | select PARPORT_NOT_PC |
108 | help | 108 | help |
109 | Say Y here if you need parallel port support for the MFC3 card. | 109 | Say Y here if you need parallel port support for the MFC3 card. |
@@ -112,7 +112,7 @@ config PARPORT_MFC3 | |||
112 | 112 | ||
113 | config PARPORT_ATARI | 113 | config PARPORT_ATARI |
114 | tristate "Atari hardware" | 114 | tristate "Atari hardware" |
115 | depends on ATARI && PARPORT | 115 | depends on ATARI |
116 | select PARPORT_NOT_PC | 116 | select PARPORT_NOT_PC |
117 | help | 117 | help |
118 | Say Y here if you need support for the parallel port hardware on | 118 | Say Y here if you need support for the parallel port hardware on |
@@ -122,12 +122,11 @@ config PARPORT_ATARI | |||
122 | config PARPORT_GSC | 122 | config PARPORT_GSC |
123 | tristate | 123 | tristate |
124 | default GSC | 124 | default GSC |
125 | depends on PARPORT | ||
126 | select PARPORT_NOT_PC | 125 | select PARPORT_NOT_PC |
127 | 126 | ||
128 | config PARPORT_SUNBPP | 127 | config PARPORT_SUNBPP |
129 | tristate "Sparc hardware (EXPERIMENTAL)" | 128 | tristate "Sparc hardware (EXPERIMENTAL)" |
130 | depends on SBUS && PARPORT && EXPERIMENTAL | 129 | depends on SBUS && EXPERIMENTAL |
131 | select PARPORT_NOT_PC | 130 | select PARPORT_NOT_PC |
132 | help | 131 | help |
133 | This driver provides support for the bidirectional parallel port | 132 | This driver provides support for the bidirectional parallel port |
@@ -136,7 +135,6 @@ config PARPORT_SUNBPP | |||
136 | 135 | ||
137 | config PARPORT_AX88796 | 136 | config PARPORT_AX88796 |
138 | tristate "AX88796 Parallel Port" | 137 | tristate "AX88796 Parallel Port" |
139 | depends on PARPORT | ||
140 | select PARPORT_NOT_PC | 138 | select PARPORT_NOT_PC |
141 | help | 139 | help |
142 | Say Y here if you need support for the parallel port hardware on | 140 | Say Y here if you need support for the parallel port hardware on |
@@ -148,7 +146,6 @@ config PARPORT_AX88796 | |||
148 | 146 | ||
149 | config PARPORT_1284 | 147 | config PARPORT_1284 |
150 | bool "IEEE 1284 transfer modes" | 148 | bool "IEEE 1284 transfer modes" |
151 | depends on PARPORT | ||
152 | help | 149 | help |
153 | If you have a printer that supports status readback or device ID, or | 150 | If you have a printer that supports status readback or device ID, or |
154 | want to use a device that uses enhanced parallel port transfer modes | 151 | want to use a device that uses enhanced parallel port transfer modes |
@@ -159,5 +156,4 @@ config PARPORT_1284 | |||
159 | config PARPORT_NOT_PC | 156 | config PARPORT_NOT_PC |
160 | bool | 157 | bool |
161 | 158 | ||
162 | endmenu | 159 | endif # PARPORT |
163 | |||
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index 7bfbad57879d..5d58ad55d85c 100644 --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c | |||
@@ -2424,7 +2424,6 @@ static int __devinit sio_ite_8872_probe (struct pci_dev *pdev, int autoirq, | |||
2424 | u32 ite8872set; | 2424 | u32 ite8872set; |
2425 | u32 ite8872_lpt, ite8872_lpthi; | 2425 | u32 ite8872_lpt, ite8872_lpthi; |
2426 | u8 ite8872_irq, type; | 2426 | u8 ite8872_irq, type; |
2427 | char *fake_name = "parport probe"; | ||
2428 | int irq; | 2427 | int irq; |
2429 | int i; | 2428 | int i; |
2430 | 2429 | ||
@@ -2432,11 +2431,11 @@ static int __devinit sio_ite_8872_probe (struct pci_dev *pdev, int autoirq, | |||
2432 | 2431 | ||
2433 | // make sure which one chip | 2432 | // make sure which one chip |
2434 | for(i = 0; i < 5; i++) { | 2433 | for(i = 0; i < 5; i++) { |
2435 | base_res = request_region(inta_addr[i], 0x8, fake_name); | 2434 | base_res = request_region(inta_addr[i], 32, "it887x"); |
2436 | if (base_res) { | 2435 | if (base_res) { |
2437 | int test; | 2436 | int test; |
2438 | pci_write_config_dword (pdev, 0x60, | 2437 | pci_write_config_dword (pdev, 0x60, |
2439 | 0xe7000000 | inta_addr[i]); | 2438 | 0xe5000000 | inta_addr[i]); |
2440 | pci_write_config_dword (pdev, 0x78, | 2439 | pci_write_config_dword (pdev, 0x78, |
2441 | 0x00000000 | inta_addr[i]); | 2440 | 0x00000000 | inta_addr[i]); |
2442 | test = inb (inta_addr[i]); | 2441 | test = inb (inta_addr[i]); |
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 10dbdec80416..1b7b2812bf2d 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <linux/stat.h> | 20 | #include <linux/stat.h> |
21 | #include <linux/topology.h> | 21 | #include <linux/topology.h> |
22 | #include <linux/mm.h> | 22 | #include <linux/mm.h> |
23 | 23 | #include <linux/capability.h> | |
24 | #include "pci.h" | 24 | #include "pci.h" |
25 | 25 | ||
26 | static int sysfs_initialized; /* = 0 */ | 26 | static int sysfs_initialized; /* = 0 */ |
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index a7bce75c6732..34b8dae0d90f 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -22,6 +22,18 @@ EXPORT_SYMBOL(pci_root_buses); | |||
22 | 22 | ||
23 | LIST_HEAD(pci_devices); | 23 | LIST_HEAD(pci_devices); |
24 | 24 | ||
25 | /* | ||
26 | * Some device drivers need know if pci is initiated. | ||
27 | * Basically, we think pci is not initiated when there | ||
28 | * is no device in list of pci_devices. | ||
29 | */ | ||
30 | int no_pci_devices(void) | ||
31 | { | ||
32 | return list_empty(&pci_devices); | ||
33 | } | ||
34 | |||
35 | EXPORT_SYMBOL(no_pci_devices); | ||
36 | |||
25 | #ifdef HAVE_PCI_LEGACY | 37 | #ifdef HAVE_PCI_LEGACY |
26 | /** | 38 | /** |
27 | * pci_create_legacy_files - create legacy I/O port and memory files | 39 | * pci_create_legacy_files - create legacy I/O port and memory files |
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c index cfa0dfe61b1a..90adc62d07ff 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c | |||
@@ -11,7 +11,7 @@ | |||
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/proc_fs.h> | 12 | #include <linux/proc_fs.h> |
13 | #include <linux/seq_file.h> | 13 | #include <linux/seq_file.h> |
14 | 14 | #include <linux/capability.h> | |
15 | #include <asm/uaccess.h> | 15 | #include <asm/uaccess.h> |
16 | #include <asm/byteorder.h> | 16 | #include <asm/byteorder.h> |
17 | #include "pci.h" | 17 | #include "pci.h" |
diff --git a/drivers/pci/search.c b/drivers/pci/search.c index 9f7090fa8771..c6e79d01ce3d 100644 --- a/drivers/pci/search.c +++ b/drivers/pci/search.c | |||
@@ -202,7 +202,7 @@ static struct pci_dev * pci_find_subsys(unsigned int vendor, | |||
202 | * can cause some machines to crash. So here we detect and flag that | 202 | * can cause some machines to crash. So here we detect and flag that |
203 | * situation and bail out early. | 203 | * situation and bail out early. |
204 | */ | 204 | */ |
205 | if (unlikely(list_empty(&pci_devices))) | 205 | if (unlikely(no_pci_devices())) |
206 | return NULL; | 206 | return NULL; |
207 | down_read(&pci_bus_sem); | 207 | down_read(&pci_bus_sem); |
208 | n = from ? from->global_list.next : pci_devices.next; | 208 | n = from ? from->global_list.next : pci_devices.next; |
@@ -277,7 +277,7 @@ pci_get_subsys(unsigned int vendor, unsigned int device, | |||
277 | * can cause some machines to crash. So here we detect and flag that | 277 | * can cause some machines to crash. So here we detect and flag that |
278 | * situation and bail out early. | 278 | * situation and bail out early. |
279 | */ | 279 | */ |
280 | if (unlikely(list_empty(&pci_devices))) | 280 | if (unlikely(no_pci_devices())) |
281 | return NULL; | 281 | return NULL; |
282 | down_read(&pci_bus_sem); | 282 | down_read(&pci_bus_sem); |
283 | n = from ? from->global_list.next : pci_devices.next; | 283 | n = from ? from->global_list.next : pci_devices.next; |
diff --git a/drivers/pnp/Kconfig b/drivers/pnp/Kconfig index 1959cef8e9de..821933f9aa57 100644 --- a/drivers/pnp/Kconfig +++ b/drivers/pnp/Kconfig | |||
@@ -2,11 +2,9 @@ | |||
2 | # Plug and Play configuration | 2 | # Plug and Play configuration |
3 | # | 3 | # |
4 | 4 | ||
5 | menu "Plug and Play support" | 5 | menuconfig PNP |
6 | depends on HAS_IOMEM | ||
7 | |||
8 | config PNP | ||
9 | bool "Plug and Play support" | 6 | bool "Plug and Play support" |
7 | depends on HAS_IOMEM | ||
10 | depends on ISA || ACPI | 8 | depends on ISA || ACPI |
11 | ---help--- | 9 | ---help--- |
12 | Plug and Play (PnP) is a standard for peripherals which allows those | 10 | Plug and Play (PnP) is a standard for peripherals which allows those |
@@ -22,15 +20,15 @@ config PNP | |||
22 | 20 | ||
23 | If unsure, say Y. | 21 | If unsure, say Y. |
24 | 22 | ||
23 | if PNP | ||
24 | |||
25 | config PNP_DEBUG | 25 | config PNP_DEBUG |
26 | bool "PnP Debug Messages" | 26 | bool "PnP Debug Messages" |
27 | depends on PNP | ||
28 | help | 27 | help |
29 | Say Y if you want the Plug and Play Layer to print debug messages. | 28 | Say Y if you want the Plug and Play Layer to print debug messages. |
30 | This is useful if you are developing a PnP driver or troubleshooting. | 29 | This is useful if you are developing a PnP driver or troubleshooting. |
31 | 30 | ||
32 | comment "Protocols" | 31 | comment "Protocols" |
33 | depends on PNP | ||
34 | 32 | ||
35 | source "drivers/pnp/isapnp/Kconfig" | 33 | source "drivers/pnp/isapnp/Kconfig" |
36 | 34 | ||
@@ -38,5 +36,4 @@ source "drivers/pnp/pnpbios/Kconfig" | |||
38 | 36 | ||
39 | source "drivers/pnp/pnpacpi/Kconfig" | 37 | source "drivers/pnp/pnpacpi/Kconfig" |
40 | 38 | ||
41 | endmenu | 39 | endif # PNP |
42 | |||
diff --git a/drivers/pnp/isapnp/Kconfig b/drivers/pnp/isapnp/Kconfig index 578651eeb4b0..f1ef36673ad4 100644 --- a/drivers/pnp/isapnp/Kconfig +++ b/drivers/pnp/isapnp/Kconfig | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | config ISAPNP | 4 | config ISAPNP |
5 | bool "ISA Plug and Play support" | 5 | bool "ISA Plug and Play support" |
6 | depends on PNP && ISA | 6 | depends on ISA |
7 | help | 7 | help |
8 | Say Y here if you would like support for ISA Plug and Play devices. | 8 | Say Y here if you would like support for ISA Plug and Play devices. |
9 | Some information is in <file:Documentation/isapnp.txt>. | 9 | Some information is in <file:Documentation/isapnp.txt>. |
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index a0b158704ca1..914d00c423ad 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c | |||
@@ -370,8 +370,6 @@ static int __init isapnp_read_tag(unsigned char *type, unsigned short *size) | |||
370 | #if 0 | 370 | #if 0 |
371 | printk(KERN_DEBUG "tag = 0x%x, type = 0x%x, size = %i\n", tag, *type, *size); | 371 | printk(KERN_DEBUG "tag = 0x%x, type = 0x%x, size = %i\n", tag, *type, *size); |
372 | #endif | 372 | #endif |
373 | if (type == 0) /* wrong type */ | ||
374 | return -1; | ||
375 | if (*type == 0xff && *size == 0xffff) /* probably invalid data */ | 373 | if (*type == 0xff && *size == 0xffff) /* probably invalid data */ |
376 | return -1; | 374 | return -1; |
377 | return 0; | 375 | return 0; |
diff --git a/drivers/pnp/pnpbios/Kconfig b/drivers/pnp/pnpbios/Kconfig index fab848cae89d..b986d9fa3b9a 100644 --- a/drivers/pnp/pnpbios/Kconfig +++ b/drivers/pnp/pnpbios/Kconfig | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | config PNPBIOS | 4 | config PNPBIOS |
5 | bool "Plug and Play BIOS support (EXPERIMENTAL)" | 5 | bool "Plug and Play BIOS support (EXPERIMENTAL)" |
6 | depends on PNP && ISA && X86 && EXPERIMENTAL | 6 | depends on ISA && X86 && EXPERIMENTAL |
7 | default n | 7 | default n |
8 | ---help--- | 8 | ---help--- |
9 | Linux uses the PNPBIOS as defined in "Plug and Play BIOS | 9 | Linux uses the PNPBIOS as defined in "Plug and Play BIOS |
diff --git a/drivers/sbus/char/cpwatchdog.c b/drivers/sbus/char/cpwatchdog.c index 022e869c44dd..7b5773d88212 100644 --- a/drivers/sbus/char/cpwatchdog.c +++ b/drivers/sbus/char/cpwatchdog.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/ioport.h> | 24 | #include <linux/ioport.h> |
25 | #include <linux/timer.h> | 25 | #include <linux/timer.h> |
26 | #include <linux/smp_lock.h> | 26 | #include <linux/smp_lock.h> |
27 | #include <linux/io.h> | ||
27 | #include <asm/irq.h> | 28 | #include <asm/irq.h> |
28 | #include <asm/ebus.h> | 29 | #include <asm/ebus.h> |
29 | #include <asm/oplib.h> | 30 | #include <asm/oplib.h> |
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 9d2119b53ac9..372723161c97 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig | |||
@@ -545,7 +545,7 @@ config SCSI_HPTIOP | |||
545 | 545 | ||
546 | config SCSI_BUSLOGIC | 546 | config SCSI_BUSLOGIC |
547 | tristate "BusLogic SCSI support" | 547 | tristate "BusLogic SCSI support" |
548 | depends on (PCI || ISA || MCA) && SCSI && ISA_DMA_API | 548 | depends on (PCI || ISA || MCA) && SCSI && ISA_DMA_API && VIRT_TO_BUS |
549 | ---help--- | 549 | ---help--- |
550 | This is support for BusLogic MultiMaster and FlashPoint SCSI Host | 550 | This is support for BusLogic MultiMaster and FlashPoint SCSI Host |
551 | Adapters. Consult the SCSI-HOWTO, available from | 551 | Adapters. Consult the SCSI-HOWTO, available from |
diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c index 68817a7d8c0d..2aa6bfe8fdb3 100644 --- a/drivers/serial/68360serial.c +++ b/drivers/serial/68360serial.c | |||
@@ -934,8 +934,6 @@ static void change_speed(ser_info_t *info) | |||
934 | /* | 934 | /* |
935 | * Set up parity check flag | 935 | * Set up parity check flag |
936 | */ | 936 | */ |
937 | #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) | ||
938 | |||
939 | info->read_status_mask = (BD_SC_EMPTY | BD_SC_OV); | 937 | info->read_status_mask = (BD_SC_EMPTY | BD_SC_OV); |
940 | if (I_INPCK(info->tty)) | 938 | if (I_INPCK(info->tty)) |
941 | info->read_status_mask |= BD_SC_FR | BD_SC_PR; | 939 | info->read_status_mask |= BD_SC_FR | BD_SC_PR; |
@@ -1527,11 +1525,6 @@ static void rs_360_set_termios(struct tty_struct *tty, struct ktermios *old_term | |||
1527 | { | 1525 | { |
1528 | ser_info_t *info = (ser_info_t *)tty->driver_data; | 1526 | ser_info_t *info = (ser_info_t *)tty->driver_data; |
1529 | 1527 | ||
1530 | if ( (tty->termios->c_cflag == old_termios->c_cflag) | ||
1531 | && ( RELEVANT_IFLAG(tty->termios->c_iflag) | ||
1532 | == RELEVANT_IFLAG(old_termios->c_iflag))) | ||
1533 | return; | ||
1534 | |||
1535 | change_speed(info); | 1528 | change_speed(info); |
1536 | 1529 | ||
1537 | #ifdef modem_control | 1530 | #ifdef modem_control |
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index c84dab083a85..0b3ec38ae614 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -2514,12 +2514,18 @@ static int __init serial8250_console_setup(struct console *co, char *options) | |||
2514 | return uart_set_options(port, co, baud, parity, bits, flow); | 2514 | return uart_set_options(port, co, baud, parity, bits, flow); |
2515 | } | 2515 | } |
2516 | 2516 | ||
2517 | static int __init serial8250_console_early_setup(void) | ||
2518 | { | ||
2519 | return serial8250_find_port_for_earlycon(); | ||
2520 | } | ||
2521 | |||
2517 | static struct uart_driver serial8250_reg; | 2522 | static struct uart_driver serial8250_reg; |
2518 | static struct console serial8250_console = { | 2523 | static struct console serial8250_console = { |
2519 | .name = "ttyS", | 2524 | .name = "ttyS", |
2520 | .write = serial8250_console_write, | 2525 | .write = serial8250_console_write, |
2521 | .device = uart_console_device, | 2526 | .device = uart_console_device, |
2522 | .setup = serial8250_console_setup, | 2527 | .setup = serial8250_console_setup, |
2528 | .early_setup = serial8250_console_early_setup, | ||
2523 | .flags = CON_PRINTBUFFER, | 2529 | .flags = CON_PRINTBUFFER, |
2524 | .index = -1, | 2530 | .index = -1, |
2525 | .data = &serial8250_reg, | 2531 | .data = &serial8250_reg, |
@@ -2533,7 +2539,7 @@ static int __init serial8250_console_init(void) | |||
2533 | } | 2539 | } |
2534 | console_initcall(serial8250_console_init); | 2540 | console_initcall(serial8250_console_init); |
2535 | 2541 | ||
2536 | static int __init find_port(struct uart_port *p) | 2542 | int serial8250_find_port(struct uart_port *p) |
2537 | { | 2543 | { |
2538 | int line; | 2544 | int line; |
2539 | struct uart_port *port; | 2545 | struct uart_port *port; |
@@ -2546,26 +2552,6 @@ static int __init find_port(struct uart_port *p) | |||
2546 | return -ENODEV; | 2552 | return -ENODEV; |
2547 | } | 2553 | } |
2548 | 2554 | ||
2549 | int __init serial8250_start_console(struct uart_port *port, char *options) | ||
2550 | { | ||
2551 | int line; | ||
2552 | |||
2553 | line = find_port(port); | ||
2554 | if (line < 0) | ||
2555 | return -ENODEV; | ||
2556 | |||
2557 | add_preferred_console("ttyS", line, options); | ||
2558 | printk("Adding console on ttyS%d at %s 0x%lx (options '%s')\n", | ||
2559 | line, port->iotype == UPIO_MEM ? "MMIO" : "I/O port", | ||
2560 | port->iotype == UPIO_MEM ? (unsigned long) port->mapbase : | ||
2561 | (unsigned long) port->iobase, options); | ||
2562 | if (!(serial8250_console.flags & CON_ENABLED)) { | ||
2563 | serial8250_console.flags &= ~CON_PRINTBUFFER; | ||
2564 | register_console(&serial8250_console); | ||
2565 | } | ||
2566 | return line; | ||
2567 | } | ||
2568 | |||
2569 | #define SERIAL8250_CONSOLE &serial8250_console | 2555 | #define SERIAL8250_CONSOLE &serial8250_console |
2570 | #else | 2556 | #else |
2571 | #define SERIAL8250_CONSOLE NULL | 2557 | #define SERIAL8250_CONSOLE NULL |
diff --git a/drivers/serial/8250_early.c b/drivers/serial/8250_early.c index 7e511199b4c5..947c20507e1f 100644 --- a/drivers/serial/8250_early.c +++ b/drivers/serial/8250_early.c | |||
@@ -17,13 +17,11 @@ | |||
17 | * we locate the device directly by its MMIO or I/O port address. | 17 | * we locate the device directly by its MMIO or I/O port address. |
18 | * | 18 | * |
19 | * The user can specify the device directly, e.g., | 19 | * The user can specify the device directly, e.g., |
20 | * console=uart,io,0x3f8,9600n8 | 20 | * earlycon=uart8250,io,0x3f8,9600n8 |
21 | * console=uart,mmio,0xff5e0000,115200n8 | 21 | * earlycon=uart8250,mmio,0xff5e0000,115200n8 |
22 | * or platform code can call early_uart_console_init() to set | 22 | * or |
23 | * the early UART device. | 23 | * console=uart8250,io,0x3f8,9600n8 |
24 | * | 24 | * console=uart8250,mmio,0xff5e0000,115200n8 |
25 | * After the normal serial driver starts, we try to locate the | ||
26 | * matching ttyS device and start a console there. | ||
27 | */ | 25 | */ |
28 | 26 | ||
29 | #include <linux/tty.h> | 27 | #include <linux/tty.h> |
@@ -32,17 +30,21 @@ | |||
32 | #include <linux/serial_core.h> | 30 | #include <linux/serial_core.h> |
33 | #include <linux/serial_reg.h> | 31 | #include <linux/serial_reg.h> |
34 | #include <linux/serial.h> | 32 | #include <linux/serial.h> |
33 | #include <linux/serial_8250.h> | ||
35 | #include <asm/io.h> | 34 | #include <asm/io.h> |
36 | #include <asm/serial.h> | 35 | #include <asm/serial.h> |
36 | #ifdef CONFIG_FIX_EARLYCON_MEM | ||
37 | #include <asm/pgtable.h> | ||
38 | #include <asm/fixmap.h> | ||
39 | #endif | ||
37 | 40 | ||
38 | struct early_uart_device { | 41 | struct early_serial8250_device { |
39 | struct uart_port port; | 42 | struct uart_port port; |
40 | char options[16]; /* e.g., 115200n8 */ | 43 | char options[16]; /* e.g., 115200n8 */ |
41 | unsigned int baud; | 44 | unsigned int baud; |
42 | }; | 45 | }; |
43 | 46 | ||
44 | static struct early_uart_device early_device __initdata; | 47 | static struct early_serial8250_device early_device; |
45 | static int early_uart_registered __initdata; | ||
46 | 48 | ||
47 | static unsigned int __init serial_in(struct uart_port *port, int offset) | 49 | static unsigned int __init serial_in(struct uart_port *port, int offset) |
48 | { | 50 | { |
@@ -80,7 +82,7 @@ static void __init putc(struct uart_port *port, int c) | |||
80 | serial_out(port, UART_TX, c); | 82 | serial_out(port, UART_TX, c); |
81 | } | 83 | } |
82 | 84 | ||
83 | static void __init early_uart_write(struct console *console, const char *s, unsigned int count) | 85 | static void __init early_serial8250_write(struct console *console, const char *s, unsigned int count) |
84 | { | 86 | { |
85 | struct uart_port *port = &early_device.port; | 87 | struct uart_port *port = &early_device.port; |
86 | unsigned int ier; | 88 | unsigned int ier; |
@@ -111,7 +113,7 @@ static unsigned int __init probe_baud(struct uart_port *port) | |||
111 | return (port->uartclk / 16) / quot; | 113 | return (port->uartclk / 16) / quot; |
112 | } | 114 | } |
113 | 115 | ||
114 | static void __init init_port(struct early_uart_device *device) | 116 | static void __init init_port(struct early_serial8250_device *device) |
115 | { | 117 | { |
116 | struct uart_port *port = &device->port; | 118 | struct uart_port *port = &device->port; |
117 | unsigned int divisor; | 119 | unsigned int divisor; |
@@ -130,10 +132,9 @@ static void __init init_port(struct early_uart_device *device) | |||
130 | serial_out(port, UART_LCR, c & ~UART_LCR_DLAB); | 132 | serial_out(port, UART_LCR, c & ~UART_LCR_DLAB); |
131 | } | 133 | } |
132 | 134 | ||
133 | static int __init parse_options(struct early_uart_device *device, char *options) | 135 | static int __init parse_options(struct early_serial8250_device *device, char *options) |
134 | { | 136 | { |
135 | struct uart_port *port = &device->port; | 137 | struct uart_port *port = &device->port; |
136 | int mapsize = 64; | ||
137 | int mmio, length; | 138 | int mmio, length; |
138 | 139 | ||
139 | if (!options) | 140 | if (!options) |
@@ -143,12 +144,18 @@ static int __init parse_options(struct early_uart_device *device, char *options) | |||
143 | if (!strncmp(options, "mmio,", 5)) { | 144 | if (!strncmp(options, "mmio,", 5)) { |
144 | port->iotype = UPIO_MEM; | 145 | port->iotype = UPIO_MEM; |
145 | port->mapbase = simple_strtoul(options + 5, &options, 0); | 146 | port->mapbase = simple_strtoul(options + 5, &options, 0); |
146 | port->membase = ioremap(port->mapbase, mapsize); | 147 | #ifdef CONFIG_FIX_EARLYCON_MEM |
148 | set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, port->mapbase & PAGE_MASK); | ||
149 | port->membase = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE); | ||
150 | port->membase += port->mapbase & ~PAGE_MASK; | ||
151 | #else | ||
152 | port->membase = ioremap(port->mapbase, 64); | ||
147 | if (!port->membase) { | 153 | if (!port->membase) { |
148 | printk(KERN_ERR "%s: Couldn't ioremap 0x%lx\n", | 154 | printk(KERN_ERR "%s: Couldn't ioremap 0x%lx\n", |
149 | __FUNCTION__, port->mapbase); | 155 | __FUNCTION__, port->mapbase); |
150 | return -ENOMEM; | 156 | return -ENOMEM; |
151 | } | 157 | } |
158 | #endif | ||
152 | mmio = 1; | 159 | mmio = 1; |
153 | } else if (!strncmp(options, "io,", 3)) { | 160 | } else if (!strncmp(options, "io,", 3)) { |
154 | port->iotype = UPIO_PORT; | 161 | port->iotype = UPIO_PORT; |
@@ -175,9 +182,16 @@ static int __init parse_options(struct early_uart_device *device, char *options) | |||
175 | return 0; | 182 | return 0; |
176 | } | 183 | } |
177 | 184 | ||
178 | static int __init early_uart_setup(struct console *console, char *options) | 185 | static struct console early_serial8250_console __initdata = { |
186 | .name = "uart", | ||
187 | .write = early_serial8250_write, | ||
188 | .flags = CON_PRINTBUFFER | CON_BOOT, | ||
189 | .index = -1, | ||
190 | }; | ||
191 | |||
192 | static int __init early_serial8250_setup(char *options) | ||
179 | { | 193 | { |
180 | struct early_uart_device *device = &early_device; | 194 | struct early_serial8250_device *device = &early_device; |
181 | int err; | 195 | int err; |
182 | 196 | ||
183 | if (device->port.membase || device->port.iobase) | 197 | if (device->port.membase || device->port.iobase) |
@@ -190,61 +204,48 @@ static int __init early_uart_setup(struct console *console, char *options) | |||
190 | return 0; | 204 | return 0; |
191 | } | 205 | } |
192 | 206 | ||
193 | static struct console early_uart_console __initdata = { | 207 | int __init setup_early_serial8250_console(char *cmdline) |
194 | .name = "uart", | ||
195 | .write = early_uart_write, | ||
196 | .setup = early_uart_setup, | ||
197 | .flags = CON_PRINTBUFFER, | ||
198 | .index = -1, | ||
199 | }; | ||
200 | |||
201 | static int __init early_uart_console_init(void) | ||
202 | { | ||
203 | if (!early_uart_registered) { | ||
204 | register_console(&early_uart_console); | ||
205 | early_uart_registered = 1; | ||
206 | } | ||
207 | return 0; | ||
208 | } | ||
209 | console_initcall(early_uart_console_init); | ||
210 | |||
211 | int __init early_serial_console_init(char *cmdline) | ||
212 | { | 208 | { |
213 | char *options; | 209 | char *options; |
214 | int err; | 210 | int err; |
215 | 211 | ||
216 | options = strstr(cmdline, "console=uart,"); | 212 | options = strstr(cmdline, "uart8250,"); |
217 | if (!options) | 213 | if (!options) { |
218 | return -ENODEV; | 214 | options = strstr(cmdline, "uart,"); |
215 | if (!options) | ||
216 | return 0; | ||
217 | } | ||
219 | 218 | ||
220 | options = strchr(cmdline, ',') + 1; | 219 | options = strchr(cmdline, ',') + 1; |
221 | if ((err = early_uart_setup(NULL, options)) < 0) | 220 | if ((err = early_serial8250_setup(options)) < 0) |
222 | return err; | 221 | return err; |
223 | return early_uart_console_init(); | 222 | |
223 | register_console(&early_serial8250_console); | ||
224 | |||
225 | return 0; | ||
224 | } | 226 | } |
225 | 227 | ||
226 | static int __init early_uart_console_switch(void) | 228 | int __init serial8250_find_port_for_earlycon(void) |
227 | { | 229 | { |
228 | struct early_uart_device *device = &early_device; | 230 | struct early_serial8250_device *device = &early_device; |
229 | struct uart_port *port = &device->port; | 231 | struct uart_port *port = &device->port; |
230 | int mmio, line; | 232 | int line; |
233 | int ret; | ||
231 | 234 | ||
232 | if (!(early_uart_console.flags & CON_ENABLED)) | 235 | if (!device->port.membase && !device->port.iobase) |
233 | return 0; | 236 | return -ENODEV; |
234 | 237 | ||
235 | /* Try to start the normal driver on a matching line. */ | 238 | line = serial8250_find_port(port); |
236 | mmio = (port->iotype == UPIO_MEM); | ||
237 | line = serial8250_start_console(port, device->options); | ||
238 | if (line < 0) | 239 | if (line < 0) |
239 | printk("No ttyS device at %s 0x%lx for console\n", | 240 | return -ENODEV; |
240 | mmio ? "MMIO" : "I/O port", | ||
241 | mmio ? port->mapbase : | ||
242 | (unsigned long) port->iobase); | ||
243 | 241 | ||
244 | unregister_console(&early_uart_console); | 242 | ret = update_console_cmdline("uart", 8250, |
245 | if (mmio) | 243 | "ttyS", line, device->options); |
246 | iounmap(port->membase); | 244 | if (ret < 0) |
245 | ret = update_console_cmdline("uart", 0, | ||
246 | "ttyS", line, device->options); | ||
247 | 247 | ||
248 | return 0; | 248 | return ret; |
249 | } | 249 | } |
250 | late_initcall(early_uart_console_switch); | 250 | |
251 | early_param("earlycon", setup_early_serial8250_console); | ||
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 2adbed4e10f3..cab42cbd920d 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig | |||
@@ -62,8 +62,22 @@ config SERIAL_8250_CONSOLE | |||
62 | kernel will automatically use the first serial line, /dev/ttyS0, as | 62 | kernel will automatically use the first serial line, /dev/ttyS0, as |
63 | system console. | 63 | system console. |
64 | 64 | ||
65 | you can set that using a kernel command line option such as | ||
66 | "console=uart8250,io,0x3f8,9600n8" | ||
67 | "console=uart8250,mmio,0xff5e0000,115200n8". | ||
68 | and it will switch to normal serial console when correponding port is | ||
69 | ready. | ||
70 | "earlycon=uart8250,io,0x3f8,9600n8" | ||
71 | "earlycon=uart8250,mmio,0xff5e0000,115200n8". | ||
72 | it will not only setup early console. | ||
73 | |||
65 | If unsure, say N. | 74 | If unsure, say N. |
66 | 75 | ||
76 | config FIX_EARLYCON_MEM | ||
77 | bool | ||
78 | depends on X86 | ||
79 | default y | ||
80 | |||
67 | config SERIAL_8250_GSC | 81 | config SERIAL_8250_GSC |
68 | tristate | 82 | tristate |
69 | depends on SERIAL_8250 && GSC | 83 | depends on SERIAL_8250 && GSC |
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index 3320bcd92c0a..4d6b3c56d20e 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c | |||
@@ -114,6 +114,7 @@ struct atmel_uart_port { | |||
114 | struct uart_port uart; /* uart */ | 114 | struct uart_port uart; /* uart */ |
115 | struct clk *clk; /* uart clock */ | 115 | struct clk *clk; /* uart clock */ |
116 | unsigned short suspended; /* is port suspended? */ | 116 | unsigned short suspended; /* is port suspended? */ |
117 | int break_active; /* break being received */ | ||
117 | }; | 118 | }; |
118 | 119 | ||
119 | static struct atmel_uart_port atmel_ports[ATMEL_MAX_UART]; | 120 | static struct atmel_uart_port atmel_ports[ATMEL_MAX_UART]; |
@@ -252,6 +253,7 @@ static void atmel_break_ctl(struct uart_port *port, int break_state) | |||
252 | */ | 253 | */ |
253 | static void atmel_rx_chars(struct uart_port *port) | 254 | static void atmel_rx_chars(struct uart_port *port) |
254 | { | 255 | { |
256 | struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port; | ||
255 | struct tty_struct *tty = port->info->tty; | 257 | struct tty_struct *tty = port->info->tty; |
256 | unsigned int status, ch, flg; | 258 | unsigned int status, ch, flg; |
257 | 259 | ||
@@ -267,13 +269,29 @@ static void atmel_rx_chars(struct uart_port *port) | |||
267 | * note that the error handling code is | 269 | * note that the error handling code is |
268 | * out of the main execution path | 270 | * out of the main execution path |
269 | */ | 271 | */ |
270 | if (unlikely(status & (ATMEL_US_PARE | ATMEL_US_FRAME | ATMEL_US_OVRE | ATMEL_US_RXBRK))) { | 272 | if (unlikely(status & (ATMEL_US_PARE | ATMEL_US_FRAME |
273 | | ATMEL_US_OVRE | ATMEL_US_RXBRK) | ||
274 | || atmel_port->break_active)) { | ||
271 | UART_PUT_CR(port, ATMEL_US_RSTSTA); /* clear error */ | 275 | UART_PUT_CR(port, ATMEL_US_RSTSTA); /* clear error */ |
272 | if (status & ATMEL_US_RXBRK) { | 276 | if (status & ATMEL_US_RXBRK |
277 | && !atmel_port->break_active) { | ||
273 | status &= ~(ATMEL_US_PARE | ATMEL_US_FRAME); /* ignore side-effect */ | 278 | status &= ~(ATMEL_US_PARE | ATMEL_US_FRAME); /* ignore side-effect */ |
274 | port->icount.brk++; | 279 | port->icount.brk++; |
280 | atmel_port->break_active = 1; | ||
281 | UART_PUT_IER(port, ATMEL_US_RXBRK); | ||
275 | if (uart_handle_break(port)) | 282 | if (uart_handle_break(port)) |
276 | goto ignore_char; | 283 | goto ignore_char; |
284 | } else { | ||
285 | /* | ||
286 | * This is either the end-of-break | ||
287 | * condition or we've received at | ||
288 | * least one character without RXBRK | ||
289 | * being set. In both cases, the next | ||
290 | * RXBRK will indicate start-of-break. | ||
291 | */ | ||
292 | UART_PUT_IDR(port, ATMEL_US_RXBRK); | ||
293 | status &= ~ATMEL_US_RXBRK; | ||
294 | atmel_port->break_active = 0; | ||
277 | } | 295 | } |
278 | if (status & ATMEL_US_PARE) | 296 | if (status & ATMEL_US_PARE) |
279 | port->icount.parity++; | 297 | port->icount.parity++; |
@@ -352,6 +370,16 @@ static irqreturn_t atmel_interrupt(int irq, void *dev_id) | |||
352 | /* Interrupt receive */ | 370 | /* Interrupt receive */ |
353 | if (pending & ATMEL_US_RXRDY) | 371 | if (pending & ATMEL_US_RXRDY) |
354 | atmel_rx_chars(port); | 372 | atmel_rx_chars(port); |
373 | else if (pending & ATMEL_US_RXBRK) { | ||
374 | /* | ||
375 | * End of break detected. If it came along | ||
376 | * with a character, atmel_rx_chars will | ||
377 | * handle it. | ||
378 | */ | ||
379 | UART_PUT_CR(port, ATMEL_US_RSTSTA); | ||
380 | UART_PUT_IDR(port, ATMEL_US_RXBRK); | ||
381 | atmel_port->break_active = 0; | ||
382 | } | ||
355 | 383 | ||
356 | // TODO: All reads to CSR will clear these interrupts! | 384 | // TODO: All reads to CSR will clear these interrupts! |
357 | if (pending & ATMEL_US_RIIC) port->icount.rng++; | 385 | if (pending & ATMEL_US_RIIC) port->icount.rng++; |
diff --git a/drivers/serial/ip22zilog.c b/drivers/serial/ip22zilog.c index c3abfb39f316..f3257f708ef9 100644 --- a/drivers/serial/ip22zilog.c +++ b/drivers/serial/ip22zilog.c | |||
@@ -862,6 +862,7 @@ ip22zilog_set_termios(struct uart_port *port, struct ktermios *termios, | |||
862 | up->cflag = termios->c_cflag; | 862 | up->cflag = termios->c_cflag; |
863 | 863 | ||
864 | ip22zilog_maybe_update_regs(up, ZILOG_CHANNEL_FROM_PORT(port)); | 864 | ip22zilog_maybe_update_regs(up, ZILOG_CHANNEL_FROM_PORT(port)); |
865 | uart_update_timeout(port, termios->c_cflag, baud); | ||
865 | 866 | ||
866 | spin_unlock_irqrestore(&up->port.lock, flags); | 867 | spin_unlock_irqrestore(&up->port.lock, flags); |
867 | } | 868 | } |
@@ -1017,6 +1018,8 @@ ip22serial_console_termios(struct console *con, char *options) | |||
1017 | } | 1018 | } |
1018 | 1019 | ||
1019 | con->cflag = cflag | CS8; /* 8N1 */ | 1020 | con->cflag = cflag | CS8; /* 8N1 */ |
1021 | |||
1022 | uart_update_timeout(&ip22zilog_port_table[con->index].port, cflag, baud); | ||
1020 | } | 1023 | } |
1021 | 1024 | ||
1022 | static int __init ip22zilog_console_setup(struct console *con, char *options) | 1025 | static int __init ip22zilog_console_setup(struct console *con, char *options) |
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 326020f86f75..9c57486c2e7f 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
@@ -1910,6 +1910,12 @@ uart_set_options(struct uart_port *port, struct console *co, | |||
1910 | if (flow == 'r') | 1910 | if (flow == 'r') |
1911 | termios.c_cflag |= CRTSCTS; | 1911 | termios.c_cflag |= CRTSCTS; |
1912 | 1912 | ||
1913 | /* | ||
1914 | * some uarts on other side don't support no flow control. | ||
1915 | * So we set * DTR in host uart to make them happy | ||
1916 | */ | ||
1917 | port->mctrl |= TIOCM_DTR; | ||
1918 | |||
1913 | port->ops->set_termios(port, &termios, NULL); | 1919 | port->ops->set_termios(port, &termios, NULL); |
1914 | co->cflag = termios.c_cflag; | 1920 | co->cflag = termios.c_cflag; |
1915 | 1921 | ||
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 1f89496d530e..672cd1042539 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
@@ -367,7 +367,9 @@ static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag) | |||
367 | } else { | 367 | } else { |
368 | #ifdef CONFIG_CPU_SUBTYPE_SH7343 | 368 | #ifdef CONFIG_CPU_SUBTYPE_SH7343 |
369 | /* Nothing */ | 369 | /* Nothing */ |
370 | #elif defined(CONFIG_CPU_SUBTYPE_SH7780) || defined(CONFIG_CPU_SUBTYPE_SH7785) | 370 | #elif defined(CONFIG_CPU_SUBTYPE_SH7780) || \ |
371 | defined(CONFIG_CPU_SUBTYPE_SH7785) || \ | ||
372 | defined(CONFIG_CPU_SUBTYPE_SHX3) | ||
371 | ctrl_outw(0x0080, SCSPTR0); /* Set RTS = 1 */ | 373 | ctrl_outw(0x0080, SCSPTR0); /* Set RTS = 1 */ |
372 | #else | 374 | #else |
373 | ctrl_outw(0x0080, SCSPTR2); /* Set RTS = 1 */ | 375 | ctrl_outw(0x0080, SCSPTR2); /* Set RTS = 1 */ |
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h index fb04fb5f9843..247fb66bf0f4 100644 --- a/drivers/serial/sh-sci.h +++ b/drivers/serial/sh-sci.h | |||
@@ -53,7 +53,12 @@ | |||
53 | # define SCIF_ORER 0x0001 /* overrun error bit */ | 53 | # define SCIF_ORER 0x0001 /* overrun error bit */ |
54 | # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 54 | # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ |
55 | # define SCIF_ONLY | 55 | # define SCIF_ONLY |
56 | #elif defined(CONFIG_CPU_SUBTYPE_SH7750) || defined(CONFIG_CPU_SUBTYPE_SH7751) | 56 | #elif defined(CONFIG_CPU_SUBTYPE_SH7750) || \ |
57 | defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ | ||
58 | defined(CONFIG_CPU_SUBTYPE_SH7750S) || \ | ||
59 | defined(CONFIG_CPU_SUBTYPE_SH7091) || \ | ||
60 | defined(CONFIG_CPU_SUBTYPE_SH7751) || \ | ||
61 | defined(CONFIG_CPU_SUBTYPE_SH7751R) | ||
57 | # define SCSPTR1 0xffe0001c /* 8 bit SCI */ | 62 | # define SCSPTR1 0xffe0001c /* 8 bit SCI */ |
58 | # define SCSPTR2 0xFFE80020 /* 16 bit SCIF */ | 63 | # define SCSPTR2 0xFFE80020 /* 16 bit SCIF */ |
59 | # define SCIF_ORER 0x0001 /* overrun error bit */ | 64 | # define SCIF_ORER 0x0001 /* overrun error bit */ |
@@ -73,7 +78,7 @@ | |||
73 | # define SCPDR 0xA4050136 /* 16 bit SCIF */ | 78 | # define SCPDR 0xA4050136 /* 16 bit SCIF */ |
74 | # define SCSCR_INIT(port) 0x0030 /* TIE=0,RIE=0,TE=1,RE=1 */ | 79 | # define SCSCR_INIT(port) 0x0030 /* TIE=0,RIE=0,TE=1,RE=1 */ |
75 | # define SCIF_ONLY | 80 | # define SCIF_ONLY |
76 | #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) | 81 | #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) |
77 | # define SCSPTR0 0xA4400000 /* 16 bit SCIF */ | 82 | # define SCSPTR0 0xA4400000 /* 16 bit SCIF */ |
78 | # define SCI_NPORTS 2 | 83 | # define SCI_NPORTS 2 |
79 | # define SCIF_ORER 0x0001 /* overrun error bit */ | 84 | # define SCIF_ORER 0x0001 /* overrun error bit */ |
@@ -168,6 +173,14 @@ | |||
168 | # define SCIF_ORER 0x0001 /* overrun error bit */ | 173 | # define SCIF_ORER 0x0001 /* overrun error bit */ |
169 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 174 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ |
170 | # define SCIF_ONLY | 175 | # define SCIF_ONLY |
176 | #elif defined(CONFIG_CPU_SUBTYPE_SHX3) | ||
177 | # define SCSPTR0 0xffc30020 /* 16 bit SCIF */ | ||
178 | # define SCSPTR1 0xffc40020 /* 16 bit SCIF */ | ||
179 | # define SCSPTR2 0xffc50020 /* 16 bit SCIF */ | ||
180 | # define SCSPTR3 0xffc60020 /* 16 bit SCIF */ | ||
181 | # define SCIF_ORER 0x0001 /* Overrun error bit */ | ||
182 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | ||
183 | # define SCIF_ONLY | ||
171 | #else | 184 | #else |
172 | # error CPU subtype not defined | 185 | # error CPU subtype not defined |
173 | #endif | 186 | #endif |
@@ -177,10 +190,15 @@ | |||
177 | #define SCI_CTRL_FLAGS_RIE 0x40 /* all */ | 190 | #define SCI_CTRL_FLAGS_RIE 0x40 /* all */ |
178 | #define SCI_CTRL_FLAGS_TE 0x20 /* all */ | 191 | #define SCI_CTRL_FLAGS_TE 0x20 /* all */ |
179 | #define SCI_CTRL_FLAGS_RE 0x10 /* all */ | 192 | #define SCI_CTRL_FLAGS_RE 0x10 /* all */ |
180 | #if defined(CONFIG_CPU_SUBTYPE_SH7750) || \ | 193 | #if defined(CONFIG_CPU_SUBTYPE_SH7750) || \ |
181 | defined(CONFIG_CPU_SUBTYPE_SH7751) || \ | 194 | defined(CONFIG_CPU_SUBTYPE_SH7091) || \ |
182 | defined(CONFIG_CPU_SUBTYPE_SH7780) || \ | 195 | defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ |
183 | defined(CONFIG_CPU_SUBTYPE_SH7785) | 196 | defined(CONFIG_CPU_SUBTYPE_SH7750S) || \ |
197 | defined(CONFIG_CPU_SUBTYPE_SH7751) || \ | ||
198 | defined(CONFIG_CPU_SUBTYPE_SH7751R) || \ | ||
199 | defined(CONFIG_CPU_SUBTYPE_SH7780) || \ | ||
200 | defined(CONFIG_CPU_SUBTYPE_SH7785) || \ | ||
201 | defined(CONFIG_CPU_SUBTYPE_SHX3) | ||
184 | #define SCI_CTRL_FLAGS_REIE 0x08 /* 7750 SCIF */ | 202 | #define SCI_CTRL_FLAGS_REIE 0x08 /* 7750 SCIF */ |
185 | #else | 203 | #else |
186 | #define SCI_CTRL_FLAGS_REIE 0 | 204 | #define SCI_CTRL_FLAGS_REIE 0 |
@@ -514,8 +532,12 @@ static inline void set_sh771x_scif_pfc(struct uart_port *port) | |||
514 | } | 532 | } |
515 | } | 533 | } |
516 | 534 | ||
517 | #elif defined(CONFIG_CPU_SUBTYPE_SH7750) || \ | 535 | #elif defined(CONFIG_CPU_SUBTYPE_SH7750) || \ |
518 | defined(CONFIG_CPU_SUBTYPE_SH7751) || \ | 536 | defined(CONFIG_CPU_SUBTYPE_SH7751) || \ |
537 | defined(CONFIG_CPU_SUBTYPE_SH7751R) || \ | ||
538 | defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ | ||
539 | defined(CONFIG_CPU_SUBTYPE_SH7750S) || \ | ||
540 | defined(CONFIG_CPU_SUBTYPE_SH7091) || \ | ||
519 | defined(CONFIG_CPU_SUBTYPE_SH4_202) | 541 | defined(CONFIG_CPU_SUBTYPE_SH4_202) |
520 | static inline int sci_rxd_in(struct uart_port *port) | 542 | static inline int sci_rxd_in(struct uart_port *port) |
521 | { | 543 | { |
@@ -653,6 +675,18 @@ static inline int sci_rxd_in(struct uart_port *port) | |||
653 | return ctrl_inw(SCSPTR2) & 0x0001 ? 1 : 0; /* SCIF */ | 675 | return ctrl_inw(SCSPTR2) & 0x0001 ? 1 : 0; /* SCIF */ |
654 | return 1; | 676 | return 1; |
655 | } | 677 | } |
678 | #elif defined(CONFIG_CPU_SUBTYPE_SHX3) | ||
679 | static inline int sci_rxd_in(struct uart_port *port) | ||
680 | { | ||
681 | if (port->mapbase == 0xffc30000) | ||
682 | return ctrl_inw(SCSPTR0) & 0x0001 ? 1 : 0; /* SCIF */ | ||
683 | if (port->mapbase == 0xffc40000) | ||
684 | return ctrl_inw(SCSPTR1) & 0x0001 ? 1 : 0; /* SCIF */ | ||
685 | if (port->mapbase == 0xffc50000) | ||
686 | return ctrl_inw(SCSPTR2) & 0x0001 ? 1 : 0; /* SCIF */ | ||
687 | if (port->mapbase == 0xffc60000) | ||
688 | return ctrl_inw(SCSPTR3) & 0x0001 ? 1 : 0; /* SCIF */ | ||
689 | } | ||
656 | #endif | 690 | #endif |
657 | 691 | ||
658 | /* | 692 | /* |
diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c index a27e9e92cb5e..41fc61264443 100644 --- a/drivers/serial/sn_console.c +++ b/drivers/serial/sn_console.c | |||
@@ -759,7 +759,7 @@ static void __init sn_sal_switch_to_interrupts(struct sn_cons_port *port) | |||
759 | */ | 759 | */ |
760 | 760 | ||
761 | static void sn_sal_console_write(struct console *, const char *, unsigned); | 761 | static void sn_sal_console_write(struct console *, const char *, unsigned); |
762 | static int __init sn_sal_console_setup(struct console *, char *); | 762 | static int sn_sal_console_setup(struct console *, char *); |
763 | static struct uart_driver sal_console_uart; | 763 | static struct uart_driver sal_console_uart; |
764 | extern struct tty_driver *uart_console_device(struct console *, int *); | 764 | extern struct tty_driver *uart_console_device(struct console *, int *); |
765 | 765 | ||
@@ -1006,7 +1006,7 @@ sn_sal_console_write(struct console *co, const char *s, unsigned count) | |||
1006 | * here so providing it is easier. | 1006 | * here so providing it is easier. |
1007 | * | 1007 | * |
1008 | */ | 1008 | */ |
1009 | static int __init sn_sal_console_setup(struct console *co, char *options) | 1009 | static int sn_sal_console_setup(struct console *co, char *options) |
1010 | { | 1010 | { |
1011 | return 0; | 1011 | return 0; |
1012 | } | 1012 | } |
diff --git a/drivers/telephony/Kconfig b/drivers/telephony/Kconfig index dd1d6a53f3c0..8f530e68263b 100644 --- a/drivers/telephony/Kconfig +++ b/drivers/telephony/Kconfig | |||
@@ -2,11 +2,9 @@ | |||
2 | # Telephony device configuration | 2 | # Telephony device configuration |
3 | # | 3 | # |
4 | 4 | ||
5 | menu "Telephony Support" | 5 | menuconfig PHONE |
6 | tristate "Telephony support" | ||
6 | depends on HAS_IOMEM | 7 | depends on HAS_IOMEM |
7 | |||
8 | config PHONE | ||
9 | tristate "Linux telephony support" | ||
10 | ---help--- | 8 | ---help--- |
11 | Say Y here if you have a telephony card, which for example allows | 9 | Say Y here if you have a telephony card, which for example allows |
12 | you to use a regular phone for voice-over-IP applications. | 10 | you to use a regular phone for voice-over-IP applications. |
@@ -17,9 +15,10 @@ config PHONE | |||
17 | To compile this driver as a module, choose M here: the | 15 | To compile this driver as a module, choose M here: the |
18 | module will be called phonedev. | 16 | module will be called phonedev. |
19 | 17 | ||
18 | if PHONE | ||
19 | |||
20 | config PHONE_IXJ | 20 | config PHONE_IXJ |
21 | tristate "QuickNet Internet LineJack/PhoneJack support" | 21 | tristate "QuickNet Internet LineJack/PhoneJack support" |
22 | depends on PHONE | ||
23 | ---help--- | 22 | ---help--- |
24 | Say M if you have a telephony card manufactured by Quicknet | 23 | Say M if you have a telephony card manufactured by Quicknet |
25 | Technologies, Inc. These include the Internet PhoneJACK and | 24 | Technologies, Inc. These include the Internet PhoneJACK and |
@@ -44,5 +43,4 @@ config PHONE_IXJ_PCMCIA | |||
44 | cards manufactured by Quicknet Technologies, Inc. This changes the | 43 | cards manufactured by Quicknet Technologies, Inc. This changes the |
45 | card initialization code to work with the card manager daemon. | 44 | card initialization code to work with the card manager daemon. |
46 | 45 | ||
47 | endmenu | 46 | endif # PHONE |
48 | |||
diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c index df2909ae704c..2ba959a83eb0 100644 --- a/drivers/video/pvr2fb.c +++ b/drivers/video/pvr2fb.c | |||
@@ -115,11 +115,11 @@ enum { VO_PAL, VO_NTSC, VO_VGA }; | |||
115 | enum { PAL_ARGB1555, PAL_RGB565, PAL_ARGB4444, PAL_ARGB8888 }; | 115 | enum { PAL_ARGB1555, PAL_RGB565, PAL_ARGB4444, PAL_ARGB8888 }; |
116 | 116 | ||
117 | struct pvr2_params { unsigned int val; char *name; }; | 117 | struct pvr2_params { unsigned int val; char *name; }; |
118 | static struct pvr2_params cables[] __initdata = { | 118 | static struct pvr2_params cables[] __devinitdata = { |
119 | { CT_VGA, "VGA" }, { CT_RGB, "RGB" }, { CT_COMPOSITE, "COMPOSITE" }, | 119 | { CT_VGA, "VGA" }, { CT_RGB, "RGB" }, { CT_COMPOSITE, "COMPOSITE" }, |
120 | }; | 120 | }; |
121 | 121 | ||
122 | static struct pvr2_params outputs[] __initdata = { | 122 | static struct pvr2_params outputs[] __devinitdata = { |
123 | { VO_PAL, "PAL" }, { VO_NTSC, "NTSC" }, { VO_VGA, "VGA" }, | 123 | { VO_PAL, "PAL" }, { VO_NTSC, "NTSC" }, { VO_VGA, "VGA" }, |
124 | }; | 124 | }; |
125 | 125 | ||
@@ -147,16 +147,16 @@ static struct pvr2fb_par { | |||
147 | 147 | ||
148 | static struct fb_info *fb_info; | 148 | static struct fb_info *fb_info; |
149 | 149 | ||
150 | static struct fb_fix_screeninfo pvr2_fix __initdata = { | 150 | static struct fb_fix_screeninfo pvr2_fix __devinitdata = { |
151 | .id = "NEC PowerVR2", | 151 | .id = "NEC PowerVR2", |
152 | .type = FB_TYPE_PACKED_PIXELS, | 152 | .type = FB_TYPE_PACKED_PIXELS, |
153 | .visual = FB_VISUAL_TRUECOLOR, | 153 | .visual = FB_VISUAL_TRUECOLOR, |
154 | .ypanstep = 1, | 154 | .ypanstep = 1, |
155 | .ywrapstep = 1, | 155 | .ywrapstep = 1, |
156 | .accel = FB_ACCEL_NONE, | 156 | .accel = FB_ACCEL_NONE, |
157 | }; | 157 | }; |
158 | 158 | ||
159 | static struct fb_var_screeninfo pvr2_var __initdata = { | 159 | static struct fb_var_screeninfo pvr2_var __devinitdata = { |
160 | .xres = 640, | 160 | .xres = 640, |
161 | .yres = 480, | 161 | .yres = 480, |
162 | .xres_virtual = 640, | 162 | .xres_virtual = 640, |
@@ -195,10 +195,6 @@ static unsigned int shdma = PVR2_CASCADE_CHAN; | |||
195 | static unsigned int pvr2dma = ONCHIP_NR_DMA_CHANNELS; | 195 | static unsigned int pvr2dma = ONCHIP_NR_DMA_CHANNELS; |
196 | #endif | 196 | #endif |
197 | 197 | ||
198 | /* Interface used by the world */ | ||
199 | |||
200 | int pvr2fb_setup(char*); | ||
201 | |||
202 | static int pvr2fb_setcolreg(unsigned int regno, unsigned int red, unsigned int green, unsigned int blue, | 198 | static int pvr2fb_setcolreg(unsigned int regno, unsigned int red, unsigned int green, unsigned int blue, |
203 | unsigned int transp, struct fb_info *info); | 199 | unsigned int transp, struct fb_info *info); |
204 | static int pvr2fb_blank(int blank, struct fb_info *info); | 200 | static int pvr2fb_blank(int blank, struct fb_info *info); |
@@ -227,12 +223,12 @@ static struct fb_ops pvr2fb_ops = { | |||
227 | #ifdef CONFIG_SH_DMA | 223 | #ifdef CONFIG_SH_DMA |
228 | .fb_write = pvr2fb_write, | 224 | .fb_write = pvr2fb_write, |
229 | #endif | 225 | #endif |
230 | .fb_fillrect = cfb_fillrect, | 226 | .fb_fillrect = cfb_fillrect, |
231 | .fb_copyarea = cfb_copyarea, | 227 | .fb_copyarea = cfb_copyarea, |
232 | .fb_imageblit = cfb_imageblit, | 228 | .fb_imageblit = cfb_imageblit, |
233 | }; | 229 | }; |
234 | 230 | ||
235 | static struct fb_videomode pvr2_modedb[] __initdata = { | 231 | static struct fb_videomode pvr2_modedb[] __devinitdata = { |
236 | /* | 232 | /* |
237 | * Broadcast video modes (PAL and NTSC). I'm unfamiliar with | 233 | * Broadcast video modes (PAL and NTSC). I'm unfamiliar with |
238 | * PAL-M and PAL-N, but from what I've read both modes parallel PAL and | 234 | * PAL-M and PAL-N, but from what I've read both modes parallel PAL and |
@@ -252,7 +248,7 @@ static struct fb_videomode pvr2_modedb[] __initdata = { | |||
252 | /* 640x480 @ 60hz (VGA) */ | 248 | /* 640x480 @ 60hz (VGA) */ |
253 | "vga_640x480", 60, 640, 480, VGA_CLK, 38, 33, 0, 18, 146, 26, | 249 | "vga_640x480", 60, 640, 480, VGA_CLK, 38, 33, 0, 18, 146, 26, |
254 | 0, FB_VMODE_YWRAP | 250 | 0, FB_VMODE_YWRAP |
255 | }, | 251 | }, |
256 | }; | 252 | }; |
257 | 253 | ||
258 | #define NUM_TOTAL_MODES ARRAY_SIZE(pvr2_modedb) | 254 | #define NUM_TOTAL_MODES ARRAY_SIZE(pvr2_modedb) |
@@ -262,7 +258,7 @@ static struct fb_videomode pvr2_modedb[] __initdata = { | |||
262 | #define DEFMODE_VGA 2 | 258 | #define DEFMODE_VGA 2 |
263 | 259 | ||
264 | static int defmode = DEFMODE_NTSC; | 260 | static int defmode = DEFMODE_NTSC; |
265 | static char *mode_option __initdata = NULL; | 261 | static char *mode_option __devinitdata = NULL; |
266 | 262 | ||
267 | static inline void pvr2fb_set_pal_type(unsigned int type) | 263 | static inline void pvr2fb_set_pal_type(unsigned int type) |
268 | { | 264 | { |
@@ -293,7 +289,7 @@ static void set_color_bitfields(struct fb_var_screeninfo *var) | |||
293 | { | 289 | { |
294 | switch (var->bits_per_pixel) { | 290 | switch (var->bits_per_pixel) { |
295 | case 16: /* RGB 565 */ | 291 | case 16: /* RGB 565 */ |
296 | pvr2fb_set_pal_type(PAL_RGB565); | 292 | pvr2fb_set_pal_type(PAL_RGB565); |
297 | var->red.offset = 11; var->red.length = 5; | 293 | var->red.offset = 11; var->red.length = 5; |
298 | var->green.offset = 5; var->green.length = 6; | 294 | var->green.offset = 5; var->green.length = 6; |
299 | var->blue.offset = 0; var->blue.length = 5; | 295 | var->blue.offset = 0; var->blue.length = 5; |
@@ -306,7 +302,7 @@ static void set_color_bitfields(struct fb_var_screeninfo *var) | |||
306 | var->transp.offset = 0; var->transp.length = 0; | 302 | var->transp.offset = 0; var->transp.length = 0; |
307 | break; | 303 | break; |
308 | case 32: /* ARGB 8888 */ | 304 | case 32: /* ARGB 8888 */ |
309 | pvr2fb_set_pal_type(PAL_ARGB8888); | 305 | pvr2fb_set_pal_type(PAL_ARGB8888); |
310 | var->red.offset = 16; var->red.length = 8; | 306 | var->red.offset = 16; var->red.length = 8; |
311 | var->green.offset = 8; var->green.length = 8; | 307 | var->green.offset = 8; var->green.length = 8; |
312 | var->blue.offset = 0; var->blue.length = 8; | 308 | var->blue.offset = 0; var->blue.length = 8; |
@@ -379,13 +375,13 @@ static int pvr2fb_set_par(struct fb_info *info) | |||
379 | var->vmode &= FB_VMODE_MASK; | 375 | var->vmode &= FB_VMODE_MASK; |
380 | if (var->vmode & FB_VMODE_INTERLACED && video_output != VO_VGA) | 376 | if (var->vmode & FB_VMODE_INTERLACED && video_output != VO_VGA) |
381 | par->is_interlaced = 1; | 377 | par->is_interlaced = 1; |
382 | /* | 378 | /* |
383 | * XXX: Need to be more creative with this (i.e. allow doublecan for | 379 | * XXX: Need to be more creative with this (i.e. allow doublecan for |
384 | * PAL/NTSC output). | 380 | * PAL/NTSC output). |
385 | */ | 381 | */ |
386 | if (var->vmode & FB_VMODE_DOUBLE && video_output == VO_VGA) | 382 | if (var->vmode & FB_VMODE_DOUBLE && video_output == VO_VGA) |
387 | par->is_doublescan = 1; | 383 | par->is_doublescan = 1; |
388 | 384 | ||
389 | par->hsync_total = var->left_margin + var->xres + var->right_margin + | 385 | par->hsync_total = var->left_margin + var->xres + var->right_margin + |
390 | var->hsync_len; | 386 | var->hsync_len; |
391 | par->vsync_total = var->upper_margin + var->yres + var->lower_margin + | 387 | par->vsync_total = var->upper_margin + var->yres + var->lower_margin + |
@@ -408,7 +404,7 @@ static int pvr2fb_set_par(struct fb_info *info) | |||
408 | } else { | 404 | } else { |
409 | /* VGA mode */ | 405 | /* VGA mode */ |
410 | /* XXX: What else needs to be checked? */ | 406 | /* XXX: What else needs to be checked? */ |
411 | /* | 407 | /* |
412 | * XXX: We have a little freedom in VGA modes, what ranges | 408 | * XXX: We have a little freedom in VGA modes, what ranges |
413 | * should be here (i.e. hsync/vsync totals, etc.)? | 409 | * should be here (i.e. hsync/vsync totals, etc.)? |
414 | */ | 410 | */ |
@@ -419,8 +415,8 @@ static int pvr2fb_set_par(struct fb_info *info) | |||
419 | /* Calculate the remainding offsets */ | 415 | /* Calculate the remainding offsets */ |
420 | par->diwstart_h = par->borderstart_h + var->left_margin; | 416 | par->diwstart_h = par->borderstart_h + var->left_margin; |
421 | par->diwstart_v = par->borderstart_v + var->upper_margin; | 417 | par->diwstart_v = par->borderstart_v + var->upper_margin; |
422 | par->borderstop_h = par->diwstart_h + var->xres + | 418 | par->borderstop_h = par->diwstart_h + var->xres + |
423 | var->right_margin; | 419 | var->right_margin; |
424 | par->borderstop_v = par->diwstart_v + var->yres + | 420 | par->borderstop_v = par->diwstart_v + var->yres + |
425 | var->lower_margin; | 421 | var->lower_margin; |
426 | 422 | ||
@@ -465,12 +461,12 @@ static int pvr2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | |||
465 | set_color_bitfields(var); | 461 | set_color_bitfields(var); |
466 | 462 | ||
467 | if (var->vmode & FB_VMODE_YWRAP) { | 463 | if (var->vmode & FB_VMODE_YWRAP) { |
468 | if (var->xoffset || var->yoffset < 0 || | 464 | if (var->xoffset || var->yoffset < 0 || |
469 | var->yoffset >= var->yres_virtual) { | 465 | var->yoffset >= var->yres_virtual) { |
470 | var->xoffset = var->yoffset = 0; | 466 | var->xoffset = var->yoffset = 0; |
471 | } else { | 467 | } else { |
472 | if (var->xoffset > var->xres_virtual - var->xres || | 468 | if (var->xoffset > var->xres_virtual - var->xres || |
473 | var->yoffset > var->yres_virtual - var->yres || | 469 | var->yoffset > var->yres_virtual - var->yres || |
474 | var->xoffset < 0 || var->yoffset < 0) | 470 | var->xoffset < 0 || var->yoffset < 0) |
475 | var->xoffset = var->yoffset = 0; | 471 | var->xoffset = var->yoffset = 0; |
476 | } | 472 | } |
@@ -478,7 +474,7 @@ static int pvr2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | |||
478 | var->xoffset = var->yoffset = 0; | 474 | var->xoffset = var->yoffset = 0; |
479 | } | 475 | } |
480 | 476 | ||
481 | /* | 477 | /* |
482 | * XXX: Need to be more creative with this (i.e. allow doublecan for | 478 | * XXX: Need to be more creative with this (i.e. allow doublecan for |
483 | * PAL/NTSC output). | 479 | * PAL/NTSC output). |
484 | */ | 480 | */ |
@@ -507,7 +503,7 @@ static int pvr2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | |||
507 | var->vsync_len = par->borderstop_v + | 503 | var->vsync_len = par->borderstop_v + |
508 | (par->vsync_total - par->borderstop_v); | 504 | (par->vsync_total - par->borderstop_v); |
509 | } | 505 | } |
510 | 506 | ||
511 | hsync_total = var->left_margin + var->xres + var->right_margin + | 507 | hsync_total = var->left_margin + var->xres + var->right_margin + |
512 | var->hsync_len; | 508 | var->hsync_len; |
513 | vtotal = var->upper_margin + var->yres + var->lower_margin + | 509 | vtotal = var->upper_margin + var->yres + var->lower_margin + |
@@ -531,7 +527,7 @@ static int pvr2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | |||
531 | } | 527 | } |
532 | } | 528 | } |
533 | } | 529 | } |
534 | 530 | ||
535 | /* Check memory sizes */ | 531 | /* Check memory sizes */ |
536 | line_length = get_line_length(var->xres_virtual, var->bits_per_pixel); | 532 | line_length = get_line_length(var->xres_virtual, var->bits_per_pixel); |
537 | if (line_length * var->yres_virtual > info->fix.smem_len) | 533 | if (line_length * var->yres_virtual > info->fix.smem_len) |
@@ -552,7 +548,7 @@ static void pvr2_update_display(struct fb_info *info) | |||
552 | DISP_DIWADDRS); | 548 | DISP_DIWADDRS); |
553 | } | 549 | } |
554 | 550 | ||
555 | /* | 551 | /* |
556 | * Initialize the video mode. Currently, the 16bpp and 24bpp modes aren't | 552 | * Initialize the video mode. Currently, the 16bpp and 24bpp modes aren't |
557 | * very stable. It's probably due to the fact that a lot of the 2D video | 553 | * very stable. It's probably due to the fact that a lot of the 2D video |
558 | * registers are still undocumented. | 554 | * registers are still undocumented. |
@@ -592,18 +588,18 @@ static void pvr2_init_display(struct fb_info *info) | |||
592 | /* display window start position */ | 588 | /* display window start position */ |
593 | fb_writel(par->diwstart_h, DISP_DIWHSTRT); | 589 | fb_writel(par->diwstart_h, DISP_DIWHSTRT); |
594 | fb_writel((par->diwstart_v << 16) | par->diwstart_v, DISP_DIWVSTRT); | 590 | fb_writel((par->diwstart_v << 16) | par->diwstart_v, DISP_DIWVSTRT); |
595 | 591 | ||
596 | /* misc. settings */ | 592 | /* misc. settings */ |
597 | fb_writel((0x16 << 16) | par->is_lowres, DISP_DIWCONF); | 593 | fb_writel((0x16 << 16) | par->is_lowres, DISP_DIWCONF); |
598 | 594 | ||
599 | /* clock doubler (for VGA), scan doubler, display enable */ | 595 | /* clock doubler (for VGA), scan doubler, display enable */ |
600 | fb_writel(((video_output == VO_VGA) << 23) | | 596 | fb_writel(((video_output == VO_VGA) << 23) | |
601 | (par->is_doublescan << 1) | 1, DISP_DIWMODE); | 597 | (par->is_doublescan << 1) | 1, DISP_DIWMODE); |
602 | 598 | ||
603 | /* bits per pixel */ | 599 | /* bits per pixel */ |
604 | fb_writel(fb_readl(DISP_DIWMODE) | (--bytesperpixel << 2), DISP_DIWMODE); | 600 | fb_writel(fb_readl(DISP_DIWMODE) | (--bytesperpixel << 2), DISP_DIWMODE); |
605 | 601 | ||
606 | /* video enable, color sync, interlace, | 602 | /* video enable, color sync, interlace, |
607 | * hsync and vsync polarity (currently unused) */ | 603 | * hsync and vsync polarity (currently unused) */ |
608 | fb_writel(0x100 | ((par->is_interlaced /*|4*/) << 4), DISP_SYNCCONF); | 604 | fb_writel(0x100 | ((par->is_interlaced /*|4*/) << 4), DISP_SYNCCONF); |
609 | } | 605 | } |
@@ -657,7 +653,7 @@ static irqreturn_t pvr2fb_interrupt(int irq, void *dev_id) | |||
657 | static int pvr2_init_cable(void) | 653 | static int pvr2_init_cable(void) |
658 | { | 654 | { |
659 | if (cable_type < 0) { | 655 | if (cable_type < 0) { |
660 | fb_writel((fb_readl(PCTRA) & 0xfff0ffff) | 0x000a0000, | 656 | fb_writel((fb_readl(PCTRA) & 0xfff0ffff) | 0x000a0000, |
661 | PCTRA); | 657 | PCTRA); |
662 | cable_type = (fb_readw(PDTRA) >> 8) & 3; | 658 | cable_type = (fb_readw(PDTRA) >> 8) & 3; |
663 | } | 659 | } |
@@ -687,7 +683,7 @@ static ssize_t pvr2fb_write(struct fb_info *info, const char *buf, | |||
687 | pages = kmalloc(nr_pages * sizeof(struct page *), GFP_KERNEL); | 683 | pages = kmalloc(nr_pages * sizeof(struct page *), GFP_KERNEL); |
688 | if (!pages) | 684 | if (!pages) |
689 | return -ENOMEM; | 685 | return -ENOMEM; |
690 | 686 | ||
691 | down_read(¤t->mm->mmap_sem); | 687 | down_read(¤t->mm->mmap_sem); |
692 | ret = get_user_pages(current, current->mm, (unsigned long)buf, | 688 | ret = get_user_pages(current, current->mm, (unsigned long)buf, |
693 | nr_pages, WRITE, 0, pages, NULL); | 689 | nr_pages, WRITE, 0, pages, NULL); |
@@ -700,7 +696,7 @@ static ssize_t pvr2fb_write(struct fb_info *info, const char *buf, | |||
700 | } | 696 | } |
701 | 697 | ||
702 | dma_configure_channel(shdma, 0x12c1); | 698 | dma_configure_channel(shdma, 0x12c1); |
703 | 699 | ||
704 | dst = (unsigned long)fb_info->screen_base + *ppos; | 700 | dst = (unsigned long)fb_info->screen_base + *ppos; |
705 | start = (unsigned long)page_address(pages[0]); | 701 | start = (unsigned long)page_address(pages[0]); |
706 | end = (unsigned long)page_address(pages[nr_pages]); | 702 | end = (unsigned long)page_address(pages[nr_pages]); |
@@ -744,7 +740,7 @@ out_unmap: | |||
744 | kfree(pages); | 740 | kfree(pages); |
745 | 741 | ||
746 | return ret; | 742 | return ret; |
747 | } | 743 | } |
748 | #endif /* CONFIG_SH_DMA */ | 744 | #endif /* CONFIG_SH_DMA */ |
749 | 745 | ||
750 | /** | 746 | /** |
@@ -765,21 +761,21 @@ out_unmap: | |||
765 | * in for flexibility anyways. Who knows, maybe someone has tv-out on a | 761 | * in for flexibility anyways. Who knows, maybe someone has tv-out on a |
766 | * PCI-based version of these things ;-) | 762 | * PCI-based version of these things ;-) |
767 | */ | 763 | */ |
768 | static int __init pvr2fb_common_init(void) | 764 | static int __devinit pvr2fb_common_init(void) |
769 | { | 765 | { |
770 | struct pvr2fb_par *par = currentpar; | 766 | struct pvr2fb_par *par = currentpar; |
771 | unsigned long modememused, rev; | 767 | unsigned long modememused, rev; |
772 | 768 | ||
773 | fb_info->screen_base = ioremap_nocache(pvr2_fix.smem_start, | 769 | fb_info->screen_base = ioremap_nocache(pvr2_fix.smem_start, |
774 | pvr2_fix.smem_len); | 770 | pvr2_fix.smem_len); |
775 | 771 | ||
776 | if (!fb_info->screen_base) { | 772 | if (!fb_info->screen_base) { |
777 | printk(KERN_ERR "pvr2fb: Failed to remap smem space\n"); | 773 | printk(KERN_ERR "pvr2fb: Failed to remap smem space\n"); |
778 | goto out_err; | 774 | goto out_err; |
779 | } | 775 | } |
780 | 776 | ||
781 | par->mmio_base = (unsigned long)ioremap_nocache(pvr2_fix.mmio_start, | 777 | par->mmio_base = (unsigned long)ioremap_nocache(pvr2_fix.mmio_start, |
782 | pvr2_fix.mmio_len); | 778 | pvr2_fix.mmio_len); |
783 | if (!par->mmio_base) { | 779 | if (!par->mmio_base) { |
784 | printk(KERN_ERR "pvr2fb: Failed to remap mmio space\n"); | 780 | printk(KERN_ERR "pvr2fb: Failed to remap mmio space\n"); |
785 | goto out_err; | 781 | goto out_err; |
@@ -820,7 +816,7 @@ static int __init pvr2fb_common_init(void) | |||
820 | printk("fb%d: %s (rev %ld.%ld) frame buffer device, using %ldk/%ldk of video memory\n", | 816 | printk("fb%d: %s (rev %ld.%ld) frame buffer device, using %ldk/%ldk of video memory\n", |
821 | fb_info->node, fb_info->fix.id, (rev >> 4) & 0x0f, rev & 0x0f, | 817 | fb_info->node, fb_info->fix.id, (rev >> 4) & 0x0f, rev & 0x0f, |
822 | modememused >> 10, (unsigned long)(fb_info->fix.smem_len >> 10)); | 818 | modememused >> 10, (unsigned long)(fb_info->fix.smem_len >> 10)); |
823 | printk("fb%d: Mode %dx%d-%d pitch = %ld cable: %s video output: %s\n", | 819 | printk("fb%d: Mode %dx%d-%d pitch = %ld cable: %s video output: %s\n", |
824 | fb_info->node, fb_info->var.xres, fb_info->var.yres, | 820 | fb_info->node, fb_info->var.xres, fb_info->var.yres, |
825 | fb_info->var.bits_per_pixel, | 821 | fb_info->var.bits_per_pixel, |
826 | get_line_length(fb_info->var.xres, fb_info->var.bits_per_pixel), | 822 | get_line_length(fb_info->var.xres, fb_info->var.bits_per_pixel), |
@@ -878,8 +874,8 @@ static int __init pvr2fb_dc_init(void) | |||
878 | video_output = VO_NTSC; | 874 | video_output = VO_NTSC; |
879 | } | 875 | } |
880 | } | 876 | } |
881 | 877 | ||
882 | /* | 878 | /* |
883 | * Nothing exciting about the DC PVR2 .. only a measly 8MiB. | 879 | * Nothing exciting about the DC PVR2 .. only a measly 8MiB. |
884 | */ | 880 | */ |
885 | pvr2_fix.smem_start = 0xa5000000; /* RAM starts here */ | 881 | pvr2_fix.smem_start = 0xa5000000; /* RAM starts here */ |
@@ -903,7 +899,7 @@ static int __init pvr2fb_dc_init(void) | |||
903 | return pvr2fb_common_init(); | 899 | return pvr2fb_common_init(); |
904 | } | 900 | } |
905 | 901 | ||
906 | static void pvr2fb_dc_exit(void) | 902 | static void __exit pvr2fb_dc_exit(void) |
907 | { | 903 | { |
908 | if (fb_info->screen_base) { | 904 | if (fb_info->screen_base) { |
909 | iounmap(fb_info->screen_base); | 905 | iounmap(fb_info->screen_base); |
@@ -987,13 +983,13 @@ static int __init pvr2fb_pci_init(void) | |||
987 | return pci_register_driver(&pvr2fb_pci_driver); | 983 | return pci_register_driver(&pvr2fb_pci_driver); |
988 | } | 984 | } |
989 | 985 | ||
990 | static void pvr2fb_pci_exit(void) | 986 | static void __exit pvr2fb_pci_exit(void) |
991 | { | 987 | { |
992 | pci_unregister_driver(&pvr2fb_pci_driver); | 988 | pci_unregister_driver(&pvr2fb_pci_driver); |
993 | } | 989 | } |
994 | #endif /* CONFIG_PCI */ | 990 | #endif /* CONFIG_PCI */ |
995 | 991 | ||
996 | static int __init pvr2_get_param(const struct pvr2_params *p, const char *s, | 992 | static int __devinit pvr2_get_param(const struct pvr2_params *p, const char *s, |
997 | int val, int size) | 993 | int val, int size) |
998 | { | 994 | { |
999 | int i; | 995 | int i; |
@@ -1021,7 +1017,7 @@ static int __init pvr2_get_param(const struct pvr2_params *p, const char *s, | |||
1021 | */ | 1017 | */ |
1022 | 1018 | ||
1023 | #ifndef MODULE | 1019 | #ifndef MODULE |
1024 | int __init pvr2fb_setup(char *options) | 1020 | static int __init pvr2fb_setup(char *options) |
1025 | { | 1021 | { |
1026 | char *this_opt; | 1022 | char *this_opt; |
1027 | char cable_arg[80]; | 1023 | char cable_arg[80]; |
@@ -1061,7 +1057,7 @@ static struct pvr2_board { | |||
1061 | int (*init)(void); | 1057 | int (*init)(void); |
1062 | void (*exit)(void); | 1058 | void (*exit)(void); |
1063 | char name[16]; | 1059 | char name[16]; |
1064 | } board_list[] = { | 1060 | } board_driver[] = { |
1065 | #ifdef CONFIG_SH_DREAMCAST | 1061 | #ifdef CONFIG_SH_DREAMCAST |
1066 | { pvr2fb_dc_init, pvr2fb_dc_exit, "Sega DC PVR2" }, | 1062 | { pvr2fb_dc_init, pvr2fb_dc_exit, "Sega DC PVR2" }, |
1067 | #endif | 1063 | #endif |
@@ -1071,7 +1067,7 @@ static struct pvr2_board { | |||
1071 | { 0, }, | 1067 | { 0, }, |
1072 | }; | 1068 | }; |
1073 | 1069 | ||
1074 | int __init pvr2fb_init(void) | 1070 | static int __init pvr2fb_init(void) |
1075 | { | 1071 | { |
1076 | int i, ret = -ENODEV; | 1072 | int i, ret = -ENODEV; |
1077 | int size; | 1073 | int size; |
@@ -1095,8 +1091,8 @@ int __init pvr2fb_init(void) | |||
1095 | 1091 | ||
1096 | currentpar = (struct pvr2fb_par *)(fb_info + 1); | 1092 | currentpar = (struct pvr2fb_par *)(fb_info + 1); |
1097 | 1093 | ||
1098 | for (i = 0; i < ARRAY_SIZE(board_list); i++) { | 1094 | for (i = 0; i < ARRAY_SIZE(board_driver); i++) { |
1099 | struct pvr2_board *pvr_board = board_list + i; | 1095 | struct pvr2_board *pvr_board = board_driver + i; |
1100 | 1096 | ||
1101 | if (!pvr_board->init) | 1097 | if (!pvr_board->init) |
1102 | continue; | 1098 | continue; |
@@ -1118,13 +1114,13 @@ static void __exit pvr2fb_exit(void) | |||
1118 | { | 1114 | { |
1119 | int i; | 1115 | int i; |
1120 | 1116 | ||
1121 | for (i = 0; i < ARRAY_SIZE(board_list); i++) { | 1117 | for (i = 0; i < ARRAY_SIZE(board_driver); i++) { |
1122 | struct pvr2_board *pvr_board = board_list + i; | 1118 | struct pvr2_board *pvr_board = board_driver + i; |
1123 | 1119 | ||
1124 | if (pvr_board->exit) | 1120 | if (pvr_board->exit) |
1125 | pvr_board->exit(); | 1121 | pvr_board->exit(); |
1126 | } | 1122 | } |
1127 | 1123 | ||
1128 | #ifdef CONFIG_SH_STORE_QUEUES | 1124 | #ifdef CONFIG_SH_STORE_QUEUES |
1129 | sq_unmap(pvr2fb_map); | 1125 | sq_unmap(pvr2fb_map); |
1130 | #endif | 1126 | #endif |
@@ -1139,4 +1135,3 @@ module_exit(pvr2fb_exit); | |||
1139 | MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>, M. R. Brown <mrbrown@0xd6.org>"); | 1135 | MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>, M. R. Brown <mrbrown@0xd6.org>"); |
1140 | MODULE_DESCRIPTION("Framebuffer driver for NEC PowerVR 2 based graphics boards"); | 1136 | MODULE_DESCRIPTION("Framebuffer driver for NEC PowerVR 2 based graphics boards"); |
1141 | MODULE_LICENSE("GPL"); | 1137 | MODULE_LICENSE("GPL"); |
1142 | |||
diff --git a/drivers/w1/Kconfig b/drivers/w1/Kconfig index ca75b3ad3a2e..6854fd6b9714 100644 --- a/drivers/w1/Kconfig +++ b/drivers/w1/Kconfig | |||
@@ -1,8 +1,6 @@ | |||
1 | menu "Dallas's 1-wire bus" | 1 | menuconfig W1 |
2 | depends on HAS_IOMEM | ||
3 | |||
4 | config W1 | ||
5 | tristate "Dallas's 1-wire support" | 2 | tristate "Dallas's 1-wire support" |
3 | depends on HAS_IOMEM | ||
6 | ---help--- | 4 | ---help--- |
7 | Dallas' 1-wire bus is useful to connect slow 1-pin devices | 5 | Dallas' 1-wire bus is useful to connect slow 1-pin devices |
8 | such as iButtons and thermal sensors. | 6 | such as iButtons and thermal sensors. |
@@ -12,8 +10,10 @@ config W1 | |||
12 | This W1 support can also be built as a module. If so, the module | 10 | This W1 support can also be built as a module. If so, the module |
13 | will be called wire.ko. | 11 | will be called wire.ko. |
14 | 12 | ||
13 | if W1 | ||
14 | |||
15 | config W1_CON | 15 | config W1_CON |
16 | depends on CONNECTOR && W1 | 16 | depends on CONNECTOR |
17 | bool "Userspace communication over connector" | 17 | bool "Userspace communication over connector" |
18 | default y | 18 | default y |
19 | --- help --- | 19 | --- help --- |
@@ -27,4 +27,4 @@ config W1_CON | |||
27 | source drivers/w1/masters/Kconfig | 27 | source drivers/w1/masters/Kconfig |
28 | source drivers/w1/slaves/Kconfig | 28 | source drivers/w1/slaves/Kconfig |
29 | 29 | ||
30 | endmenu | 30 | endif # W1 |
diff --git a/drivers/w1/masters/Kconfig b/drivers/w1/masters/Kconfig index 8f779338f744..8236d447adf5 100644 --- a/drivers/w1/masters/Kconfig +++ b/drivers/w1/masters/Kconfig | |||
@@ -3,11 +3,10 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | menu "1-wire Bus Masters" | 5 | menu "1-wire Bus Masters" |
6 | depends on W1 | ||
7 | 6 | ||
8 | config W1_MASTER_MATROX | 7 | config W1_MASTER_MATROX |
9 | tristate "Matrox G400 transport layer for 1-wire" | 8 | tristate "Matrox G400 transport layer for 1-wire" |
10 | depends on W1 && PCI | 9 | depends on PCI |
11 | help | 10 | help |
12 | Say Y here if you want to communicate with your 1-wire devices | 11 | Say Y here if you want to communicate with your 1-wire devices |
13 | using Matrox's G400 GPIO pins. | 12 | using Matrox's G400 GPIO pins. |
@@ -17,7 +16,7 @@ config W1_MASTER_MATROX | |||
17 | 16 | ||
18 | config W1_MASTER_DS2490 | 17 | config W1_MASTER_DS2490 |
19 | tristate "DS2490 USB <-> W1 transport layer for 1-wire" | 18 | tristate "DS2490 USB <-> W1 transport layer for 1-wire" |
20 | depends on W1 && USB | 19 | depends on USB |
21 | help | 20 | help |
22 | Say Y here if you want to have a driver for DS2490 based USB <-> W1 bridges, | 21 | Say Y here if you want to have a driver for DS2490 based USB <-> W1 bridges, |
23 | for example DS9490*. | 22 | for example DS9490*. |
@@ -27,7 +26,7 @@ config W1_MASTER_DS2490 | |||
27 | 26 | ||
28 | config W1_MASTER_DS2482 | 27 | config W1_MASTER_DS2482 |
29 | tristate "Maxim DS2482 I2C to 1-Wire bridge" | 28 | tristate "Maxim DS2482 I2C to 1-Wire bridge" |
30 | depends on I2C && W1 && EXPERIMENTAL | 29 | depends on I2C && EXPERIMENTAL |
31 | help | 30 | help |
32 | If you say yes here you get support for the Maxim DS2482 | 31 | If you say yes here you get support for the Maxim DS2482 |
33 | I2C to 1-Wire bridge. | 32 | I2C to 1-Wire bridge. |
diff --git a/drivers/w1/slaves/Kconfig b/drivers/w1/slaves/Kconfig index df95d6c2cefa..3df29a122f84 100644 --- a/drivers/w1/slaves/Kconfig +++ b/drivers/w1/slaves/Kconfig | |||
@@ -3,25 +3,21 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | menu "1-wire Slaves" | 5 | menu "1-wire Slaves" |
6 | depends on W1 | ||
7 | 6 | ||
8 | config W1_SLAVE_THERM | 7 | config W1_SLAVE_THERM |
9 | tristate "Thermal family implementation" | 8 | tristate "Thermal family implementation" |
10 | depends on W1 | ||
11 | help | 9 | help |
12 | Say Y here if you want to connect 1-wire thermal sensors to your | 10 | Say Y here if you want to connect 1-wire thermal sensors to your |
13 | wire. | 11 | wire. |
14 | 12 | ||
15 | config W1_SLAVE_SMEM | 13 | config W1_SLAVE_SMEM |
16 | tristate "Simple 64bit memory family implementation" | 14 | tristate "Simple 64bit memory family implementation" |
17 | depends on W1 | ||
18 | help | 15 | help |
19 | Say Y here if you want to connect 1-wire | 16 | Say Y here if you want to connect 1-wire |
20 | simple 64bit memory rom(ds2401/ds2411/ds1990*) to your wire. | 17 | simple 64bit memory rom(ds2401/ds2411/ds1990*) to your wire. |
21 | 18 | ||
22 | config W1_SLAVE_DS2433 | 19 | config W1_SLAVE_DS2433 |
23 | tristate "4kb EEPROM family support (DS2433)" | 20 | tristate "4kb EEPROM family support (DS2433)" |
24 | depends on W1 | ||
25 | help | 21 | help |
26 | Say Y here if you want to use a 1-wire | 22 | Say Y here if you want to use a 1-wire |
27 | 4kb EEPROM family device (DS2433). | 23 | 4kb EEPROM family device (DS2433). |