diff options
Diffstat (limited to 'drivers/char')
60 files changed, 575 insertions, 332 deletions
diff --git a/drivers/char/Config.in b/drivers/char/Config.in index 45b0b2447..c6d225616 100644 --- a/drivers/char/Config.in +++ b/drivers/char/Config.in @@ -164,6 +164,7 @@ if [ "$CONFIG_VIDEO_DEV" != "n" ]; then if [ "$CONFIG_RADIO_ZOLTRIX" = "y" ]; then hex ' ZOLTRIX I/O port (0x20c or 0x30c)' CONFIG_RADIO_ZOLTRIX_PORT 20c fi + dep_tristate 'IIC on parallel port' CONFIG_I2C_PARPORT $CONFIG_PARPORT fi endmenu diff --git a/drivers/char/Makefile b/drivers/char/Makefile index 093ebb07e..2d1f45599 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile @@ -346,6 +346,16 @@ else endif endif +ifeq ($(CONFIG_I2C_PARPORT),y) +L_OBJS += i2c-parport.o +L_I2C = y +else + ifeq ($(CONFIG_I2C_PARPORT),m) + M_OBJS += i2c-parport.o + M_I2C = y + endif +endif + ifeq ($(CONFIG_VIDEO_BWQCAM),y) L_OBJS += bw-qcam.o else diff --git a/drivers/char/acquirewdt.c b/drivers/char/acquirewdt.c index a9aa76714..74ad52cfc 100644 --- a/drivers/char/acquirewdt.c +++ b/drivers/char/acquirewdt.c @@ -3,8 +3,8 @@ * * Based on wdt.c. Original copyright messages: * - * (c) Copyright 1996 Alan Cox <alan@cymru.net>, All Rights Reserved. - * http://www.cymru.net + * (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved. + * http://www.redhat.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -15,7 +15,7 @@ * warranty for any of this software. This material is provided * "AS-IS" and at no charge. * - * (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk> + * (c) Copyright 1995 Alan Cox <alan@redhat.com> * */ diff --git a/drivers/char/adbmouse.c b/drivers/char/adbmouse.c index f41fa3891..77bbbbd69 100644 --- a/drivers/char/adbmouse.c +++ b/drivers/char/adbmouse.c @@ -248,7 +248,7 @@ __initfunc(int adb_mouse_init(void)) { mouse.active = 0; mouse.ready = 0; - mouse.wait = NULL; + init_waitqueue_head(&mouse.wait); #ifdef __powerpc__ if ( (_machine != _MACH_chrp) && (_machine != _MACH_Pmac) ) diff --git a/drivers/char/atixlmouse.c b/drivers/char/atixlmouse.c index 52ce4bf67..69fcbf004 100644 --- a/drivers/char/atixlmouse.c +++ b/drivers/char/atixlmouse.c @@ -67,7 +67,7 @@ static struct mouse_status { int present; int ready; int active; - struct wait_queue *wait; + wait_queue_head_t wait; struct fasync_struct *fasync; } mouse; @@ -223,7 +223,7 @@ __initfunc(int atixl_busmouse_init(void)) mouse.ready = 0; mouse.buttons = mouse.latch_buttons = 0; mouse.dx = mouse.dy = 0; - mouse.wait = NULL; + init_waitqueue_head(&mouse.wait); printk("Bus mouse detected and installed.\n"); misc_register(&atixl_mouse); return 0; diff --git a/drivers/char/bttv.c b/drivers/char/bttv.c index 12ac86673..614349275 100644 --- a/drivers/char/bttv.c +++ b/drivers/char/bttv.c @@ -1,3 +1,4 @@ + /* bttv - Bt848 frame grabber driver @@ -543,6 +544,10 @@ static struct tvcard tvcards[] = { 3, 1, 0, 2,15, { 2, 3, 1, 1}, { 0, 0, 0, 0, 0}}, /* Pixelview PlayTV (bt878) */ { 3, 4, 0, 2, 0x01e000, { 2, 0, 1, 1}, {0x01c000, 0, 0x018000, 0x014000, 0x002000, 0 }}, + /* "Leadtek WinView 601", */ + { 3, 1, 0, 2, 0x8300f8, { 2, 3, 1, 1,0}, {0x4fa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007}}, + /* AVEC Intercapture */ + { 3, 1, 9, 2, 0, { 2, 3, 1, 1}, { 0, 0, 0, 0, 0}}, }; #define TVCARDS (sizeof(tvcards)/sizeof(tvcard)) @@ -2036,6 +2041,41 @@ static int bttv_ioctl(struct video_device *dev, unsigned int cmd, void *arg) I2CWrite(&(btv->i2c), I2C_TDA9850, TDA9850_CON3, con3, 1); } + + /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */ + if (btv->type == BTTV_WINVIEW_601) { + int bits_out, loops, vol, data; + + /* 32 levels logarithmic */ + vol = 32 - ((v.volume>>11)); + /* units */ + bits_out = (PT2254_DBS_IN_2>>(vol%5)); + /* tens */ + bits_out |= (PT2254_DBS_IN_10>>(vol/5)); + bits_out |= PT2254_L_CHANEL | PT2254_R_CHANEL; + data = btread(BT848_GPIO_DATA); + data &= ~(WINVIEW_PT2254_CLK| WINVIEW_PT2254_DATA| + WINVIEW_PT2254_STROBE); + for (loops = 17; loops >= 0 ; loops--) { + if (bits_out & (1<<loops)) + data |= WINVIEW_PT2254_DATA; + else + data &= ~WINVIEW_PT2254_DATA; + btwrite(data, BT848_GPIO_DATA); + udelay(5); + data |= WINVIEW_PT2254_CLK; + btwrite(data, BT848_GPIO_DATA); + udelay(5); + data &= ~WINVIEW_PT2254_CLK; + btwrite(data, BT848_GPIO_DATA); + } + data |= WINVIEW_PT2254_STROBE; + data &= ~WINVIEW_PT2254_DATA; + btwrite(data, BT848_GPIO_DATA); + udelay(10); + data &= ~WINVIEW_PT2254_STROBE; + btwrite(data, BT848_GPIO_DATA); + } if (btv->have_msp3400) { i2c_control_device(&(btv->i2c), @@ -2863,6 +2903,18 @@ static void init_tea6300(struct i2c_bus *bus) I2CWrite(bus, I2C_TEA6300, TEA6300_SW, 0x01, 1); /* mute off input A */ } +static void init_tea6320(struct i2c_bus *bus) +{ + I2CWrite(bus, I2C_TEA6300, TEA6320_V, 0x28, 1); /* master volume */ + I2CWrite(bus, I2C_TEA6300, TEA6320_FFL, 0x28, 1); /* volume left 0dB */ + I2CWrite(bus, I2C_TEA6300, TEA6320_FFR, 0x28, 1); /* volume right 0dB */ + I2CWrite(bus, I2C_TEA6300, TEA6320_FRL, 0x28, 1); /* volume rear left 0dB */ + I2CWrite(bus, I2C_TEA6300, TEA6320_FRR, 0x28, 1); /* volume rear right 0dB */ + I2CWrite(bus, I2C_TEA6300, TEA6320_BA, 0x11, 1); /* bass 0dB */ + I2CWrite(bus, I2C_TEA6300, TEA6320_TR, 0x11, 1); /* treble 0dB */ + I2CWrite(bus, I2C_TEA6300, TEA6320_S, TEA6320_S_GMU, 1); /* mute off input A */ +} + static void init_tda8425(struct i2c_bus *bus) { I2CWrite(bus, I2C_TDA8425, TDA8425_VL, 0xFC, 1); /* volume left 0dB */ @@ -2990,9 +3042,16 @@ static void idcard(int i) if (I2CRead(&(btv->i2c), I2C_TEA6300) >=0) { + if(btv->type==BTTV_AVEC_INTERCAP) + { + printk(KERN_INFO "bttv%d: fader chip: TEA6320\n",btv->nr); + btv->audio_chip = TEA6320; + init_tea6320(&(btv->i2c)); + } else { printk(KERN_INFO "bttv%d: fader chip: TEA6300\n",btv->nr); btv->audio_chip = TEA6300; init_tea6300(&(btv->i2c)); + } } else printk(KERN_INFO "bttv%d: NO fader chip: TEA6300\n",btv->nr); @@ -3033,6 +3092,12 @@ static void idcard(int i) case BTTV_VHX: strcpy(btv->video_dev.name,"BT848(Aimslab-VHX)"); break; + case BTTV_WINVIEW_601: + strcpy(btv->video_dev.name,"BT848(Leadtek WinView 601)"); + break; + case BTTV_AVEC_INTERCAP: + strcpy(btv->video_dev.name,"(AVEC Intercapture)"); + break; } printk("%s\n",btv->video_dev.name); audio(btv, AUDIO_MUTE); @@ -3421,10 +3486,10 @@ int configure_bt848(struct pci_dev *dev, int bttv_num) btv->risc_jmp=NULL; btv->vbi_odd=NULL; btv->vbi_even=NULL; - btv->vbiq=NULL; - btv->capq=NULL; - btv->capqo=NULL; - btv->capqe=NULL; + init_waitqueue_head(&btv->vbiq); + init_waitqueue_head(&btv->capq); + init_waitqueue_head(&btv->capqo); + init_waitqueue_head(&btv->capqe); btv->vbip=VBIBUF_SIZE; btv->id=dev->device; diff --git a/drivers/char/bttv.h b/drivers/char/bttv.h index 479384783..da4f91c85 100644 --- a/drivers/char/bttv.h +++ b/drivers/char/bttv.h @@ -122,10 +122,10 @@ struct bttv u32 *vbi_even; u32 bus_vbi_even; u32 bus_vbi_odd; - struct wait_queue *vbiq; - struct wait_queue *capq; - struct wait_queue *capqo; - struct wait_queue *capqe; + wait_queue_head_t vbiq; + wait_queue_head_t capq; + wait_queue_head_t capqo; + wait_queue_head_t capqe; int vbip; u32 *risc_odd; @@ -210,6 +210,8 @@ struct bttv #define BTTV_VHX 0x0e #define BTTV_ZOLTRIX 0x0f #define BTTV_PIXVIEWPLAYTV 0x10 +#define BTTV_WINVIEW_601 0x11 +#define BTTV_AVEC_INTERCAP 0x12 #define AUDIO_TUNER 0x00 #define AUDIO_RADIO 0x01 @@ -224,6 +226,7 @@ struct bttv #define TDA8425 0x02 #define TDA9840 0x03 #define TEA6300 0x04 +#define TEA6320 0x05 #define I2C_TSA5522 0xc2 #define I2C_TDA9840 0x84 @@ -232,7 +235,7 @@ struct bttv #define I2C_HAUPEE 0xa0 #define I2C_STBEE 0xae #define I2C_VHX 0xc0 -#define I2C_TEA6300 0x80 +#define I2C_TEA6300 0x80 /* same as TEA6320 */ #define TDA9840_SW 0x00 #define TDA9840_LVADJ 0x02 @@ -260,4 +263,28 @@ struct bttv #define TEA6300_FA 0x04 /* fader control */ #define TEA6300_SW 0x05 /* mute and source switch */ + +#define TEA6320_V 0x00 +#define TEA6320_FFR 0x01 /* volume front right */ +#define TEA6320_FFL 0x02 /* volume front left */ +#define TEA6320_FRR 0x03 /* volume rear right */ +#define TEA6320_FRL 0x04 /* volume rear left */ +#define TEA6320_BA 0x05 /* bass */ +#define TEA6320_TR 0x06 /* treble */ +#define TEA6320_S 0x07 /* switch register */ + /* values for those registers: */ +#define TEA6320_S_SA 0x01 /* stereo A input */ +#define TEA6320_S_SB 0x02 /* stereo B */ +#define TEA6320_S_SC 0x04 /* stereo C */ +#define TEA6320_S_GMU 0x80 /* general mute */ + + +#define PT2254_L_CHANEL 0x10 +#define PT2254_R_CHANEL 0x08 +#define PT2254_DBS_IN_2 0x400 +#define PT2254_DBS_IN_10 0x20000 +#define WINVIEW_PT2254_CLK 0x40 +#define WINVIEW_PT2254_DATA 0x20 +#define WINVIEW_PT2254_STROBE 0x80 + #endif diff --git a/drivers/char/busmouse.c b/drivers/char/busmouse.c index d4fc2d7f9..1ec37e864 100644 --- a/drivers/char/busmouse.c +++ b/drivers/char/busmouse.c @@ -277,7 +277,7 @@ __initfunc(int bus_mouse_init(void)) mouse.buttons = 0x87; mouse.dx = 0; mouse.dy = 0; - mouse.wait = NULL; + init_waitqueue_head(&mouse.wait); printk(KERN_INFO "Logitech bus mouse detected, using IRQ %d.\n", mouse_irq); misc_register(&bus_mouse); diff --git a/drivers/char/console.c b/drivers/char/console.c index 6d528d545..f04a00708 100644 --- a/drivers/char/console.c +++ b/drivers/char/console.c @@ -2269,7 +2269,7 @@ static void vc_init(unsigned int currcons, unsigned int rows, unsigned int cols, def_color = 0x07; /* white */ ulcolor = 0x0f; /* bold white */ halfcolor = 0x08; /* grey */ - vt_cons[currcons]->paste_wait = 0; + init_waitqueue_head(&vt_cons[currcons]->paste_wait); reset_terminal(currcons, do_clear); } diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index 93ab0faa3..a5e8ff891 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c @@ -1,7 +1,7 @@ #define BLOCKMOVE #define Z_WAKE static char rcsid[] = -"$Revision: 2.2.2.1 $$Date: 1999/04/08 16:17:43 $"; +"$Revision: 2.2.2.2 $$Date: 1999/05/21 17:18:15 $"; /* * linux/drivers/char/cyclades.c @@ -21,7 +21,7 @@ static char rcsid[] = * extensively rewritten by Theodore Ts'o, 8/16/92 -- 9/14/92, * and then fixed as suggested by Michael K. Johnson 12/12/92. * - * This version does not support shared irq's. + * This version supports shared IRQ's (only for PCI boards). * * This module exports the following rs232 io functions: * int cy_init(void); @@ -31,6 +31,17 @@ static char rcsid[] = * void cleanup_module(void); * * $Log: cyclades.c,v $ + * Revision 2.2.2.2 1999/05/14 17:18:15 ivan + * /proc entry location changed to /proc/tty/driver/cyclades; + * Added support to shared IRQ's (only for PCI boards); + * Added support for Cobalt Qube2 systems; + * IRQ [de]allocation scheme revisited; + * BREAK implementation changed in order to make use of the 'break_ctl' + * TTY facility; + * Fixed typo in TTY structure field 'driver_name'; + * Included a PCI bridge reset and EEPROM reload in the board + * initialization code (for both Y and Z series). + * * Revision 2.2.2.1 1999/04/08 16:17:43 ivan * Fixed a bug in cy_wait_until_sent that was preventing the port to be * closed properly after a SIGINT; @@ -536,7 +547,7 @@ static char rcsid[] = #undef CY_16Y_HACK #undef CY_ENABLE_MONITORING #undef CY_PCI_DEBUG -#define CY_PROC +#undef CY_PROC #if 0 #define PAUSE __asm__("nop"); @@ -600,6 +611,14 @@ static char rcsid[] = #include <linux/stat.h> #include <linux/proc_fs.h> +#ifdef CONFIG_COBALT_27 +#include <asm/page.h> +#include <asm/pgtable.h> + +#define CACHED_TO_UNCACHED(x) (((unsigned long)(x) & \ + (unsigned long)0x1fffffff) + KSEG1) +#endif + #define cy_put_user put_user static unsigned long cy_get_user(unsigned long *addr) @@ -638,6 +657,7 @@ static DECLARE_TASK_QUEUE(tq_cyclades); static struct tty_driver cy_serial_driver, cy_callout_driver; static int serial_refcount; +#ifndef CONFIG_COBALT_27 static volatile int cy_irq_triggered; static volatile int cy_triggered; static int cy_wild_int_mask; @@ -665,6 +685,8 @@ static unsigned char *cy_isa_addresses[] = { }; #define NR_ISA_ADDRS (sizeof(cy_isa_addresses)/sizeof(unsigned char*)) +#endif /* CONFIG_COBALT_27 */ + /* This is the per-card data structure containing address, irq, number of channels, etc. This driver supports a maximum of NR_CARDS cards. */ @@ -681,11 +703,6 @@ static struct tty_struct *serial_table[NR_PORTS]; static struct termios *serial_termios[NR_PORTS]; static struct termios *serial_termios_locked[NR_PORTS]; -/* This is the per-irq data structure, - it maps an irq to the corresponding card */ - -static struct cyclades_card *IRQ_cards[NR_IRQS]; - /* * tmp_buf is used as a temporary buffer by serial_write. We need to * lock it in case the copy_from_user blocks while swapping in a page, @@ -697,7 +714,7 @@ static struct cyclades_card *IRQ_cards[NR_IRQS]; * allocated when the first cy_open occurs. */ static unsigned char *tmp_buf; -static struct semaphore tmp_buf_sem = MUTEX; +DECLARE_MUTEX(tmp_buf_sem); /* * This is used to look up the divisor speeds and the timeouts @@ -790,7 +807,9 @@ static unsigned short cy_pci_dev_id[] = { static void cy_start(struct tty_struct *); static void set_line_char(struct cyclades_port *); +#ifndef CONFIG_COBALT_27 static void cy_probe(int, void *, struct pt_regs *); +#endif /* CONFIG_COBALT_27 */ static void cyz_poll(unsigned long); #ifdef CYCLOM_SHOW_STATUS static void show_status(int); @@ -959,6 +978,8 @@ cyy_issue_cmd(volatile ucchar *base_addr, u_char cmd, int index) return(0); } /* cyy_issue_cmd */ +#ifndef CONFIG_COBALT_27 /* ISA interrupt detection code */ + static int probe_ready; /* @@ -1149,6 +1170,8 @@ cy_probe(int irq, void *dev_id, struct pt_regs *regs) return; } /* cy_probe */ +#endif /* CONFIG_COBALT_27 */ + /* The real interrupt service routine is called whenever the card wants its hand held--chars received, out buffer empty, modem change, etc. @@ -1172,9 +1195,9 @@ cyy_interrupt(int irq, void *dev_id, struct pt_regs *regs) int mdm_change; int mdm_status; - if((cinfo = IRQ_cards[irq]) == 0){ + if((cinfo = (struct cyclades_card *)dev_id) == 0){ #ifdef CY_DEBUG_INTERRUPTS -printk("cy_interrupt: spurious interrupt %d\n\r", irq); + printk("cy_interrupt: spurious interrupt %d\n\r", irq); #endif return; /* spurious interrupt */ } @@ -1206,7 +1229,7 @@ printk("cy_interrupt: spurious interrupt %d\n\r", irq); } if (status & CySRReceive) { /* reception interrupt */ #ifdef CY_DEBUG_INTERRUPTS -printk("cy_interrupt: rcvd intr, chip %d\n\r", chip); + printk("cy_interrupt: rcvd intr, chip %d\n\r", chip); #endif /* determine the channel & change to that context */ save_xir = (u_char) cy_readb(base_addr+(CyRIR<<index)); @@ -1264,7 +1287,7 @@ printk("cy_interrupt: rcvd intr, chip %d\n\r", chip); TTY_OVERRUN; *tty->flip.char_buf_ptr++ = 0; /* If the flip buffer itself is - overflowing, we still loose + overflowing, we still lose the next incoming character. */ if(tty->flip.count @@ -1333,7 +1356,7 @@ printk("cy_interrupt: rcvd intr, chip %d\n\r", chip); is empty, we know we can always stuff a dozen characters. */ #ifdef CY_DEBUG_INTERRUPTS -printk("cy_interrupt: xmit intr, chip %d\n\r", chip); + printk("cy_interrupt: xmit intr, chip %d\n\r", chip); #endif /* determine the channel & change to that context */ @@ -1368,37 +1391,19 @@ printk("cy_interrupt: xmit intr, chip %d\n\r", chip); info->x_char = 0; } - if (info->x_break){ - /* The Cirrus chip requires the "Embedded - Transmit Commands" of start break, delay, - and end break sequences to be sent. The - duration of the break is given in TICs, - which runs at HZ (typically 100) and the - PPR runs at 200 Hz, so the delay is - duration * 200/HZ, and thus a break can - run from 1/100 sec to about 5/4 sec. - For CD1400 J or later, replace the 200 Hz - by 500 Hz. - */ - /* start break */ - cy_writeb((u_long)base_addr + (CyTDR<<index), 0); - cy_writeb((u_long)base_addr + (CyTDR<<index), 0x81); - /* delay a bit */ - cy_writeb((u_long)base_addr + (CyTDR<<index), 0); - cy_writeb((u_long)base_addr + (CyTDR<<index), 0x82); - if (info->chip_rev >= CD1400_REV_J ) { - /* It is a CD1400 rev. J or later */ - cy_writeb((u_long)base_addr + (CyTDR<<index), - info->x_break*500/HZ); - } else { - cy_writeb((u_long)base_addr + (CyTDR<<index), - info->x_break*200/HZ); + if (info->breakon || info->breakoff) { + if (info->breakon) { + cy_writeb((u_long)base_addr + (CyTDR<<index), 0); + cy_writeb((u_long)base_addr + (CyTDR<<index), 0x81); + info->breakon = 0; + char_count -= 2; + } + if (info->breakoff) { + cy_writeb((u_long)base_addr + (CyTDR<<index), 0); + cy_writeb((u_long)base_addr + (CyTDR<<index), 0x83); + info->breakoff = 0; + char_count -= 2; } - /* finish break */ - cy_writeb((u_long)base_addr + (CyTDR<<index), 0); - cy_writeb((u_long)base_addr + (CyTDR<<index), 0x83); - char_count -= 7; - info->x_break = 0; } while (char_count-- > 0){ @@ -1871,12 +1876,6 @@ cyz_poll(unsigned long arg) info->last_active = jiffies; info->jiffies[2] = jiffies; } - if (info->x_break){ - printk("cyc cyz_poll shouldn't see x_break\n"); - info->x_break = 0; - info->last_active = jiffies; - info->jiffies[2] = jiffies; - } #ifdef BLOCKMOVE while(0 < (small_count = cy_min((tx_bufsize - tx_put), @@ -1946,26 +1945,35 @@ static int startup(struct cyclades_port * info) { unsigned long flags; + int retval = 0; unsigned char *base_addr; int card,chip,channel,index; + unsigned long page; + + page = get_free_page(GFP_KERNEL); + if (!page) + return -ENOMEM; + + save_flags(flags); cli(); if (info->flags & ASYNC_INITIALIZED){ - return 0; + free_page(page); + goto errout; } if (!info->type){ if (info->tty){ set_bit(TTY_IO_ERROR, &info->tty->flags); } - return 0; - } - if (!info->xmit_buf){ - info->xmit_buf = (unsigned char *) get_free_page (GFP_KERNEL); - if (!info->xmit_buf){ - return -ENOMEM; - } + free_page(page); + goto errout; } + if (info->xmit_buf) + free_page(page); + else + info->xmit_buf = (unsigned char *) page; + set_line_char(info); card = info->card; @@ -1982,39 +1990,40 @@ startup(struct cyclades_port * info) card, chip, channel, (long)base_addr);/**/ #endif - save_flags(flags); cli(); - cy_writeb((ulong)base_addr+(CyCAR<<index), (u_char)channel); + cy_writeb((ulong)base_addr+(CyCAR<<index), (u_char)channel); - cy_writeb((ulong)base_addr+(CyRTPR<<index), (info->default_timeout - ? info->default_timeout - : 0x02)); /* 10ms rx timeout */ + cy_writeb((ulong)base_addr+(CyRTPR<<index), (info->default_timeout + ? info->default_timeout : 0x02)); /* 10ms rx timeout */ - cyy_issue_cmd(base_addr,CyCHAN_CTL|CyENB_RCVR|CyENB_XMTR,index); + cyy_issue_cmd(base_addr,CyCHAN_CTL|CyENB_RCVR|CyENB_XMTR,index); - cy_writeb((ulong)base_addr+(CyCAR<<index), (u_char)channel); - cy_writeb((ulong)base_addr+(CyMSVR1<<index), CyRTS); - cy_writeb((ulong)base_addr+(CyMSVR2<<index), CyDTR); + cy_writeb((ulong)base_addr+(CyCAR<<index), (u_char)channel); + cy_writeb((ulong)base_addr+(CyMSVR1<<index), CyRTS); + cy_writeb((ulong)base_addr+(CyMSVR2<<index), CyDTR); #ifdef CY_DEBUG_DTR - printk("cyc:startup raising DTR\n"); - printk(" status: 0x%x, 0x%x\n", - cy_readb(base_addr+(CyMSVR1<<index)), - cy_readb(base_addr+(CyMSVR2<<index))); + printk("cyc:startup raising DTR\n"); + printk(" status: 0x%x, 0x%x\n", + cy_readb(base_addr+(CyMSVR1<<index)), + cy_readb(base_addr+(CyMSVR2<<index))); #endif - cy_writeb((u_long)base_addr+(CySRER<<index), - cy_readb(base_addr+(CySRER<<index)) | CyRxData); - info->flags |= ASYNC_INITIALIZED; + cy_writeb((u_long)base_addr+(CySRER<<index), + cy_readb(base_addr+(CySRER<<index)) | CyRxData); + info->flags |= ASYNC_INITIALIZED; + + if (info->tty){ + clear_bit(TTY_IO_ERROR, &info->tty->flags); + } + info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; + info->breakon = info->breakoff = 0; + memset((char *)&info->idle_stats, 0, sizeof(info->idle_stats)); + info->idle_stats.in_use = + info->idle_stats.recv_idle = + info->idle_stats.xmit_idle = jiffies; - if (info->tty){ - clear_bit(TTY_IO_ERROR, &info->tty->flags); - } - info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; - memset((char *)&info->idle_stats, 0, sizeof(info->idle_stats)); - info->idle_stats.in_use = - info->idle_stats.recv_idle = - info->idle_stats.xmit_idle = jiffies; restore_flags(flags); + } else { struct FIRM_ID *firm_id; struct ZFW_CTRL *zfw_ctrl; @@ -2022,6 +2031,8 @@ startup(struct cyclades_port * info) struct CH_CTRL *ch_ctrl; int retval; + restore_flags(flags); + base_addr = (unsigned char*) (cy_card[card].base_addr); firm_id = (struct FIRM_ID *) (base_addr + ID_ADDRESS); @@ -2074,7 +2085,7 @@ startup(struct cyclades_port * info) clear_bit(TTY_IO_ERROR, &info->tty->flags); } info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; - + info->breakon = info->breakoff = 0; memset((char *)&info->idle_stats, 0, sizeof(info->idle_stats)); info->idle_stats.in_use = info->idle_stats.recv_idle = @@ -2085,6 +2096,10 @@ startup(struct cyclades_port * info) printk(" cyc startup done\n"); #endif return 0; + +errout: + restore_flags(flags); + return retval; } /* startup */ @@ -2246,7 +2261,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, struct cyclades_port *info) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); struct cyclades_card *cinfo; unsigned long flags; int chip, channel,index; @@ -3763,36 +3778,62 @@ set_modem_info(struct cyclades_port * info, unsigned int cmd, return 0; } /* set_modem_info */ +/* + * cy_break() --- routine which turns the break handling on or off + */ static void -send_break( struct cyclades_port * info, int duration) +cy_break(struct tty_struct *tty, int break_state) { + struct cyclades_port * info = (struct cyclades_port *)tty->driver_data; + unsigned long flags; + if (serial_paranoia_check(info, tty->device, "cy_break")) + return; + + save_flags(flags); cli(); if (!IS_CYC_Z(cy_card[info->card])) { /* Let the transmit ISR take care of this (since it requires stuffing characters into the output stream). */ - info->x_break = duration; - if (!info->xmit_cnt ) { - start_xmit(info); + if (break_state == -1) { + if (!info->breakon) { + info->breakon = 1; + if (!info->xmit_cnt ) { + start_xmit(info); + } + } + } else { + if (!info->breakoff) { + info->breakoff = 1; + if (!info->xmit_cnt ) { + start_xmit(info); + } + } } } else { - /* For the moment we ignore the duration parameter!!! - A better implementation will use C_CM_SET_BREAK - and C_CM_CLR_BREAK with the appropriate delay. - */ -#if 1 -// this appears to wedge the output data stream -int retval; - retval = cyz_issue_cmd(&cy_card[info->card], + int retval; + + if (break_state == -1) { + retval = cyz_issue_cmd(&cy_card[info->card], (info->line) - (cy_card[info->card].first_line), - C_CM_SENDBRK, 0L); - if (retval != 0){ - printk("cyc:send_break retval at %d was %x\n", - __LINE__, retval); + C_CM_SET_BREAK, 0L); + if (retval != 0) { + printk("cyc:cy_break (set) retval at %d was %x\n", + __LINE__, retval); + } + } else { + retval = cyz_issue_cmd(&cy_card[info->card], + (info->line) - (cy_card[info->card].first_line), + C_CM_CLR_BREAK, 0L); + if (retval != 0) { + printk("cyc:cy_break (clr) retval at %d was %x\n", + __LINE__, retval); + } } -#endif } -} /* send_break */ + restore_flags(flags); + +} /* cy_break */ static int get_mon_info(struct cyclades_port * info, struct cyclades_monitor * mon) @@ -4026,21 +4067,6 @@ cy_ioctl(struct tty_struct *tty, struct file * file, case CYGETWAIT: ret_val = info->closing_wait / (HZ/100); break; - case TCSBRK: /* SVID version: non-zero arg --> no break */ - ret_val = tty_check_change(tty); - if (ret_val) - return ret_val; - tty_wait_until_sent(tty,0); - if (!arg) - send_break(info, HZ/4); /* 1/4 second */ - break; - case TCSBRKP: /* support for POSIX tcsendbreak() */ - ret_val = tty_check_change(tty); - if (ret_val) - return ret_val; - tty_wait_until_sent(tty,0); - send_break(info, arg ? arg*(HZ/10) : HZ/4); - break; case TIOCMGET: ret_val = get_modem_info(info, (unsigned int *) arg); break; @@ -4091,7 +4117,13 @@ cy_set_termios(struct tty_struct *tty, struct termios * old_termios) tty->stopped = 0; cy_start(tty); } -#ifdef tytso_patch_94Nov25_1726 +#if 0 + /* + * No need to wake up processes in open wait, since they + * sample the CLOCAL flag once, and don't recheck it. + * XXX It's not clear whether the current behavior is correct + * or not. Hence, this may change..... + */ if (!(old_termios->c_cflag & CLOCAL) && (tty->termios->c_cflag & CLOCAL)) wake_up_interruptible(&info->open_wait); @@ -4100,16 +4132,6 @@ cy_set_termios(struct tty_struct *tty, struct termios * old_termios) return; } /* cy_set_termios */ - -/* - * void (*set_ldisc)(struct tty_struct *tty); - * - * This routine allows the tty driver to be notified when the - * device's termios settings have changed. - * - */ - - /* This routine is called by the upper-layer tty layer to signal that incoming characters should be throttled because the input buffers are close to full. @@ -4467,6 +4489,7 @@ cyy_init_card(volatile ucchar *true_base_addr,int index)) return chip_number; } /* cyy_init_card */ +#ifndef CONFIG_COBALT_27 /* * --------------------------------------------------------------------- * cy_detect_isa() - Probe for Cyclom-Y/ISA boards. @@ -4530,7 +4553,7 @@ cy_detect_isa(void)) /* allocate IRQ */ if(request_irq(cy_isa_irq, cyy_interrupt, - SA_INTERRUPT, "cyclomY", NULL)) + SA_INTERRUPT, "Cyclom-Y", &cy_card[j])) { printk("Cyclom-Y/ISA found at 0x%lx ", (unsigned long) cy_isa_address); @@ -4546,7 +4569,6 @@ cy_detect_isa(void)) cy_card[j].bus_index = 0; cy_card[j].first_line = cy_next_channel; cy_card[j].num_chips = cy_isa_nchan/4; - IRQ_cards[cy_isa_irq] = &cy_card[j]; nboard++; /* print message */ @@ -4561,6 +4583,20 @@ cy_detect_isa(void)) return(nboard); } /* cy_detect_isa */ +#endif /* CONFIG_COBALT_27 */ + +static void plx_init(uclong addr, uclong initctl) +{ + /* Reset PLX */ + cy_writel(addr + initctl, cy_readl(addr + initctl) | 0x40000000); + udelay(100L); + cy_writel(addr + initctl, cy_readl(addr + initctl) & ~0x40000000); + + /* Reload Config. Registers from EEPROM */ + cy_writel(addr + initctl, cy_readl(addr + initctl) | 0x20000000); + udelay(100L); + cy_writel(addr + initctl, cy_readl(addr + initctl) & ~0x20000000); +} /* * --------------------------------------------------------------------- @@ -4621,6 +4657,12 @@ cy_detect_pci(void)) cy_pci_addr0 &= PCI_BASE_ADDRESS_MEM_MASK; cy_pci_addr2 &= PCI_BASE_ADDRESS_MEM_MASK; + if (cy_pci_addr2 & ~PCI_BASE_ADDRESS_IO_MASK) { + printk(" Warning: PCI I/O bit incorrectly set. " + "Ignoring it...\n"); + cy_pci_addr2 &= PCI_BASE_ADDRESS_IO_MASK; + } + #if defined(__alpha__) if (device_id == PCI_DEVICE_ID_CYCLOM_Y_Lo) { /* below 1M? */ printk("Cyclom-Y/PCI (bus=0x0%x, pci_id=0x%x, ", @@ -4673,7 +4715,7 @@ cy_detect_pci(void)) /* allocate IRQ */ if(request_irq(cy_pci_irq, cyy_interrupt, - SA_INTERRUPT, "cyclomY", NULL)) + SA_SHIRQ, "Cyclom-Y", &cy_card[j])) { printk("Cyclom-Y/PCI found at 0x%lx ", (ulong) cy_pci_addr2); @@ -4689,13 +4731,14 @@ cy_detect_pci(void)) cy_card[j].bus_index = 1; cy_card[j].first_line = cy_next_channel; cy_card[j].num_chips = cy_pci_nchan/4; - IRQ_cards[cy_pci_irq] = &cy_card[j]; /* enable interrupts in the PCI interface */ plx_ver = cy_readb(cy_pci_addr2 + CyPLX_VER) & 0x0f; switch (plx_ver) { case PLX_9050: + plx_init(cy_pci_addr0, 0x50); + cy_writew(cy_pci_addr0+0x4c, cy_readw(cy_pci_addr0+0x4c)|0x0040); break; @@ -4704,6 +4747,8 @@ cy_detect_pci(void)) case PLX_9080: default: /* Old boards, use PLX_9060 */ + plx_init(cy_pci_addr0, 0x6c); + cy_writew(cy_pci_addr0+0x68, cy_readw(cy_pci_addr0+0x68)|0x0900); break; @@ -4742,9 +4787,18 @@ cy_detect_pci(void)) #if !defined(__alpha__) cy_pci_addr0 = (ulong)ioremap(cy_pci_addr0, CyPCI_Zctl); #endif + + plx_init(cy_pci_addr0, 0x6c); + mailbox = (uclong)cy_readl(&((struct RUNTIME_9060 *) cy_pci_addr0)->mail_box_0); cy_pci_addr2 &= PCI_BASE_ADDRESS_MEM_MASK; + + if (cy_pci_addr2 & ~PCI_BASE_ADDRESS_IO_MASK) { + printk(" Warning: PCI I/O bit incorrectly set. " + "Ignoring it...\n"); + cy_pci_addr2 &= PCI_BASE_ADDRESS_IO_MASK; + } if (mailbox == ZE_V1) { #if !defined(__alpha__) cy_pci_addr2 = (ulong)ioremap(cy_pci_addr2, CyPCI_Ze_win); @@ -4821,7 +4875,7 @@ cy_detect_pci(void)) /* allocate IRQ only if board has an IRQ */ if( (1 < cy_pci_irq) && (cy_pci_irq < 15) ) { if(request_irq(cy_pci_irq,cyz_interrupt, - SA_INTERRUPT,"cyclomZ",NULL)) + SA_SHIRQ,"Cyclades-Z",&cy_card[j])) { printk("Could not allocate IRQ%d ", cy_pci_irq); @@ -4839,7 +4893,6 @@ cy_detect_pci(void)) cy_card[j].bus_index = 1; cy_card[j].first_line = cy_next_channel; cy_card[j].num_chips = -1; - IRQ_cards[cy_pci_irq] = &cy_card[j]; /* print message */ /* don't report IRQ if board is no IRQ */ @@ -4905,7 +4958,7 @@ cy_detect_pci(void)) /* allocate IRQ only if board has an IRQ */ if( (1 < cy_pci_irq) && (cy_pci_irq < 15) ) { if(request_irq(cy_pci_irq,cyz_interrupt, - SA_INTERRUPT,"cyclomZ",NULL)) + SA_SHIRQ,"Cyclades-Z",&cy_card[j])) { printk("Could not allocate IRQ%d ", cy_pci_irq); @@ -4922,7 +4975,6 @@ cy_detect_pci(void)) cy_card[j].bus_index = 1; cy_card[j].first_line = cy_next_channel; cy_card[j].num_chips = -1; - IRQ_cards[cy_pci_irq] = &cy_card[j]; /* print message */ /* don't report IRQ if board is no IRQ */ @@ -4971,7 +5023,6 @@ show_version(void) __DATE__, __TIME__); } /* show_version */ -#ifdef CY_PROC static int cyclades_get_proc_info(char *buf, char **start, off_t offset, int length, int *eof, void *data) @@ -5028,7 +5079,6 @@ done: len = 0; return len; } -#endif /* The serial driver boot-time initialization code! Hardware I/O ports are mapped to character special devices on a @@ -5062,13 +5112,15 @@ cy_init(void)) struct proc_dir_entry *ent; #endif + init_bh(CYCLADES_BH, do_cyclades_bh); + show_version(); /* Initialize the tty_driver structure */ memset(&cy_serial_driver, 0, sizeof(struct tty_driver)); cy_serial_driver.magic = TTY_DRIVER_MAGIC; - cy_serial_driver.name = "cyclades"; + cy_serial_driver.driver_name = "cyclades"; cy_serial_driver.name = "ttyC"; cy_serial_driver.major = CYCLADES_MAJOR; cy_serial_driver.minor_start = 0; @@ -5083,6 +5135,7 @@ cy_init(void)) cy_serial_driver.table = serial_table; cy_serial_driver.termios = serial_termios; cy_serial_driver.termios_locked = serial_termios_locked; + cy_serial_driver.open = cy_open; cy_serial_driver.close = cy_close; cy_serial_driver.write = cy_write; @@ -5098,7 +5151,9 @@ cy_init(void)) cy_serial_driver.stop = cy_stop; cy_serial_driver.start = cy_start; cy_serial_driver.hangup = cy_hangup; + cy_serial_driver.break_ctl = cy_break; cy_serial_driver.wait_until_sent = cy_wait_until_sent; + cy_serial_driver.read_proc = cyclades_get_proc_info; /* * The callout device is just like normal device except for @@ -5117,12 +5172,6 @@ cy_init(void)) if (tty_register_driver(&cy_callout_driver)) panic("Couldn't register Cyclades callout driver\n"); - init_bh(CYCLADES_BH, do_cyclades_bh); - - for (i = 0; i < NR_IRQS; i++) { - IRQ_cards[i] = 0; - } - for (i = 0; i < NR_CARDS; i++) { /* base_addr=0 indicates board not found */ cy_card[i].base_addr = 0; @@ -5135,9 +5184,11 @@ cy_init(void)) availability of cy_card and cy_port data structures and updating the cy_next_channel. */ +#ifndef CONFIG_COBALT_27 /* look for isa boards */ cy_isa_nboard = cy_detect_isa(); - +#endif /* CONFIG_COBALT_27 */ + /* look for pci boards */ cy_pci_nboard = cy_detect_pci(); @@ -5210,9 +5261,9 @@ cy_init(void)) cy_callout_driver.init_termios; info->normal_termios = cy_serial_driver.init_termios; - info->open_wait = 0; - info->close_wait = 0; - info->shutdown_wait = 0; + init_waitqueue_head(&info->open_wait); + init_waitqueue_head(&info->close_wait); + init_waitqueue_head(&info->shutdown_wait); /* info->session */ /* info->pgrp */ info->read_status_mask = 0; @@ -5279,9 +5330,9 @@ cy_init(void)) cy_callout_driver.init_termios; info->normal_termios = cy_serial_driver.init_termios; - info->open_wait = 0; - info->close_wait = 0; - info->shutdown_wait = 0; + init_waitqueue_head(&info->open_wait); + init_waitqueue_head(&info->close_wait); + init_waitqueue_head(&info->shutdown_wait); /* info->session */ /* info->pgrp */ info->read_status_mask = @@ -5323,6 +5374,7 @@ void cleanup_module(void) { int i; + int e1, e2; unsigned long flags; if (cyz_timeron){ @@ -5333,11 +5385,12 @@ cleanup_module(void) save_flags(flags); cli(); remove_bh(CYCLADES_BH); - free_page((unsigned long)tmp_buf); - if (tty_unregister_driver(&cy_callout_driver)) - printk("Couldn't unregister Cyclades callout driver\n"); - if (tty_unregister_driver(&cy_serial_driver)) - printk("Couldn't unregister Cyclades serial driver\n"); + if ((e1 = tty_unregister_driver(&cy_serial_driver))) + printk("cyc: failed to unregister Cyclades serial driver(%d)\n", + e1); + if ((e2 = tty_unregister_driver(&cy_callout_driver))) + printk("cyc: failed to unregister Cyclades callout driver (%d)\n", + e2); restore_flags(flags); @@ -5345,9 +5398,13 @@ cleanup_module(void) if (cy_card[i].base_addr != 0 && cy_card[i].irq) { - free_irq(cy_card[i].irq,NULL); + free_irq(cy_card[i].irq, &cy_card[i]); } } + if (tmp_buf) { + free_page((unsigned long) tmp_buf); + tmp_buf = NULL; + } #ifdef CY_PROC remove_proc_entry("cyclades", 0); #endif @@ -5358,6 +5415,7 @@ cleanup_module(void) void cy_setup(char *str, int *ints) { +#ifndef CONFIG_COBALT_27 int i, j; for (i = 0 ; i < NR_ISA_ADDRS ; i++) { @@ -5368,6 +5426,7 @@ cy_setup(char *str, int *ints) cy_isa_addresses[i++] = (unsigned char *)(ints[j]); } } +#endif /* CONFIG_COBALT_27 */ } /* cy_setup */ #endif diff --git a/drivers/char/dn_keyb.c b/drivers/char/dn_keyb.c index 304feb0e8..29e9f7f81 100644 --- a/drivers/char/dn_keyb.c +++ b/drivers/char/dn_keyb.c @@ -47,7 +47,7 @@ static int keyb_cmd_transmit=0; static unsigned int kbd_mode=APOLLO_KBD_MODE_KEYB; static short mouse_dx,mouse_dy,mouse_buttons; static int mouse_ready=0,mouse_update_allowed=0,mouse_active=0; -static struct wait_queue *mouse_wait=NULL; +static DECLARE_WAIT_QUEUE_HEAD(mouse_wait); static struct fasync_struct *mouse_fasyncptr=NULL; #if 0 diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c index 888f0a3ad..688604227 100644 --- a/drivers/char/dtlk.c +++ b/drivers/char/dtlk.c @@ -87,7 +87,7 @@ static int dtlk_timer_active; static int dtlk_has_indexing; static unsigned int dtlk_portlist[] = {0x25e, 0x29e, 0x2de, 0x31e, 0x35e, 0x39e, 0}; -static struct wait_queue *dtlk_process_list = NULL; +static wait_queue_head_t dtlk_process_list; static struct timer_list dtlk_timer; /* prototypes for file_operations struct */ @@ -382,7 +382,7 @@ int __init dtlk_init(void) init_timer(&dtlk_timer); dtlk_timer.function = dtlk_timer_tick; - dtlk_process_list = NULL; + init_waitqueue_head(&dtlk_process_list); return 0; } diff --git a/drivers/char/epca.c b/drivers/char/epca.c index e1d2cd2f7..abb8c5f35 100644 --- a/drivers/char/epca.c +++ b/drivers/char/epca.c @@ -1268,7 +1268,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, struct channel *ch) { /* Begin block_til_ready */ - struct wait_queue wait = {current, NULL}; + DECLARE_WAITQUEUE(wait,current); int retval, do_clocal = 0; unsigned long flags; @@ -2236,8 +2236,8 @@ static void post_fep_init(unsigned int crd) ch->blocked_open = 0; ch->callout_termios = pc_callout.init_termios; ch->normal_termios = pc_driver.init_termios; - ch->open_wait = 0; - ch->close_wait = 0; + init_waitqueue_head(&ch->open_wait); + init_waitqueue_head(&ch->close_wait); ch->tmp_buf = kmalloc(ch->txbufsize,GFP_KERNEL); if (!(ch->tmp_buf)) { diff --git a/drivers/char/esp.c b/drivers/char/esp.c index bf852fb20..53d67f19e 100644 --- a/drivers/char/esp.c +++ b/drivers/char/esp.c @@ -169,7 +169,7 @@ static struct termios *serial_termios_locked[NR_PORTS]; * memory if large numbers of serial ports are open. */ static unsigned char *tmp_buf = 0; -static struct semaphore tmp_buf_sem = MUTEX; +static DECLARE_MUTEX(tmp_buf_sem); static inline int serial_paranoia_check(struct esp_struct *info, kdev_t device, const char *routine) @@ -2224,7 +2224,7 @@ static void esp_hangup(struct tty_struct *tty) static int block_til_ready(struct tty_struct *tty, struct file * filp, struct esp_struct *info) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); int retval; int do_clocal = 0; @@ -2676,6 +2676,10 @@ __initfunc(int espserial_init(void)) info->config.flow_off = flow_off; info->config.pio_threshold = pio_threshold; info->next_port = ports; + init_waitqueue_head(&info->open_wait); + init_waitqueue_head(&info->close_wait); + init_waitqueue_head(&info->delta_msr_wait); + init_waitqueue_head(&info->break_wait); ports = info; printk(KERN_INFO "ttyP%d at 0x%04x (irq = %d) is an ESP ", info->line, info->port, info->irq); diff --git a/drivers/char/ftape/lowlevel/fdc-io.c b/drivers/char/ftape/lowlevel/fdc-io.c index 6890df0fa..c476c6441 100644 --- a/drivers/char/ftape/lowlevel/fdc-io.c +++ b/drivers/char/ftape/lowlevel/fdc-io.c @@ -54,7 +54,7 @@ int ftape_motor = 0; volatile int ftape_current_cylinder = -1; volatile fdc_mode_enum fdc_mode = fdc_idle; fdc_config_info fdc = {0}; -struct wait_queue *ftape_wait_intr = NULL; +DECLARE_WAIT_QUEUE_HEAD(ftape_wait_intr); unsigned int ft_fdc_base = CONFIG_FT_FDC_BASE; unsigned int ft_fdc_irq = CONFIG_FT_FDC_IRQ; @@ -385,7 +385,7 @@ int fdc_issue_command(const __u8 * out_data, int out_count, */ int fdc_interrupt_wait(unsigned int time) { - struct wait_queue wait = {current, NULL}; + DECLARE_WAITQUEUE(wait,current); sigset_t old_sigmask; static int resetting = 0; long timeout; diff --git a/drivers/char/ftape/lowlevel/fdc-io.h b/drivers/char/ftape/lowlevel/fdc-io.h index 77b2f5bb9..d7093b316 100644 --- a/drivers/char/ftape/lowlevel/fdc-io.h +++ b/drivers/char/ftape/lowlevel/fdc-io.h @@ -209,7 +209,7 @@ typedef struct { */ extern volatile fdc_mode_enum fdc_mode; extern int fdc_setup_error; /* outdated ??? */ -extern struct wait_queue *ftape_wait_intr; +extern wait_queue_head_t ftape_wait_intr; extern int ftape_motor; /* fdc motor line state */ extern volatile int ftape_current_cylinder; /* track nr FDC thinks we're on */ extern volatile __u8 fdc_head; /* FDC head */ diff --git a/drivers/char/h8.c b/drivers/char/h8.c index c76aeb79b..d146a808f 100644 --- a/drivers/char/h8.c +++ b/drivers/char/h8.c @@ -160,7 +160,7 @@ queue_head_t h8_actq, h8_cmdq, h8_freeq; */ int cpu_speed_divisor = -1; int h8_event_mask = 0; -struct wait_queue *h8_monitor_wait = NULL; +DECLARE_WAIT_QUEUE_HEAD(h8_monitor_wait); unsigned int h8_command_mask = 0; int h8_uthermal_threshold = DEFAULT_UTHERMAL_THRESHOLD; int h8_uthermal_window = UTH_HYSTERESIS; @@ -170,7 +170,7 @@ int h8_udamp = MHZ_57; u_char h8_current_temp = 0; u_char h8_system_temp = 0; int h8_sync_channel = 0; -struct wait_queue *h8_sync_wait = NULL; +DECLARE_WAIT_QUEUE_HEAD(h8_sync_wait); int h8_init_performed; /* CPU speeds and clock divisor values */ diff --git a/drivers/char/hfmodem/main.c b/drivers/char/hfmodem/main.c index 20347f32c..6af834fce 100644 --- a/drivers/char/hfmodem/main.c +++ b/drivers/char/hfmodem/main.c @@ -638,6 +638,7 @@ __initfunc(int init_module(void)) hfmodem_state[0].ptt_out.seriobase = serio; hfmodem_state[0].ptt_out.pariobase = pario; hfmodem_state[0].ptt_out.midiiobase = midiio; + init_waitqueue_head(&hfmodem_state[0].wait); hfmodem_refclock_probe(); output_check(&hfmodem_state[0]); #if defined(CONFIG_HFMODEM_WSS) && defined(CONFIG_HFMODEM_SBC) @@ -703,7 +704,8 @@ __initfunc(void hfmodem_init(void)) int i; printk(hfmodem_drvinfo); - hfmodem_refclock_probe(); + init_waitqueue_head(&hfmode_state[0].wait); + hfmodem_refclock_probe(); output_check(&hfmodem_state[0]); #if defined(CONFIG_HFMODEM_WSS) && defined(CONFIG_HFMODEM_SBC) if (hw) diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c index ba72b616a..e99decb62 100644 --- a/drivers/char/isicom.c +++ b/drivers/char/isicom.c @@ -80,7 +80,7 @@ static void isicom_tx(unsigned long _data); static void isicom_start(struct tty_struct * tty); static unsigned char * tmp_buf = 0; -static struct semaphore tmp_buf_sem = MUTEX; +static DECLARE_MUTEX(tmp_buf_sem); /* baud index mappings from linux defns to isi */ @@ -870,7 +870,7 @@ static int isicom_setup_port(struct isi_port * port) static int block_til_ready(struct tty_struct * tty, struct file * filp, struct isi_port * port) { int do_clocal = 0, retval; - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); /* block if port is in the process of being closed */ @@ -1858,7 +1858,8 @@ static int isicom_init(void) port->bh_tqueue.routine = isicom_bottomhalf; port->bh_tqueue.data = port; port->status = 0; - + init_waitqueue_head(&port->open_wait); + init_waitqueue_head(&port->close_wait); /* . . . */ } } diff --git a/drivers/char/joystick/joystick.c b/drivers/char/joystick/joystick.c index aff1acd17..4d9d94aa1 100644 --- a/drivers/char/joystick/joystick.c +++ b/drivers/char/joystick/joystick.c @@ -491,7 +491,7 @@ static ssize_t js_read(struct file *file, char *buf, size_t count, loff_t *ppos) static int js_read(struct inode *inode, struct file *file, char *buf, int count) #endif { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); struct js_event *buff = (void *) buf; struct js_list *curl; struct js_dev *jd; @@ -1081,7 +1081,7 @@ int js_register_device(struct js_port *port, int number, int axes, int buttons, curd->next = NULL; curd->list = NULL; curd->port = port; - curd->wait = NULL; + init_waitqueue_head(&curd->wait); curd->open = open; curd->close = close; diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index 3ef7bf1a6..c25f24bc4 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -64,7 +64,7 @@ EXPORT_SYMBOL(handle_scancode); extern void ctrl_alt_del(void); -struct wait_queue * keypress_wait = NULL; +DECLARE_WAIT_QUEUE_HEAD(keypress_wait); struct console; int keyboard_wait_for_keypress(struct console *co) @@ -247,9 +247,10 @@ void handle_scancode(unsigned char scancode, int down) sysrq_pressed = !up_flag; return; } else if (sysrq_pressed) { - if (!up_flag) + if (!up_flag) { handle_sysrq(kbd_sysrq_xlate[keycode], kbd_pt_regs, kbd, tty); - return; + return; + } } #endif @@ -279,7 +280,8 @@ void handle_scancode(unsigned char scancode, int down) u_char type; /* the XOR below used to be an OR */ - int shift_final = shift_state ^ kbd->lockstate ^ kbd->slockstate; + int shift_final = (shift_state | kbd->slockstate) ^ + kbd->lockstate; ushort *key_map = key_maps[shift_final]; if (key_map != NULL) { @@ -311,6 +313,7 @@ void handle_scancode(unsigned char scancode, int down) /* we have at least to update shift_state */ #if 1 /* how? two almost equivalent choices follow */ compute_shiftstate(); + kbd->slockstate = 0; /* play it safe */ #else keysym = U(plain_map[keycode]); type = KTYP(keysym); @@ -757,7 +760,7 @@ void compute_shiftstate(void) for(j=0; j<BITS_PER_LONG; j++,k++) if(test_bit(k, key_down)) { sym = U(plain_map[k]); - if(KTYP(sym) == KT_SHIFT) { + if(KTYP(sym) == KT_SHIFT || KTYP(sym) == KT_SLOCK) { val = KVAL(sym); if (val == KVAL(K_CAPSSHIFT)) val = KVAL(K_SHIFT); @@ -809,9 +812,15 @@ static void do_lock(unsigned char value, char up_flag) static void do_slock(unsigned char value, char up_flag) { + do_shift(value,up_flag); if (up_flag || rep) return; chg_vc_kbd_slock(kbd, value); + /* try to make Alt, oops, AltGr and such work */ + if (!key_maps[kbd->lockstate ^ kbd->slockstate]) { + kbd->slockstate = 0; + chg_vc_kbd_slock(kbd, value); + } } /* diff --git a/drivers/char/lp.c b/drivers/char/lp.c index 996c15019..4b005b96d 100644 --- a/drivers/char/lp.c +++ b/drivers/char/lp.c @@ -187,15 +187,7 @@ int main(int argc, char **argv) /* if you have more than 3 printers, remember to increase LP_NO */ #define LP_NO 3 -struct lp_struct lp_table[LP_NO] = -{ - [0 ... LP_NO-1] = {NULL, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, - NULL, -#ifdef LP_STATS - 0, 0, {0}, -#endif - NULL, 0, 0, 0} -}; +struct lp_struct lp_table[LP_NO]; /* Test if printer is ready */ #define LP_READY(status) ((status) & LP_PBUSY) @@ -737,6 +729,7 @@ static int lp_open(struct inode * inode, struct file * file) LP_F(minor) &= ~LP_BUSY; return -ENOMEM; } + init_waitqueue_head(&(lp_table[minor].wait_q)); return 0; } @@ -929,6 +922,24 @@ int lp_init(void) unsigned int i; struct parport *port; + for(i = 0; i < LP_NO; i++) { + lp_table[i].dev = NULL; + lp_table[i].flags = 0; + lp_table[i].chars = LP_INIT_CHAR; + lp_table[i].time = LP_INIT_TIME; + lp_table[i].wait = LP_INIT_WAIT; + lp_table[i].lp_buffer = NULL; +#ifdef LP_STATS + lp_table[i].lastcall = 0; + lp_table[i].runchars = 0; + memset(&lp_table[i].stats, 0, sizeof(struct lp_stats)); +#endif + init_waitqueue_head(&lp_table[i].wait_q); + lp_table[i].last_error = 0; + lp_table[i].irq_detected = 0; + lp_table[i].irq_missed = 0; + } + switch (parport_nr[0]) { case LP_PARPORT_OFF: diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 47ae0706f..d83775f7c 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -51,14 +51,8 @@ extern void mda_console_init(void); #if defined(CONFIG_PPC) || defined(CONFIG_MAC) extern void adbdev_init(void); #endif -#ifdef CONFIG_USB_UHCI -int uhci_init(void); -#endif -#ifdef CONFIG_USB_OHCI -int ohci_init(void); -#endif -#ifdef CONFIG_USB_OHCI_HCD -int ohci_hcd_init(void); +#ifdef CONFIG_USB +extern void usb_init(void); #endif static ssize_t do_write_mem(struct file * file, void *p, unsigned long realp, @@ -609,15 +603,7 @@ __initfunc(int chr_dev_init(void)) printk("unable to get major %d for memory devs\n", MEM_MAJOR); rand_initialize(); #ifdef CONFIG_USB -#ifdef CONFIG_USB_UHCI - uhci_init(); -#endif -#ifdef CONFIG_USB_OHCI - ohci_init(); -#endif -#ifdef CONFIG_USB_OHCI_HCD - ohci_hcd_init(); -#endif + usb_init(); #endif #if defined (CONFIG_FB) fbmem_init(); diff --git a/drivers/char/misc.c b/drivers/char/misc.c index ae05abcfd..9b5b5fc20 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c @@ -80,6 +80,7 @@ extern void acq_init(void); extern void dtlk_init(void); extern void pcwatchdog_init(void); extern int rtc_init(void); +extern int rtc_sun_init(void); /* Combines MK48T02 and MK48T08 */ extern int ds1286_init(void); extern int dsp56k_init(void); extern int nvram_init(void); @@ -250,7 +251,10 @@ int __init misc_init(void) #ifdef CONFIG_BVME6000 rtc_DP8570A_init(); #endif -#if defined(CONFIG_RTC) || defined(CONFIG_SUN_MOSTEK_RTC) +#if defined(CONFIG_SUN_MOSTEK_RTC) + rtc_sun_init(); +#endif +#if defined(CONFIG_RTC) rtc_init(); #endif #ifdef CONFIG_SGI_DS1286 diff --git a/drivers/char/msbusmouse.c b/drivers/char/msbusmouse.c index 07c733b5b..f580be0bb 100644 --- a/drivers/char/msbusmouse.c +++ b/drivers/char/msbusmouse.c @@ -195,7 +195,7 @@ __initfunc(int ms_bus_mouse_init(void)) mouse.present = mouse.active = mouse.ready = 0; mouse.buttons = 0x80; mouse.dx = mouse.dy = 0; - mouse.wait = NULL; + init_waitqueue_head(&mouse.wait); if (check_region(MS_MSE_CONTROL_PORT, 0x04)) return -ENODEV; diff --git a/drivers/char/msp3400.c b/drivers/char/msp3400.c index 4ccdb8f15..5791e149e 100644 --- a/drivers/char/msp3400.c +++ b/drivers/char/msp3400.c @@ -83,7 +83,7 @@ struct msp3400c { /* thread */ struct task_struct *thread; - struct wait_queue *wq; + wait_queue_head_t wq; struct semaphore *notify; int active,restart,rmmod; @@ -523,7 +523,6 @@ static int msp3400c_thread(void *data) current->fs->umask = 0; strcpy(current->comm,"msp3400"); - msp->wq = NULL; msp->thread = current; #ifdef __SMP__ @@ -748,7 +747,7 @@ static int msp3410d_thread(void *data) { unsigned long flags; struct msp3400c *msp = data; - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); int i, val; /* lock_kernel(); */ @@ -844,7 +843,7 @@ done: static struct msp3400c *mspmix = NULL; /* ugly hack, should do something more sensible */ static int mixer_num; static int mixer_modcnt = 0; -static struct semaphore mixer_sem = MUTEX; +static DECLARE_MUTEX(mixer_sem); static int mix_to_v4l(int i) { @@ -1016,7 +1015,7 @@ static /*const*/ struct file_operations msp3400c_mixer_fops = { static int msp3400c_attach(struct i2c_device *device) { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); struct msp3400c *msp; int rev1,rev2; LOCK_FLAGS; @@ -1030,6 +1029,7 @@ static int msp3400c_attach(struct i2c_device *device) msp->right = 65535; msp->bass = 32768; msp->treble = 32768; + init_waitqueue_head(&msp->wq); LOCK_I2C_BUS(msp->bus); if (-1 == msp3400c_reset(msp->bus)) { @@ -1069,7 +1069,6 @@ static int msp3400c_attach(struct i2c_device *device) /* startup control thread */ MOD_INC_USE_COUNT; - msp->wq = NULL; msp->notify = &sem; kernel_thread(msp3400c_thread, (void *)msp, 0); down(&sem); @@ -1090,7 +1089,7 @@ static int msp3400c_attach(struct i2c_device *device) static int msp3400c_detach(struct i2c_device *device) { - struct semaphore sem = MUTEX_LOCKED; + DECLARE_MUTEX_LOCKED(sem); struct msp3400c *msp = (struct msp3400c*)device->data; LOCK_FLAGS; diff --git a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c index cff73b4a3..9319b777a 100644 --- a/drivers/char/n_hdlc.c +++ b/drivers/char/n_hdlc.c @@ -221,8 +221,8 @@ struct n_hdlc { struct tty_struct *backup_tty; /* TTY to use if tty gets closed */ /* Queues for select() functionality */ - struct wait_queue *read_wait; - struct wait_queue *write_wait; + wait_queue_head_t read_wait; + wait_queue_head_t write_wait; int tbusy; /* reentrancy flag for tx wakeup code */ int woke_up; @@ -724,7 +724,7 @@ static rw_ret_t n_hdlc_tty_write (struct tty_struct *tty, struct file *file, { struct n_hdlc *n_hdlc = tty2n_hdlc (tty); int error = 0; - struct wait_queue wait = {current, NULL}; + DECLARE_WAITQUEUE(wait, current); N_HDLC_BUF *tbuf; if (debuglevel >= DEBUG_LEVEL_INFO) @@ -1006,8 +1006,8 @@ static struct n_hdlc *n_hdlc_alloc (void) n_hdlc->magic = HDLC_MAGIC; n_hdlc->flags = 0; - n_hdlc->read_wait = NULL; - n_hdlc->write_wait = NULL; + init_waitqueue_head(&n_hdlc->read_wait); + init_waitqueue_head(&n_hdlc->write_wait); return n_hdlc; diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c index 1c6f93f44..af4daecfb 100644 --- a/drivers/char/n_tty.c +++ b/drivers/char/n_tty.c @@ -605,7 +605,7 @@ send_signal: tty->canon_data++; if (tty->fasync) kill_fasync(tty->fasync, SIGIO); - if (tty->read_wait) + if (waitqueue_active(&tty->read_wait)) wake_up_interruptible(&tty->read_wait); return; } @@ -707,7 +707,7 @@ static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp, if (!tty->icanon && (tty->read_cnt >= tty->minimum_to_wake)) { if (tty->fasync) kill_fasync(tty->fasync, SIGIO); - if (tty->read_wait) + if (waitqueue_active(&tty->read_wait)) wake_up_interruptible(&tty->read_wait); } @@ -868,7 +868,7 @@ static ssize_t read_chan(struct tty_struct *tty, struct file *file, unsigned char *buf, size_t nr) { unsigned char *b = buf; - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); int c; int minimum, time; ssize_t retval = 0; @@ -1058,7 +1058,7 @@ static ssize_t write_chan(struct tty_struct * tty, struct file * file, const unsigned char * buf, size_t nr) { const unsigned char *b = buf; - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); int c; ssize_t retval = 0; diff --git a/drivers/char/pc110pad.c b/drivers/char/pc110pad.c index 247cfa181..0c00dcfa5 100644 --- a/drivers/char/pc110pad.c +++ b/drivers/char/pc110pad.c @@ -9,11 +9,11 @@ * This is read internally and used to synthesize a stream of * triples in the form expected from a PS/2 device. * - * 0.0 1997-05-16 Alan Cox <alan@cymru.net> - Pad reader + * 0.0 1997-05-16 Alan Cox <alan@redhat.com> - Pad reader * 0.1 1997-05-19 Robin O'Leary <robin@acm.org> - PS/2 emulation * 0.2 1997-06-03 Robin O'Leary <robin@acm.org> - tap gesture - * 0.3 1997-06-27 Alan Cox <alan@cymru.net> - 2.1 commit - * 0.4 1997-11-09 Alan Cox <alan@cymru.net> - Single Unix VFS API changes + * 0.3 1997-06-27 Alan Cox <alan@redhat.com> - 2.1 commit + * 0.4 1997-11-09 Alan Cox <alan@redhat.com> - Single Unix VFS API changes */ #include <linux/module.h> @@ -48,7 +48,7 @@ static struct pc110pad_params current_params; /* driver/filesystem interface management */ -static struct wait_queue *queue; +static wait_queue_head_t queue; static struct fasync_struct *asyncptr; static int active=0; /* number of concurrent open()s */ @@ -656,6 +656,7 @@ int pc110pad_init(void) return -EBUSY; } request_region(current_params.io, 4, "pc110pad"); + init_waitqueue_head(&queue); printk("PC110 digitizer pad at 0x%X, irq %d.\n", current_params.io,current_params.irq); misc_register(&pc110_pad); diff --git a/drivers/char/pc_keyb.c b/drivers/char/pc_keyb.c index 9b50d1079..bf3d1f41d 100644 --- a/drivers/char/pc_keyb.c +++ b/drivers/char/pc_keyb.c @@ -867,7 +867,7 @@ static int open_aux(struct inode * inode, struct file * file) static ssize_t read_aux(struct file * file, char * buffer, size_t count, loff_t *ppos) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); ssize_t i = count; unsigned char c; @@ -967,7 +967,7 @@ static int __init psaux_init(void) queue = (struct aux_queue *) kmalloc(sizeof(*queue), GFP_KERNEL); memset(queue, 0, sizeof(*queue)); queue->head = queue->tail = 0; - queue->proc_list = NULL; + init_waitqueue_head(&queue->proc_list); #ifdef INITIALIZE_MOUSE kbd_write_command_w(KBD_CCMD_MOUSE_ENABLE); /* Enable Aux. */ diff --git a/drivers/char/pcxx.c b/drivers/char/pcxx.c index 9b0418faf..dda54324e 100644 --- a/drivers/char/pcxx.c +++ b/drivers/char/pcxx.c @@ -326,7 +326,7 @@ static void pcxx_error(int line, char *msg) static int pcxx_waitcarrier(struct tty_struct *tty,struct file *filp,struct channel *info) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); int retval = 0; int do_clocal = 0; diff --git a/drivers/char/pcxx.h b/drivers/char/pcxx.h index e688a8be2..6d7a08b85 100644 --- a/drivers/char/pcxx.h +++ b/drivers/char/pcxx.h @@ -88,8 +88,8 @@ struct channel { int blocked_open; int close_delay; int event; - struct wait_queue *open_wait; - struct wait_queue *close_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; struct tq_struct tqueue; /* ------------ Async control data ------------- */ unchar modemfake; /* Modem values to be forced */ diff --git a/drivers/char/planb.c b/drivers/char/planb.c index 0f2d24e8b..1c6bf655b 100644 --- a/drivers/char/planb.c +++ b/drivers/char/planb.c @@ -379,7 +379,7 @@ static volatile struct dbdma_cmd *cmd_geo_setup( static void __planb_wait(struct planb *pb) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); add_wait_queue(&pb->lockq, &wait); repeat: diff --git a/drivers/char/planb.h b/drivers/char/planb.h index 716163f6c..e57bed49b 100644 --- a/drivers/char/planb.h +++ b/drivers/char/planb.h @@ -175,7 +175,7 @@ struct planb { unsigned int tab_size; int maxlines; int lock; - struct wait_queue *lockq; + wait_queue_head_t lockq; unsigned int irq; /* interrupt number */ volatile unsigned int intr_mask; @@ -190,13 +190,13 @@ struct planb { unsigned long ch1_cmd_phys; volatile unsigned char *mask; /* Clipmask buffer */ int suspend; - struct wait_queue *suspendq; + wait_queue_head_t suspendq; struct planb_suspend suspended; int cmd_buff_inited; /* cmd buffer inited? */ int grabbing; unsigned int gcount; - struct wait_queue *capq; + wait_queue_head_t capq; int last_fr; int prev_last_fr; unsigned char *fbuffer; diff --git a/drivers/char/pms.c b/drivers/char/pms.c index 252929f82..72653aa19 100644 --- a/drivers/char/pms.c +++ b/drivers/char/pms.c @@ -10,7 +10,7 @@ * 14478 Potsdam, Germany * * Most of this code is directly derived from his userspace driver. - * His driver works so send any reports to alan@cymru.net unless the + * His driver works so send any reports to alan@redhat.com unless the * userspace driver also doesnt work for you... */ diff --git a/drivers/char/pty.c b/drivers/char/pty.c index 48e81fc61..1e67c604e 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c @@ -30,7 +30,7 @@ struct pty_struct { int magic; - struct wait_queue * open_wait; + wait_queue_head_t open_wait; }; #define PTY_MAGIC 0x5001 @@ -336,13 +336,13 @@ static void pty_set_termios(struct tty_struct *tty, struct termios *old_termios) __initfunc(int pty_init(void)) { -#ifdef CONFIG_UNIX98_PTYS int i; -#endif /* Traditional BSD devices */ memset(&pty_state, 0, sizeof(pty_state)); + for (i = 0; i < NR_PTYS; i++) + init_waitqueue_head(&pty_state[i].open_wait); memset(&pty_driver, 0, sizeof(struct tty_driver)); pty_driver.magic = TTY_DRIVER_MAGIC; pty_driver.driver_name = "pty_master"; @@ -405,6 +405,8 @@ __initfunc(int pty_init(void)) #ifdef CONFIG_UNIX98_PTYS printk("pty: %d Unix98 ptys configured\n", UNIX98_NR_MAJORS*NR_PTYS); for ( i = 0 ; i < UNIX98_NR_MAJORS ; i++ ) { + int j; + ptm_driver[i] = pty_driver; ptm_driver[i].name = "ptm"; ptm_driver[i].proc_entry = 0; @@ -417,6 +419,9 @@ __initfunc(int pty_init(void)) ptm_driver[i].termios = ptm_termios[i]; ptm_driver[i].termios_locked = ptm_termios_locked[i]; ptm_driver[i].driver_state = ptm_state[i]; + + for (j = 0; j < NR_PTYS; j++) + init_waitqueue_head(&ptm_state[i][j].open_wait); pts_driver[i] = pty_slave_driver; pts_driver[i].name = "pts"; diff --git a/drivers/char/qpmouse.c b/drivers/char/qpmouse.c index 12b134719..2aa736190 100644 --- a/drivers/char/qpmouse.c +++ b/drivers/char/qpmouse.c @@ -55,7 +55,7 @@ struct qp_queue { unsigned long head; unsigned long tail; - struct wait_queue *proc_list; + wait_queue_head_t proc_list; struct fasync_struct *fasync; unsigned char buf[QP_BUF_SIZE]; }; @@ -258,7 +258,7 @@ static int poll_qp_status(void) static ssize_t read_qp(struct file * file, char * buffer, size_t count, loff_t *ppos) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); ssize_t i = count; unsigned char c; @@ -354,7 +354,7 @@ int __init qpmouse_init(void) queue = (struct qp_queue *) kmalloc(sizeof(*queue), GFP_KERNEL); memset(queue, 0, sizeof(*queue)); queue->head = queue->tail = 0; - queue->proc_list = NULL; + init_waitqueue_head(&queue->proc_list); return 0; } diff --git a/drivers/char/radio-cadet.c b/drivers/char/radio-cadet.c index 08d502d85..cfca71f7f 100644 --- a/drivers/char/radio-cadet.c +++ b/drivers/char/radio-cadet.c @@ -1,7 +1,7 @@ /* cadet.c - A video4linux driver for the ADS Cadet AM/FM Radio Card * * by Fred Gleason <fredg@wava.com> - * Version 0.3.1 + * Version 0.3.2 * * (Loosely) based on code for the Aztech radio card by * @@ -34,7 +34,7 @@ static int users=0; static int curtuner=0; static int tunestat=0; static int sigstrength=0; -struct wait_queue *tunerq,*rdsq,*readq; +static wait_queue_head_t tunerq,rdsq,readq; struct timer_list tunertimer,rdstimer,readtimer; static __u8 rdsin=0,rdsout=0,rdsstat=0; static unsigned char rdsbuf[RDS_BUFFER]; @@ -75,7 +75,7 @@ static int cadet_getrds(void) rdstimer.function=cadet_wake; rdstimer.data=(unsigned long)1; rdstimer.expires=jiffies+(HZ/10); - rdsq=NULL; + init_waitqueue_head(&rdsq); add_timer(&rdstimer); sleep_on(&rdsq); @@ -260,7 +260,7 @@ static void cadet_setfreq(unsigned freq) tunertimer.function=cadet_wake; tunertimer.data=(unsigned long)0; tunertimer.expires=jiffies+(HZ/10); - tunerq=NULL; + init_waitqueue_head(&tunerq); add_timer(&tunertimer); sleep_on(&tunerq); cadet_gettune(); @@ -327,7 +327,7 @@ void cadet_handler(unsigned long data) /* * Service pending read */ - if((rdsin!=rdsout)&&(readq!=NULL)) { + if( rdsin!=rdsout) { wake_up_interruptible(&readq); } @@ -369,7 +369,6 @@ static long cadet_read(struct video_device *v,char *buf,unsigned long count, return -EWOULDBLOCK; } interruptible_sleep_on(&readq); - readq=NULL; } while((i<count)&&(rdsin!=rdsout)) { readbuf[i++]=rdsbuf[rdsout++]; @@ -517,7 +516,7 @@ static int cadet_open(struct video_device *dev, int flags) return -EBUSY; users++; MOD_INC_USE_COUNT; - readq=NULL; + init_waitqueue_head(&readq); return 0; } @@ -558,7 +557,7 @@ __initfunc(int cadet_init(struct video_init *v)) return -EINVAL; request_region(io,2,"cadet"); - printk(KERN_INFO "ADS Cadet Radio Card at %x\n",io); + printk(KERN_INFO "ADS Cadet Radio Card at 0x%x\n",io); return 0; } @@ -571,12 +570,11 @@ static int cadet_probe(void) for(i=0;i<8;i++) { io=iovals[i]; - if(check_region(io,2)) { - return -1; - } - cadet_setfreq(1410); - if(cadet_getfreq()==1410) { - return io; + if(check_region(io,2)>=0) { + cadet_setfreq(1410); + if(cadet_getfreq()==1410) { + return io; + } } } return -1; diff --git a/drivers/char/random.c b/drivers/char/random.c index f78974d69..f1dd26cd2 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -424,8 +424,8 @@ static struct timer_rand_state mouse_timer_state; static struct timer_rand_state extract_timer_state; static struct timer_rand_state *irq_timer_state[NR_IRQS]; static struct timer_rand_state *blkdev_timer_state[MAX_BLKDEV]; -static struct wait_queue *random_read_wait; -static struct wait_queue *random_write_wait; +static DECLARE_WAIT_QUEUE_HEAD(random_read_wait); +static DECLARE_WAIT_QUEUE_HEAD(random_write_wait); static ssize_t random_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos); @@ -555,8 +555,6 @@ __initfunc(void rand_initialize(void)) initialize_benchmark(&timer_benchmark, "timer", 0); #endif extract_timer_state.dont_count_entropy = 1; - random_read_wait = NULL; - random_write_wait = NULL; } void rand_initialize_irq(int irq) @@ -1303,7 +1301,7 @@ void get_random_bytes(void *buf, int nbytes) static ssize_t random_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); ssize_t n, retval = 0, count = 0; if (nbytes == 0) diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c index 7764997b5..adfa0a165 100644 --- a/drivers/char/riscom8.c +++ b/drivers/char/riscom8.c @@ -87,7 +87,7 @@ static struct tty_struct * riscom_table[RC_NBOARD * RC_NPORT] = { NULL, }; static struct termios * riscom_termios[RC_NBOARD * RC_NPORT] = { NULL, }; static struct termios * riscom_termios_locked[RC_NBOARD * RC_NPORT] = { NULL, }; static unsigned char * tmp_buf = NULL; -static struct semaphore tmp_buf_sem = MUTEX; +static DECLARE_MUTEX(tmp_buf_sem); static unsigned long baud_table[] = { 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, @@ -946,7 +946,7 @@ static void rc_shutdown_port(struct riscom_board *bp, struct riscom_port *port) static int block_til_ready(struct tty_struct *tty, struct file * filp, struct riscom_port *port) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); struct riscom_board *bp = port_Board(port); int retval; int do_clocal = 0; @@ -1790,6 +1790,8 @@ static inline int rc_init_drivers(void) rc_port[i].tqueue_hangup.data = &rc_port[i]; rc_port[i].close_delay = 50 * HZ/100; rc_port[i].closing_wait = 3000 * HZ/100; + init_waitqueue_head(&rc_port[i].open_wait); + init_waitqueue_head(&rc_port[i].close_wait); } return 0; diff --git a/drivers/char/riscom8.h b/drivers/char/riscom8.h index c116b4538..3b2b9e78d 100644 --- a/drivers/char/riscom8.h +++ b/drivers/char/riscom8.h @@ -83,8 +83,8 @@ struct riscom_port { int xmit_cnt; struct termios normal_termios; struct termios callout_termios; - struct wait_queue *open_wait; - struct wait_queue *close_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; struct tq_struct tqueue; struct tq_struct tqueue_hangup; short wakeup_chars; diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index 13aa8edec..8c7020379 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c @@ -253,7 +253,7 @@ static inline int signal_pending(struct task_struct *p) * memory if large numbers of serial ports are open. */ static unsigned char *tmp_buf = 0; -static struct semaphore tmp_buf_sem = MUTEX; +static DECLARE_MUTEX(tmp_buf_sem); static void rp_start(struct tty_struct *tty); @@ -643,6 +643,8 @@ static void init_r_port(int board, int aiop, int chan) info->close_delay = 50; info->callout_termios =callout_driver.init_termios; info->normal_termios = rocket_driver.init_termios; + init_waitqueue_head(&info->open_wait); + init_waitqueue_head(&info->close_wait); info->intmask = RXF_TRIG | TXFIFO_MT | SRC_INT | DELTA_CD | DELTA_CTS | DELTA_DSR; @@ -807,7 +809,7 @@ static void configure_r_port(struct r_port *info) static int block_til_ready(struct tty_struct *tty, struct file * filp, struct r_port *info) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); int retval; int do_clocal = 0, extra_count = 0; unsigned long flags; diff --git a/drivers/char/rocket_int.h b/drivers/char/rocket_int.h index 604e8733b..74dda61ed 100644 --- a/drivers/char/rocket_int.h +++ b/drivers/char/rocket_int.h @@ -1144,8 +1144,8 @@ struct r_port { struct termios normal_termios; struct termios callout_termios; struct tq_struct tqueue; - struct wait_queue *open_wait; - struct wait_queue *close_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; }; #define RPORT_MAGIC 0x525001 diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index 5fde4639e..4339d5514 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c @@ -32,10 +32,11 @@ * 1.08 Miquel van Smoorenburg: disallow certain things on the * DEC Alpha as the CMOS clock is also used for other things. * 1.09 Nikita Schmidt: epoch support and some Alpha cleanup. + * 1.09a Pete Zaitcev: Sun SPARC * */ -#define RTC_VERSION "1.09" +#define RTC_VERSION "1.09a" #define RTC_IRQ 8 /* Can't see this changing soon. */ #define RTC_IO_EXTENT 0x10 /* Only really two ports, but... */ @@ -63,6 +64,12 @@ #include <asm/uaccess.h> #include <asm/system.h> +#ifdef __sparc__ +#include <asm/ebus.h> + +static unsigned long rtc_port; +#endif + /* * We sponge a minor off of the misc major. No need slurping * up another valuable major dev number for this. If you add @@ -70,7 +77,7 @@ * ioctls. */ -static struct wait_queue *rtc_wait; +static DECLARE_WAIT_QUEUE_HEAD(rtc_wait); static struct timer_list rtc_irq_timer; @@ -84,12 +91,12 @@ static int rtc_ioctl(struct inode *inode, struct file *file, static unsigned int rtc_poll(struct file *file, poll_table *wait); -void get_rtc_time (struct rtc_time *rtc_tm); -void get_rtc_alm_time (struct rtc_time *alm_tm); -void rtc_dropped_irq(unsigned long data); +static void get_rtc_time (struct rtc_time *rtc_tm); +static void get_rtc_alm_time (struct rtc_time *alm_tm); +static void rtc_dropped_irq(unsigned long data); -void set_rtc_irq_bit(unsigned char bit); -void mask_rtc_irq_bit(unsigned char bit); +static void set_rtc_irq_bit(unsigned char bit); +static void mask_rtc_irq_bit(unsigned char bit); static inline unsigned char rtc_is_updating(void); @@ -151,7 +158,7 @@ static long long rtc_llseek(struct file *file, loff_t offset, int origin) static ssize_t rtc_read(struct file *file, char *buf, size_t count, loff_t *ppos) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); unsigned long data; ssize_t retval; @@ -526,7 +533,42 @@ __initfunc(int rtc_init(void)) unsigned long uip_watchdog; char *guess = NULL; #endif +#ifdef __sparc__ + struct linux_ebus *ebus; + struct linux_ebus_device *edev; + int rtc_irq; +#endif + printk(KERN_INFO "Real Time Clock Driver v%s\n", RTC_VERSION); +#ifdef __sparc__ + for_each_ebus(ebus) { + for_each_ebusdev(edev, ebus) { + if(strcmp(edev->prom_name, "rtc") == 0) { + goto found; + } + } + } + printk("rtc_init: no PC rtc found\n"); + return -EIO; + +found: + rtc_port = edev->base_address[0]; + rtc_irq = edev->irqs[0]; + /* + * XXX Interrupt pin #7 in Espresso is shared between RTC and + * PCI Slot 2 INTA# (and some INTx# in Slot 1). SA_INTERRUPT here + * is asking for trouble with add-on boards. Change to SA_SHIRQ. + */ + if(request_irq(rtc_irq, rtc_interrupt, SA_INTERRUPT, "rtc", (void *)&rtc_port)) { + /* + * Standard way for sparc to print irq's is to use + * __irq_itoa(). I think for EBus it's ok to use %d. + */ + printk("rtc: cannot register IRQ %d\n", rtc_irq); + return -EIO; + } + misc_register(&rtc_dev); +#else if(request_irq(RTC_IRQ, rtc_interrupt, SA_INTERRUPT, "rtc", NULL)) { /* Yeah right, seeing as irq 8 doesn't even hit the bus. */ @@ -536,6 +578,7 @@ __initfunc(int rtc_init(void)) misc_register(&rtc_dev); /* Check region? Naaah! Just snarf it up. */ request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc"); +#endif /* __sparc__ vs. Others */ #if defined(__alpha__) || defined(__mips__) rtc_freq = HZ; @@ -571,7 +614,6 @@ __initfunc(int rtc_init(void)) #endif init_timer(&rtc_irq_timer); rtc_irq_timer.function = rtc_dropped_irq; - rtc_wait = NULL; save_flags(flags); cli(); /* Initialize periodic freq. to CMOS reset default, which is 1024Hz */ @@ -593,7 +635,7 @@ __initfunc(int rtc_init(void)) * for something that requires a steady > 1KHz signal anyways.) */ -void rtc_dropped_irq(unsigned long data) +static void rtc_dropped_irq(unsigned long data) { unsigned long flags; @@ -701,7 +743,7 @@ static inline unsigned char rtc_is_updating(void) return uip; } -void get_rtc_time(struct rtc_time *rtc_tm) +static void get_rtc_time(struct rtc_time *rtc_tm) { unsigned long flags, uip_watchdog = jiffies; @@ -758,7 +800,7 @@ void get_rtc_time(struct rtc_time *rtc_tm) rtc_tm->tm_mon--; } -void get_rtc_alm_time(struct rtc_time *alm_tm) +static void get_rtc_alm_time(struct rtc_time *alm_tm) { unsigned long flags; unsigned char ctrl; @@ -808,7 +850,7 @@ void mask_rtc_irq_bit(unsigned char bit) rtc_irq_data = 0; } -void set_rtc_irq_bit(unsigned char bit) +static void set_rtc_irq_bit(unsigned char bit) { unsigned char val; unsigned long flags; diff --git a/drivers/char/selection.c b/drivers/char/selection.c index 6d38fcf7e..1529bd7ee 100644 --- a/drivers/char/selection.c +++ b/drivers/char/selection.c @@ -296,7 +296,7 @@ int paste_selection(struct tty_struct *tty) { struct vt_struct *vt = (struct vt_struct *) tty->driver_data; int pasted = 0, count; - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); poke_blanked_console(); add_wait_queue(&vt->paste_wait, &wait); diff --git a/drivers/char/serial.c b/drivers/char/serial.c index f0c685a4c..4a3d6e00e 100644 --- a/drivers/char/serial.c +++ b/drivers/char/serial.c @@ -227,7 +227,7 @@ static struct termios *serial_termios_locked[NR_PORTS]; * memory if large numbers of serial ports are open. */ static unsigned char *tmp_buf; -static struct semaphore tmp_buf_sem = MUTEX; +static DECLARE_MUTEX(tmp_buf_sem); static inline int serial_paranoia_check(struct async_struct *info, kdev_t device, const char *routine) @@ -2444,7 +2444,7 @@ static void rs_hangup(struct tty_struct *tty) static int block_til_ready(struct tty_struct *tty, struct file * filp, struct async_struct *info) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); struct serial_state *state = info->state; int retval; int do_clocal = 0, extra_count = 0; @@ -2593,6 +2593,9 @@ static int get_async_struct(int line, struct async_struct **ret_info) return -ENOMEM; } memset(info, 0, sizeof(struct async_struct)); + init_waitqueue_head(&info->open_wait); + init_waitqueue_head(&info->close_wait); + init_waitqueue_head(&info->delta_msr_wait); info->magic = SERIAL_MAGIC; info->port = sstate->port; info->flags = sstate->flags; diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c index b3ff15257..3851616ab 100644 --- a/drivers/char/serial167.c +++ b/drivers/char/serial167.c @@ -2007,7 +2007,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, struct cyclades_port *info) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); unsigned long flags; int channel; int retval; diff --git a/drivers/char/softdog.c b/drivers/char/softdog.c index 9dc9cbfe4..c8f21a184 100644 --- a/drivers/char/softdog.c +++ b/drivers/char/softdog.c @@ -1,8 +1,8 @@ /* * SoftDog 0.05: A Software Watchdog Device * - * (c) Copyright 1996 Alan Cox <alan@cymru.net>, All Rights Reserved. - * http://www.cymru.net + * (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved. + * http://www.redhat.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c index 220c93f80..c6fecb819 100644 --- a/drivers/char/specialix.c +++ b/drivers/char/specialix.c @@ -182,7 +182,7 @@ static struct tty_struct * specialix_table[SX_NBOARD * SX_NPORT] = { NULL, }; static struct termios * specialix_termios[SX_NBOARD * SX_NPORT] = { NULL, }; static struct termios * specialix_termios_locked[SX_NBOARD * SX_NPORT] = { NULL, }; static unsigned char * tmp_buf = NULL; -static struct semaphore tmp_buf_sem = MUTEX; +static DECLARE_MUTEX(tmp_buf_sem); static unsigned long baud_table[] = { 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, @@ -1311,7 +1311,7 @@ static void sx_shutdown_port(struct specialix_board *bp, struct specialix_port * static int block_til_ready(struct tty_struct *tty, struct file * filp, struct specialix_port *port) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); struct specialix_board *bp = port_Board(port); int retval; int do_clocal = 0; @@ -2248,6 +2248,8 @@ static int sx_init_drivers(void) sx_port[i].tqueue_hangup.data = &sx_port[i]; sx_port[i].close_delay = 50 * HZ/100; sx_port[i].closing_wait = 3000 * HZ/100; + init_waitqueue_head(&sx_port[i].open_wait); + init_waitqueue_head(&sx_port[i].close_wait); } return 0; diff --git a/drivers/char/specialix_io8.h b/drivers/char/specialix_io8.h index f4ca99ea6..e2a4a224c 100644 --- a/drivers/char/specialix_io8.h +++ b/drivers/char/specialix_io8.h @@ -122,8 +122,8 @@ struct specialix_port { int xmit_cnt; struct termios normal_termios; struct termios callout_termios; - struct wait_queue *open_wait; - struct wait_queue *close_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; struct tq_struct tqueue; struct tq_struct tqueue_hangup; short wakeup_chars; diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c index 64bacb0bd..23b8df504 100644 --- a/drivers/char/stallion.c +++ b/drivers/char/stallion.c @@ -154,7 +154,7 @@ static int stl_refcount = 0; * is already swapping a shared buffer won't make things any worse. */ static char *stl_tmpwritebuf; -static struct semaphore stl_tmpwritesem = MUTEX; +static DECLARE_MUTEX(stl_tmpwritesem); /* * Define a local default termios struct. All ports will be created diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index 0881c8821..75c8a68b9 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c @@ -241,11 +241,11 @@ struct mgsl_struct { int xmit_tail; int xmit_cnt; - struct wait_queue *open_wait; - struct wait_queue *close_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; - struct wait_queue *status_event_wait_q; - struct wait_queue *event_wait_q; + wait_queue_head_t status_event_wait_q; + wait_queue_head_t event_wait_q; struct timer_list tx_timer; /* HDLC transmit timeout timer */ struct mgsl_struct *next_device; /* device list link */ @@ -904,7 +904,7 @@ void* mgsl_get_text_ptr() {return mgsl_get_text_ptr;} * memory if large numbers of serial ports are open. */ static unsigned char *tmp_buf; -static struct semaphore tmp_buf_sem = MUTEX; +static DECLARE_MUTEX(tmp_buf_sem); static inline int mgsl_paranoia_check(struct mgsl_struct *info, kdev_t device, const char *routine) @@ -2724,7 +2724,7 @@ static int mgsl_wait_event(struct mgsl_struct * info, int mask) if (mask & (MgslEvent_ExitHuntMode + MgslEvent_IdleReceived)) { spin_lock_irqsave(&info->irq_spinlock,flags); - if (!info->event_wait_q) { + if (!waitqueue_active(&info->event_wait_q)) { /* disable enable exit hunt mode/idle rcvd IRQs */ regval = usc_InReg(info,RICR); usc_OutReg(info, RICR, regval & @@ -3295,7 +3295,7 @@ static void mgsl_hangup(struct tty_struct *tty) static int block_til_ready(struct tty_struct *tty, struct file * filp, struct mgsl_struct *info) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); int retval; int do_clocal = 0, extra_count = 0; unsigned long flags; @@ -4152,6 +4152,10 @@ struct mgsl_struct* mgsl_allocate_device() info->max_frame_size = 4096; info->close_delay = 5*HZ/10; info->closing_wait = 30*HZ; + init_waitqueue_head(&info->open_wait); + init_waitqueue_head(&info->close_wait); + init_waitqueue_head(&info->status_event_wait_q); + init_waitqueue_head(&info->event_wait_q); memcpy(&info->params,&default_params,sizeof(MGSL_PARAMS)); info->idle_mode = HDLC_TXIDLE_FLAGS; diff --git a/drivers/char/tpqic02.c b/drivers/char/tpqic02.c index 7dcecae4c..67b8f3a71 100644 --- a/drivers/char/tpqic02.c +++ b/drivers/char/tpqic02.c @@ -127,7 +127,7 @@ unsigned long qic02_tape_debug = TPQD_DEFAULT_FLAGS; static volatile int ctlbits = 0; /* control reg bits for tape interface */ -static struct wait_queue *qic02_tape_transfer = NULL; /* sync rw with interrupts */ +static wait_queue_t qic02_tape_transfer; /* sync rw with interrupts */ static volatile struct mtget ioctl_status; /* current generic status */ @@ -2936,6 +2936,7 @@ __initfunc(int qic02_tape_init(void)) return -ENODEV; } + init_waitqueue_head(&qic02_tape_transfer); /* prepare timer */ TIMEROFF; timer_table[QIC02_TAPE_TIMER].expires = 0; diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 113ab48ab..5007652d1 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -729,7 +729,7 @@ static ssize_t tty_write(struct file * file, const char * buf, size_t count, } /* Semaphore to protect creating and releasing a tty */ -static struct semaphore tty_sem = MUTEX; +static DECLARE_MUTEX(tty_sem); static void down_tty_sem(int index) { @@ -1930,7 +1930,9 @@ static void initialize_tty_struct(struct tty_struct *tty) tty->flip.flag_buf_ptr = tty->flip.flag_buf; tty->flip.tqueue.routine = flush_to_ldisc; tty->flip.tqueue.data = tty; - tty->flip.pty_sem = MUTEX; + init_MUTEX(&tty->flip.pty_sem); + init_waitqueue_head(&tty->write_wait); + init_waitqueue_head(&tty->read_wait); tty->tq_hangup.routine = do_tty_hangup; tty->tq_hangup.data = tty; sema_init(&tty->atomic_read, 1); diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c index 2cad9dba6..44dfbfcd8 100644 --- a/drivers/char/tty_ioctl.c +++ b/drivers/char/tty_ioctl.c @@ -42,7 +42,7 @@ void tty_wait_until_sent(struct tty_struct * tty, long timeout) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); #ifdef TTY_DEBUG_WAIT_UNTIL_SENT char buf[64]; diff --git a/drivers/char/tuner.c b/drivers/char/tuner.c index 1a96bec11..55ff8eacc 100644 --- a/drivers/char/tuner.c +++ b/drivers/char/tuner.c @@ -84,7 +84,9 @@ static struct tunertype tuners[] = { // 16*170.00,16*450.00,0xa0,0x90,0x30,0x8e,0xc2,623}, 16*170.00,16*450.00,0x02,0x04,0x01,0x8e,0xc2,623}, {"Temic 4036 FY5 NTSC", TEMIC, NTSC, - 16*157.25,16*463.25,0xa0,0x90,0x30,0x8e,0xc2,732}, + 16*157.25,16*463.25,0xa0,0x90,0x30,0x8e,0xc2,732}, + {"Alps HSBH1", TEMIC, NTSC, + 16*137.25,16*385.25,0x01,0x02,0x08,0x8e,0xc2,732}, }; /* ---------------------------------------------------------------------- */ diff --git a/drivers/char/tuner.h b/drivers/char/tuner.h index 439cc530d..afb0f10fb 100644 --- a/drivers/char/tuner.h +++ b/drivers/char/tuner.h @@ -31,6 +31,7 @@ #define TUNER_TEMIC_NTSC 6 #define TUNER_TEMIC_PAL_I 7 #define TUNER_TEMIC_4036FY5_NTSC 8 +#define TUNER_ALPS_TSBH1_NTSC 9 #define NOTUNER 0 #define PAL 1 diff --git a/drivers/char/videodev.c b/drivers/char/videodev.c index 21ed48c61..141fcf1bc 100644 --- a/drivers/char/videodev.c +++ b/drivers/char/videodev.c @@ -9,7 +9,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * - * Author: Alan Cox, <alan@cymru.net> + * Author: Alan Cox, <alan@redhat.com> * * Fixes: */ diff --git a/drivers/char/vt.c b/drivers/char/vt.c index e07a150e9..8b5fcc00c 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -1100,7 +1100,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, * while those not ready go back to sleep. Seems overkill to add a wait * to each vt just for this - usually this does nothing! */ -static struct wait_queue *vt_activate_queue = NULL; +static DECLARE_WAIT_QUEUE_HEAD(vt_activate_queue); /* * Sleeps until a vt is activated, or the task is interrupted. Returns @@ -1109,7 +1109,7 @@ static struct wait_queue *vt_activate_queue = NULL; int vt_waitactive(int vt) { int retval; - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); add_wait_queue(&vt_activate_queue, &wait); for (;;) { diff --git a/drivers/char/wdt.c b/drivers/char/wdt.c index a5e0fac4e..174175808 100644 --- a/drivers/char/wdt.c +++ b/drivers/char/wdt.c @@ -1,8 +1,8 @@ /* * Industrial Computer Source WDT500/501 driver for Linux 2.1.x * - * (c) Copyright 1996-1997 Alan Cox <alan@cymru.net>, All Rights Reserved. - * http://www.cymru.net + * (c) Copyright 1996-1997 Alan Cox <alan@redhat.com>, All Rights Reserved. + * http://www.redhat.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -15,7 +15,7 @@ * * (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk> * - * Release 0.07. + * Release 0.08. * * Fixes * Dave Gregorich : Modularisation and minor bugs @@ -24,6 +24,8 @@ * Matt Crocker). * Alan Cox : Added wdt= boot option * Alan Cox : Cleaned up copy/user stuff + * Tim Hockin : Added insmod parameters, comment cleanup + * Parameterized timeout */ #include <linux/config.h> |