Re: [PATCH 4/5] tty: n_gsm: initiate close of all DLCIs during muxshutdown

From: Alan Cox
Date: Fri Jun 03 2011 - 18:03:24 EST


On Fri, 3 Jun 2011 12:03:40 -0700
Russ Gorby <russ.gorby@xxxxxxxxx> wrote:

> Although DLCI-0 is closed during ldisc close, we found the
> applications were better served when open DLCI shutdowns where
> initiated at that time as well.

They should all see a hangup on the gsm client tty anyway ?

> - for (i = 0; i < NUM_DLCI; i++)
> + for (i = NUM_DLCI-1; i >= 0; i--) {
> + dlci = gsm->dlci[i];
> + if (dlci) {
> + if (i != 0)
> + gsm_dlci_begin_close(dlci);
> + else {
> + dlci->dead = 1;
> + gsm_dlci_begin_close(dlci);
> + t = wait_event_timeout(gsm->event,
> + dlci->state == DLCI_CLOSED,
> + gsm->t2 * HZ / 100);
> + if (!t) {
> + pr_info("%s: timeout dlci0 close",
> + __func__);
> + gsm_dlci_close(dlci);
> + }
> + }
> + }
> + }
> + for (i = NUM_DLCI-1; i >= 0; i--)

I'd like to understand better why it is needed and also why you don't
want for the others to close but just set it off ?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/