Diffstat (limited to 'libopie2/opienet/onetwork.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opienet/onetwork.cpp | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp index 16fa8ae..36f409b 100644 --- a/libopie2/opienet/onetwork.cpp +++ b/libopie2/opienet/onetwork.cpp | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) 2003 by Michael 'Mickey' Lauer <mickey@Vanille.de> | 3 | Copyright (C) 2003-2004 by Michael 'Mickey' Lauer |
4 | =. | 4 | =. <mickey@Vanille.de> |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
@@ -583,6 +583,13 @@ void OWirelessNetworkInterface::dumpInformation() const | |||
583 | odebug << "OWirelessNetworkInterface::() -------------- dumping information block ----------------" << oendl; | 583 | odebug << "OWirelessNetworkInterface::() -------------- dumping information block ----------------" << oendl; |
584 | 584 | ||
585 | qDebug( " - driver's idea of maximum throughput is %d bps = %d byte/s = %d Kb/s = %f.2 Mb/s", _range.throughput, _range.throughput / 8, _range.throughput / 8 / 1024, float( _range.throughput ) / 8.0 / 1024.0 / 1024.0 ); | 585 | qDebug( " - driver's idea of maximum throughput is %d bps = %d byte/s = %d Kb/s = %f.2 Mb/s", |
586 | qDebug( " - driver for '%s' has been compiled against WE V%d (source=V%d)", name(), _range.we_version_compiled, _range.we_version_source ); | 586 | _range.throughput, _range.throughput / 8, _range.throughput / 8 / 1024, float( _range.throughput ) / 8.0 / 1024.0 / 1024.0 ); |
587 | qDebug( " - driver for '%s' (V%d) has been compiled against WE V%d", | ||
588 | name(), _range.we_version_source, _range.we_version_compiled ); | ||
589 | |||
590 | if ( _range.we_version_compiled != WIRELESS_EXT ) | ||
591 | { | ||
592 | owarn << "Version mismatch! WE_DRIVER = " << _range.we_version_compiled << " and WE_OPIENET = " << WIRELESS_EXT << oendl; | ||
593 | } | ||
587 | 594 | ||
588 | odebug << "OWirelessNetworkInterface::() ---------------------------------------------------------" << oendl; | 595 | odebug << "OWirelessNetworkInterface::() ---------------------------------------------------------" << oendl; |
@@ -966,8 +973,22 @@ OStationList* OWirelessNetworkInterface::scanNetwork() | |||
966 | 973 | ||
967 | int OWirelessNetworkInterface::signalStrength() const | 974 | int OWirelessNetworkInterface::signalStrength() const |
968 | { | 975 | { |
969 | int max = _range.max_qual.level; | 976 | iw_statistics stat; |
970 | odebug << "signalStrength(): max quality seems to be " << max << "dBM" << oendl; | 977 | ::memset( &stat, 0, sizeof stat ); |
971 | return 50; | 978 | _iwr.u.data.pointer = (char*) &stat; |
979 | _iwr.u.data.flags = 0; | ||
980 | _iwr.u.data.length = sizeof stat; | ||
981 | |||
982 | if ( !wioctl( SIOCGIWSTATS ) ) | ||
983 | { | ||
984 | return -1; | ||
985 | } | ||
986 | |||
987 | int max = _range.max_qual.qual; | ||
988 | int cur = stat.qual.qual; | ||
989 | int lev = stat.qual.level; //FIXME: Do something with them? | ||
990 | int noi = stat.qual.noise; //FIXME: Do something with them? | ||
991 | |||
992 | return cur*100/max; | ||
972 | } | 993 | } |
973 | 994 | ||