platform_system_core/nexus/WifiController.h

297 lines
9.9 KiB
C
Raw Normal View History

/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _WIFI_CONTROLLER_H
#define _WIFI_CONTROLLER_H
#include <sys/types.h>
#include "Controller.h"
#include "ScanResult.h"
#include "WifiNetwork.h"
#include "ISupplicantEventHandler.h"
nexus: Rollup update for nexus nexus: Change field separator from : to ' ' Signed-off-by: San Mehat <san@google.com> nexus: Add some prototypes for stuff to come Signed-off-by: San Mehat <san@google.com> nexus: Add some TODOs Signed-off-by: San Mehat <san@google.com> libsysutils: Put a proper token parser into the FrameworkListener which supports minimal \ escapes and quotes Signed-off-by: San Mehat <san@google.com> nexus: Fix a lot of bugs Signed-off-by: San Mehat <san@google.com> libsysutils: Remove some debugging Signed-off-by: San Mehat <san@google.com> nexus: Send broadcasts for supplicant state changes Signed-off-by: San Mehat <san@google.com> nexus: Plumb DHCP listener state changes to NetworkManager Signed-off-by: San Mehat <san@google.com> nexus: Make the SupplicantState strings more parsable Signed-off-by: San Mehat <san@google.com> nexus: Broadcast a message when dhcp state changes. Signed-off-by: San Mehat <san@google.com> nexus: Add a few new response codes Signed-off-by: San Mehat <san@google.com> nexus: Rename ErrorCode -> ResponseCode Signed-off-by: San Mehat <san@google.com> nexus: Add DHCP event broadcasting. Also adds the framework for tracking supplicant 'searching-for-AP' state Signed-off-by: San Mehat <san@google.com> nexus: REmove WifiScanner Signed-off-by: San Mehat <san@google.com> nexus: Change the way scanning works. scanmode can now be selected independantly of triggering a scan. Also adds rxfilter support Signed-off-by: San Mehat <san@google.com> nexus: Add support for configuring bluetooth coexistence scanning and modes Signed-off-by: San Mehat <san@google.com> nexus: use case insensitive match for property names Signed-off-by: San Mehat <san@google.com> nexus: Rollup of a bunch of stuff: - 'list' command now takes an argument to match against - InterfaceConfig has been moved into the Controller base (for now) - DhcpClient now has some rudimentry locking - process 'ADDRINFO' messages from dhcpcd - Drop tertiary dns Signed-off-by: San Mehat <san@google.com> nexus: Clean up some of the supplicant variable parsing and add 'wifi.current' Signed-off-by: San Mehat <san@google.com> nexus: Add driver-stop/start, initial suspend support Signed-off-by: San Mehat <san@google.com> nexus: Add Controller suspend/resume callbacks, as well as locking Signed-off-by: San Mehat <san@google.com> nexus: Make ARP probing configurable for DhcpClient Signed-off-by: San Mehat <san@google.com> nexus: Add linkspeed / rssi retrieval Signed-off-by: San Mehat <san@google.com> nexus: Add WifiStatusPoller to track RSSI/linkspeed when associated Signed-off-by: San Mehat <san@google.com> nexus: Disable some debugging and add 'wifi.netcount' property Signed-off-by: San Mehat <san@google.com> nexus: Replace the hackish property system with something more flexible with namespaces Signed-off-by: San Mehat <san@google.com> libsysutils: Fix a few bugs in SocketListener Signed-off-by: San Mehat <san@google.com> nexus: PropertyManager: Add array support Signed-off-by: San Mehat <san@google.com> nexus: Clean up properties Signed-off-by: San Mehat <san@google.com> nexus: WifiController: Change name of 'CurrentNetwork' property Signed-off-by: San Mehat <san@google.com>
2009-06-24 06:10:57 +02:00
#include "IWifiStatusPollerHandler.h"
class NetInterface;
class Supplicant;
class SupplicantAssociatingEvent;
class SupplicantAssociatedEvent;
class SupplicantConnectedEvent;
class SupplicantScanResultsEvent;
class SupplicantStateChangeEvent;
class SupplicantDisconnectedEvent;
nexus: Rollup update for nexus nexus: Change field separator from : to ' ' Signed-off-by: San Mehat <san@google.com> nexus: Add some prototypes for stuff to come Signed-off-by: San Mehat <san@google.com> nexus: Add some TODOs Signed-off-by: San Mehat <san@google.com> libsysutils: Put a proper token parser into the FrameworkListener which supports minimal \ escapes and quotes Signed-off-by: San Mehat <san@google.com> nexus: Fix a lot of bugs Signed-off-by: San Mehat <san@google.com> libsysutils: Remove some debugging Signed-off-by: San Mehat <san@google.com> nexus: Send broadcasts for supplicant state changes Signed-off-by: San Mehat <san@google.com> nexus: Plumb DHCP listener state changes to NetworkManager Signed-off-by: San Mehat <san@google.com> nexus: Make the SupplicantState strings more parsable Signed-off-by: San Mehat <san@google.com> nexus: Broadcast a message when dhcp state changes. Signed-off-by: San Mehat <san@google.com> nexus: Add a few new response codes Signed-off-by: San Mehat <san@google.com> nexus: Rename ErrorCode -> ResponseCode Signed-off-by: San Mehat <san@google.com> nexus: Add DHCP event broadcasting. Also adds the framework for tracking supplicant 'searching-for-AP' state Signed-off-by: San Mehat <san@google.com> nexus: REmove WifiScanner Signed-off-by: San Mehat <san@google.com> nexus: Change the way scanning works. scanmode can now be selected independantly of triggering a scan. Also adds rxfilter support Signed-off-by: San Mehat <san@google.com> nexus: Add support for configuring bluetooth coexistence scanning and modes Signed-off-by: San Mehat <san@google.com> nexus: use case insensitive match for property names Signed-off-by: San Mehat <san@google.com> nexus: Rollup of a bunch of stuff: - 'list' command now takes an argument to match against - InterfaceConfig has been moved into the Controller base (for now) - DhcpClient now has some rudimentry locking - process 'ADDRINFO' messages from dhcpcd - Drop tertiary dns Signed-off-by: San Mehat <san@google.com> nexus: Clean up some of the supplicant variable parsing and add 'wifi.current' Signed-off-by: San Mehat <san@google.com> nexus: Add driver-stop/start, initial suspend support Signed-off-by: San Mehat <san@google.com> nexus: Add Controller suspend/resume callbacks, as well as locking Signed-off-by: San Mehat <san@google.com> nexus: Make ARP probing configurable for DhcpClient Signed-off-by: San Mehat <san@google.com> nexus: Add linkspeed / rssi retrieval Signed-off-by: San Mehat <san@google.com> nexus: Add WifiStatusPoller to track RSSI/linkspeed when associated Signed-off-by: San Mehat <san@google.com> nexus: Disable some debugging and add 'wifi.netcount' property Signed-off-by: San Mehat <san@google.com> nexus: Replace the hackish property system with something more flexible with namespaces Signed-off-by: San Mehat <san@google.com> libsysutils: Fix a few bugs in SocketListener Signed-off-by: San Mehat <san@google.com> nexus: PropertyManager: Add array support Signed-off-by: San Mehat <san@google.com> nexus: Clean up properties Signed-off-by: San Mehat <san@google.com> nexus: WifiController: Change name of 'CurrentNetwork' property Signed-off-by: San Mehat <san@google.com>
2009-06-24 06:10:57 +02:00
class WifiStatusPoller;
nexus: Rollup update for nexus nexus: Change field separator from : to ' ' Signed-off-by: San Mehat <san@google.com> nexus: Add some prototypes for stuff to come Signed-off-by: San Mehat <san@google.com> nexus: Add some TODOs Signed-off-by: San Mehat <san@google.com> libsysutils: Put a proper token parser into the FrameworkListener which supports minimal \ escapes and quotes Signed-off-by: San Mehat <san@google.com> nexus: Fix a lot of bugs Signed-off-by: San Mehat <san@google.com> libsysutils: Remove some debugging Signed-off-by: San Mehat <san@google.com> nexus: Send broadcasts for supplicant state changes Signed-off-by: San Mehat <san@google.com> nexus: Plumb DHCP listener state changes to NetworkManager Signed-off-by: San Mehat <san@google.com> nexus: Make the SupplicantState strings more parsable Signed-off-by: San Mehat <san@google.com> nexus: Broadcast a message when dhcp state changes. Signed-off-by: San Mehat <san@google.com> nexus: Add a few new response codes Signed-off-by: San Mehat <san@google.com> nexus: Rename ErrorCode -> ResponseCode Signed-off-by: San Mehat <san@google.com> nexus: Add DHCP event broadcasting. Also adds the framework for tracking supplicant 'searching-for-AP' state Signed-off-by: San Mehat <san@google.com> nexus: REmove WifiScanner Signed-off-by: San Mehat <san@google.com> nexus: Change the way scanning works. scanmode can now be selected independantly of triggering a scan. Also adds rxfilter support Signed-off-by: San Mehat <san@google.com> nexus: Add support for configuring bluetooth coexistence scanning and modes Signed-off-by: San Mehat <san@google.com> nexus: use case insensitive match for property names Signed-off-by: San Mehat <san@google.com> nexus: Rollup of a bunch of stuff: - 'list' command now takes an argument to match against - InterfaceConfig has been moved into the Controller base (for now) - DhcpClient now has some rudimentry locking - process 'ADDRINFO' messages from dhcpcd - Drop tertiary dns Signed-off-by: San Mehat <san@google.com> nexus: Clean up some of the supplicant variable parsing and add 'wifi.current' Signed-off-by: San Mehat <san@google.com> nexus: Add driver-stop/start, initial suspend support Signed-off-by: San Mehat <san@google.com> nexus: Add Controller suspend/resume callbacks, as well as locking Signed-off-by: San Mehat <san@google.com> nexus: Make ARP probing configurable for DhcpClient Signed-off-by: San Mehat <san@google.com> nexus: Add linkspeed / rssi retrieval Signed-off-by: San Mehat <san@google.com> nexus: Add WifiStatusPoller to track RSSI/linkspeed when associated Signed-off-by: San Mehat <san@google.com> nexus: Disable some debugging and add 'wifi.netcount' property Signed-off-by: San Mehat <san@google.com> nexus: Replace the hackish property system with something more flexible with namespaces Signed-off-by: San Mehat <san@google.com> libsysutils: Fix a few bugs in SocketListener Signed-off-by: San Mehat <san@google.com> nexus: PropertyManager: Add array support Signed-off-by: San Mehat <san@google.com> nexus: Clean up properties Signed-off-by: San Mehat <san@google.com> nexus: WifiController: Change name of 'CurrentNetwork' property Signed-off-by: San Mehat <san@google.com>
2009-06-24 06:10:57 +02:00
class WifiController : public Controller,
public ISupplicantEventHandler,
public IWifiStatusPollerHandler {
nexus: Rollup update for nexus nexus: Change field separator from : to ' ' Signed-off-by: San Mehat <san@google.com> nexus: Add some prototypes for stuff to come Signed-off-by: San Mehat <san@google.com> nexus: Add some TODOs Signed-off-by: San Mehat <san@google.com> libsysutils: Put a proper token parser into the FrameworkListener which supports minimal \ escapes and quotes Signed-off-by: San Mehat <san@google.com> nexus: Fix a lot of bugs Signed-off-by: San Mehat <san@google.com> libsysutils: Remove some debugging Signed-off-by: San Mehat <san@google.com> nexus: Send broadcasts for supplicant state changes Signed-off-by: San Mehat <san@google.com> nexus: Plumb DHCP listener state changes to NetworkManager Signed-off-by: San Mehat <san@google.com> nexus: Make the SupplicantState strings more parsable Signed-off-by: San Mehat <san@google.com> nexus: Broadcast a message when dhcp state changes. Signed-off-by: San Mehat <san@google.com> nexus: Add a few new response codes Signed-off-by: San Mehat <san@google.com> nexus: Rename ErrorCode -> ResponseCode Signed-off-by: San Mehat <san@google.com> nexus: Add DHCP event broadcasting. Also adds the framework for tracking supplicant 'searching-for-AP' state Signed-off-by: San Mehat <san@google.com> nexus: REmove WifiScanner Signed-off-by: San Mehat <san@google.com> nexus: Change the way scanning works. scanmode can now be selected independantly of triggering a scan. Also adds rxfilter support Signed-off-by: San Mehat <san@google.com> nexus: Add support for configuring bluetooth coexistence scanning and modes Signed-off-by: San Mehat <san@google.com> nexus: use case insensitive match for property names Signed-off-by: San Mehat <san@google.com> nexus: Rollup of a bunch of stuff: - 'list' command now takes an argument to match against - InterfaceConfig has been moved into the Controller base (for now) - DhcpClient now has some rudimentry locking - process 'ADDRINFO' messages from dhcpcd - Drop tertiary dns Signed-off-by: San Mehat <san@google.com> nexus: Clean up some of the supplicant variable parsing and add 'wifi.current' Signed-off-by: San Mehat <san@google.com> nexus: Add driver-stop/start, initial suspend support Signed-off-by: San Mehat <san@google.com> nexus: Add Controller suspend/resume callbacks, as well as locking Signed-off-by: San Mehat <san@google.com> nexus: Make ARP probing configurable for DhcpClient Signed-off-by: San Mehat <san@google.com> nexus: Add linkspeed / rssi retrieval Signed-off-by: San Mehat <san@google.com> nexus: Add WifiStatusPoller to track RSSI/linkspeed when associated Signed-off-by: San Mehat <san@google.com> nexus: Disable some debugging and add 'wifi.netcount' property Signed-off-by: San Mehat <san@google.com> nexus: Replace the hackish property system with something more flexible with namespaces Signed-off-by: San Mehat <san@google.com> libsysutils: Fix a few bugs in SocketListener Signed-off-by: San Mehat <san@google.com> nexus: PropertyManager: Add array support Signed-off-by: San Mehat <san@google.com> nexus: Clean up properties Signed-off-by: San Mehat <san@google.com> nexus: WifiController: Change name of 'CurrentNetwork' property Signed-off-by: San Mehat <san@google.com>
2009-06-24 06:10:57 +02:00
class WifiIntegerProperty : public IntegerProperty {
protected:
WifiController *mWc;
public:
WifiIntegerProperty(WifiController *c, const char *name, bool ro,
int elements);
virtual ~WifiIntegerProperty() {}
virtual int set(int idx, int value) = 0;
virtual int get(int idx, int *buffer) = 0;
};
friend class WifiController::WifiIntegerProperty;
class WifiStringProperty : public StringProperty {
protected:
WifiController *mWc;
public:
WifiStringProperty(WifiController *c, const char *name, bool ro,
int elements);
virtual ~WifiStringProperty() {}
virtual int set(int idx, const char *value) = 0;
virtual int get(int idx, char *buffer, size_t max) = 0;
};
friend class WifiController::WifiStringProperty;
class WifiEnabledProperty : public WifiIntegerProperty {
public:
WifiEnabledProperty(WifiController *c);
virtual ~WifiEnabledProperty() {}
int set(int idx, int value);
int get(int idx, int *buffer);
};
class WifiScanOnlyProperty : public WifiIntegerProperty {
public:
WifiScanOnlyProperty(WifiController *c);
virtual ~WifiScanOnlyProperty() {}
int set(int idx, int value);
int get(int idx, int *buffer);
};
class WifiAllowedChannelsProperty : public WifiIntegerProperty {
public:
WifiAllowedChannelsProperty(WifiController *c);
virtual ~WifiAllowedChannelsProperty() {}
int set(int idx, int value);
int get(int idx, int *buffer);
};
class WifiActiveScanProperty : public WifiIntegerProperty {
public:
WifiActiveScanProperty(WifiController *c);
virtual ~WifiActiveScanProperty() {}
int set(int idx, int value);
int get(int idx, int *buffer);
};
class WifiSearchingProperty : public WifiIntegerProperty {
public:
WifiSearchingProperty(WifiController *c);
virtual ~WifiSearchingProperty() {}
int set(int idx, int value) { return -1; }
int get(int idx, int *buffer);
};
class WifiPacketFilterProperty : public WifiIntegerProperty {
public:
WifiPacketFilterProperty(WifiController *c);
virtual ~WifiPacketFilterProperty() {}
int set(int idx, int value);
int get(int idx, int *buffer);
};
class WifiBluetoothCoexScanProperty : public WifiIntegerProperty {
public:
WifiBluetoothCoexScanProperty(WifiController *c);
virtual ~WifiBluetoothCoexScanProperty() {}
int set(int idx, int value);
int get(int idx, int *buffer);
};
class WifiBluetoothCoexModeProperty : public WifiIntegerProperty {
public:
WifiBluetoothCoexModeProperty(WifiController *c);
virtual ~WifiBluetoothCoexModeProperty() {}
int set(int idx, int value);
int get(int idx, int *buffer);
};
class WifiCurrentNetworkProperty : public WifiIntegerProperty {
public:
WifiCurrentNetworkProperty(WifiController *c);
virtual ~WifiCurrentNetworkProperty() {}
int set(int idx, int value) { return -1; }
int get(int idx, int *buffer);
};
class WifiSuspendedProperty : public WifiIntegerProperty {
public:
WifiSuspendedProperty(WifiController *c);
virtual ~WifiSuspendedProperty() {}
int set(int idx, int value);
int get(int idx, int *buffer);
};
class WifiNetCountProperty : public WifiIntegerProperty {
public:
WifiNetCountProperty(WifiController *c);
virtual ~WifiNetCountProperty() {}
int set(int idx, int value) { return -1; }
int get(int idx, int *buffer);
};
class WifiTriggerScanProperty : public WifiIntegerProperty {
public:
WifiTriggerScanProperty(WifiController *c);
virtual ~WifiTriggerScanProperty() {}
int set(int idx, int value);
int get(int idx, int *buffer);
};
class WifiSupplicantStateProperty : public WifiStringProperty {
public:
WifiSupplicantStateProperty(WifiController *c);
virtual ~WifiSupplicantStateProperty() {}
int set(int idx, const char *value) { return -1; }
int get(int idx, char *buffer, size_t max);
};
class WifiInterfaceProperty : public WifiStringProperty {
public:
WifiInterfaceProperty(WifiController *c);
virtual ~WifiInterfaceProperty() {}
int set(int idx, const char *value) { return -1; }
int get(int idx, char *buffer, size_t max);
};
Supplicant *mSupplicant;
char mModulePath[255];
char mModuleName[64];
char mModuleArgs[255];
int mSupplicantState;
nexus: Rollup update for nexus nexus: Change field separator from : to ' ' Signed-off-by: San Mehat <san@google.com> nexus: Add some prototypes for stuff to come Signed-off-by: San Mehat <san@google.com> nexus: Add some TODOs Signed-off-by: San Mehat <san@google.com> libsysutils: Put a proper token parser into the FrameworkListener which supports minimal \ escapes and quotes Signed-off-by: San Mehat <san@google.com> nexus: Fix a lot of bugs Signed-off-by: San Mehat <san@google.com> libsysutils: Remove some debugging Signed-off-by: San Mehat <san@google.com> nexus: Send broadcasts for supplicant state changes Signed-off-by: San Mehat <san@google.com> nexus: Plumb DHCP listener state changes to NetworkManager Signed-off-by: San Mehat <san@google.com> nexus: Make the SupplicantState strings more parsable Signed-off-by: San Mehat <san@google.com> nexus: Broadcast a message when dhcp state changes. Signed-off-by: San Mehat <san@google.com> nexus: Add a few new response codes Signed-off-by: San Mehat <san@google.com> nexus: Rename ErrorCode -> ResponseCode Signed-off-by: San Mehat <san@google.com> nexus: Add DHCP event broadcasting. Also adds the framework for tracking supplicant 'searching-for-AP' state Signed-off-by: San Mehat <san@google.com> nexus: REmove WifiScanner Signed-off-by: San Mehat <san@google.com> nexus: Change the way scanning works. scanmode can now be selected independantly of triggering a scan. Also adds rxfilter support Signed-off-by: San Mehat <san@google.com> nexus: Add support for configuring bluetooth coexistence scanning and modes Signed-off-by: San Mehat <san@google.com> nexus: use case insensitive match for property names Signed-off-by: San Mehat <san@google.com> nexus: Rollup of a bunch of stuff: - 'list' command now takes an argument to match against - InterfaceConfig has been moved into the Controller base (for now) - DhcpClient now has some rudimentry locking - process 'ADDRINFO' messages from dhcpcd - Drop tertiary dns Signed-off-by: San Mehat <san@google.com> nexus: Clean up some of the supplicant variable parsing and add 'wifi.current' Signed-off-by: San Mehat <san@google.com> nexus: Add driver-stop/start, initial suspend support Signed-off-by: San Mehat <san@google.com> nexus: Add Controller suspend/resume callbacks, as well as locking Signed-off-by: San Mehat <san@google.com> nexus: Make ARP probing configurable for DhcpClient Signed-off-by: San Mehat <san@google.com> nexus: Add linkspeed / rssi retrieval Signed-off-by: San Mehat <san@google.com> nexus: Add WifiStatusPoller to track RSSI/linkspeed when associated Signed-off-by: San Mehat <san@google.com> nexus: Disable some debugging and add 'wifi.netcount' property Signed-off-by: San Mehat <san@google.com> nexus: Replace the hackish property system with something more flexible with namespaces Signed-off-by: San Mehat <san@google.com> libsysutils: Fix a few bugs in SocketListener Signed-off-by: San Mehat <san@google.com> nexus: PropertyManager: Add array support Signed-off-by: San Mehat <san@google.com> nexus: Clean up properties Signed-off-by: San Mehat <san@google.com> nexus: WifiController: Change name of 'CurrentNetwork' property Signed-off-by: San Mehat <san@google.com>
2009-06-24 06:10:57 +02:00
bool mActiveScan;
bool mScanOnly;
bool mPacketFilter;
bool mBluetoothCoexScan;
int mBluetoothCoexMode;
int mCurrentlyConnectedNetworkId;
bool mSuspended;
int mLastRssi;
int mRssiEventThreshold;
int mLastLinkSpeed;
int mNumAllowedChannels;
ScanResultCollection *mLatestScanResults;
pthread_mutex_t mLatestScanResultsLock;
nexus: Rollup update for nexus nexus: Change field separator from : to ' ' Signed-off-by: San Mehat <san@google.com> nexus: Add some prototypes for stuff to come Signed-off-by: San Mehat <san@google.com> nexus: Add some TODOs Signed-off-by: San Mehat <san@google.com> libsysutils: Put a proper token parser into the FrameworkListener which supports minimal \ escapes and quotes Signed-off-by: San Mehat <san@google.com> nexus: Fix a lot of bugs Signed-off-by: San Mehat <san@google.com> libsysutils: Remove some debugging Signed-off-by: San Mehat <san@google.com> nexus: Send broadcasts for supplicant state changes Signed-off-by: San Mehat <san@google.com> nexus: Plumb DHCP listener state changes to NetworkManager Signed-off-by: San Mehat <san@google.com> nexus: Make the SupplicantState strings more parsable Signed-off-by: San Mehat <san@google.com> nexus: Broadcast a message when dhcp state changes. Signed-off-by: San Mehat <san@google.com> nexus: Add a few new response codes Signed-off-by: San Mehat <san@google.com> nexus: Rename ErrorCode -> ResponseCode Signed-off-by: San Mehat <san@google.com> nexus: Add DHCP event broadcasting. Also adds the framework for tracking supplicant 'searching-for-AP' state Signed-off-by: San Mehat <san@google.com> nexus: REmove WifiScanner Signed-off-by: San Mehat <san@google.com> nexus: Change the way scanning works. scanmode can now be selected independantly of triggering a scan. Also adds rxfilter support Signed-off-by: San Mehat <san@google.com> nexus: Add support for configuring bluetooth coexistence scanning and modes Signed-off-by: San Mehat <san@google.com> nexus: use case insensitive match for property names Signed-off-by: San Mehat <san@google.com> nexus: Rollup of a bunch of stuff: - 'list' command now takes an argument to match against - InterfaceConfig has been moved into the Controller base (for now) - DhcpClient now has some rudimentry locking - process 'ADDRINFO' messages from dhcpcd - Drop tertiary dns Signed-off-by: San Mehat <san@google.com> nexus: Clean up some of the supplicant variable parsing and add 'wifi.current' Signed-off-by: San Mehat <san@google.com> nexus: Add driver-stop/start, initial suspend support Signed-off-by: San Mehat <san@google.com> nexus: Add Controller suspend/resume callbacks, as well as locking Signed-off-by: San Mehat <san@google.com> nexus: Make ARP probing configurable for DhcpClient Signed-off-by: San Mehat <san@google.com> nexus: Add linkspeed / rssi retrieval Signed-off-by: San Mehat <san@google.com> nexus: Add WifiStatusPoller to track RSSI/linkspeed when associated Signed-off-by: San Mehat <san@google.com> nexus: Disable some debugging and add 'wifi.netcount' property Signed-off-by: San Mehat <san@google.com> nexus: Replace the hackish property system with something more flexible with namespaces Signed-off-by: San Mehat <san@google.com> libsysutils: Fix a few bugs in SocketListener Signed-off-by: San Mehat <san@google.com> nexus: PropertyManager: Add array support Signed-off-by: San Mehat <san@google.com> nexus: Clean up properties Signed-off-by: San Mehat <san@google.com> nexus: WifiController: Change name of 'CurrentNetwork' property Signed-off-by: San Mehat <san@google.com>
2009-06-24 06:10:57 +02:00
pthread_mutex_t mLock;
WifiStatusPoller *mStatusPoller;
struct {
WifiEnabledProperty *propEnabled;
WifiScanOnlyProperty *propScanOnly;
WifiAllowedChannelsProperty *propAllowedChannels;
IntegerPropertyHelper *propRssiEventThreshold;
} mStaticProperties;
struct {
WifiActiveScanProperty *propActiveScan;
WifiSearchingProperty *propSearching;
WifiPacketFilterProperty *propPacketFilter;
WifiBluetoothCoexScanProperty *propBluetoothCoexScan;
WifiBluetoothCoexModeProperty *propBluetoothCoexMode;
WifiCurrentNetworkProperty *propCurrentNetwork;
IntegerPropertyHelper *propRssi;
IntegerPropertyHelper *propLinkSpeed;
WifiSuspendedProperty *propSuspended;
WifiNetCountProperty *propNetCount;
WifiSupplicantStateProperty *propSupplicantState;
WifiInterfaceProperty *propInterface;
WifiTriggerScanProperty *propTriggerScan;
} mDynamicProperties;
// True if supplicant is currently searching for a network
bool mIsSupplicantSearching;
int mNumScanResultsSinceLastStateChange;
bool mEnabled;
public:
WifiController(PropertyManager *propmngr, IControllerHandler *handlers, char *modpath, char *modname, char *modargs);
virtual ~WifiController() {}
int start();
int stop();
WifiNetwork *createNetwork();
int removeNetwork(int networkId);
WifiNetworkCollection *createNetworkList();
ScanResultCollection *createScanResults();
char *getModulePath() { return mModulePath; }
char *getModuleName() { return mModuleName; }
char *getModuleArgs() { return mModuleArgs; }
Supplicant *getSupplicant() { return mSupplicant; }
protected:
// Move this crap into a 'driver'
virtual int powerUp() = 0;
virtual int powerDown() = 0;
virtual int loadFirmware();
virtual bool isFirmwareLoaded() = 0;
virtual bool isPoweredUp() = 0;
private:
void sendStatusBroadcast(const char *msg);
nexus: Rollup update for nexus nexus: Change field separator from : to ' ' Signed-off-by: San Mehat <san@google.com> nexus: Add some prototypes for stuff to come Signed-off-by: San Mehat <san@google.com> nexus: Add some TODOs Signed-off-by: San Mehat <san@google.com> libsysutils: Put a proper token parser into the FrameworkListener which supports minimal \ escapes and quotes Signed-off-by: San Mehat <san@google.com> nexus: Fix a lot of bugs Signed-off-by: San Mehat <san@google.com> libsysutils: Remove some debugging Signed-off-by: San Mehat <san@google.com> nexus: Send broadcasts for supplicant state changes Signed-off-by: San Mehat <san@google.com> nexus: Plumb DHCP listener state changes to NetworkManager Signed-off-by: San Mehat <san@google.com> nexus: Make the SupplicantState strings more parsable Signed-off-by: San Mehat <san@google.com> nexus: Broadcast a message when dhcp state changes. Signed-off-by: San Mehat <san@google.com> nexus: Add a few new response codes Signed-off-by: San Mehat <san@google.com> nexus: Rename ErrorCode -> ResponseCode Signed-off-by: San Mehat <san@google.com> nexus: Add DHCP event broadcasting. Also adds the framework for tracking supplicant 'searching-for-AP' state Signed-off-by: San Mehat <san@google.com> nexus: REmove WifiScanner Signed-off-by: San Mehat <san@google.com> nexus: Change the way scanning works. scanmode can now be selected independantly of triggering a scan. Also adds rxfilter support Signed-off-by: San Mehat <san@google.com> nexus: Add support for configuring bluetooth coexistence scanning and modes Signed-off-by: San Mehat <san@google.com> nexus: use case insensitive match for property names Signed-off-by: San Mehat <san@google.com> nexus: Rollup of a bunch of stuff: - 'list' command now takes an argument to match against - InterfaceConfig has been moved into the Controller base (for now) - DhcpClient now has some rudimentry locking - process 'ADDRINFO' messages from dhcpcd - Drop tertiary dns Signed-off-by: San Mehat <san@google.com> nexus: Clean up some of the supplicant variable parsing and add 'wifi.current' Signed-off-by: San Mehat <san@google.com> nexus: Add driver-stop/start, initial suspend support Signed-off-by: San Mehat <san@google.com> nexus: Add Controller suspend/resume callbacks, as well as locking Signed-off-by: San Mehat <san@google.com> nexus: Make ARP probing configurable for DhcpClient Signed-off-by: San Mehat <san@google.com> nexus: Add linkspeed / rssi retrieval Signed-off-by: San Mehat <san@google.com> nexus: Add WifiStatusPoller to track RSSI/linkspeed when associated Signed-off-by: San Mehat <san@google.com> nexus: Disable some debugging and add 'wifi.netcount' property Signed-off-by: San Mehat <san@google.com> nexus: Replace the hackish property system with something more flexible with namespaces Signed-off-by: San Mehat <san@google.com> libsysutils: Fix a few bugs in SocketListener Signed-off-by: San Mehat <san@google.com> nexus: PropertyManager: Add array support Signed-off-by: San Mehat <san@google.com> nexus: Clean up properties Signed-off-by: San Mehat <san@google.com> nexus: WifiController: Change name of 'CurrentNetwork' property Signed-off-by: San Mehat <san@google.com>
2009-06-24 06:10:57 +02:00
int setActiveScan(bool active);
int triggerScan();
int enable();
int disable();
nexus: Rollup update for nexus nexus: Change field separator from : to ' ' Signed-off-by: San Mehat <san@google.com> nexus: Add some prototypes for stuff to come Signed-off-by: San Mehat <san@google.com> nexus: Add some TODOs Signed-off-by: San Mehat <san@google.com> libsysutils: Put a proper token parser into the FrameworkListener which supports minimal \ escapes and quotes Signed-off-by: San Mehat <san@google.com> nexus: Fix a lot of bugs Signed-off-by: San Mehat <san@google.com> libsysutils: Remove some debugging Signed-off-by: San Mehat <san@google.com> nexus: Send broadcasts for supplicant state changes Signed-off-by: San Mehat <san@google.com> nexus: Plumb DHCP listener state changes to NetworkManager Signed-off-by: San Mehat <san@google.com> nexus: Make the SupplicantState strings more parsable Signed-off-by: San Mehat <san@google.com> nexus: Broadcast a message when dhcp state changes. Signed-off-by: San Mehat <san@google.com> nexus: Add a few new response codes Signed-off-by: San Mehat <san@google.com> nexus: Rename ErrorCode -> ResponseCode Signed-off-by: San Mehat <san@google.com> nexus: Add DHCP event broadcasting. Also adds the framework for tracking supplicant 'searching-for-AP' state Signed-off-by: San Mehat <san@google.com> nexus: REmove WifiScanner Signed-off-by: San Mehat <san@google.com> nexus: Change the way scanning works. scanmode can now be selected independantly of triggering a scan. Also adds rxfilter support Signed-off-by: San Mehat <san@google.com> nexus: Add support for configuring bluetooth coexistence scanning and modes Signed-off-by: San Mehat <san@google.com> nexus: use case insensitive match for property names Signed-off-by: San Mehat <san@google.com> nexus: Rollup of a bunch of stuff: - 'list' command now takes an argument to match against - InterfaceConfig has been moved into the Controller base (for now) - DhcpClient now has some rudimentry locking - process 'ADDRINFO' messages from dhcpcd - Drop tertiary dns Signed-off-by: San Mehat <san@google.com> nexus: Clean up some of the supplicant variable parsing and add 'wifi.current' Signed-off-by: San Mehat <san@google.com> nexus: Add driver-stop/start, initial suspend support Signed-off-by: San Mehat <san@google.com> nexus: Add Controller suspend/resume callbacks, as well as locking Signed-off-by: San Mehat <san@google.com> nexus: Make ARP probing configurable for DhcpClient Signed-off-by: San Mehat <san@google.com> nexus: Add linkspeed / rssi retrieval Signed-off-by: San Mehat <san@google.com> nexus: Add WifiStatusPoller to track RSSI/linkspeed when associated Signed-off-by: San Mehat <san@google.com> nexus: Disable some debugging and add 'wifi.netcount' property Signed-off-by: San Mehat <san@google.com> nexus: Replace the hackish property system with something more flexible with namespaces Signed-off-by: San Mehat <san@google.com> libsysutils: Fix a few bugs in SocketListener Signed-off-by: San Mehat <san@google.com> nexus: PropertyManager: Add array support Signed-off-by: San Mehat <san@google.com> nexus: Clean up properties Signed-off-by: San Mehat <san@google.com> nexus: WifiController: Change name of 'CurrentNetwork' property Signed-off-by: San Mehat <san@google.com>
2009-06-24 06:10:57 +02:00
int setSuspend(bool suspend);
bool getSuspended();
int setBluetoothCoexistenceScan(bool enable);
int setBluetoothCoexistenceMode(int mode);
int setPacketFilter(bool enable);
int setScanOnly(bool scanOnly);
// ISupplicantEventHandler methods
nexus: Rollup update for nexus nexus: Change field separator from : to ' ' Signed-off-by: San Mehat <san@google.com> nexus: Add some prototypes for stuff to come Signed-off-by: San Mehat <san@google.com> nexus: Add some TODOs Signed-off-by: San Mehat <san@google.com> libsysutils: Put a proper token parser into the FrameworkListener which supports minimal \ escapes and quotes Signed-off-by: San Mehat <san@google.com> nexus: Fix a lot of bugs Signed-off-by: San Mehat <san@google.com> libsysutils: Remove some debugging Signed-off-by: San Mehat <san@google.com> nexus: Send broadcasts for supplicant state changes Signed-off-by: San Mehat <san@google.com> nexus: Plumb DHCP listener state changes to NetworkManager Signed-off-by: San Mehat <san@google.com> nexus: Make the SupplicantState strings more parsable Signed-off-by: San Mehat <san@google.com> nexus: Broadcast a message when dhcp state changes. Signed-off-by: San Mehat <san@google.com> nexus: Add a few new response codes Signed-off-by: San Mehat <san@google.com> nexus: Rename ErrorCode -> ResponseCode Signed-off-by: San Mehat <san@google.com> nexus: Add DHCP event broadcasting. Also adds the framework for tracking supplicant 'searching-for-AP' state Signed-off-by: San Mehat <san@google.com> nexus: REmove WifiScanner Signed-off-by: San Mehat <san@google.com> nexus: Change the way scanning works. scanmode can now be selected independantly of triggering a scan. Also adds rxfilter support Signed-off-by: San Mehat <san@google.com> nexus: Add support for configuring bluetooth coexistence scanning and modes Signed-off-by: San Mehat <san@google.com> nexus: use case insensitive match for property names Signed-off-by: San Mehat <san@google.com> nexus: Rollup of a bunch of stuff: - 'list' command now takes an argument to match against - InterfaceConfig has been moved into the Controller base (for now) - DhcpClient now has some rudimentry locking - process 'ADDRINFO' messages from dhcpcd - Drop tertiary dns Signed-off-by: San Mehat <san@google.com> nexus: Clean up some of the supplicant variable parsing and add 'wifi.current' Signed-off-by: San Mehat <san@google.com> nexus: Add driver-stop/start, initial suspend support Signed-off-by: San Mehat <san@google.com> nexus: Add Controller suspend/resume callbacks, as well as locking Signed-off-by: San Mehat <san@google.com> nexus: Make ARP probing configurable for DhcpClient Signed-off-by: San Mehat <san@google.com> nexus: Add linkspeed / rssi retrieval Signed-off-by: San Mehat <san@google.com> nexus: Add WifiStatusPoller to track RSSI/linkspeed when associated Signed-off-by: San Mehat <san@google.com> nexus: Disable some debugging and add 'wifi.netcount' property Signed-off-by: San Mehat <san@google.com> nexus: Replace the hackish property system with something more flexible with namespaces Signed-off-by: San Mehat <san@google.com> libsysutils: Fix a few bugs in SocketListener Signed-off-by: San Mehat <san@google.com> nexus: PropertyManager: Add array support Signed-off-by: San Mehat <san@google.com> nexus: Clean up properties Signed-off-by: San Mehat <san@google.com> nexus: WifiController: Change name of 'CurrentNetwork' property Signed-off-by: San Mehat <san@google.com>
2009-06-24 06:10:57 +02:00
void onAssociatingEvent(SupplicantAssociatingEvent *evt);
void onAssociatedEvent(SupplicantAssociatedEvent *evt);
void onConnectedEvent(SupplicantConnectedEvent *evt);
void onScanResultsEvent(SupplicantScanResultsEvent *evt);
void onStateChangeEvent(SupplicantStateChangeEvent *evt);
void onConnectionTimeoutEvent(SupplicantConnectionTimeoutEvent *evt);
void onDisconnectedEvent(SupplicantDisconnectedEvent *evt);
#if 0
virtual void onTerminatingEvent(SupplicantEvent *evt);
virtual void onPasswordChangedEvent(SupplicantEvent *evt);
virtual void onEapNotificationEvent(SupplicantEvent *evt);
virtual void onEapStartedEvent(SupplicantEvent *evt);
virtual void onEapMethodEvent(SupplicantEvent *evt);
virtual void onEapSuccessEvent(SupplicantEvent *evt);
virtual void onEapFailureEvent(SupplicantEvent *evt);
virtual void onLinkSpeedEvent(SupplicantEvent *evt);
virtual void onDriverStateEvent(SupplicantEvent *evt);
#endif
nexus: Rollup update for nexus nexus: Change field separator from : to ' ' Signed-off-by: San Mehat <san@google.com> nexus: Add some prototypes for stuff to come Signed-off-by: San Mehat <san@google.com> nexus: Add some TODOs Signed-off-by: San Mehat <san@google.com> libsysutils: Put a proper token parser into the FrameworkListener which supports minimal \ escapes and quotes Signed-off-by: San Mehat <san@google.com> nexus: Fix a lot of bugs Signed-off-by: San Mehat <san@google.com> libsysutils: Remove some debugging Signed-off-by: San Mehat <san@google.com> nexus: Send broadcasts for supplicant state changes Signed-off-by: San Mehat <san@google.com> nexus: Plumb DHCP listener state changes to NetworkManager Signed-off-by: San Mehat <san@google.com> nexus: Make the SupplicantState strings more parsable Signed-off-by: San Mehat <san@google.com> nexus: Broadcast a message when dhcp state changes. Signed-off-by: San Mehat <san@google.com> nexus: Add a few new response codes Signed-off-by: San Mehat <san@google.com> nexus: Rename ErrorCode -> ResponseCode Signed-off-by: San Mehat <san@google.com> nexus: Add DHCP event broadcasting. Also adds the framework for tracking supplicant 'searching-for-AP' state Signed-off-by: San Mehat <san@google.com> nexus: REmove WifiScanner Signed-off-by: San Mehat <san@google.com> nexus: Change the way scanning works. scanmode can now be selected independantly of triggering a scan. Also adds rxfilter support Signed-off-by: San Mehat <san@google.com> nexus: Add support for configuring bluetooth coexistence scanning and modes Signed-off-by: San Mehat <san@google.com> nexus: use case insensitive match for property names Signed-off-by: San Mehat <san@google.com> nexus: Rollup of a bunch of stuff: - 'list' command now takes an argument to match against - InterfaceConfig has been moved into the Controller base (for now) - DhcpClient now has some rudimentry locking - process 'ADDRINFO' messages from dhcpcd - Drop tertiary dns Signed-off-by: San Mehat <san@google.com> nexus: Clean up some of the supplicant variable parsing and add 'wifi.current' Signed-off-by: San Mehat <san@google.com> nexus: Add driver-stop/start, initial suspend support Signed-off-by: San Mehat <san@google.com> nexus: Add Controller suspend/resume callbacks, as well as locking Signed-off-by: San Mehat <san@google.com> nexus: Make ARP probing configurable for DhcpClient Signed-off-by: San Mehat <san@google.com> nexus: Add linkspeed / rssi retrieval Signed-off-by: San Mehat <san@google.com> nexus: Add WifiStatusPoller to track RSSI/linkspeed when associated Signed-off-by: San Mehat <san@google.com> nexus: Disable some debugging and add 'wifi.netcount' property Signed-off-by: San Mehat <san@google.com> nexus: Replace the hackish property system with something more flexible with namespaces Signed-off-by: San Mehat <san@google.com> libsysutils: Fix a few bugs in SocketListener Signed-off-by: San Mehat <san@google.com> nexus: PropertyManager: Add array support Signed-off-by: San Mehat <san@google.com> nexus: Clean up properties Signed-off-by: San Mehat <san@google.com> nexus: WifiController: Change name of 'CurrentNetwork' property Signed-off-by: San Mehat <san@google.com>
2009-06-24 06:10:57 +02:00
void onStatusPollInterval();
int verifyNotSuspended();
};
#endif