[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linux-ATM-General] Removal of atm_dev->vccs



try this diff for the cnx driver:

--- KernelModule/CardMgmt.c.000	2003-12-03 10:37:15.000000000 -0500
+++ KernelModule/CardMgmt.c	2003-12-03 10:43:48.000000000 -0500
@@ -1516,7 +1516,8 @@
 {
 	int RetBytes = 0;
 	int State = *pPOS;
-	int VCIndex;
+	int VCIndex, nVccs = 0;
+	struct sock *s
 	char Buffer[sizeof(TIG_DEVICE_SPEC_T) + sizeof(BACK_DOOR_T)];
 	TIG_DEVICE_SPEC_T  *pDevSpecific=(TIG_DEVICE_SPEC_T*)Buffer;
 	BACK_DOOR_T        *pBackDoorBuf=(BACK_DOOR_T*)pDevSpecific->BackDoorBuf;
@@ -1600,21 +1601,21 @@
 		}
  
 		// display the connection info
-		if ( pDev->vccs )
-		{
-			struct atm_vcc* pVcc = pDev->vccs;
-			RetBytes += sprintf(pPage+RetBytes,"ATM Virtual Channel IDs: VPI: %d   VCI: %d\n\n",
+		read_lock(&vcc_sklist_lock);
+		for (s = vcc_sklist; s; s = s->next) {
+			struct atm_vcc* pVcc = s->protinfo.af_atm;
+			if (pVcc->dev != pDev)
+				continue;
+
+			if (nVccs == 0)
+				RetBytes += sprintf(pPage+RetBytes,"ATM Virtual Channel IDs: VPI: %d   VCI: %d\n\n",
 								pVcc->vpi,pVcc->vci);
-			pVcc = pVcc->next;
-			
-			while ( pVcc )
-			{
-				RetBytes += sprintf(pPage+RetBytes,"                         VPI: %d   VCI: %d\n\n",
+			++nVccs;
+			RetBytes += sprintf(pPage+RetBytes,"                         VPI: %d   VCI: %d\n\n",
 									pVcc->vpi,pVcc->vci);
-				pVcc = pVcc->next;
-			}					
 		}
-		else
+		read_unlock(&vcc_sklist_lock);
+		if (nVccs == 0)
 			RetBytes += sprintf(pPage+RetBytes,"ATM Virtual Channel IDs: no connections open\n\n");
 				
 		return RetBytes;


-------------------------------------------------------
This SF.net email is sponsored by OSDN's Audience Survey.
Help shape OSDN's sites and tell us what you think. Take this
five minute survey and you could win a $250 Gift Certificate.
http://www.wrgsurveys.com/2003/osdntech03.php?site=8
_______________________________________________
Linux-atm-general mailing list
Linux-atm-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-atm-general