summaryrefslogtreecommitdiffstats
path: root/bcmdhd/wifi_hal
diff options
context:
space:
mode:
authorxinhe <xinhe@google.com>2015-03-20 10:46:15 -0700
committerxinhe <xinhe@google.com>2015-03-20 17:16:27 -0700
commitc02e00563882d87ab29822c43097cbb1ce04b55d (patch)
tree30d2b837ff2a6ab25b1f82f8cc25f70978abf18c /bcmdhd/wifi_hal
parent86fd36e469910d52ee544a5158263b3b80fdba1f (diff)
downloadhardware_broadcom_wlan-c02e00563882d87ab29822c43097cbb1ce04b55d.zip
hardware_broadcom_wlan-c02e00563882d87ab29822c43097cbb1ce04b55d.tar.gz
hardware_broadcom_wlan-c02e00563882d87ab29822c43097cbb1ce04b55d.tar.bz2
Merge Broadcom HAL codes for set country code
net: wireless: bcmdhd changes for set country Change-Id: I7fdb4efe00a5f6df166b8dbb071939c4aa311845 Signed-off-by: eccopark@broadcom.com <eccopark@broadcom.com> Bug:19829530
Diffstat (limited to 'bcmdhd/wifi_hal')
-rw-r--r--bcmdhd/wifi_hal/common.h2
-rw-r--r--bcmdhd/wifi_hal/wifi_hal.cpp37
2 files changed, 37 insertions, 2 deletions
diff --git a/bcmdhd/wifi_hal/common.h b/bcmdhd/wifi_hal/common.h
index be1d10a..bffd580 100644
--- a/bcmdhd/wifi_hal/common.h
+++ b/bcmdhd/wifi_hal/common.h
@@ -80,7 +80,7 @@ typedef enum {
WIFI_SUBCMD_GET_FEATURE_SET_MATRIX, /* 0x100B */
WIFI_SUBCMD_SET_PNO_RANDOM_MAC_OUI, /* 0x100C */
WIFI_SUBCMD_NODFS_SET, /* 0x100D */
- WIFI_SUBCMD_SET_COUNTRY, /* 0x100E */
+ WIFI_SUBCMD_SET_COUNTRY_CODE, /* 0x100E */
/* Add more sub commands here */
GSCAN_SUBCMD_SET_EPNO_SSID, /* 0x100F */
GSCAN_SUBCMD_MAX /* 0x100D */
diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp
index 5049ac2..a898697 100644
--- a/bcmdhd/wifi_hal/wifi_hal.cpp
+++ b/bcmdhd/wifi_hal/wifi_hal.cpp
@@ -1,4 +1,3 @@
-
#include <stdint.h>
#include <fcntl.h>
#include <sys/socket.h>
@@ -45,6 +44,7 @@
#define FEATURE_SET 0
#define FEATURE_SET_MATRIX 1
#define ATTR_NODFS_VALUE 3
+#define ATTR_COUNTRY_CODE 4
static void internal_event_handler(wifi_handle handle, int events);
static int internal_no_seq_check(nl_msg *msg, void *arg);
@@ -512,6 +512,35 @@ public:
}
};
+class SetCountryCodeCommand : public WifiCommand {
+private:
+ const char *mCountryCode;
+public:
+ SetCountryCodeCommand(wifi_interface_handle handle, const char *country_code)
+ : WifiCommand(handle, 0) {
+ mCountryCode = country_code;
+ }
+ virtual int create() {
+ int ret;
+
+ ret = mMsg.create(GOOGLE_OUI, WIFI_SUBCMD_SET_COUNTRY_CODE);
+ 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_string(ATTR_COUNTRY_CODE, mCountryCode);
+ if (ret < 0) {
+ return ret;
+ }
+
+ mMsg.attr_end(data);
+ return WIFI_SUCCESS;
+
+ }
+};
+
class GetFeatureSetCommand : public WifiCommand {
private:
@@ -739,4 +768,10 @@ wifi_error wifi_start_logging(wifi_interface_handle iface, u32 verbose_level, u3
return WIFI_ERROR_NOT_SUPPORTED;
}
+wifi_error wifi_set_country_code(wifi_interface_handle handle, const char *country_code)
+{
+ SetCountryCodeCommand command(handle, country_code);
+ return (wifi_error) command.requestResponse();
+}
+
/////////////////////////////////////////////////////////////////////////////