diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2014-08-25 10:35:35 -0700 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2014-08-26 09:49:39 -0700 |
commit | b4ac10a4e1eddf00ddad32f3307cc050bb4e0963 (patch) | |
tree | d0e42eb14d1a258970a6533a81ef0a29a41fb28a /bcmdhd/wifi_hal/wifi_hal.cpp | |
parent | f0d5070a931327e6356d765478069b9e66452a5b (diff) | |
download | hardware_broadcom_wlan-b4ac10a4e1eddf00ddad32f3307cc050bb4e0963.tar.gz hardware_broadcom_wlan-b4ac10a4e1eddf00ddad32f3307cc050bb4e0963.tar.bz2 hardware_broadcom_wlan-b4ac10a4e1eddf00ddad32f3307cc050bb4e0963.zip |
bcmdhd: wifi: hal: Add wifi_set_nodfs_flag() function
Bug: 17181998
Change-Id: I8337fe6ce41716993bbe02538ef55af6129ca7b3
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'bcmdhd/wifi_hal/wifi_hal.cpp')
-rw-r--r-- | bcmdhd/wifi_hal/wifi_hal.cpp | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp index e45cb78..87bc87b 100644 --- a/bcmdhd/wifi_hal/wifi_hal.cpp +++ b/bcmdhd/wifi_hal/wifi_hal.cpp @@ -44,6 +44,7 @@ #define FEATURE_SET 0 #define FEATURE_SET_MATRIX 1 +#define ATTR_NODFS_VALUE 3 static void internal_event_handler(wifi_handle handle, int events); static int internal_no_seq_check(nl_msg *msg, void *arg); @@ -483,10 +484,36 @@ protected: /* Nothing to do on response! */ return NL_SKIP; } - }; +class SetNodfsCommand : public WifiCommand { + +private: + u32 mNoDfs; +public: + SetNodfsCommand(wifi_interface_handle handle, u32 nodfs) + : WifiCommand(handle, 0) { + mNoDfs = nodfs; + } + virtual int create() { + int ret; + ret = mMsg.create(GOOGLE_OUI, WIFI_SUBCMD_NODFS_SET); + if (ret < 0) { + ALOGE("Can't create message to send to driver - %d", ret); + return ret; + } + + nlattr *data = mMsg.attr_start(NL80211_ATTR_VENDOR_DATA); + ret = mMsg.put_u32(ATTR_NODFS_VALUE, mNoDfs); + if (ret < 0) { + return ret; + } + + mMsg.attr_end(data); + return WIFI_SUCCESS; + } +}; class GetFeatureSetCommand : public WifiCommand { @@ -513,7 +540,7 @@ public: if(feature_type == FEATURE_SET) { ret = mMsg.create(GOOGLE_OUI, WIFI_SUBCMD_GET_FEATURE_SET); - } else if (feature_type == FEATURE_SET_MATRIX){ + } else if (feature_type == FEATURE_SET_MATRIX) { ret = mMsg.create(GOOGLE_OUI, WIFI_SUBCMD_GET_FEATURE_SET_MATRIX); } else { ALOGE("Unknown feature type %d", feature_type); @@ -703,5 +730,10 @@ wifi_error wifi_set_scanning_mac_oui(wifi_interface_handle handle, oui scan_oui) } -///////////////////////////////////////////////////////////////////////////// +wifi_error wifi_set_nodfs_flag(wifi_interface_handle handle, u32 nodfs) +{ + SetNodfsCommand command(handle, nodfs); + return (wifi_error) command.requestResponse(); +} +///////////////////////////////////////////////////////////////////////////// |