patch-2.3.29 linux/net/irda/iriap.c

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

diff -u --recursive --new-file v2.3.28/linux/net/irda/iriap.c linux/net/irda/iriap.c
@@ -6,7 +6,7 @@
  * Status:        Experimental.
  * Author:        Dag Brattli <dagb@cs.uit.no>
  * Created at:    Thu Aug 21 00:02:07 1997
- * Modified at:   Sun Oct 31 22:10:45 1999
+ * Modified at:   Fri Nov  5 20:25:42 1999
  * Modified by:   Dag Brattli <dagb@cs.uit.no>
  * 
  *     Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>, 
@@ -100,7 +100,7 @@
 	 *  Register some default services for IrLMP 
 	 */
 	hints  = irlmp_service_to_hint(S_COMPUTER);
-	hints |= irlmp_service_to_hint(S_PNP);
+	/*hints |= irlmp_service_to_hint(S_PNP);*/
 	service_handle = irlmp_register_service(hints);
 
 	/* 
@@ -267,19 +267,16 @@
 	if (self->mode == IAS_CLIENT) {
 		IRDA_DEBUG(4, __FUNCTION__ "(), disconnect as client\n");
 
+
+		iriap_do_client_event(self, IAP_LM_DISCONNECT_INDICATION, 
+				      NULL);
 		/* 
 		 * Inform service user that the request failed by sending 
-		 * it a NULL value.
+		 * it a NULL value. Warning, the client might close us, so
+		 * remember no to use self anymore after calling confirm
 		 */
 		if (self->confirm)
  			self->confirm(IAS_DISCONNECT, 0, NULL, self->priv);
-		
-		
-		iriap_do_client_event(self, IAP_LM_DISCONNECT_INDICATION, 
-				      NULL);
-		/* Close instance only if client */
-		/* iriap_close(self); */
-		
 	} else {
 		IRDA_DEBUG(4, __FUNCTION__ "(), disconnect as server\n");
 		iriap_do_server_event(self, IAP_LM_DISCONNECT_INDICATION, 
@@ -497,6 +494,9 @@
 	/* Finished, close connection! */
 	iriap_disconnect_request(self);
 
+	/* Warning, the client might close us, so remember no to use self
+	 * anymore after calling confirm 
+	 */
 	if (self->confirm)
 		self->confirm(IAS_SUCCESS, obj_id, value, self->priv);
 }
@@ -794,7 +794,11 @@
 			WARNING(__FUNCTION__ "(), No such class!\n");
 			/* Finished, close connection! */
 			iriap_disconnect_request(self);
-			
+
+			/* 
+			 * Warning, the client might close us, so remember
+			 * no to use self anymore after calling confirm 
+			 */
 			if (self->confirm)
 				self->confirm(IAS_CLASS_UNKNOWN, 0, NULL, 
 					      self->priv);
@@ -804,13 +808,15 @@
 		       	/* Finished, close connection! */
 			iriap_disconnect_request(self);
 
+			/* 
+			 * Warning, the client might close us, so remember
+			 * no to use self anymore after calling confirm 
+			 */
 			if (self->confirm)
 				self->confirm(IAS_CLASS_UNKNOWN, 0, NULL, 
 					      self->priv);
 			break;
-		}
-		
-	/* 	iriap_close(self); */
+		}		
 		break;
 	default:
 		IRDA_DEBUG(0, __FUNCTION__ "(), Unknown op-code: %02x\n", 
@@ -883,7 +889,7 @@
 	"IAS_STRING"
 };
 
-int irias_proc_read(char *buf, char **start, off_t offset, int len, int unused)
+int irias_proc_read(char *buf, char **start, off_t offset, int len)
 {
 	struct ias_object *obj;
 	struct ias_attrib *attrib;

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