summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTerry Chen <terry-ht.chen@broadcom.corp-partner.google.com>2020-05-01 15:37:59 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-05-01 15:37:59 +0000
commit7902c6c14f06c526217cb69dac03c815712205f2 (patch)
tree2b65a51ea4458a970cb0808f260d5a20fe535323
parentb25e05ef0e88f1d11b74a1593f4d08af9ea7b3eb (diff)
parentb739e60e12385dc4e9cab88aa688aacd15274cfb (diff)
downloadplatform_hardware_broadcom_wlan-7902c6c14f06c526217cb69dac03c815712205f2.tar.gz
platform_hardware_broadcom_wlan-7902c6c14f06c526217cb69dac03c815712205f2.tar.bz2
platform_hardware_broadcom_wlan-7902c6c14f06c526217cb69dac03c815712205f2.zip
Wifi: Set event socket pid to brcm driver am: b739e60e12
Change-Id: Ie7c52ee4bfdf8918e439f02df9bfe775c287b118
-rwxr-xr-xbcmdhd/wifi_hal/wifi_logger.cpp41
1 files changed, 38 insertions, 3 deletions
diff --git a/bcmdhd/wifi_hal/wifi_logger.cpp b/bcmdhd/wifi_hal/wifi_logger.cpp
index e8c6a4a..1ab37d5 100755
--- a/bcmdhd/wifi_hal/wifi_logger.cpp
+++ b/bcmdhd/wifi_hal/wifi_logger.cpp
@@ -33,6 +33,8 @@
#include <netlink/socket.h>
#include <netlink-private/object-api.h>
#include <netlink-private/types.h>
+#include <unistd.h>
+
#include "nl80211_copy.h"
#include "sync.h"
@@ -45,6 +47,7 @@
#include "common.h"
#include "cpp_bindings.h"
#include "brcm_version.h"
+#define WIFI_HAL_EVENT_SOCK_PORT 645
#define ARRAYSIZE(a) (u8)(sizeof(a) / sizeof(a[0]))
typedef enum {
@@ -65,7 +68,8 @@ typedef enum {
LOGGER_DEBUG_GET_DUMP,
LOGGER_FILE_DUMP_DONE_IND,
LOGGER_SET_HAL_START,
- LOGGER_HAL_STOP
+ LOGGER_HAL_STOP,
+ LOGGER_SET_HAL_PID
} DEBUG_SUB_COMMAND;
typedef enum {
@@ -115,7 +119,8 @@ typedef enum {
typedef enum {
SET_HAL_START_ATTRIBUTE_DEINIT = 0x0001,
- SET_HAL_START_ATTRIBUTE_PRE_INIT = 0x0002
+ SET_HAL_START_ATTRIBUTE_PRE_INIT = 0x0002,
+ SET_HAL_START_ATTRIBUTE_EVENT_SOCK_PID = 0x0003
} SET_HAL_START_ATTRIBUTE;
#define HAL_START_REQUEST_ID 2
@@ -556,8 +561,38 @@ public:
int start() {
ALOGV("Register loghandler");
+ int result;
+ uint32_t event_sock_pid = getpid() + (WIFI_HAL_EVENT_SOCK_PORT << 22);
registerVendorHandler(GOOGLE_OUI, GOOGLE_DEBUG_RING_EVENT);
- return WIFI_SUCCESS;
+
+ WifiRequest request(familyId(), ifaceId());
+
+ /* set hal event socket port to driver */
+ result = request.create(GOOGLE_OUI, LOGGER_SET_HAL_PID);
+ if (result != WIFI_SUCCESS) {
+ ALOGV("Failed to set Hal preInit; result = %d", result);
+ return result;
+ }
+ nlattr *data = request.attr_start(NL80211_ATTR_VENDOR_DATA);
+ result = request.put_u32(SET_HAL_START_ATTRIBUTE_EVENT_SOCK_PID, event_sock_pid);
+ if (result != WIFI_SUCCESS) {
+ ALOGV("Hal preInit Failed to put pic = %d", result);
+ return result;
+ }
+
+ if (result != WIFI_SUCCESS) {
+ ALOGV("Hal preInit Failed to put pid= %d", result);
+ return result;
+ }
+
+ request.attr_end(data);
+
+ result = requestResponse(request);
+ if (result != WIFI_SUCCESS) {
+ ALOGE("Failed to register set Hal preInit; result = %d", result);
+ return result;
+ }
+ return result;
}
virtual int cancel() {