This is needed by ./net/bluetooth/rfcomm/tty.c
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
extern void tty_port_tty_wakeup(struct tty_port *port);
+extern void tty_port_tty_hangup(struct tty_port *port, bool check_clocal);
#endif
#endif /* __BACKPORT_LINUX_TTY_H */
}
}
EXPORT_SYMBOL_GPL(tty_port_tty_wakeup);
+
+/**
+ * tty_port_tty_hangup - helper to hang up a tty
+ *
+ * @port: tty port
+ * @check_clocal: hang only ttys with CLOCAL unset?
+ */
+void tty_port_tty_hangup(struct tty_port *port, bool check_clocal)
+{
+ struct tty_struct *tty = tty_port_tty_get(port);
+
+ if (tty && (!check_clocal || !C_CLOCAL(tty)))
+ tty_hangup(tty);
+ tty_kref_put(tty);
+}
+EXPORT_SYMBOL_GPL(tty_port_tty_hangup);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)) */