summaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-07-08 02:59:00 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-07-08 02:59:00 +0000
commit1fcb7623bc138d780101d7a70cfe29b11f7c67ef (patch)
treee1ec9bb6aa19db16a405fb4393e2a90c38b4c75d /drivers/char
parent458fe58677afb17219d864e100131728038b4f1b (diff)
Merge with Linux 2.4.0-test3-pre5. 64-bit kernel are still not
-Werror clean.
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/console.c12
-rw-r--r--drivers/char/drm/proc.c2
-rw-r--r--drivers/char/n_hdlc.c80
3 files changed, 41 insertions, 53 deletions
diff --git a/drivers/char/console.c b/drivers/char/console.c
index 6e862ec53..e0c5b9064 100644
--- a/drivers/char/console.c
+++ b/drivers/char/console.c
@@ -587,10 +587,11 @@ void redraw_screen(int new_console, int is_switch)
if (redraw) {
set_origin(currcons);
- set_palette(currcons);
- if (sw->con_switch(vc_cons[currcons].d) && vcmode != KD_GRAPHICS)
+ if (sw->con_switch(vc_cons[currcons].d) && vcmode != KD_GRAPHICS) {
/* Update the screen contents */
+ set_palette(currcons);
do_update_region(currcons, origin, screenbuf_size/2);
+ }
}
set_cursor(currcons);
if (is_switch) {
@@ -2433,8 +2434,6 @@ void __init con_init(void)
* kmalloc is not running yet - we use the bootmem allocator.
*/
for (currcons = 0; currcons < MIN_NR_CONSOLES; currcons++) {
- int j, k ;
-
vc_cons[currcons].d = (struct vc_data *)
alloc_bootmem(sizeof(struct vc_data));
vt_cons[currcons] = (struct vt_struct *)
@@ -2444,11 +2443,6 @@ void __init con_init(void)
kmalloced = 0;
vc_init(currcons, video_num_lines, video_num_columns,
currcons || !sw->con_save_screen);
- for (j=k=0; j<16; j++) {
- vc_cons[currcons].d->vc_palette[k++] = default_red[j] ;
- vc_cons[currcons].d->vc_palette[k++] = default_grn[j] ;
- vc_cons[currcons].d->vc_palette[k++] = default_blu[j] ;
- }
}
currcons = fg_console = 0;
master_display_fg = vc_cons[currcons].d;
diff --git a/drivers/char/drm/proc.c b/drivers/char/drm/proc.c
index d44195539..7f85da2c9 100644
--- a/drivers/char/drm/proc.c
+++ b/drivers/char/drm/proc.c
@@ -225,7 +225,7 @@ static int _drm_queues_info(char *buf, char **start, off_t offset, int len,
atomic_inc(&q->use_count);
DRM_PROC_PRINT_RET(atomic_dec(&q->use_count),
"%5d/0x%03x %5d %5d"
- " %5d/%c%c/%c%c%c %5d %10d %10d %10d\n",
+ " %5d/%c%c/%c%c%c %5Zd %10d %10d %10d\n",
i,
q->flags,
atomic_read(&q->use_count),
diff --git a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c
index 7a0df755e..e9585bcaa 100644
--- a/drivers/char/n_hdlc.c
+++ b/drivers/char/n_hdlc.c
@@ -9,7 +9,7 @@
* Al Longyear <longyear@netcom.com>, Paul Mackerras <Paul.Mackerras@cs.anu.edu.au>
*
* Original release 01/11/99
- * ==FILEDATE 19991217==
+ * ==FILEDATE 20000706==
*
* This code is released under the GNU General Public License (GPL)
*
@@ -78,7 +78,7 @@
*/
#define HDLC_MAGIC 0x239e
-#define HDLC_VERSION "1.13"
+#define HDLC_VERSION "1.16"
#include <linux/version.h>
#include <linux/config.h>
@@ -239,6 +239,7 @@ struct n_hdlc {
/* Queues for select() functionality */
wait_queue_head_t read_wait;
wait_queue_head_t write_wait;
+ wait_queue_head_t poll_wait;
int tbusy; /* reentrancy flag for tx wakeup code */
int woke_up;
@@ -317,6 +318,7 @@ static void n_hdlc_release (struct n_hdlc *n_hdlc)
/* Ensure that the n_hdlcd process is not hanging on select()/poll() */
wake_up_interruptible (&n_hdlc->read_wait);
+ wake_up_interruptible (&n_hdlc->poll_wait);
wake_up_interruptible (&n_hdlc->write_wait);
if (tty != NULL && tty->disc_data == n_hdlc)
@@ -463,9 +465,10 @@ static void n_hdlc_send_frames (struct n_hdlc *n_hdlc, struct tty_struct *tty)
register int actual;
unsigned long flags;
N_HDLC_BUF *tbuf;
-
+
if (debuglevel >= DEBUG_LEVEL_INFO)
printk("%s(%d)n_hdlc_send_frames() called\n",__FILE__,__LINE__);
+ check_again:
save_flags(flags);
cli ();
@@ -475,6 +478,7 @@ static void n_hdlc_send_frames (struct n_hdlc *n_hdlc, struct tty_struct *tty)
return;
}
n_hdlc->tbusy = 1;
+ n_hdlc->woke_up = 0;
restore_flags(flags);
/* get current transmit buffer or get new transmit */
@@ -490,7 +494,6 @@ static void n_hdlc_send_frames (struct n_hdlc *n_hdlc, struct tty_struct *tty)
__FILE__,__LINE__,tbuf,tbuf->count);
/* Send the next block of data to device */
- n_hdlc->woke_up = 0;
tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
actual = tty->driver.write(tty, 0, tbuf->buf, tbuf->count);
@@ -512,6 +515,7 @@ static void n_hdlc_send_frames (struct n_hdlc *n_hdlc, struct tty_struct *tty)
/* wait up sleeping writers */
wake_up_interruptible(&n_hdlc->write_wait);
+ wake_up_interruptible(&n_hdlc->poll_wait);
/* get next pending transmit buffer */
tbuf = n_hdlc_buf_get(&n_hdlc->tx_buf_list);
@@ -521,11 +525,6 @@ static void n_hdlc_send_frames (struct n_hdlc *n_hdlc, struct tty_struct *tty)
__FILE__,__LINE__,tbuf);
/* buffer not accepted by driver */
-
- /* check if wake up code called since last write call */
- if (n_hdlc->woke_up)
- continue;
-
/* set this buffer as pending buffer */
n_hdlc->tbuf = tbuf;
break;
@@ -541,6 +540,9 @@ static void n_hdlc_send_frames (struct n_hdlc *n_hdlc, struct tty_struct *tty)
n_hdlc->tbusy = 0;
restore_flags(flags);
+ if (n_hdlc->woke_up)
+ goto check_again;
+
if (debuglevel >= DEBUG_LEVEL_INFO)
printk("%s(%d)n_hdlc_send_frames() exit\n",__FILE__,__LINE__);
@@ -568,11 +570,8 @@ static void n_hdlc_tty_wakeup (struct tty_struct *tty)
tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP);
return;
}
-
- if (!n_hdlc->tbuf)
- tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP);
- else
- n_hdlc_send_frames (n_hdlc, tty);
+
+ n_hdlc_send_frames (n_hdlc, tty);
} /* end of n_hdlc_tty_wakeup() */
@@ -659,11 +658,12 @@ static void n_hdlc_tty_receive(struct tty_struct *tty,
/* wake up any blocked reads and perform async signalling */
wake_up_interruptible (&n_hdlc->read_wait);
+ wake_up_interruptible (&n_hdlc->poll_wait);
if (n_hdlc->tty->fasync != NULL)
#if LINUX_VERSION_CODE < VERSION(2,3,0)
kill_fasync (n_hdlc->tty->fasync, SIGIO);
#else
- kill_fasync(&n_hdlc->tty->fasync, SIGIO, POLL_IN);
+ kill_fasync (&n_hdlc->tty->fasync, SIGIO, POLL_IN);
#endif
} /* end of n_hdlc_tty_receive() */
@@ -788,34 +788,31 @@ static rw_ret_t n_hdlc_tty_write (struct tty_struct *tty, struct file *file,
count = maxframe;
}
+ add_wait_queue(&n_hdlc->write_wait, &wait);
+ set_current_state(TASK_INTERRUPTIBLE);
+
/* Allocate transmit buffer */
- tbuf = n_hdlc_buf_get(&n_hdlc->tx_free_buf_list);
- if (!tbuf) {
- /* sleep until transmit buffer available */
- add_wait_queue(&n_hdlc->write_wait, &wait);
- while (!tbuf) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule();
-
- n_hdlc = tty2n_hdlc (tty);
- if (!n_hdlc || n_hdlc->magic != HDLC_MAGIC ||
- tty != n_hdlc->tty) {
- printk("n_hdlc_tty_write: %p invalid after wait!\n", n_hdlc);
- error = -EIO;
- break;
- }
+ /* sleep until transmit buffer available */
+ while (!(tbuf = n_hdlc_buf_get(&n_hdlc->tx_free_buf_list))) {
+ schedule();
- if (signal_pending(current)) {
- error = -EINTR;
- break;
- }
+ n_hdlc = tty2n_hdlc (tty);
+ if (!n_hdlc || n_hdlc->magic != HDLC_MAGIC ||
+ tty != n_hdlc->tty) {
+ printk("n_hdlc_tty_write: %p invalid after wait!\n", n_hdlc);
+ error = -EIO;
+ break;
+ }
- tbuf = n_hdlc_buf_get(&n_hdlc->tx_free_buf_list);
+ if (signal_pending(current)) {
+ error = -EINTR;
+ break;
}
- set_current_state(TASK_RUNNING);
- remove_wait_queue(&n_hdlc->write_wait, &wait);
}
+ set_current_state(TASK_RUNNING);
+ remove_wait_queue(&n_hdlc->write_wait, &wait);
+
if (!error) {
/* Retrieve the user's buffer */
COPY_FROM_USER (error, tbuf->buf, data, count);
@@ -978,8 +975,6 @@ static int n_hdlc_tty_select (struct tty_struct *tty, struct inode *inode,
* Return Value:
*
* bit mask containing info on which ops will not block
- *
- * Note: Called without the kernel lock held. Which is fine.
*/
static unsigned int n_hdlc_tty_poll (struct tty_struct *tty,
struct file *filp, poll_table * wait)
@@ -994,11 +989,9 @@ static unsigned int n_hdlc_tty_poll (struct tty_struct *tty,
/* queue current process into any wait queue that */
/* may awaken in the future (read and write) */
#if LINUX_VERSION_CODE < VERSION(2,1,89)
- poll_wait(&n_hdlc->read_wait, wait);
- poll_wait(&n_hdlc->write_wait, wait);
+ poll_wait(&n_hdlc->poll_wait, wait);
#else
- poll_wait(filp, &n_hdlc->read_wait, wait);
- poll_wait(filp, &n_hdlc->write_wait, wait);
+ poll_wait(filp, &n_hdlc->poll_wait, wait);
#endif
/* set bits for operations that wont block */
if(n_hdlc->rx_buf_list.head)
@@ -1062,6 +1055,7 @@ static struct n_hdlc *n_hdlc_alloc (void)
n_hdlc->flags = 0;
init_waitqueue_head(&n_hdlc->read_wait);
+ init_waitqueue_head(&n_hdlc->poll_wait);
init_waitqueue_head(&n_hdlc->write_wait);
return n_hdlc;