aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/irnet/irnet_irda.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-04-26 04:31:28 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2007-04-26 04:31:28 -0400
commitef2e58ea6b9931c3a4816c66593da49bb20e3b24 (patch)
treece7432add3becbe78de4ea06425cd2d9e91f4ada /net/irda/irnet/irnet_irda.c
parent06d63cc51d47f572009138a7f3ac34d95773405d (diff)
parentde46c33745f5e2ad594c72f2cf5f490861b16ce1 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'net/irda/irnet/irnet_irda.c')
-rw-r--r--net/irda/irnet/irnet_irda.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/net/irda/irnet/irnet_irda.c b/net/irda/irnet/irnet_irda.c
index c378e668af0c..a4f1439ffdd8 100644
--- a/net/irda/irnet/irnet_irda.c
+++ b/net/irda/irnet/irnet_irda.c
@@ -10,6 +10,27 @@
10 10
11#include "irnet_irda.h" /* Private header */ 11#include "irnet_irda.h" /* Private header */
12 12
13/*
14 * PPP disconnect work: we need to make sure we're in
15 * process context when calling ppp_unregister_channel().
16 */
17static void irnet_ppp_disconnect(struct work_struct *work)
18{
19 irnet_socket * self =
20 container_of(work, irnet_socket, disconnect_work);
21
22 if (self == NULL)
23 return;
24 /*
25 * If we were connected, cleanup & close the PPP
26 * channel, which will kill pppd (hangup) and the rest.
27 */
28 if (self->ppp_open && !self->ttp_open && !self->ttp_connect) {
29 ppp_unregister_channel(&self->chan);
30 self->ppp_open = 0;
31 }
32}
33
13/************************* CONTROL CHANNEL *************************/ 34/************************* CONTROL CHANNEL *************************/
14/* 35/*
15 * When ppp is not active, /dev/irnet act as a control channel. 36 * When ppp is not active, /dev/irnet act as a control channel.
@@ -499,6 +520,8 @@ irda_irnet_create(irnet_socket * self)
499#endif /* DISCOVERY_NOMASK */ 520#endif /* DISCOVERY_NOMASK */
500 self->tx_flow = FLOW_START; /* Flow control from IrTTP */ 521 self->tx_flow = FLOW_START; /* Flow control from IrTTP */
501 522
523 INIT_WORK(&self->disconnect_work, irnet_ppp_disconnect);
524
502 DEXIT(IRDA_SOCK_TRACE, "\n"); 525 DEXIT(IRDA_SOCK_TRACE, "\n");
503 return(0); 526 return(0);
504} 527}
@@ -1134,15 +1157,8 @@ irnet_disconnect_indication(void * instance,
1134 { 1157 {
1135 if(test_open) 1158 if(test_open)
1136 { 1159 {
1137#ifdef MISSING_PPP_API 1160 /* ppp_unregister_channel() wants a user context. */
1138 /* ppp_unregister_channel() wants a user context, which we 1161 schedule_work(&self->disconnect_work);
1139 * are guaranteed to NOT have here. What are we supposed
1140 * to do here ? Jean II */
1141 /* If we were connected, cleanup & close the PPP channel,
1142 * which will kill pppd (hangup) and the rest */
1143 ppp_unregister_channel(&self->chan);
1144 self->ppp_open = 0;
1145#endif
1146 } 1162 }
1147 else 1163 else
1148 { 1164 {