tty: tty_port: Move the IO_ERROR clear
[safe/jmp/linux-2.6] / drivers / char / hvc_console.h
index ec0e9bb..10950ca 100644 (file)
@@ -27,6 +27,8 @@
 #ifndef HVC_CONSOLE_H
 #define HVC_CONSOLE_H
 #include <linux/kref.h>
+#include <linux/tty.h>
+#include <linux/spinlock.h>
 
 /*
  * This is the max number of console adapters that can/will be found as
@@ -47,7 +49,7 @@ struct hvc_struct {
        spinlock_t lock;
        int index;
        struct tty_struct *tty;
-       unsigned int count;
+       int count;
        int do_wakeup;
        char *outbuf;
        int outbuf_size;
@@ -56,6 +58,8 @@ struct hvc_struct {
        struct hv_ops *ops;
        int irq_requested;
        int data;
+       struct winsize ws;
+       struct work_struct tty_resize;
        struct list_head next;
        struct kref kref; /* ref count & hvc_struct lifetime */
 };
@@ -78,12 +82,24 @@ extern int hvc_instantiate(uint32_t vtermno, int index, struct hv_ops *ops);
 extern struct hvc_struct * __devinit hvc_alloc(uint32_t vtermno, int data,
                                struct hv_ops *ops, int outbuf_size);
 /* remove a vterm from hvc tty operation (module_exit or hotplug remove) */
-extern int __devexit hvc_remove(struct hvc_struct *hp);
+extern int hvc_remove(struct hvc_struct *hp);
 
 /* data available */
 int hvc_poll(struct hvc_struct *hp);
 void hvc_kick(void);
 
+/* Resize hvc tty terminal window */
+extern void __hvc_resize(struct hvc_struct *hp, struct winsize ws);
+
+static inline void hvc_resize(struct hvc_struct *hp, struct winsize ws)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&hp->lock, flags);
+       __hvc_resize(hp, ws);
+       spin_unlock_irqrestore(&hp->lock, flags);
+}
+
 /* default notifier for irq based notification */
 extern int notifier_add_irq(struct hvc_struct *hp, int data);
 extern void notifier_del_irq(struct hvc_struct *hp, int data);