qcacld-3.0: Add QDF lock API's

Replace CDF lock API's with QDF lock API's.

Change-Id: I7c4a59920e17915f077c87457c513e763738c062
CRs-Fixed: 981188
This commit is contained in:
Anurag Chouhan
2016-02-21 14:53:42 +05:30
کامیت شده توسط Gerrit - the friendly Code Review server
والد 6d760664ee
کامیت a37b5b783a
87فایلهای تغییر یافته به همراه810 افزوده شده و 2020 حذف شده

مشاهده پرونده

@@ -51,7 +51,7 @@
#include <cdf_net_types.h> /* CDF_NBUF_EXEMPT_NO_EXEMPTION, etc. */
#include <cdf_nbuf.h> /* cdf_nbuf_t, etc. */
#include <cdf_util.h> /* cdf_assert */
#include <cdf_lock.h> /* cdf_spinlock */
#include <qdf_lock.h> /* cdf_spinlock */
#include <cds_queue.h> /* TAILQ */
#include <qdf_time.h>
#include <qdf_timer.h>
@@ -131,18 +131,18 @@
#define DFS_EXT_CHAN_LOADING_THRESH 30
#define DFS_DEFAULT_PRI_MARGIN 6
#define DFS_DEFAULT_FIXEDPATTERN_PRI_MARGIN 4
#define ATH_DFSQ_LOCK(_dfs) cdf_spin_lock_bh((&(_dfs)->dfs_radarqlock))
#define ATH_DFSQ_UNLOCK(_dfs) cdf_spin_unlock_bh((&(_dfs)->dfs_radarqlock))
#define ATH_DFSQ_LOCK_INIT(_dfs) cdf_spinlock_init(&(_dfs)->dfs_radarqlock)
#define ATH_DFSQ_LOCK(_dfs) qdf_spin_lock_bh((&(_dfs)->dfs_radarqlock))
#define ATH_DFSQ_UNLOCK(_dfs) qdf_spin_unlock_bh((&(_dfs)->dfs_radarqlock))
#define ATH_DFSQ_LOCK_INIT(_dfs) qdf_spinlock_create(&(_dfs)->dfs_radarqlock)
#define ATH_ARQ_LOCK(_dfs) cdf_spin_lock_bh((&(_dfs)->dfs_arqlock))
#define ATH_ARQ_UNLOCK(_dfs) cdf_spin_unlock_bh((&(_dfs)->dfs_arqlock))
#define ATH_ARQ_LOCK_INIT(_dfs) cdf_spinlock_init(&(_dfs)->dfs_arqlock)
#define ATH_ARQ_LOCK(_dfs) qdf_spin_lock_bh((&(_dfs)->dfs_arqlock))
#define ATH_ARQ_UNLOCK(_dfs) qdf_spin_unlock_bh((&(_dfs)->dfs_arqlock))
#define ATH_ARQ_LOCK_INIT(_dfs) qdf_spinlock_create(&(_dfs)->dfs_arqlock)
#define ATH_DFSEVENTQ_LOCK(_dfs) cdf_spin_lock_bh((&(_dfs)->dfs_eventqlock))
#define ATH_DFSEVENTQ_UNLOCK(_dfs) cdf_spin_unlock_bh((&(_dfs)->dfs_eventqlock))
#define ATH_DFSEVENTQ_LOCK(_dfs) qdf_spin_lock_bh((&(_dfs)->dfs_eventqlock))
#define ATH_DFSEVENTQ_UNLOCK(_dfs) qdf_spin_unlock_bh((&(_dfs)->dfs_eventqlock))
#define ATH_DFSEVENTQ_LOCK_INIT(_dfs) \
cdf_spinlock_init((&(_dfs)->dfs_eventqlock))
qdf_spinlock_create((&(_dfs)->dfs_eventqlock))
/* Mask for time stamp from descriptor */
#define DFS_TSMASK 0xFFFFFFFF
/* Shift for time stamp from descriptor */
@@ -222,7 +222,7 @@
#define DFS_ETSI_TYPE3_WAR_PRI_UPPER_LIMIT 435
#define DFS_ETSI_WAR_VALID_PULSE_DURATION 15
typedef cdf_spinlock_t dfsq_lock_t;
typedef qdf_spinlock_t dfsq_lock_t;
#ifdef WIN32
#pragma pack(push, dfs_pulseparams, 1)

مشاهده پرونده

@@ -169,9 +169,9 @@ static os_timer_func(dfs_task)
*/
OS_CANCEL_TIMER(&dfs->ath_dfstesttimer);
dfs->ath_dfstest = 1;
cdf_spin_lock_bh(&ic->chan_lock);
qdf_spin_lock_bh(&ic->chan_lock);
dfs->ath_dfstest_ieeechan = ic->ic_curchan->ic_ieee;
cdf_spin_unlock_bh(&ic->chan_lock);
qdf_spin_unlock_bh(&ic->chan_lock);
dfs->ath_dfstesttime = 1; /* 1ms */
OS_SET_TIMER(&dfs->ath_dfstesttimer,
dfs->ath_dfstesttime);

مشاهده پرونده

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002-2014 The Linux Foundation. All rights reserved.
* Copyright (c) 2002-2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -27,7 +27,7 @@
/*===========================================================================
dfs_fcc_bin5.c
dfs_fcc_bin5.c
OVERVIEW:
@@ -41,7 +41,7 @@
/*===========================================================================
EDIT HISTORY FOR FILE
EDIT HISTORY FOR FILE
This section contains comments describing changes made to the module.
Notice that changes are listed in reverse chronological order.
@@ -95,15 +95,15 @@ dfs_bin5_check_pulse(struct ath_dfs *dfs, struct dfs_event *re,
!!(re->re_flags & DFS_EVENT_CHECKCHIRP),
!!(re->re_flags & DFS_EVENT_HW_CHIRP),
!!(re->re_flags & DFS_EVENT_SW_CHIRP));
return (0);
return 0;
}
/* Adjust the filter threshold for rssi in non TURBO mode */
cdf_spin_lock_bh(&dfs->ic->chan_lock);
qdf_spin_lock_bh(&dfs->ic->chan_lock);
if (!(dfs->ic->ic_curchan->ic_flags & CHANNEL_TURBO))
b5_rssithresh += br->br_pulse.b5_rssimargin;
cdf_spin_unlock_bh(&dfs->ic->chan_lock);
qdf_spin_unlock_bh(&dfs->ic->chan_lock);
/*
* Check if the pulse is within duration and rssi
@@ -115,7 +115,7 @@ dfs_bin5_check_pulse(struct ath_dfs *dfs, struct dfs_event *re,
DFS_DPRINTK(dfs, ATH_DEBUG_DFS_BIN5,
"%s: dur=%d, rssi=%d - adding!\n",
__func__, (int)re->re_dur, (int)re->re_rssi);
return (1);
return 1;
}
DFS_DPRINTK(dfs, ATH_DEBUG_DFS_BIN5,
@@ -124,7 +124,7 @@ dfs_bin5_check_pulse(struct ath_dfs *dfs, struct dfs_event *re,
(unsigned long long)re->re_full_ts,
(int)re->re_dur, (int)re->re_rssi);
return (0);
return 0;
}
int dfs_bin5_addpulse(struct ath_dfs *dfs, struct dfs_bin5radars *br,
@@ -567,7 +567,7 @@ dfs_check_chirping_merlin(struct ath_dfs *dfs, void *buf, uint16_t datalen,
int same_sign;
int temp;
cdf_spin_lock_bh(&dfs->ic->chan_lock);
qdf_spin_lock_bh(&dfs->ic->chan_lock);
if (IS_CHAN_HT40(dfs->ic->ic_curchan)) {
num_fft_bytes = NUM_FFT_BYTES_HT40;
num_bin_bytes = NUM_BIN_BYTES_HT40;
@@ -598,7 +598,7 @@ dfs_check_chirping_merlin(struct ath_dfs *dfs, void *buf, uint16_t datalen,
upper_mag_byte = UPPER_MAG_BYTE_HT20;
}
cdf_spin_unlock_bh(&dfs->ic->chan_lock);
qdf_spin_unlock_bh(&dfs->ic->chan_lock);
ptr = (uint8_t *) buf;
/*
* sanity check for FFT buffer
@@ -634,7 +634,7 @@ dfs_check_chirping_merlin(struct ath_dfs *dfs, void *buf, uint16_t datalen,
max_index_upper[i] =
(ptr[fft_start + upper_index_byte] >> 2) + num_subchan_bins;
cdf_spin_lock_bh(&dfs->ic->chan_lock);
qdf_spin_lock_bh(&dfs->ic->chan_lock);
if (!IS_CHAN_HT40(dfs->ic->ic_curchan)) {
/*
* for HT20 mode indices are 6 bit signed number
@@ -643,7 +643,7 @@ dfs_check_chirping_merlin(struct ath_dfs *dfs, void *buf, uint16_t datalen,
max_index_upper[i] = 0;
}
cdf_spin_unlock_bh(&dfs->ic->chan_lock);
qdf_spin_unlock_bh(&dfs->ic->chan_lock);
/*
* Reconstruct the maximum magnitude for each sub-channel. Also select
* and flag the max overall magnitude between the two sub-channels.

مشاهده پرونده

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002-2015 The Linux Foundation. All rights reserved.
* Copyright (c) 2002-2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -27,7 +27,7 @@
/*===========================================================================
dfs_misc.c
dfs_misc.c
OVERVIEW:
@@ -41,7 +41,7 @@
/*===========================================================================
EDIT HISTORY FOR FILE
EDIT HISTORY FOR FILE
This section contains comments describing changes made to the module.
Notice that changes are listed in reverse chronological order.
@@ -107,9 +107,9 @@ dfs_get_pri_margin(struct ath_dfs *dfs, int is_extchan_detect,
else
pri_margin = DFS_DEFAULT_PRI_MARGIN;
cdf_spin_lock_bh(&dfs->ic->chan_lock);
qdf_spin_lock_bh(&dfs->ic->chan_lock);
if (IS_CHAN_HT40(dfs->ic->ic_curchan)) {
cdf_spin_unlock_bh(&dfs->ic->chan_lock);
qdf_spin_unlock_bh(&dfs->ic->chan_lock);
ext_chan_busy = dfs->ic->ic_get_ext_busy(dfs->ic);
if (ext_chan_busy >= 0) {
dfs->dfs_rinfo.ext_chan_busy_ts =
@@ -134,7 +134,7 @@ dfs_get_pri_margin(struct ath_dfs *dfs, int is_extchan_detect,
pri_margin -= adjust_pri;
} else {
cdf_spin_unlock_bh(&dfs->ic->chan_lock);
qdf_spin_unlock_bh(&dfs->ic->chan_lock);
}
return pri_margin;
}
@@ -150,9 +150,9 @@ int dfs_get_filter_threshold(struct ath_dfs *dfs, struct dfs_filter *rf,
thresh = rf->rf_threshold;
cdf_spin_lock_bh(&dfs->ic->chan_lock);
qdf_spin_lock_bh(&dfs->ic->chan_lock);
if (IS_CHAN_HT40(dfs->ic->ic_curchan)) {
cdf_spin_unlock_bh(&dfs->ic->chan_lock);
qdf_spin_unlock_bh(&dfs->ic->chan_lock);
ext_chan_busy = dfs->ic->ic_get_ext_busy(dfs->ic);
if (ext_chan_busy >= 0) {
dfs->dfs_rinfo.ext_chan_busy_ts =
@@ -186,7 +186,7 @@ int dfs_get_filter_threshold(struct ath_dfs *dfs, struct dfs_filter *rf,
thresh += adjust_thresh;
} else {
cdf_spin_unlock_bh(&dfs->ic->chan_lock);
qdf_spin_unlock_bh(&dfs->ic->chan_lock);
}
return thresh;
}
@@ -202,7 +202,7 @@ uint32_t dfs_round(int32_t val)
if (rem < 50)
return ival;
else
return (ival + 1);
return ival + 1;
}
struct dfs_ieee80211_channel *ieee80211_get_extchan(struct ieee80211com *ic)
@@ -273,12 +273,12 @@ struct dfs_state *dfs_getchanstate(struct ath_dfs *dfs, uint8_t *index,
if (index != NULL)
*index = (uint8_t) i;
return (rs);
return rs;
}
}
DFS_DPRINTK(dfs, ATH_DEBUG_DFS2, "%s: No more radar states left.\n",
__func__);
return (NULL);
return NULL;
}
#endif /* ATH_SUPPORT_DFS */

مشاهده پرونده

@@ -388,7 +388,7 @@ radar_summary_parse(struct ath_dfs *dfs, const char *buf, size_t len,
* Set pulse duration to 20 us
*/
cdf_spin_lock_bh(&dfs->ic->chan_lock);
qdf_spin_lock_bh(&dfs->ic->chan_lock);
freq = ieee80211_chan2freq(dfs->ic, dfs->ic->ic_curchan);
freq_centre = dfs->ic->ic_curchan->ic_vhtop_ch_freq_seg1;
@@ -399,7 +399,7 @@ radar_summary_parse(struct ath_dfs *dfs, const char *buf, size_t len,
rsu->pulse_duration = 20;
}
cdf_spin_unlock_bh(&dfs->ic->chan_lock);
qdf_spin_unlock_bh(&dfs->ic->chan_lock);
}
static void
@@ -599,7 +599,7 @@ static int tlv_calc_freq_info(struct ath_dfs *dfs, struct rx_radar_status *rs)
return 0;
}
cdf_spin_lock_bh(&dfs->ic->chan_lock);
qdf_spin_lock_bh(&dfs->ic->chan_lock);
/*
* calculate the channel center frequency for
* 160MHz and 80p80 MHz including the legacy
@@ -644,7 +644,7 @@ static int tlv_calc_freq_info(struct ath_dfs *dfs, struct rx_radar_status *rs)
chan_centre += (chan_offset / 2);
}
cdf_spin_unlock_bh(&dfs->ic->chan_lock);
qdf_spin_unlock_bh(&dfs->ic->chan_lock);
/*
* XXX half/quarter rate support!
*/

مشاهده پرونده

@@ -88,7 +88,7 @@ dfs_get_event_freqcentre(struct ath_dfs *dfs, int is_pri, int is_ext, int is_dc)
* based on whether it's an upper or lower channel.
*/
chan_width = dfs_get_event_freqwidth(dfs);
cdf_spin_lock_bh(&ic->chan_lock);
qdf_spin_lock_bh(&ic->chan_lock);
if (IEEE80211_IS_CHAN_11N_HT40PLUS(ic->ic_curchan))
chan_offset = chan_width;
else if (IEEE80211_IS_CHAN_11N_HT40MINUS(ic->ic_curchan))
@@ -96,7 +96,7 @@ dfs_get_event_freqcentre(struct ath_dfs *dfs, int is_pri, int is_ext, int is_dc)
else
chan_offset = 0;
cdf_spin_unlock_bh(&ic->chan_lock);
qdf_spin_unlock_bh(&ic->chan_lock);
/*
* Check for DC events first - the sowl code may just set all
@@ -106,10 +106,10 @@ dfs_get_event_freqcentre(struct ath_dfs *dfs, int is_pri, int is_ext, int is_dc)
/*
* XXX TODO: Should DC events be considered 40MHz wide here?
*/
cdf_spin_lock_bh(&ic->chan_lock);
qdf_spin_lock_bh(&ic->chan_lock);
freq = ieee80211_chan2freq(ic, ic->ic_curchan) +
(chan_offset / 2);
cdf_spin_unlock_bh(&ic->chan_lock);
qdf_spin_unlock_bh(&ic->chan_lock);
return freq;
}
@@ -118,23 +118,23 @@ dfs_get_event_freqcentre(struct ath_dfs *dfs, int is_pri, int is_ext, int is_dc)
* The centre frequency for pri events is still ic_freq.
*/
if (is_pri) {
cdf_spin_lock_bh(&ic->chan_lock);
qdf_spin_lock_bh(&ic->chan_lock);
freq = ieee80211_chan2freq(ic, ic->ic_curchan);
cdf_spin_unlock_bh(&ic->chan_lock);
qdf_spin_unlock_bh(&ic->chan_lock);
return freq;
}
if (is_ext) {
cdf_spin_lock_bh(&ic->chan_lock);
qdf_spin_lock_bh(&ic->chan_lock);
freq = ieee80211_chan2freq(ic, ic->ic_curchan) + chan_width;
cdf_spin_unlock_bh(&ic->chan_lock);
qdf_spin_unlock_bh(&ic->chan_lock);
return freq;
}
/* XXX shouldn't get here */
cdf_spin_lock_bh(&ic->chan_lock);
qdf_spin_lock_bh(&ic->chan_lock);
freq = ieee80211_chan2freq(ic, ic->ic_curchan);
cdf_spin_unlock_bh(&ic->chan_lock);
qdf_spin_unlock_bh(&ic->chan_lock);
return freq;
}
@@ -514,16 +514,16 @@ dfs_process_phyerr(struct ieee80211com *ic, void *buf, uint16_t datalen,
return;
}
cdf_spin_lock_bh(&ic->chan_lock);
qdf_spin_lock_bh(&ic->chan_lock);
if (IEEE80211_IS_CHAN_RADAR(chan)) {
cdf_spin_unlock_bh(&ic->chan_lock);
qdf_spin_unlock_bh(&ic->chan_lock);
DFS_DPRINTK(dfs, ATH_DEBUG_DFS1,
"%s: Radar already found in the channel, "
" do not queue radar data\n", __func__);
return;
}
cdf_spin_unlock_bh(&ic->chan_lock);
qdf_spin_unlock_bh(&ic->chan_lock);
dfs->ath_dfs_stats.total_phy_errors++;
DFS_DPRINTK(dfs, ATH_DEBUG_DFS2,
"%s[%d] phyerr %d len %d\n",
@@ -711,9 +711,9 @@ dfs_process_phyerr(struct ieee80211com *ic, void *buf, uint16_t datalen,
* for the adaptive radio (AR) pattern matching rather than
* radar detection.
*/
cdf_spin_lock_bh(&ic->chan_lock);
qdf_spin_lock_bh(&ic->chan_lock);
if ((chan->ic_flags & CHANNEL_108G) == CHANNEL_108G) {
cdf_spin_unlock_bh(&ic->chan_lock);
qdf_spin_unlock_bh(&ic->chan_lock);
if (!(dfs->dfs_proc_phyerr & DFS_AR_EN)) {
DFS_DPRINTK(dfs, ATH_DEBUG_DFS2,
"%s: DFS_AR_EN not enabled\n", __func__);
@@ -763,7 +763,7 @@ dfs_process_phyerr(struct ieee80211com *ic, void *buf, uint16_t datalen,
ATH_ARQ_UNLOCK(dfs);
} else {
if (IEEE80211_IS_CHAN_DFS(chan)) {
cdf_spin_unlock_bh(&ic->chan_lock);
qdf_spin_unlock_bh(&ic->chan_lock);
if (!(dfs->dfs_proc_phyerr & DFS_RADAR_EN)) {
DFS_DPRINTK(dfs, ATH_DEBUG_DFS3,
"%s: DFS_RADAR_EN not enabled\n",
@@ -857,7 +857,7 @@ dfs_process_phyerr(struct ieee80211com *ic, void *buf, uint16_t datalen,
STAILQ_INSERT_TAIL(&(dfs->dfs_radarq), event, re_list);
ATH_DFSQ_UNLOCK(dfs);
} else {
cdf_spin_unlock_bh(&ic->chan_lock);
qdf_spin_unlock_bh(&ic->chan_lock);
}
}

مشاهده پرونده

@@ -141,9 +141,9 @@ int dfs_process_radarevent(struct ath_dfs *dfs,
"%s[%d]: dfs is NULL", __func__, __LINE__);
return 0;
}
cdf_spin_lock_bh(&dfs->ic->chan_lock);
qdf_spin_lock_bh(&dfs->ic->chan_lock);
if (!(IEEE80211_IS_CHAN_DFS(dfs->ic->ic_curchan))) {
cdf_spin_unlock_bh(&dfs->ic->chan_lock);
qdf_spin_unlock_bh(&dfs->ic->chan_lock);
DFS_DPRINTK(dfs, ATH_DEBUG_DFS2,
"%s: radar event on non-DFS chan", __func__);
dfs_reset_radarq(dfs);
@@ -155,7 +155,7 @@ int dfs_process_radarevent(struct ath_dfs *dfs,
return 0;
}
cdf_spin_unlock_bh(&dfs->ic->chan_lock);
qdf_spin_unlock_bh(&dfs->ic->chan_lock);
#ifndef ATH_DFS_RADAR_DETECTION_ONLY
/* TEST : Simulate radar bang, make sure we add the channel to NOL (bug 29968) */
if (dfs->dfs_bangradar) {
@@ -235,16 +235,16 @@ int dfs_process_radarevent(struct ath_dfs *dfs,
ATH_DFSEVENTQ_UNLOCK(dfs);
found = 0;
cdf_spin_lock_bh(&dfs->ic->chan_lock);
qdf_spin_lock_bh(&dfs->ic->chan_lock);
if (dfs->ic->disable_phy_err_processing) {
ATH_DFSQ_LOCK(dfs);
empty = STAILQ_EMPTY(&(dfs->dfs_radarq));
ATH_DFSQ_UNLOCK(dfs);
cdf_spin_unlock_bh(&dfs->ic->chan_lock);
qdf_spin_unlock_bh(&dfs->ic->chan_lock);
continue;
}
cdf_spin_unlock_bh(&dfs->ic->chan_lock);
qdf_spin_unlock_bh(&dfs->ic->chan_lock);
if (re.re_chanindex < DFS_NUM_RADAR_STATES)
rs = &dfs->dfs_radar[re.re_chanindex];
else {
@@ -848,15 +848,15 @@ dfsfound:
DFS_DPRINTK(dfs, ATH_DEBUG_DFS1,
"Primary channel freq = %u flags=0x%x",
chan->ic_freq, chan->ic_flagext);
cdf_spin_lock_bh(&dfs->ic->chan_lock);
qdf_spin_lock_bh(&dfs->ic->chan_lock);
if ((dfs->ic->ic_curchan->ic_freq != thischan->ic_freq)) {
cdf_spin_unlock_bh(&dfs->ic->chan_lock);
qdf_spin_unlock_bh(&dfs->ic->chan_lock);
DFS_DPRINTK(dfs, ATH_DEBUG_DFS1,
"Ext channel freq = %u flags=0x%x",
thischan->ic_freq, thischan->ic_flagext);
}
cdf_spin_unlock_bh(&dfs->ic->chan_lock);
qdf_spin_unlock_bh(&dfs->ic->chan_lock);
dfs->dfs_phyerr_freq_min = 0x7fffffff;
dfs->dfs_phyerr_freq_max = 0;
dfs->dfs_phyerr_w53_counter = 0;