diff options
author | Vinit Deshpande <vinitd@google.com> | 2015-05-13 18:36:47 -0700 |
---|---|---|
committer | Vinit Deshpande <vinitd@google.com> | 2015-05-13 18:36:47 -0700 |
commit | 219e15ee9f8f6a84490aeb2d0681b3d5566952c2 (patch) | |
tree | 2e8bde94cecac5d9593fe05ef92ece258da441be | |
parent | b9cd762ca3cb6725585d349e161560039ed192db (diff) | |
parent | dee2763112928ba86e084ed0551c05d1d94d287e (diff) | |
download | hardware_broadcom_wlan-219e15ee9f8f6a84490aeb2d0681b3d5566952c2.zip hardware_broadcom_wlan-219e15ee9f8f6a84490aeb2d0681b3d5566952c2.tar.gz hardware_broadcom_wlan-219e15ee9f8f6a84490aeb2d0681b3d5566952c2.tar.bz2 |
am f02e958..dee2763 from mirror-m-wireless-internal-release
dee2763 Merge "net:wireless:bcmdhd: Update bcm4339 FW (6.37.32.RC23.34.37)" into m-wireless-dev
d4438c7 net:wireless:bcmdhd: Update bcm4339 FW (6.37.32.RC23.34.37)
262499e net:wireless:bcmdhd: Update bcm4354/56 FW(7.35.79.81)
040ee11 change wifi Logging header
-rwxr-xr-x | bcmdhd/firmware/bcm4339/fw_bcmdhd.bin | bin | 551429 -> 558431 bytes | |||
-rwxr-xr-x | bcmdhd/firmware/bcm4339/fw_bcmdhd_apsta.bin | bin | 496164 -> 496280 bytes | |||
-rw-r--r-- | bcmdhd/firmware/bcm4354/fw_bcm4354.bin | bin | 636104 -> 636896 bytes | |||
-rw-r--r-- | bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin | bin | 549311 -> 549728 bytes | |||
-rw-r--r-- | bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin | bin | 594273 -> 593684 bytes | |||
-rw-r--r-- | bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin | bin | 668805 -> 668387 bytes | |||
-rw-r--r-- | bcmdhd/wifi_hal/common.h | 7 | ||||
-rw-r--r-- | bcmdhd/wifi_hal/gscan.cpp | 176 | ||||
-rw-r--r-- | bcmdhd/wifi_hal/wifi_logger.cpp | 38 |
9 files changed, 200 insertions, 21 deletions
diff --git a/bcmdhd/firmware/bcm4339/fw_bcmdhd.bin b/bcmdhd/firmware/bcm4339/fw_bcmdhd.bin Binary files differindex a56a32e..8933153 100755 --- a/bcmdhd/firmware/bcm4339/fw_bcmdhd.bin +++ b/bcmdhd/firmware/bcm4339/fw_bcmdhd.bin diff --git a/bcmdhd/firmware/bcm4339/fw_bcmdhd_apsta.bin b/bcmdhd/firmware/bcm4339/fw_bcmdhd_apsta.bin Binary files differindex 52ba140..5cf03c2 100755 --- a/bcmdhd/firmware/bcm4339/fw_bcmdhd_apsta.bin +++ b/bcmdhd/firmware/bcm4339/fw_bcmdhd_apsta.bin diff --git a/bcmdhd/firmware/bcm4354/fw_bcm4354.bin b/bcmdhd/firmware/bcm4354/fw_bcm4354.bin Binary files differindex daf6867..244a7be 100644 --- a/bcmdhd/firmware/bcm4354/fw_bcm4354.bin +++ b/bcmdhd/firmware/bcm4354/fw_bcm4354.bin diff --git a/bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin b/bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin Binary files differindex f700b61..4d1623c 100644 --- a/bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin +++ b/bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin diff --git a/bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin b/bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin Binary files differindex 1acc765..7bf0056 100644 --- a/bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin +++ b/bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin diff --git a/bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin b/bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin Binary files differindex a653944..0553d44 100644 --- a/bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin +++ b/bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin diff --git a/bcmdhd/wifi_hal/common.h b/bcmdhd/wifi_hal/common.h index 87abafd..ac5af91 100644 --- a/bcmdhd/wifi_hal/common.h +++ b/bcmdhd/wifi_hal/common.h @@ -93,9 +93,11 @@ typedef enum { WIFI_SUBCMD_ENABLE_LAZY_ROAM, /* 0x1012 */ WIFI_SUBCMD_SET_BSSID_PREF, /* 0x1013 */ WIFI_SUBCMD_SET_BSSID_BLACKLIST, /* 0x1014 */ + + GSCAN_SUBCMD_ANQPO_CONFIG, /* 0x1015 */ /* Add more sub commands here */ - GSCAN_SUBCMD_MAX /* 0x1015 */ + GSCAN_SUBCMD_MAX } WIFI_SUB_COMMAND; @@ -110,8 +112,9 @@ typedef enum { GSCAN_EVENT_COMPLETE_SCAN, GSCAN_EVENT_HOTLIST_RESULTS_LOST, GSCAN_EVENT_EPNO_EVENT, + GSCAN_EVENT_ANQPO_HOTSPOT_MATCH, GOOGLE_DEBUG_RING_EVENT, - GOOGLE_DEBUG_MEM_DUMP_EVENT, + GOOGLE_DEBUG_MEM_DUMP_EVENT } WIFI_EVENT; typedef void (*wifi_internal_event_handler) (wifi_handle handle, int events); diff --git a/bcmdhd/wifi_hal/gscan.cpp b/bcmdhd/wifi_hal/gscan.cpp index 5e13dd0..e3ed685 100644 --- a/bcmdhd/wifi_hal/gscan.cpp +++ b/bcmdhd/wifi_hal/gscan.cpp @@ -119,6 +119,14 @@ typedef enum { GSCAN_ATTRIBUTE_BSSID_BLACKLIST_FLUSH = 100, GSCAN_ATTRIBUTE_BLACKLIST_BSSID, + /* ANQPO */ + GSCAN_ATTRIBUTE_ANQPO_HS_LIST = 110, + GSCAN_ATTRIBUTE_ANQPO_HS_LIST_SIZE, + GSCAN_ATTRIBUTE_ANQPO_HS_NETWORK_ID, + GSCAN_ATTRIBUTE_ANQPO_HS_NAI_REALM, + GSCAN_ATTRIBUTE_ANQPO_HS_ROAM_CONSORTIUM_ID, + GSCAN_ATTRIBUTE_ANQPO_HS_PLMN, + GSCAN_ATTRIBUTE_MAX } GSCAN_ATTRIBUTE; @@ -1981,3 +1989,171 @@ wifi_error wifi_set_bssid_preference(wifi_request_id id, wifi_interface_handle i return (wifi_error)cmd->start(); } +//////////////////////////////////////////////////////////////////////////////// + +class AnqpoConfigureCommand : public WifiCommand +{ + int num_hs; + wifi_passpoint_network *mNetworks; + wifi_passpoint_event_handler mHandler; +public: + AnqpoConfigureCommand(wifi_request_id id, wifi_interface_handle iface, + int num, wifi_passpoint_network *hs_list, wifi_passpoint_event_handler handler) + : WifiCommand(iface, id), num_hs(num), mNetworks(hs_list), mHandler(handler) + { + } + + int createRequest(WifiRequest& request, int val) { + + int result = request.create(GOOGLE_OUI, GSCAN_SUBCMD_ANQPO_CONFIG); + result = request.put_u32(GSCAN_ATTRIBUTE_ANQPO_HS_LIST_SIZE, num_hs); + if (result < 0) { + return result; + } + + nlattr *data = request.attr_start(NL80211_ATTR_VENDOR_DATA); + + struct nlattr * attr = request.attr_start(GSCAN_ATTRIBUTE_ANQPO_HS_LIST); + for (int i = 0; i < num_hs; i++) { + nlattr *attr2 = request.attr_start(i); + if (attr2 == NULL) { + return WIFI_ERROR_OUT_OF_MEMORY; + } + result = request.put_u32(GSCAN_ATTRIBUTE_ANQPO_HS_NETWORK_ID, mNetworks[i].id); + if (result < 0) { + return result; + } + result = request.put(GSCAN_ATTRIBUTE_ANQPO_HS_NAI_REALM, mNetworks[i].realm, 256); + if (result < 0) { + return result; + } + result = request.put(GSCAN_ATTRIBUTE_ANQPO_HS_ROAM_CONSORTIUM_ID, + mNetworks[i].roamingConsortiumIds, 128); + if (result < 0) { + return result; + } + result = request.put(GSCAN_ATTRIBUTE_ANQPO_HS_PLMN, mNetworks[i].plmn, 3); + if (result < 0) { + return result; + } + + request.attr_end(attr2); + } + + request.attr_end(attr); + request.attr_end(data); + + return WIFI_SUCCESS; + } + + int start() { + + WifiRequest request(familyId(), ifaceId()); + int result = createRequest(request, num_hs); + if (result != WIFI_SUCCESS) { + ALOGE("failed to create request; result = %d", result); + return result; + } + + registerVendorHandler(GOOGLE_OUI, GSCAN_EVENT_ANQPO_HOTSPOT_MATCH); + + result = requestResponse(request); + if (result != WIFI_SUCCESS) { + ALOGE("failed to set ANQPO networks; result = %d", result); + unregisterVendorHandler(GOOGLE_OUI, GSCAN_EVENT_ANQPO_HOTSPOT_MATCH); + return result; + } + + return result; + } + + virtual int cancel() { + + WifiRequest request(familyId(), ifaceId()); + int result = createRequest(request, 0); + if (result != WIFI_SUCCESS) { + ALOGE("failed to create request; result = %d", result); + } else { + result = requestResponse(request); + if (result != WIFI_SUCCESS) { + ALOGE("failed to reset ANQPO networks;result = %d", result); + } + } + + unregisterVendorHandler(GOOGLE_OUI, GSCAN_EVENT_ANQPO_HOTSPOT_MATCH); + return WIFI_SUCCESS; + } + + virtual int handleResponse(WifiEvent& reply) { + ALOGD("Request complete!"); + /* Nothing to do on response! */ + return NL_SKIP; + } + + virtual int handleEvent(WifiEvent& event) { + typedef struct { + u16 channel; /* channel of GAS protocol */ + u8 dialog_token; /* GAS dialog token */ + u8 fragment_id; /* fragment id */ + u16 status_code; /* status code on GAS completion */ + u16 data_len; /* length of data to follow */ + u8 data[1]; /* variable length specified by data_len */ + } wifi_anqp_gas_resp; + + ALOGI("ANQPO hotspot matched event!"); + + nlattr *vendor_data = event.get_attribute(NL80211_ATTR_VENDOR_DATA); + unsigned int len = event.get_vendor_data_len(); + + if (vendor_data == NULL || len < sizeof(wifi_scan_result)) { + ALOGI("No scan results found"); + return NL_SKIP; + } + + wifi_scan_result *result = (wifi_scan_result *)event.get_vendor_data(); + byte *anqp = (byte *)result + offsetof(wifi_scan_result, ie_data) + result->ie_length; + wifi_anqp_gas_resp *gas = (wifi_anqp_gas_resp *)anqp; + int anqp_len = offsetof(wifi_anqp_gas_resp, data) + gas->data_len; + int networkId = *(int *)((byte *)anqp + anqp_len); + + ALOGI("%-32s\t", result->ssid); + + ALOGI("%02x:%02x:%02x:%02x:%02x:%02x ", result->bssid[0], result->bssid[1], + result->bssid[2], result->bssid[3], result->bssid[4], result->bssid[5]); + + ALOGI("%d\t", result->rssi); + ALOGI("%d\t", result->channel); + ALOGI("%lld\t", result->ts); + ALOGI("%lld\t", result->rtt); + ALOGI("%lld\n", result->rtt_sd); + + if(*mHandler.on_passpoint_network_found) + (*mHandler.on_passpoint_network_found)(id(), networkId, result, anqp_len, anqp); + + return NL_SKIP; + } +}; + +wifi_error wifi_set_passpoint_list(wifi_request_id id, wifi_interface_handle iface, int num, + wifi_passpoint_network *networks, wifi_passpoint_event_handler handler) +{ + wifi_handle handle = getWifiHandle(iface); + + AnqpoConfigureCommand *cmd = new AnqpoConfigureCommand(id, iface, num, networks, handler); + wifi_register_cmd(handle, id, cmd); + return (wifi_error)cmd->start(); +} + +wifi_error wifi_reset_passpoint_list(wifi_request_id id, wifi_interface_handle iface) +{ + wifi_handle handle = getWifiHandle(iface); + + WifiCommand *cmd = wifi_unregister_cmd(handle, id); + if (cmd) { + cmd->cancel(); + cmd->releaseRef(); + return WIFI_SUCCESS; + } + + return WIFI_ERROR_INVALID_ARGS; +} diff --git a/bcmdhd/wifi_hal/wifi_logger.cpp b/bcmdhd/wifi_hal/wifi_logger.cpp index 3a242ed..d7d60ae 100644 --- a/bcmdhd/wifi_hal/wifi_logger.cpp +++ b/bcmdhd/wifi_hal/wifi_logger.cpp @@ -76,10 +76,10 @@ typedef enum { /////////////////////////////////////////////////////////////////////////////// class DebugCommand : public WifiCommand { - char **mBuff; + char *mBuff; int *mBuffSize; u32 *mNumRings; - wifi_ring_buffer_status **mStatus; + wifi_ring_buffer_status *mStatus; unsigned int *mSupport; u32 mVerboseLevel; u32 mFlags; @@ -91,11 +91,11 @@ class DebugCommand : public WifiCommand public: // constructor for get version - DebugCommand(wifi_interface_handle iface, char **buffer, int *buffer_size, + DebugCommand(wifi_interface_handle iface, char *buffer, int *buffer_size, GetCmdType cmdType) : WifiCommand(iface, 0), mBuff(buffer), mBuffSize(buffer_size), mType(cmdType) { - memset(*mBuff, 0, *mBuffSize); + memset(mBuff, 0, *mBuffSize); } // constructor for ring data @@ -105,10 +105,10 @@ public: // constructor for ring status DebugCommand(wifi_interface_handle iface, u32 *num_rings, - wifi_ring_buffer_status **status, GetCmdType cmdType) + wifi_ring_buffer_status *status, GetCmdType cmdType) : WifiCommand(iface, 0), mNumRings(num_rings), mStatus(status), mType(cmdType) { - memset(*mStatus, 0, sizeof(wifi_ring_buffer_status) * (*mNumRings)); + memset(mStatus, 0, sizeof(wifi_ring_buffer_status) * (*mNumRings)); } // constructor for feature set @@ -179,7 +179,7 @@ public: // Driver expecting only attribute type, passing mbuff as data with // length 0 to avoid undefined state - result = request.put(LOGGER_ATTRIBUTE_FW_VER, *mBuff, 0); + result = request.put(LOGGER_ATTRIBUTE_FW_VER, mBuff, 0); if (result != WIFI_SUCCESS) { ALOGE("Failed to put get fw version request; result = %d", result); return result; @@ -200,7 +200,7 @@ public: // Driver expecting only attribute type, passing mbuff as data with // length 0 to avoid undefined state - result = request.put(LOGGER_ATTRIBUTE_DRIVER_VER, *mBuff, 0); + result = request.put(LOGGER_ATTRIBUTE_DRIVER_VER, mBuff, 0); if (result != WIFI_SUCCESS) { ALOGE("Failed to put get drv version request; result = %d", result); @@ -291,7 +291,7 @@ public: int len = reply.get_vendor_data_len(); ALOGD("len = %d, expected len = %d", len, *mBuffSize); - memcpy(*mBuff, data, min(len, *mBuffSize)); + memcpy(mBuff, data, min(len, *mBuffSize)); if (*mBuffSize < len) return NL_SKIP; *mBuffSize = len; @@ -306,7 +306,7 @@ public: { nlattr *vendor_data = reply.get_attribute(NL80211_ATTR_VENDOR_DATA); int len = reply.get_vendor_data_len(); - wifi_ring_buffer_status *status(*mStatus); + wifi_ring_buffer_status *status(mStatus); if (vendor_data == NULL || len == 0) { ALOGE("No Debug data found"); @@ -365,11 +365,11 @@ public: }; /* API to collect a firmware version string */ -wifi_error wifi_get_firmware_version( wifi_interface_handle iface, char **buffer, - int *buffer_size) +wifi_error wifi_get_firmware_version(wifi_interface_handle iface, char *buffer, + int buffer_size) { - if (buffer && *buffer && buffer_size) { - DebugCommand *cmd = new DebugCommand(iface, buffer, buffer_size, GET_FW_VER); + if (buffer && (buffer_size > 0)) { + DebugCommand *cmd = new DebugCommand(iface, buffer, &buffer_size, GET_FW_VER); return (wifi_error)cmd->start(); } else { ALOGE("FW version buffer NULL"); @@ -378,10 +378,10 @@ wifi_error wifi_get_firmware_version( wifi_interface_handle iface, char **buffer } /* API to collect a driver version string */ -wifi_error wifi_get_driver_version(wifi_interface_handle iface, char **buffer, int *buffer_size) +wifi_error wifi_get_driver_version(wifi_interface_handle iface, char *buffer, int buffer_size) { - if (buffer && *buffer && buffer_size) { - DebugCommand *cmd = new DebugCommand(iface, buffer, buffer_size, GET_DRV_VER); + if (buffer && (buffer_size > 0)) { + DebugCommand *cmd = new DebugCommand(iface, buffer, &buffer_size, GET_DRV_VER); return (wifi_error)cmd->start(); } else { ALOGE("Driver version buffer NULL"); @@ -398,9 +398,9 @@ wifi_error wifi_get_ring_data(wifi_interface_handle iface, char *ring_name) /* API to get the status of all ring buffers supported by driver */ wifi_error wifi_get_ring_buffers_status(wifi_interface_handle iface, - u32 *num_rings, wifi_ring_buffer_status **status) + u32 *num_rings, wifi_ring_buffer_status *status) { - if (status && *status && num_rings) { + if (status && num_rings) { DebugCommand *cmd = new DebugCommand(iface, num_rings, status, GET_RING_STATUS); return (wifi_error)cmd->start(); } else { |