Commit fc362e2e0efd8b652ebfb409a4e43e6189c04f6f
Committed by
Benjamin Herrenschmidt
1 parent
a02efb906d
Exists in
master
and in
39 other branches
hvc_console: Add a hangup notifier for backends
I have added a hangup notifier that can be used by hvc console backends to handle a tty hangup. The default irq hangup notifier calls the notifier_del_irq() for compatibility. Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Showing 7 changed files with 14 additions and 3 deletions Side-by-side Diff
drivers/char/hvc_console.c
... | ... | @@ -418,8 +418,8 @@ |
418 | 418 | |
419 | 419 | spin_unlock_irqrestore(&hp->lock, flags); |
420 | 420 | |
421 | - if (hp->ops->notifier_del) | |
422 | - hp->ops->notifier_del(hp, hp->data); | |
421 | + if (hp->ops->notifier_hangup) | |
422 | + hp->ops->notifier_hangup(hp, hp->data); | |
423 | 423 | |
424 | 424 | while(temp_open_count) { |
425 | 425 | --temp_open_count; |
drivers/char/hvc_console.h
... | ... | @@ -65,9 +65,10 @@ |
65 | 65 | int (*get_chars)(uint32_t vtermno, char *buf, int count); |
66 | 66 | int (*put_chars)(uint32_t vtermno, const char *buf, int count); |
67 | 67 | |
68 | - /* Callbacks for notification. Called in open and close */ | |
68 | + /* Callbacks for notification. Called in open, close and hangup */ | |
69 | 69 | int (*notifier_add)(struct hvc_struct *hp, int irq); |
70 | 70 | void (*notifier_del)(struct hvc_struct *hp, int irq); |
71 | + void (*notifier_hangup)(struct hvc_struct *hp, int irq); | |
71 | 72 | }; |
72 | 73 | |
73 | 74 | /* Register a vterm and a slot index for use as a console (console_init) */ |
... | ... | @@ -86,6 +87,7 @@ |
86 | 87 | /* default notifier for irq based notification */ |
87 | 88 | extern int notifier_add_irq(struct hvc_struct *hp, int data); |
88 | 89 | extern void notifier_del_irq(struct hvc_struct *hp, int data); |
90 | +extern void notifier_hangup_irq(struct hvc_struct *hp, int data); | |
89 | 91 | |
90 | 92 | |
91 | 93 | #if defined(CONFIG_XMON) && defined(CONFIG_SMP) |
drivers/char/hvc_irq.c
drivers/char/hvc_iseries.c
drivers/char/hvc_vio.c
drivers/char/hvc_xen.c
drivers/char/virtio_console.c
... | ... | @@ -198,6 +198,7 @@ |
198 | 198 | virtio_cons.put_chars = put_chars; |
199 | 199 | virtio_cons.notifier_add = notifier_add_vio; |
200 | 200 | virtio_cons.notifier_del = notifier_del_vio; |
201 | + virtio_cons.notifier_hangup = notifier_del_vio; | |
201 | 202 | |
202 | 203 | /* The first argument of hvc_alloc() is the virtual console number, so |
203 | 204 | * we use zero. The second argument is the parameter for the |