summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/mac/src/sys/legacy/src/system/src/mac_init_api.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/core/mac/src/sys/legacy/src/system/src/mac_init_api.c b/core/mac/src/sys/legacy/src/system/src/mac_init_api.c
index 8c0c432dae7e..9fd4a2a6771f 100644
--- a/core/mac/src/sys/legacy/src/system/src/mac_init_api.c
+++ b/core/mac/src/sys/legacy/src/system/src/mac_init_api.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -49,6 +49,8 @@
#include "mac_trace.h"
#endif
+static tAniSirGlobal global_mac_context;
+
extern tSirRetStatus halDoCfgInit(tpAniSirGlobal pMac);
extern tSirRetStatus halProcessStartEvent(tpAniSirGlobal pMac);
@@ -106,25 +108,13 @@ tSirRetStatus mac_stop(tHalHandle hHal, tHalStopType stopType)
tSirRetStatus mac_open(tHalHandle *pHalHandle, tHddHandle hHdd,
struct cds_config_info *cds_cfg)
{
- tpAniSirGlobal p_mac = NULL;
+ tpAniSirGlobal p_mac = &global_mac_context;
tSirRetStatus status = eSIR_SUCCESS;
if (pHalHandle == NULL)
return eSIR_FAILURE;
/*
- * Make sure this adapter is not already opened. (Compare pAdapter pointer in already
- * allocated p_mac structures.)
- * If it is opened just return pointer to previously allocated p_mac pointer.
- * Or should this result in error?
- */
-
- /* Allocate p_mac */
- p_mac = qdf_mem_malloc(sizeof(tAniSirGlobal));
- if (NULL == p_mac)
- return eSIR_MEM_ALLOC_FAILED;
-
- /*
* Set various global fields of p_mac here
* (Could be platform dependant as some variables in p_mac are platform
* dependant)
@@ -184,8 +174,5 @@ tSirRetStatus mac_close(tHalHandle hHal)
log_deinit(pMac);
- /* Finally, de-allocate the global MAC datastructure: */
- qdf_mem_free(pMac);
-
return eSIR_SUCCESS;
}