summaryrefslogtreecommitdiff
path: root/libopie2/opienet/onetwork.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opienet/onetwork.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index 05513f8..1deb051 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -31,3 +31,2 @@
/* OPIE */
-
#include <opie2/onetwork.h>
@@ -35,5 +34,5 @@
#include <opie2/odebug.h>
+using namespace Opie::Core;
/* QT */
-
#include <qfile.h>
@@ -42,4 +41,3 @@
-/* UNIX */
-
+/* STD */
#include <assert.h>
@@ -47,2 +45,3 @@
#include <errno.h>
+#include <stdarg.h>
#include <string.h>
@@ -50,2 +49,5 @@
#include <math.h>
+#include <unistd.h>
+#include <net/if_arp.h>
+#include <net/ethernet.h>
#include <sys/ioctl.h>
@@ -53,7 +55,9 @@
#include <sys/types.h>
-#include <unistd.h>
+#include <linux/types.h>
#include <linux/sockios.h>
-#include <net/if_arp.h>
-#include <net/ethernet.h>
-#include <stdarg.h>
+#define u64 __u64
+#define u32 __u32
+#define u16 __u16
+#define u8 __u8
+#include <linux/ethtool.h>
@@ -61,4 +65,2 @@
#include <opie2/odebugmapper.h>
-
-using namespace Opie::Core;
using namespace Opie::Net::Internal;
@@ -383,2 +385,10 @@ bool ONetworkInterface::isWireless() const
+ONetworkInterfaceDriverInfo ONetworkInterface::driverInfo() const
+{
+ struct ethtool_drvinfo info;
+ info.cmd = ETHTOOL_GDRVINFO;
+ _ifr.ifr_data = (caddr_t) &info;
+ return ioctl( SIOCETHTOOL ) ? ONetworkInterfaceDriverInfo( info.driver, info.version, info.fw_version, info.bus_info) : ONetworkInterfaceDriverInfo();
+}
+
/*======================================================================================
@@ -407,2 +417,3 @@ OChannelHopper::OChannelHopper( OWirelessNetworkInterface* iface )
if ( _maxChannel >= 12 ) _channels.append( 12 );
+ //FIXME: Add 802.11a/g channels
_channel = _channels.begin();