summaryrefslogtreecommitdiffstats
path: root/bcmdhd/wifi_hal/common.h
diff options
context:
space:
mode:
authorVinit Deshpande <vinitd@google.com>2014-06-02 09:44:35 -0700
committerVinit Deshpande <vinitd@google.com>2014-06-11 14:38:50 -0700
commitbb8a4d506769d7dc8b33445c6725a40b7523063c (patch)
tree1a703f62e996aa2ec8bd21ebe3dba389c6ee2562 /bcmdhd/wifi_hal/common.h
parente165f3a9d7d77eed0ae55bebf885d9a879a9349c (diff)
downloadhardware_broadcom_wlan-bb8a4d506769d7dc8b33445c6725a40b7523063c.zip
hardware_broadcom_wlan-bb8a4d506769d7dc8b33445c6725a40b7523063c.tar.gz
hardware_broadcom_wlan-bb8a4d506769d7dc8b33445c6725a40b7523063c.tar.bz2
Add mutual exclusion to wifi HAL infrastructure
This change restricts free access from multiple threads to event buffers. Mutual exclusion is added to avoid crashes and corruption that may happen because of simultaneous access from a command and an event. Access to commands from multiple threads is still not protected. But thankfully, framework takes care of it. Bug: 15188917 Change-Id: I41e294f01a85097e30078f603b113da9a319ba83
Diffstat (limited to 'bcmdhd/wifi_hal/common.h')
-rw-r--r--bcmdhd/wifi_hal/common.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/bcmdhd/wifi_hal/common.h b/bcmdhd/wifi_hal/common.h
index cdd87fb..a73c173 100644
--- a/bcmdhd/wifi_hal/common.h
+++ b/bcmdhd/wifi_hal/common.h
@@ -8,6 +8,7 @@
#include <utils/Log.h>
#include "nl80211_copy.h"
+#include "sync.h"
#define SOCKET_BUFFER_SIZE (32768U)
#define RECV_BUF_SIZE (4096)
@@ -95,6 +96,7 @@ typedef struct {
cb_info *event_cb; // event callbacks
int num_event_cb; // number of event callbacks
int alloc_event_cb; // number of allocated callback objects
+ pthread_mutex_t cb_lock; // mutex for the event_cb access
cmd_info *cmd; // Outstanding commands
int num_cmd; // number of commands
@@ -103,6 +105,7 @@ typedef struct {
interface_info **interfaces; // array of interfaces
int num_interfaces; // number of interfaces
+
// add other details
} hal_info;