[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [PATCH] Fix kdenetwork/wifi compilation with iwlib27
From:       Dominique Devriese <dominique.devriese () student ! kuleuven ! ac ! be>
Date:       2004-02-27 21:07:13
Message-ID: 87r7wgz0xq.fsf () student ! kuleuven ! ac ! be
[Download RAW message or body]

Hi,

Can anyone please review the following kdenetwork patch ?  It fixes
kdenetwork/wifi compilation with iwlib27 ( which broke backwards
compatibility ).  Note that I have no idea what the iw_range parameter
is, but from the code in the wireless-tools iwlib.c source, I am sure
that it is never used unless has_range is set to non-zero.  As said in
the comment above my modification, someone who knows more about this
code should look into the new interface.

As usual, this patch compiles for me, unless anyone objects, I am
going to commit this to 3_2_BRANCH and HEAD.

cheers
domi


[Attachment #3 (text/x-patch)]

Index: wifi/wirelesstools.cpp
===================================================================
RCS file: /home/kde/kdenetwork/wifi/Attic/wirelesstools.cpp,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 wirelesstools.cpp
--- wifi/wirelesstools.cpp	14 Feb 2004 10:34:10 -0000	1.1.2.1
+++ wifi/wirelesstools.cpp	27 Feb 2004 21:00:36 -0000
@@ -11,6 +11,21 @@
 #include "stuff.h"
 #include "wirelesstools.h"
 
+// domi:the wireless-tools people managed to change their interfaces
+// around.  Someone with more knowledge of this code should look into
+// moving to use the new iw_range interfaces.
+#if WT_VERSION >= 27
+inline int wtc_private_iw_get_stats( int skfd, char* ifname, iwstats* stats )
+{
+  return iw_get_stats( skfd, ifname, stats, 0, 0 );
+}
+#else
+inline int wtc_private_iw_get_stats( int skfd, char* ifname, iwstats* stats )
+{
+  return iw_get_stats( skfd, ifname, stats, 0, 0 );
+}
+#endif
+
 /* ================================== FROM IWCONFIG.C ================================== */
 int get_info(int skfd, char * ifname, struct wireless_info * info)
 {
@@ -154,7 +169,7 @@
 #endif	/* WIRELESS_EXT > 10 */
 
   /* Get stats */
-  if(iw_get_stats(skfd, ifname, &(info->stats)) >= 0)
+  if(wtc_private_iw_get_stats(skfd, ifname, &(info->stats)) >= 0)
     {
       info->has_stats = 1;
     }
@@ -198,7 +213,7 @@
 	    {
 	      char device[128];
 	      snprintf(device,128,"%s",(*it).latin1());
-	      iw_get_stats (transfer->skfd, device, tempic2);
+	      wtc_private_iw_get_stats (transfer->skfd, device, tempic2);
 	      kdDebug() << "Found!\n";
         already_warned=false;
 	      transfer->has_freq = tempic1->has_freq;
@@ -258,7 +273,7 @@
 	{
 	  char device[128];
 	  snprintf(device,128,"%s",transfer->used_interface.latin1());
-	  iw_get_stats (transfer->skfd, device, tempic2);
+	  wtc_private_iw_get_stats (transfer->skfd, device, tempic2);
 	  transfer->has_freq = tempic1->has_freq;
 	  transfer->freq = tempic1->freq;
 	  transfer->mode = tempic1->mode;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic