Merge branches 'battery-2.6.34', 'bugzilla-10805', 'bugzilla-14668', 'bugzilla-531916...
[deliverable/linux.git] / include / linux / serial_core.h
index 8c3dd36fe91a741a5edc3b96a9c01f094ca15334..78dd1e7120a98bec0960f5aa63d3f499f3b2e336 100644 (file)
@@ -491,9 +491,13 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
 {
        struct uart_state *state = uport->state;
        struct tty_port *port = &state->port;
+       struct tty_ldisc *ld = tty_ldisc_ref(port->tty);
+       struct timespec ts;
 
-       uport->icount.dcd++;
+       if (ld && ld->ops->dcd_change)
+               getnstimeofday(&ts);
 
+       uport->icount.dcd++;
 #ifdef CONFIG_HARD_PPS
        if ((uport->flags & UPF_HARDPPS_CD) && status)
                hardpps();
@@ -505,6 +509,11 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
                else if (port->tty)
                        tty_hangup(port->tty);
        }
+
+       if (ld && ld->ops->dcd_change)
+               ld->ops->dcd_change(port->tty, status, &ts);
+       if (ld)
+               tty_ldisc_deref(ld);
 }
 
 /**
This page took 0.029012 seconds and 5 git commands to generate.