Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d305045 authored by Prashanth Bhatta's avatar Prashanth Bhatta Committed by Akash Patel
Browse files

qcacld-3.0: hdd: Refactor wlan_startup (phase 1)

In HDD, hdd_wlan_startup which is called by probe is beast of a
function to maintain. Over time it has grown to such an extent
that it is almost 800 lines of code with in a single function.
Divide the beast into logical smaller functions.

This is the first phase of changes to add a separate function to
allocate and initialize HDD context.

Change-Id: I35b6c95c1b09f853e83752123c44e8d21c8af50a
CRs-fixed: 959287
parent 71b3d724
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved.
 * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
 *
 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
 *
@@ -247,7 +247,6 @@ static void cdf_timer_clean(void);
 */
void cdf_mc_timer_manager_init(void)
{
	/* Initalizing the list with maximum size of 60000 */
	cdf_list_init(&cdf_timer_list, 1000);
	cdf_spinlock_init(&cdf_timer_list_lock);
	return;
+1 −1
Original line number Diff line number Diff line
@@ -187,7 +187,7 @@ void cds_deinit(void);

CDF_STATUS cds_pre_enable(v_CONTEXT_t cds_context);

CDF_STATUS cds_open(v_CONTEXT_t *p_cds_context, uint32_t hddContextSize);
CDF_STATUS cds_open(void);

CDF_STATUS cds_enable(v_CONTEXT_t cds_context);

+4 −5
Original line number Diff line number Diff line
@@ -152,8 +152,6 @@ static void cds_set_nan_enable(tMacOpenParameters *param,

/**
 * cds_open() - open the CDS Module
 * @p_cds_context: A pointer to where the CDS Context was stored
 * @hddContextSize: Size of the HDD context to allocate.
 *
 * cds_open() function opens the CDS Scheduler
 * Upon successful initialization:
@@ -166,7 +164,7 @@ static void cds_set_nan_enable(tMacOpenParameters *param,
 *
 * Return: CDF status
 */
CDF_STATUS cds_open(v_CONTEXT_t *p_cds_context, uint32_t hddContextSize)
CDF_STATUS cds_open(void)
{
	CDF_STATUS cdf_status = CDF_STATUS_SUCCESS;
	int iter = 0;
@@ -447,8 +445,6 @@ CDF_STATUS cds_open(v_CONTEXT_t *p_cds_context, uint32_t hddContextSize)
	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
		  "%s: CDS successfully Opened", __func__);

	*p_cds_context = gp_cds_context;

	return CDF_STATUS_SUCCESS;

err_sme_close:
@@ -836,6 +832,9 @@ CDF_STATUS cds_close(v_CONTEXT_t cds_context)
	}

	cds_deinit_log_completion();

	gp_cds_context->pHDDContext = NULL;

	return CDF_STATUS_SUCCESS;
}

+3 −6
Original line number Diff line number Diff line
@@ -259,11 +259,8 @@ void cds_pkt_proto_trace_init(void)
	/* Init spin lock to protect global memory */
	cdf_spinlock_init(&trace_buffer_lock);
	trace_buffer_order = 0;
	trace_buffer =
		cdf_mem_malloc(CDS_PKT_TRAC_MAX_TRACE_BUF *
			       sizeof(cds_pkt_proto_trace_t));
	cdf_mem_zero((void *)trace_buffer,
		     CDS_PKT_TRAC_MAX_TRACE_BUF *

	trace_buffer = cdf_mem_malloc(CDS_PKT_TRAC_MAX_TRACE_BUF *
				      sizeof(cds_pkt_proto_trace_t));

	/* Register callback function to NBUF
+3 −0
Original line number Diff line number Diff line
@@ -607,6 +607,7 @@ int hdd_set_tdls_offchannel(hdd_context_t *hdd_ctx, int offchannel);
int hdd_set_tdls_secoffchanneloffset(hdd_context_t *hdd_ctx, int offchanoffset);
int hdd_set_tdls_offchannelmode(hdd_adapter_t *adapter, int offchanmode);
int hdd_set_tdls_scan_type(hdd_context_t *hdd_ctx, int val);
void hdd_tdls_pre_init(hdd_context_t *hdd_ctx);

#else
static inline void hdd_tdls_notify_mode_change(hdd_adapter_t *adapter,
@@ -620,6 +621,8 @@ wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx)
static inline void wlan_hdd_tdls_exit(hdd_adapter_t *adapter)
{
}

static inline void hdd_tdls_pre_init(hdd_context_t *hdd_ctx) { }
#endif /* End of FEATURE_WLAN_TDLS */

#endif /* __HDD_TDLS_H */
Loading