Bladeren bron

qcacld-3.0: Fix namespace collision in DFS module

Fix namespace collision of the DFS module
with userspace.

Change-Id: I4ca582e9cb5713238cbae3060005375682fc8806
CRs-Fixed: 935515
Chandrasekaran, Manishekar 9 jaren geleden
bovenliggende
commit
65b4dcbffd

+ 6 - 5
core/sap/dfs/inc/dfs.h

@@ -409,7 +409,7 @@ struct dfs_filtertype {
 };
 
 struct dfs_state {
-	struct ieee80211_channel rs_chan;       /* Channel info */
+	struct dfs_ieee80211_channel rs_chan;       /* Channel info */
 	uint8_t rs_chanindex;   /* Channel index in radar structure */
 	uint32_t rs_numradarevents;     /* Number of radar events */
 
@@ -728,10 +728,11 @@ int dfs_set_thresholds(struct ieee80211com *ic,
 		       const uint32_t threshtype, const uint32_t value);
 
 /* PHY error and radar event handling */
-int dfs_process_radarevent(struct ath_dfs *dfs, struct ieee80211_channel *chan);
+int dfs_process_radarevent(struct ath_dfs *dfs,
+				struct dfs_ieee80211_channel *chan);
 
 /* Non occupancy (NOL) handling prototypes */
-void dfs_nol_addchan(struct ath_dfs *dfs, struct ieee80211_channel *chan,
+void dfs_nol_addchan(struct ath_dfs *dfs, struct dfs_ieee80211_channel *chan,
 		     uint32_t dfs_nol_timeout);
 void dfs_get_nol(struct ath_dfs *dfs, struct dfsreq_nolelem *dfs_nol,
 		 int *nchan);
@@ -803,7 +804,7 @@ int dfs_get_filter_threshold(struct ath_dfs *dfs, struct dfs_filter *rf,
 /* Commenting out since all the ar functions are obsolete and
  * the function definition has been removed as part of dfs_ar.c
  * void dfs_process_ar_event(struct ath_dfs *dfs,
- *	struct ieee80211_channel *chan);
+ *	struct dfs_ieee80211_channel *chan);
  */
 /* Commenting out since all the ar functions are obsolete and
  * the function definition has been removed as part of dfs_ar.c
@@ -819,6 +820,6 @@ void dfs_reset_ar(struct ath_dfs *dfs);
  * void        dfs_reset_arq(struct ath_dfs *dfs);
  */
 
-struct ieee80211_channel *ieee80211_get_extchan(struct ieee80211com *ic);
+struct dfs_ieee80211_channel *ieee80211_get_extchan(struct ieee80211com *ic);
 
 #endif /* _DFS_H_ */

+ 2 - 2
core/sap/dfs/src/dfs.c

@@ -85,7 +85,7 @@ uint32_t dfs_debug_level = ATH_DEBUG_DFS;
  * both the primary and extension.
  */
 static void
-dfs_channel_mark_radar(struct ath_dfs *dfs, struct ieee80211_channel *chan)
+dfs_channel_mark_radar(struct ath_dfs *dfs, struct dfs_ieee80211_channel *chan)
 {
 	struct ieee80211_channel_list chan_info;
 	int i;
@@ -535,7 +535,7 @@ int dfs_radar_enable(struct ieee80211com *ic,
 	/* uint32_t                        rfilt; */
 	struct ath_dfs *dfs;
 	struct dfs_state *rs_pri, *rs_ext;
-	struct ieee80211_channel *chan = ic->ic_curchan, *ext_ch = NULL;
+	struct dfs_ieee80211_channel *chan = ic->ic_curchan, *ext_ch = NULL;
 	is_ext_ch = IEEE80211_IS_CHAN_11N_HT40(ic->ic_curchan);
 	dfs = (struct ath_dfs *)ic->ic_dfs;
 	rs_pri = NULL;

+ 3 - 3
core/sap/dfs/src/dfs_misc.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002-2014 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2002-2015 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -205,7 +205,7 @@ uint32_t dfs_round(int32_t val)
 		return (ival + 1);
 }
 
-struct ieee80211_channel *ieee80211_get_extchan(struct ieee80211com *ic)
+struct dfs_ieee80211_channel *ieee80211_get_extchan(struct ieee80211com *ic)
 {
 	int chan_offset = 0;
 	if (IEEE80211_IS_CHAN_HT40PLUS_CAPABLE(ic->ic_curchan)) {
@@ -228,7 +228,7 @@ struct dfs_state *dfs_getchanstate(struct ath_dfs *dfs, uint8_t *index,
 {
 	struct dfs_state *rs = NULL;
 	int i;
-	struct ieee80211_channel *cmp_ch;
+	struct dfs_ieee80211_channel *cmp_ch;
 
 	if (dfs == NULL) {
 		printk("%s[%d]: sc_dfs is NULL\n", __func__, __LINE__);

+ 2 - 2
core/sap/dfs/src/dfs_nol.c

@@ -149,7 +149,7 @@ void dfs_set_nol(struct ath_dfs *dfs, struct dfsreq_nolelem *dfs_nol, int nchan)
 {
 #define TIME_IN_MS 1000
 	uint32_t nol_time_left_ms;
-	struct ieee80211_channel chan;
+	struct dfs_ieee80211_channel chan;
 	int i;
 
 	if (dfs == NULL) {
@@ -177,7 +177,7 @@ void dfs_set_nol(struct ath_dfs *dfs, struct dfsreq_nolelem *dfs_nol, int nchan)
 }
 
 void
-dfs_nol_addchan(struct ath_dfs *dfs, struct ieee80211_channel *chan,
+dfs_nol_addchan(struct ath_dfs *dfs, struct dfs_ieee80211_channel *chan,
 		uint32_t dfs_nol_timeout)
 {
 #define TIME_IN_MS 1000

+ 1 - 1
core/sap/dfs/src/dfs_process_phyerr.c

@@ -474,7 +474,7 @@ dfs_process_phyerr(struct ieee80211com *ic, void *buf, uint16_t datalen,
 		   uint64_t r_fulltsf, bool enable_log)
 {
 	struct ath_dfs *dfs = (struct ath_dfs *)ic->ic_dfs;
-	struct ieee80211_channel *chan = ic->ic_curchan;
+	struct dfs_ieee80211_channel *chan = ic->ic_curchan;
 	struct dfs_event *event;
 	struct dfs_phy_err e;
 	int empty;

+ 3 - 2
core/sap/dfs/src/dfs_process_radarevent.c

@@ -112,7 +112,8 @@ static inline uint8_t dfs_process_pulse_dur(struct ath_dfs *dfs, uint8_t re_dur)
  * and ext channels as being unavailable.  This should be fixed for 802.11ac
  * or we'll quickly run out of valid channels to use.
  */
-int dfs_process_radarevent(struct ath_dfs *dfs, struct ieee80211_channel *chan)
+int dfs_process_radarevent(struct ath_dfs *dfs,
+				struct dfs_ieee80211_channel *chan)
 {
 /* commenting for now to validate radar indication msg to SAP */
 /* #if 0 */
@@ -124,7 +125,7 @@ int dfs_process_radarevent(struct ath_dfs *dfs, struct ieee80211_channel *chan)
 	int events_processed = 0;
 	uint32_t tabledepth, index;
 	uint64_t deltafull_ts = 0, this_ts, deltaT;
-	struct ieee80211_channel *thischan;
+	struct dfs_ieee80211_channel *thischan;
 	struct dfs_pulseline *pl;
 	static uint32_t test_ts = 0;
 	static uint32_t diff_ts = 0;

+ 3 - 3
core/wma/inc/wma.h

@@ -1900,7 +1900,7 @@ A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
 int ol_if_dfs_attach(struct ieee80211com *ic, void *ptr, void *radar_info);
 uint64_t ol_if_get_tsf64(struct ieee80211com *ic);
 int ol_if_dfs_disable(struct ieee80211com *ic);
-struct ieee80211_channel *ieee80211_find_channel(struct ieee80211com *ic,
+struct dfs_ieee80211_channel *ieee80211_find_channel(struct ieee80211com *ic,
 						 int freq, uint32_t flags);
 int ol_if_dfs_enable(struct ieee80211com *ic, int *is_fastclk, void *pe);
 uint32_t ieee80211_ieee2mhz(uint32_t chan, uint32_t flags);
@@ -1910,9 +1910,9 @@ int ol_if_dfs_get_mib_cycle_counts_pct(struct ieee80211com *ic,
 				       uint32_t *txf_pcnt);
 uint16_t ol_if_dfs_usenol(struct ieee80211com *ic);
 void ieee80211_mark_dfs(struct ieee80211com *ic,
-			struct ieee80211_channel *ichan);
+			struct dfs_ieee80211_channel *ichan);
 int wma_dfs_indicate_radar(struct ieee80211com *ic,
-			   struct ieee80211_channel *ichan);
+			   struct dfs_ieee80211_channel *ichan);
 uint16_t dfs_usenol(struct ieee80211com *ic);
 
 CDF_STATUS wma_trigger_uapsd_params(tp_wma_handle wma_handle, uint32_t vdev_id,

+ 18 - 18
core/wma/inc/wma_dfs_interface.h

@@ -49,8 +49,6 @@
 #define IEEE80211_CHAN_DYN              0x00000400
 /* GFSK channel (FHSS PHY) */
 #define IEEE80211_CHAN_GFSK             0x00000800
-/* Radar found on channel */
-#define IEEE80211_CHAN_RADAR            0x00001000
 /* 11a static turbo channel only */
 #define IEEE80211_CHAN_STURBO           0x00002000
 /* Half rate channel */
@@ -75,9 +73,9 @@
 #define IEEE80211_CHAN_VHT80            0x00800000
 
 /* token for ``any channel'' */
-#define IEEE80211_CHAN_ANY      (-1)
-#define IEEE80211_CHAN_ANYC \
-	((struct ieee80211_channel *) IEEE80211_CHAN_ANY)
+#define DFS_IEEE80211_CHAN_ANY      (-1)
+#define DFS_IEEE80211_CHAN_ANYC \
+	((struct dfs_ieee80211_channel *) DFS_IEEE80211_CHAN_ANY)
 
 #define IEEE80211_IS_CHAN_11N_HT40MINUS(_c) \
 	(((_c)->ic_flags & IEEE80211_CHAN_HT40MINUS) != 0)
@@ -102,7 +100,7 @@
 #define IEE80211_MAX_20M_SUB_CH 8
 
 /**
- * struct ieee80211_channel - channel info
+ * struct dfs_ieee80211_channel - channel info
  * @ic_freq: frequency in MHz
  * @ic_flags: channel flags
  * @ic_flagext: flags extension
@@ -116,7 +114,7 @@
  * @ic_vhtop_ch_freq_seg2: Channel Center frequency applicable
  * @ic_pri_freq_center_freq_mhz_separation: separation b/w pri and center freq
  */
-struct ieee80211_channel {
+struct dfs_ieee80211_channel {
 	uint32_t ic_freq;
 	uint32_t ic_flags;
 	uint8_t ic_flagext;
@@ -138,7 +136,7 @@ struct ieee80211_channel {
  */
 struct ieee80211_channel_list {
 	int cl_nchans;
-	struct ieee80211_channel *cl_channels[IEE80211_MAX_20M_SUB_CH];
+	struct dfs_ieee80211_channel *cl_channels[IEE80211_MAX_20M_SUB_CH];
 };
 
 /**
@@ -157,8 +155,8 @@ struct ieee80211_dfs_state {
 	os_timer_t nol_timer;
 	os_timer_t cac_timer;
 	int cureps;
-	const struct ieee80211_channel *lastchan;
-	struct ieee80211_channel *newchan;
+	const struct dfs_ieee80211_channel *lastchan;
+	struct dfs_ieee80211_channel *newchan;
 	int cac_timeout_override;
 	uint8_t enable : 1, cac_timer_running : 1, ignore_dfs : 1, ignore_cac : 1;
 };
@@ -180,13 +178,13 @@ typedef struct ieee80211com {
 	void (*ic_get_ext_chan_info)(struct ieee80211com *ic,
 				     struct ieee80211_channel_list *chan);
 	enum ieee80211_opmode ic_opmode;
-	struct ieee80211_channel *(*ic_find_channel)(struct ieee80211com *ic,
-						     int freq, uint32_t flags);
+	struct dfs_ieee80211_channel *(*ic_find_channel)
+			(struct ieee80211com *ic, int freq, uint32_t flags);
 	uint64_t (*ic_get_TSF64)(struct ieee80211com *ic);
 	unsigned int (*ic_ieee2mhz)(u_int chan, u_int flags);
-	struct ieee80211_channel ic_channels[IEEE80211_CHAN_MAX + 1];
+	struct dfs_ieee80211_channel ic_channels[IEEE80211_CHAN_MAX + 1];
 	int ic_nchans;
-	struct ieee80211_channel *ic_curchan;
+	struct dfs_ieee80211_channel *ic_curchan;
 	uint8_t ic_isdfsregdomain;
 	int (*ic_get_dfsdomain)(struct ieee80211com *);
 	uint16_t (*ic_dfs_usenol)(struct ieee80211com *ic);
@@ -222,9 +220,9 @@ typedef struct ieee80211com {
 	void (*ic_dfs_clist_update)(struct ieee80211com *ic, int cmd,
 				    struct dfs_nol_chan_entry *, int nentries);
 	void (*ic_dfs_notify_radar)(struct ieee80211com *ic,
-				    struct ieee80211_channel *chan);
+				    struct dfs_ieee80211_channel *chan);
 	void (*ic_dfs_unmark_radar)(struct ieee80211com *ic,
-				    struct ieee80211_channel *chan);
+				    struct dfs_ieee80211_channel *chan);
 	int (*ic_dfs_control)(struct ieee80211com *ic,
 			      u_int id, void *indata, uint32_t insize,
 			      void *outdata, uint32_t *outsize);
@@ -244,10 +242,12 @@ typedef struct ieee80211com {
  * Return: freqency in MHz
  */
 static INLINE u_int
-ieee80211_chan2freq(struct ieee80211com *ic, const struct ieee80211_channel *c)
+ieee80211_chan2freq(struct ieee80211com *ic,
+			const struct dfs_ieee80211_channel *c)
 {
 	if (c == NULL) {
 		return 0;
 	}
-	return (c == IEEE80211_CHAN_ANYC ? IEEE80211_CHAN_ANY : c->ic_freq);
+	return (c == DFS_IEEE80211_CHAN_ANYC) ?
+			DFS_IEEE80211_CHAN_ANY : c->ic_freq;
 }

+ 6 - 5
core/wma/inc/wma_internal.h

@@ -1062,11 +1062,12 @@ void wma_dfs_detach(struct ieee80211com *dfs_ic);
 
 void wma_dfs_configure(struct ieee80211com *ic);
 
-struct ieee80211_channel *wma_dfs_configure_channel(struct ieee80211com *dfs_ic,
-						    wmi_channel *chan,
-						    WLAN_PHY_MODE chanmode,
-						    struct wma_vdev_start_req
-						    *req);
+struct dfs_ieee80211_channel *wma_dfs_configure_channel(
+						struct ieee80211com *dfs_ic,
+						wmi_channel *chan,
+						WLAN_PHY_MODE chanmode,
+						struct wma_vdev_start_req
+						*req);
 void wma_set_sap_keepalive(tp_wma_handle wma, uint8_t vdev_id);
 
 #ifdef REMOVE_PKT_LOG

+ 4 - 4
core/wma/src/wma_dfs_interface.c

@@ -104,12 +104,12 @@ int ol_if_dfs_disable(struct ieee80211com *ic)
  * This verifies that found channels have not been
  * excluded because of 11d.
  *
- * Return: returns ieee80211_channel or NULL for error
+ * Return: returns dfs_ieee80211_channel or NULL for error
  */
-struct ieee80211_channel *ieee80211_find_channel(struct ieee80211com *ic,
+struct dfs_ieee80211_channel *ieee80211_find_channel(struct ieee80211com *ic,
 						 int freq, uint32_t flags)
 {
-	struct ieee80211_channel *c;
+	struct dfs_ieee80211_channel *c;
 	int i;
 
 	flags &= IEEE80211_CHAN_ALLTURBO;
@@ -238,7 +238,7 @@ uint16_t ol_if_dfs_usenol(struct ieee80211com *ic)
  * Return: none
  */
 void
-ieee80211_mark_dfs(struct ieee80211com *ic, struct ieee80211_channel *ichan)
+ieee80211_mark_dfs(struct ieee80211com *ic, struct dfs_ieee80211_channel *ichan)
 {
 	int status;
 	status = wma_dfs_indicate_radar(ic, ichan);

+ 18 - 15
core/wma/src/wma_features.c

@@ -1694,7 +1694,7 @@ static int wma_unified_dfs_radar_rx_event_handler(void *handle,
 	struct ieee80211com *ic;
 	struct ath_dfs *dfs;
 	struct dfs_event *event;
-	struct ieee80211_channel *chan;
+	struct dfs_ieee80211_channel *chan;
 	int empty;
 	int do_check_chirp = 0;
 	int is_hw_chirp = 0;
@@ -6752,13 +6752,14 @@ void wma_dfs_configure(struct ieee80211com *ic)
  * Also,configure the DFS radar filters for
  * matching the DFS phyerrors.
  *
- * Return: ieee80211 channel / NULL for error
+ * Return: dfs_ieee80211_channel / NULL for error
  */
-struct ieee80211_channel *wma_dfs_configure_channel(struct ieee80211com *dfs_ic,
-						    wmi_channel *chan,
-						    WLAN_PHY_MODE chanmode,
-						    struct wma_vdev_start_req
-						    *req)
+struct dfs_ieee80211_channel *wma_dfs_configure_channel(
+						struct ieee80211com *dfs_ic,
+						wmi_channel *chan,
+						WLAN_PHY_MODE chanmode,
+						struct wma_vdev_start_req
+						*req)
 {
 	if (dfs_ic == NULL) {
 		WMA_LOGE("%s: DFS ic is Invalid", __func__);
@@ -6766,17 +6767,19 @@ struct ieee80211_channel *wma_dfs_configure_channel(struct ieee80211com *dfs_ic,
 	}
 
 	if (!dfs_ic->ic_curchan) {
-		dfs_ic->ic_curchan = (struct ieee80211_channel *)os_malloc(NULL,
-					sizeof(struct ieee80211_channel),
-								   GFP_ATOMIC);
+		dfs_ic->ic_curchan = (struct dfs_ieee80211_channel *)os_malloc(
+					NULL,
+					sizeof(struct dfs_ieee80211_channel),
+					GFP_ATOMIC);
 		if (dfs_ic->ic_curchan == NULL) {
-			WMA_LOGE("%s: allocation of dfs_ic->ic_curchan failed %zu",
-				 __func__, sizeof(struct ieee80211_channel));
+			WMA_LOGE(
+			    "%s: allocation of dfs_ic->ic_curchan failed %zu",
+			    __func__, sizeof(struct dfs_ieee80211_channel));
 			return NULL;
 		}
 	}
 
-	OS_MEMZERO(dfs_ic->ic_curchan, sizeof(struct ieee80211_channel));
+	OS_MEMZERO(dfs_ic->ic_curchan, sizeof(struct dfs_ieee80211_channel));
 
 	dfs_ic->ic_curchan->ic_ieee = req->chan;
 	dfs_ic->ic_curchan->ic_freq = chan->mhz;
@@ -6853,7 +6856,7 @@ void wma_set_dfs_region(tp_wma_handle wma, uint8_t dfs_region)
  *
  * Return: return number of channels
  */
-int wma_get_channels(struct ieee80211_channel *ichan,
+int wma_get_channels(struct dfs_ieee80211_channel *ichan,
 		     struct wma_dfs_radar_channel_list *chan_list)
 {
 	uint8_t center_chan = cds_freq_to_chan(ichan->ic_vhtop_ch_freq_seg1);
@@ -6888,7 +6891,7 @@ int wma_get_channels(struct ieee80211_channel *ichan,
  * Return: 0 for success or error code
  */
 int wma_dfs_indicate_radar(struct ieee80211com *ic,
-			   struct ieee80211_channel *ichan)
+			   struct dfs_ieee80211_channel *ichan)
 {
 	tp_wma_handle wma;
 	void *hdd_ctx;