summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2004-02-23 19:04:50 (UTC)
committer mickeyl <mickeyl>2004-02-23 19:04:50 (UTC)
commit7206bf5ae8a9940a9c30a9dc3dd3cb663e64874b (patch) (unidiff)
treef48e9183a4ffcb9d9bc4c448f79c6f424ac4a387
parent4f8be1658bc82040bac404aa98fe70c24239f10c (diff)
downloadopie-7206bf5ae8a9940a9c30a9dc3dd3cb663e64874b.zip
opie-7206bf5ae8a9940a9c30a9dc3dd3cb663e64874b.tar.gz
opie-7206bf5ae8a9940a9c30a9dc3dd3cb663e64874b.tar.bz2
The Orinoco (and Symbol/Spectrum) driver recently got the monitor mode
patch applied. It uses the WE15 IW_MODE_MONITOR. Fix OOrinocoMonitoringInterface to work with recent Orinoco drivers
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index 36f409b..915814d 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -1136,90 +1136,93 @@ void OWlanNGMonitoringInterface::setChannel( int c )
1136{ 1136{
1137 //NOTE: Older wlan-ng drivers automatically hopped channels while lnxreq_wlansniff=true. Newer ones don't. 1137 //NOTE: Older wlan-ng drivers automatically hopped channels while lnxreq_wlansniff=true. Newer ones don't.
1138 1138
1139 QString enable = "true"; //_if->monitorMode() ? "true" : "false"; 1139 QString enable = "true"; //_if->monitorMode() ? "true" : "false";
1140 QString prism = _prismHeader ? "true" : "false"; 1140 QString prism = _prismHeader ? "true" : "false";
1141 QString cmd; 1141 QString cmd;
1142 cmd.sprintf( "$(which wlanctl-ng) %s lnxreq_wlansniff channel=%d enable=%s prismheader=%s", 1142 cmd.sprintf( "$(which wlanctl-ng) %s lnxreq_wlansniff channel=%d enable=%s prismheader=%s",
1143 (const char*) _if->name(), c, (const char*) enable, (const char*) prism ); 1143 (const char*) _if->name(), c, (const char*) enable, (const char*) prism );
1144 system( cmd ); 1144 system( cmd );
1145} 1145}
1146 1146
1147 1147
1148/*====================================================================================== 1148/*======================================================================================
1149 * OHostAPMonitoringInterface 1149 * OHostAPMonitoringInterface
1150 *======================================================================================*/ 1150 *======================================================================================*/
1151 1151
1152OHostAPMonitoringInterface::OHostAPMonitoringInterface( ONetworkInterface* iface, bool prismHeader ) 1152OHostAPMonitoringInterface::OHostAPMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
1153 :OMonitoringInterface( iface, prismHeader ) 1153 :OMonitoringInterface( iface, prismHeader )
1154{ 1154{
1155 iface->setMonitoring( this ); 1155 iface->setMonitoring( this );
1156} 1156}
1157 1157
1158OHostAPMonitoringInterface::~OHostAPMonitoringInterface() 1158OHostAPMonitoringInterface::~OHostAPMonitoringInterface()
1159{ 1159{
1160} 1160}
1161 1161
1162void OHostAPMonitoringInterface::setEnabled( bool b ) 1162void OHostAPMonitoringInterface::setEnabled( bool b )
1163{ 1163{
1164 int monitorCode = _prismHeader ? 1 : 2; 1164 int monitorCode = _prismHeader ? 1 : 2;
1165 if ( b ) 1165 if ( b )
1166 { 1166 {
1167 _if->setPrivate( "monitor", 1, monitorCode ); 1167 _if->setPrivate( "monitor", 1, monitorCode );
1168 } 1168 }
1169 else 1169 else
1170 { 1170 {
1171 _if->setPrivate( "monitor", 1, 0 ); 1171 _if->setPrivate( "monitor", 1, 0 );
1172 } 1172 }
1173} 1173}
1174 1174
1175 1175
1176QString OHostAPMonitoringInterface::name() const 1176QString OHostAPMonitoringInterface::name() const
1177{ 1177{
1178 return "hostap"; 1178 return "hostap";
1179} 1179}
1180 1180
1181 1181
1182/*====================================================================================== 1182/*======================================================================================
1183 * OOrinocoNetworkInterface 1183 * OOrinocoNetworkInterface
1184 *======================================================================================*/ 1184 *======================================================================================*/
1185 1185
1186OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* iface, bool prismHeader ) 1186OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
1187 :OMonitoringInterface( iface, prismHeader ) 1187 :OMonitoringInterface( iface, prismHeader )
1188{ 1188{
1189 iface->setMonitoring( this ); 1189 iface->setMonitoring( this );
1190} 1190}
1191 1191
1192 1192
1193OOrinocoMonitoringInterface::~OOrinocoMonitoringInterface() 1193OOrinocoMonitoringInterface::~OOrinocoMonitoringInterface()
1194{ 1194{
1195} 1195}
1196 1196
1197 1197
1198void OOrinocoMonitoringInterface::setChannel( int c ) 1198void OOrinocoMonitoringInterface::setChannel( int c )
1199{ 1199{
1200 int monitorCode = _prismHeader ? 1 : 2; 1200 if ( !_if->hasPrivate( "monitor" ) )
1201 _if->setPrivate( "monitor", 2, monitorCode, c ); 1201 {
1202 this->OMonitoringInterface::setChannel( c );
1203 }
1204 else
1205 {
1206 int monitorCode = _prismHeader ? 1 : 2;
1207 _if->setPrivate( "monitor", 2, monitorCode, c );
1208 }
1202} 1209}
1203 1210
1204 1211
1205void OOrinocoMonitoringInterface::setEnabled( bool b ) 1212void OOrinocoMonitoringInterface::setEnabled( bool b )
1206{ 1213{
1207 // IW_MODE_MONITOR was introduced in Wireless Extensions Version 15
1208 // Wireless Extensions < Version 15 need iwpriv commandos for monitoring
1209 // However, as of recent orinoco drivers, IW_MODE_MONITOR is still not supported
1210
1211 if ( b ) 1214 if ( b )
1212 { 1215 {
1213 setChannel( 1 ); 1216 setChannel( 1 );
1214 } 1217 }
1215 else 1218 else
1216 { 1219 {
1217 _if->setPrivate( "monitor", 2, 0, 0 ); 1220 _if->setPrivate( "monitor", 2, 0, 0 );
1218 } 1221 }
1219} 1222}
1220 1223
1221 1224
1222QString OOrinocoMonitoringInterface::name() const 1225QString OOrinocoMonitoringInterface::name() const
1223{ 1226{
1224 return "orinoco"; 1227 return "orinoco";
1225} 1228}