patch-2.3.26 linux/net/irda/irlan/irlan_client.c

Next file: linux/net/irda/irlan/irlan_client_event.c
Previous file: linux/net/irda/iriap_event.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.25/linux/net/irda/irlan/irlan_client.c linux/net/irda/irlan/irlan_client.c
@@ -6,7 +6,7 @@
  * Status:        Experimental.
  * Author:        Dag Brattli <dagb@cs.uit.no>
  * Created at:    Sun Aug 31 20:14:37 1997
- * Modified at:   Thu Jul  8 13:50:16 1999
+ * Modified at:   Sun Oct 31 19:44:41 1999
  * Modified by:   Dag Brattli <dagb@cs.uit.no>
  * Sources:       skeleton.c by Donald Becker <becker@CESDIS.gsfc.nasa.gov>
  *                slip.c by Laurence Culhane, <loz@holmes.demon.co.uk>
@@ -71,7 +71,7 @@
 {
 	struct irlan_cb *self = (struct irlan_cb *) data;
 	
-	DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, __FUNCTION__ "()\n");
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -90,7 +90,7 @@
 
 void irlan_client_start_kick_timer(struct irlan_cb *self, int timeout)
 {
-	DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 	
 	irda_start_timer(&self->client.kick_timer, timeout, (void *) self, 
 			 irlan_client_kick_timer_expired);
@@ -106,7 +106,7 @@
 {
 	struct irmanager_event mgr_event;
 
-	DEBUG(1, __FUNCTION__ "()\n");
+	IRDA_DEBUG(1, __FUNCTION__ "()\n");
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -168,7 +168,7 @@
 	struct irlan_cb *self;
 	__u32 saddr, daddr;
 	
-	DEBUG(1, __FUNCTION__"()\n");
+	IRDA_DEBUG(1, __FUNCTION__"()\n");
 
 	ASSERT(irlan != NULL, return;);
 	ASSERT(discovery != NULL, return;);
@@ -183,7 +183,7 @@
       	if (self) {
 		ASSERT(self->magic == IRLAN_MAGIC, return;);
 
-		DEBUG(1, __FUNCTION__ "(), Found instance (%08x)!\n",
+		IRDA_DEBUG(1, __FUNCTION__ "(), Found instance (%08x)!\n",
 		      daddr);
 		
 		irlan_client_wakeup(self, saddr, daddr);
@@ -194,7 +194,7 @@
 	/* 
 	 * We have no instance for daddr, so start a new one
 	 */
-	DEBUG(1, __FUNCTION__ "(), starting new instance!\n");
+	IRDA_DEBUG(1, __FUNCTION__ "(), starting new instance!\n");
 	self = irlan_open(saddr, daddr, TRUE);
 
 	/* Restart watchdog timer */
@@ -212,7 +212,7 @@
 {
 	struct irlan_cb *self;
 	
-	DEBUG(2, __FUNCTION__ "()\n");
+	IRDA_DEBUG(2, __FUNCTION__ "()\n");
 	
 	self = (struct irlan_cb *) instance;
 	
@@ -223,7 +223,7 @@
 	irlan_do_client_event(self, IRLAN_DATA_INDICATION, skb); 
 
 	/* Ready for a new command */	
-	DEBUG(2, __FUNCTION__ "(), clearing tx_busy\n");
+	IRDA_DEBUG(2, __FUNCTION__ "(), clearing tx_busy\n");
 	self->client.tx_busy = FALSE;
 
 	/* Check if we have some queued commands waiting to be sent */
@@ -240,7 +240,7 @@
 	struct tsap_cb *tsap;
 	struct sk_buff *skb;
 
-	DEBUG(4, __FUNCTION__ "(), reason=%d\n", reason);
+	IRDA_DEBUG(4, __FUNCTION__ "(), reason=%d\n", reason);
 	
 	self = (struct irlan_cb *) instance;
 	tsap = (struct tsap_cb *) sap;
@@ -272,7 +272,7 @@
 	struct tsap_cb *tsap;
 	notify_t notify;
 
-	DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -292,7 +292,7 @@
 	
 	tsap = irttp_open_tsap(LSAP_ANY, DEFAULT_INITIAL_CREDIT, &notify);
 	if (!tsap) {
-		DEBUG(2, __FUNCTION__ "(), Got no tsap!\n");
+		IRDA_DEBUG(2, __FUNCTION__ "(), Got no tsap!\n");
 		return;
 	}
 	self->client.tsap_ctrl = tsap;
@@ -312,7 +312,7 @@
 {
 	struct irlan_cb *self;
 
-	DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
 	self = (struct irlan_cb *) instance;
 
@@ -338,7 +338,7 @@
 	struct sk_buff *skb;
 	__u8 *frame;
 		
-	DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -381,7 +381,7 @@
 
 	ASSERT(skb != NULL, return;);	
 	
-	DEBUG(4, __FUNCTION__ "() skb->len=%d\n", (int) skb->len);
+	IRDA_DEBUG(4, __FUNCTION__ "() skb->len=%d\n", (int) skb->len);
 	
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -412,7 +412,7 @@
 	/* How many parameters? */
 	count = frame[1];
 
-	DEBUG(4, __FUNCTION__ "(), got %d parameters\n", count);
+	IRDA_DEBUG(4, __FUNCTION__ "(), got %d parameters\n", count);
 	
 	ptr = frame+2;
 
@@ -420,7 +420,7 @@
  	for (i=0; i<count;i++) {
 		ret = irlan_extract_param(ptr, name, value, &val_len);
 		if (ret < 0) {
-			DEBUG(2, __FUNCTION__ "(), IrLAN, Error!\n");
+			IRDA_DEBUG(2, __FUNCTION__ "(), IrLAN, Error!\n");
 			break;
 		}
 		ptr += ret;
@@ -444,7 +444,7 @@
 	__u8 *bytes;
 	int i;
 
-	DEBUG(4, __FUNCTION__ "(), parm=%s\n", param);
+	IRDA_DEBUG(4, __FUNCTION__ "(), parm=%s\n", param);
 
 	ASSERT(self != NULL, return;);
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -484,14 +484,14 @@
 		else if (strcmp(value, "HOSTED") == 0)
 			self->client.access_type = ACCESS_HOSTED;
 		else {
-			DEBUG(2, __FUNCTION__ "(), unknown access type!\n");
+			IRDA_DEBUG(2, __FUNCTION__ "(), unknown access type!\n");
 		}
 	}
 	/*
 	 *  IRLAN version
 	 */
 	if (strcmp(param, "IRLAN_VER") == 0) {
-		DEBUG(4, "IrLAN version %d.%d\n", (__u8) value[0], 
+		IRDA_DEBUG(4, "IrLAN version %d.%d\n", (__u8) value[0], 
 		      (__u8) value[1]);
 
 		self->version[0] = value[0];
@@ -503,41 +503,41 @@
 	 */
 	if (strcmp(param, "DATA_CHAN") == 0) {
 		self->dtsap_sel_data = value[0];
-		DEBUG(4, "Data TSAP = %02x\n", self->dtsap_sel_data);
+		IRDA_DEBUG(4, "Data TSAP = %02x\n", self->dtsap_sel_data);
 		return;
 	}
 	if (strcmp(param, "CON_ARB") == 0) {
 		memcpy(&tmp_cpu, value, 2); /* Align value */
 		le16_to_cpus(&tmp_cpu);     /* Convert to host order */
 		self->client.recv_arb_val = tmp_cpu;
-		DEBUG(2, __FUNCTION__ "(), receive arb val=%d\n", 
-		      self->client.recv_arb_val);
+		IRDA_DEBUG(2, __FUNCTION__ "(), receive arb val=%d\n", 
+			   self->client.recv_arb_val);
 	}
 	if (strcmp(param, "MAX_FRAME") == 0) {
 		memcpy(&tmp_cpu, value, 2); /* Align value */
 		le16_to_cpus(&tmp_cpu);     /* Convert to host order */
 		self->client.max_frame = tmp_cpu;
-		DEBUG(4, __FUNCTION__ "(), max frame=%d\n", 
-		      self->client.max_frame);
+		IRDA_DEBUG(4, __FUNCTION__ "(), max frame=%d\n", 
+			   self->client.max_frame);
 	}
 	 
 	/*
 	 *  RECONNECT_KEY, in case the link goes down!
 	 */
 	if (strcmp(param, "RECONNECT_KEY") == 0) {
-		DEBUG(4, "Got reconnect key: ");
+		IRDA_DEBUG(4, "Got reconnect key: ");
 		/* for (i = 0; i < val_len; i++) */
 /* 			printk("%02x", value[i]); */
 		memcpy(self->client.reconnect_key, value, val_len);
 		self->client.key_len = val_len;
-		DEBUG(4, "\n");
+		IRDA_DEBUG(4, "\n");
 	}
 	/*
 	 *  FILTER_ENTRY, have we got an ethernet address?
 	 */
 	if (strcmp(param, "FILTER_ENTRY") == 0) {
 		bytes = value;
-		DEBUG(4, "Ethernet address = %02x:%02x:%02x:%02x:%02x:%02x\n",
+		IRDA_DEBUG(4, "Ethernet address = %02x:%02x:%02x:%02x:%02x:%02x\n",
 		      bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], 
 		      bytes[5]);
 		for (i = 0; i < 6; i++) 
@@ -556,16 +556,20 @@
 {
 	struct irlan_cb *self;
 	
-	DEBUG(4, __FUNCTION__ "()\n");
+	IRDA_DEBUG(4, __FUNCTION__ "()\n");
 
 	ASSERT(priv != NULL, return;);
 
 	self = (struct irlan_cb *) priv;
 	ASSERT(self->magic == IRLAN_MAGIC, return;);
 
+	/* We probably don't need to make any more queries */
+	iriap_close(self->client.iriap);
+	self->client.iriap = NULL;
+
 	/* Check if request succeeded */
 	if (result != IAS_SUCCESS) {
-		DEBUG(2, __FUNCTION__ "(), got NULL value!\n");
+		IRDA_DEBUG(2, __FUNCTION__ "(), got NULL value!\n");
 		irlan_do_client_event(self, IRLAN_IAS_PROVIDER_NOT_AVAIL, 
 				      NULL);
 		return;
@@ -582,16 +586,17 @@
 		}
 		break;
 	case IAS_STRING:
-		DEBUG(2, __FUNCTION__ "(), got string %s\n", value->t.string);
+		IRDA_DEBUG(2, __FUNCTION__ "(), got string %s\n", 
+			   value->t.string);
 		break;
 	case IAS_OCT_SEQ:
-		DEBUG(2, __FUNCTION__ "(), OCT_SEQ not implemented\n");
+		IRDA_DEBUG(2, __FUNCTION__ "(), OCT_SEQ not implemented\n");
 		break;
 	case IAS_MISSING:
-		DEBUG(2, __FUNCTION__ "(), MISSING not implemented\n");
+		IRDA_DEBUG(2, __FUNCTION__ "(), MISSING not implemented\n");
 		break;
 	default:
-		DEBUG(2, __FUNCTION__ "(), unknown type!\n");
+		IRDA_DEBUG(2, __FUNCTION__ "(), unknown type!\n");
 		break;
 	}
 	irlan_do_client_event(self, IRLAN_IAS_PROVIDER_NOT_AVAIL, NULL);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)