Advertisement
Guest User

Untitled

a guest
Oct 10th, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 315.08 KB | None | 0 0
  1. diff --git a/drivers/staging/qcacld-2.0/Android.mk b/drivers/staging/qcacld-2.0/Android.mk
  2. index acaf71fa..c16d390 100644
  3. --- a/drivers/staging/qcacld-2.0/Android.mk
  4. +++ b/drivers/staging/qcacld-2.0/Android.mk
  5. @@ -60,10 +60,14 @@ KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
  6. KBUILD_OPTIONS += $(WLAN_SELECT)
  7. KBUILD_OPTIONS += WLAN_OPEN_SOURCE=$(WLAN_OPEN_SOURCE)
  8.  
  9. +ifdef CNSS_LOCALE
  10. +KBUILD_OPTIONS += CNSS_LOCALE=$(CNSS_LOCALE)
  11. +endif
  12. +
  13. include $(CLEAR_VARS)
  14. LOCAL_MODULE := $(WLAN_CHIPSET)_wlan.ko
  15. LOCAL_MODULE_KBUILD_NAME := wlan.ko
  16. -LOCAL_MODULE_TAGS := debug
  17. +LOCAL_MODULE_TAGS := optional
  18. LOCAL_MODULE_DEBUG_ENABLE := true
  19. LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET)
  20. include $(DLKM_DIR)/AndroidKernelModule.mk
  21. @@ -85,7 +89,6 @@ endif
  22. $(shell mkdir -p $(TARGET_OUT)/lib/modules; \
  23. ln -sf /system/lib/modules/$(WLAN_CHIPSET)/$(WLAN_CHIPSET)_wlan.ko \
  24. $(TARGET_OUT)/lib/modules/wlan.ko)
  25. -$(shell ln -sf /persist/wlan_mac.bin $(TARGET_OUT_ETC)/firmware/wlan/qca_cld/wlan_mac.bin)
  26.  
  27. ifeq ($(call is-board-platform-in-list, msm8960),true)
  28. $(shell ln -sf /firmware/image/bdwlan20.bin $(TARGET_OUT_ETC)/firmware/fakeboar.bin)
  29. diff --git a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/HTT/htt_rx.c b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/HTT/htt_rx.c
  30. index 8018055..2b08427 100644
  31. --- a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/HTT/htt_rx.c
  32. +++ b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/HTT/htt_rx.c
  33. @@ -63,7 +63,7 @@
  34. extern int process_wma_set_command(int sessid, int paramid,
  35. int sval, int vpdev);
  36. #endif
  37. -
  38. +int dumpEnable;
  39. /* AR9888v1 WORKAROUND for EV#112367 */
  40. /* FIX THIS - remove this WAR when the bug is fixed */
  41. #define PEREGRINE_1_0_ZERO_LEN_PHY_ERR_WAR
  42. @@ -812,53 +812,11 @@ htt_rx_print_rx_indication(
  43.  
  44. msg_word = (u_int32_t *)adf_nbuf_data(rx_ind_msg);
  45.  
  46. - adf_os_print("------------------HTT RX IND-----------------------------\n");
  47. - adf_os_print("alloc idx paddr %x (*vaddr) %d\n",
  48. - pdev->rx_ring.alloc_idx.paddr,
  49. - *pdev->rx_ring.alloc_idx.vaddr);
  50. -
  51. - adf_os_print("sw_rd_idx msdu_payld %d msdu_desc %d\n",
  52. - pdev->rx_ring.sw_rd_idx.msdu_payld,
  53. - pdev->rx_ring.sw_rd_idx.msdu_desc);
  54. -
  55. - adf_os_print("dbg_ring_idx %d\n", pdev->rx_ring.dbg_ring_idx);
  56. -
  57. - adf_os_print("fill_level %d fill_cnt %d\n",pdev->rx_ring.fill_level,
  58. - pdev->rx_ring.fill_cnt);
  59. -
  60. - adf_os_print("initial msdu_payld %d curr mpdu range %d curr mpdu cnt %d\n",
  61. - pdev->rx_ring.dbg_initial_msdu_payld,
  62. - pdev->rx_ring.dbg_mpdu_range,
  63. - pdev->rx_ring.dbg_mpdu_count);
  64. -
  65. - /* Print the RX_IND contents */
  66. -
  67. - adf_os_print("peer id %x RV %x FV %x ext_tid %x msg_type %x\n",
  68. - HTT_RX_IND_PEER_ID_GET(*msg_word),
  69. - HTT_RX_IND_REL_VALID_GET(*msg_word),
  70. - HTT_RX_IND_FLUSH_VALID_GET(*msg_word),
  71. - HTT_RX_IND_EXT_TID_GET(*msg_word),
  72. - HTT_T2H_MSG_TYPE_GET(*msg_word));
  73. -
  74. - adf_os_print("num_mpdu_ranges %x rel_seq_num_end %x rel_seq_num_start %x\n"
  75. - " flush_seq_num_end %x flush_seq_num_start %x\n",
  76. - HTT_RX_IND_NUM_MPDU_RANGES_GET(*(msg_word + 1)),
  77. - HTT_RX_IND_REL_SEQ_NUM_END_GET(*(msg_word + 1)),
  78. - HTT_RX_IND_REL_SEQ_NUM_START_GET(*(msg_word + 1)),
  79. - HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(*(msg_word + 1)),
  80. - HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(*(msg_word + 1)));
  81. -
  82. - adf_os_print("fw_rx_desc_bytes %x\n", HTT_RX_IND_FW_RX_DESC_BYTES_GET(
  83. - *(msg_word + 2 + HTT_RX_PPDU_DESC_SIZE32)));
  84.  
  85. /* receive MSDU desc for current frame */
  86. byte_offset = HTT_ENDIAN_BYTE_IDX_SWAP(HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET +
  87. pdev->rx_ind_msdu_byte_idx);
  88.  
  89. - adf_os_print("msdu byte idx %x msdu desc %x\n", pdev->rx_ind_msdu_byte_idx,
  90. - HTT_RX_IND_FW_RX_DESC_BYTES_GET(
  91. - *(msg_word + 2 + HTT_RX_PPDU_DESC_SIZE32)));
  92. -
  93. num_mpdu_range = HTT_RX_IND_NUM_MPDU_RANGES_GET(*(msg_word + 1));
  94.  
  95. for (mpdu_range = 0; mpdu_range < num_mpdu_range; mpdu_range++) {
  96. @@ -868,10 +826,7 @@ htt_rx_print_rx_indication(
  97. htt_rx_ind_mpdu_range_info(
  98. pdev, rx_ind_msg, mpdu_range, &status, &num_mpdus);
  99.  
  100. - adf_os_print("mpdu_range %x status %x num_mpdus %x\n",
  101. - pdev->rx_ind_msdu_byte_idx, status, num_mpdus);
  102. }
  103. - adf_os_print("---------------------------------------------------------\n");
  104. }
  105. #endif
  106.  
  107. @@ -937,6 +892,39 @@ htt_rx_amsdu_pop_ll(
  108. * than the descriptor.
  109. */
  110. adf_nbuf_pull_head(msdu, HTT_RX_STD_DESC_RESERVATION);
  111. + if ((dumpEnable == 1) && (msdu->data_len >= 16)){
  112. + VOS_TRACE(VOS_MODULE_ID_TXRX, VOS_TRACE_LEVEL_ERROR,
  113. + "\n%s: skbuff->data dump**************\n", __func__);
  114. + {
  115. + char *buf = (char *)msdu->data;
  116. + int i;
  117. +
  118. + for (i=0; (i+15)< 64; i+=16)
  119. + {
  120. + VOS_TRACE(VOS_MODULE_ID_TXRX, VOS_TRACE_LEVEL_ERROR,
  121. + "%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
  122. + buf[i],
  123. + buf[i+1],
  124. + buf[i+2],
  125. + buf[i+3],
  126. + buf[i+4],
  127. + buf[i+5],
  128. + buf[i+6],
  129. + buf[i+7],
  130. + buf[i+8],
  131. + buf[i+9],
  132. + buf[i+10],
  133. + buf[i+11],
  134. + buf[i+12],
  135. + buf[i+13],
  136. + buf[i+14],
  137. + buf[i+15]);
  138. + }
  139. + }
  140. + VOS_TRACE(VOS_MODULE_ID_TXRX, VOS_TRACE_LEVEL_ERROR,
  141. + "data dump end**************\n");
  142. + }
  143. +
  144.  
  145. /*
  146. * Sanity check - confirm the HW is finished filling in the rx data.
  147. @@ -1361,12 +1349,46 @@ htt_rx_amsdu_rx_in_order_pop_ll(
  148.  
  149. msdu_count--;
  150.  
  151. + if (dumpEnable == 1){
  152. + VOS_TRACE(VOS_MODULE_ID_TXRX, VOS_TRACE_LEVEL_ERROR,
  153. + "\n%s: skbuff->data dump**************\n", __func__);
  154. + {
  155. + char *buf = (char *)msdu->data;
  156. + int i;
  157. +
  158. + for (i=0; (i+15)< 64; i+=16)
  159. + {
  160. + VOS_TRACE(VOS_MODULE_ID_TXRX, VOS_TRACE_LEVEL_ERROR,
  161. + "%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
  162. + buf[i],
  163. + buf[i+1],
  164. + buf[i+2],
  165. + buf[i+3],
  166. + buf[i+4],
  167. + buf[i+5],
  168. + buf[i+6],
  169. + buf[i+7],
  170. + buf[i+8],
  171. + buf[i+9],
  172. + buf[i+10],
  173. + buf[i+11],
  174. + buf[i+12],
  175. + buf[i+13],
  176. + buf[i+14],
  177. + buf[i+15]);
  178. + }
  179. + }
  180. + VOS_TRACE(VOS_MODULE_ID_TXRX, VOS_TRACE_LEVEL_ERROR,
  181. + "data dump end**************\n");
  182. + }
  183. if (adf_os_unlikely((*((u_int8_t *) &rx_desc->fw_desc.u.val)) &
  184. FW_RX_DESC_MIC_ERR_M)) {
  185. u_int8_t tid =
  186. HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(*(u_int32_t *)rx_ind_data);
  187. u_int16_t peer_id =
  188. HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(*(u_int32_t *)rx_ind_data);
  189. + VOS_TRACE(VOS_MODULE_ID_TXRX, VOS_TRACE_LEVEL_INFO,
  190. + "%s- tid %d peer_id %d\n", __func__, tid, peer_id);
  191. ol_rx_mic_error_handler(pdev->txrx_pdev, tid, peer_id, rx_desc, msdu);
  192.  
  193. htt_rx_desc_frame_free(pdev, msdu);
  194. @@ -2491,8 +2513,7 @@ htt_rx_attach(struct htt_pdev_t *pdev)
  195.  
  196. /* Initialize the Rx refill retry timer */
  197. adf_os_timer_init(pdev->osdev, &pdev->rx_ring.refill_retry_timer,
  198. - htt_rx_ring_refill_retry, (void *)pdev,
  199. - ADF_DEFERRABLE_TIMER);
  200. + htt_rx_ring_refill_retry, (void *)pdev);
  201.  
  202. pdev->rx_ring.fill_cnt = 0;
  203. #ifdef DEBUG_DMA_DONE
  204. diff --git a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/HTT/htt_t2h.c b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/HTT/htt_t2h.c
  205. index aebc2cb..16b6a36 100644
  206. --- a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/HTT/htt_t2h.c
  207. +++ b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/HTT/htt_t2h.c
  208. @@ -55,6 +55,11 @@
  209. #define DEBUG_CREDIT 0
  210. #endif
  211.  
  212. +extern int dumpEnable;
  213. +void htt_rx_print_rx_indication(
  214. + adf_nbuf_t rx_ind_msg,
  215. + htt_pdev_handle pdev);
  216. +
  217. static u_int8_t *
  218. htt_t2h_mac_addr_deswizzle(u_int8_t *tgt_mac_addr, u_int8_t *buffer)
  219. {
  220. @@ -177,6 +182,11 @@ htt_t2h_lp_msg_handler(void *context, adf_nbuf_t htt_t2h_msg )
  221. action =
  222. HTT_RX_FLUSH_MPDU_STATUS_GET(*(msg_word+1)) == 1 ?
  223. htt_rx_flush_release : htt_rx_flush_discard;
  224. + if(dumpEnable == 1)
  225. + VOS_TRACE(VOS_MODULE_ID_TXRX, VOS_TRACE_LEVEL_ERROR,
  226. + "RX_FLUSH: peer_id %x, tid %x, seq_num_start %x,seq_num_end %x, action %d\n",
  227. + peer_id, tid, seq_num_start, seq_num_end, action);
  228. +
  229. ol_rx_flush_handler(
  230. pdev->txrx_pdev,
  231. peer_id, tid,
  232. @@ -227,6 +237,11 @@ htt_t2h_lp_msg_handler(void *context, adf_nbuf_t htt_t2h_msg )
  233. peer_id = HTT_RX_ADDBA_PEER_ID_GET(*msg_word);
  234. tid = HTT_RX_ADDBA_TID_GET(*msg_word);
  235. win_sz = HTT_RX_ADDBA_WIN_SIZE_GET(*msg_word);
  236. + if(dumpEnable == 1)
  237. + VOS_TRACE(VOS_MODULE_ID_TXRX, VOS_TRACE_LEVEL_ERROR,
  238. + "RX_ADDBA: peer_id %x, tid %x, win_sz %d\n",
  239. + peer_id, tid, win_sz);
  240. +
  241. ol_rx_addba_handler(
  242. pdev->txrx_pdev, peer_id, tid, win_sz, start_seq_num,
  243. 0 /* success */);
  244. @@ -239,6 +254,10 @@ htt_t2h_lp_msg_handler(void *context, adf_nbuf_t htt_t2h_msg )
  245.  
  246. peer_id = HTT_RX_DELBA_PEER_ID_GET(*msg_word);
  247. tid = HTT_RX_DELBA_TID_GET(*msg_word);
  248. + if(dumpEnable == 1)
  249. + VOS_TRACE(VOS_MODULE_ID_TXRX, VOS_TRACE_LEVEL_ERROR,
  250. + "RX_DelBA: peer_id %x, tid %x\n",
  251. + peer_id, tid);
  252. ol_rx_delba_handler(pdev->txrx_pdev, peer_id, tid);
  253. break;
  254. }
  255. @@ -414,6 +433,10 @@ if (adf_os_unlikely(pdev->rx_ring.rx_reset)) {
  256.  
  257. msg_word = (u_int32_t *) adf_nbuf_data(htt_t2h_msg);
  258. msg_type = HTT_T2H_MSG_TYPE_GET(*msg_word);
  259. + if ((dumpEnable == 1) && (msg_type != 8))
  260. + VOS_TRACE(VOS_MODULE_ID_TXRX, VOS_TRACE_LEVEL_ERROR,
  261. + "%s: HTT_msg_type: %d, word1: 0x%02x, word2: 0x%02x \n", __func__, msg_type, *msg_word, *(msg_word+1));
  262. +
  263. switch (msg_type) {
  264. case HTT_T2H_MSG_TYPE_RX_IND:
  265. {
  266. @@ -422,6 +445,9 @@ if (adf_os_unlikely(pdev->rx_ring.rx_reset)) {
  267. u_int16_t peer_id;
  268. u_int8_t tid;
  269.  
  270. + if(dumpEnable == 1)
  271. + htt_rx_print_rx_indication(htt_t2h_msg, pdev);
  272. +
  273. if (adf_os_unlikely(pdev->cfg.is_full_reorder_offload)) {
  274. adf_os_print("HTT_T2H_MSG_TYPE_RX_IND not supported with full "
  275. "reorder offload\n");
  276. @@ -513,6 +539,10 @@ if (adf_os_unlikely(pdev->rx_ring.rx_reset)) {
  277. seq_num_start = HTT_RX_PN_IND_SEQ_NUM_START_GET(*msg_word);
  278. seq_num_end = HTT_RX_PN_IND_SEQ_NUM_END_GET(*msg_word);
  279. pn_ie_cnt = HTT_RX_PN_IND_PN_IE_CNT_GET(*msg_word);
  280. + if(dumpEnable == 1)
  281. + VOS_TRACE(VOS_MODULE_ID_TXRX, VOS_TRACE_LEVEL_ERROR,
  282. + "RX_PN_IND: peer_id %x, tid %x, seq_start %x,seq_end %x, pn_ie_cnt %d\n",
  283. + peer_id, tid, seq_num_start, seq_num_end, pn_ie_cnt);
  284.  
  285. msg_word++;
  286. /*Third dword*/
  287. diff --git a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TLSHIM/tl_shim.c b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TLSHIM/tl_shim.c
  288. index bf16c03..712372f 100644
  289. --- a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TLSHIM/tl_shim.c
  290. +++ b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TLSHIM/tl_shim.c
  291. @@ -1,5 +1,5 @@
  292. /*
  293. - * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved.
  294. + * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved.
  295. *
  296. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  297. *
  298. @@ -1143,7 +1143,7 @@ adf_nbuf_t WLANTL_SendSTA_DataFrame(void *vos_ctx, u_int8_t sta_id,
  299. }
  300.  
  301. if (vos_is_load_unload_in_progress(VOS_MODULE_ID_TL, NULL)) {
  302. - TLSHIM_LOGW("%s: Driver load/unload in progress", __func__);
  303. + TLSHIM_LOGP("%s: Driver load/unload in progress", __func__);
  304. return skb;
  305. }
  306. /*
  307. @@ -2035,20 +2035,6 @@ void *tl_shim_get_vdev_by_sta_id(void *vos_context, uint8_t sta_id)
  308. return peer->vdev;
  309. }
  310.  
  311. -void
  312. -WLANTL_PauseUnPauseQs(void *vos_context, v_BOOL_t flag)
  313. -{
  314. - ol_txrx_pdev_handle pdev = vos_get_context(VOS_MODULE_ID_TXRX,
  315. - vos_context);
  316. -
  317. - if (true == flag)
  318. - wdi_in_pdev_pause(pdev,
  319. - OL_TXQ_PAUSE_REASON_VDEV_SUSPEND);
  320. - else
  321. - wdi_in_pdev_unpause(pdev,
  322. - OL_TXQ_PAUSE_REASON_VDEV_SUSPEND);
  323. -}
  324. -
  325. #ifdef QCA_LL_TX_FLOW_CT
  326. /*=============================================================================
  327. FUNCTION WLANTL_GetTxResource
  328. diff --git a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_rx.c b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_rx.c
  329. index 5fe67c4..f074ba4 100644
  330. --- a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_rx.c
  331. +++ b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_rx.c
  332. @@ -72,6 +72,13 @@
  333. vdev->osif_rx(vdev->osif_dev, msdus)
  334. #endif /* OSIF_NEED_RX_PEER_ID */
  335.  
  336. +extern int dumpEnable;
  337. +
  338. +void ol_rx_reorder_display(
  339. + struct ol_txrx_pdev_t *pdev,
  340. + struct ol_txrx_peer_t *peer,
  341. + unsigned tid);
  342. +
  343. #ifdef HTT_RX_RESTORE
  344.  
  345. static void ol_rx_restore_handler(struct work_struct *htt_rx)
  346. @@ -1075,7 +1082,7 @@ ol_rx_in_order_indication_handler(
  347. if (peer) {
  348. vdev = peer->vdev;
  349. } else {
  350. - TXRX_PRINT(TXRX_PRINT_LEVEL_INFO2,
  351. + TXRX_PRINT(TXRX_PRINT_LEVEL_ERR,
  352. "%s: Couldn't find peer from ID 0x%x\n", __FUNCTION__,
  353. peer_id);
  354. while (head_msdu) {
  355. diff --git a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_rx_defrag.c b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_rx_defrag.c
  356. index cdbcc76..5d6fbef 100644
  357. --- a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_rx_defrag.c
  358. +++ b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_rx_defrag.c
  359. @@ -455,8 +455,9 @@ ol_rx_defrag_waitlist_remove(
  360.  
  361. rx_reorder->defrag_waitlist_elem.tqe_next = NULL;
  362. rx_reorder->defrag_waitlist_elem.tqe_prev = NULL;
  363. - } else if (rx_reorder->defrag_waitlist_elem.tqe_next != NULL) {
  364. - TXRX_PRINT(TXRX_PRINT_LEVEL_FATAL_ERR, "waitlist->tqe_prv = NULL\n");
  365. + } else if (rx_reorder->defrag_waitlist_elem.tqe_next != NULL){
  366. + TXRX_PRINT(TXRX_PRINT_LEVEL_FATAL_ERR,
  367. + "waitlist->tqe_prv = NULL & tqe->next is not NULL\n");
  368. VOS_ASSERT(0);
  369. rx_reorder->defrag_waitlist_elem.tqe_next = NULL;
  370. }
  371. diff --git a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_rx_reorder.c b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_rx_reorder.c
  372. index f5da6d4..74b3b9e 100644
  373. --- a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_rx_reorder.c
  374. +++ b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_rx_reorder.c
  375. @@ -45,7 +45,7 @@
  376. #include <ol_rx_reorder_timeout.h> /* OL_RX_REORDER_TIMEOUT_REMOVE, etc. */
  377. #include <ol_rx_reorder.h>
  378. #include <ol_rx_defrag.h>
  379. -
  380. +extern int dumpEnable;
  381.  
  382. /*=== data types and defines ===*/
  383. #define OL_RX_REORDER_ROUND_PWR2(value) g_log2ceil[value]
  384. @@ -144,6 +144,40 @@ ol_rx_reorder_seq_num_check(
  385. }
  386.  
  387. void
  388. +ol_rx_reorder_display(
  389. + struct ol_txrx_pdev_t *pdev,
  390. + struct ol_txrx_peer_t *peer,
  391. + unsigned tid)
  392. +{
  393. + adf_nbuf_t head_msdu;
  394. + int idx = 0, msdu_cnt=0;
  395. + struct ol_rx_reorder_array_elem_t *rx_reorder_array_elem = NULL;
  396. +
  397. + VOS_TRACE(VOS_MODULE_ID_TXRX, VOS_TRACE_LEVEL_ERROR,
  398. + "%s %d, display reorder buffer info for peer-id %d,tid %d\n",
  399. + __func__, __LINE__, peer->peer_ids[0], tid);
  400. +
  401. + for(; idx<64; idx++)
  402. + {
  403. + msdu_cnt = 0;
  404. + rx_reorder_array_elem = &peer->tids_rx_reorder[tid].array[idx];
  405. + head_msdu = rx_reorder_array_elem->head;
  406. + /*while (head_msdu != NULL) {
  407. + msdu_cnt++;
  408. + head_msdu = adf_nbuf_next(head_msdu);
  409. + }
  410. + */
  411. + if(head_msdu != NULL) msdu_cnt++;
  412. +
  413. + if (msdu_cnt !=0)
  414. + printk("idx %d, MSDU_cnt %d\n", idx, msdu_cnt);
  415. + }
  416. + VOS_TRACE(VOS_MODULE_ID_TXRX, VOS_TRACE_LEVEL_ERROR,
  417. + "display reorder buffer end for peer-id %d, tid %d\n",peer->peer_ids[0], tid);
  418. +
  419. +}
  420. +
  421. +void
  422. ol_rx_reorder_store(
  423. struct ol_txrx_pdev_t *pdev,
  424. struct ol_txrx_peer_t *peer,
  425. @@ -194,7 +228,9 @@ ol_rx_reorder_release(
  426. OL_RX_REORDER_PTR_CHECK(head_msdu) {
  427. OL_RX_REORDER_MPDU_CNT_DECR(&peer->tids_rx_reorder[tid], 1);
  428. }
  429. -
  430. + if(dumpEnable == 1)
  431. + VOS_TRACE(VOS_MODULE_ID_TXRX, VOS_TRACE_LEVEL_ERROR,
  432. + "%s %d: start_idx %d end_idx %d", __func__, __LINE__, idx_start, idx_end);
  433. idx = (idx_start + 1);
  434. OL_RX_REORDER_IDX_WRAP(idx, win_sz, win_sz_mask);
  435. while (idx != idx_end) {
  436. @@ -280,7 +316,9 @@ ol_rx_reorder_flush(
  437.  
  438. idx_start &= win_sz_mask;
  439. idx_end &= win_sz_mask;
  440. -
  441. + if(dumpEnable == 1)
  442. + VOS_TRACE(VOS_MODULE_ID_TXRX, VOS_TRACE_LEVEL_ERROR,
  443. + "%s %d: start_idx %d end_idx %d", __func__, __LINE__, idx_start, idx_end);
  444. do {
  445. rx_reorder_array_elem =
  446. &peer->tids_rx_reorder[tid].array[idx_start];
  447. @@ -551,6 +589,10 @@ ol_rx_pn_ind_handler(
  448. seq_num_start &= win_sz_mask;
  449. seq_num_end &= win_sz_mask;
  450. seq_num = seq_num_start;
  451. + if(dumpEnable == 1)
  452. + VOS_TRACE(VOS_MODULE_ID_TXRX, VOS_TRACE_LEVEL_ERROR,
  453. + "%s %d seq_start %d, seq_end %d, seq_num %d, pn_ie_cnt %d", __func__,
  454. + __LINE__,seq_num_start,seq_num_end,seq_num, pn_ie_cnt);
  455.  
  456. do {
  457. rx_reorder_array_elem =
  458. diff --git a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_rx_reorder_timeout.c b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_rx_reorder_timeout.c
  459. index a1deb5c..ea7e6ec 100644
  460. --- a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_rx_reorder_timeout.c
  461. +++ b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_rx_reorder_timeout.c
  462. @@ -188,7 +188,7 @@ ol_rx_reorder_timeout_init(struct ol_txrx_pdev_t *pdev)
  463. /* init the per-AC timers */
  464. adf_os_timer_init(
  465. pdev->osdev, &rx_reorder_timeout_ac->timer,
  466. - ol_rx_reorder_timeout, rx_reorder_timeout_ac, ADF_DEFERRABLE_TIMER);
  467. + ol_rx_reorder_timeout, rx_reorder_timeout_ac);
  468. /* init the virtual timer list */
  469. TAILQ_INIT(&rx_reorder_timeout_ac->virtual_timer_list);
  470. rx_reorder_timeout_ac->pdev = pdev;
  471. diff --git a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_tx.c b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_tx.c
  472. index 7e469e4..dc3c73f 100644
  473. --- a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_tx.c
  474. +++ b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_tx.c
  475. @@ -114,30 +114,6 @@ ol_tx_ll(ol_txrx_vdev_handle vdev, adf_nbuf_t msdu_list)
  476.  
  477. #define OL_TX_VDEV_PAUSE_QUEUE_SEND_MARGIN 400
  478. #define OL_TX_VDEV_PAUSE_QUEUE_SEND_PERIOD_MS 5
  479. -
  480. -/**
  481. - * ol_tx_vdev_ll_pause_start_timer() - Start ll-q pause timer for specific virtual device
  482. - * @vdev: the virtual device
  483. - *
  484. - * When system comes out of suspend, it is necessary to start the timer
  485. - * which will ensure to pull out all the queued packets after expiry.
  486. - * This function restarts the ll-pause timer, for the specific vdev device.
  487. - *
  488. - *
  489. - * Return: None
  490. - */
  491. -void
  492. -ol_tx_vdev_ll_pause_start_timer(struct ol_txrx_vdev_t *vdev)
  493. -{
  494. - adf_os_spin_lock_bh(&vdev->ll_pause.mutex);
  495. - if (vdev->ll_pause.txq.depth) {
  496. - adf_os_timer_cancel(&vdev->ll_pause.timer);
  497. - adf_os_timer_start(&vdev->ll_pause.timer,
  498. - OL_TX_VDEV_PAUSE_QUEUE_SEND_PERIOD_MS);
  499. - }
  500. - adf_os_spin_unlock_bh(&vdev->ll_pause.mutex);
  501. -}
  502. -
  503. static void
  504. ol_tx_vdev_ll_pause_queue_send_base(struct ol_txrx_vdev_t *vdev)
  505. {
  506. @@ -225,8 +201,8 @@ ol_tx_vdev_pause_queue_append(
  507. adf_nbuf_set_next(vdev->ll_pause.txq.tail, NULL);
  508. }
  509.  
  510. - adf_os_timer_cancel(&vdev->ll_pause.timer);
  511. if (start_timer) {
  512. + adf_os_timer_cancel(&vdev->ll_pause.timer);
  513. adf_os_timer_start(
  514. &vdev->ll_pause.timer, OL_TX_VDEV_PAUSE_QUEUE_SEND_PERIOD_MS);
  515. }
  516. @@ -261,10 +237,7 @@ ol_tx_ll_queue(ol_txrx_vdev_handle vdev, adf_nbuf_t msdu_list)
  517. return msdu_list;
  518. }
  519. }
  520. - if (paused_reason & OL_TXQ_PAUSE_REASON_VDEV_SUSPEND)
  521. - msdu_list = ol_tx_vdev_pause_queue_append(vdev, msdu_list, 0);
  522. - else
  523. - msdu_list = ol_tx_vdev_pause_queue_append(vdev, msdu_list, 1);
  524. + msdu_list = ol_tx_vdev_pause_queue_append(vdev, msdu_list, 1);
  525. } else {
  526. if (vdev->ll_pause.txq.depth > 0 ||
  527. vdev->pdev->tx_throttle.current_throttle_level !=
  528. @@ -382,16 +355,16 @@ ol_tx_pdev_ll_pause_queue_send_all(struct ol_txrx_pdev_t *pdev)
  529.  
  530. void ol_tx_vdev_ll_pause_queue_send(void *context)
  531. {
  532. +#ifdef QCA_SUPPORT_TXRX_VDEV_LL_TXQ
  533. struct ol_txrx_vdev_t *vdev = (struct ol_txrx_vdev_t *) context;
  534.  
  535. -#ifdef QCA_SUPPORT_TXRX_VDEV_LL_TXQ
  536. if (vdev->pdev->tx_throttle.current_throttle_level != THROTTLE_LEVEL_0 &&
  537. vdev->pdev->tx_throttle.current_throttle_phase == THROTTLE_PHASE_OFF) {
  538. return;
  539. }
  540. -#endif
  541.  
  542. ol_tx_vdev_ll_pause_queue_send_base(vdev);
  543. +#endif
  544. }
  545.  
  546. static inline int
  547. diff --git a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_tx.h b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_tx.h
  548. index f099b1a..e53439f 100644
  549. --- a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_tx.h
  550. +++ b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_tx.h
  551. @@ -73,20 +73,6 @@ ol_tx_reinject(struct ol_txrx_vdev_t *vdev, adf_nbuf_t msdu, u_int16_t peer_id);
  552. void
  553. ol_txrx_mgmt_tx_complete(void *ctxt, adf_nbuf_t netbuf, int err);
  554.  
  555. -/**
  556. - * ol_tx_vdev_ll_pause_start_timer() - Start ll-q pause timer for specific virtual device
  557. - * @vdev: the virtual device
  558. - *
  559. - * When system comes out of suspend, it is necessary to start the timer
  560. - * which will ensure to pull out all the queued packets after expiry.
  561. - * This function restarts the ll-pause timer, for the specific vdev device.
  562. - *
  563. - *
  564. - * Return: None
  565. - */
  566. -void
  567. -ol_tx_vdev_ll_pause_start_timer(struct ol_txrx_vdev_t *vdev);
  568. -
  569. void
  570. ol_tx_pdev_ll_pause_queue_send_all(struct ol_txrx_pdev_t *pdev);
  571. #endif /* _OL_TX__H_ */
  572. diff --git a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_tx_queue.c b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_tx_queue.c
  573. index 0936b05..65723af 100644
  574. --- a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_tx_queue.c
  575. +++ b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_tx_queue.c
  576. @@ -458,7 +458,7 @@ ol_txrx_throttle_pause(ol_txrx_pdev_handle pdev)
  577. pdev->tx_throttle.is_paused = TRUE;
  578. adf_os_spin_unlock_bh(&pdev->tx_throttle.mutex);
  579. #endif
  580. - ol_txrx_pdev_pause(pdev, 0);
  581. + ol_txrx_pdev_pause(pdev);
  582. }
  583.  
  584. void
  585. @@ -475,57 +475,33 @@ ol_txrx_throttle_unpause(ol_txrx_pdev_handle pdev)
  586. pdev->tx_throttle.is_paused = FALSE;
  587. adf_os_spin_unlock_bh(&pdev->tx_throttle.mutex);
  588. #endif
  589. - ol_txrx_pdev_unpause(pdev, 0);
  590. + ol_txrx_pdev_unpause(pdev);
  591. }
  592. -#endif /* defined(CONFIG_HL_SUPPORT) */
  593.  
  594. -#if defined(CONFIG_HL_SUPPORT) || defined(QCA_SUPPORT_TXRX_VDEV_PAUSE_LL)
  595. -/**
  596. - * ol_txrx_pdev_pause() - Suspend all tx data for the specified physical device.
  597. - * @data_pdev: the physical device being paused.
  598. - * @reason: pause reason.
  599. - *
  600. - * This function applies to HL systems -
  601. - * in LL systems, applies when txrx_vdev_pause_all is enabled.
  602. - * In some systems it is necessary to be able to temporarily
  603. - * suspend all WLAN traffic, e.g. to allow another device such as bluetooth
  604. - * to temporarily have exclusive access to shared RF chain resources.
  605. - * This function suspends tx traffic within the specified physical device.
  606. - *
  607. - *
  608. - * Return: None
  609. - */
  610. void
  611. -ol_txrx_pdev_pause(ol_txrx_pdev_handle pdev, u_int32_t reason)
  612. +ol_txrx_pdev_pause(ol_txrx_pdev_handle pdev)
  613. {
  614. - struct ol_txrx_vdev_t *vdev = NULL, *tmp;
  615. + struct ol_txrx_vdev_t *vdev = NULL, *tmp;
  616.  
  617. - TAILQ_FOREACH_SAFE(vdev, &pdev->vdev_list, vdev_list_elem, tmp) {
  618. - ol_txrx_vdev_pause(vdev, reason);
  619. - }
  620. + TAILQ_FOREACH_SAFE(vdev, &pdev->vdev_list, vdev_list_elem, tmp) {
  621. + ol_txrx_vdev_pause(vdev, 0);
  622. + }
  623. }
  624.  
  625. -/**
  626. - * ol_txrx_pdev_unpause() - Resume tx for the specified physical device..
  627. - * @data_pdev: the physical device being paused.
  628. - * @reason: pause reason.
  629. - *
  630. - * This function applies to HL systems -
  631. - * in LL systems, applies when txrx_vdev_pause_all is enabled.
  632. - *
  633. - *
  634. - * Return: None
  635. - */
  636. void
  637. -ol_txrx_pdev_unpause(ol_txrx_pdev_handle pdev, u_int32_t reason)
  638. +ol_txrx_pdev_unpause(ol_txrx_pdev_handle pdev)
  639. {
  640. - struct ol_txrx_vdev_t *vdev = NULL, *tmp;
  641. + struct ol_txrx_vdev_t *vdev = NULL, *tmp;
  642.  
  643. - TAILQ_FOREACH_SAFE(vdev, &pdev->vdev_list, vdev_list_elem, tmp) {
  644. - ol_txrx_vdev_unpause(vdev, reason);
  645. - }
  646. + TAILQ_FOREACH_SAFE(vdev, &pdev->vdev_list, vdev_list_elem, tmp) {
  647. + ol_txrx_vdev_unpause(vdev, 0);
  648. + }
  649. }
  650.  
  651. +#endif /* defined(CONFIG_HL_SUPPORT) */
  652. +
  653. +#if defined(CONFIG_HL_SUPPORT) || defined(QCA_SUPPORT_TXRX_VDEV_PAUSE_LL)
  654. +
  655. void
  656. ol_txrx_vdev_pause(ol_txrx_vdev_handle vdev, u_int32_t reason)
  657. {
  658. @@ -578,11 +554,7 @@ ol_txrx_vdev_unpause(ol_txrx_vdev_handle vdev, u_int32_t reason)
  659. if (vdev->ll_pause.paused_reason & reason)
  660. {
  661. vdev->ll_pause.paused_reason &= ~reason;
  662. - if (reason == OL_TXQ_PAUSE_REASON_VDEV_SUSPEND) {
  663. - adf_os_spin_unlock_bh(&vdev->ll_pause.mutex);
  664. - ol_tx_vdev_ll_pause_start_timer(vdev);
  665. - }
  666. - else if (!vdev->ll_pause.paused_reason) {
  667. + if (!vdev->ll_pause.paused_reason) {
  668. adf_os_spin_unlock_bh(&vdev->ll_pause.mutex);
  669. ol_tx_vdev_ll_pause_queue_send(vdev);
  670. } else {
  671. @@ -780,14 +752,14 @@ void ol_tx_throttle_init(struct ol_txrx_pdev_t *pdev)
  672. pdev->osdev,
  673. &pdev->tx_throttle.phase_timer,
  674. ol_tx_pdev_throttle_phase_timer,
  675. - pdev, ADF_DEFERRABLE_TIMER);
  676. + pdev);
  677.  
  678. #ifdef QCA_SUPPORT_TXRX_VDEV_LL_TXQ
  679. adf_os_timer_init(
  680. pdev->osdev,
  681. &pdev->tx_throttle.tx_timer,
  682. ol_tx_pdev_throttle_tx_timer,
  683. - pdev, ADF_DEFERRABLE_TIMER);
  684. + pdev);
  685. #endif
  686.  
  687. pdev->tx_throttle.tx_threshold = THROTTLE_TX_THRESHOLD;
  688. diff --git a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_txrx.c b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_txrx.c
  689. index 90efd30..ed1eada 100644
  690. --- a/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_txrx.c
  691. +++ b/drivers/staging/qcacld-2.0/CORE/CLD_TXRX/TXRX/ol_txrx.c
  692. @@ -884,7 +884,7 @@ ol_txrx_vdev_attach(
  693. pdev->osdev,
  694. &vdev->ll_pause.timer,
  695. ol_tx_vdev_ll_pause_queue_send,
  696. - vdev, ADF_DEFERRABLE_TIMER);
  697. + vdev);
  698. adf_os_atomic_init(&vdev->os_q_paused);
  699. adf_os_atomic_set(&vdev->os_q_paused, 0);
  700. vdev->tx_fl_lwm = 0;
  701. diff --git a/drivers/staging/qcacld-2.0/CORE/EPPING/src/epping_txrx.c b/drivers/staging/qcacld-2.0/CORE/EPPING/src/epping_txrx.c
  702. index 44fe268..678d58e 100644
  703. --- a/drivers/staging/qcacld-2.0/CORE/EPPING/src/epping_txrx.c
  704. +++ b/drivers/staging/qcacld-2.0/CORE/EPPING/src/epping_txrx.c
  705. @@ -374,7 +374,7 @@ epping_adapter_t *epping_add_adapter(epping_context_t *pEpping_ctx,
  706. adf_nbuf_queue_init(&pAdapter->nodrop_queue);
  707. pAdapter->epping_timer_state = EPPING_TX_TIMER_STOPPED;
  708. adf_os_timer_init(epping_get_adf_ctx(), &pAdapter->epping_timer,
  709. - epping_timer_expire, dev, ADF_DEFERRABLE_TIMER);
  710. + epping_timer_expire, dev);
  711. dev->type = ARPHRD_IEEE80211;
  712. dev->netdev_ops = &epping_drv_ops;
  713. dev->watchdog_timeo = 5 * HZ; /* XXX */
  714. diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/inc/wlan_hdd_cfg.h b/drivers/staging/qcacld-2.0/CORE/HDD/inc/wlan_hdd_cfg.h
  715. index 6001834..e25b982 100644
  716. --- a/drivers/staging/qcacld-2.0/CORE/HDD/inc/wlan_hdd_cfg.h
  717. +++ b/drivers/staging/qcacld-2.0/CORE/HDD/inc/wlan_hdd_cfg.h
  718. @@ -1226,11 +1226,6 @@ typedef enum
  719. #define CFG_ROAM_RESCAN_RSSI_DIFF_MAX (100)
  720. #define CFG_ROAM_RESCAN_RSSI_DIFF_DEFAULT (5)
  721.  
  722. -#define CFG_DROPPED_PKT_DISCONNECT_TH_NAME "gDroppedPktDisconnectTh"
  723. -#define CFG_DROPPED_PKT_DISCONNECT_TH_MIN (48)
  724. -#define CFG_DROPPED_PKT_DISCONNECT_TH_MAX (256)
  725. -#define CFG_DROPPED_PKT_DISCONNECT_TH_DEFAULT (96)
  726. -
  727. /*
  728. * This parameter is the RSSI diff above neighbor lookup threshold, when
  729. * opportunistic scan should be triggered.
  730. @@ -1587,13 +1582,13 @@ typedef enum
  731. #define CFG_ENABLE_FW_LOG_TYPE_DEFAULT ( 3 )
  732.  
  733. /* gFwDebugLogLevel takes values from enum DBGLOG_LOG_LVL,
  734. - * make default value as DBGLOG_WARN to enable error and
  735. - * warning logs by default.
  736. + * make default value as DBGLOG_ERR to enable error logs by
  737. + * default.
  738. */
  739. #define CFG_ENABLE_FW_DEBUG_LOG_LEVEL "gFwDebugLogLevel"
  740. #define CFG_ENABLE_FW_DEBUG_LOG_LEVEL_MIN ( 0 )
  741. #define CFG_ENABLE_FW_DEBUG_LOG_LEVEL_MAX ( 255 )
  742. -#define CFG_ENABLE_FW_DEBUG_LOG_LEVEL_DEFAULT ( 4 )
  743. +#define CFG_ENABLE_FW_DEBUG_LOG_LEVEL_DEFAULT ( 5 )
  744.  
  745. /* For valid values of log levels check enum DBGLOG_LOG_LVL and
  746. * for valid values of module ids check enum WLAN_MODULE_ID.
  747. @@ -3452,7 +3447,6 @@ typedef struct
  748. bool enable_fw_hash_check;
  749. #endif
  750. uint16_t p2p_listen_defer_interval;
  751. - uint16_t pkt_err_disconn_th;
  752. } hdd_config_t;
  753.  
  754. #ifdef WLAN_FEATURE_MBSSID
  755. @@ -3575,6 +3569,9 @@ static __inline unsigned long utilMin( unsigned long a, unsigned long b )
  756. -------------------------------------------------------------------------*/
  757. VOS_STATUS hdd_parse_config_ini(hdd_context_t *pHddCtx);
  758. VOS_STATUS hdd_update_mac_config(hdd_context_t *pHddCtx);
  759. +VOS_STATUS hdd_generate_random_mac_from_serialno(char *serialNo,
  760. + int serialength, char *computedMac);
  761. +VOS_STATUS hdd_update_mac_serial(hdd_context_t *pHddCtx);
  762. VOS_STATUS hdd_set_sme_config( hdd_context_t *pHddCtx );
  763. VOS_STATUS hdd_set_sme_chan_list(hdd_context_t *hdd_ctx);
  764. v_BOOL_t hdd_update_config_dat ( hdd_context_t *pHddCtx );
  765. diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/inc/wlan_hdd_tdls.h b/drivers/staging/qcacld-2.0/CORE/HDD/inc/wlan_hdd_tdls.h
  766. index 3c74f70..480a0c1 100644
  767. --- a/drivers/staging/qcacld-2.0/CORE/HDD/inc/wlan_hdd_tdls.h
  768. +++ b/drivers/staging/qcacld-2.0/CORE/HDD/inc/wlan_hdd_tdls.h
  769. @@ -226,6 +226,7 @@ typedef struct _hddTdlsPeer_t {
  770. tANI_U8 supported_channels[SIR_MAC_MAX_SUPP_CHANNELS];
  771. tANI_U8 supported_oper_classes_len;
  772. tANI_U8 supported_oper_classes[SIR_MAC_MAX_SUPP_OPER_CLASSES];
  773. + vos_timer_t initiatorWaitTimeoutTimer;
  774. tANI_BOOLEAN isForcedPeer;
  775. tANI_U8 op_class_for_pref_off_chan;
  776. tANI_U8 pref_off_chan_num;
  777. diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_assoc.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_assoc.c
  778. index 6eedd4c..256f94c 100644
  779. --- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_assoc.c
  780. +++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_assoc.c
  781. @@ -512,7 +512,6 @@ void hdd_SendFTEvent(hdd_adapter_t *pAdapter)
  782. if (auth_resp_len == 0)
  783. {
  784. hddLog(LOGE, "%s: AuthRsp FTIES is of length 0", __func__);
  785. - kfree(buff);
  786. return;
  787. }
  788.  
  789. @@ -1408,9 +1407,10 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs
  790. /* HDD has initiated disconnect, do not send connect result indication
  791. * to kernel as it will be handled by __cfg80211_disconnect.
  792. */
  793. - if(( eConnectionState_Disconnecting == pHddStaCtx->conn_info.connState) &&
  794. - (( eCSR_ROAM_RESULT_ASSOCIATED == roamResult) ||
  795. - ( eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus)) )
  796. + if(((eConnectionState_Disconnecting == pHddStaCtx->conn_info.connState) ||
  797. + (eConnectionState_NotConnected == pHddStaCtx->conn_info.connState)) &&
  798. + ((eCSR_ROAM_RESULT_ASSOCIATED == roamResult) ||
  799. + (eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus)))
  800. {
  801. VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
  802. FL(" Disconnect from HDD in progress "));
  803. diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_cfg.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_cfg.c
  804. index 0c796e9..f537bf6 100644
  805. --- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_cfg.c
  806. +++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_cfg.c
  807. @@ -48,6 +48,8 @@
  808. ------------------------------------------------------------------------*/
  809.  
  810.  
  811. +#include <linux/of.h>
  812. +#include <linux/of_address.h>
  813. #include <linux/firmware.h>
  814. #include <linux/string.h>
  815. #include <wlan_hdd_includes.h>
  816. @@ -59,8 +61,25 @@
  817. #include <csrApi.h>
  818. #include <pmcApi.h>
  819. #include <wlan_hdd_misc.h>
  820. +#include <crypto/md5.h>
  821. +#include <crypto/hash.h>
  822.  
  823. #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR)
  824. +
  825. +#ifdef MOTO_UTAGS_MAC
  826. +#define WIFI_MAC_BOOTARG "androidboot.wifimacaddr="
  827. +#define DEVICE_SERIALNO_BOOTARG "androidboot.serialno="
  828. +#define MACSTRLEN 12
  829. +#define MACSTRCOLON 58
  830. +#define MACADDRESSUSED 1
  831. +#endif
  832. +
  833. +
  834. +struct sdesc {
  835. + struct shash_desc shash;
  836. + char ctx[];
  837. +};
  838. +
  839. static void
  840. cbNotifySetRoamPrefer5GHz(hdd_context_t *pHddCtx, unsigned long NotifyId)
  841. {
  842. @@ -3922,13 +3941,6 @@ REG_TABLE_ENTRY g_registry_table[] =
  843. CFG_INFORM_BSS_RSSI_RAW_DEFAULT,
  844. CFG_INFORM_BSS_RSSI_RAW_MIN,
  845. CFG_INFORM_BSS_RSSI_RAW_MAX),
  846. -
  847. - REG_VARIABLE(CFG_DROPPED_PKT_DISCONNECT_TH_NAME, WLAN_PARAM_Integer,
  848. - hdd_config_t, pkt_err_disconn_th,
  849. - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
  850. - CFG_DROPPED_PKT_DISCONNECT_TH_DEFAULT,
  851. - CFG_DROPPED_PKT_DISCONNECT_TH_MIN,
  852. - CFG_DROPPED_PKT_DISCONNECT_TH_MAX),
  853. };
  854.  
  855. #ifdef WLAN_FEATURE_MBSSID
  856. @@ -4741,18 +4753,31 @@ static void update_mac_from_string(hdd_context_t *pHddCtx, tCfgIniEntry *macTabl
  857. */
  858. VOS_STATUS hdd_update_mac_config(hdd_context_t *pHddCtx)
  859. {
  860. - int status, i = 0;
  861. +#ifndef MOTO_UTAGS_MAC
  862. const struct firmware *fw = NULL;
  863. - char *line, *buffer = NULL;
  864. - char *name, *value;
  865. + char *line = NULL;
  866. + int status, i = 0;
  867. +#else
  868. + int len = 0;
  869. + int iteration = 0;
  870. +
  871. + char *bufferPtr = NULL;
  872. + char buffer_temp[MACSTRLEN];
  873. + const char *cmd_line = NULL;
  874. + struct device_node *chosen_node = NULL;
  875. +#endif
  876. +
  877. + char *buffer = NULL;
  878. tCfgIniEntry macTable[VOS_MAX_CONCURRENCY_PERSONA];
  879. tSirMacAddr customMacAddr;
  880. -
  881. VOS_STATUS vos_status = VOS_STATUS_SUCCESS;
  882.  
  883. memset(macTable, 0, sizeof(macTable));
  884. - status = request_firmware(&fw, WLAN_MAC_FILE, pHddCtx->parent_dev);
  885.  
  886. + /*Implemenation of QCOM is to read the MAC address from the predefined*/
  887. + /*location where WLAN MMAC File have the MAC Address */
  888. +#ifndef MOTO_UTAGS_MAC
  889. + status = request_firmware(&fw, WLAN_MAC_FILE, pHddCtx->parent_dev);
  890. if (status)
  891. {
  892. hddLog(VOS_TRACE_LEVEL_WARN, "%s: request_firmware failed %d",
  893. @@ -4766,9 +4791,41 @@ VOS_STATUS hdd_update_mac_config(hdd_context_t *pHddCtx)
  894. vos_status = VOS_STATUS_E_INVAL;
  895. goto config_exit;
  896. }
  897. -
  898. buffer = (char *)fw->data;
  899. +#else
  900. + /* Read MACs from bootparams. */
  901. + chosen_node = of_find_node_by_name(NULL, "chosen");
  902. + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
  903. + "%s: get chosen node \n", __func__);
  904. + if (!chosen_node)
  905. + {
  906. + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
  907. + "%s: get chosen node read failed \n", __func__);
  908. + goto config_exit;
  909. + } else {
  910. + cmd_line = of_get_property(chosen_node, "bootargs", &len);
  911. +
  912. + if (!cmd_line || len <= 0) {
  913. + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
  914. + "%s: get wlan MACs bootargs failed \n", __func__);
  915. + vos_status = VOS_STATUS_E_FAILURE;
  916. + goto config_exit;
  917. + } else {
  918. + buffer = strstr(cmd_line, WIFI_MAC_BOOTARG);
  919. + if (buffer == NULL) {
  920. + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
  921. + "%s: " WIFI_MAC_BOOTARG " bootarg cmd line is null", __func__);
  922. + vos_status = VOS_STATUS_E_FAILURE;
  923. + goto config_exit;
  924. + } else {
  925. + buffer += strlen(WIFI_MAC_BOOTARG);
  926. + bufferPtr = buffer;
  927. + }
  928. + }
  929. + }
  930. +#endif
  931.  
  932. +#ifndef MOTO_UTAGS_MAC
  933. /* data format:
  934. * Intf0MacAddress=00AA00BB00CC
  935. * Intf1MacAddress=00AA00BB00CD
  936. @@ -4813,19 +4870,186 @@ VOS_STATUS hdd_update_mac_config(hdd_context_t *pHddCtx)
  937. vos_status = VOS_STATUS_E_INVAL;
  938. goto config_exit;
  939. }
  940. -
  941. update_mac_from_string(pHddCtx, &macTable[0], i);
  942. + vos_mem_copy(&customMacAddr,
  943. + &pHddCtx->cfg_ini->intfMacAddr[0].bytes[0],
  944. + sizeof(tSirMacAddr));
  945. +#else
  946.  
  947. + /* Mac address data format used by qcom:
  948. + * Intf0MacAddress=00AA00BB00CC
  949. + * Intf1MacAddress=00AA00BB00CD
  950. + * xxxxxxxxxxxxxxxxxxxxxxxxxxxx
  951. + * From bootarg we need to strip off : from macaddress
  952. + */
  953. + for (iteration = 0; iteration < MACSTRLEN; iteration++) {
  954. + if (*bufferPtr != MACSTRCOLON) {
  955. + buffer_temp[iteration] = *bufferPtr;
  956. + } else {
  957. + iteration = iteration - 1;
  958. + }
  959. + bufferPtr++;
  960. + }
  961. + /* Mac address data format used by qcom:
  962. + * Intf0MacAddress used for 1 macaddress
  963. + * if gp2pdeviceAdmistered is set to 1
  964. + * if s020deviceAdmisnited is set to 0
  965. + * it will use Intf1MacAddress for P2P seprately
  966. + * Motorola decided to use gp2pdeviceAdmistered = 1 i.e use
  967. + * locally gerated bin MAC addr for P2P
  968. + */
  969. + macTable[0].name = "Intf0MacAddress";
  970. + macTable[0].value = &buffer_temp[0];
  971. + update_mac_from_string(pHddCtx, &macTable[0], MACADDRESSUSED);
  972. vos_mem_copy(&customMacAddr,
  973. &pHddCtx->cfg_ini->intfMacAddr[0].bytes[0],
  974. sizeof(tSirMacAddr));
  975. +#endif
  976. sme_SetCustomMacAddr(customMacAddr);
  977.  
  978. config_exit:
  979. +#ifndef MOTO_UTAGS_MAC
  980. release_firmware(fw);
  981. +#endif
  982. return vos_status;
  983. }
  984.  
  985. +VOS_STATUS hdd_update_mac_serial(hdd_context_t *pHddCtx)
  986. +{
  987. + VOS_STATUS vos_status = VOS_STATUS_SUCCESS;
  988. +
  989. + int len = 0;
  990. + int serialnoLen = 0;
  991. +
  992. + char *buffer = NULL;
  993. + char *bufferPtr = NULL;
  994. + char *computedMac = NULL;
  995. + const char *cmd_line = NULL;
  996. +
  997. + struct device_node *chosen_node = NULL;
  998. + computedMac = (char*)vos_mem_malloc(VOS_MAC_ADDR_SIZE);
  999. +
  1000. + chosen_node = of_find_node_by_name(NULL, "chosen");
  1001. + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
  1002. + "%s: get chosen node \n", __func__);
  1003. +
  1004. + if (!chosen_node)
  1005. + {
  1006. + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
  1007. + "%s: get chosen node read failed \n", __func__);
  1008. + goto config_exit;
  1009. + } else {
  1010. + cmd_line = of_get_property(chosen_node, "bootargs", &len);
  1011. + if (!cmd_line || len <= 0) {
  1012. + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
  1013. + "%s: get the barcode bootargs failed \n", __func__);
  1014. + vos_status = VOS_STATUS_E_FAILURE;
  1015. + goto config_exit;
  1016. + } else {
  1017. + buffer = strstr(cmd_line, DEVICE_SERIALNO_BOOTARG);
  1018. + if (buffer == NULL) {
  1019. + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
  1020. + "%s: " DEVICE_SERIALNO_BOOTARG" not present cmd line argc",
  1021. + __func__);
  1022. + vos_status = VOS_STATUS_E_FAILURE;
  1023. + goto config_exit;
  1024. + } else {
  1025. + buffer += strlen(DEVICE_SERIALNO_BOOTARG);
  1026. + bufferPtr = buffer;
  1027. + while (*bufferPtr != ' ') {
  1028. + bufferPtr++;
  1029. + serialnoLen = serialnoLen + 1;
  1030. + }
  1031. + }
  1032. + }
  1033. + }
  1034. + /*Data have been read from boot serial no */
  1035. + /*Now generate random unique the 6 byte string */
  1036. + if (hdd_generate_random_mac_from_serialno(buffer, serialnoLen,
  1037. + computedMac)
  1038. + != VOS_STATUS_SUCCESS)
  1039. + {
  1040. + vos_status = VOS_STATUS_E_FAILURE;
  1041. + goto config_exit;
  1042. + }
  1043. +
  1044. + vos_mem_copy((v_U8_t *)&pHddCtx->cfg_ini->intfMacAddr[0].bytes[0],
  1045. + (v_U8_t *)computedMac, VOS_MAC_ADDR_SIZE);
  1046. +
  1047. +config_exit:
  1048. + vos_mem_free(computedMac);
  1049. + return vos_status;
  1050. +}
  1051. +
  1052. +VOS_STATUS hdd_generate_random_mac_from_serialno(char *serialNo, int serialnoLen,
  1053. + char *macAddr)
  1054. +{
  1055. + unsigned int size;
  1056. + struct crypto_shash *md5;
  1057. + struct sdesc *sdescmd5;
  1058. + char *hashBuf = NULL;
  1059. +
  1060. + VOS_STATUS cryptoStatus = VOS_STATUS_SUCCESS;
  1061. + hashBuf = (char*)vos_mem_malloc(16);
  1062. +
  1063. + /*Motorola OUI*/
  1064. + macAddr[0] = 0xA4;
  1065. + macAddr[1] = 0x70;
  1066. + macAddr[2] = 0xd6;
  1067. +
  1068. + md5 = crypto_alloc_shash("md5", 0, 0);
  1069. + if (IS_ERR(md5)) {
  1070. + cryptoStatus = VOS_STATUS_E_FAILURE;
  1071. + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
  1072. + "%s: Crypto md5 allocation error \n", __func__);
  1073. + vos_mem_free(hashBuf);
  1074. + return VOS_STATUS_E_FAILURE;
  1075. + }
  1076. +
  1077. + size = sizeof(struct shash_desc) + crypto_shash_descsize(md5);
  1078. +
  1079. + sdescmd5 = kmalloc(size, GFP_KERNEL);
  1080. + if (!sdescmd5) {
  1081. + cryptoStatus = VOS_STATUS_E_FAILURE;
  1082. + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
  1083. + "%s: Memory allocationn error \n", __func__);
  1084. + goto crypto_hash_err;
  1085. + }
  1086. +
  1087. + sdescmd5->shash.tfm = md5;
  1088. + sdescmd5->shash.flags = 0x0;
  1089. +
  1090. + if (crypto_shash_init(&sdescmd5->shash)) {
  1091. + cryptoStatus = VOS_STATUS_E_FAILURE;
  1092. + goto crypto_hash_err;
  1093. + }
  1094. +
  1095. + if (crypto_shash_update(&sdescmd5->shash, serialNo, serialnoLen)) {
  1096. + cryptoStatus = VOS_STATUS_E_FAILURE;
  1097. + goto crypto_hash_err;
  1098. + }
  1099. +
  1100. + if (crypto_shash_final(&sdescmd5->shash, &hashBuf[0])) {
  1101. + cryptoStatus = VOS_STATUS_E_FAILURE;
  1102. + goto crypto_hash_err;
  1103. + }
  1104. +
  1105. + macAddr[3] = hashBuf[0];
  1106. + macAddr[4] = hashBuf[1];
  1107. + macAddr[5] = hashBuf[2];
  1108. +
  1109. + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
  1110. + "%X:%X:%X:%X:%X:%X MAC genrated from serial number \n", macAddr[0],
  1111. + macAddr[1], macAddr[2], macAddr[3],
  1112. + macAddr[4], macAddr[5]);
  1113. +crypto_hash_err:
  1114. + vos_mem_free(hashBuf);
  1115. + crypto_free_shash(md5);
  1116. + kfree(sdescmd5);
  1117. +
  1118. + return cryptoStatus;
  1119. +}
  1120. +
  1121. static VOS_STATUS hdd_apply_cfg_ini( hdd_context_t *pHddCtx, tCfgIniEntry* iniTable, unsigned long entries)
  1122. {
  1123. VOS_STATUS match_status = VOS_STATUS_E_FAILURE;
  1124. @@ -6319,9 +6543,6 @@ VOS_STATUS hdd_set_sme_config( hdd_context_t *pHddCtx )
  1125. pHddCtx->cfg_ini->isRoamOffloadEnabled;
  1126. #endif
  1127.  
  1128. - smeConfig->csrConfig.pkt_err_disconn_th =
  1129. - pHddCtx->cfg_ini->pkt_err_disconn_th;
  1130. -
  1131. halStatus = sme_UpdateConfig( pHddCtx->hHal, smeConfig);
  1132. if ( !HAL_STATUS_SUCCESS( halStatus ) )
  1133. {
  1134. diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_cfg80211.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_cfg80211.c
  1135. index d50fce5..bee3cb8 100644
  1136. --- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_cfg80211.c
  1137. +++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_cfg80211.c
  1138. @@ -6497,8 +6497,6 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
  1139.  
  1140. pSapEventCallback = hdd_hostapd_SAPEventCB;
  1141.  
  1142. - (WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->dfs_cac_block_tx = VOS_TRUE;
  1143. -
  1144. status = WLANSAP_StartBss(
  1145. #ifdef WLAN_FEATURE_MBSSID
  1146. WLAN_HDD_GET_SAP_CTX_PTR(pHostapdAdapter),
  1147. @@ -11167,7 +11165,6 @@ static int __wlan_hdd_cfg80211_disconnect( struct wiphy *wiphy,
  1148. int status;
  1149. hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
  1150. hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
  1151. - eConnectionState connState;
  1152. #ifdef FEATURE_WLAN_TDLS
  1153. tANI_U8 staIdx;
  1154. #endif
  1155. @@ -11194,8 +11191,6 @@ static int __wlan_hdd_cfg80211_disconnect( struct wiphy *wiphy,
  1156. eCsrRoamDisconnectReason reasonCode =
  1157. eCSR_DISCONNECT_REASON_UNSPECIFIED;
  1158. hdd_scaninfo_t *pScanInfo;
  1159. -
  1160. - connState = pHddStaCtx->conn_info.connState;
  1161. switch (reason) {
  1162. case WLAN_REASON_MIC_FAILURE:
  1163. reasonCode = eCSR_DISCONNECT_REASON_MIC_ERROR;
  1164. @@ -11236,6 +11231,7 @@ static int __wlan_hdd_cfg80211_disconnect( struct wiphy *wiphy,
  1165. eCSR_SCAN_ABORT_DEFAULT);
  1166. }
  1167.  
  1168. + wlan_hdd_cleanup_remain_on_channel_ctx(pAdapter);
  1169. #ifdef FEATURE_WLAN_TDLS
  1170. /* First clean up the tdls peers if any */
  1171. for (staIdx = 0 ; staIdx < pHddCtx->max_num_tdls_sta; staIdx++) {
  1172. @@ -11258,7 +11254,6 @@ static int __wlan_hdd_cfg80211_disconnect( struct wiphy *wiphy,
  1173. status = wlan_hdd_disconnect(pAdapter, reasonCode);
  1174. if (0 != status) {
  1175. hddLog(VOS_TRACE_LEVEL_ERROR, FL("failure, returned %d"), status);
  1176. - pHddStaCtx->conn_info.connState = connState;
  1177. return -EINVAL;
  1178. }
  1179. } else {
  1180. @@ -13007,7 +13002,7 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
  1181. tpSirPNOScanReq pPnoRequest = NULL;
  1182. hdd_context_t *pHddCtx;
  1183. tHalHandle hHal;
  1184. - v_U32_t i, indx, num_ch, tempInterval, j;
  1185. + v_U32_t i, indx, num_ch, j;
  1186. u8 valid_ch[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0};
  1187. u8 channels_allowed[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0};
  1188. v_U32_t num_channels_allowed = WNI_CFG_VALID_CHANNEL_LIST_LEN;
  1189. @@ -13193,7 +13188,8 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
  1190. memcpy(&pPnoRequest->p5GProbeTemplate, request->ie,
  1191. pPnoRequest->us5GProbeTemplateLen);
  1192. }
  1193. -
  1194. + //BEGIN MOT a19110 IKDREL3KK-2175 PNO enhancement
  1195. +#if 0
  1196. /* Driver gets only one time interval which is hard coded in
  1197. * supplicant for 10000ms. Taking power consumption into account 6 timers
  1198. * will be used, Timer value is increased exponentially i.e 10,20,40,
  1199. @@ -13222,6 +13218,13 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
  1200. }
  1201. //Repeat last timer until pno disabled.
  1202. pPnoRequest->scanTimers.aTimerValues[i-1].uTimerRepeat = 0;
  1203. +#endif
  1204. + pPnoRequest->scanTimers.ucScanTimersCount = 2;
  1205. + pPnoRequest->scanTimers.aTimerValues[0].uTimerRepeat = 7;
  1206. + pPnoRequest->scanTimers.aTimerValues[0].uTimerValue = 45;
  1207. + pPnoRequest->scanTimers.aTimerValues[1].uTimerRepeat = 0;
  1208. + pPnoRequest->scanTimers.aTimerValues[1].uTimerValue = 480;
  1209. + //END IKDREL3KK-2175
  1210.  
  1211. pPnoRequest->modePNO = SIR_PNO_MODE_IMMEDIATE;
  1212.  
  1213. @@ -13846,6 +13849,21 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
  1214. {
  1215. tANI_U8 i;
  1216.  
  1217. + if (pTdlsPeer->is_responder == 0)
  1218. + {
  1219. + v_U8_t staId = (v_U8_t)pTdlsPeer->staId;
  1220. +
  1221. + wlan_hdd_tdls_timer_restart(pAdapter,
  1222. + &pTdlsPeer->initiatorWaitTimeoutTimer,
  1223. + WAIT_TIME_TDLS_INITIATOR);
  1224. + /*
  1225. + * Suspend initiator TX until it receives direct
  1226. + * packet from the responder or
  1227. + * WAIT_TIME_TDLS_INITIATOR timer expires
  1228. + */
  1229. + WLANTL_SuspendDataTx( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext,
  1230. + &staId, NULL);
  1231. + }
  1232. vos_mem_zero(&smeTdlsPeerStateParams,
  1233. sizeof(tSmeTdlsPeerStateParams));
  1234.  
  1235. diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_early_suspend.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_early_suspend.c
  1236. index 4625741..c15731a 100644
  1237. --- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_early_suspend.c
  1238. +++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_early_suspend.c
  1239. @@ -1325,7 +1325,6 @@ void hdd_suspend_wlan(void (*callback)(void *callbackContext, boolean suspended)
  1240. send_suspend_ind:
  1241. //stop all TX queues before suspend
  1242. netif_tx_disable(pAdapter->dev);
  1243. - WLANTL_PauseUnPauseQs(pVosContext, true);
  1244.  
  1245. /* Keep this suspend indication at the end (before processing next adaptor)
  1246. * for discrete. This indication is considered as trigger point to start
  1247. @@ -1650,9 +1649,6 @@ void hdd_resume_wlan(void)
  1248.  
  1249. send_resume_ind:
  1250. //wake the tx queues
  1251. - hddLog(LOG1, FL("Enabling queues"));
  1252. - WLANTL_PauseUnPauseQs(pVosContext, false);
  1253. -
  1254. netif_tx_wake_all_queues(pAdapter->dev);
  1255.  
  1256. hdd_conf_resume_ind(pAdapter);
  1257. diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_hostapd.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_hostapd.c
  1258. index 238df71..18c8adf 100644
  1259. --- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_hostapd.c
  1260. +++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_hostapd.c
  1261. @@ -765,7 +765,10 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa
  1262. hdd_config_t *cfg = NULL;
  1263. struct wlan_dfs_info dfs_info;
  1264. v_U8_t cc_len = WLAN_SVC_COUNTRY_CODE_LEN;
  1265. +
  1266. +#ifdef WLAN_FEATURE_MBSSID
  1267. hdd_adapter_t *con_sap_adapter;
  1268. +#endif
  1269. VOS_STATUS status = VOS_STATUS_SUCCESS;
  1270. #if defined CONFIG_CNSS
  1271. int ret = 0;
  1272. @@ -965,13 +968,6 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa
  1273. || ignoreCAC)
  1274. {
  1275. pHddApCtx->dfs_cac_block_tx = VOS_FALSE;
  1276. - } else {
  1277. - /*
  1278. - * DFS requirement: Do not transmit during CAC.
  1279. - * This flag will be reset when BSS starts
  1280. - * (if not in a DFS channel) or CAC ends.
  1281. - */
  1282. - pHddApCtx->dfs_cac_block_tx = VOS_TRUE;
  1283. }
  1284.  
  1285. VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_MED,
  1286. @@ -1040,33 +1036,39 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa
  1287. }
  1288. }
  1289. #endif
  1290. - /* reset the dfs_cac_status and dfs_cac_block_tx flag only when
  1291. - * the last BSS is stopped
  1292. - */
  1293. +#ifdef WLAN_FEATURE_MBSSID
  1294. con_sap_adapter = hdd_get_con_sap_adapter(pHostapdAdapter);
  1295. - if (!con_sap_adapter) {
  1296. - pHddApCtx->dfs_cac_block_tx = TRUE;
  1297. - pHddCtx->dev_dfs_cac_status = DFS_CAC_NEVER_DONE;
  1298. + if (con_sap_adapter) {
  1299. + if (!VOS_IS_DFS_CH(
  1300. + con_sap_adapter->sessionCtx.ap.operatingChannel))
  1301. + pHddCtx->dev_dfs_cac_status = DFS_CAC_NEVER_DONE;
  1302. }
  1303. +#endif
  1304. goto stopbss;
  1305.  
  1306. case eSAP_DFS_CAC_START:
  1307. wlan_hdd_send_svc_nlink_msg(WLAN_SVC_DFS_CAC_START_IND,
  1308. &dfs_info, sizeof(struct wlan_dfs_info));
  1309. +#ifdef WLAN_FEATURE_MBSSID
  1310. pHddCtx->dev_dfs_cac_status = DFS_CAC_IN_PROGRESS;
  1311. +#endif
  1312. break;
  1313.  
  1314. case eSAP_DFS_CAC_END:
  1315. wlan_hdd_send_svc_nlink_msg(WLAN_SVC_DFS_CAC_END_IND,
  1316. &dfs_info, sizeof(struct wlan_dfs_info));
  1317. pHddApCtx->dfs_cac_block_tx = VOS_FALSE;
  1318. +#ifdef WLAN_FEATURE_MBSSID
  1319. pHddCtx->dev_dfs_cac_status = DFS_CAC_ALREADY_DONE;
  1320. +#endif
  1321. break;
  1322.  
  1323. case eSAP_DFS_RADAR_DETECT:
  1324. wlan_hdd_send_svc_nlink_msg(WLAN_SVC_DFS_RADAR_DETECT_IND,
  1325. &dfs_info, sizeof(struct wlan_dfs_info));
  1326. +#ifdef WLAN_FEATURE_MBSSID
  1327. pHddCtx->dev_dfs_cac_status = DFS_CAC_NEVER_DONE;
  1328. +#endif
  1329. break;
  1330.  
  1331. case eSAP_DFS_NO_AVAILABLE_CHANNEL:
  1332. @@ -1955,13 +1957,31 @@ static iw_softap_setparam(struct net_device *dev,
  1333. {
  1334. hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
  1335. tHalHandle hHal;
  1336. - int *value = (int *)extra;
  1337. - int sub_cmd = value[0];
  1338. - int set_value = value[1];
  1339. + //BEGIN MOT a19110 IKDREL3KK-11113 Fix iwpriv panic
  1340. + int *value;
  1341. + int sub_cmd;
  1342. + int set_value;
  1343. + int *tmp = (int *) extra;
  1344. + //END IKDREL3KK-11113
  1345. eHalStatus status;
  1346. int ret = 0; /* success */
  1347. v_CONTEXT_t pVosContext;
  1348.  
  1349. +
  1350. + //BEGIN MOT a19110 IKDREL3KK-11113 Fix iwpriv panic
  1351. + if(tmp[0] < 0 || tmp[0] > QCASAP_SET_PHYMODE)
  1352. + {
  1353. + value = (int *)(wrqu->data.pointer);
  1354. + }
  1355. + else
  1356. + {
  1357. + value = (int *)extra;
  1358. + }
  1359. +
  1360. + sub_cmd = value[0];
  1361. + set_value = value[1];
  1362. + //END IKDREL3KK-11113
  1363. +
  1364. if (!pHostapdAdapter || !pHostapdAdapter->pHddCtx)
  1365. {
  1366. VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
  1367. @@ -2982,7 +3002,7 @@ int iw_softap_modify_acl(struct net_device *dev, struct iw_request_info *info,
  1368. #ifndef WLAN_FEATURE_MBSSID
  1369. v_CONTEXT_t pVosContext = (WLAN_HDD_GET_CTX(pHostapdAdapter))->pvosContext;
  1370. #endif
  1371. - v_BYTE_t *value = (v_BYTE_t*)extra;
  1372. + v_BYTE_t *value = (v_BYTE_t*)(wrqu->data.pointer);
  1373. v_U8_t pPeerStaMac[VOS_MAC_ADDR_SIZE];
  1374. int listType, cmd, i;
  1375. int ret = 0; /* success */
  1376. @@ -3203,7 +3223,7 @@ static iw_softap_disassoc_sta(struct net_device *dev,
  1377. /* iwpriv tool or framework calls this ioctl with
  1378. * data passed in extra (less than 16 octets);
  1379. */
  1380. - peerMacAddr = (v_U8_t *)(extra);
  1381. + peerMacAddr = (v_U8_t *)(wrqu->data.pointer);
  1382.  
  1383. hddLog(LOG1, "%s data " MAC_ADDRESS_STR,
  1384. __func__, MAC_ADDR_ARRAY(peerMacAddr));
  1385. @@ -4978,6 +4998,12 @@ VOS_STATUS hdd_init_ap_mode( hdd_adapter_t *pAdapter )
  1386.  
  1387. pAdapter->sessionCtx.ap.sapContext = sapContext;
  1388.  
  1389. + /*
  1390. + * DFS requirement: Do not transmit during CAC. This flag will be reset
  1391. + * when BSS starts(if not in a DFS channel) or CAC ends.
  1392. + */
  1393. + pAdapter->sessionCtx.ap.dfs_cac_block_tx = VOS_TRUE;
  1394. +
  1395. status = WLANSAP_Start(sapContext);
  1396. if ( ! VOS_IS_STATUS_SUCCESS( status ) )
  1397. {
  1398. diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_main.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_main.c
  1399. index 42e4dab..bee6957 100755
  1400. --- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_main.c
  1401. +++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_main.c
  1402. @@ -651,14 +651,9 @@ end:
  1403.  
  1404. static int hdd_netdev_notifier_call(struct notifier_block * nb,
  1405. unsigned long state,
  1406. - void *data)
  1407. + void *ndev)
  1408. {
  1409. -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
  1410. - struct netdev_notifier_info *dev_notif_info = data;
  1411. - struct net_device *dev = dev_notif_info->dev;
  1412. -#else
  1413. - struct net_device *dev = data;
  1414. -#endif
  1415. + struct net_device *dev = ndev;
  1416. hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
  1417. hdd_context_t *pHddCtx;
  1418. #ifdef WLAN_BTAMP_FEATURE
  1419. @@ -670,15 +665,11 @@ static int hdd_netdev_notifier_call(struct notifier_block * nb,
  1420. return NOTIFY_DONE;
  1421.  
  1422. if ((pAdapter->magic != WLAN_HDD_ADAPTER_MAGIC) &&
  1423. - (pAdapter->dev != dev)) {
  1424. - hddLog(LOGE, FL("device adapter is not matching!!!"));
  1425. + (pAdapter->dev != dev))
  1426. return NOTIFY_DONE;
  1427. - }
  1428.  
  1429. - if (!dev->ieee80211_ptr) {
  1430. - hddLog(LOGE, FL("ieee80211_ptr is NULL!!!"));
  1431. + if (!dev->ieee80211_ptr)
  1432. return NOTIFY_DONE;
  1433. - }
  1434.  
  1435. pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
  1436. if (NULL == pHddCtx)
  1437. @@ -3496,13 +3487,13 @@ static int hdd_set_app_type2_parser(hdd_adapter_t *pAdapter,
  1438.  
  1439. memset(&params, 0, sizeof(tSirAppType2Params));
  1440.  
  1441. - ret = sscanf(arg, "%17s %16s %x %x %x %u %u %hu %hu %u %u %u %u %u %u",
  1442. + ret = sscanf(arg, "%17s %16s %x %x %x %u %u %u %u %u %u %u %u %u %u",
  1443. mac_addr, rc4_key, (unsigned int *)&params.ip_id,
  1444. (unsigned int*)&params.ip_device_ip,
  1445. (unsigned int*)&params.ip_server_ip,
  1446. (unsigned int*)&params.tcp_seq, (unsigned int*)&params.tcp_ack_seq,
  1447. - (uint16_t *)&params.tcp_src_port,
  1448. - (uint16_t *)&params.tcp_dst_port,
  1449. + (unsigned int*)&params.tcp_src_port,
  1450. + (unsigned int*)&params.tcp_dst_port,
  1451. (unsigned int*)&params.keepalive_init,
  1452. (unsigned int*)&params.keepalive_min,
  1453. (unsigned int*)&params.keepalive_max,
  1454. @@ -4015,41 +4006,6 @@ int hdd_set_miracast_mode(hdd_adapter_t *pAdapter, tANI_U8 *command)
  1455. return 0;
  1456. }
  1457.  
  1458. -/**
  1459. - * drv_cmd_set_fcc_channel() - handle fcc constraint request
  1460. - * @hdd_ctx: HDD context
  1461. - * @cmd: command ptr
  1462. - * @cmd_len: command len
  1463. - *
  1464. - * Return: status
  1465. - */
  1466. -static int drv_cmd_set_fcc_channel(hdd_context_t *hdd_ctx, uint8_t *cmd,
  1467. - uint8_t cmd_len)
  1468. -{
  1469. - uint8_t *value;
  1470. - uint8_t fcc_constraint;
  1471. - eHalStatus status;
  1472. - int ret = 0;
  1473. -
  1474. - value = cmd + cmd_len + 1;
  1475. -
  1476. - ret = kstrtou8(value, 10, &fcc_constraint);
  1477. - if ((ret < 0) || (fcc_constraint > 1)) {
  1478. - /*
  1479. - * If the input value is greater than max value of datatype,
  1480. - * then also it is a failure
  1481. - */
  1482. - hddLog(LOGE, FL("value out of range"));
  1483. - return -EINVAL;
  1484. - }
  1485. -
  1486. - status = sme_disable_non_fcc_channel(hdd_ctx->hHal, !fcc_constraint);
  1487. - if (status != eHAL_STATUS_SUCCESS)
  1488. - ret = -EPERM;
  1489. -
  1490. - return ret;
  1491. -}
  1492. -
  1493. static int hdd_driver_command(hdd_adapter_t *pAdapter,
  1494. hdd_priv_data_t *ppriv_data)
  1495. {
  1496. @@ -5351,8 +5307,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter,
  1497. &modProfileFields);
  1498. sme_RoamReassoc(hHal, pAdapter->sessionId,
  1499. NULL, modProfileFields, &roamId, 1);
  1500. - ret = 0;
  1501. - goto exit;
  1502. + return 0;
  1503. }
  1504.  
  1505. /* Check channel number is a valid channel number */
  1506. @@ -5361,9 +5316,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter,
  1507. {
  1508. hddLog(VOS_TRACE_LEVEL_ERROR,
  1509. "%s: Invalid Channel [%d] \n", __func__, channel);
  1510. -
  1511. - ret = -EINVAL;
  1512. - goto exit;
  1513. + return -EINVAL;
  1514. }
  1515. #ifdef WLAN_FEATURE_ROAM_OFFLOAD
  1516. if (pHddCtx->cfg_ini->isRoamOffloadEnabled) {
  1517. @@ -6131,48 +6084,23 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter,
  1518. int set_value;
  1519. /* Move pointer to point the string */
  1520. value += 14;
  1521. - ret = sscanf(value, "%d", &set_value);
  1522. - if (ret != 1) {
  1523. - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
  1524. - "Wrong value is given for hdd_set_tdls_offchannel");
  1525. - ret = -EINVAL;
  1526. - goto exit;
  1527. - }
  1528. -
  1529. + sscanf(value, "%d", &set_value);
  1530. VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
  1531. - FL("Tdls offchannel num: %d"), set_value);
  1532. + FL("Tdls offchannel num: %d"),
  1533. + set_value);
  1534. ret = hdd_set_tdls_offchannel(pHddCtx, set_value);
  1535. } else if (strncmp(command, "TDLSSCAN", 8) == 0) {
  1536. uint8_t *value = command;
  1537. int set_value;
  1538. /* Move pointer to point the string */
  1539. value += 8;
  1540. - ret = sscanf(value, "%d", &set_value);
  1541. - if (ret != 1) {
  1542. - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
  1543. - "Wrong value is given for tdls_scan_type");
  1544. - ret = -EINVAL;
  1545. - goto exit;
  1546. - }
  1547. + sscanf(value, "%d", &set_value);
  1548. hddLog(LOG1, FL("Tdls scan type val: %d"),
  1549. set_value);
  1550. ret = hdd_set_tdls_scan_type(pHddCtx, set_value);
  1551. }
  1552. #endif
  1553. - else if (strncasecmp(command, "SET_FCC_CHANNEL", 15) == 0) {
  1554. - /*
  1555. - * this command wld be called by user-space when it detects WLAN
  1556. - * ON after airplane mode is set. When APM is set, WLAN turns off.
  1557. - * But it can be turned back on. Otherwise; when APM is turned back
  1558. - * off, WLAN wld turn back on. So at that point the command is
  1559. - * expected to come down. 0 means disable, 1 means enable. The
  1560. - * constraint is removed when parameter 1 is set or different
  1561. - * country code is set
  1562. - */
  1563. -
  1564. - ret = drv_cmd_set_fcc_channel(pHddCtx, command, 15);
  1565. -
  1566. - } else {
  1567. + else {
  1568. MTRACE(vos_trace(VOS_MODULE_ID_HDD,
  1569. TRACE_CODE_HDD_UNSUPPORTED_IOCTL,
  1570. pAdapter->sessionId, 0));
  1571. @@ -12053,9 +11981,15 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc)
  1572.  
  1573. if ( VOS_STATUS_SUCCESS != hdd_update_mac_config( pHddCtx ) )
  1574. {
  1575. - hddLog(VOS_TRACE_LEVEL_WARN,
  1576. - "%s: can't update mac config, using MAC from ini file",
  1577. + hddLog(VOS_TRACE_LEVEL_FATAL,
  1578. + "%s: can't update mac config, using MAC from serial number",
  1579. __func__);
  1580. + if ( VOS_STATUS_SUCCESS != hdd_update_mac_serial( pHddCtx ) )
  1581. + {
  1582. + hddLog(VOS_TRACE_LEVEL_FATAL,
  1583. + "%s: can't update mac from serial number, using MAC from ini file",
  1584. + __func__);
  1585. + }
  1586. }
  1587.  
  1588. {
  1589. @@ -13186,6 +13120,26 @@ tVOS_CONCURRENCY_MODE hdd_get_concurrency_mode ( void )
  1590. return VOS_STA;
  1591. }
  1592.  
  1593. +// BEGIN MOTOROLA IKJB42MAIN-274, dpn473, 01/02/2013, Add flag to disable/enable MCC mode
  1594. +v_U8_t hdd_get_mcc_mode( void )
  1595. +{
  1596. + v_CONTEXT_t pVosContext = vos_get_global_context( VOS_MODULE_ID_HDD, NULL );
  1597. + hdd_context_t *pHddCtx;
  1598. +
  1599. + if (NULL != pVosContext)
  1600. + {
  1601. + pHddCtx = vos_get_context( VOS_MODULE_ID_HDD, pVosContext);
  1602. + if (NULL != pHddCtx)
  1603. + {
  1604. + return (v_U8_t)pHddCtx->cfg_ini->enableMCC;
  1605. + }
  1606. + }
  1607. + /* we are in an invalid state :( */
  1608. + hddLog(LOGE, "%s: Invalid context", __func__);
  1609. + return (v_U8_t)0;
  1610. +}
  1611. +// END IKJB42MAIN-274
  1612. +
  1613. /* Decide whether to allow/not the apps power collapse.
  1614. * Allow apps power collapse if we are in connected state.
  1615. * if not, allow only if we are in IMPS */
  1616. diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_p2p.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_p2p.c
  1617. index 874f847..0b7b1d8 100644
  1618. --- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_p2p.c
  1619. +++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_p2p.c
  1620. @@ -435,13 +435,12 @@ void wlan_hdd_cleanup_remain_on_channel_ctx(hdd_adapter_t *pAdapter)
  1621. pAdapter->is_roc_inprogress = FALSE;
  1622. }
  1623. mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
  1624. +
  1625. }
  1626. - /* hold the lock before break from the loop */
  1627. - mutex_lock(&cfgState->remain_on_chan_ctx_lock);
  1628. break;
  1629. }
  1630. mutex_lock(&cfgState->remain_on_chan_ctx_lock);
  1631. - } /* end of while */
  1632. + }
  1633. mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
  1634.  
  1635. }
  1636. @@ -512,18 +511,6 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter,
  1637. v_BOOL_t isGoPresent = VOS_FALSE;
  1638. unsigned int duration;
  1639.  
  1640. - mutex_lock(&cfgState->remain_on_chan_ctx_lock);
  1641. - if (pAdapter->is_roc_inprogress == TRUE) {
  1642. - mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
  1643. - hddLog(VOS_TRACE_LEVEL_ERROR,
  1644. - FL("remain on channel request is in execution"));
  1645. - return -EBUSY;
  1646. - }
  1647. - cfgState->remain_on_chan_ctx = pRemainChanCtx;
  1648. - cfgState->current_freq = pRemainChanCtx->chan.center_freq;
  1649. - pAdapter->is_roc_inprogress = TRUE;
  1650. - mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
  1651. -
  1652. /* Initialize Remain on chan timer */
  1653. vos_status = vos_timer_init(&pRemainChanCtx->hdd_remain_on_chan_timer,
  1654. VOS_TIMER_TYPE_SW,
  1655. @@ -532,15 +519,15 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter,
  1656. if (vos_status != VOS_STATUS_SUCCESS)
  1657. {
  1658. hddLog(VOS_TRACE_LEVEL_ERROR,
  1659. - FL("Not able to initialize remain_on_chan timer"));
  1660. - mutex_lock(&cfgState->remain_on_chan_ctx_lock);
  1661. - cfgState->remain_on_chan_ctx = NULL;
  1662. - pAdapter->is_roc_inprogress = FALSE;
  1663. - mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
  1664. - vos_mem_free(pRemainChanCtx);
  1665. - return -EINVAL;
  1666. + "%s: Not able to initialize remain_on_chan timer",__func__);
  1667. }
  1668.  
  1669. + mutex_lock(&cfgState->remain_on_chan_ctx_lock);
  1670. + cfgState->remain_on_chan_ctx = pRemainChanCtx;
  1671. + cfgState->current_freq = pRemainChanCtx->chan.center_freq;
  1672. + pAdapter->is_roc_inprogress = TRUE;
  1673. + mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
  1674. +
  1675. status = hdd_get_front_adapter ( pHddCtx, &pAdapterNode );
  1676. while ( NULL != pAdapterNode && VOS_STATUS_SUCCESS == status )
  1677. {
  1678. @@ -702,7 +689,6 @@ static int wlan_hdd_roc_request_enqueue(hdd_adapter_t *adapter,
  1679. void wlan_hdd_roc_request_dequeue(struct work_struct *work)
  1680. {
  1681. VOS_STATUS status;
  1682. - int ret = 0;
  1683. hdd_roc_req_t *hdd_roc_req;
  1684. hdd_context_t *hdd_ctx =
  1685. container_of(work, hdd_context_t, rocReqWork);
  1686. @@ -733,14 +719,9 @@ void wlan_hdd_roc_request_dequeue(struct work_struct *work)
  1687. spin_unlock(&hdd_ctx->hdd_roc_req_q.lock);
  1688.  
  1689. if (status == VOS_STATUS_SUCCESS) {
  1690. - ret = wlan_hdd_execute_remain_on_channel(
  1691. + wlan_hdd_execute_remain_on_channel(
  1692. hdd_roc_req->pAdapter,
  1693. hdd_roc_req->pRemainChanCtx);
  1694. - if (ret == -EBUSY){
  1695. - hddLog(VOS_TRACE_LEVEL_ERROR,
  1696. - FL("dropping RoC request"));
  1697. - vos_mem_free(hdd_roc_req->pRemainChanCtx);
  1698. - }
  1699. vos_mem_free(hdd_roc_req);
  1700. }
  1701. }
  1702. @@ -762,7 +743,6 @@ static int wlan_hdd_request_remain_on_channel( struct wiphy *wiphy,
  1703. v_SIZE_t size = 0;
  1704. hdd_adapter_t *sta_adapter;
  1705. int ret = 0;
  1706. - int status = 0;
  1707.  
  1708. hddLog(VOS_TRACE_LEVEL_INFO, "%s: device_mode = %d",
  1709. __func__, pAdapter->device_mode);
  1710. @@ -833,7 +813,7 @@ static int wlan_hdd_request_remain_on_channel( struct wiphy *wiphy,
  1711.  
  1712. wlan_hdd_roc_request_enqueue(pAdapter, pRemainChanCtx);
  1713. schedule_delayed_work(&pAdapter->roc_work,
  1714. - msecs_to_jiffies(pHddCtx->cfg_ini->p2p_listen_defer_interval));
  1715. + msecs_to_jiffies(pHddCtx->cfg_ini->p2p_listen_defer_interval));
  1716. hddLog(LOG1, "Defer interval is %hu, pAdapter %p",
  1717. pHddCtx->cfg_ini->p2p_listen_defer_interval, pAdapter);
  1718. return 0;
  1719. @@ -846,20 +826,12 @@ static int wlan_hdd_request_remain_on_channel( struct wiphy *wiphy,
  1720.  
  1721. if ((isBusy == VOS_FALSE) && (!size)) {
  1722. /* Media is free and no RoC request is in queue, execute directly */
  1723. - status = wlan_hdd_execute_remain_on_channel(pAdapter,
  1724. - pRemainChanCtx);
  1725. - if (status == -EBUSY) {
  1726. - if (wlan_hdd_roc_request_enqueue(pAdapter, pRemainChanCtx)) {
  1727. - vos_mem_free(pRemainChanCtx);
  1728. - return -EAGAIN;
  1729. - }
  1730. - }
  1731. + wlan_hdd_execute_remain_on_channel(pAdapter, pRemainChanCtx);
  1732. +
  1733. return 0;
  1734. } else {
  1735. - if (wlan_hdd_roc_request_enqueue(pAdapter, pRemainChanCtx)) {
  1736. - vos_mem_free(pRemainChanCtx);
  1737. - return -EAGAIN;
  1738. - }
  1739. + if (wlan_hdd_roc_request_enqueue(pAdapter, pRemainChanCtx))
  1740. + return -EAGAIN;
  1741. }
  1742.  
  1743. /*
  1744. diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_tdls.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_tdls.c
  1745. index c4a7e00..d141acb 100644
  1746. --- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_tdls.c
  1747. +++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_tdls.c
  1748. @@ -51,6 +51,7 @@ static tANI_S32 wlan_hdd_get_tdls_discovery_peer_cnt(tdlsCtx_t *pHddTdlsCtx);
  1749.  
  1750. static tANI_S32 wlan_hdd_tdls_peer_reset_discovery_processed(tdlsCtx_t *pHddTdlsCtx);
  1751. static void wlan_hdd_tdls_timers_destroy(tdlsCtx_t *pHddTdlsCtx);
  1752. +static void wlan_hdd_tdls_peer_timers_destroy(tdlsCtx_t *pHddTdlsCtx);
  1753. int wpa_tdls_is_allowed_force_peer(tdlsCtx_t *pHddTdlsCtx, u8 *mac);
  1754. #ifdef CONFIG_TDLS_IMPLICIT
  1755. static void wlan_hdd_tdls_pre_setup(struct work_struct *work);
  1756. @@ -423,6 +424,31 @@ static v_VOID_t wlan_hdd_tdls_discovery_timeout_peer_cb(v_PVOID_t userData)
  1757. return;
  1758. }
  1759.  
  1760. +static v_VOID_t wlan_hdd_tdls_initiator_wait_cb( v_PVOID_t userData )
  1761. +{
  1762. + hddTdlsPeer_t *curr_peer = (hddTdlsPeer_t *)userData;
  1763. + tdlsCtx_t *pHddTdlsCtx;
  1764. +
  1765. + if ( NULL == curr_peer )
  1766. + {
  1767. + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
  1768. + FL("curr_peer is NULL"));
  1769. + return;
  1770. + }
  1771. +
  1772. + pHddTdlsCtx = curr_peer->pHddTdlsCtx;
  1773. +
  1774. + if ( NULL == pHddTdlsCtx )
  1775. + {
  1776. + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
  1777. + FL("pHddTdlsCtx is NULL"));
  1778. + return;
  1779. + }
  1780. +
  1781. + WLANTL_ResumeDataTx( (WLAN_HDD_GET_CTX(pHddTdlsCtx->pAdapter))->pvosContext,
  1782. + (v_U8_t *)&curr_peer->staId);
  1783. +}
  1784. +
  1785. static void wlan_hdd_tdls_free_list(tdlsCtx_t *pHddTdlsCtx)
  1786. {
  1787. int i;
  1788. @@ -481,10 +507,28 @@ static void wlan_hdd_tdls_monitor_timers_stop(tdlsCtx_t *pHddTdlsCtx)
  1789. vos_timer_stop(&pHddTdlsCtx->peerDiscoveryTimeoutTimer);
  1790. }
  1791.  
  1792. +/* stop all per peer timers */
  1793. +static void wlan_hdd_tdls_peer_timers_stop(tdlsCtx_t *pHddTdlsCtx)
  1794. +{
  1795. + int i;
  1796. + struct list_head *head;
  1797. + struct list_head *pos;
  1798. + hddTdlsPeer_t *curr_peer;
  1799. + for (i = 0; i < TDLS_PEER_LIST_SIZE; i++)
  1800. + {
  1801. + head = &pHddTdlsCtx->peer_list[i];
  1802. + list_for_each (pos, head) {
  1803. + curr_peer = list_entry (pos, hddTdlsPeer_t, node);
  1804. + vos_timer_stop( &curr_peer->initiatorWaitTimeoutTimer );
  1805. + }
  1806. + }
  1807. +}
  1808. +
  1809. /* stop all the tdls timers running */
  1810. static void wlan_hdd_tdls_timers_stop(tdlsCtx_t *pHddTdlsCtx)
  1811. {
  1812. wlan_hdd_tdls_monitor_timers_stop(pHddTdlsCtx);
  1813. + wlan_hdd_tdls_peer_timers_stop(pHddTdlsCtx);
  1814. }
  1815.  
  1816. int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter)
  1817. @@ -579,6 +623,7 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter)
  1818. list_for_each_safe(pos, q, head) {
  1819. tmp = list_entry(pos, hddTdlsPeer_t, node);
  1820. if (FALSE == tmp->isForcedPeer) {
  1821. + vos_timer_destroy(&tmp->initiatorWaitTimeoutTimer);
  1822. list_del(pos);
  1823. vos_mem_free(tmp);
  1824. tmp = NULL;
  1825. @@ -891,11 +936,32 @@ static void wlan_hdd_tdls_monitor_timers_destroy(tdlsCtx_t *pHddTdlsCtx)
  1826. vos_timer_stop(&pHddTdlsCtx->peerDiscoveryTimeoutTimer);
  1827. vos_timer_destroy(&pHddTdlsCtx->peerDiscoveryTimeoutTimer);
  1828. }
  1829. +/*Free all the timers related to the TDLS peer */
  1830. +static void wlan_hdd_tdls_peer_timers_destroy(tdlsCtx_t *pHddTdlsCtx)
  1831. +{
  1832. + int i;
  1833. + struct list_head *head;
  1834. + struct list_head *pos;
  1835. + hddTdlsPeer_t *curr_peer;
  1836. + for (i = 0; i < TDLS_PEER_LIST_SIZE; i++)
  1837. + {
  1838. + head = &pHddTdlsCtx->peer_list[i];
  1839. +
  1840. + list_for_each (pos, head) {
  1841. + curr_peer = list_entry (pos, hddTdlsPeer_t, node);
  1842. +
  1843. + vos_timer_stop(&curr_peer->initiatorWaitTimeoutTimer);
  1844. + vos_timer_destroy(&curr_peer->initiatorWaitTimeoutTimer);
  1845. + }
  1846. + }
  1847. +
  1848. +}
  1849.  
  1850. /* destroy all the tdls timers running */
  1851. static void wlan_hdd_tdls_timers_destroy(tdlsCtx_t *pHddTdlsCtx)
  1852. {
  1853. wlan_hdd_tdls_monitor_timers_destroy(pHddTdlsCtx);
  1854. + wlan_hdd_tdls_peer_timers_destroy(pHddTdlsCtx);
  1855. }
  1856.  
  1857. /* if mac address exist, return pointer
  1858. @@ -952,6 +1018,11 @@ hddTdlsPeer_t *wlan_hdd_tdls_get_peer(hdd_adapter_t *pAdapter, u8 *mac)
  1859. peer->pHddTdlsCtx = pHddTdlsCtx;
  1860. peer->pref_off_chan_num = pHddCtx->cfg_ini->fTDLSPrefOffChanNum;
  1861.  
  1862. + vos_timer_init(&peer->initiatorWaitTimeoutTimer,
  1863. + VOS_TIMER_TYPE_SW,
  1864. + wlan_hdd_tdls_initiator_wait_cb,
  1865. + peer);
  1866. +
  1867. list_add_tail(&peer->node, head);
  1868. mutex_unlock(&pHddCtx->tdls_lock);
  1869.  
  1870. @@ -2074,6 +2145,7 @@ void wlan_hdd_tdls_disconnection_callback(hdd_adapter_t *pAdapter)
  1871. wlan_hdd_tdls_check_power_save_prohibited(pHddTdlsCtx->pAdapter);
  1872.  
  1873. wlan_hdd_tdls_monitor_timers_stop(pHddTdlsCtx);
  1874. + wlan_hdd_tdls_peer_timers_destroy(pHddTdlsCtx);
  1875. wlan_hdd_tdls_free_list(pHddTdlsCtx);
  1876.  
  1877. pHddTdlsCtx->curr_candidate = NULL;
  1878. diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_tx_rx.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_tx_rx.c
  1879. index ec4940f..591153c 100644
  1880. --- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_tx_rx.c
  1881. +++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_tx_rx.c
  1882. @@ -85,6 +85,7 @@ const v_U8_t hdd_QdiscAcToTlAC[] = {
  1883. };
  1884.  
  1885. static struct sk_buff* hdd_mon_tx_fetch_pkt(hdd_adapter_t* pAdapter);
  1886. +extern int dumpEnable;
  1887.  
  1888. /*---------------------------------------------------------------------------
  1889. Type declarations
  1890. @@ -1749,75 +1750,81 @@ VOS_STATUS hdd_rx_packet_cbk(v_VOID_t *vosContext,
  1891. skb = (struct sk_buff *) rxBuf;
  1892. pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
  1893. while (NULL != skb) {
  1894. - skb_next = skb->next;
  1895. -
  1896. - if ((pHddStaCtx->conn_info.proxyARPService) &&
  1897. - cfg80211_is_gratuitous_arp_unsolicited_na(skb)) {
  1898. - ++pAdapter->hdd_stats.hddTxRxStats.rxDropped;
  1899. - VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO,
  1900. - "%s: Dropping HS 2.0 Gratuitous ARP or Unsolicited NA", __func__);
  1901. - kfree_skb(skb);
  1902. -
  1903. - skb = skb_next;
  1904. - continue;
  1905. - }
  1906. + skb_next = skb->next;
  1907. +
  1908. + if ((pHddStaCtx->conn_info.proxyARPService) &&
  1909. + cfg80211_is_gratuitous_arp_unsolicited_na(skb)) {
  1910. + ++pAdapter->hdd_stats.hddTxRxStats.rxDropped;
  1911. + VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_INFO,
  1912. + "%s: Dropping HS 2.0 Gratuitous ARP or Unsolicited NA", __func__);
  1913. + kfree_skb(skb);
  1914. + skb = skb_next;
  1915. + continue;
  1916. + }
  1917.  
  1918. #ifdef QCA_PKT_PROTO_TRACE
  1919. if ((pHddCtx->cfg_ini->gEnableDebugLog & VOS_PKT_TRAC_TYPE_EAPOL) ||
  1920. (pHddCtx->cfg_ini->gEnableDebugLog & VOS_PKT_TRAC_TYPE_DHCP)) {
  1921. proto_type = vos_pkt_get_proto_type(skb,
  1922. pHddCtx->cfg_ini->gEnableDebugLog, 0);
  1923. - if (VOS_PKT_TRAC_TYPE_EAPOL & proto_type)
  1924. - vos_pkt_trace_buf_update("ST:R:EPL");
  1925. - else if (VOS_PKT_TRAC_TYPE_DHCP & proto_type)
  1926. - vos_pkt_trace_buf_update("ST:R:DHC");
  1927. - }
  1928. + if (VOS_PKT_TRAC_TYPE_EAPOL & proto_type)
  1929. + vos_pkt_trace_buf_update("ST:R:EPL");
  1930. + else if (VOS_PKT_TRAC_TYPE_DHCP & proto_type)
  1931. + vos_pkt_trace_buf_update("ST:R:DHC");
  1932. + }
  1933. +
  1934. #endif /* QCA_PKT_PROTO_TRACE */
  1935.  
  1936. skb->dev = pAdapter->dev;
  1937. skb->protocol = eth_type_trans(skb, skb->dev);
  1938.  
  1939. - /* Check & drop mcast packets (for IPV6) as required */
  1940. - if (drop_ip6_mcast(skb)) {
  1941. + /* Check & drop mcast packets (for IPV6) as required */
  1942. + if (drop_ip6_mcast(skb)) {
  1943. print_hex_dump_bytes("MAC Header",
  1944. - DUMP_PREFIX_NONE, skb_mac_header(skb), 16);
  1945. + DUMP_PREFIX_NONE, skb_mac_header(skb), 16);
  1946. ++pAdapter->hdd_stats.hddTxRxStats.rxDropped;
  1947. VOS_TRACE(VOS_MODULE_ID_HDD_DATA, VOS_TRACE_LEVEL_ERROR,
  1948. - "%s: Dropping multicast to self NA", __func__);
  1949. - kfree_skb(skb);
  1950. -
  1951. - skb = skb_next;
  1952. - continue;
  1953. - }
  1954. -
  1955. - ++pAdapter->hdd_stats.hddTxRxStats.rxPackets;
  1956. - ++pAdapter->stats.rx_packets;
  1957. - pAdapter->stats.rx_bytes += skb->len;
  1958. -
  1959. - /*
  1960. - * If this is not a last packet on the chain
  1961. - * Just put packet into backlog queue, not scheduling RX sirq
  1962. - */
  1963. - if (skb->next) {
  1964. - rxstat = netif_rx(skb);
  1965. - } else {
  1966. + "%s: Dropping multicast to self NA", __func__);
  1967. + kfree_skb(skb);
  1968. +
  1969. + skb = skb_next;
  1970. + continue;
  1971. + }
  1972. +
  1973. + ++pAdapter->hdd_stats.hddTxRxStats.rxPackets;
  1974. + ++pAdapter->stats.rx_packets;
  1975. + pAdapter->stats.rx_bytes += skb->len;
  1976. +
  1977. + /*
  1978. + * If this is not a last packet on the chain
  1979. + * Just put packet into backlog queue, not scheduling RX sirq
  1980. + */
  1981. + if (skb->next) {
  1982. + rxstat = netif_rx(skb);
  1983. + } else {
  1984. #ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK
  1985. - vos_wake_lock_timeout_acquire(&pHddCtx->rx_wake_lock,
  1986. - HDD_WAKE_LOCK_DURATION);
  1987. + vos_wake_lock_timeout_acquire(&pHddCtx->rx_wake_lock,
  1988. + HDD_WAKE_LOCK_DURATION);
  1989. #endif
  1990. - /*
  1991. - * This is the last packet on the chain
  1992. - * Scheduling rx sirq
  1993. - */
  1994. - rxstat = netif_rx_ni(skb);
  1995. - }
  1996. -
  1997. - if (NET_RX_SUCCESS == rxstat)
  1998. - ++pAdapter->hdd_stats.hddTxRxStats.rxDelivered;
  1999. - else
  2000. - ++pAdapter->hdd_stats.hddTxRxStats.rxRefused;
  2001. -
  2002. - skb = skb_next;
  2003. + if (dumpEnable == 1) {
  2004. + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
  2005. + "%s: RX-data dump\n", __func__);
  2006. + VOS_TRACE_HEX_DUMP(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
  2007. + skb->data, 64);
  2008. + }
  2009. + /*
  2010. + * This is the last packet on the chain
  2011. + * Scheduling rx sirq
  2012. + */
  2013. + rxstat = netif_rx_ni(skb);
  2014. + }
  2015. +
  2016. + if (NET_RX_SUCCESS == rxstat)
  2017. + ++pAdapter->hdd_stats.hddTxRxStats.rxDelivered;
  2018. + else
  2019. + ++pAdapter->hdd_stats.hddTxRxStats.rxRefused;
  2020. +
  2021. + skb = skb_next;
  2022. }
  2023.  
  2024. pAdapter->dev->last_rx = jiffies;
  2025. diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wext.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wext.c
  2026. index e52008e..3aecb37 100644
  2027. --- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wext.c
  2028. +++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wext.c
  2029. @@ -118,7 +118,7 @@
  2030. #define HDD_FINISH_ULA_TIME_OUT 800
  2031. #define HDD_SET_MCBC_FILTERS_TO_FW 1
  2032. #define HDD_DELETE_MCBC_FILTERS_FROM_FW 0
  2033. -
  2034. +extern int dumpEnable;
  2035. extern int wlan_hdd_cfg80211_update_band(struct wiphy *wiphy, eCsrBand eBand);
  2036. static int ioctl_debug;
  2037. module_param(ioctl_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
  2038. @@ -241,6 +241,10 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2},
  2039. /* Private ioctl for packet power save */
  2040. #define WE_PPS_5G_EBT 83
  2041. #define WE_SET_CTS_CBW 84
  2042. +#define WE_SET_CHANNEL_RANGE 85 // Motorola, IKDREL3KK-5698
  2043. +// The below one should always be the last entry
  2044. +// It will have a value of last sub_cmd + 1
  2045. +#define MAX_SUB_CMD 86 // Motorola, IKDREL3KK-10418
  2046.  
  2047. /* Private ioctls and their sub-ioctls */
  2048. #define WLAN_PRIV_SET_NONE_GET_INT (SIOCIWFIRSTPRIV + 1)
  2049. @@ -252,6 +256,7 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2},
  2050. /* 7 is unused */
  2051. #define WE_GET_SAP_AUTO_CHANNEL_SELECTION 8
  2052. #define WE_GET_CONCURRENCY_MODE 9
  2053. +#define WE_GET_MCC_MODE 10 /* MOTOROLA IKJB42MAIN-274 */
  2054. #define WE_GET_NSS 11
  2055. #define WE_GET_LDPC 12
  2056. #define WE_GET_TX_STBC 13
  2057. @@ -4603,9 +4608,17 @@ static int iw_setint_getnone(struct net_device *dev, struct iw_request_info *inf
  2058. hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
  2059. hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
  2060. tSmeConfigParams smeConfig;
  2061. + //BEGIN MOT a19110 IKDREL3KK-10418
  2062. + int *value;
  2063. + int sub_cmd, set_value, cmd_len;
  2064. + int *tmp_value;
  2065. + //END IKDREL3KK-10418
  2066. + //BEGIN MOT a19110 IKDREL3KK-5698
  2067. +#if 0
  2068. int *value = (int *)extra;
  2069. int sub_cmd = value[0];
  2070. int set_value = value[1];
  2071. +#endif
  2072. int ret = 0; /* success */
  2073. int enable_pbm, enable_mp;
  2074.  
  2075. @@ -4622,6 +4635,34 @@ static int iw_setint_getnone(struct net_device *dev, struct iw_request_info *inf
  2076. return -EBUSY;
  2077. }
  2078.  
  2079. + //BEGIN MOT a19110 IKDREL3KK-10418
  2080. + tmp_value = (int *)extra;
  2081. +
  2082. + // Copy from wrqu structure if it was a ioctl from Motorola code
  2083. + if(tmp_value[0] < 0 || (tmp_value[0] >= MAX_SUB_CMD)) {
  2084. + cmd_len = wrqu->data.length;
  2085. + value = (int *) kmalloc(cmd_len+1, GFP_KERNEL); // Motorola, IKHSS7-39028
  2086. +
  2087. + if(value == NULL)
  2088. + return -ENOMEM;
  2089. +
  2090. + if(copy_from_user((char *) value, (char*)(wrqu->data.pointer), cmd_len)) {
  2091. + hddLog(VOS_TRACE_LEVEL_FATAL, "%s -- copy_from_user --data pointer failed! bailing",
  2092. + __FUNCTION__);
  2093. + kfree(value);
  2094. + return -EFAULT;
  2095. + }
  2096. +
  2097. + sub_cmd = value[0];
  2098. + set_value = value[1];
  2099. + kfree(value);
  2100. + } else {
  2101. + value = (int *)extra;
  2102. + sub_cmd = value[0];
  2103. + set_value = value[1];
  2104. + }
  2105. + //END IKDREL3KK-10418
  2106. +
  2107. switch(sub_cmd)
  2108. {
  2109. case WE_SET_11D_STATE:
  2110. @@ -5546,6 +5587,14 @@ static int iw_setint_getnone(struct net_device *dev, struct iw_request_info *inf
  2111. case WE_SET_TXRX_FWSTATS:
  2112. {
  2113. hddLog(LOG1, "WE_SET_TXRX_FWSTATS val %d", set_value);
  2114. +#if 0
  2115. + if (set_value == 9)
  2116. + dumpEnable =1;
  2117. + else if (set_value == 10)
  2118. + dumpEnable = 0;
  2119. + else
  2120. +#endif
  2121. + dumpEnable = 0;
  2122. ret = process_wma_set_command((int)pAdapter->sessionId,
  2123. (int)WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID,
  2124. set_value, VDEV_CMD);
  2125. @@ -5978,6 +6027,31 @@ static int iw_setint_getnone(struct net_device *dev, struct iw_request_info *inf
  2126. set_value, VDEV_CMD);
  2127. break;
  2128. }
  2129. + //BEGIN MOT a19110 IKDREL3KK-5698
  2130. + case WE_SET_CHANNEL_RANGE:
  2131. + {
  2132. + int startChannel, endChannel;
  2133. +
  2134. + if (set_value == 3) {
  2135. + startChannel = 149;
  2136. + endChannel = 161;
  2137. + } else if (set_value == 2) {
  2138. + startChannel = 100;
  2139. + endChannel = 144;
  2140. + } else if (set_value == 1) {
  2141. + startChannel = 36;
  2142. + endChannel = 64;
  2143. + } else {
  2144. + set_value = 0;
  2145. + startChannel = 1;
  2146. + endChannel = 14;
  2147. + }
  2148. +
  2149. + ret = iw_softap_set_channel_range( dev, startChannel, endChannel, set_value);
  2150. +
  2151. + break;
  2152. + }
  2153. + // END IKDREL3KK-5698
  2154. default:
  2155. {
  2156. hddLog(LOGE, "%s: Invalid sub command %d", __func__, sub_cmd);
  2157. @@ -6179,6 +6253,13 @@ static int iw_setnone_getint(struct net_device *dev, struct iw_request_info *inf
  2158. VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, ("concurrency mode=%d"),*value);
  2159. break;
  2160. }
  2161. + // BEGIN MOTOROLA IKJB42MAIN-274, dpn473, 01/02/2013, Add flag to disable/enable MCC mode
  2162. + case WE_GET_MCC_MODE:
  2163. + {
  2164. + *value = (int)hdd_get_mcc_mode();
  2165. + break;
  2166. + }
  2167. + // IKJB42MAIN-274
  2168.  
  2169. case WE_GET_NSS:
  2170. {
  2171. @@ -6652,8 +6733,12 @@ int iw_set_three_ints_getnone(struct net_device *dev,
  2172. union iwreq_data *wrqu, char *extra)
  2173. {
  2174. hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
  2175. - int *value = (int *)extra;
  2176. - int sub_cmd = value[0];
  2177. + //BEGIN MOT a19110 IKSWL-15774 Ioctl from Mot code
  2178. + int *value;
  2179. + int sub_cmd, cmd_len;
  2180. + int *tmp_value;
  2181. + int *get_value = NULL;
  2182. + //END IKSWL-15774
  2183. int ret = 0;
  2184.  
  2185. if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) {
  2186. @@ -6662,6 +6747,31 @@ int iw_set_three_ints_getnone(struct net_device *dev,
  2187. return -EBUSY;
  2188. }
  2189.  
  2190. + //BEGIN MOT a19110 IKSWL-15774 Ioctl from Mot code
  2191. + tmp_value = (int *)extra;
  2192. +
  2193. + // Copy from wrqu structure if it was a ioctl from Motorola code
  2194. + if(tmp_value[0] < 0 || (tmp_value[0] >= MAX_SUB_CMD)) {
  2195. + cmd_len = wrqu->data.length;
  2196. + get_value = (int *) kmalloc(cmd_len+1, GFP_KERNEL); // Motorola, IKHSS7-39028
  2197. +
  2198. + if(get_value == NULL)
  2199. + return -ENOMEM;
  2200. +
  2201. + if(copy_from_user((char *) get_value, (char*)(wrqu->data.pointer), cmd_len)) {
  2202. + hddLog(VOS_TRACE_LEVEL_FATAL, "%s -- copy_from_user --data pointer failed! bailing",
  2203. + __FUNCTION__);
  2204. + kfree(get_value);
  2205. + return -EFAULT;
  2206. + }
  2207. +
  2208. + value = (int *)get_value;
  2209. + } else {
  2210. + value = (int *)extra;
  2211. + }
  2212. + sub_cmd = value[0];
  2213. + //END IKSWL-15774
  2214. +
  2215. switch(sub_cmd) {
  2216.  
  2217. case WE_SET_WLAN_DBG:
  2218. @@ -6677,6 +6787,12 @@ int iw_set_three_ints_getnone(struct net_device *dev,
  2219. break;
  2220.  
  2221. }
  2222. +
  2223. + //BEGIN MOT a19110 IKSWL-15774 Ioctl from Mot code
  2224. + if(get_value != NULL)
  2225. + kfree(get_value);
  2226. + //END IKSWL-15774
  2227. +
  2228. return ret;
  2229. }
  2230.  
  2231. @@ -10097,6 +10213,13 @@ static const struct iw_priv_args we_private_args[] = {
  2232. IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
  2233. 0, "erx_dri_sample" },
  2234.  
  2235. + //BEGIN MOT a19110 IKDREL3KK-5698
  2236. + { WE_SET_CHANNEL_RANGE,
  2237. + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
  2238. + 0,
  2239. + "setChannelRange" },
  2240. + //END IKDREL3KK-5698
  2241. +
  2242. { WLAN_PRIV_SET_NONE_GET_INT,
  2243. 0,
  2244. IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
  2245. @@ -10133,6 +10256,12 @@ static const struct iw_priv_args we_private_args[] = {
  2246. IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
  2247. "getconcurrency" },
  2248.  
  2249. + /* MOTOROLA IKJB42MAIN-274 */
  2250. + { WE_GET_MCC_MODE,
  2251. + 0,
  2252. + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
  2253. + "getMccMode" },
  2254. +
  2255. { WE_GET_NSS,
  2256. 0,
  2257. IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
  2258. diff --git a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wmm.c b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wmm.c
  2259. index 1c6ea71..a43b3a3 100644
  2260. --- a/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wmm.c
  2261. +++ b/drivers/staging/qcacld-2.0/CORE/HDD/src/wlan_hdd_wmm.c
  2262. @@ -1576,10 +1576,7 @@ VOS_STATUS hdd_wmm_adapter_close ( hdd_adapter_t* pAdapter )
  2263. #ifdef FEATURE_WLAN_ESE
  2264. hdd_wmm_disable_inactivity_timer(pQosContext);
  2265. #endif
  2266. - if (pQosContext->handle == HDD_WMM_HANDLE_IMPLICIT
  2267. - && pQosContext->magic == HDD_WMM_CTX_MAGIC)
  2268. - vos_flush_work(&pQosContext->wmmAcSetupImplicitQos);
  2269. -
  2270. + vos_flush_work(&pQosContext->wmmAcSetupImplicitQos);
  2271. hdd_wmm_free_context(pQosContext);
  2272. }
  2273.  
  2274. diff --git a/drivers/staging/qcacld-2.0/CORE/MAC/inc/qwlan_version.h b/drivers/staging/qcacld-2.0/CORE/MAC/inc/qwlan_version.h
  2275. index b84b50f..3be167d 100644
  2276. --- a/drivers/staging/qcacld-2.0/CORE/MAC/inc/qwlan_version.h
  2277. +++ b/drivers/staging/qcacld-2.0/CORE/MAC/inc/qwlan_version.h
  2278. @@ -42,10 +42,9 @@ BRIEF DESCRIPTION:
  2279. #define QWLAN_VERSION_MINOR 4
  2280. #define QWLAN_VERSION_PATCH 21
  2281. #define QWLAN_VERSION_EXTRA ""
  2282. -#define QWLAN_VERSION_BUILD 65
  2283. -
  2284. -#define QWLAN_VERSIONSTR "4.4.21.65"
  2285. +#define QWLAN_VERSION_BUILD 52
  2286.  
  2287. +#define QWLAN_VERSIONSTR "4.4.21.52"
  2288.  
  2289. #define AR6320_REV1_VERSION 0x5000000
  2290. #define AR6320_REV1_1_VERSION 0x5000001
  2291. diff --git a/drivers/staging/qcacld-2.0/CORE/MAC/inc/sirApi.h b/drivers/staging/qcacld-2.0/CORE/MAC/inc/sirApi.h
  2292. index 260e120..8eee749 100644
  2293. --- a/drivers/staging/qcacld-2.0/CORE/MAC/inc/sirApi.h
  2294. +++ b/drivers/staging/qcacld-2.0/CORE/MAC/inc/sirApi.h
  2295. @@ -3496,7 +3496,6 @@ typedef struct sSirSmeAddStaSelfReq
  2296. tANI_U32 type;
  2297. tANI_U32 subType;
  2298. tANI_U8 sessionId;
  2299. - tANI_U16 pkt_err_disconn_th;
  2300. }tSirSmeAddStaSelfReq, *tpSirSmeAddStaSelfReq;
  2301.  
  2302. typedef struct sSirSmeDelStaSelfReq
  2303. diff --git a/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/include/limSession.h b/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/include/limSession.h
  2304. index d05acb6..678c4b2 100644
  2305. --- a/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/include/limSession.h
  2306. +++ b/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/include/limSession.h
  2307. @@ -616,18 +616,6 @@ tpPESession peFindSessionByPeerSta(tpAniSirGlobal pMac, tANI_U8* sa, tANI_U8* s
  2308. --------------------------------------------------------------------------*/
  2309. void peDeleteSession(tpAniSirGlobal pMac, tpPESession psessionEntry);
  2310.  
  2311. -/**
  2312. - * pe_find_session_by_sme_session_id() - looks up the PE session for given sme
  2313. - * session id
  2314. - * @mac_ctx: pointer to global adapter context
  2315. - * @sme_session_id: sme session id
  2316. - *
  2317. - * looks up the PE session for given sme session id
  2318. - *
  2319. - * Return: pe session entry for given sme session if found else NULL
  2320. - */
  2321. -tpPESession pe_find_session_by_sme_session_id(tpAniSirGlobal mac_ctx,
  2322. - uint8_t sme_session_id);
  2323.  
  2324. /*--------------------------------------------------------------------------
  2325. \brief peDeleteSession() - Returns the SME session ID and Transaction ID .
  2326. diff --git a/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c b/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c
  2327. index 50f68dc..f856e50 100644
  2328. --- a/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c
  2329. +++ b/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c
  2330. @@ -100,16 +100,16 @@ limDeleteStaContext(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
  2331. tpDeleteStaContext pMsg = (tpDeleteStaContext)limMsg->bodyptr;
  2332. tpDphHashNode pStaDs;
  2333. tpPESession psessionEntry ;
  2334. + tANI_U8 sessionId;
  2335.  
  2336. if(NULL == pMsg)
  2337. {
  2338. PELOGE(limLog(pMac, LOGE,FL("Invalid body pointer in message"));)
  2339. return;
  2340. }
  2341. - psessionEntry = pe_find_session_by_sme_session_id(pMac, pMsg->vdev_id);
  2342. - if(NULL == psessionEntry)
  2343. + if((psessionEntry = peFindSessionByBssid(pMac,pMsg->bssId,&sessionId))== NULL)
  2344. {
  2345. - limLog(pMac, LOGE, FL("session not found for given sme session"));
  2346. + PELOGE(limLog(pMac, LOGE,FL("session does not exist for given BSSId"));)
  2347. vos_mem_free(pMsg);
  2348. return;
  2349. }
  2350. @@ -117,23 +117,7 @@ limDeleteStaContext(tpAniSirGlobal pMac, tpSirMsgQ limMsg)
  2351. switch(pMsg->reasonCode)
  2352. {
  2353. case HAL_DEL_STA_REASON_CODE_KEEP_ALIVE:
  2354. - if (LIM_IS_STA_ROLE(psessionEntry) && !pMsg->is_tdls) {
  2355. - pStaDs = dphGetHashEntry(pMac,
  2356. - DPH_STA_HASH_INDEX_PEER,
  2357. - &psessionEntry->dph.dphHashTable);
  2358. - if (NULL == pStaDs) {
  2359. - limLog(pMac, LOGE, FL("Dph entry not found."));
  2360. - vos_mem_free(pMsg);
  2361. - return;
  2362. - }
  2363. - limSendDeauthMgmtFrame(pMac,
  2364. - eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON,
  2365. - pMsg->addr2, psessionEntry, FALSE);
  2366. - limTearDownLinkWithAp(pMac, psessionEntry->peSessionId,
  2367. - eSIR_MAC_UNSPEC_FAILURE_REASON);
  2368. - /* only break for STA role (non TDLS) */
  2369. - break;
  2370. - }
  2371. + case HAL_DEL_STA_REASON_CODE_TIM_BASED:
  2372. PELOGE(limLog(pMac, LOGE, FL(" Deleting station: staId = %d, reasonCode = %d"), pMsg->staId, pMsg->reasonCode);)
  2373. if (eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole)
  2374. return;
  2375. diff --git a/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
  2376. index fa00aed..2595489 100644
  2377. --- a/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
  2378. +++ b/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
  2379. @@ -5157,7 +5157,6 @@ __limProcessSmeAddStaSelfReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf)
  2380. pAddStaSelfParams->sessionId = pSmeReq->sessionId;
  2381. pAddStaSelfParams->type = pSmeReq->type;
  2382. pAddStaSelfParams->subType = pSmeReq->subType;
  2383. - pAddStaSelfParams->pkt_err_disconn_th = pSmeReq->pkt_err_disconn_th;
  2384.  
  2385. msg.type = SIR_HAL_ADD_STA_SELF_REQ;
  2386. msg.reserved = 0;
  2387. @@ -6503,8 +6502,7 @@ limProcessSmeDfsCsaIeRequest(tpAniSirGlobal pMac, tANI_U32 *pMsg)
  2388. /* Channel switch announcement needs to be included in beacon */
  2389. psessionEntry->dfsIncludeChanSwIe = VOS_TRUE;
  2390. psessionEntry->gLimChannelSwitch.switchCount = LIM_MAX_CSA_IE_UPDATES;
  2391. - if (pMac->sap.SapDfsInfo.disable_dfs_ch_switch == VOS_FALSE)
  2392. - psessionEntry->gLimChannelSwitch.switchMode = 1;
  2393. + psessionEntry->gLimChannelSwitch.switchMode = 1;
  2394.  
  2395. /* Validate if SAP is operating HT or VHT
  2396. * mode and set the Channel Switch Wrapper
  2397. diff --git a/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c b/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c
  2398. index 6a0db83..4c2ac6d 100644
  2399. --- a/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c
  2400. +++ b/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c
  2401. @@ -507,21 +507,6 @@ limSendSmeJoinReassocRsp(tpAniSirGlobal pMac, tANI_U16 msgType,
  2402. psessionEntry->assocRsp = NULL;
  2403. }
  2404.  
  2405. -#ifdef WLAN_FEATURE_VOWIFI_11R
  2406. - if(psessionEntry->ricData != NULL)
  2407. - {
  2408. - vos_mem_free( psessionEntry->ricData);
  2409. - psessionEntry->ricData = NULL;
  2410. - }
  2411. -#endif
  2412. -
  2413. -#ifdef FEATURE_WLAN_ESE
  2414. - if(psessionEntry->tspecIes != NULL)
  2415. - {
  2416. - vos_mem_free(psessionEntry->tspecIes);
  2417. - psessionEntry->tspecIes = NULL;
  2418. - }
  2419. -#endif
  2420. }
  2421. }
  2422.  
  2423. @@ -1378,8 +1363,7 @@ limSendSmeDisassocNtf(tpAniSirGlobal pMac,
  2424. switch (disassocTrigger)
  2425. {
  2426. case eLIM_PEER_ENTITY_DISASSOC:
  2427. - if (reasonCode != eSIR_SME_STA_NOT_ASSOCIATED)
  2428. - return;
  2429. + return;
  2430.  
  2431. case eLIM_HOST_DISASSOC:
  2432. /**
  2433. @@ -3251,8 +3235,7 @@ limProcessBeaconTxSuccessInd(tpAniSirGlobal pMac, tANI_U16 msgType, void *event)
  2434. {
  2435. /* Done with CSA IE update, send response back to SME */
  2436. psessionEntry->gLimChannelSwitch.switchCount = 0;
  2437. - if (pMac->sap.SapDfsInfo.disable_dfs_ch_switch == VOS_FALSE)
  2438. - psessionEntry->gLimChannelSwitch.switchMode = 0;
  2439. + psessionEntry->gLimChannelSwitch.switchMode = 0;
  2440. psessionEntry->dfsIncludeChanSwIe = VOS_FALSE;
  2441. psessionEntry->dfsIncludeChanWrapperIe = VOS_FALSE;
  2442.  
  2443. diff --git a/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limSession.c b/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limSession.c
  2444. index b6bc3424..211852d 100644
  2445. --- a/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limSession.c
  2446. +++ b/drivers/staging/qcacld-2.0/CORE/MAC/src/pe/lim/limSession.c
  2447. @@ -153,6 +153,17 @@ void pe_reset_protection_callback(void *ptr)
  2448. &beacon_params, pe_session_entry);
  2449. }
  2450.  
  2451. + /* index 0, is self node, peers start from 1 */
  2452. + for(i = 1 ; i < mac_ctx->lim.gLimAssocStaLimit ; i++)
  2453. + {
  2454. + station_hash_node = dphGetHashEntry(mac_ctx, i,
  2455. + &pe_session_entry->dph.dphHashTable);
  2456. + if (NULL == station_hash_node)
  2457. + continue;
  2458. + limDecideApProtection(mac_ctx, station_hash_node->staAddr,
  2459. + &beacon_params, pe_session_entry);
  2460. + }
  2461. +
  2462. if ((current_protection_state != pe_session_entry->old_protection_state) &&
  2463. (VOS_FALSE == mac_ctx->sap.SapDfsInfo.is_dfs_cac_timer_running)) {
  2464. VOS_TRACE(VOS_MODULE_ID_PE,
  2465. @@ -447,33 +458,6 @@ tpPESession peFindSessionByBssIdx(tpAniSirGlobal pMac, tANI_U8 bssIdx)
  2466. return NULL;
  2467. }
  2468.  
  2469. -/**
  2470. - * pe_find_session_by_sme_session_id() - looks up the PE session for given sme
  2471. - * session id
  2472. - * @mac_ctx: pointer to global adapter context
  2473. - * @sme_session_id: sme session id
  2474. - *
  2475. - * looks up the PE session for given sme session id
  2476. - *
  2477. - * Return: pe session entry for given sme session if found else NULL
  2478. - */
  2479. -tpPESession pe_find_session_by_sme_session_id(tpAniSirGlobal mac_ctx,
  2480. - tANI_U8 sme_session_id)
  2481. -{
  2482. - uint8_t i;
  2483. - for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
  2484. - if ( (mac_ctx->lim.gpSession[i].valid) &&
  2485. - (mac_ctx->lim.gpSession[i].smeSessionId ==
  2486. - sme_session_id) ) {
  2487. - return &mac_ctx->lim.gpSession[i];
  2488. - }
  2489. - }
  2490. - limLog(mac_ctx, LOG4,
  2491. - FL("Session lookup fails for smeSessionID: %d"),
  2492. - sme_session_id);
  2493. - return NULL;
  2494. -}
  2495. -
  2496. /*--------------------------------------------------------------------------
  2497. \brief peFindSessionBySessionId() - looks up the PE session given the session ID.
  2498.  
  2499. diff --git a/drivers/staging/qcacld-2.0/CORE/SAP/inc/sapApi.h b/drivers/staging/qcacld-2.0/CORE/SAP/inc/sapApi.h
  2500. index d3589dc..74a1d23 100644
  2501. --- a/drivers/staging/qcacld-2.0/CORE/SAP/inc/sapApi.h
  2502. +++ b/drivers/staging/qcacld-2.0/CORE/SAP/inc/sapApi.h
  2503. @@ -621,12 +621,6 @@ typedef struct sSapDfsInfo
  2504. * operating DFS channel.
  2505. */
  2506. v_U8_t sap_operating_chan_preferred_location;
  2507. -
  2508. - /*
  2509. - * Flag to indicate if DFS test mode is enabled and
  2510. - * channel switch is disabled.
  2511. - */
  2512. - v_U8_t disable_dfs_ch_switch;
  2513. } tSapDfsInfo;
  2514.  
  2515. typedef struct tagSapCtxList
  2516. diff --git a/drivers/staging/qcacld-2.0/CORE/SAP/src/sapApiLinkCntl.c b/drivers/staging/qcacld-2.0/CORE/SAP/src/sapApiLinkCntl.c
  2517. index d944cf8..23e76c0 100644
  2518. --- a/drivers/staging/qcacld-2.0/CORE/SAP/src/sapApiLinkCntl.c
  2519. +++ b/drivers/staging/qcacld-2.0/CORE/SAP/src/sapApiLinkCntl.c
  2520. @@ -305,7 +305,6 @@ WLANSAP_RoamCallback
  2521. eHalStatus halStatus = eHAL_STATUS_SUCCESS;
  2522. tHalHandle hHal = VOS_GET_HAL_CB(sapContext->pvosGCtx);
  2523. tpAniSirGlobal pMac = NULL;
  2524. - tANI_U8 dfs_beacon_start_req = 0;
  2525.  
  2526. if (NULL == hHal)
  2527. {
  2528. @@ -717,13 +716,14 @@ WLANSAP_RoamCallback
  2529. break;
  2530.  
  2531. case eCSR_ROAM_RESULT_DFS_RADAR_FOUND_IND:
  2532. - if (eSAP_DFS_CAC_WAIT == sapContext->sapsMachine)
  2533. + if (sapContext->csrRoamProfile.disableDFSChSwitch)
  2534. {
  2535. - if (sapContext->csrRoamProfile.disableDFSChSwitch) {
  2536. - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
  2537. + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
  2538. "sapdfs: DFS channel switch disabled");
  2539. - break;
  2540. - }
  2541. + break;
  2542. + }
  2543. + if (eSAP_DFS_CAC_WAIT == sapContext->sapsMachine)
  2544. + {
  2545. if (VOS_TRUE == pMac->sap.SapDfsInfo.sap_radar_found_status)
  2546. {
  2547. VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_MED,
  2548. @@ -782,22 +782,6 @@ WLANSAP_RoamCallback
  2549. eCsrPhyMode phyMode =
  2550. sapConvertSapPhyModeToCsrPhyMode(sapContext->csrRoamProfile.phyMode);
  2551.  
  2552. - if (sapContext->csrRoamProfile.disableDFSChSwitch) {
  2553. - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
  2554. - "sapdfs: DFS channel switch disabled");
  2555. - /*
  2556. - * Send a beacon start request to PE. CSA IE required
  2557. - * flag from beacon template will be cleared by now.
  2558. - * A new beacon template with no CSA IE will be sent
  2559. - * to firmware.
  2560. - */
  2561. - dfs_beacon_start_req = VOS_TRUE;
  2562. - halStatus = sme_RoamStartBeaconReq( hHal,
  2563. - sapContext->bssid,
  2564. - dfs_beacon_start_req);
  2565. - break;
  2566. - }
  2567. -
  2568. /* Both success and failure cases are handled intentionally handled
  2569. * together. Irrespective of whether the channel switch IE was
  2570. * sent out successfully or not, SAP should still vacate the
  2571. diff --git a/drivers/staging/qcacld-2.0/CORE/SAP/src/sapChSelect.h b/drivers/staging/qcacld-2.0/CORE/SAP/src/sapChSelect.h
  2572. index 9f037ee..7921279 100644
  2573. --- a/drivers/staging/qcacld-2.0/CORE/SAP/src/sapChSelect.h
  2574. +++ b/drivers/staging/qcacld-2.0/CORE/SAP/src/sapChSelect.h
  2575. @@ -113,7 +113,7 @@ typedef enum
  2576. CHANNEL_14
  2577. } tSapChannel;
  2578.  
  2579. -#define MAX_80MHZ_BANDS 6
  2580. +#define MAX_80MHZ_BANDS 5
  2581. #define SAP_80MHZ_MASK 0x0F
  2582. #define SAP_40MHZ_MASK_L 0x03
  2583. #define SAP_40MHZ_MASK_H 0x0C
  2584. @@ -191,11 +191,7 @@ typedef struct sSapTxLeakInfo {
  2585.  
  2586. typedef struct sSapChanMatrixInfo {
  2587. v_U8_t channel; /* channel to switch from */
  2588. -#ifdef FEATURE_WLAN_CH144
  2589. - tSapTxLeakInfo chan_matrix[RF_CHAN_144 - RF_CHAN_36 + 1];
  2590. -#else
  2591. tSapTxLeakInfo chan_matrix[RF_CHAN_140 - RF_CHAN_36 + 1];
  2592. -#endif
  2593. } tSapChanMatrixInfo;
  2594.  
  2595. #endif // if !defined __SAP_CH_SELECT_H
  2596. diff --git a/drivers/staging/qcacld-2.0/CORE/SAP/src/sapFsm.c b/drivers/staging/qcacld-2.0/CORE/SAP/src/sapFsm.c
  2597. index 4cbdf80..d4f4dab 100644
  2598. --- a/drivers/staging/qcacld-2.0/CORE/SAP/src/sapFsm.c
  2599. +++ b/drivers/staging/qcacld-2.0/CORE/SAP/src/sapFsm.c
  2600. @@ -89,17 +89,6 @@ extern sapSafeChannelType safeChannels[];
  2601. * Static Variable Definitions
  2602. * -------------------------------------------------------------------------*/
  2603.  
  2604. -#ifdef WLAN_ENABLE_CHNL_MATRIX_RESTRICTION
  2605. -/*
  2606. - * TODO: At present SAP Channel leakage matrix for ch 144
  2607. - * is not available from system's team. So to play it safe
  2608. - * and avoid crash if channel 144 is request, in following
  2609. - * matix channel 144 is added such that it will cause code
  2610. - * to avoid selecting channel 144.
  2611. - *
  2612. - * THESE ENTRIES SHOULD BE REPLACED WITH CORRECT VALUES AS
  2613. - * PROVIDED BY SYSTEM'S TEAM.
  2614. - */
  2615. /* channel tx leakage table - ht80 */
  2616. tSapChanMatrixInfo ht80_chan[] =
  2617. {
  2618. @@ -113,12 +102,7 @@ tSapChanMatrixInfo ht80_chan[] =
  2619. {116, 424}, {120, 429},
  2620. {124, 437}, {128, 435},
  2621. {132, SAP_TX_LEAKAGE_MAX},{136, SAP_TX_LEAKAGE_MAX},
  2622. - {140, SAP_TX_LEAKAGE_MAX}
  2623. -#ifdef FEATURE_WLAN_CH144
  2624. - ,{144, SAP_TX_LEAKAGE_MIN}
  2625. -#endif
  2626. -}},
  2627. -
  2628. + {140, SAP_TX_LEAKAGE_MAX}}},
  2629.  
  2630. {56,
  2631. {{36, 171}, {40, 178},
  2632. @@ -130,11 +114,7 @@ tSapChanMatrixInfo ht80_chan[] =
  2633. {116, 403}, {120, 397},
  2634. {124, SAP_TX_LEAKAGE_MAX},{128, SAP_TX_LEAKAGE_MAX},
  2635. {132, SAP_TX_LEAKAGE_MAX},{136, SAP_TX_LEAKAGE_MAX},
  2636. - {140, SAP_TX_LEAKAGE_MAX}
  2637. -#ifdef FEATURE_WLAN_CH144
  2638. - ,{144, SAP_TX_LEAKAGE_MIN}
  2639. -#endif
  2640. -}},
  2641. + {140, SAP_TX_LEAKAGE_MAX}}},
  2642.  
  2643. {60,
  2644. {{36, 156}, {40, 146},
  2645. @@ -146,11 +126,7 @@ tSapChanMatrixInfo ht80_chan[] =
  2646. {116, 395}, {120, 399},
  2647. {124, SAP_TX_LEAKAGE_MAX},{128, SAP_TX_LEAKAGE_MAX},
  2648. {132, SAP_TX_LEAKAGE_MAX},{136, SAP_TX_LEAKAGE_MAX},
  2649. - {140, SAP_TX_LEAKAGE_MAX}
  2650. -#ifdef FEATURE_WLAN_CH144
  2651. - ,{144, SAP_TX_LEAKAGE_MIN}
  2652. -#endif
  2653. -}},
  2654. + {140, SAP_TX_LEAKAGE_MAX}}},
  2655.  
  2656. {64,
  2657. {{36, 217}, {40, 221},
  2658. @@ -162,11 +138,7 @@ tSapChanMatrixInfo ht80_chan[] =
  2659. {116, 375}, {120, 374},
  2660. {124, SAP_TX_LEAKAGE_MAX},{128, SAP_TX_LEAKAGE_MAX},
  2661. {132, SAP_TX_LEAKAGE_MAX},{136, SAP_TX_LEAKAGE_MAX},
  2662. - {140, SAP_TX_LEAKAGE_MAX}
  2663. -#ifdef FEATURE_WLAN_CH144
  2664. - ,{144, SAP_TX_LEAKAGE_MIN}
  2665. -#endif
  2666. -}},
  2667. + {140, SAP_TX_LEAKAGE_MAX}}},
  2668.  
  2669. {100,
  2670. {{36, 357}, {40, 326},
  2671. @@ -178,11 +150,7 @@ tSapChanMatrixInfo ht80_chan[] =
  2672. {116, 166}, {120, SAP_TX_LEAKAGE_MIN},
  2673. {124, SAP_TX_LEAKAGE_MIN},{128, SAP_TX_LEAKAGE_MIN},
  2674. {132, SAP_TX_LEAKAGE_MIN},{136, SAP_TX_LEAKAGE_MIN},
  2675. - {140, SAP_TX_LEAKAGE_MIN}
  2676. -#ifdef FEATURE_WLAN_CH144
  2677. - ,{144, SAP_TX_LEAKAGE_MIN}
  2678. -#endif
  2679. -}},
  2680. + {140, SAP_TX_LEAKAGE_MIN}}},
  2681.  
  2682. {104,
  2683. {{36, 325}, {40, 325},
  2684. @@ -194,11 +162,7 @@ tSapChanMatrixInfo ht80_chan[] =
  2685. {116, 198}, {120, SAP_TX_LEAKAGE_MIN},
  2686. {124, SAP_TX_LEAKAGE_MIN},{128, SAP_TX_LEAKAGE_MIN},
  2687. {132, SAP_TX_LEAKAGE_MIN},{136, SAP_TX_LEAKAGE_MIN},
  2688. - {140, SAP_TX_LEAKAGE_MIN}
  2689. -#ifdef FEATURE_WLAN_CH144
  2690. - ,{144, SAP_TX_LEAKAGE_MIN}
  2691. -#endif
  2692. -}},
  2693. + {140, SAP_TX_LEAKAGE_MIN}}},
  2694.  
  2695. {108,
  2696. {{36, 304}, {40, 332},
  2697. @@ -210,11 +174,7 @@ tSapChanMatrixInfo ht80_chan[] =
  2698. {116, 185}, {120, SAP_TX_LEAKAGE_MIN},
  2699. {124, SAP_TX_LEAKAGE_MIN},{128, SAP_TX_LEAKAGE_MIN},
  2700. {132, SAP_TX_LEAKAGE_MIN},{136, SAP_TX_LEAKAGE_MIN},
  2701. - {140, SAP_TX_LEAKAGE_MIN}
  2702. -#ifdef FEATURE_WLAN_CH144
  2703. - ,{144, SAP_TX_LEAKAGE_MIN}
  2704. -#endif
  2705. -}},
  2706. + {140, SAP_TX_LEAKAGE_MIN}}},
  2707.  
  2708. {112,
  2709. {{36, 327}, {40, 335},
  2710. @@ -226,11 +186,7 @@ tSapChanMatrixInfo ht80_chan[] =
  2711. {116, 189}, {120, SAP_TX_LEAKAGE_MIN},
  2712. {124, SAP_TX_LEAKAGE_MIN},{128, SAP_TX_LEAKAGE_MIN},
  2713. {132, SAP_TX_LEAKAGE_MIN},{136, SAP_TX_LEAKAGE_MIN},
  2714. - {140, SAP_TX_LEAKAGE_MIN}
  2715. -#ifdef FEATURE_WLAN_CH144
  2716. - ,{144, SAP_TX_LEAKAGE_MIN}
  2717. -#endif
  2718. -}},
  2719. + {140, SAP_TX_LEAKAGE_MIN}}},
  2720.  
  2721. {116,
  2722. {{36, 384}, {40, 372},
  2723. @@ -242,11 +198,7 @@ tSapChanMatrixInfo ht80_chan[] =
  2724. {116, SAP_TX_LEAKAGE_MIN},{120, SAP_TX_LEAKAGE_MIN},
  2725. {124, SAP_TX_LEAKAGE_MIN},{128, SAP_TX_LEAKAGE_MIN},
  2726. {132, SAP_TX_LEAKAGE_MIN},{136, SAP_TX_LEAKAGE_MIN},
  2727. - {140, SAP_TX_LEAKAGE_MIN}
  2728. -#ifdef FEATURE_WLAN_CH144
  2729. - ,{144, SAP_TX_LEAKAGE_MIN}
  2730. -#endif
  2731. -}},
  2732. + {140, SAP_TX_LEAKAGE_MIN}}},
  2733.  
  2734. {120,
  2735. {{36, 395}, {40, 419},
  2736. @@ -258,11 +210,7 @@ tSapChanMatrixInfo ht80_chan[] =
  2737. {116, SAP_TX_LEAKAGE_MIN},{120, SAP_TX_LEAKAGE_MIN},
  2738. {124, SAP_TX_LEAKAGE_MIN},{128, 159},
  2739. {132, SAP_TX_LEAKAGE_MIN},{136, SAP_TX_LEAKAGE_MIN},
  2740. - {140, SAP_TX_LEAKAGE_MIN}
  2741. -#ifdef FEATURE_WLAN_CH144
  2742. - ,{144, SAP_TX_LEAKAGE_MIN}
  2743. -#endif
  2744. -}},
  2745. + {140, SAP_TX_LEAKAGE_MIN}}},
  2746.  
  2747. {124,
  2748. {{36, 469}, {40, 433},
  2749. @@ -274,11 +222,7 @@ tSapChanMatrixInfo ht80_chan[] =
  2750. {116, 350}, {120, SAP_TX_LEAKAGE_MIN},
  2751. {124, SAP_TX_LEAKAGE_MIN},{128, 138},
  2752. {132, SAP_TX_LEAKAGE_MIN},{136, SAP_TX_LEAKAGE_MIN},
  2753. - {140, SAP_TX_LEAKAGE_MIN}
  2754. -#ifdef FEATURE_WLAN_CH144
  2755. - ,{144, SAP_TX_LEAKAGE_MIN}
  2756. -#endif
  2757. -}},
  2758. + {140, SAP_TX_LEAKAGE_MIN}}},
  2759.  
  2760. {128,
  2761. {{36, 408}, {40, 434},
  2762. @@ -290,12 +234,7 @@ tSapChanMatrixInfo ht80_chan[] =
  2763. {116, 142}, {120, SAP_TX_LEAKAGE_MIN},
  2764. {124, SAP_TX_LEAKAGE_MIN},{128, SAP_TX_LEAKAGE_MIN},
  2765. {132, SAP_TX_LEAKAGE_MIN},{136, SAP_TX_LEAKAGE_MIN},
  2766. - {140, SAP_TX_LEAKAGE_MIN}
  2767. -#ifdef FEATURE_WLAN_CH144
  2768. - ,{144, SAP_TX_LEAKAGE_MIN}
  2769. -#endif
  2770. -}},
  2771. -
  2772. + {140, SAP_TX_LEAKAGE_MIN}}},
  2773. {132,
  2774. {{36, SAP_TX_LEAKAGE_MAX }, {40, SAP_TX_LEAKAGE_MAX },
  2775. {44, SAP_TX_LEAKAGE_MAX }, {48, SAP_TX_LEAKAGE_MAX },
  2776. @@ -306,12 +245,7 @@ tSapChanMatrixInfo ht80_chan[] =
  2777. {116, SAP_TX_LEAKAGE_MIN },{120, SAP_TX_LEAKAGE_MIN},
  2778. {124, SAP_TX_LEAKAGE_MIN},{128, SAP_TX_LEAKAGE_MIN},
  2779. {132, SAP_TX_LEAKAGE_MIN},{136, SAP_TX_LEAKAGE_MIN},
  2780. - {140, SAP_TX_LEAKAGE_MIN }
  2781. -#ifdef FEATURE_WLAN_CH144
  2782. - ,{144, SAP_TX_LEAKAGE_MIN}
  2783. -#endif
  2784. -}},
  2785. -
  2786. + {140, SAP_TX_LEAKAGE_MIN }}},
  2787. {136,
  2788. {{36, SAP_TX_LEAKAGE_MAX }, {40, SAP_TX_LEAKAGE_MAX },
  2789. {44, SAP_TX_LEAKAGE_MAX }, {48, SAP_TX_LEAKAGE_MAX },
  2790. @@ -322,12 +256,7 @@ tSapChanMatrixInfo ht80_chan[] =
  2791. {116, SAP_TX_LEAKAGE_MIN }, {120, SAP_TX_LEAKAGE_MIN},
  2792. {124, SAP_TX_LEAKAGE_MIN},{128, SAP_TX_LEAKAGE_MIN},
  2793. {132, SAP_TX_LEAKAGE_MIN},{136, SAP_TX_LEAKAGE_MIN},
  2794. - {140, SAP_TX_LEAKAGE_MIN }
  2795. -#ifdef FEATURE_WLAN_CH144
  2796. - ,{144, SAP_TX_LEAKAGE_MIN}
  2797. -#endif
  2798. -}},
  2799. -
  2800. + {140, SAP_TX_LEAKAGE_MIN }}},
  2801. {140,
  2802. {{36, SAP_TX_LEAKAGE_MAX }, {40, SAP_TX_LEAKAGE_MAX },
  2803. {44, SAP_TX_LEAKAGE_MAX }, {48, SAP_TX_LEAKAGE_MAX },
  2804. @@ -337,11 +266,7 @@ tSapChanMatrixInfo ht80_chan[] =
  2805. {108, SAP_TX_LEAKAGE_MIN },{112, SAP_TX_LEAKAGE_MIN },
  2806. {116, SAP_TX_LEAKAGE_MIN }, {120, SAP_TX_LEAKAGE_MIN},
  2807. {124, SAP_TX_LEAKAGE_MIN},{128, SAP_TX_LEAKAGE_MIN},
  2808. - {132, SAP_TX_LEAKAGE_MIN},{136, SAP_TX_LEAKAGE_MIN}
  2809. -#ifdef FEATURE_WLAN_CH144
  2810. - ,{144, SAP_TX_LEAKAGE_MIN}
  2811. -#endif
  2812. -}},
  2813. + {132, SAP_TX_LEAKAGE_MIN},{136, SAP_TX_LEAKAGE_MIN}}},
  2814. };
  2815.  
  2816. /* channel tx leakage table - ht40 */
  2817. @@ -357,12 +282,7 @@ tSapChanMatrixInfo ht40_chan[] =
  2818. {116, SAP_TX_LEAKAGE_MAX},{120, SAP_TX_LEAKAGE_MAX},
  2819. {124, SAP_TX_LEAKAGE_MAX},{128, SAP_TX_LEAKAGE_MAX},
  2820. {132, SAP_TX_LEAKAGE_MAX},{136, SAP_TX_LEAKAGE_MAX},
  2821. - {140, SAP_TX_LEAKAGE_MAX}
  2822. -#ifdef FEATURE_WLAN_CH144
  2823. - ,{144, SAP_TX_LEAKAGE_MIN}
  2824. -#endif
  2825. -}},
  2826. -
  2827. + {140, SAP_TX_LEAKAGE_MAX}}},
  2828. {56,
  2829. {{36, 446}, {40, 446 },
  2830. {44, 300}, {48, 300 },
  2831. @@ -373,12 +293,7 @@ tSapChanMatrixInfo ht40_chan[] =
  2832. {116, SAP_TX_LEAKAGE_MAX},{120, SAP_TX_LEAKAGE_MAX},
  2833. {124, SAP_TX_LEAKAGE_MAX},{128, SAP_TX_LEAKAGE_MAX},
  2834. {132, SAP_TX_LEAKAGE_MAX},{136, SAP_TX_LEAKAGE_MAX},
  2835. - {140, SAP_TX_LEAKAGE_MAX}
  2836. -#ifdef FEATURE_WLAN_CH144
  2837. - ,{144, SAP_TX_LEAKAGE_MIN}
  2838. -#endif
  2839. -}},
  2840. -
  2841. + {140, SAP_TX_LEAKAGE_MAX}}},
  2842. {60,
  2843. {{36, 481}, {40, 481 },
  2844. {44, 407}, {48, 407 },
  2845. @@ -389,12 +304,7 @@ tSapChanMatrixInfo ht40_chan[] =
  2846. {116, SAP_TX_LEAKAGE_MAX},{120, SAP_TX_LEAKAGE_MAX},
  2847. {124, SAP_TX_LEAKAGE_MAX},{128, SAP_TX_LEAKAGE_MAX},
  2848. {132, SAP_TX_LEAKAGE_MAX},{136, SAP_TX_LEAKAGE_MAX},
  2849. - {140, SAP_TX_LEAKAGE_MAX}
  2850. -#ifdef FEATURE_WLAN_CH144
  2851. - ,{144, SAP_TX_LEAKAGE_MIN}
  2852. -#endif
  2853. -}},
  2854. -
  2855. + {140, SAP_TX_LEAKAGE_MAX}}},
  2856. {64,
  2857. {{36, 524}, {40, 524 },
  2858. {44, 527}, {48, 527 },
  2859. @@ -405,11 +315,7 @@ tSapChanMatrixInfo ht40_chan[] =
  2860. {116, SAP_TX_LEAKAGE_MAX},{120, SAP_TX_LEAKAGE_MAX},
  2861. {124, SAP_TX_LEAKAGE_MAX},{128, SAP_TX_LEAKAGE_MAX},
  2862. {132, SAP_TX_LEAKAGE_MAX},{136, SAP_TX_LEAKAGE_MAX},
  2863. - {140, SAP_TX_LEAKAGE_MAX}
  2864. -#ifdef FEATURE_WLAN_CH144
  2865. - ,{144, SAP_TX_LEAKAGE_MIN}
  2866. -#endif
  2867. -}},
  2868. + {140, SAP_TX_LEAKAGE_MAX}}},
  2869.  
  2870. {100,
  2871. {{36, 618}, {40, 618 },
  2872. @@ -421,12 +327,7 @@ tSapChanMatrixInfo ht40_chan[] =
  2873. {116, 486}, {120, 486 },
  2874. {124, 498}, {128, 498 },
  2875. {132, 538}, {136, 538 },
  2876. - {140, 598}
  2877. -#ifdef FEATURE_WLAN_CH144
  2878. - ,{144, SAP_TX_LEAKAGE_MIN}
  2879. -#endif
  2880. -}},
  2881. -
  2882. + {140, 598}}},
  2883. {104,
  2884. {{36, 636}, {40, 636 },
  2885. {44, 601}, {48, 601 },
  2886. @@ -437,12 +338,7 @@ tSapChanMatrixInfo ht40_chan[] =
  2887. {116, 396},{120, 396 },
  2888. {124, 483}, {128, 483 },
  2889. {132, 553}, {136, 553 },
  2890. - {140, 568}
  2891. -#ifdef FEATURE_WLAN_CH144
  2892. - ,{144, SAP_TX_LEAKAGE_MIN}
  2893. -#endif
  2894. -}},
  2895. -
  2896. + {140, 568}}},
  2897. {108,
  2898. {{36, 600}, {40, 600 },
  2899. {44, 627}, {48, 627 },
  2900. @@ -453,12 +349,7 @@ tSapChanMatrixInfo ht40_chan[] =
  2901. {116, 323},{120, 323},
  2902. {124, 494},{128, 494},
  2903. {132, 566},{136, 566 },
  2904. - {140, 534}
  2905. -#ifdef FEATURE_WLAN_CH144
  2906. - ,{144, SAP_TX_LEAKAGE_MIN}
  2907. -#endif
  2908. -}},
  2909. -
  2910. + {140, 534}}},
  2911. {112,
  2912. {{36, 645}, {40, 645 },
  2913. {44, 641}, {48, 641 },
  2914. @@ -469,12 +360,7 @@ tSapChanMatrixInfo ht40_chan[] =
  2915. {116, SAP_TX_LEAKAGE_MIN},{120, SAP_TX_LEAKAGE_MIN},
  2916. {124, 414},{128, 414},
  2917. {132, 533},{136, 533 },
  2918. - {140, 521}
  2919. -#ifdef FEATURE_WLAN_CH144
  2920. - ,{144, SAP_TX_LEAKAGE_MIN}
  2921. -#endif
  2922. -}},
  2923. -
  2924. + {140, 521}}},
  2925. {116,
  2926. {{36, 661}, {40, 661 },
  2927. {44, 624}, {48, 624 },
  2928. @@ -485,12 +371,7 @@ tSapChanMatrixInfo ht40_chan[] =
  2929. {116, SAP_TX_LEAKAGE_MIN},{120, SAP_TX_LEAKAGE_MIN},
  2930. {124, 309},{128, 309 },
  2931. {132, 412},{136, 412},
  2932. - {140, 509}
  2933. -#ifdef FEATURE_WLAN_CH144
  2934. - ,{144, SAP_TX_LEAKAGE_MIN}
  2935. -#endif
  2936. -}},
  2937. -
  2938. + {140, 509}}},
  2939. {120,
  2940. {{36, 667}, {40, 667 },
  2941. {44, 645}, {48, 645 },
  2942. @@ -501,12 +382,7 @@ tSapChanMatrixInfo ht40_chan[] =
  2943. {116, SAP_TX_LEAKAGE_MIN},{120, SAP_TX_LEAKAGE_MIN},
  2944. {124, SAP_TX_LEAKAGE_MIN},{128, SAP_TX_LEAKAGE_MIN},
  2945. {132, 434},{136, 434},
  2946. - {140, 514}
  2947. -#ifdef FEATURE_WLAN_CH144
  2948. - ,{144, SAP_TX_LEAKAGE_MIN}
  2949. -#endif
  2950. -}},
  2951. -
  2952. + {140, 514}}},
  2953. {124,
  2954. {{36, 676}, {40, 676 },
  2955. {44, 668}, {48, 668 },
  2956. @@ -517,12 +393,7 @@ tSapChanMatrixInfo ht40_chan[] =
  2957. {116, 225},{120, 225},
  2958. {124, SAP_TX_LEAKAGE_MIN},{128, SAP_TX_LEAKAGE_MIN},
  2959. {132, 327},{136, 327},
  2960. - {140, 468}
  2961. -#ifdef FEATURE_WLAN_CH144
  2962. - ,{144, SAP_TX_LEAKAGE_MIN}
  2963. -#endif
  2964. -}},
  2965. -
  2966. + {140, 468}}},
  2967. {128,
  2968. {{36, 678}, {40, 678 },
  2969. {44, 664}, {48, 664 },
  2970. @@ -533,12 +404,7 @@ tSapChanMatrixInfo ht40_chan[] =
  2971. {116, 293},{120, 293},
  2972. {124, SAP_TX_LEAKAGE_MIN},{128, SAP_TX_LEAKAGE_MIN},
  2973. {132, SAP_TX_LEAKAGE_MIN},{136, SAP_TX_LEAKAGE_MIN},
  2974. - {140, 415}
  2975. -#ifdef FEATURE_WLAN_CH144
  2976. - ,{144, SAP_TX_LEAKAGE_MIN}
  2977. -#endif
  2978. -}},
  2979. -
  2980. + {140, 415}}},
  2981. {132,
  2982. {{36, 689}, {40, 689 },
  2983. {44, 669}, {48, 669 },
  2984. @@ -549,12 +415,7 @@ tSapChanMatrixInfo ht40_chan[] =
  2985. {116, 428},{120, 428},
  2986. {124, 247},{128, 247},
  2987. {132, SAP_TX_LEAKAGE_MIN},{136, SAP_TX_LEAKAGE_MIN},
  2988. - {140, SAP_TX_LEAKAGE_MIN }
  2989. -#ifdef FEATURE_WLAN_CH144
  2990. - ,{144, SAP_TX_LEAKAGE_MIN}
  2991. -#endif
  2992. -}},
  2993. -
  2994. + {140, SAP_TX_LEAKAGE_MIN }}},
  2995. {136,
  2996. {{36, 703}, {40, 703 },
  2997. {44, 688}, {48, SAP_TX_LEAKAGE_MIN },
  2998. @@ -565,12 +426,7 @@ tSapChanMatrixInfo ht40_chan[] =
  2999. {116, 428}, {120, 428},
  3000. {124, 289},{128, 289},
  3001. {132, SAP_TX_LEAKAGE_MIN},{136, SAP_TX_LEAKAGE_MIN},
  3002. - {140, SAP_TX_LEAKAGE_MIN }
  3003. -#ifdef FEATURE_WLAN_CH144
  3004. - ,{144, SAP_TX_LEAKAGE_MIN}
  3005. -#endif
  3006. -}},
  3007. -
  3008. + {140, SAP_TX_LEAKAGE_MIN }}},
  3009. {140,
  3010. {{36, 695}, {40, 695 },
  3011. {44, 684}, {48, 684 },
  3012. @@ -581,11 +437,7 @@ tSapChanMatrixInfo ht40_chan[] =
  3013. {116, 529}, {120, 529},
  3014. {124, 432},{128, 432},
  3015. {132, 262},{136, 262},
  3016. - {140, SAP_TX_LEAKAGE_MIN }
  3017. -#ifdef FEATURE_WLAN_CH144
  3018. - ,{144, SAP_TX_LEAKAGE_MIN}
  3019. -#endif
  3020. -}},
  3021. + {140, SAP_TX_LEAKAGE_MIN }}},
  3022. };
  3023.  
  3024.  
  3025. @@ -602,12 +454,7 @@ tSapChanMatrixInfo ht20_chan[] =
  3026. {116, SAP_TX_LEAKAGE_MAX},{120, SAP_TX_LEAKAGE_MAX},
  3027. {124, SAP_TX_LEAKAGE_MAX},{128, SAP_TX_LEAKAGE_MAX},
  3028. {132, SAP_TX_LEAKAGE_MAX},{136, SAP_TX_LEAKAGE_MAX},
  3029. - {140, SAP_TX_LEAKAGE_MAX}
  3030. -#ifdef FEATURE_WLAN_CH144
  3031. - ,{144, SAP_TX_LEAKAGE_MIN}
  3032. -#endif
  3033. -}},
  3034. -
  3035. + {140, SAP_TX_LEAKAGE_MAX}}},
  3036. {56,
  3037. {{36, 468}, {40, 413},
  3038. {44, 374}, {48, 206},
  3039. @@ -618,12 +465,7 @@ tSapChanMatrixInfo ht20_chan[] =
  3040. {116, SAP_TX_LEAKAGE_MAX},{120, SAP_TX_LEAKAGE_MAX},
  3041. {124, SAP_TX_LEAKAGE_MAX},{128, SAP_TX_LEAKAGE_MAX},
  3042. {132, SAP_TX_LEAKAGE_MAX},{136, SAP_TX_LEAKAGE_MAX},
  3043. - {140, SAP_TX_LEAKAGE_MAX}
  3044. -#ifdef FEATURE_WLAN_CH144
  3045. - ,{144, SAP_TX_LEAKAGE_MIN}
  3046. -#endif
  3047. -}},
  3048. -
  3049. + {140, SAP_TX_LEAKAGE_MAX}}},
  3050. {60,
  3051. {{36, 507}, {40, 440},
  3052. {44, 431}, {48, 313},
  3053. @@ -634,12 +476,7 @@ tSapChanMatrixInfo ht20_chan[] =
  3054. {116, SAP_TX_LEAKAGE_MAX},{120, SAP_TX_LEAKAGE_MAX},
  3055. {124, SAP_TX_LEAKAGE_MAX},{128, SAP_TX_LEAKAGE_MAX},
  3056. {132, SAP_TX_LEAKAGE_MAX},{136, SAP_TX_LEAKAGE_MAX},
  3057. - {140, SAP_TX_LEAKAGE_MAX}
  3058. -#ifdef FEATURE_WLAN_CH144
  3059. - ,{144, SAP_TX_LEAKAGE_MIN}
  3060. -#endif
  3061. -}},
  3062. -
  3063. + {140, SAP_TX_LEAKAGE_MAX}}},
  3064. {64,
  3065. {{36, 516}, {40, 520},
  3066. {44, 506}, {48, 424},
  3067. @@ -650,11 +487,7 @@ tSapChanMatrixInfo ht20_chan[] =
  3068. {116, SAP_TX_LEAKAGE_MAX},{120, SAP_TX_LEAKAGE_MAX},
  3069. {124, SAP_TX_LEAKAGE_MAX},{128, SAP_TX_LEAKAGE_MAX},
  3070. {132, SAP_TX_LEAKAGE_MAX},{136, SAP_TX_LEAKAGE_MAX},
  3071. - {140, SAP_TX_LEAKAGE_MAX}
  3072. -#ifdef FEATURE_WLAN_CH144
  3073. - ,{144, SAP_TX_LEAKAGE_MIN}
  3074. -#endif
  3075. -}},
  3076. + {140, SAP_TX_LEAKAGE_MAX}}},
  3077.  
  3078. {100,
  3079. {{36, 616}, {40, 601},
  3080. @@ -666,12 +499,7 @@ tSapChanMatrixInfo ht20_chan[] =
  3081. {116, 462}, {120, 522},
  3082. {124, 571}, {128, 589},
  3083. {132, 593}, {136, 598},
  3084. - {140, 594}
  3085. -#ifdef FEATURE_WLAN_CH144
  3086. - ,{144, SAP_TX_LEAKAGE_MIN}
  3087. -#endif
  3088. -}},
  3089. -
  3090. + {140, 594}}},
  3091. {104,
  3092. {{36, 622}, {40, 624},
  3093. {44, 618}, {48, 610},
  3094. @@ -682,12 +510,7 @@ tSapChanMatrixInfo ht20_chan[] =
  3095. {116, 483},{120, 503},
  3096. {124, 523}, {128, 565},
  3097. {132, 570}, {136, 588},
  3098. - {140, 585}
  3099. -#ifdef FEATURE_WLAN_CH144
  3100. - ,{144, SAP_TX_LEAKAGE_MIN}
  3101. -#endif
  3102. -}},
  3103. -
  3104. + {140, 585}}},
  3105. {108,
  3106. {{36, 620}, {40, 638},
  3107. {44, 611}, {48, 614},
  3108. @@ -698,12 +521,7 @@ tSapChanMatrixInfo ht20_chan[] =
  3109. {116, 477},{120, 497},
  3110. {124, 517},{128, 537},
  3111. {132, 557},{136, 577},
  3112. - {140, 603}
  3113. -#ifdef FEATURE_WLAN_CH144
  3114. - ,{144, SAP_TX_LEAKAGE_MIN}
  3115. -#endif
  3116. -}},
  3117. -
  3118. + {140, 603}}},
  3119. {112,
  3120. {{36, 636}, {40, 623},
  3121. {44, 638}, {48, 628},
  3122. @@ -714,12 +532,7 @@ tSapChanMatrixInfo ht20_chan[] =
  3123. {116, SAP_TX_LEAKAGE_MIN},{120, 481},
  3124. {124, 501},{128, 421},
  3125. {132, 541},{136, 561},
  3126. - {140, 583}
  3127. -#ifdef FEATURE_WLAN_CH144
  3128. - ,{144, SAP_TX_LEAKAGE_MIN}
  3129. -#endif
  3130. -}},
  3131. -
  3132. + {140, 583}}},
  3133. {116,
  3134. {{36, 646}, {40, 648},
  3135. {44, 633}, {48, 634},
  3136. @@ -730,12 +543,7 @@ tSapChanMatrixInfo ht20_chan[] =
  3137. {116, SAP_TX_LEAKAGE_MIN},{120, SAP_TX_LEAKAGE_MIN},
  3138. {124, SAP_TX_LEAKAGE_MIN},{128, SAP_TX_LEAKAGE_MIN},
  3139. {132, 534},{136, 554},
  3140. - {140, 574}
  3141. -#ifdef FEATURE_WLAN_CH144
  3142. - ,{144, SAP_TX_LEAKAGE_MIN}
  3143. -#endif
  3144. -}},
  3145. -
  3146. + {140, 574}}},
  3147. {120,
  3148. {{36, 643}, {40, 649},
  3149. {44, 654}, {48, 629},
  3150. @@ -746,12 +554,7 @@ tSapChanMatrixInfo ht20_chan[] =
  3151. {116, SAP_TX_LEAKAGE_MIN},{120, SAP_TX_LEAKAGE_MIN},
  3152. {124, SAP_TX_LEAKAGE_MIN},{128, 505},
  3153. {132, 525},{136, 545},
  3154. - {140, 565}
  3155. -#ifdef FEATURE_WLAN_CH144
  3156. - ,{144, SAP_TX_LEAKAGE_MIN}
  3157. -#endif
  3158. -}},
  3159. -
  3160. + {140, 565}}},
  3161. {124,
  3162. {{36, 638}, {40, 657},
  3163. {44, 663}, {48, 649},
  3164. @@ -762,12 +565,7 @@ tSapChanMatrixInfo ht20_chan[] =
  3165. {116, 499},{120, SAP_TX_LEAKAGE_MIN},
  3166. {124, SAP_TX_LEAKAGE_MIN},{128, SAP_TX_LEAKAGE_MIN},
  3167. {132, 499},{136, 519},
  3168. - {140, 539}
  3169. -#ifdef FEATURE_WLAN_CH144
  3170. - ,{144, SAP_TX_LEAKAGE_MIN}
  3171. -#endif
  3172. -}},
  3173. -
  3174. + {140, 539}}},
  3175. {128,
  3176. {{36, 651}, {40, 651},
  3177. {44, 674}, {48, 640},
  3178. @@ -778,12 +576,7 @@ tSapChanMatrixInfo ht20_chan[] =
  3179. {116, 499},{120, 479},
  3180. {124, SAP_TX_LEAKAGE_MIN},{128, SAP_TX_LEAKAGE_MIN},
  3181. {132, SAP_TX_LEAKAGE_MIN},{136, 479},
  3182. - {140, 499}
  3183. -#ifdef FEATURE_WLAN_CH144
  3184. - ,{144, SAP_TX_LEAKAGE_MIN}
  3185. -#endif
  3186. -}},
  3187. -
  3188. + {140, 499}}},
  3189. {132,
  3190. {{36, 643}, {40, 668},
  3191. {44, 651}, {48, 657},
  3192. @@ -794,12 +587,7 @@ tSapChanMatrixInfo ht20_chan[] =
  3193. {116, 550},{120, 530},
  3194. {124, 510},{128, SAP_TX_LEAKAGE_MIN},
  3195. {132, SAP_TX_LEAKAGE_MIN},{136, SAP_TX_LEAKAGE_MIN},
  3196. - {140, 490}
  3197. -#ifdef FEATURE_WLAN_CH144
  3198. - ,{144, SAP_TX_LEAKAGE_MIN}
  3199. -#endif
  3200. -}},
  3201. -
  3202. + {140, 490}}},
  3203. {136,
  3204. {{36, 654}, {40, 667},
  3205. {44, 666}, {48, 642},
  3206. @@ -810,12 +598,7 @@ tSapChanMatrixInfo ht20_chan[] =
  3207. {116, 555}, {120, 535},
  3208. {124, 515},{128, 495},
  3209. {132, SAP_TX_LEAKAGE_MIN},{136, SAP_TX_LEAKAGE_MIN},
  3210. - {140, SAP_TX_LEAKAGE_MIN}
  3211. -#ifdef FEATURE_WLAN_CH144
  3212. - ,{144, SAP_TX_LEAKAGE_MIN}
  3213. -#endif
  3214. -}},
  3215. -
  3216. + {140, SAP_TX_LEAKAGE_MIN}}},
  3217. {140,
  3218. {{36, 679}, {40, 673},
  3219. {44, 667}, {48, 656},
  3220. @@ -826,13 +609,8 @@ tSapChanMatrixInfo ht20_chan[] =
  3221. {116, 573}, {120, 553},
  3222. {124, 533},{128, 513},
  3223. {132, 490},{136, SAP_TX_LEAKAGE_MIN},
  3224. - {140, SAP_TX_LEAKAGE_MIN}
  3225. -#ifdef FEATURE_WLAN_CH144
  3226. - ,{144, SAP_TX_LEAKAGE_MIN}
  3227. -#endif
  3228. -}},
  3229. + {140, SAP_TX_LEAKAGE_MIN}}},
  3230. };
  3231. -#endif //end of WLAN_ENABLE_CHNL_MATRIX_RESTRICTION
  3232.  
  3233.  
  3234. /*----------------------------------------------------------------------------
  3235. @@ -939,33 +717,37 @@ static inline void sapEventInit(ptWLAN_SAPEvent sapEvent)
  3236. sapEvent->u2 = 0;
  3237. }
  3238.  
  3239. -#ifdef WLAN_ENABLE_CHNL_MATRIX_RESTRICTION
  3240. /*
  3241. - * This function gives the leakage matrix for given NOL channel and cbMode
  3242. + * This function is added to check if channel is in tx leak range
  3243. *
  3244. * PARAMETERS
  3245. * IN
  3246. - * sapContext : Pointer to vos global context structure
  3247. - * cbMode : target channel bonding mode
  3248. - * NOL_channel : the NOL channel whose leakage matrix is required
  3249. - * pTarget_chnl_mtrx : pointer to target channel matrix returned.
  3250. + * sapContext: Pointer to vos global context structure
  3251. + * target_channel: the target channel to switch to
  3252. *
  3253. * RETURN VALUE
  3254. - * BOOLEAN
  3255. - * TRUE: leakage matrix was found
  3256. - * FALSE: leakage matrix was not found
  3257. + * BOOLEAN to indicate if the target channel is good or bad to switch
  3258. + *
  3259. + * TRUE: the channel is above the tx leak threshold, CANNOT USE
  3260. + * FALSE: the channel is below the tx leak threshold, CAN BE USED
  3261. */
  3262. v_BOOL_t
  3263. -sapFindTargetChannelInChannelMatrix(ptSapContext sapContext,
  3264. - ePhyChanBondState cbMode,
  3265. - v_U8_t NOL_channel,
  3266. - tSapTxLeakInfo **pTarget_chnl_mtrx)
  3267. +sapChannelMatrixCheck(ptSapContext sapContext,
  3268. + ePhyChanBondState cbMode,
  3269. + v_U8_t target_channel)
  3270. {
  3271. tSapTxLeakInfo *target_chan_matrix = NULL;
  3272. tSapChanMatrixInfo *pchan_matrix = NULL;
  3273. + v_U32_t num_channel = (RF_CHAN_140 - RF_CHAN_36) + 1;
  3274. v_U32_t nchan_matrix;
  3275. + tHalHandle hHal = VOS_GET_HAL_CB(sapContext->pvosGCtx);
  3276. int i = 0;
  3277.  
  3278. + if (NULL == hHal) {
  3279. + VOS_ASSERT(0);
  3280. + return VOS_FALSE;
  3281. + }
  3282. +
  3283. switch (cbMode) {
  3284. case PHY_SINGLE_CHANNEL_CENTERED:
  3285. /* HT20 */
  3286. @@ -998,7 +780,7 @@ sapFindTargetChannelInChannelMatrix(ptSapContext sapContext,
  3287. for (i = 0; i < nchan_matrix; i++)
  3288. {
  3289. /* find the SAP channel to map the leakage matrix */
  3290. - if (NOL_channel == pchan_matrix[i].channel)
  3291. + if (sapContext->channel == pchan_matrix[i].channel)
  3292. {
  3293. target_chan_matrix = pchan_matrix[i].chan_matrix;
  3294. break;
  3295. @@ -1007,112 +789,45 @@ sapFindTargetChannelInChannelMatrix(ptSapContext sapContext,
  3296.  
  3297. if (NULL == target_chan_matrix)
  3298. {
  3299. + /* should never happen, we should ind a table here,
  3300. + * if we don't, need a fix here!
  3301. + */
  3302. +
  3303. + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
  3304. + FL("Shouldn't see this message! something went wrong here!"));
  3305. +
  3306. + VOS_ASSERT(0);
  3307. return VOS_FALSE;
  3308. - } else {
  3309. - *pTarget_chnl_mtrx = target_chan_matrix;
  3310. - return VOS_TRUE;
  3311. }
  3312. -}
  3313. -
  3314. -/*
  3315. - * This function removes the channels from temp channel list that
  3316. - * (if selected as target channel) will cause leakage in one of
  3317. - * the NOL channels
  3318. - *
  3319. - * PARAMETERS
  3320. - * IN
  3321. - * sapContext : Pointer to vos global context structure
  3322. - * cbMode : target channel bonding mode
  3323. - * pNol : DFS NOL
  3324. - * pTempChannelList : the target channel list
  3325. - *
  3326. - * RETURN VALUE
  3327. - * VOS_STATUS code associated with performing the operation
  3328. - */
  3329.  
  3330. -VOS_STATUS
  3331. -sapMarkChannelsLeakingIntoNOL(ptSapContext sapContext,
  3332. - ePhyChanBondState cbMode,
  3333. - tSapDfsNolInfo *pNol,
  3334. - v_U8_t tempChannelListSize,
  3335. - v_U8_t *pTempChannelList)
  3336. -{
  3337. - tSapTxLeakInfo *target_chan_matrix = NULL;
  3338. -#ifdef FEATURE_WLAN_CH144
  3339. - v_U32_t num_channel = (RF_CHAN_144 - RF_CHAN_36) + 1;
  3340. -#else
  3341. - v_U32_t num_channel = (RF_CHAN_140 - RF_CHAN_36) + 1;
  3342. -#endif
  3343. - v_U32_t i = 0;
  3344. - v_U32_t j = 0;
  3345. - v_U32_t k = 0;
  3346. - v_U8_t dfs_nol_channel;
  3347. -
  3348. -
  3349. - /* traverse target_chan_matrix and */
  3350. - for (i = 0; i < NUM_5GHZ_CHANNELS ; i++) {
  3351. - dfs_nol_channel = pNol[i].dfs_channel_number;
  3352. - if ( pNol[i].radar_status_flag == eSAP_DFS_CHANNEL_USABLE ||
  3353. - pNol[i].radar_status_flag == eSAP_DFS_CHANNEL_AVAILABLE ) {
  3354. - /* not present in NOL */
  3355. - continue;
  3356. - }
  3357. - VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_DEBUG,
  3358. - FL("sapdfs: processing NOL channel: %d"),
  3359. - dfs_nol_channel );
  3360. - if (VOS_FALSE == sapFindTargetChannelInChannelMatrix(sapContext,
  3361. - cbMode,
  3362. - dfs_nol_channel,
  3363. - &target_chan_matrix))
  3364. + for (i = 0; i < num_channel; i++)
  3365. + {
  3366. + if (target_channel == target_chan_matrix[i].leak_chan)
  3367. {
  3368. - /*
  3369. - * should never happen, we should always find a table here,
  3370. - * if we don't, need a fix here!
  3371. - */
  3372. - VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
  3373. - FL("Couldn't find target channel matrix!"));
  3374. - VOS_ASSERT(0);
  3375. - return VOS_STATUS_E_FAILURE;
  3376. - }
  3377. + if (target_chan_matrix[i].leak_lvl > SAP_TX_LEAKAGE_THRES) {
  3378. + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
  3379. + FL("Channel=%d is good"),
  3380. + target_channel);
  3381.  
  3382. - /*
  3383. - * following is based on assumption that both pTempChannelList
  3384. - * and target channel matrix are in increasing order of channelID
  3385. - */
  3386. - for (j = 0, k = 0; j < tempChannelListSize &&
  3387. - k < num_channel; ) {
  3388. - if (pTempChannelList[j] == 0) {
  3389. - j++;
  3390. + return VOS_FALSE;
  3391. } else {
  3392. - if (target_chan_matrix[k].leak_chan != pTempChannelList[j]) {
  3393. - k++;
  3394. - } else {
  3395. - /* check leakage from candidate channel to NOL channel */
  3396. - if (target_chan_matrix[k].leak_lvl <= SAP_TX_LEAKAGE_THRES)
  3397. - {
  3398. - /*
  3399. - * this means that candidate channel will have bad
  3400. - * leakage in NOL channel, remove the candidate channel
  3401. - * from temp list
  3402. - */
  3403. - VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,
  3404. - FL("sapdfs: channel: %d will have bad leakage"
  3405. - " due to channel: %d\n"),
  3406. - dfs_nol_channel,
  3407. - pTempChannelList[j]);
  3408. - pTempChannelList[j] = 0;
  3409. - break;
  3410. - }
  3411. - j++;
  3412. - k++;
  3413. - }
  3414. + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
  3415. + FL("Channel=%d has leakage=-%d dBm"),
  3416. + target_channel, (target_chan_matrix[i].leak_lvl/10));
  3417. + return VOS_TRUE;
  3418. }
  3419. - } /* end of for loop checking temp channel list leakage into NOL */
  3420. - } /* end of loop that selects each NOL */
  3421. - return VOS_STATUS_SUCCESS;
  3422. -}
  3423. + }
  3424. + }
  3425.  
  3426. -#endif // end of WLAN_ENABLE_CHNL_MATRIX_RESTRICTION
  3427. + /* should never happen, we should find a table here,
  3428. + * if we don't, need a fix here
  3429. + */
  3430. + VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
  3431. + FL("Channel=%d is not in the list"),
  3432. + target_channel);
  3433. +
  3434. + return VOS_FALSE;
  3435. +}
  3436.  
  3437. /*
  3438. * This function adds availabe channel to bitmap
  3439. @@ -1332,7 +1047,6 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext)
  3440. {
  3441. v_U32_t random_byte = 0;
  3442. v_U8_t available_chnl_count = 0;
  3443. - v_U8_t valid_chnl_count = 0;
  3444. v_U8_t availableChannels[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0,};
  3445. v_U8_t target_channel = 0;
  3446. v_BOOL_t isChannelNol = VOS_FALSE;
  3447. @@ -1345,7 +1059,6 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext)
  3448. tANI_U32 chanWidth;
  3449. ePhyChanBondState cbModeCurrent;
  3450. v_REGDOMAIN_t regDomain;
  3451. - v_U8_t *tempChannels = NULL;
  3452.  
  3453. if (NULL == hHal) {
  3454. VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
  3455. @@ -1395,17 +1108,12 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext)
  3456. if (sapGet5GHzChannelList(sapContext))
  3457. {
  3458. VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,
  3459. - FL("Getting 5Ghz channel list failed"));
  3460. + FL("Get 5Ghz channel list failed"));
  3461. return target_channel;
  3462. }
  3463.  
  3464. regDomain = sapFetchRegulatoryDomain(hHal);
  3465.  
  3466. - /*
  3467. - * valid_chnl_count will be used to find number of valid channels
  3468. - * after following for loop ends
  3469. - */
  3470. - valid_chnl_count = sapContext->SapAllChnlList.numChannel;
  3471. /* loop to check ACS range or NOL channels */
  3472. for (i = 0; i < sapContext->SapAllChnlList.numChannel; i++)
  3473. {
  3474. @@ -1439,8 +1147,6 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext)
  3475. FL("index:%d, Channel=%d Invalid,Japan W53 Disabled"),
  3476. i, channelID);
  3477. sapContext->SapAllChnlList.channelList[i].valid = VOS_FALSE;
  3478. - valid_chnl_count--;
  3479. - continue;
  3480. }
  3481.  
  3482. /*
  3483. @@ -1458,8 +1164,6 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext)
  3484. channelID,
  3485. pMac->sap.SapDfsInfo.sap_operating_chan_preferred_location);
  3486. sapContext->SapAllChnlList.channelList[i].valid = VOS_FALSE;
  3487. - valid_chnl_count--;
  3488. - continue;
  3489. }
  3490. }
  3491.  
  3492. @@ -1475,11 +1179,9 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext)
  3493. * DFS Non-Occupancy-Period which is 30 mins.
  3494. */
  3495. VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_LOW,
  3496. - FL("index: %d, Channel = %d Present in NOL"),
  3497. + FL("index: %d, Channel = %d Present in NOL LIST"),
  3498. i, channelID);
  3499. sapContext->SapAllChnlList.channelList[i].valid = VOS_FALSE;
  3500. - valid_chnl_count--;
  3501. - continue;
  3502. }
  3503. }
  3504.  
  3505. @@ -1495,86 +1197,44 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext)
  3506. FL("index: %d, Channel = %d out of ACS channel range"),
  3507. i, channelID);
  3508. sapContext->SapAllChnlList.channelList[i].valid = VOS_FALSE;
  3509. - valid_chnl_count--;
  3510. - continue;
  3511. }
  3512. } /* end of check for NOL or ACS channels */
  3513.  
  3514. - /* valid_chnl_count now have number of valid channels */
  3515. - tempChannels = vos_mem_malloc(valid_chnl_count);
  3516. - if (tempChannels == NULL) {
  3517. - VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
  3518. - FL("sapdfs: memory alloc failed"));
  3519. - return target_channel;
  3520. - }
  3521. -
  3522. do
  3523. {
  3524. - v_U8_t j = 0;
  3525. -#ifdef WLAN_ENABLE_CHNL_MATRIX_RESTRICTION
  3526. - tSapDfsNolInfo *pNol = pMac->sap.SapDfsInfo.sapDfsChannelNolList;
  3527. -#endif
  3528. -
  3529. - /* prepare temp list of just the valid channels */
  3530. - for (i = 0; i < sapContext->SapAllChnlList.numChannel; i++) {
  3531. - if (sapContext->SapAllChnlList.channelList[i].valid) {
  3532. - VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
  3533. - FL("sapdfs: Adding Channel = %d to temp List"),
  3534. - sapContext->SapAllChnlList.channelList[i].channel);
  3535. - tempChannels[j++] =
  3536. - sapContext->SapAllChnlList.channelList[i].channel;
  3537. - }
  3538. - }
  3539. -
  3540. -#ifdef WLAN_ENABLE_CHNL_MATRIX_RESTRICTION
  3541. - VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
  3542. - FL("sapdfs: Processing temp channel list against NOL."));
  3543. - if (VOS_STATUS_SUCCESS != sapMarkChannelsLeakingIntoNOL(sapContext,
  3544. - cbModeCurrent,
  3545. - pNol,
  3546. - valid_chnl_count,
  3547. - tempChannels)) {
  3548. - vos_mem_free(tempChannels);
  3549. - return target_channel;
  3550. - }
  3551. -#endif
  3552. - vos_mem_zero(availableChannels, sizeof(availableChannels));
  3553. vos_mem_zero(&channelBitmap, sizeof(channelBitmap));
  3554. channelBitmap.chanBondingSet[0].startChannel = 36;
  3555. channelBitmap.chanBondingSet[1].startChannel = 52;
  3556. channelBitmap.chanBondingSet[2].startChannel = 100;
  3557. channelBitmap.chanBondingSet[3].startChannel = 116;
  3558. - channelBitmap.chanBondingSet[3].startChannel = 132;
  3559. channelBitmap.chanBondingSet[4].startChannel = 149;
  3560. + vos_mem_zero(availableChannels, sizeof(availableChannels));
  3561. /* now loop through whatever is left of channel list */
  3562. - VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
  3563. - FL("sapdfs: Moving temp channel list to final."));
  3564. - for (i = 0; i < valid_chnl_count; i++ ){
  3565. - /*
  3566. - * add channel from temp channel list to bitmap or fianl
  3567. - * channel list (in case of 20MHz width)
  3568. - */
  3569. - if (tempChannels[i] != 0) {
  3570. - VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_DEBUG,
  3571. - FL("sapdfs: processing channel: %d "),
  3572. - tempChannels[i]);
  3573. - /* for 20MHz, directly create available channel list */
  3574. - if (cbModeCurrent == PHY_SINGLE_CHANNEL_CENTERED) {
  3575. - VOS_TRACE(VOS_MODULE_ID_SAP,
  3576. - VOS_TRACE_LEVEL_DEBUG,
  3577. - FL("sapdfs: Channel=%d added to available list"),
  3578. - tempChannels[i]);
  3579. - availableChannels[available_chnl_count++] =
  3580. - tempChannels[i];
  3581. - } else {
  3582. - VOS_TRACE(VOS_MODULE_ID_SAP,
  3583. - VOS_TRACE_LEVEL_DEBUG,
  3584. - FL("sapdfs: Channel=%d added to bitmap"),
  3585. - tempChannels[i]);
  3586. - sapSetBitmap(&channelBitmap, tempChannels[i]);
  3587. + for (i = 0; i < sapContext->SapAllChnlList.numChannel; i++ ){
  3588. + /* check the channel matrix */
  3589. + if (sapContext->SapAllChnlList.channelList[i].valid) {
  3590. + channelID = sapContext->SapAllChnlList.channelList[i].channel;
  3591. + /* if leakage for this channel is within limits */
  3592. + if (VOS_FALSE == sapChannelMatrixCheck(sapContext,
  3593. + cbModeCurrent,
  3594. + channelID)) {
  3595. + /* for 20MHz, directly create available channel list */
  3596. + if (cbModeCurrent == PHY_SINGLE_CHANNEL_CENTERED) {
  3597. + VOS_TRACE(VOS_MODULE_ID_SAP,
  3598. + VOS_TRACE_LEVEL_INFO_LOW,
  3599. + FL("Channel=%d added to available list"),
  3600. + channelID);
  3601. + availableChannels[available_chnl_count++] = channelID;
  3602. + } else {
  3603. + VOS_TRACE(VOS_MODULE_ID_SAP,
  3604. + VOS_TRACE_LEVEL_INFO_LOW,
  3605. + FL("Channel=%d added to bitmap"),
  3606. + channelID);
  3607. + sapSetBitmap(&channelBitmap, channelID);
  3608. + }
  3609. }
  3610. }
  3611. - }
  3612. + } /* end of loop to check against DFS leakage channel matrix */
  3613.  
  3614. /* if 40 MHz or 80 MHz, populate available channel list from bitmap */
  3615. if (cbModeCurrent != PHY_SINGLE_CHANNEL_CENTERED) {
  3616. @@ -1652,7 +1312,6 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext)
  3617. break;
  3618. } while(1); /* this loop will iterate at max 3 times */
  3619.  
  3620. - vos_mem_free(tempChannels);
  3621. return target_channel;
  3622. }
  3623.  
  3624. @@ -4403,13 +4062,6 @@ v_U8_t sapIndicateRadar(ptSapContext sapContext, tSirSmeDfsEventInd *dfs_event)
  3625. return 0;
  3626. }
  3627.  
  3628. - /*
  3629. - * SAP needs to generate Channel Switch IE
  3630. - * if the radar is found in the STARTED state
  3631. - */
  3632. - if (eSAP_STARTED == sapContext->sapsMachine)
  3633. - pMac->sap.SapDfsInfo.csaIERequired = VOS_TRUE;
  3634. -
  3635. if (sapContext->csrRoamProfile.disableDFSChSwitch)
  3636. {
  3637. return sapContext->channel;
  3638. @@ -4418,6 +4070,12 @@ v_U8_t sapIndicateRadar(ptSapContext sapContext, tSirSmeDfsEventInd *dfs_event)
  3639. /* set the Radar Found flag in SapDfsInfo */
  3640. pMac->sap.SapDfsInfo.sap_radar_found_status = VOS_TRUE;
  3641.  
  3642. + /* We need to generate Channel Switch IE if the radar is found in the
  3643. + * operating state
  3644. + */
  3645. + if (eSAP_STARTED == sapContext->sapsMachine)
  3646. + pMac->sap.SapDfsInfo.csaIERequired = VOS_TRUE;
  3647. +
  3648. sapGet5GHzChannelList(sapContext);
  3649.  
  3650. if (dfs_event->chan_list.nchannels > SIR_DFS_MAX_20M_SUB_CH) {
  3651. diff --git a/drivers/staging/qcacld-2.0/CORE/SAP/src/sapModule.c b/drivers/staging/qcacld-2.0/CORE/SAP/src/sapModule.c
  3652. index 0786da6..519a85c 100644
  3653. --- a/drivers/staging/qcacld-2.0/CORE/SAP/src/sapModule.c
  3654. +++ b/drivers/staging/qcacld-2.0/CORE/SAP/src/sapModule.c
  3655. @@ -644,7 +644,6 @@ WLANSAP_StartBss
  3656. ptSapContext pSapCtx = NULL;
  3657. tANI_BOOLEAN restartNeeded;
  3658. tHalHandle hHal;
  3659. - tpAniSirGlobal pmac = NULL;
  3660. int ret;
  3661.  
  3662. /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
  3663. @@ -736,13 +735,6 @@ WLANSAP_StartBss
  3664. }
  3665. }
  3666.  
  3667. - pmac = PMAC_STRUCT( hHal );
  3668. - /*
  3669. - * Copy the DFS Test Mode setting to pmac for
  3670. - * access in lower layers
  3671. - */
  3672. - pmac->sap.SapDfsInfo.disable_dfs_ch_switch =
  3673. - pConfig->disableDFSChSwitch;
  3674. // Copy MAC filtering settings to sap context
  3675. pSapCtx->eSapMacAddrAclMode = pConfig->SapMacaddr_acl;
  3676. vos_mem_copy(pSapCtx->acceptMacList, pConfig->accept_mac, sizeof(pConfig->accept_mac));
  3677. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/BMI/ol_fw.c b/drivers/staging/qcacld-2.0/CORE/SERVICES/BMI/ol_fw.c
  3678. index 7a0c1db..1c18be6 100644
  3679. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/BMI/ol_fw.c
  3680. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/BMI/ol_fw.c
  3681. @@ -1,5 +1,5 @@
  3682. /*
  3683. - * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved.
  3684. + * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved.
  3685. *
  3686. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  3687. *
  3688. @@ -57,9 +57,62 @@
  3689. #include "qwlan_version.h"
  3690.  
  3691. #ifdef FEATURE_SECURE_FIRMWARE
  3692. -#define MAX_FIRMWARE_SIZE (1*1024*1024)
  3693.  
  3694. static u8 fw_mem[MAX_FIRMWARE_SIZE];
  3695. +static struct hash_fw fw_hash = {
  3696. +
  3697. +/* qwlan30.bin sha256sum hash */
  3698. +{
  3699. +0xad, 0x18, 0xb6, 0x6e, 0x59, 0x49, 0x34, 0x82, 0x1e, 0x09,
  3700. +0x07, 0x3b, 0x00, 0xe8, 0xfa, 0x1e, 0x70, 0xb9, 0x22, 0xa9,
  3701. +0x93, 0xc1, 0xef, 0xd7, 0x14, 0xef, 0x36, 0xb8, 0x5e, 0x7d,
  3702. +0xea, 0xd7,
  3703. +},
  3704. +
  3705. +/* otp30.bin sha256sum hash */
  3706. +{
  3707. +0xf8, 0x46, 0x08, 0x53, 0x25, 0x9d, 0xd2, 0x1f, 0xeb, 0x12,
  3708. +0xc5, 0x22, 0x14, 0x22, 0x1a, 0xf5, 0x35, 0x15, 0xff, 0xf7,
  3709. +0x1a, 0xa7, 0x5f, 0x79, 0x44, 0xd7, 0xfe, 0x58, 0xe1, 0xf3,
  3710. +0xed, 0xd4,
  3711. +},
  3712. +
  3713. +/* bdwlan30.bin sha256sum hash */
  3714. +#ifdef CONFIG_MSM8994
  3715. +{
  3716. +0x9c, 0x4f, 0xb2, 0xd3, 0x9a, 0xbf, 0xf0, 0x0a, 0x5f, 0x78,
  3717. +0x92, 0xcf, 0x03, 0x58, 0x03, 0xfc, 0x5a, 0xb6, 0xd8, 0xa0,
  3718. +0xfb, 0x6d, 0xcc, 0x7b, 0x4e, 0x06, 0x67, 0xda, 0x0e, 0xfd,
  3719. +0xd9, 0x1f,
  3720. +},
  3721. +#else /* Clark */
  3722. +#ifdef CNSS_LOCALE_argentina
  3723. +{
  3724. +0x0f, 0xcb, 0xcd, 0x2b, 0x8f, 0x5c, 0xb5, 0xd8, 0xdc, 0xbd,
  3725. +0x91, 0xaf, 0x29, 0x27, 0x11, 0x73, 0xce, 0x11, 0x7d, 0x8d,
  3726. +0x5a, 0x6c, 0x5e, 0x22, 0xb1, 0x29, 0x65, 0x7a, 0x18, 0x87,
  3727. +0x29, 0xc5,
  3728. +},
  3729. +#else
  3730. +{
  3731. +0x26, 0xdd, 0xa9, 0xc1, 0xc1, 0x61, 0xb9, 0xb4, 0xbb, 0xf8,
  3732. +0xac, 0xc0, 0xa8, 0xd0, 0x39, 0xa7, 0x83, 0xe6, 0x12, 0x20,
  3733. +0x94, 0xb5, 0xa7, 0x3c, 0xf3, 0xc0, 0xb9, 0xd7, 0x13, 0x8f,
  3734. +0x96, 0xac,
  3735. +},
  3736. +#endif
  3737. +#endif
  3738. +
  3739. +/* utf30.bin sha256sum hash */
  3740. +{
  3741. +0x7f, 0x1f, 0xae, 0xd8, 0x8b, 0xeb, 0xb4, 0x3f, 0xa2,
  3742. +0x2a, 0x43, 0x15, 0x48, 0x81, 0x53, 0xdf, 0xfb, 0x1e, 0x79,
  3743. +0x46, 0x75, 0x38, 0xd9, 0xf6, 0x9e, 0x67, 0xd8, 0xbf, 0xf8,
  3744. +0xce, 0x3f, 0x67,
  3745. +},
  3746. +
  3747. +};
  3748. +#else
  3749. static struct hash_fw fw_hash;
  3750. #endif
  3751.  
  3752. @@ -934,7 +987,7 @@ static void ramdump_work_handler(struct work_struct *ramdump)
  3753. goto out_fail;
  3754.  
  3755. printk("%s: RAM dump collecting completed!\n", __func__);
  3756. -
  3757. + msleep(250);
  3758. #if defined(HIF_SDIO)
  3759. panic("CNSS Ram dump collected\n");
  3760. #else
  3761. @@ -1107,8 +1160,6 @@ void ol_ramdump_handler(struct ol_softc *scn)
  3762. void ol_target_failure(void *instance, A_STATUS status)
  3763. {
  3764. struct ol_softc *scn = (struct ol_softc *)instance;
  3765. - void *vos_context = vos_get_global_context(VOS_MODULE_ID_WDA, NULL);
  3766. - tp_wma_handle wma = vos_get_context(VOS_MODULE_ID_WDA, vos_context);
  3767. #ifndef CONFIG_CNSS
  3768. A_UINT32 reg_dump_area = 0;
  3769. A_UINT32 reg_dump_values[REGISTER_DUMP_LEN_MAX];
  3770. @@ -1118,6 +1169,8 @@ void ol_target_failure(void *instance, A_STATUS status)
  3771. struct dbglog_hdr_host dbglog_hdr;
  3772. struct dbglog_buf_host dbglog_buf;
  3773. A_UINT8 *dbglog_data;
  3774. + void *vos_context = vos_get_global_context(VOS_MODULE_ID_WDA, NULL);
  3775. + tp_wma_handle wma = vos_get_context(VOS_MODULE_ID_WDA, vos_context);
  3776. #else
  3777. int ret;
  3778. #endif
  3779. @@ -1131,8 +1184,6 @@ void ol_target_failure(void *instance, A_STATUS status)
  3780. }
  3781. #endif
  3782.  
  3783. - vos_event_set(&wma->recovery_event);
  3784. -
  3785. if (OL_TRGET_STATUS_RESET == scn->target_status) {
  3786. printk("Target is already asserted, ignore!\n");
  3787. return;
  3788. @@ -1140,11 +1191,6 @@ void ol_target_failure(void *instance, A_STATUS status)
  3789.  
  3790. scn->target_status = OL_TRGET_STATUS_RESET;
  3791.  
  3792. - if (vos_is_logp_in_progress(VOS_MODULE_ID_VOSS, NULL)) {
  3793. - pr_info("%s: LOGP is in progress, ignore!\n", __func__);
  3794. - return;
  3795. - }
  3796. -
  3797. if (vos_is_load_unload_in_progress(VOS_MODULE_ID_VOSS, NULL)) {
  3798. printk("%s: Loading/Unloading is in progress, ignore!\n",
  3799. __func__);
  3800. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/adf/adf_os_timer.h b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/adf/adf_os_timer.h
  3801. index fdbe312..0a0088e 100644
  3802. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/adf/adf_os_timer.h
  3803. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/adf/adf_os_timer.h
  3804. @@ -58,10 +58,9 @@ static inline void
  3805. adf_os_timer_init(adf_os_handle_t hdl,
  3806. adf_os_timer_t *timer,
  3807. adf_os_timer_func_t func,
  3808. - void *arg,
  3809. - uint8_t type)
  3810. + void *arg)
  3811. {
  3812. - __adf_os_timer_init(hdl, timer, func, arg, type);
  3813. + __adf_os_timer_init(hdl, timer, func, arg);
  3814. }
  3815.  
  3816. /**
  3817. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/adf/linux/adf_os_timer_pvt.h b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/adf/linux/adf_os_timer_pvt.h
  3818. index b57b1b6..e4cb74b 100644
  3819. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/adf/linux/adf_os_timer_pvt.h
  3820. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/adf/linux/adf_os_timer_pvt.h
  3821. @@ -1,5 +1,5 @@
  3822. /*
  3823. - * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved.
  3824. + * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved.
  3825. *
  3826. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  3827. *
  3828. @@ -35,9 +35,6 @@
  3829. #include <linux/jiffies.h>
  3830. #include <adf_os_types.h>
  3831.  
  3832. -#define ADF_DEFERRABLE_TIMER 0
  3833. -#define ADF_NON_DEFERRABLE_TIMER 1
  3834. -
  3835. /*
  3836. * timer data type
  3837. */
  3838. @@ -56,13 +53,9 @@ static inline a_status_t
  3839. __adf_os_timer_init(adf_os_handle_t hdl,
  3840. struct timer_list *timer,
  3841. adf_os_timer_func_t func,
  3842. - void *arg,
  3843. - uint8_t type)
  3844. + void *arg)
  3845. {
  3846. - if (ADF_DEFERRABLE_TIMER == type)
  3847. - init_timer_deferrable(timer);
  3848. - else
  3849. - init_timer(timer);
  3850. + init_timer(timer);
  3851. timer->function = (adf_dummy_timer_func_t)func;
  3852. timer->data = (unsigned long)arg;
  3853.  
  3854. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/dbglog.h b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/dbglog.h
  3855. index 9874ac8..c7ac9e9 100644
  3856. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/dbglog.h
  3857. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/dbglog.h
  3858. @@ -1,5 +1,5 @@
  3859. /*
  3860. - * Copyright (c) 2012, 2015 The Linux Foundation. All rights reserved.
  3861. + * Copyright (c) 2012 The Linux Foundation. All rights reserved.
  3862. *
  3863. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  3864. *
  3865. @@ -63,8 +63,8 @@ extern "C" {
  3866.  
  3867. #define DBGLOG_NUM_ARGS_OFFSET 26
  3868. #define DBGLOG_NUM_ARGS_MASK 0xFC000000 /* Bit 26-31 */
  3869. -#define DBGLOG_NUM_ARGS_MAX 9 /* it is bcoz of limitation
  3870. - of corebsp MSG*() to accept max 9 arg */
  3871. +#define DBGLOG_NUM_ARGS_MAX 5 /* it is limited bcoz of limitations
  3872. + with Xtensa tool */
  3873.  
  3874. #define DBGLOG_LOG_BUFFER_SIZE 1500
  3875. #define DBGLOG_DBGID_DEFINITION_LEN_MAX 90
  3876. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/htc.h b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/htc.h
  3877. index dd6ecb5..93033a9 100644
  3878. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/htc.h
  3879. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/htc.h
  3880. @@ -92,9 +92,9 @@ typedef PREPACK struct _HTC_FRAME_HDR{
  3881.  
  3882. /***** end of 4-byte lookahead ****/
  3883.  
  3884. - A_UINT32 ControlBytes0 : 8, /* used for CRC check if CRC_CHECK flag set */
  3885. - ControlBytes1 : 8, /* used for seq check if SEQ_CHECK flag set */
  3886. - reserved : 16; /* used by bundle processing in SDIO systems */
  3887. + A_UINT32 ControlBytes0 : 8,
  3888. + ControlBytes1 : 8,
  3889. + reserved : 16;
  3890.  
  3891. /* message payload starts after the header */
  3892.  
  3893. @@ -124,10 +124,6 @@ typedef PREPACK struct _HTC_FRAME_HDR{
  3894. /* send direction */
  3895. #define HTC_FLAGS_NEED_CREDIT_UPDATE (1 << 0)
  3896. #define HTC_FLAGS_SEND_BUNDLE (1 << 1) /* start or part of bundle */
  3897. -#define HTC_FLAGS_SEQ_CHECK (1 << 2) /* seq check on rx side */
  3898. -#define HTC_FLAGS_CRC CHECK (1 << 3) /* CRC check on rx side */
  3899. -
  3900. -
  3901. /* receive direction */
  3902. #define HTC_FLAGS_RECV_UNUSED_0 (1 << 0) /* bit 0 unused */
  3903. #define HTC_FLAGS_RECV_TRAILER (1 << 1) /* bit 1 trailer data present */
  3904. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/ol_txrx_ctrl_api.h b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/ol_txrx_ctrl_api.h
  3905. index f2cf10a..af1904b 100644
  3906. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/ol_txrx_ctrl_api.h
  3907. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/ol_txrx_ctrl_api.h
  3908. @@ -61,7 +61,6 @@ enum wlan_op_mode {
  3909. #define OL_TXQ_PAUSE_REASON_PEER_UNAUTHORIZED (1 << 1)
  3910. #define OL_TXQ_PAUSE_REASON_TX_ABORT (1 << 2)
  3911. #define OL_TXQ_PAUSE_REASON_VDEV_STOP (1 << 3)
  3912. -#define OL_TXQ_PAUSE_REASON_VDEV_SUSPEND (1 << 4)
  3913.  
  3914. /**
  3915. * @brief Set up the data SW subsystem.
  3916. @@ -394,45 +393,37 @@ ol_txrx_throttle_unpause(ol_txrx_pdev_handle data_pdev);
  3917. #endif /* CONFIG_HL_SUPPORT */
  3918.  
  3919. /**
  3920. - * ol_txrx_pdev_pause() - Suspend all tx data for the specified physical device.
  3921. - * @data_pdev: the physical device being paused.
  3922. - * @reason: pause reason.
  3923. - * One can provide multiple line descriptions
  3924. - * for arguments.
  3925. - *
  3926. - * This function applies to HL systems -
  3927. - * in LL systems, applies when txrx_vdev_pause_all is enabled.
  3928. - * In some systems it is necessary to be able to temporarily
  3929. - * suspend all WLAN traffic, e.g. to allow another device such as bluetooth
  3930. - * to temporarily have exclusive access to shared RF chain resources.
  3931. - * This function suspends tx traffic within the specified physical device.
  3932. - *
  3933. + * @brief Suspend all tx data for the specified physical device.
  3934. + * @details
  3935. + * This function applies only to HL systems - in LL systems, tx flow control
  3936. + * is handled entirely within the target FW.
  3937. + * In some systems it is necessary to be able to temporarily
  3938. + * suspend all WLAN traffic, e.g. to allow another device such as bluetooth
  3939. + * to temporarily have exclusive access to shared RF chain resources.
  3940. + * This function suspends tx traffic within the specified physical device.
  3941. *
  3942. - * Return: None
  3943. + * @param data_pdev - the physical device being paused
  3944. */
  3945. -#if defined(CONFIG_HL_SUPPORT) || defined(QCA_SUPPORT_TXRX_VDEV_PAUSE_LL)
  3946. +#if defined(CONFIG_HL_SUPPORT)
  3947. void
  3948. -ol_txrx_pdev_pause(ol_txrx_pdev_handle data_pdev, u_int32_t reason);
  3949. +ol_txrx_pdev_pause(ol_txrx_pdev_handle data_pdev);
  3950. #else
  3951. -#define ol_txrx_pdev_pause(data_pdev,reason) /* no-op */
  3952. +#define ol_txrx_pdev_pause(data_pdev) /* no-op */
  3953. #endif /* CONFIG_HL_SUPPORT */
  3954.  
  3955. /**
  3956. - * ol_txrx_pdev_unpause() - Resume tx for the specified physical device..
  3957. - * @data_pdev: the physical device being paused.
  3958. - * @reason: pause reason.
  3959. - *
  3960. - * This function applies to HL systems -
  3961. - * in LL systems, applies when txrx_vdev_pause_all is enabled.
  3962. - *
  3963. + * @brief Resume tx for the specified physical device.
  3964. + * @details
  3965. + * This function applies only to HL systems - in LL systems, tx flow control
  3966. + * is handled entirely within the target FW.
  3967. *
  3968. - * Return: None
  3969. + * @param data_pdev - the physical device being unpaused
  3970. */
  3971. -#if defined(CONFIG_HL_SUPPORT) || defined(QCA_SUPPORT_TXRX_VDEV_PAUSE_LL)
  3972. +#if defined(CONFIG_HL_SUPPORT)
  3973. void
  3974. -ol_txrx_pdev_unpause(ol_txrx_pdev_handle data_pdev, u_int32_t reason);
  3975. +ol_txrx_pdev_unpause(ol_txrx_pdev_handle data_pdev);
  3976. #else
  3977. -#define ol_txrx_pdev_unpause(data_pdev,reason) /* no-op */
  3978. +#define ol_txrx_pdev_unpause(data_pdev) /* no-op */
  3979. #endif /* CONFIG_HL_SUPPORT */
  3980.  
  3981. /**
  3982. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/osapi_linux.h b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/osapi_linux.h
  3983. index 6a85175..79cfecc 100644
  3984. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/osapi_linux.h
  3985. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/osapi_linux.h
  3986. @@ -1,5 +1,5 @@
  3987. /*
  3988. - * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved.
  3989. + * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved.
  3990. *
  3991. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  3992. *
  3993. @@ -170,7 +170,7 @@ typedef spinlock_t A_MUTEX_T;
  3994. typedef struct timer_list A_TIMER;
  3995.  
  3996. #define A_INIT_TIMER(pTimer, pFunction, pArg) do { \
  3997. - init_timer_deferrable(pTimer); \
  3998. + init_timer(pTimer); \
  3999. (pTimer)->function = (pFunction); \
  4000. (pTimer)->data = (unsigned long)(pArg); \
  4001. } while (0)
  4002. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/osdep_adf.h b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/osdep_adf.h
  4003. index 8739f87..708b6f8 100644
  4004. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/osdep_adf.h
  4005. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/osdep_adf.h
  4006. @@ -641,7 +641,7 @@ typedef dma_addr_t * dma_context_t;
  4007. (_arg) = (_type)(timer_arg)
  4008.  
  4009.  
  4010. -#define OS_INIT_TIMER(_osdev, _timer, _fn, _ctx, type) adf_os_timer_init(_osdev, _timer, _fn, _ctx, type)
  4011. +#define OS_INIT_TIMER(_osdev, _timer, _fn, _ctx) adf_os_timer_init(_osdev, _timer, _fn, _ctx)
  4012.  
  4013. #define OS_SET_TIMER(_timer, _ms) adf_os_timer_mod(_timer, _ms)
  4014.  
  4015. @@ -767,8 +767,7 @@ static INLINE int OS_MESGQ_INIT(osdev_t devhandle, os_mesg_queue_t *queue,
  4016. #ifdef USE_SOFTINTR
  4017. queue->_task = softintr_establish(IPL_SOFTNET,os_mesgq_handler,(void *)queue);
  4018. #else
  4019. - OS_INIT_TIMER(devhandle,&queue->_timer, os_mesgq_handler, queue,
  4020. - ADF_DEFERRABLE_TIMER);
  4021. + OS_INIT_TIMER(devhandle,&queue->_timer, os_mesgq_handler, queue);
  4022. #endif
  4023.  
  4024. return 0;
  4025. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/targaddrs.h b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/targaddrs.h
  4026. index 0cec68f..4f91698 100644
  4027. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/targaddrs.h
  4028. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/targaddrs.h
  4029. @@ -1,5 +1,5 @@
  4030. /*
  4031. - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
  4032. + * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved.
  4033. *
  4034. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  4035. *
  4036. @@ -369,10 +369,6 @@ PREPACK64 struct host_interest_s {
  4037.  
  4038. #define HI_OPTION_USE_EXT_LDO 0x40 /* use LDO27 for 1.1V instead of PMU */
  4039. #define HI_OPTION_DBUART_SUPPORT 0x80 /* Enable uart debug support */
  4040. -#define HT_OPTION_GPIO_WAKEUP_SUPPORT 0x200 /* GPIO wake up support */
  4041. -
  4042. -#define GPIO_WAKEUP_ENABLED() \
  4043. - (HOST_INTEREST->hi_option_flag2 & HT_OPTION_GPIO_WAKEUP_SUPPORT)
  4044.  
  4045. /* hi_reset_flag */
  4046. #define HI_RESET_FLAG_PRESERVE_APP_START 0x01 /* preserve App Start address */
  4047. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wdi_in.h b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wdi_in.h
  4048. index c81497d..10fd92c 100644
  4049. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wdi_in.h
  4050. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wdi_in.h
  4051. @@ -350,38 +350,36 @@ wdi_in_vdev_unpause(ol_txrx_vdev_handle data_vdev, u_int32_t reason);
  4052. /**
  4053. * @brief Suspend all tx data for the specified physical device.
  4054. * @details
  4055. - * This function applies to HL systems -
  4056. - * in LL systems, applies when txrx_vdev_pause_all is enabled.
  4057. + * This function applies only to HL systems - in LL systems, tx flow control
  4058. + * is handled entirely within the target FW.
  4059. * In some systems it is necessary to be able to temporarily
  4060. * suspend all WLAN traffic, e.g. to allow another device such as bluetooth
  4061. * to temporarily have exclusive access to shared RF chain resources.
  4062. * This function suspends tx traffic within the specified physical device.
  4063. *
  4064. * @param data_pdev - the physical device being paused
  4065. - * @param reason - pause reason
  4066. */
  4067. -#if defined(CONFIG_HL_SUPPORT) || defined(QCA_SUPPORT_TXRX_VDEV_PAUSE_LL)
  4068. +#if defined(CONFIG_HL_SUPPORT)
  4069. void
  4070. -wdi_in_pdev_pause(ol_txrx_pdev_handle data_pdev, u_int32_t reason);
  4071. +wdi_in_pdev_pause(ol_txrx_pdev_handle data_pdev);
  4072. #else
  4073. -#define wdi_in_pdev_pause(data_pdev, reason) /* no-op */
  4074. -#endif
  4075. +#define wdi_in_pdev_pause(data_pdev) /* no-op */
  4076. +#endif /* CONFIG_HL_SUPPORT */
  4077.  
  4078. /**
  4079. * @brief Resume tx for the specified physical device.
  4080. * @details
  4081. - * This function applies to HL systems -
  4082. - * in LL systems, applies when txrx_vdev_pause_all is enabled.
  4083. + * This function applies only to HL systems - in LL systems, tx flow control
  4084. + * is handled entirely within the target FW.
  4085. *
  4086. * @param data_pdev - the physical device being unpaused
  4087. - * @param reason - pause reason
  4088. */
  4089. -#if defined(CONFIG_HL_SUPPORT) || defined(QCA_SUPPORT_TXRX_VDEV_PAUSE_LL)
  4090. +#if defined(CONFIG_HL_SUPPORT)
  4091. void
  4092. -wdi_in_pdev_unpause(ol_txrx_pdev_handle data_pdev, u_int32_t reason);
  4093. +wdi_in_pdev_unpause(ol_txrx_pdev_handle data_pdev);
  4094. #else
  4095. -#define wdi_in_pdev_unpause(data_pdev, reason) /* no-op */
  4096. -#endif
  4097. +#define wdi_in_pdev_unpause(data_pdev) /* no-op */
  4098. +#endif /* CONFIG_HL_SUPPORT */
  4099.  
  4100. /**
  4101. * @brief Synchronize the data-path tx with a control-path target download
  4102. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wlan_defs.h b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wlan_defs.h
  4103. index ce2a166..bcab123 100644
  4104. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wlan_defs.h
  4105. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wlan_defs.h
  4106. @@ -37,12 +37,12 @@
  4107. #define __WLANDEFS_H__
  4108.  
  4109. #include <a_osapi.h> /* A_COMPILE_TIME_ASSERT */
  4110. -#include <osdep.h>
  4111.  
  4112. /*
  4113. * This file contains WLAN definitions that may be used across both
  4114. * Host and Target software.
  4115. */
  4116. +
  4117. /*
  4118. * MAX_SPATIAL_STREAM should be defined in a fwconfig_xxx.h file,
  4119. * but for now provide a default value here in case it's not defined
  4120. @@ -160,30 +160,29 @@ typedef enum {
  4121.  
  4122.  
  4123. enum {
  4124. - REGDMN_MODE_11A = 0x00000001, /* 11a channels */
  4125. - REGDMN_MODE_TURBO = 0x00000002, /* 11a turbo-only channels */
  4126. - REGDMN_MODE_11B = 0x00000004, /* 11b channels */
  4127. - REGDMN_MODE_PUREG = 0x00000008, /* 11g channels (OFDM only) */
  4128. - REGDMN_MODE_11G = 0x00000008, /* XXX historical */
  4129. - REGDMN_MODE_108G = 0x00000020, /* 11g+Turbo channels */
  4130. - REGDMN_MODE_108A = 0x00000040, /* 11a+Turbo channels */
  4131. - REGDMN_MODE_XR = 0x00000100, /* XR channels */
  4132. - REGDMN_MODE_11A_HALF_RATE = 0x00000200, /* 11A half rate channels */
  4133. - REGDMN_MODE_11A_QUARTER_RATE = 0x00000400, /* 11A quarter rate channels */
  4134. - REGDMN_MODE_11NG_HT20 = 0x00000800, /* 11N-G HT20 channels */
  4135. - REGDMN_MODE_11NA_HT20 = 0x00001000, /* 11N-A HT20 channels */
  4136. - REGDMN_MODE_11NG_HT40PLUS = 0x00002000, /* 11N-G HT40 + channels */
  4137. - REGDMN_MODE_11NG_HT40MINUS = 0x00004000, /* 11N-G HT40 - channels */
  4138. - REGDMN_MODE_11NA_HT40PLUS = 0x00008000, /* 11N-A HT40 + channels */
  4139. - REGDMN_MODE_11NA_HT40MINUS = 0x00010000, /* 11N-A HT40 - channels */
  4140. - REGDMN_MODE_11AC_VHT20 = 0x00020000, /* 5Ghz, VHT20 */
  4141. - REGDMN_MODE_11AC_VHT40PLUS = 0x00040000, /* 5Ghz, VHT40 + channels */
  4142. - REGDMN_MODE_11AC_VHT40MINUS = 0x00080000, /* 5Ghz VHT40 - channels */
  4143. - REGDMN_MODE_11AC_VHT80 = 0x000100000, /* 5Ghz, VHT80 channels */
  4144. - REGDMN_MODE_11AC_VHT20_2G = 0x000200000, /* 2Ghz, VHT20 */
  4145. - REGDMN_MODE_11AC_VHT40_2G = 0x000400000, /* 2Ghz, VHT40 */
  4146. - REGDMN_MODE_11AC_VHT80_2G = 0x000800000, /* 2Ghz, VHT80 */
  4147. - REGDMN_MODE_11AC_VHT160 = 0x001000000, /* 5Ghz, VHT160 */
  4148. + REGDMN_MODE_11A = 0x00001, /* 11a channels */
  4149. + REGDMN_MODE_TURBO = 0x00002, /* 11a turbo-only channels */
  4150. + REGDMN_MODE_11B = 0x00004, /* 11b channels */
  4151. + REGDMN_MODE_PUREG = 0x00008, /* 11g channels (OFDM only) */
  4152. + REGDMN_MODE_11G = 0x00008, /* XXX historical */
  4153. + REGDMN_MODE_108G = 0x00020, /* 11g+Turbo channels */
  4154. + REGDMN_MODE_108A = 0x00040, /* 11a+Turbo channels */
  4155. + REGDMN_MODE_XR = 0x00100, /* XR channels */
  4156. + REGDMN_MODE_11A_HALF_RATE = 0x00200, /* 11A half rate channels */
  4157. + REGDMN_MODE_11A_QUARTER_RATE = 0x00400, /* 11A quarter rate channels */
  4158. + REGDMN_MODE_11NG_HT20 = 0x00800, /* 11N-G HT20 channels */
  4159. + REGDMN_MODE_11NA_HT20 = 0x01000, /* 11N-A HT20 channels */
  4160. + REGDMN_MODE_11NG_HT40PLUS = 0x02000, /* 11N-G HT40 + channels */
  4161. + REGDMN_MODE_11NG_HT40MINUS = 0x04000, /* 11N-G HT40 - channels */
  4162. + REGDMN_MODE_11NA_HT40PLUS = 0x08000, /* 11N-A HT40 + channels */
  4163. + REGDMN_MODE_11NA_HT40MINUS = 0x10000, /* 11N-A HT40 - channels */
  4164. + REGDMN_MODE_11AC_VHT20 = 0x20000, /* 5Ghz, VHT20 */
  4165. + REGDMN_MODE_11AC_VHT40PLUS = 0x40000, /* 5Ghz, VHT40 + channels */
  4166. + REGDMN_MODE_11AC_VHT40MINUS = 0x80000, /* 5Ghz VHT40 - channels */
  4167. + REGDMN_MODE_11AC_VHT80 = 0x100000, /* 5Ghz, VHT80 channels */
  4168. + REGDMN_MODE_11AC_VHT20_2G = 0x200000, /* 2Ghz, VHT20 */
  4169. + REGDMN_MODE_11AC_VHT40_2G = 0x400000, /* 2Ghz, VHT40 */
  4170. + REGDMN_MODE_11AC_VHT80_2G = 0x800000, /* 2Ghz, VHT80 */
  4171. };
  4172.  
  4173. #define REGDMN_MODE_ALL (0xFFFFFFFF) /* REGDMN_MODE_ALL is defined out of the enum
  4174. @@ -298,8 +297,6 @@ typedef A_UINT8 A_RATE;
  4175. #error "Extend rate table module first"
  4176. #endif
  4177.  
  4178. -#define MAX_IBSS_PEERS 32
  4179. -
  4180. #if defined(CONFIG_AR900B_SUPPORT) || defined(AR900B)
  4181. typedef struct{
  4182. A_UINT32 psdu_len [NUM_DYN_BW * NUM_SCHED_ENTRIES];
  4183. @@ -365,7 +362,6 @@ typedef struct{
  4184. A_UINT8 sh_pream;
  4185. A_UINT8 bw_in_service;
  4186. A_RATE probe_rix;
  4187. - A_UINT8 dd_profile;
  4188. } RC_TX_RATE_INFO;
  4189.  
  4190. /*
  4191. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wlan_module_ids.h b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wlan_module_ids.h
  4192. index 8596a8c..348085d 100644
  4193. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wlan_module_ids.h
  4194. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wlan_module_ids.h
  4195. @@ -86,8 +86,6 @@ typedef enum {
  4196. WLAN_MODULE_UNIT_TEST,
  4197. WLAN_MODULE_MLME,
  4198. WLAN_MODULE_SUPPL,
  4199. - WLAN_MODULE_ERE,
  4200. - WLAN_MODULE_OCB,
  4201. WLAN_MODULE_ID_MAX,
  4202. WLAN_MODULE_ID_INVALID = WLAN_MODULE_ID_MAX,
  4203. } WLAN_MODULE_ID;
  4204. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wmi_tlv_defs.h b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wmi_tlv_defs.h
  4205. index 15d29c3..84114d4 100644
  4206. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wmi_tlv_defs.h
  4207. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wmi_tlv_defs.h
  4208. @@ -557,21 +557,6 @@ typedef enum {
  4209. WMITLV_TAG_STRUC_wmi_extscan_hotlist_ssid_match_event_fixed_param,
  4210. WMITLV_TAG_STRUC_wmi_vdev_tsf_tstamp_action_cmd_fixed_param,
  4211. WMITLV_TAG_STRUC_wmi_vdev_tsf_report_event_fixed_param,
  4212. - WMITLV_TAG_STRUC_wmi_get_fw_mem_dump_fixed_param,
  4213. - WMITLV_TAG_STRUC_wmi_update_fw_mem_dump_fixed_param,
  4214. - WMITLV_TAG_STRUC_wmi_fw_mem_dump_params,
  4215. - WMITLV_TAG_STRUC_wmi_debug_mesg_flush_fixed_param,
  4216. - WMITLV_TAG_STRUC_wmi_debug_mesg_flush_complete_fixed_param,
  4217. - WMITLV_TAG_STRUC_wmi_peer_set_rate_report_condition_fixed_param,
  4218. - WMITLV_TAG_STRUC_wmi_roam_subnet_change_config_fixed_param,
  4219. - WMITLV_TAG_STRUC_wmi_vdev_set_ie_cmd_fixed_param,
  4220. - WMITLV_TAG_STRUC_wmi_rssi_breach_monitor_config_fixed_param,
  4221. - WMITLV_TAG_STRUC_wmi_rssi_breach_event_fixed_param,
  4222. - WMITLV_TAG_STRUC_WOW_EVENT_INITIAL_WAKEUP_fixed_param,
  4223. - WMITLV_TAG_STRUC_wmi_soc_set_pcl_cmd_fixed_param,
  4224. - WMITLV_TAG_STRUC_wmi_soc_set_hw_mode_cmd_fixed_param,
  4225. - WMITLV_TAG_STRUC_wmi_soc_set_hw_mode_response_event_fixed_param,
  4226. - WMITLV_TAG_STRUC_wmi_soc_hw_mode_transition_event_fixed_param,
  4227. } WMITLV_TAG_ID;
  4228.  
  4229. /*
  4230. @@ -784,15 +769,7 @@ typedef enum {
  4231. OP(WMI_DCC_UPDATE_NDL_CMDID) \
  4232. OP(WMI_ROAM_FILTER_CMDID) \
  4233. OP(WMI_PASSPOINT_LIST_CONFIG_CMDID) \
  4234. - OP(WMI_VDEV_TSF_TSTAMP_ACTION_CMDID) \
  4235. - OP(WMI_GET_FW_MEM_DUMP_CMDID) \
  4236. - OP(WMI_DEBUG_MESG_FLUSH_CMDID) \
  4237. - OP(WMI_PEER_SET_RATE_REPORT_CONDITION_CMDID) \
  4238. - OP(WMI_ROAM_SUBNET_CHANGE_CONFIG_CMDID) \
  4239. - OP(WMI_VDEV_SET_IE_CMDID) \
  4240. - OP(WMI_RSSI_BREACH_MONITOR_CONFIG_CMDID) \
  4241. - OP(WMI_SOC_SET_PCL_CMDID) \
  4242. - OP(WMI_SOC_SET_HW_MODE_CMDID)
  4243. + OP(WMI_VDEV_TSF_TSTAMP_ACTION_CMDID)
  4244.  
  4245. /*
  4246. * IMPORTANT: Please add _ALL_ WMI Events Here.
  4247. @@ -895,13 +872,7 @@ typedef enum {
  4248. OP(WMI_DCC_UPDATE_NDL_RESP_EVENTID) \
  4249. OP(WMI_DCC_STATS_EVENTID) \
  4250. OP(WMI_PASSPOINT_MATCH_EVENTID) \
  4251. - OP(WMI_VDEV_TSF_REPORT_EVENTID) \
  4252. - OP(WMI_UPDATE_FW_MEM_DUMP_EVENTID) \
  4253. - OP(WMI_DEBUG_MESG_FLUSH_COMPLETE_EVENTID) \
  4254. - OP(WMI_RSSI_BREACH_EVENTID)\
  4255. - OP(WMI_WOW_INITIAL_WAKEUP_EVENTID) \
  4256. - OP(WMI_SOC_SET_HW_MODE_RESP_EVENTID) \
  4257. - OP(WMI_SOC_HW_MODE_TRANSITION_EVENTID)
  4258. + OP(WMI_VDEV_TSF_REPORT_EVENTID)
  4259.  
  4260. /* TLV definitions of WMI commands */
  4261.  
  4262. @@ -1249,13 +1220,6 @@ WMITLV_CREATE_PARAM_STRUC(WMI_VDEV_IPSEC_NATKEEPALIVE_FILTER_CMDID);
  4263.  
  4264. WMITLV_CREATE_PARAM_STRUC(WMI_PEER_ASSOC_CMDID);
  4265.  
  4266. -/* Peer Set Rate Report Condition Cmd */
  4267. -#define WMITLV_TABLE_WMI_PEER_SET_RATE_REPORT_CONDITION_CMDID(id,op,buf,len) \
  4268. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_peer_set_rate_report_condition_fixed_param, wmi_peer_set_rate_report_condition_fixed_param, fixed_param, WMITLV_SIZE_FIX)
  4269. -
  4270. -WMITLV_CREATE_PARAM_STRUC(WMI_PEER_SET_RATE_REPORT_CONDITION_CMDID);
  4271. -
  4272. -
  4273. /* Add Beacon filter Cmd */
  4274. #define WMITLV_TABLE_WMI_ADD_BCN_FILTER_CMDID(id,op,buf,len) \
  4275. WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_add_bcn_filter_cmd_fixed_param, wmi_add_bcn_filter_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
  4276. @@ -1348,22 +1312,6 @@ WMITLV_CREATE_PARAM_STRUC(WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID);
  4277.  
  4278. WMITLV_CREATE_PARAM_STRUC(WMI_REQUEST_STATS_CMDID);
  4279.  
  4280. -
  4281. -/* Request for memory dump stats Cmd */
  4282. -#define WMITLV_TABLE_WMI_GET_FW_MEM_DUMP_CMDID(id,op,buf,len) \
  4283. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_get_fw_mem_dump_fixed_param, wmi_get_fw_mem_dump_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
  4284. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_fw_mem_dump, fw_mem_dump_params, WMITLV_SIZE_VAR)
  4285. -
  4286. -WMITLV_CREATE_PARAM_STRUC(WMI_GET_FW_MEM_DUMP_CMDID);
  4287. -
  4288. -/* flush debug messages */
  4289. -#define WMITLV_TABLE_WMI_DEBUG_MESG_FLUSH_CMDID(id,op,buf,len) \
  4290. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_debug_mesg_flush_fixed_param, wmi_debug_mesg_flush_fixed_param, fixed_param, WMITLV_SIZE_FIX)
  4291. -
  4292. -WMITLV_CREATE_PARAM_STRUC(WMI_DEBUG_MESG_FLUSH_CMDID);
  4293. -
  4294. -
  4295. -
  4296. /* Set config params */
  4297. #define WMITLV_TABLE_WMI_START_LINK_STATS_CMDID(id,op,buf,len) \
  4298. WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_start_link_stats_cmd_fixed_param, wmi_start_link_stats_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX)
  4299. @@ -2083,16 +2031,11 @@ WMITLV_CREATE_PARAM_STRUC(WMI_D0_WOW_ENABLE_DISABLE_CMDID);
  4300. WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_pdev_get_temperature_cmd_fixed_param, wmi_pdev_get_temperature_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX)
  4301. WMITLV_CREATE_PARAM_STRUC(WMI_PDEV_GET_TEMPERATURE_CMDID);
  4302.  
  4303. -/* Set antenna diversity Cmd */
  4304. +/* Set antenna diversiry Cmd */
  4305. #define WMITLV_TABLE_WMI_SET_ANTENNA_DIVERSITY_CMDID(id,op,buf,len) \
  4306. WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_pdev_set_antenna_diversity_cmd_fixed_param, wmi_pdev_set_antenna_diversity_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX)
  4307. WMITLV_CREATE_PARAM_STRUC(WMI_SET_ANTENNA_DIVERSITY_CMDID);
  4308.  
  4309. -/* Set rssi monitoring config Cmd */
  4310. -#define WMITLV_TABLE_WMI_RSSI_BREACH_MONITOR_CONFIG_CMDID(id,op,buf,len) \
  4311. -WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_rssi_breach_monitor_config_fixed_param, wmi_rssi_breach_monitor_config_fixed_param, fixed_param, WMITLV_SIZE_FIX)
  4312. -WMITLV_CREATE_PARAM_STRUC(WMI_RSSI_BREACH_MONITOR_CONFIG_CMDID);
  4313. -
  4314. /* DHCP server offload param Cmd */
  4315. #define WMITLV_TABLE_WMI_SET_DHCP_SERVER_OFFLOAD_CMDID(id,op,buf,len) \
  4316. WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_set_dhcp_server_offload_cmd_fixed_param, wmi_set_dhcp_server_offload_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX)
  4317. @@ -2215,24 +2158,6 @@ WMITLV_CREATE_PARAM_STRUC(WMI_ROAM_FILTER_CMDID);
  4318. WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_vdev_tsf_tstamp_action_cmd_fixed_param, wmi_vdev_tsf_tstamp_action_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX)
  4319. WMITLV_CREATE_PARAM_STRUC(WMI_VDEV_TSF_TSTAMP_ACTION_CMDID);
  4320.  
  4321. -/* LFR subnet change config Cmd */
  4322. -#define WMITLV_TABLE_WMI_ROAM_SUBNET_CHANGE_CONFIG_CMDID(id,op,buf,len) \
  4323. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_roam_subnet_change_config_fixed_param, wmi_roam_subnet_change_config_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
  4324. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_FIXED_STRUC, wmi_mac_addr, skip_subnet_change_detection_bssid_list, WMITLV_SIZE_VAR)
  4325. -
  4326. -WMITLV_CREATE_PARAM_STRUC(WMI_ROAM_SUBNET_CHANGE_CONFIG_CMDID);
  4327. -
  4328. -/* Set the SOC Preferred Channel List (PCL) Cmd */
  4329. -#define WMITLV_TABLE_WMI_SOC_SET_PCL_CMDID(id,op,buf,len) \
  4330. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_soc_set_pcl_cmd_fixed_param, wmi_soc_set_pcl_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
  4331. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_UINT32, A_UINT32, channel_list, WMITLV_SIZE_VAR)
  4332. -WMITLV_CREATE_PARAM_STRUC(WMI_SOC_SET_PCL_CMDID);
  4333. -
  4334. -/* Set the SOC Hardware Mode Cmd */
  4335. -#define WMITLV_TABLE_WMI_SOC_SET_HW_MODE_CMDID(id,op,buf,len) \
  4336. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_soc_set_hw_mode_cmd_fixed_param, wmi_soc_set_hw_mode_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX)
  4337. -WMITLV_CREATE_PARAM_STRUC(WMI_SOC_SET_HW_MODE_CMDID);
  4338. -
  4339. /************************** TLV definitions of WMI events *******************************/
  4340.  
  4341. /* Service Ready event */
  4342. @@ -2240,8 +2165,7 @@ WMITLV_CREATE_PARAM_STRUC(WMI_SOC_SET_HW_MODE_CMDID);
  4343. WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_service_ready_event_fixed_param, wmi_service_ready_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
  4344. WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_HAL_REG_CAPABILITIES, HAL_REG_CAPABILITIES, hal_reg_capabilities, WMITLV_SIZE_FIX) \
  4345. WMITLV_FXAR(id,op,buf,len, WMITLV_TAG_ARRAY_UINT32, A_UINT32, wmi_service_bitmap, WMITLV_SIZE_FIX, WMI_SERVICE_BM_SIZE) \
  4346. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wlan_host_mem_req, mem_reqs, WMITLV_SIZE_VAR) \
  4347. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_UINT32, A_UINT32, wlan_dbs_hw_mode_list, WMITLV_SIZE_VAR)
  4348. + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wlan_host_mem_req, mem_reqs, WMITLV_SIZE_VAR)
  4349. WMITLV_CREATE_PARAM_STRUC(WMI_SERVICE_READY_EVENTID);
  4350.  
  4351. /* Ready event */
  4352. @@ -2405,8 +2329,7 @@ WMITLV_CREATE_PARAM_STRUC(WMI_ROAM_EVENTID);
  4353. WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, bcn_probe_rsp_frame, WMITLV_SIZE_VAR) \
  4354. WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, reassoc_rsp_frame, WMITLV_SIZE_VAR) \
  4355. WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_channel, wmi_channel, chan, WMITLV_SIZE_FIX) \
  4356. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_key_material, key, WMITLV_SIZE_VAR) \
  4357. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_UINT32, A_UINT32, status, WMITLV_SIZE_FIX)
  4358. + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_key_material, key, WMITLV_SIZE_VAR)
  4359. WMITLV_CREATE_PARAM_STRUC(WMI_ROAM_SYNCH_EVENTID);
  4360.  
  4361. /* WOW Wakeup Host Event */
  4362. @@ -2420,10 +2343,6 @@ WMITLV_CREATE_PARAM_STRUC(WMI_ROAM_SYNCH_EVENTID);
  4363.  
  4364. WMITLV_CREATE_PARAM_STRUC(WMI_WOW_WAKEUP_HOST_EVENTID);
  4365.  
  4366. -#define WMITLV_TABLE_WMI_WOW_INITIAL_WAKEUP_EVENTID(id,op,buf,len) \
  4367. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_WOW_EVENT_INITIAL_WAKEUP_fixed_param, WOW_INITIAL_WAKEUP_EVENT_fixed_param, fixed_param, WMITLV_SIZE_FIX)
  4368. -WMITLV_CREATE_PARAM_STRUC(WMI_WOW_INITIAL_WAKEUP_EVENTID);
  4369. -
  4370. /* RTT error report Event */
  4371. #define WMITLV_TABLE_WMI_RTT_ERROR_REPORT_EVENTID(id,op,buf,len) \
  4372. WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, data, WMITLV_SIZE_VAR)
  4373. @@ -2465,14 +2384,6 @@ WMITLV_CREATE_PARAM_STRUC(WMI_RFKILL_STATE_CHANGE_EVENTID);
  4374. WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, bufp, WMITLV_SIZE_VAR)
  4375. WMITLV_CREATE_PARAM_STRUC(WMI_DEBUG_MESG_EVENTID);
  4376.  
  4377. -#define WMITLV_TABLE_WMI_DEBUG_MESG_FLUSH_COMPLETE_EVENTID(id,op,buf,len)\
  4378. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_debug_mesg_flush_complete_fixed_param, wmi_debug_mesg_flush_complete_fixed_param, fixed_param, WMITLV_SIZE_FIX)
  4379. -WMITLV_CREATE_PARAM_STRUC(WMI_DEBUG_MESG_FLUSH_COMPLETE_EVENTID);
  4380. -
  4381. -#define WMITLV_TABLE_WMI_RSSI_BREACH_EVENTID(id,op,buf,len)\
  4382. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_rssi_breach_event_fixed_param, wmi_rssi_breach_event_fixed_param, fixed_param, WMITLV_SIZE_FIX)
  4383. -WMITLV_CREATE_PARAM_STRUC(WMI_RSSI_BREACH_EVENTID);
  4384. -
  4385. /* Diagnostics Event */
  4386. #define WMITLV_TABLE_WMI_DIAG_EVENTID(id,op,buf,len)\
  4387. WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, bufp, WMITLV_SIZE_VAR)
  4388. @@ -2546,14 +2457,6 @@ WMITLV_CREATE_PARAM_STRUC(WMI_UPDATE_STATS_EVENTID);
  4389. WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_vdev_rate_stats_event_fixed_param, wmi_vdev_rate_stats_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
  4390. WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_vdev_rate_ht_info, ht_info, WMITLV_SIZE_VAR)
  4391. WMITLV_CREATE_PARAM_STRUC(WMI_UPDATE_VDEV_RATE_STATS_EVENTID);
  4392. -
  4393. -
  4394. -/* Update memory dump complete Event */
  4395. -#define WMITLV_TABLE_WMI_UPDATE_FW_MEM_DUMP_EVENTID(id,op,buf,len)\
  4396. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_update_fw_mem_dump_fixed_param, wmi_update_fw_mem_dump_fixed_param, fixed_param, WMITLV_SIZE_FIX)
  4397. -
  4398. -WMITLV_CREATE_PARAM_STRUC(WMI_UPDATE_FW_MEM_DUMP_EVENTID);
  4399. -
  4400. /* Update iface link stats Event */
  4401. #define WMITLV_TABLE_WMI_IFACE_LINK_STATS_EVENTID(id,op,buf,len)\
  4402. WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_iface_link_stats_event_fixed_param, wmi_iface_link_stats_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
  4403. @@ -2788,23 +2691,6 @@ WMITLV_CREATE_PARAM_STRUC(WMI_DCC_STATS_EVENTID);
  4404. WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_vdev_tsf_report_event_fixed_param, wmi_vdev_tsf_report_event_fixed_param, fixed_param, WMITLV_SIZE_FIX)
  4405. WMITLV_CREATE_PARAM_STRUC(WMI_VDEV_TSF_REPORT_EVENTID);
  4406.  
  4407. -/* Vdev capabilities IE to be transmitted in mgmt frames */
  4408. -#define WMITLV_TABLE_WMI_VDEV_SET_IE_CMDID(id,op,buf,len) \
  4409. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_vdev_set_ie_cmd_fixed_param, wmi_vdev_set_ie_cmd_fixed_param, vdev_ie, WMITLV_SIZE_FIX) \
  4410. - WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, bufp, WMITLV_SIZE_VAR)
  4411. -WMITLV_CREATE_PARAM_STRUC(WMI_VDEV_SET_IE_CMDID);
  4412. -
  4413. -/* SOC Set Hardware Mode Response event */
  4414. -#define WMITLV_TABLE_WMI_SOC_SET_HW_MODE_RESP_EVENTID(id,op,buf,len) \
  4415. -WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_soc_set_hw_mode_response_event_fixed_param, wmi_soc_set_hw_mode_response_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
  4416. -WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_soc_set_hw_mode_response_vdev_mac_entry, wmi_soc_set_hw_mode_response_vdev_mac_mapping, WMITLV_SIZE_VAR)
  4417. -WMITLV_CREATE_PARAM_STRUC(WMI_SOC_SET_HW_MODE_RESP_EVENTID);
  4418. -
  4419. -/* SOC Hardware Mode Transition event */
  4420. -#define WMITLV_TABLE_WMI_SOC_HW_MODE_TRANSITION_EVENTID(id,op,buf,len) \
  4421. -WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_soc_hw_mode_transition_event_fixed_param, wmi_soc_hw_mode_transition_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
  4422. -WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_soc_set_hw_mode_response_vdev_mac_entry, wmi_soc_set_hw_mode_response_vdev_mac_mapping, WMITLV_SIZE_VAR)
  4423. -WMITLV_CREATE_PARAM_STRUC(WMI_SOC_HW_MODE_TRANSITION_EVENTID);
  4424. #ifdef __cplusplus
  4425. }
  4426. #endif
  4427. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wmi_unified.h b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wmi_unified.h
  4428. index 4819fa5..75e7a08 100644
  4429. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wmi_unified.h
  4430. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wmi_unified.h
  4431. @@ -121,7 +121,7 @@ extern "C" {
  4432. (((num_entries) / (32 / (bits_per_entry))) + \
  4433. (((num_entries) % (32 / (bits_per_entry))) ? 1 : 0))
  4434.  
  4435. -static INLINE A_UINT32 wmi_packed_arr_get_bits(A_UINT32 *arr,
  4436. +static inline A_UINT32 wmi_packed_arr_get_bits(A_UINT32 *arr,
  4437. A_UINT32 entry_index, A_UINT32 bits_per_entry)
  4438. {
  4439. A_UINT32 entries_per_uint = (32 / bits_per_entry);
  4440. @@ -133,7 +133,7 @@ static INLINE A_UINT32 wmi_packed_arr_get_bits(A_UINT32 *arr,
  4441. (( 1 << bits_per_entry) - 1));
  4442. }
  4443.  
  4444. -static INLINE void wmi_packed_arr_set_bits(A_UINT32 *arr, A_UINT32 entry_index,
  4445. +static inline void wmi_packed_arr_set_bits(A_UINT32 *arr, A_UINT32 entry_index,
  4446. A_UINT32 bits_per_entry, A_UINT32 val)
  4447. {
  4448. A_UINT32 entries_per_uint = (32 / bits_per_entry);
  4449. @@ -228,7 +228,6 @@ typedef enum {
  4450. WMI_GRP_MDNS_OFL,
  4451. WMI_GRP_SAP_OFL,
  4452. WMI_GRP_OCB,
  4453. - WMI_GRP_SOC,
  4454. } WMI_GRP_ID;
  4455.  
  4456. #define WMI_CMD_GRP_START_ID(grp_id) (((grp_id) << 12) | 0x1)
  4457. @@ -332,9 +331,6 @@ typedef enum {
  4458. WMI_VDEV_PLMREQ_STOP_CMDID,
  4459. /* TSF timestamp action for specified vdev */
  4460. WMI_VDEV_TSF_TSTAMP_ACTION_CMDID,
  4461. - /** set the capabilties IE, e.g. for extended caps in probe requests,
  4462. - * assoc req etc for frames FW locally generates */
  4463. - WMI_VDEV_SET_IE_CMDID,
  4464.  
  4465. /* peer specific commands */
  4466.  
  4467. @@ -361,10 +357,6 @@ typedef enum {
  4468. * WMI_PEER_ESTIMATED_LINKSPEED_EVENTID.
  4469. */
  4470. WMI_PEER_GET_ESTIMATED_LINKSPEED_CMDID,
  4471. - /** Set the conditions to report peer justified rate to driver
  4472. - * The justified rate means the the user-rate is justified by PER.
  4473. - */
  4474. - WMI_PEER_SET_RATE_REPORT_CONDITION_CMDID,
  4475.  
  4476. /* beacon/management specific commands */
  4477.  
  4478. @@ -442,8 +434,6 @@ typedef enum {
  4479. WMI_ROAM_INVOKE_CMDID,
  4480. /** roaming filter cmd to allow further filtering of roaming candidate */
  4481. WMI_ROAM_FILTER_CMDID,
  4482. - /** set gateway ip, mac and retries for subnet change detection */
  4483. - WMI_ROAM_SUBNET_CHANGE_CONFIG_CMDID,
  4484.  
  4485. /** offload scan specific commands */
  4486. /** set offload scan AP profile */
  4487. @@ -559,12 +549,6 @@ typedef enum {
  4488. /** Request to clear stats*/
  4489. WMI_CLEAR_LINK_STATS_CMDID,
  4490.  
  4491. - /** Request for getting the Firmware Memory Dump */
  4492. - WMI_GET_FW_MEM_DUMP_CMDID,
  4493. -
  4494. - /** Request to flush of the buffered debug messages */
  4495. - WMI_DEBUG_MESG_FLUSH_CMDID,
  4496. -
  4497. /** ARP OFFLOAD REQUEST*/
  4498. WMI_SET_ARP_NS_OFFLOAD_CMDID=WMI_CMD_GRP_START_ID(WMI_GRP_ARP_NS_OFL),
  4499.  
  4500. @@ -654,8 +638,7 @@ typedef enum {
  4501. WMI_SET_ANTENNA_DIVERSITY_CMDID,
  4502. /** Set OCB Sched Request, deprecated */
  4503. WMI_OCB_SET_SCHED_CMDID,
  4504. - /** Set rssi monitoring config command */
  4505. - WMI_RSSI_BREACH_MONITOR_CONFIG_CMDID,
  4506. +
  4507. /* GPIO Configuration */
  4508. WMI_GPIO_CONFIG_CMDID=WMI_CMD_GRP_START_ID(WMI_GRP_GPIO),
  4509. WMI_GPIO_OUTPUT_CMDID,
  4510. @@ -793,9 +776,6 @@ typedef enum {
  4511. WMI_DCC_GET_STATS_CMDID,
  4512. WMI_DCC_CLEAR_STATS_CMDID,
  4513. WMI_DCC_UPDATE_NDL_CMDID,
  4514. - /* System-On-Chip commands */
  4515. - WMI_SOC_SET_PCL_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_SOC),
  4516. - WMI_SOC_SET_HW_MODE_CMDID,
  4517.  
  4518. } WMI_CMD_ID;
  4519.  
  4520. @@ -921,7 +901,6 @@ typedef enum {
  4521. will cary wake reason */
  4522. WMI_WOW_WAKEUP_HOST_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_WOW),
  4523. WMI_D0_WOW_DISABLE_ACK_EVENTID,
  4524. - WMI_WOW_INITIAL_WAKEUP_EVENTID,
  4525.  
  4526. /*RTT related event ID*/
  4527. /** RTT measurement report */
  4528. @@ -940,9 +919,6 @@ typedef enum {
  4529. /** FW Update radio stats Event */
  4530. WMI_RADIO_LINK_STATS_EVENTID,
  4531.  
  4532. - /** Firmware memory dump Complete event*/
  4533. - WMI_UPDATE_FW_MEM_DUMP_EVENTID,
  4534. -
  4535. /*NLO specific events*/
  4536. /** NLO match event after the first match */
  4537. WMI_NLO_MATCH_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_NLO_OFL),
  4538. @@ -1020,12 +996,6 @@ typedef enum {
  4539. /** Set OCB Sched Response, deprecated */
  4540. WMI_OCB_SET_SCHED_EVENTID,
  4541.  
  4542. - /** event to indicate the flush of the buffered debug messages is complete*/
  4543. - WMI_DEBUG_MESG_FLUSH_COMPLETE_EVENTID,
  4544. -
  4545. - /** event to report mix/max RSSI breach events */
  4546. - WMI_RSSI_BREACH_EVENTID,
  4547. -
  4548. /* GPIO Event */
  4549. WMI_GPIO_INPUT_EVENTID=WMI_EVT_GRP_START_ID(WMI_GRP_GPIO),
  4550. /** upload H_CV info WMI event
  4551. @@ -1085,10 +1055,6 @@ typedef enum {
  4552. WMI_DCC_GET_STATS_RESP_EVENTID,
  4553. WMI_DCC_UPDATE_NDL_RESP_EVENTID,
  4554. WMI_DCC_STATS_EVENTID,
  4555. -
  4556. - /* System-On-Chip events */
  4557. - WMI_SOC_SET_HW_MODE_RESP_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_SOC),
  4558. - WMI_SOC_HW_MODE_TRANSITION_EVENTID,
  4559. } WMI_EVT_ID;
  4560.  
  4561. /* defines for OEM message sub-types */
  4562. @@ -1100,8 +1066,6 @@ typedef enum {
  4563. #define WMI_OEM_NAN_MEAS_REQ 0x06
  4564. #define WMI_OEM_NAN_MEAS_RSP 0x07
  4565. #define WMI_OEM_NAN_PEER_INFO 0x08
  4566. -#define WMI_OEM_CONFIGURE_LCR 0x09
  4567. -#define WMI_OEM_CONFIGURE_LCI 0x0A
  4568.  
  4569.  
  4570. /* below message subtype is internal to CLD. Target should
  4571. @@ -1191,7 +1155,6 @@ WMI_CHANNEL_CHANGE_CAUSE_CSA,
  4572. } while(0)
  4573. #define WMI_GET_CHANNEL_ANTENNA_MAX(pwmi_channel) ((pwmi_channel)->reg_info_2 & 0xff )
  4574.  
  4575. -/* max tx power is in 1 dBm units */
  4576. #define WMI_SET_CHANNEL_MAX_TX_POWER(pwmi_channel,val) do { \
  4577. (pwmi_channel)->reg_info_2 &= 0xffff00ff; \
  4578. (pwmi_channel)->reg_info_2 |= ((val&0xff)<<8); \
  4579. @@ -1281,62 +1244,6 @@ WMI_CHANNEL_CHANGE_CAUSE_CSA,
  4580. #define WMI_SYS_CAP_ENABLE 0x00000001
  4581. #define WMI_SYS_CAP_TXPOWER 0x00000002
  4582.  
  4583. -/*
  4584. - * WMI Dual Band Simultaneous (DBS) hardware mode list bit-mask definitions.
  4585. - * Bits 5:0 are reserved
  4586. - */
  4587. -#define WMI_DBS_HW_MODE_MAC0_TX_STREAMS_BITPOS (28)
  4588. -#define WMI_DBS_HW_MODE_MAC0_RX_STREAMS_BITPOS (24)
  4589. -#define WMI_DBS_HW_MODE_MAC1_TX_STREAMS_BITPOS (20)
  4590. -#define WMI_DBS_HW_MODE_MAC1_RX_STREAMS_BITPOS (16)
  4591. -#define WMI_DBS_HW_MODE_MAC0_BANDWIDTH_BITPOS (12)
  4592. -#define WMI_DBS_HW_MODE_MAC1_BANDWIDTH_BITPOS (8)
  4593. -#define WMI_DBS_HW_MODE_DBS_MODE_BITPOS (7)
  4594. -#define WMI_DBS_HW_MODE_AGILE_DFS_MODE_BITPOS (6)
  4595. -
  4596. -#define WMI_DBS_HW_MODE_MAC0_TX_STREAMS_MASK (0xf << WMI_DBS_HW_MODE_MAC0_TX_STREAMS_BITPOS)
  4597. -#define WMI_DBS_HW_MODE_MAC0_RX_STREAMS_MASK (0xf << WMI_DBS_HW_MODE_MAC0_RX_STREAMS_BITPOS)
  4598. -#define WMI_DBS_HW_MODE_MAC1_TX_STREAMS_MASK (0xf << WMI_DBS_HW_MODE_MAC1_TX_STREAMS_BITPOS)
  4599. -#define WMI_DBS_HW_MODE_MAC1_RX_STREAMS_MASK (0xf << WMI_DBS_HW_MODE_MAC1_RX_STREAMS_BITPOS)
  4600. -#define WMI_DBS_HW_MODE_MAC0_BANDWIDTH_MASK (0xf << WMI_DBS_HW_MODE_MAC0_BANDWIDTH_BITPOS)
  4601. -#define WMI_DBS_HW_MODE_MAC1_BANDWIDTH_MASK (0xf << WMI_DBS_HW_MODE_MAC1_BANDWIDTH_BITPOS)
  4602. -#define WMI_DBS_HW_MODE_DBS_MODE_MASK (0x1 << WMI_DBS_HW_MODE_DBS_MODE_BITPOS)
  4603. -#define WMI_DBS_HW_MODE_AGILE_DFS_MODE_MASK (0x1 << WMI_DBS_HW_MODE_AGILE_DFS_MODE_BITPOS)
  4604. -
  4605. -#define WMI_DBS_HW_MODE_MAC0_TX_STREAMS_SET(hw_mode, value) \
  4606. - (hw_mode |= ((value << WMI_DBS_HW_MODE_MAC0_TX_STREAMS_BITPOS) & WMI_DBS_HW_MODE_MAC0_TX_STREAMS_MASK))
  4607. -#define WMI_DBS_HW_MODE_MAC0_RX_STREAMS_SET(hw_mode, value) \
  4608. - (hw_mode != ((value << WMI_DBS_HW_MODE_MAC0_RX_STREAMS_BITPOS) & WMI_DBS_HW_MODE_MAC0_RX_STREAMS_MASK))
  4609. -#define WMI_DBS_HW_MODE_MAC1_TX_STREAMS_SET(hw_mode, value) \
  4610. - (hw_mode |= ((value << WMI_DBS_HW_MODE_MAC1_TX_STREAMS_BITPOS) & WMI_DBS_HW_MODE_MAC1_TX_STREAMS_MASK))
  4611. -#define WMI_DBS_HW_MODE_MAC1_RX_STREAMS_SET(hw_mode, value) \
  4612. - (hw_mode |= ((value << WMI_DBS_HW_MODE_MAC1_RX_STREAMS_BITPOS) & WMI_DBS_HW_MODE_MAC1_RX_STREAMS_MASK))
  4613. -#define WMI_DBS_HW_MODE_MAC0_BANDWIDTH_SET(hw_mode, value) \
  4614. - (hw_mode |= ((value << WMI_DBS_HW_MODE_MAC0_BANDWIDTH_BITPOS) & WMI_DBS_HW_MODE_MAC0_BANDWIDTH_MASK))
  4615. -#define WMI_DBS_HW_MODE_MAC1_BANDWIDTH_SET(hw_mode, value) \
  4616. - (hw_mode |= ((value << WMI_DBS_HW_MODE_MAC1_BANDWIDTH_BITPOS) & WMI_DBS_HW_MODE_MAC1_BANDWIDTH_MASK))
  4617. -#define WMI_DBS_HW_MODE_DBS_MODE_SET(hw_mode, value) \
  4618. - (hw_mode |= ((value << WMI_DBS_HW_MODE_DBS_MODE_BITPOS) & WMI_DBS_HW_MODE_DBS_MODE_MASK))
  4619. -#define WMI_DBS_HW_MODE_AGILE_DFS_SET(hw_mode, value) \
  4620. - (hw_mode |= ((value << WMI_DBS_HW_MODE_AGILE_DFS_MODE_BITPOS) & WMI_DBS_HW_MODE_AGILE_DFS_MODE_MASK))
  4621. -
  4622. -#define WMI_DBS_HW_MODE_MAC0_TX_STREAMS_GET(hw_mode) \
  4623. - ((hw_mode & WMI_DBS_HW_MODE_MAC0_TX_STREAMS_MASK) >> WMI_DBS_HW_MODE_MAC0_TX_STREAMS_BITPOS)
  4624. -#define WMI_DBS_HW_MODE_MAC0_RX_STREAMS_GET(hw_mode) \
  4625. - ((hw_mode & WMI_DBS_HW_MODE_MAC0_RX_STREAMS_MASK) >> WMI_DBS_HW_MODE_MAC0_RX_STREAMS_BITPOS)
  4626. -#define WMI_DBS_HW_MODE_MAC1_TX_STREAMS_GET(hw_mode) \
  4627. - ((hw_mode & WMI_DBS_HW_MODE_MAC1_TX_STREAMS_MASK) >> WMI_DBS_HW_MODE_MAC1_TX_STREAMS_BITPOS)
  4628. -#define WMI_DBS_HW_MODE_MAC1_RX_STREAMS_GET(hw_mode) \
  4629. - ((hw_mode & WMI_DBS_HW_MODE_MAC1_RX_STREAMS_MASK) >> WMI_DBS_HW_MODE_MAC1_RX_STREAMS_BITPOS)
  4630. -#define WMI_DBS_HW_MODE_MAC0_BANDWIDTH_GET(hw_mode) \
  4631. - ((hw_mode & WMI_DBS_HW_MODE_MAC0_BANDWIDTH_MASK) >> WMI_DBS_HW_MODE_MAC0_BANDWIDTH_BITPOS)
  4632. -#define WMI_DBS_HW_MODE_MAC1_BANDWIDTH_GET(hw_mode) \
  4633. - ((hw_mode & WMI_DBS_HW_MODE_MAC1_BANDWIDTH_MASK) >> WMI_DBS_HW_MODE_MAC1_BANDWIDTH_BITPOS)
  4634. -#define WMI_DBS_HW_MODE_DBS_MODE_GET(hw_mode) \
  4635. - ((hw_mode & WMI_DBS_HW_MODE_DBS_MODE_MASK) >> WMI_DBS_HW_MODE_DBS_MODE_BITPOS)
  4636. -#define WMI_DBS_HW_MODE_AGILE_DFS_GET(hw_mode) \
  4637. - ((hw_mode & WMI_DBS_HW_MODE_AGILE_DFS_MODE_MASK) >> WMI_DBS_HW_MODE_AGILE_DFS_MODE_BITPOS)
  4638. -
  4639. /** NOTE: This structure cannot be extended in the future without breaking WMI compatibility */
  4640. typedef struct _wmi_abi_version {
  4641. A_UINT32 abi_version_0; /** WMI Major and Minor versions */
  4642. @@ -1406,43 +1313,14 @@ typedef struct {
  4643. */
  4644. A_UINT32 max_supported_macs;
  4645.  
  4646. - /*
  4647. - * FW sub-feature capabilities to be used in concurrence with wmi_service_bitmap
  4648. - */
  4649. - A_UINT32 wmi_fw_sub_feat_caps; //values from enum WMI_FW_SUB_FEAT_CAPS
  4650. -
  4651. - /*
  4652. - * Number of Dual Band Simultaneous (DBS) hardware modes
  4653. - */
  4654. - A_UINT32 num_dbs_hw_modes;
  4655. -
  4656. /* The TLVs for hal_reg_capabilities, wmi_service_bitmap and mem_reqs[] will follow this TLV.
  4657. * HAL_REG_CAPABILITIES hal_reg_capabilities;
  4658. * A_UINT32 wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
  4659. * wlan_host_mem_req mem_reqs[];
  4660. - * wlan_dbs_hw_mode_list[];
  4661. */
  4662. } wmi_service_ready_event_fixed_param;
  4663.  
  4664. typedef enum {
  4665. - WMI_FW_STA_RTT_INITR = 0x00000001,
  4666. - WMI_FW_STA_RTT_RESPR = 0x00000002,
  4667. - WMI_FW_P2P_CLI_RTT_INITR = 0x00000004,
  4668. - WMI_FW_P2P_CLI_RTT_RESPR = 0x00000008,
  4669. - WMI_FW_P2P_GO_RTT_INITR = 0x00000010,
  4670. - WMI_FW_P2P_GO_RTT_RESPR = 0x00000020,
  4671. - WMI_FW_AP_RTT_INITR = 0x00000040,
  4672. - WMI_FW_AP_RTT_RESPR = 0x00000080,
  4673. - WMI_FW_NAN_RTT_INITR = 0x00000100,
  4674. - WMI_FW_NAN_RTT_RESPR = 0x00000200,
  4675. - /*
  4676. - * New fw sub feature capabilites before
  4677. - * WMI_FW_MAX_SUB_FEAT_CAP
  4678. - */
  4679. - WMI_FW_MAX_SUB_FEAT_CAP = 0x80000000,
  4680. -} WMI_FW_SUB_FEAT_CAPS;
  4681. -
  4682. -typedef enum {
  4683. WMI_HWBD_NONE = 0, /* No hw board information is given */
  4684. WMI_HWBD_QCA6174 = 1, /* Rome(AR6320) */
  4685. WMI_HWBD_QCA2582 = 2, /* Killer 1525*/
  4686. @@ -1809,12 +1687,13 @@ typedef struct {
  4687. typedef struct {
  4688. /** WMI_CHAN_LIST_TAG */
  4689. A_UINT32 tag;
  4690. - /** # of channels to scan */
  4691. + /** # if channels to scan */
  4692. A_UINT32 num_chan;
  4693. /** channels in Mhz */
  4694. A_UINT32 channel_list[1];
  4695. } wmi_chan_list;
  4696.  
  4697. +
  4698. /**
  4699. * TLV for bssid list
  4700. */
  4701. @@ -2190,15 +2069,6 @@ typedef struct {
  4702. A_UINT32 flags;
  4703. /** combined RSSI, i.e. the sum of the snr + noise floor (dBm units) */
  4704. A_INT32 rssi;
  4705. - /** delta between local TSF(TSF timestamp when frame was RXd)
  4706. - * and remote TSF(TSF timestamp in the IE for mgmt frame -
  4707. - * beacon,proberesp for e.g). If remote TSF is not available,
  4708. - * delta set to 0.
  4709. - * Although tsf_delta is stored as A_UINT32, it can be negative,
  4710. - * and thus would need to be sign-extended if added to a value
  4711. - * larger than 32 bits.
  4712. - */
  4713. - A_UINT32 tsf_delta;
  4714.  
  4715. /* This TLV is followed by array of bytes:
  4716. * // management frame buffer
  4717. @@ -2679,28 +2549,6 @@ typedef enum {
  4718. WMI_PDEV_PARAM_VDEV_RATE_STATS_UPDATE_PERIOD,
  4719. /** Set CTS channel BW for dynamic BW adjustment feature */
  4720. WMI_PDEV_PARAM_CTS_CBW,
  4721. - /** Set GPIO pin info used by WNTS */
  4722. - WMI_PDEV_PARAM_WNTS_CONFIG,
  4723. - /** Enable/Disable hardware adaptive early rx feature */
  4724. - WMI_PDEV_PARAM_ADAPTIVE_EARLY_RX_ENABLE,
  4725. - /** The minimum early rx duration, to ensure early rx duration is non-zero */
  4726. - WMI_PDEV_PARAM_ADAPTIVE_EARLY_RX_MIN_SLEEP_SLOP,
  4727. - /** Increasing/decreasing step used by hardware */
  4728. - WMI_PDEV_PARAM_ADAPTIVE_EARLY_RX_INC_DEC_STEP,
  4729. - /** The fixed early rx duration when adaptive early rx is disabled */
  4730. - WMI_PDEV_PARAM_EARLY_RX_FIX_SLEEP_SLOP,
  4731. - /** Enable/Disable bmiss based adaptive beacon timeout feature */
  4732. - WMI_PDEV_PARAM_BMISS_BASED_ADAPTIVE_BTO_ENABLE,
  4733. - /** The minimum beacon timeout duration, to ensure beacon timeout duration is non-zero */
  4734. - WMI_PDEV_PARAM_BMISS_BTO_MIN_BCN_TIMEOUT,
  4735. - /** Increasing/decreasing step used by hardware */
  4736. - WMI_PDEV_PARAM_BMISS_BTO_INC_DEC_STEP,
  4737. - /** The fixed beacon timeout duration when bmiss based adaptive beacon timeout is disabled */
  4738. - WMI_PDEV_PARAM_BTO_FIX_BCN_TIMEOUT,
  4739. - /** Enable/Disable Congestion Estimator based adaptive beacon timeout feature */
  4740. - WMI_PDEV_PARAM_CE_BASED_ADAPTIVE_BTO_ENABLE,
  4741. - /** combo value of ce_id, ce_threshold, ce_time, refer to WMI_CE_BTO_CE_ID_MASK */
  4742. - WMI_PDEV_PARAM_CE_BTO_COMBO_CE_VALUE,
  4743. } WMI_PDEV_PARAM;
  4744.  
  4745. typedef enum {
  4746. @@ -2758,21 +2606,6 @@ typedef struct {
  4747. A_UINT32 value; /** bit0 is for enable/disable FAST diversity, and bit1 is for enable/disable SLOW diversity, 0->disable, 1->enable */
  4748. } wmi_pdev_set_antenna_diversity_cmd_fixed_param;
  4749.  
  4750. -#define WMI_MAX_RSSI_THRESHOLD_SUPPORTED 3
  4751. -
  4752. -typedef struct {
  4753. - A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_rssi_breach_monitor_config_cmd_fixed_param */
  4754. - A_UINT32 vdev_id; /* vdev_id, where RSSI monitoring will take place */
  4755. - A_UINT32 request_id; /* host will configure request_id and firmware echo this id in RSSI_BREACH_EVENT */
  4756. - A_UINT32 enabled_bitmap; /* bit [0-2] = low_rssi_breach_enabled[0-2] enabled, bit [3-5] = hi_rssi_breach_enabled[0-2] */
  4757. - A_UINT32 low_rssi_breach_threshold[WMI_MAX_RSSI_THRESHOLD_SUPPORTED]; /* unit dBm. host driver to make sure [0] > [1] > [2] */
  4758. - A_UINT32 hi_rssi_breach_threshold[WMI_MAX_RSSI_THRESHOLD_SUPPORTED]; /* unit dBm. host driver to make sure [0] < [1] < [2] */
  4759. - A_UINT32 lo_rssi_reenable_hysteresis; /* unit dBm. once low rssi[] breached, same event bitmap will be generated only after signal gets better than this level. This value is adopted for all low_rssi_breach_threshold[3] */
  4760. - A_UINT32 hi_rssi_reenable_histeresis;/* unit dBm. once hi rssi[] breached, same event bitmap will be generated only after signal gets worse than this level. This value is adopted for all hi_rssi_breach_threshold[3] */
  4761. - A_UINT32 min_report_interval; /* After last event is generated, we wait until this interval to generate next event */
  4762. - A_UINT32 max_num_report; /* this is to suppress number of event to be generated */
  4763. -} wmi_rssi_breach_monitor_config_fixed_param;
  4764. -
  4765. typedef struct {
  4766. /** parameter */
  4767. A_UINT32 param;
  4768. @@ -3095,66 +2928,6 @@ typedef struct {
  4769. /** Default value for stats if the stats collection has not started */
  4770. #define WMI_STATS_VALUE_INVALID 0xffffffff
  4771.  
  4772. -typedef struct {
  4773. - A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_debug_mesg_flush_fixed_param*/
  4774. - A_UINT32 reserved0; /** placeholder for future */
  4775. -} wmi_debug_mesg_flush_fixed_param;
  4776. -
  4777. -typedef struct {
  4778. - A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_debug_mesg_flush_complete_fixed_param*/
  4779. - A_UINT32 reserved0; /** placeholder for future */
  4780. -} wmi_debug_mesg_flush_complete_fixed_param;
  4781. -
  4782. -typedef struct {
  4783. - A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_rssi_breach_fixed_param */
  4784. - /* vdev_id, where RSSI breach event occurred */
  4785. - A_UINT32 vdev_id;
  4786. - /* request id */
  4787. - A_UINT32 request_id;
  4788. - /* bitmap[0-2] is corresponding to low_rssi[0-2]. bitmap[3-5] is corresponding to hi_rssi[0-2]*/
  4789. - A_UINT32 event_bitmap;
  4790. - /* rssi at the time of RSSI breach. Unit dBm */
  4791. - A_UINT32 rssi;
  4792. - /* bssid of the monitored AP's */
  4793. - wmi_mac_addr bssid;
  4794. -} wmi_rssi_breach_event_fixed_param;
  4795. -
  4796. -typedef struct {
  4797. - A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_fw_mem_dump */
  4798. - /** unique id identifying the segment */
  4799. - A_UINT32 seg_id;
  4800. - /** Start address of the segment to be read */
  4801. - A_UINT32 seg_start_addr_lo;
  4802. - A_UINT32 seg_start_addr_hi;
  4803. - /** Length of the segment to be read */
  4804. - A_UINT32 seg_length;
  4805. - /** Host bufeer address to which the segment will be read and dumped */
  4806. - A_UINT32 dest_addr_lo;
  4807. - A_UINT32 dest_addr_hi;
  4808. -} wmi_fw_mem_dump;
  4809. -
  4810. -/* Command to get firmware memory dump*/
  4811. -typedef struct {
  4812. - A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_get_fw_mem_dump_fixed_param */
  4813. - /** unique id identifying the request */
  4814. - A_UINT32 request_id;
  4815. - /** number of memory dump segments */
  4816. - A_UINT32 num_fw_mem_dump_segs;
  4817. -/**
  4818. - * This TLV is followed by another TLV
  4819. - * wmi_fw_mem_dump fw_mem_dump[];
  4820. - */
  4821. -} wmi_get_fw_mem_dump_fixed_param;
  4822. -
  4823. -/** Event to indicate the completion of fw mem dump */
  4824. -typedef struct {
  4825. - A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_update_fw_mem_dump_fixed_param */
  4826. - /** unique id identifying the request, given in the request stats command */
  4827. - A_UINT32 request_id;
  4828. - /*In case of Firmware memory dump */
  4829. - A_UINT32 fw_mem_dump_complete;
  4830. -} wmi_update_fw_mem_dump_fixed_param;
  4831. -
  4832. typedef enum {
  4833. WMI_ROAMING_IDLE = 0,
  4834. WMI_ROAMING_ACTIVE = 1,
  4835. @@ -4061,10 +3834,6 @@ typedef enum {
  4836. * beacon spread or average number of frames leaked */
  4837. WMI_VDEV_PARAM_STATS_AVG_FACTOR,
  4838.  
  4839. - /** disconnect threshold, once the consecutive error for specific peer
  4840. - * exceed this threhold, FW will send kickout event to host */
  4841. - WMI_VDEV_PARAM_DISCONNECT_TH,
  4842. -
  4843. } WMI_VDEV_PARAM;
  4844.  
  4845. /* Length of ATIM Window in TU */
  4846. @@ -4129,10 +3898,6 @@ typedef struct {
  4847. A_UINT32 smps_mode;
  4848. /** mac_id field contains the MAC identifier that the VDEV is bound to. The valid range is 0 to (num_macs-1). */
  4849. A_UINT32 mac_id;
  4850. - /** Configured Transmit Streams **/
  4851. - A_UINT32 cfgd_tx_streams;
  4852. - /** Configured Receive Streams **/
  4853. - A_UINT32 cfgd_rx_streams;
  4854. } wmi_vdev_start_response_event_fixed_param;
  4855.  
  4856. typedef struct {
  4857. @@ -4693,43 +4458,6 @@ typedef struct {
  4858.  
  4859. /* Peer Specific commands and events */
  4860.  
  4861. -typedef struct {
  4862. - A_UINT32 percentage; /* in unit of 12.5% */
  4863. - A_UINT32 min_delta; /* in unit of Mbps */
  4864. -} rate_delta_t;
  4865. -
  4866. -#define PEER_RATE_REPORT_COND_FLAG_DELTA 0x01
  4867. -#define PEER_RATE_REPORT_COND_FLAG_THRESHOLD 0x02
  4868. -#define MAX_NUM_OF_RATE_THRESH 4
  4869. -
  4870. -typedef struct {
  4871. - A_UINT32 val_cond_flags; /* PEER_RATE_REPORT_COND_FLAG_DELTA, PEER_RATE_REPORT_COND_FLAG_THRESHOLD
  4872. - Any of these two conditions or both of them can be set. */
  4873. - rate_delta_t rate_delta;
  4874. - A_UINT32 rate_threshold[MAX_NUM_OF_RATE_THRESH]; /* In unit of Mbps. There are at most 4 thresholds.
  4875. - If the threshold count is less than 4, set zero to
  4876. - the one following the last threshold */
  4877. -} report_cond_per_phy_t;
  4878. -
  4879. -
  4880. -enum peer_rate_report_cond_phy_type {
  4881. - PEER_RATE_REPORT_COND_11B = 0,
  4882. - PEER_RATE_REPORT_COND_11A_G,
  4883. - PEER_RATE_REPORT_COND_11N,
  4884. - PEER_RATE_REPORT_COND_11AC,
  4885. - PEER_RATE_REPORT_COND_MAX_NUM
  4886. -};
  4887. -
  4888. -typedef struct {
  4889. - A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_peer_rate_report_condtion_fixed_param */
  4890. - A_UINT32 enable_rate_report; /* 1= enable, 0=disable */
  4891. - A_UINT32 report_backoff_time; /* in unit of msecond */
  4892. - A_UINT32 report_timer_period; /* in unit of msecond */
  4893. - /* In the following field, the array index means the phy type,
  4894. - * please see enum peer_rate_report_cond_phy_type for detail */
  4895. - report_cond_per_phy_t cond_per_phy[PEER_RATE_REPORT_COND_MAX_NUM];
  4896. -} wmi_peer_set_rate_report_condition_fixed_param;
  4897. -
  4898. /* Peer Type:
  4899. * NB: This can be left DEFAULT for the normal case, and f/w will determine BSS type based
  4900. * on address and vdev opmode. This is largely here to allow host to indicate that
  4901. @@ -4885,8 +4613,6 @@ typedef struct {
  4902. A_UINT32 dtim_pwrsave_method;
  4903. /** DTIM PS value. Contents depends on the method */
  4904. A_UINT32 value;
  4905. - /** Modulated DTIM value */
  4906. - A_UINT32 MaxLIModulatedDTIM;
  4907. } wmi_sta_dtim_ps_method_cmd_fixed_param;
  4908.  
  4909. /*
  4910. @@ -5053,7 +4779,6 @@ typedef struct {
  4911. #define WMI_PEER_PMF 0x08000000 /* Robust Management Frame Protection enabled */
  4912. /** CAUTION TODO: Place holder for WLAN_PEER_F_PS_PRESEND_REQUIRED = 0x10000000. Need to be clean up */
  4913. #define WMI_PEER_IS_P2P_CAPABLE 0x20000000 /* P2P capable peer */
  4914. -#define WMI_PEER_160MHZ 0x40000000 /* 160 MHz enabled */
  4915. #define WMI_PEER_SAFEMODE_EN 0x80000000 /* Fips Mode Enabled */
  4916.  
  4917. /**
  4918. @@ -5773,13 +5498,6 @@ typedef struct {
  4919. */
  4920. } wmi_roam_invoke_cmd_fixed_param;
  4921.  
  4922. -/* Definition for op_bitmap */
  4923. -enum {
  4924. - ROAM_FILTER_OP_BITMAP_BLACK_LIST = 0x1,
  4925. - ROAM_FILTER_OP_BITMAP_WHITE_LIST = 0x2,
  4926. - ROAM_FILTER_OP_BITMAP_PREFER_BSSID = 0x4,
  4927. -};
  4928. -
  4929. typedef struct {
  4930. A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_roam_filter_list_fixed_param */
  4931. A_UINT32 vdev_id; /** Unique id identifying the VDEV on which roaming filter is adopted */
  4932. @@ -5798,75 +5516,6 @@ typedef struct {
  4933. */
  4934. } wmi_roam_filter_fixed_param;
  4935.  
  4936. -typedef struct {
  4937. - A_UINT8 address[4]; /* IPV4 address in Network Byte Order */
  4938. -} WMI_IPV4_ADDR;
  4939. -
  4940. -typedef struct _WMI_IPV6_ADDR {
  4941. - A_UINT8 address[16]; /* IPV6 in Network Byte Order */
  4942. -} WMI_IPV6_ADDR;
  4943. -
  4944. -/* flags for subnet change detection */
  4945. -#define WMI_ROAM_SUBNET_CHANGE_FLAG_IP4_ENABLED 0
  4946. -#define WMI_ROAM_SUBNET_CHANGE_FLAG_IP6_ENABLED 1
  4947. -/* bit 2 to bit 31 are reserved */
  4948. -
  4949. -/* set IPv4 enabled/disabled flag and get the flag */
  4950. -#define WMI_SET_ROAM_SUBNET_CHANGE_FLAG_IP4_ENABLED(flag) do { \
  4951. - (flag) |= (1 << WMI_ROAM_SUBNET_CHANGE_FLAG_IP4_ENABLED); \
  4952. -} while (0)
  4953. -
  4954. -#define WMI_SET_ROAM_SUBNET_CHANGE_FLAG_IP4_DISABLED(flag) do { \
  4955. - (flag) &= ~(1 << WMI_ROAM_SUBNET_CHANGE_FLAG_IP4_ENABLED); \
  4956. -} while (0)
  4957. -
  4958. -#define WMI_GET_ROAM_SUBNET_CHANGE_FLAG_IP4_ENABLED(flag) \
  4959. - ((flag) & (1 << WMI_ROAM_SUBNET_CHANGE_FLAG_IP4_ENABLED)
  4960. -
  4961. -/* set IPv6 enabled flag, disabled and get the flag */
  4962. -#define WMI_SET_ROAM_SUBNET_CHANGE_FLAG_IP6_ENABLED(flag) do { \
  4963. - (flag) |= (1 << WMI_ROAM_SUBNET_CHANGE_FLAG_IP6_ENABLED); \
  4964. -} while (0)
  4965. -
  4966. -#define WMI_SET_ROAM_SUBNET_CHANGE_FLAG_IP6_DISABLED(flag) do { \
  4967. - (flag) &= ~(1 << WMI_ROAM_SUBNET_CHANGE_FLAG_IP6_ENABLED); \
  4968. -} while (0)
  4969. -
  4970. -#define WMI_GET_ROAM_SUBNET_CHANGE_FLAG_IP6_ENABLED(flag) do { \
  4971. - ((flag) & (1 << WMI_ROAM_SUBNET_CHANGE_FLAG_IP6_ENABLED); \
  4972. -} while (0)
  4973. -
  4974. -/**
  4975. - * WMI_ROAM_SUBNET_CHANGE_CONFIG : Pass the gateway IP and MAC addresses
  4976. - * to FW. FW uses these parameters for subnet change detection.
  4977. - */
  4978. -typedef struct {
  4979. - A_UINT32 tlv_header; /** TLV tag and len; tag equals
  4980. -WMITLV_TAG_STRUC_wmi_roam_subnet_change_config_fixed_param */
  4981. - /** unique id identifying the VDEV, generated by the caller */
  4982. - A_UINT32 vdev_id;
  4983. - /** IPv4/IPv6 enabled/disabled */
  4984. - /** This flag sets the WMI_SET_ROAM_SUBNET_CHANGE_FLAG_xxx_ENABLED/
  4985. -DISABLED */
  4986. - A_UINT32 flag;
  4987. - /** Gateway MAC address */
  4988. - wmi_mac_addr inet_gw_mac_addr;
  4989. - /** IP addresses */
  4990. - WMI_IPV4_ADDR inet_gw_ip_v4_addr;
  4991. - WMI_IPV6_ADDR inet_gw_ip_v6_addr;
  4992. - /** Number of software retries for ARP/Neighbor solicitation request */
  4993. - A_UINT32 max_retries;
  4994. - /** timeout in milliseconds for each ARP request*/
  4995. - A_UINT32 timeout;
  4996. - /** number of skipped aps **/
  4997. - A_UINT32 num_skip_subnet_change_detection_bssid_list;
  4998. -/**
  4999. - * TLV (tag length value ) parameters follows roam_subnet_change_config_cmd
  5000. - * structure. The TLV's are:
  5001. - * wmi_mac_addr skip_subnet_change_detection_bssid_list [];
  5002. - **/
  5003. -} wmi_roam_subnet_change_config_fixed_param;
  5004. -
  5005. /** WMI_PROFILE_MATCH_EVENT: offload scan
  5006. * generated when ever atleast one of the matching profiles is found
  5007. * in recent NLO scan. no data is carried with the event.
  5008. @@ -6145,7 +5794,6 @@ typedef enum event_type_e {
  5009. WOW_BEACON_EVENT,
  5010. WOW_CLIENT_KICKOUT_EVENT,
  5011. WOW_NAN_EVENT,
  5012. - WOW_EXTSCAN_EVENT,
  5013. } WOW_WAKE_EVENT_TYPE;
  5014.  
  5015. typedef enum wake_reason_e {
  5016. @@ -6179,20 +5827,12 @@ typedef enum wake_reason_e {
  5017. WOW_REASON_BEACON_RECV,
  5018. WOW_REASON_CLIENT_KICKOUT_EVENT,
  5019. WOW_REASON_NAN_EVENT,
  5020. - WOW_REASON_EXTSCAN,
  5021. - WOW_REASON_RSSI_BREACH_EVENT,
  5022. WOW_REASON_DEBUG_TEST = 0xFF,
  5023. } WOW_WAKE_REASON_TYPE;
  5024.  
  5025. -typedef enum {
  5026. - WOW_IFACE_PAUSE_ENABLED,
  5027. - WOW_IFACE_PAUSE_DISABLED
  5028. -} WOW_IFACE_STATUS;
  5029. -
  5030. typedef struct {
  5031. A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_wow_enable_cmd_fixed_param */
  5032. A_UINT32 enable;
  5033. - A_UINT32 pause_iface_config;
  5034. } wmi_wow_enable_cmd_fixed_param;
  5035.  
  5036. typedef struct {
  5037. @@ -6331,11 +5971,6 @@ typedef struct wow_event_info_s {
  5038. A_UINT32 data_len;
  5039. }WOW_EVENT_INFO_fixed_param;
  5040.  
  5041. -typedef struct wow_initial_wakeup_event_s {
  5042. - A_UINT32 tlv_header; /* TLV tag and len; tag equals WOW_INITIAL_WAKEUP_EVENT_fixed_param */
  5043. - A_UINT32 vdev_id;
  5044. -} WOW_INITIAL_WAKEUP_EVENT_fixed_param;
  5045. -
  5046. typedef enum {
  5047. WOW_EVENT_INFO_TYPE_PACKET = 0x0001,
  5048. WOW_EVENT_INFO_TYPE_BITMAP,
  5049. @@ -6483,6 +6118,11 @@ typedef struct {
  5050. #define WMI_ARPOFF_FLAGS_MAC_VALID (1 << 1) /* the target mac address is valid */
  5051. #define WMI_ARPOFF_FLAGS_REMOTE_IP_VALID (1 << 2) /* remote IP field is valid */
  5052.  
  5053. +typedef struct _WMI_IPV6_ADDR {
  5054. + A_UINT8 address[16]; /* IPV6 in Network Byte Order */
  5055. +} WMI_IPV6_ADDR;
  5056. +
  5057. +
  5058. typedef struct {
  5059. A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_WMI_ARP_OFFLOAD_TUPLE */
  5060. A_UINT32 flags; /* flags */
  5061. @@ -7044,11 +6684,14 @@ typedef struct {
  5062. A_UINT8 replay_counter[GTK_REPLAY_COUNTER_BYTES]; /* replay counter for re-key */
  5063. }WMI_GTK_OFFLOAD_CMD_fixed_param;
  5064.  
  5065. +typedef struct {
  5066. + A_UINT8 address[4]; /* IPV4 address in Network Byte Order */
  5067. +} WMI_IPV4_ADDR;
  5068. +
  5069. typedef enum {
  5070. WMI_STA_KEEPALIVE_METHOD_NULL_FRAME = 1, /* 802.11 NULL frame */
  5071. WMI_STA_KEEPALIVE_METHOD_UNSOLICITED_ARP_RESPONSE = 2, /* ARP response */
  5072. WMI_STA_KEEPALIVE_METHOD_ETHERNET_LOOPBACK = 3, /*ETHERNET LOOPBACK*/
  5073. - WMI_STA_KEEPALIVE_METHOD_GRATUITOUS_ARP_REQUEST = 4, /* gratuitous ARP req*/
  5074. } WMI_STA_KEEPALIVE_METHOD;
  5075.  
  5076. typedef struct {
  5077. @@ -7183,7 +6826,6 @@ typedef enum {
  5078. RECOVERY_SIM_STACK_OV = 0x05,
  5079. RECOVERY_SIM_INFINITE_LOOP = 0x06,
  5080. RECOVERY_SIM_PCIE_LINKDOWN = 0x07,
  5081. - RECOVERY_SIM_SELF_RECOVERY = 0x08,
  5082. } RECOVERY_SIM_TYPE;
  5083.  
  5084. /* WMI_FORCE_FW_HANG_CMDID */
  5085. @@ -7984,34 +7626,25 @@ typedef struct
  5086. A_UINT32 netWorkStartIndex; /* indicate the start index of network info*/
  5087. } wmi_batch_scan_result_scan_list;
  5088.  
  5089. -#define LPI_IE_BITMAP_BSSID 0x00000001 // if this bit is set, bssid of the scan response frame is sent as the first IE in the data buffer sent to LOWI LP.
  5090. -#define LPI_IE_BITMAP_IS_PROBE 0x00000002 // send true or false based on scan response frame being a Probe Rsp or not
  5091. -#define LPI_IE_BITMAP_SSID 0x00000004 // send ssid from received scan response frame
  5092. -#define LPI_IE_BITMAP_RSSI 0x00000008 // send RSSI value reported by HW for the received scan response after adjusting with noise floor
  5093. -#define LPI_IE_BITMAP_CHAN 0x00000010 // send channel number from the received scan response
  5094. -#define LPI_IE_BITMAP_AP_TX_PWR 0x00000020 // send Tx power from TPC IE of scan rsp
  5095. -#define LPI_IE_BITMAP_TX_RATE 0x00000040 // send rate of the received frame as reported by HW.
  5096. -#define LPI_IE_BITMAP_80211_MC_SUPPORT 0x00000080 // send true or false based on the received scan rsp was from a 11mc supported AP or not.
  5097. -#define LPI_IE_BITMAP_TSF_TIMER_VALUE 0x00000100 // send timestamp reported in the received scan rsp frame.
  5098. -#define LPI_IE_BITMAP_AGE_OF_MEASUREMENT 0x00000200 // (current system time - received time) = duration of time scan rsp frame data is kept in the buffer before sending to LOWI LP.
  5099. -/*
  5100. - * TEMPORARY alias of incorrect old name the correct name.
  5101. - * This alias will be removed once all references to the old name have been fixed.
  5102. - */
  5103. -#define LPI_IE_BITMAP_AGE_OF_MESAUREMENT LPI_IE_BITMAP_AGE_OF_MEASUREMENT
  5104. -#define LPI_IE_BITMAP_CONN_STATUS 0x00000400 // If an infra STA is active and connected to an AP, true value is sent else false.
  5105. -#define LPI_IE_BITMAP_MSAP_IE 0x00000800 // info on the vendor specific proprietary IE MSAP
  5106. -#define LPI_IE_BITMAP_SEC_STATUS 0x00001000 // we indicate true or false based on if the AP has WPA or RSN security enabled
  5107. -#define LPI_IE_BITMAP_DEVICE_TYPE 0x00002000 // info about the beacons coming from an AP or P2P or NAN device.
  5108. -#define LPI_IE_BITMAP_CHAN_IS_PASSIVE 0x00004000 // info on whether the scan rsp was received from a passive channel
  5109. -#define LPI_IE_BITMAP_DWELL_TIME 0x00008000 // send the scan dwell time of the channel on which the current scan rsp frame was received.
  5110. -#define LPI_IE_BITMAP_BAND_CENTER_FREQ1 0x00010000 // the center frequencies in case AP is supporting wider channels than 20 MHz
  5111. -#define LPI_IE_BITMAP_BAND_CENTER_FREQ2 0x00020000 // same as above
  5112. -#define LPI_IE_BITMAP_PHY_MODE 0x00040000 // PHY mode indicates a, b, ,g, ac and other combinations
  5113. -#define LPI_IE_BITMAP_SCAN_MODULE_ID 0x00080000 // scan module id indicates the scan client who originated the scan
  5114. -#define LPI_IE_BITMAP_SCAN_ID 0x00100000 // extscan inserts the scan cycle count for this value; other scan clients can insert the scan id of the scan, if needed.
  5115. -#define LPI_IE_BITMAP_FLAGS 0x00200000 // reserved as a bitmap to indicate more scan information; one such use being to indicate if the on-going scan is interrupted or not
  5116. -#define LPI_IE_BITMAP_CACHING_REQD 0x00400000 // extscan will use this field to indicate if this frame info needs to be cached in LOWI LP or not
  5117. +#define LPI_IE_BITMAP_BSSID 0x00000001
  5118. +#define LPI_IE_BITMAP_IS_PROBE 0x00000002
  5119. +#define LPI_IE_BITMAP_SSID 0x00000004
  5120. +#define LPI_IE_BITMAP_RSSI 0x00000008
  5121. +#define LPI_IE_BITMAP_CHAN 0x00000010
  5122. +#define LPI_IE_BITMAP_AP_TX_PWR 0x00000020
  5123. +#define LPI_IE_BITMAP_TX_RATE 0x00000040
  5124. +#define LPI_IE_BITMAP_80211_MC_SUPPORT 0x00000080
  5125. +#define LPI_IE_BITMAP_TSF_TIMER_VALUE 0x00000100
  5126. +#define LPI_IE_BITMAP_AGE_OF_MESAUREMENT 0x00000200
  5127. +#define LPI_IE_BITMAP_CONN_STATUS 0x00000400
  5128. +#define LPI_IE_BITMAP_MSAP_IE 0x00000800
  5129. +#define LPI_IE_BITMAP_SEC_STATUS 0x00001000
  5130. +#define LPI_IE_BITMAP_DEVICE_TYPE 0x00002000
  5131. +#define LPI_IE_BITMAP_CHAN_IS_PASSIVE 0x00004000
  5132. +#define LPI_IE_BITMAP_DWELL_TIME 0x00008000
  5133. +#define LPI_IE_BITMAP_BAND_CENTER_FREQ1 0x00010000
  5134. +#define LPI_IE_BITMAP_BAND_CENTER_FREQ2 0x00020000
  5135. +#define LPI_IE_BITMAP_PHY_MODE 0x00040000
  5136. #define LPI_IE_BITMAP_ALL 0xFFFFFFFF
  5137.  
  5138. typedef struct {
  5139. @@ -8236,9 +7869,6 @@ typedef struct {
  5140. A_UINT32 led_enable;
  5141. } wmi_pdev_set_led_config_cmd_fixed_param;
  5142.  
  5143. -#define WMI_WNTS_CFG_GPIO_PIN_NUM_OFFSET 0
  5144. -#define WMI_WNTS_CFG_GPIO_PIN_NUM_MASK 0xff
  5145. -
  5146. /** WMI_PEER_INFO_REQ_CMDID
  5147. * Request FW to provide peer info */
  5148. typedef struct {
  5149. @@ -8805,7 +8435,6 @@ typedef struct {
  5150. * A_UINT8 reassoc_rsp_frame[]; length identified by reassoc_rsp_len
  5151. * wmi_channel chan;
  5152. * wmi_key_material key;
  5153. - * A_UINT32 status; subnet changed status
  5154. **/
  5155. } wmi_roam_synch_event_fixed_param;
  5156.  
  5157. @@ -8998,15 +8627,10 @@ typedef enum {
  5158. } wmi_extscan_forwarding_flags;
  5159.  
  5160. typedef enum {
  5161. - WMI_EXTSCAN_USE_MSD = 0x0001, // Use Motion Sensor Detection */
  5162. - WMI_EXTSCAN_EXTENDED_BATCHING_EN = 0x0002, // Extscan LPASS extended batching feature is supported and enabled
  5163. + WMI_EXTSCAN_USE_MSD = 0x0001, // Use Motion Sensor Detection */
  5164. } wmi_extscan_configuration_flags;
  5165.  
  5166. typedef enum {
  5167. - WMI_EXTSCAN_BUCKET_CACHE_RESULTS = 0x0001, // Cache the results of bucket whose configuration flags has this bit set
  5168. -} wmi_extscan_bucket_configuration_flags;
  5169. -
  5170. -typedef enum {
  5171. WMI_EXTSCAN_STATUS_OK = 0,
  5172. WMI_EXTSCAN_STATUS_ERROR = 0x80000000,
  5173. WMI_EXTSCAN_STATUS_INVALID_PARAMETERS,
  5174. @@ -9043,7 +8667,7 @@ typedef struct {
  5175. A_UINT32 notify_extscan_events;
  5176. /** Options to forward scan results - see wmi_extscan_forwarding_flags */
  5177. A_UINT32 forwarding_flags;
  5178. - /** ExtScan configuration flags - wmi_extscan__bucket_configuration_flags */
  5179. + /** ExtScan configuration flags - wmi_extscan_configuration_flags */
  5180. A_UINT32 configuration_flags;
  5181. /** DEPRECATED member: multiplier to be applied to the periodic scan's base period */
  5182. A_UINT32 base_period_multiplier;
  5183. @@ -9598,9 +9222,8 @@ typedef struct {
  5184.  
  5185. enum _tExtScanEntryFlags
  5186. {
  5187. - WMI_HOTLIST_FLAG_NONE = 0x00,
  5188. - WMI_HOTLIST_FLAG_PRESENCE = 0x01,
  5189. - WMI_HOTLIST_FLAG_DUPLICATE_SSID = 0x80,
  5190. + WMI_HOTLIST_FLAG_NONE = 0x00,
  5191. + WMI_HOTLIST_FLAG_PRESENCE = 0x01
  5192. };
  5193.  
  5194. typedef struct {
  5195. @@ -9852,7 +9475,6 @@ typedef struct{
  5196. A_UINT32 pattern_id; /* pattern identifier */
  5197. A_UINT32 led_x0; /* led flashing parameter0 */
  5198. A_UINT32 led_x1; /* led flashing parameter1 */
  5199. - A_UINT32 gpio_num; /* GPIO number */
  5200. } wmi_set_led_flashing_cmd_fixed_param;
  5201.  
  5202. /**
  5203. @@ -9975,11 +9597,6 @@ typedef struct {
  5204. */
  5205. } wmi_sap_ofl_add_sta_event_fixed_param;
  5206.  
  5207. -typedef enum {
  5208. - SAP_OFL_DEL_STA_FLAG_NONE = 0x00,
  5209. - SAP_OFL_DEL_STA_FLAG_RECONNECT = 0x01,
  5210. -} wmi_sap_ofl_del_sta_flags;
  5211. -
  5212. typedef struct {
  5213. A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_sap_ofl_del_sta_event_fixed_param */
  5214. /** VDEV id(interface) of the WMI_SAP_OFL_DEL_STA_EVENTID */
  5215. @@ -9990,8 +9607,6 @@ typedef struct {
  5216. wmi_mac_addr peer_macaddr;
  5217. /** disassociation reason */
  5218. A_UINT32 reason;
  5219. - /** flags - wmi_sap_ofl_del_sta_flags */
  5220. - A_UINT32 flags;
  5221. } wmi_sap_ofl_del_sta_event_fixed_param;
  5222.  
  5223. typedef struct {
  5224. @@ -10827,131 +10442,9 @@ typedef struct {
  5225. A_UINT32 status;
  5226. } wmi_dcc_update_ndl_resp_event_fixed_param;
  5227.  
  5228. -/* Actions for TSF timestamp */
  5229. -typedef enum {
  5230. - TSF_TSTAMP_CAPTURE_REQ = 1,
  5231. - TSF_TSTAMP_CAPTURE_RESET = 2,
  5232. - TSF_TSTAMP_READ_VALUE = 3,
  5233. -} wmi_tsf_tstamp_action;
  5234. -
  5235. -typedef struct {
  5236. - /** TLV tag and len; tag equals
  5237. - * WMITLV_TAG_STRUC_wmi_vdev_tsf_tstamp_action_cmd_fixed_param */
  5238. - A_UINT32 tlv_header;
  5239. - /** unique id identifying the VDEV, generated by the caller */
  5240. - A_UINT32 vdev_id;
  5241. - /* action type, refer to wmi_tsf_tstamp_action */
  5242. - A_UINT32 tsf_action;
  5243. -} wmi_vdev_tsf_tstamp_action_cmd_fixed_param;
  5244. -
  5245. -typedef struct {
  5246. - /* TLV tag and len; tag equals
  5247. - * WMITLV_TAG_STRUC_wmi_vdev_tsf_report_event_fixed_param */
  5248. - A_UINT32 tlv_header;
  5249. - /* VDEV identifier */
  5250. - A_UINT32 vdev_id;
  5251. - /* low 32bit of tsf */
  5252. - A_UINT32 tsf_low;
  5253. - /* high 32 bit of tsf */
  5254. - A_UINT32 tsf_high;
  5255. -} wmi_vdev_tsf_report_event_fixed_param;
  5256. -
  5257. -typedef struct {
  5258. - /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_vdev_set_ie_cmd_fixed_param */
  5259. - A_UINT32 tlv_header;
  5260. - /** unique id identifying the VDEV, generated by the caller */
  5261. - A_UINT32 vdev_id;
  5262. - /** unique id to identify the ie_data as defined by ieee 802.11 spec */
  5263. - A_UINT32 ie_id; /** ie_len corresponds to num of bytes in ie_data[] */
  5264. - A_UINT32 ie_len;
  5265. - /**
  5266. - * Following this structure is the TLV byte stream of ie data of length ie_buf_len:
  5267. - * A_UINT8 ie_data[]; */
  5268. -} wmi_vdev_set_ie_cmd_fixed_param;
  5269. -
  5270. -typedef struct {
  5271. - A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_soc_set_pcl_cmd_fixed_param */
  5272. - /** Set Preferred Channel List **/
  5273. -
  5274. - /** # of channels to scan */
  5275. - A_UINT32 num_chan;
  5276. /**
  5277. - * TLV (tag length value ) parameters follow the wmi_soc_set_pcl_cmd
  5278. - * structure. The TLV's are:
  5279. - * A_UINT32 channel_list[];
  5280. - **/
  5281. -} wmi_soc_set_pcl_cmd_fixed_param;
  5282. -
  5283. -typedef struct {
  5284. - A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_soc_set_hw_mode_cmd_fixed_param */
  5285. - /** Set Hardware Mode **/
  5286. -
  5287. - /* Hardware Mode Index */
  5288. - A_UINT32 hw_mode_index;
  5289. -} wmi_soc_set_hw_mode_cmd_fixed_param;
  5290. -
  5291. -/** Data structure for information specific to a VDEV to MAC mapping. */
  5292. -typedef struct {
  5293. - /** TLV tag and len; tag equals
  5294. - * WMITLV_TAG_STRUC_wmi_soc_set_hw_mode_response_vdev_mac_entry */
  5295. - A_UINT32 tlv_header;
  5296. - A_UINT32 vdev_id; /* VDEV ID */
  5297. - A_UINT32 mac_id; /* MAC ID */
  5298. -} wmi_soc_set_hw_mode_response_vdev_mac_entry;
  5299. -
  5300. -typedef struct {
  5301. - A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_soc_set_hw_mode_response_event_fixed_param */
  5302. - /** Set Hardware Mode Response Event **/
  5303. -
  5304. - /* Status of set_hw_mode command */
  5305. - /*
  5306. - * Values for Status:
  5307. - * 0 - OK; command successful
  5308. - * 1 - EINVAL; Requested invalid hw_mode
  5309. - * 2 - ECANCELED; HW mode change canceled
  5310. - * 3 - ENOTSUP; HW mode not supported
  5311. - * 4 - EHARDWARE; HW mode change prevented by hardware
  5312. - * 5 - EPENDING; HW mode change is pending
  5313. - * 6 - ECOEX; HW mode change conflict with Coex
  5314. - */
  5315. - A_UINT32 status;
  5316. - /* Configured Hardware Mode */
  5317. - A_UINT32 cfgd_hw_mode_index;
  5318. - /* Number of Vdev to Mac entries */
  5319. - A_UINT32 num_vdev_mac_entries;
  5320. -
  5321. -/**
  5322. - * TLV (tag length value ) parameters follow the soc_set_hw_mode_response_event
  5323. - * structure. The TLV's are:
  5324. - * A_UINT32 wmi_soc_set_hw_mode_response_vdev_mac_entry[];
  5325. - */
  5326. -} wmi_soc_set_hw_mode_response_event_fixed_param;
  5327. -
  5328. -typedef struct {
  5329. - A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_soc_hw_mode_transition_event_fixed_param */
  5330. - /** Hardware Mode Transition Event **/
  5331. -
  5332. - /* Original or old Hardware mode */
  5333. - A_UINT32 old_hw_mode_index;
  5334. - /* New Hardware Mode */
  5335. - A_UINT32 new_hw_mode_index;
  5336. - /* Number of Vdev to Mac entries */
  5337. - A_UINT32 num_vdev_mac_entries;
  5338. -
  5339. -/**
  5340. - * TLV (tag length value ) parameters follow the soc_set_hw_mode_response_event
  5341. - * structure. The TLV's are:
  5342. - * A_UINT32 wmi_soc_set_hw_mode_response_vdev_mac_entry[];
  5343. - */
  5344. -} wmi_soc_hw_mode_transition_event_fixed_param;
  5345. -
  5346. -
  5347. -/* ADD NEW DEFS HERE */
  5348. -
  5349. -/*****************************************************************************
  5350. * The following structures are deprecated. DO NOT USE THEM!
  5351. */
  5352. -
  5353. /** Max number of channels in the schedule. */
  5354. #define OCB_CHANNEL_MAX (5)
  5355.  
  5356. @@ -11006,12 +10499,40 @@ typedef struct {
  5357. /** Return status. 0 for success, non-zero otherwise */
  5358. A_UINT32 status;
  5359. } wmi_ocb_set_sched_event_fixed_param;
  5360. -
  5361. -/*****************************************************************************
  5362. +/**
  5363. * END DEPRECATED
  5364. */
  5365.  
  5366. -/* ADD NEW DEFS ABOVE THIS DEPRECATED SECTION */
  5367. +
  5368. +/* Actions for TSF timestamp */
  5369. +typedef enum {
  5370. + TSF_TSTAMP_CAPTURE_REQ = 1,
  5371. + TSF_TSTAMP_CAPTURE_RESET = 2,
  5372. + TSF_TSTAMP_READ_VALUE = 3,
  5373. +} wmi_tsf_tstamp_action;
  5374. +
  5375. +typedef struct {
  5376. + /** TLV tag and len; tag equals
  5377. + * WMITLV_TAG_STRUC_wmi_vdev_tsf_tstamp_action_cmd_fixed_param */
  5378. + A_UINT32 tlv_header;
  5379. + /** unique id identifying the VDEV, generated by the caller */
  5380. + A_UINT32 vdev_id;
  5381. + /* action type, refer to wmi_tsf_tstamp_action */
  5382. + A_UINT32 tsf_action;
  5383. +} wmi_vdev_tsf_tstamp_action_cmd_fixed_param;
  5384. +
  5385. +typedef struct {
  5386. + /* TLV tag and len; tag equals
  5387. + * WMITLV_TAG_STRUC_wmi_vdev_tsf_report_event_fixed_param */
  5388. + A_UINT32 tlv_header;
  5389. + /* VDEV identifier */
  5390. + A_UINT32 vdev_id;
  5391. + /* low 32bit of tsf */
  5392. + A_UINT32 tsf_low;
  5393. + /* high 32 bit of tsf */
  5394. + A_UINT32 tsf_high;
  5395. +} wmi_vdev_tsf_report_event_fixed_param;
  5396. +
  5397.  
  5398. #ifdef __cplusplus
  5399. }
  5400. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wmi_version.h b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wmi_version.h
  5401. index c1ab37f..5cc753b 100644
  5402. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wmi_version.h
  5403. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/COMMON/wmi_version.h
  5404. @@ -36,7 +36,7 @@
  5405. #define __WMI_VER_MINOR_ 0
  5406. /** WMI revision number has to be incremented when there is a
  5407. * change that may or may not break compatibility. */
  5408. -#define __WMI_REVISION_ 127
  5409. +#define __WMI_REVISION_ 103
  5410.  
  5411. /** The Version Namespace should not be normally changed. Only
  5412. * host and firmware of the same WMI namespace will work
  5413. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/inc/dfs.h b/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/inc/dfs.h
  5414. index 6907add..64c091d 100644
  5415. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/inc/dfs.h
  5416. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/inc/dfs.h
  5417. @@ -275,7 +275,6 @@ struct dfs_event {
  5418. u_int32_t re_freq; /* Centre frequency of event, KHz */
  5419. u_int32_t re_freq_lo; /* Lower bounds of frequency, KHz */
  5420. u_int32_t re_freq_hi; /* Upper bounds of frequency, KHz */
  5421. - int sidx; /* Pulse Index as in radar summary report */
  5422. STAILQ_ENTRY(dfs_event) re_list; /* List of radar events */
  5423. } adf_os_packed;
  5424. #ifdef WIN32
  5425. @@ -601,11 +600,6 @@ struct ath_dfs {
  5426. int dfs_pri_multiplier; /* allow pulse if they are within multiple of PRI for the radar type */
  5427. int ath_dfs_nol_timeout;
  5428. int dfs_pri_multiplier_ini; /* dfs pri configuration from ini */
  5429. - /*
  5430. - * Flag to indicate if DFS test mode is enabled and
  5431. - * channel switch is disabled.
  5432. - */
  5433. - int8_t disable_dfs_ch_switch;
  5434. };
  5435.  
  5436. /* This should match the table from if_ath.c */
  5437. @@ -693,7 +687,6 @@ struct dfs_phy_err {
  5438.  
  5439. u_int8_t rssi; /* pulse RSSI */
  5440. u_int8_t dur; /* pulse duration, raw (not uS) */
  5441. - int sidx; /* Pulse Index as in radar summary report */
  5442. };
  5443.  
  5444. /* Attach, detach, handle ioctl prototypes */
  5445. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs.c b/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs.c
  5446. index bf81edf..fa05f5b 100644
  5447. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs.c
  5448. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs.c
  5449. @@ -266,11 +266,10 @@ dfs_attach(struct ieee80211com *ic)
  5450. ic->ic_dfs_attach(ic, &dfs->dfs_caps, &radar_info);
  5451. dfs_clear_stats(ic);
  5452. dfs->dfs_event_log_on = 0;
  5453. - OS_INIT_TIMER(NULL, &(dfs->ath_dfs_task_timer), dfs_task, (void *) (ic),
  5454. - ADF_DEFERRABLE_TIMER);
  5455. + OS_INIT_TIMER(NULL, &(dfs->ath_dfs_task_timer), dfs_task, (void *) (ic));
  5456. #ifndef ATH_DFS_RADAR_DETECTION_ONLY
  5457. OS_INIT_TIMER(NULL, &(dfs->ath_dfstesttimer), dfs_testtimer_task,
  5458. - (void *) ic, ADF_DEFERRABLE_TIMER);
  5459. + (void *) ic);
  5460. dfs->ath_dfs_cac_time = ATH_DFS_WAIT_MS;
  5461. dfs->ath_dfstesttime = ATH_DFS_TEST_RETURN_PERIOD_MS;
  5462. #endif
  5463. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs_nol.c b/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs_nol.c
  5464. index d907cec..3198a28 100644
  5465. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs_nol.c
  5466. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs_nol.c
  5467. @@ -239,7 +239,7 @@ dfs_nol_addchan(struct ath_dfs *dfs, struct ieee80211_channel *chan,
  5468. dfs_nol_arg->delchwidth = elem->nol_chwidth;
  5469.  
  5470. OS_INIT_TIMER(NULL, &elem->nol_timer, dfs_remove_from_nol,
  5471. - dfs_nol_arg, ADF_DEFERRABLE_TIMER);
  5472. + dfs_nol_arg);
  5473. OS_SET_TIMER(&elem->nol_timer, dfs_nol_timeout*TIME_IN_MS);
  5474.  
  5475. /* Update the NOL counter */
  5476. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs_phyerr_tlv.c b/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs_phyerr_tlv.c
  5477. index 2723852..b14106b 100644
  5478. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs_phyerr_tlv.c
  5479. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs_phyerr_tlv.c
  5480. @@ -659,7 +659,6 @@ dfs_process_phyerr_bb_tlv(struct ath_dfs *dfs, void *buf, u_int16_t datalen,
  5481. OS_MEMSET(e, 0, sizeof(*e));
  5482. e->rssi = rs.rssi;
  5483. e->dur = rs.pulse_duration;
  5484. - e->sidx = rs.sidx;
  5485. e->is_pri = 1; /* XXX always PRI for now */
  5486. e->is_ext = 0;
  5487. e->is_dc = 0;
  5488. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs_process_phyerr.c b/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs_process_phyerr.c
  5489. index 8656502..b47e39d 100644
  5490. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs_process_phyerr.c
  5491. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs_process_phyerr.c
  5492. @@ -755,7 +755,6 @@ dfs_process_phyerr(struct ieee80211com *ic, void *buf, u_int16_t datalen,
  5493. event->re_ts = (e.rs_tstamp) & DFS_TSMASK;
  5494. event->re_chanindex = dfs->dfs_curchan_radindex;
  5495. event->re_flags = 0;
  5496. - event->sidx = e.sidx;
  5497.  
  5498. /*
  5499. * Handle chirp flags.
  5500. @@ -832,7 +831,6 @@ dfs_process_phyerr(struct ieee80211com *ic, void *buf, u_int16_t datalen,
  5501. event->re_full_ts = e.fulltsf;
  5502. event->re_ts = (e.rs_tstamp) & DFS_TSMASK;
  5503. event->re_rssi = e.rssi;
  5504. - event->sidx = e.sidx;
  5505.  
  5506. /*
  5507. * Handle chirp flags.
  5508. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs_process_radarevent.c b/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs_process_radarevent.c
  5509. index 1bb758d..1154ee8 100644
  5510. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs_process_radarevent.c
  5511. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/DFS/src/dfs_process_radarevent.c
  5512. @@ -380,32 +380,8 @@ dfs_process_radarevent(struct ath_dfs *dfs, struct ieee80211_channel *chan)
  5513. dfs_reset_alldelaylines(dfs);
  5514. dfs_reset_radarq(dfs);
  5515. }
  5516. -
  5517. found = 0;
  5518.  
  5519. - /*
  5520. - * Use this fix only when device is not in test mode, as
  5521. - * it drops some valid phyerrors.
  5522. - * In FCC or JAPAN domain,if the follwing signature matches
  5523. - * its likely that this is a false radar pulse pattern
  5524. - * so process the next pulse in the queue.
  5525. - */
  5526. - if ((dfs->disable_dfs_ch_switch == VOS_FALSE) &&
  5527. - (DFS_FCC_DOMAIN == dfs->dfsdomain ||
  5528. - DFS_MKK4_DOMAIN == dfs->dfsdomain) &&
  5529. - (re.re_dur >= 11 && re.re_dur <= 20) &&
  5530. - (diff_ts > 500 || diff_ts <= 305) &&
  5531. - (re.sidx == -4)) {
  5532. - VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
  5533. - "\n%s: Rejecting on Peak Index = %d,re.re_dur = %d,diff_ts = %d\n",
  5534. - __func__,re.sidx, re.re_dur, diff_ts);
  5535. -
  5536. - ATH_DFSQ_LOCK(dfs);
  5537. - empty = STAILQ_EMPTY(&(dfs->dfs_radarq));
  5538. - ATH_DFSQ_UNLOCK(dfs);
  5539. - continue;
  5540. - }
  5541. -
  5542. /* BIN5 pulses are FCC and Japan specific */
  5543.  
  5544. if ((dfs->dfsdomain == DFS_FCC_DOMAIN) || (dfs->dfsdomain == DFS_MKK4_DOMAIN)) {
  5545. @@ -540,11 +516,7 @@ VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, "%s[%d]:filterID= %d :: Rejec
  5546. DFS_DPRINTK(dfs, ATH_DEBUG_DFS3,
  5547. "Found on channel minDur = %d, filterId = %d",ft->ft_mindur,
  5548. rf != NULL ? rf->rf_pulseid : -1);
  5549. - VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO,
  5550. - "%s[%d]:### Found on channel minDur = %d, filterId = %d ###",
  5551. - __func__,__LINE__,ft->ft_mindur,
  5552. - rf != NULL ? rf->rf_pulseid : -1);
  5553. - }
  5554. + }
  5555. tabledepth++;
  5556. }
  5557. ATH_DFSQ_LOCK(dfs);
  5558. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/HIF/PCIe/copy_engine.c b/drivers/staging/qcacld-2.0/CORE/SERVICES/HIF/PCIe/copy_engine.c
  5559. index c73a853..abb53b6 100644
  5560. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/HIF/PCIe/copy_engine.c
  5561. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/HIF/PCIe/copy_engine.c
  5562. @@ -1563,7 +1563,7 @@ CE_init(struct hif_pci_softc *sc,
  5563. /* poll timer */
  5564. if ((CE_state->attr_flags & CE_ATTR_ENABLE_POLL)) {
  5565. adf_os_timer_init(scn->adf_dev, &CE_state->poll_timer,
  5566. - CE_poll_timeout, CE_state, ADF_DEFERRABLE_TIMER);
  5567. + CE_poll_timeout, CE_state);
  5568. CE_state->timer_inited = true;
  5569. adf_os_timer_mod(&CE_state->poll_timer, CE_POLL_TIMEOUT);
  5570. }
  5571. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/HIF/PCIe/hif_pci.c b/drivers/staging/qcacld-2.0/CORE/SERVICES/HIF/PCIe/hif_pci.c
  5572. index ef4e0f5..6b33c6f 100644
  5573. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/HIF/PCIe/hif_pci.c
  5574. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/HIF/PCIe/hif_pci.c
  5575. @@ -2380,8 +2380,7 @@ HIF_PCIDeviceProbed(hif_handle_t hif_hdl)
  5576. hif_state->fake_sleep = FALSE;
  5577. hif_state->sleep_ticks = 0;
  5578. adf_os_timer_init(NULL, &hif_state->sleep_timer,
  5579. - HIF_sleep_entry, (void *)hif_state,
  5580. - ADF_NON_DEFERRABLE_TIMER);
  5581. + HIF_sleep_entry, (void *)hif_state);
  5582.  
  5583. hif_state->fw_indicator_address = FW_INDICATOR_ADDRESS;
  5584. hif_state->targid = A_TARGET_ID(sc->hif_device);
  5585. @@ -2636,6 +2635,16 @@ HIFGetTargetId(HIF_DEVICE *hif_device)
  5586. return(TARGID(sc));
  5587. }
  5588.  
  5589. +/* worker thread to recover when target does not respond over PCIe */
  5590. +static void recovery_work_handler(struct work_struct *recovery)
  5591. +{
  5592. +#ifdef CONFIG_CNSS
  5593. + cnss_device_self_recovery();
  5594. +#endif
  5595. +}
  5596. +
  5597. +static DECLARE_WORK(recovery_work, recovery_work_handler);
  5598. +
  5599. extern void HIFdebug(void);
  5600.  
  5601. /*
  5602. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/HIF/PCIe/if_pci.c b/drivers/staging/qcacld-2.0/CORE/SERVICES/HIF/PCIe/if_pci.c
  5603. index d29462f..e76730f 100644
  5604. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/HIF/PCIe/if_pci.c
  5605. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/HIF/PCIe/if_pci.c
  5606. @@ -1765,11 +1765,6 @@ void hif_pci_crash_shutdown(struct pci_dev *pdev)
  5607. return;
  5608. }
  5609.  
  5610. - if (vos_is_load_unload_in_progress(VOS_MODULE_ID_HIF, NULL)) {
  5611. - pr_info("%s: Load/unload is in progress, ignore!\n", __func__);
  5612. - return;
  5613. - }
  5614. -
  5615. adf_os_spin_lock_irqsave(&hif_state->suspend_lock);
  5616.  
  5617. #ifdef DEBUG
  5618. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/HTC/htc_services.c b/drivers/staging/qcacld-2.0/CORE/SERVICES/HTC/htc_services.c
  5619. index 948ef5c..72e9fcc 100644
  5620. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/HTC/htc_services.c
  5621. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/HTC/htc_services.c
  5622. @@ -279,7 +279,7 @@ A_STATUS HTCConnectService(HTC_HANDLE HTCHandle,
  5623. target->osdev,
  5624. &pEndpoint->ul_poll_timer,
  5625. HTCSendCompleteCheckCleanup,
  5626. - pEndpoint, ADF_DEFERRABLE_TIMER);
  5627. + pEndpoint);
  5628. }
  5629.  
  5630. AR_DEBUG_PRINTF(ATH_DEBUG_SETUP, ("HTC Service:0x%4.4X, ULpipe:%d DLpipe:%d id:%d Ready\n",
  5631. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/WMA/wma.c b/drivers/staging/qcacld-2.0/CORE/SERVICES/WMA/wma.c
  5632. index d91b953..9556f8f 100644
  5633. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/WMA/wma.c
  5634. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/WMA/wma.c
  5635. @@ -1370,8 +1370,6 @@ static int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len)
  5636. return -EINVAL;
  5637. }
  5638.  
  5639. - del_sta_ctx->is_tdls = true;
  5640. - del_sta_ctx->vdev_id = vdev_id;
  5641. del_sta_ctx->staId = peer_id;
  5642. vos_mem_copy(del_sta_ctx->addr2, macaddr, IEEE80211_ADDR_LEN);
  5643. vos_mem_copy(del_sta_ctx->bssId, wma->interfaces[vdev_id].bssid,
  5644. @@ -1433,7 +1431,6 @@ static int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len)
  5645. break;
  5646.  
  5647. case WMI_PEER_STA_KICKOUT_REASON_INACTIVITY:
  5648. - /* This could be for STA or SAP role */
  5649. default:
  5650. break;
  5651. }
  5652. @@ -1447,8 +1444,6 @@ static int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len)
  5653. return -EINVAL;
  5654. }
  5655.  
  5656. - del_sta_ctx->is_tdls = false;
  5657. - del_sta_ctx->vdev_id = vdev_id;
  5658. del_sta_ctx->staId = peer_id;
  5659. vos_mem_copy(del_sta_ctx->addr2, macaddr, IEEE80211_ADDR_LEN);
  5660. vos_mem_copy(del_sta_ctx->bssId, wma->interfaces[vdev_id].addr,
  5661. @@ -5332,12 +5327,6 @@ VOS_STATUS WDA_open(v_VOID_t *vos_context, v_VOID_t *os_ctx,
  5662. goto err_event_init;
  5663. }
  5664.  
  5665. - vos_status = vos_event_init(&wma_handle->recovery_event);
  5666. - if (vos_status != VOS_STATUS_SUCCESS) {
  5667. - WMA_LOGP("%s: recovery event initialization failed", __func__);
  5668. - goto err_event_init;
  5669. - }
  5670. -
  5671. INIT_LIST_HEAD(&wma_handle->vdev_resp_queue);
  5672. adf_os_spinlock_init(&wma_handle->vdev_respq_lock);
  5673. adf_os_spinlock_init(&wma_handle->vdev_detach_lock);
  5674. @@ -6359,7 +6348,7 @@ static ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle,
  5675. (struct sAniSirGlobal*)vos_get_context(VOS_MODULE_ID_PE,
  5676. wma_handle->vos_context);
  5677. tANI_U32 cfg_val;
  5678. - tANI_U16 val16;
  5679. + tANI_U16 val16;
  5680. int ret;
  5681. tSirMacHTCapabilityInfo *phtCapInfo;
  5682.  
  5683. @@ -6474,12 +6463,6 @@ static ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle,
  5684. self_sta_req->sessionId);
  5685. }
  5686. }
  5687. - ret = wmi_unified_vdev_set_param_send(wma_handle->wmi_handle,
  5688. - self_sta_req->sessionId,
  5689. - WMI_VDEV_PARAM_DISCONNECT_TH,
  5690. - self_sta_req->pkt_err_disconn_th);
  5691. - if (ret)
  5692. - WMA_LOGE("Failed to set WMI_VDEV_PARAM_DISCONNECT_TH");
  5693.  
  5694. if (wlan_cfgGetInt(mac, WNI_CFG_RTS_THRESHOLD,
  5695. &cfg_val) == eSIR_SUCCESS) {
  5696. @@ -9415,12 +9398,6 @@ static VOS_STATUS wma_vdev_start(tp_wma_handle wma,
  5697. WLAN_PHY_MODE chanmode;
  5698. u_int8_t *buf_ptr;
  5699. struct wma_txrx_node *intr = wma->interfaces;
  5700. - tpAniSirGlobal pmac = NULL;
  5701. - struct ath_dfs *dfs;
  5702. -
  5703. - pmac = (tpAniSirGlobal)
  5704. - vos_get_context(VOS_MODULE_ID_PE, wma->vos_context);
  5705. - dfs = (struct ath_dfs *)wma->dfs_ic->ic_dfs;
  5706.  
  5707. WMA_LOGD("%s: Enter isRestart=%d vdev=%d", __func__, isRestart,req->vdev_id);
  5708. len = sizeof(*cmd) + sizeof(wmi_channel) +
  5709. @@ -9540,8 +9517,6 @@ static VOS_STATUS wma_vdev_start(tp_wma_handle wma,
  5710. wma_dfs_configure_channel(wma->dfs_ic,chan,chanmode,req);
  5711.  
  5712. wma_unified_dfs_phyerr_filter_offload_enable(wma);
  5713. - dfs->disable_dfs_ch_switch =
  5714. - pmac->sap.SapDfsInfo.disable_dfs_ch_switch;
  5715. }
  5716. }
  5717.  
  5718. @@ -11056,24 +11031,6 @@ static int wmi_crash_inject(wmi_unified_t wmi_handle, u_int32_t type,
  5719. return ret;
  5720. }
  5721.  
  5722. -/**
  5723. - * wma_crash_inject() - sends command to FW to simulate crash
  5724. - * @wma_handle: pointer of WMA context
  5725. - * @type: subtype of the command
  5726. - * @delay_time_ms: time in milliseconds for FW to delay the crash
  5727. - *
  5728. - * This function will send a command to FW in order to simulate different
  5729. - * kinds of FW crashes.
  5730. - *
  5731. - * Return: 0 for success or reasons for failure
  5732. - */
  5733. -
  5734. -int wma_crash_inject(tp_wma_handle wma_handle, uint32_t type,
  5735. - uint32_t delay_time_ms)
  5736. -{
  5737. - return wmi_crash_inject(wma_handle->wmi_handle, type, delay_time_ms);
  5738. -}
  5739. -
  5740. static int32_t wmi_unified_set_sta_ps_param(wmi_unified_t wmi_handle,
  5741. u_int32_t vdev_id, u_int32_t param, u_int32_t value)
  5742. {
  5743. @@ -16142,10 +16099,18 @@ static VOS_STATUS wma_pno_start(tp_wma_handle wma, tpSirPNOScanReq pno)
  5744.  
  5745. /* Copy scan interval */
  5746. if (pno->scanTimers.ucScanTimersCount) {
  5747. + //BEGIN MOT a19110 IKDREL3KK-2175 PNO Enhancement
  5748. cmd->fast_scan_period =
  5749. - WMA_SEC_TO_MSEC(pno->scanTimers.aTimerValues[0].uTimerValue);
  5750. - cmd->slow_scan_period = cmd->fast_scan_period;
  5751. - WMA_LOGD("Scan period : %d msec", cmd->slow_scan_period);
  5752. + WMA_SEC_TO_MSEC(pno->scanTimers.aTimerValues[0].uTimerValue);
  5753. + WMA_LOGD("Fast Scan period : %d msec", cmd->fast_scan_period);
  5754. +
  5755. + cmd->fast_scan_max_cycles = pno->scanTimers.aTimerValues[0].uTimerRepeat;
  5756. + WMA_LOGD("Fast Scan cycle : %d", cmd->fast_scan_max_cycles);
  5757. +
  5758. + cmd->slow_scan_period =
  5759. + WMA_SEC_TO_MSEC(pno->scanTimers.aTimerValues[1].uTimerValue);
  5760. + WMA_LOGD("Slow Scan period : %d msec", cmd->slow_scan_period);
  5761. + //END IKDREL3KK-2175
  5762. }
  5763.  
  5764. buf_ptr += sizeof(wmi_nlo_config_cmd_fixed_param);
  5765. @@ -17270,7 +17235,8 @@ int wma_enable_wow_in_fw(WMA_HANDLE handle)
  5766. wmi_get_pending_cmds(wma->wmi_handle));
  5767. #ifdef CONFIG_CNSS
  5768. if (pMac->sme.enableSelfRecovery) {
  5769. - vos_trigger_recovery();
  5770. + vos_set_logp_in_progress(VOS_MODULE_ID_HIF, TRUE);
  5771. + cnss_schedule_recovery_work();
  5772. } else {
  5773. VOS_BUG(0);
  5774. }
  5775. @@ -18255,7 +18221,9 @@ static VOS_STATUS wma_send_host_wakeup_ind_to_fw(tp_wma_handle wma)
  5776. if (!vos_is_logp_in_progress(VOS_MODULE_ID_HIF, NULL)) {
  5777. #ifdef CONFIG_CNSS
  5778. if (pMac->sme.enableSelfRecovery) {
  5779. - vos_trigger_recovery();
  5780. + vos_set_logp_in_progress(VOS_MODULE_ID_HIF,
  5781. + TRUE);
  5782. + cnss_schedule_recovery_work();
  5783. } else {
  5784. VOS_BUG(0);
  5785. }
  5786. @@ -18376,6 +18344,8 @@ int wma_disable_wow_in_fw(WMA_HANDLE handle)
  5787. /* Unpause the vdev as we are resuming */
  5788. wma_unpause_vdev(wma);
  5789.  
  5790. + vos_wake_lock_timeout_acquire(&wma->wow_wake_lock, 2000);
  5791. +
  5792. return ret;
  5793. }
  5794.  
  5795. @@ -24258,7 +24228,6 @@ VOS_STATUS wma_close(v_VOID_t *vos_ctx)
  5796. vos_event_destroy(&wma_handle->target_suspend);
  5797. vos_event_destroy(&wma_handle->wma_resume_event);
  5798. vos_event_destroy(&wma_handle->wow_tx_complete);
  5799. - vos_event_destroy(&wma_handle->recovery_event);
  5800. wma_cleanup_vdev_resp(wma_handle);
  5801. for(idx = 0; idx < wma_handle->num_mem_chunks; ++idx) {
  5802. adf_os_mem_free_consistent(
  5803. @@ -25339,9 +25308,7 @@ VOS_STATUS WDA_TxPacket(void *wma_context, void *tx_frame, u_int16_t frmLen,
  5804. adf_nbuf_unmap_single(pdev->osdev, skb, ADF_OS_DMA_TO_DEVICE);
  5805. /* Call Download Cb so that umac can free the buffer */
  5806. if (tx_frm_download_comp_cb)
  5807. - tx_frm_download_comp_cb(wma_handle->mac_context,
  5808. - tx_frame,
  5809. - WMA_TX_FRAME_BUFFER_FREE);
  5810. + tx_frm_download_comp_cb(wma_handle->mac_context, tx_frame, 1);
  5811. wma_handle->umac_data_ota_ack_cb = NULL;
  5812. wma_handle->last_umac_data_nbuf = NULL;
  5813. return VOS_STATUS_E_FAILURE;
  5814. @@ -25349,9 +25316,7 @@ VOS_STATUS WDA_TxPacket(void *wma_context, void *tx_frame, u_int16_t frmLen,
  5815.  
  5816. /* Call Download Callback if passed */
  5817. if (tx_frm_download_comp_cb)
  5818. - tx_frm_download_comp_cb(wma_handle->mac_context,
  5819. - tx_frame,
  5820. - WMA_TX_FRAME_BUFFER_NO_FREE);
  5821. + tx_frm_download_comp_cb(wma_handle->mac_context, tx_frame, 0);
  5822.  
  5823. return VOS_STATUS_SUCCESS;
  5824. }
  5825. @@ -25441,13 +25406,9 @@ VOS_STATUS WDA_TxPacket(void *wma_context, void *tx_frame, u_int16_t frmLen,
  5826.  
  5827. /*
  5828. * Failed to send Tx Mgmt Frame
  5829. + * Return Failure so that umac can freeup the buf
  5830. */
  5831. if (status) {
  5832. - /* Call Download Cb so that umac can free the buffer */
  5833. - if (tx_frm_download_comp_cb)
  5834. - tx_frm_download_comp_cb(wma_handle->mac_context,
  5835. - tx_frame,
  5836. - WMA_TX_FRAME_BUFFER_FREE);
  5837. WMA_LOGP("%s: Failed to send Mgmt Frame", __func__);
  5838. goto error;
  5839. }
  5840. @@ -25487,8 +25448,7 @@ VOS_STATUS WDA_TxPacket(void *wma_context, void *tx_frame, u_int16_t frmLen,
  5841. * callback once the frame is successfully
  5842. * given to txrx module
  5843. */
  5844. - tx_frm_download_comp_cb(wma_handle->mac_context, tx_frame,
  5845. - WMA_TX_FRAME_BUFFER_NO_FREE);
  5846. + tx_frm_download_comp_cb(wma_handle->mac_context, tx_frame, 0);
  5847. }
  5848.  
  5849. return VOS_STATUS_SUCCESS;
  5850. @@ -26993,7 +26953,6 @@ int wma_dfs_indicate_radar(struct ieee80211com *ic,
  5851. struct wma_dfs_radar_indication *radar_event;
  5852. struct hdd_dfs_radar_ind hdd_radar_event;
  5853. void *vos_context = vos_get_global_context(VOS_MODULE_ID_WDA, NULL);
  5854. - tpAniSirGlobal pmac = NULL;
  5855.  
  5856. wma = (tp_wma_handle) vos_get_context(VOS_MODULE_ID_WDA, vos_context);
  5857.  
  5858. @@ -27004,9 +26963,6 @@ int wma_dfs_indicate_radar(struct ieee80211com *ic,
  5859. }
  5860.  
  5861. hdd_ctx = vos_get_context(VOS_MODULE_ID_HDD,wma->vos_context);
  5862. - pmac = (tpAniSirGlobal)
  5863. - vos_get_context(VOS_MODULE_ID_PE, wma->vos_context);
  5864. -
  5865. if (wma->dfs_ic != ic)
  5866. {
  5867. WMA_LOGE("%s:DFS- Invalid WMA handle",__func__);
  5868. @@ -27022,11 +26978,8 @@ int wma_dfs_indicate_radar(struct ieee80211com *ic,
  5869.  
  5870. /*
  5871. * Do not post multiple Radar events on the same channel.
  5872. - * But, when DFS test mode is enabled, allow multiple dfs
  5873. - * radar events to be posted on the same channel.
  5874. */
  5875. - if ((ichan->ic_ieee != (wma->dfs_ic->last_radar_found_chan)) ||
  5876. - ( pmac->sap.SapDfsInfo.disable_dfs_ch_switch == VOS_TRUE) )
  5877. + if ( ichan->ic_ieee != (wma->dfs_ic->last_radar_found_chan) )
  5878. {
  5879. wma->dfs_ic->last_radar_found_chan = ichan->ic_ieee;
  5880. /* Indicate the radar event to HDD to stop the netif Tx queues*/
  5881. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/WMA/wma.h b/drivers/staging/qcacld-2.0/CORE/SERVICES/WMA/wma.h
  5882. index fa6f7f7..2a3c0e1 100644
  5883. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/WMA/wma.h
  5884. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/WMA/wma.h
  5885. @@ -83,8 +83,6 @@
  5886. #define WMA_RESUME_TIMEOUT 3000
  5887. #define WMA_TGT_WOW_TX_COMPLETE_TIMEOUT 2000
  5888. #define MAX_MEM_CHUNKS 32
  5889. -#define WMA_CRASH_INJECT_TIMEOUT 5000
  5890. -
  5891. /*
  5892. In prima 12 HW stations are supported including BCAST STA(staId 0)
  5893. and SELF STA(staId 1) so total ASSOC stations which can connect to Prima
  5894. @@ -587,8 +585,6 @@ typedef struct {
  5895. vos_event_t wma_resume_event;
  5896. vos_event_t target_suspend;
  5897. vos_event_t wow_tx_complete;
  5898. - vos_event_t recovery_event;
  5899. -
  5900. t_cfg_nv_param cfg_nv;
  5901.  
  5902. v_U16_t max_station;
  5903. @@ -1130,8 +1126,6 @@ u_int16_t get_regdmn_5g(u_int32_t reg_dmn);
  5904. * TODO: Need to Revist the Timing
  5905. */
  5906. #define WMA_TX_FRAME_COMPLETE_TIMEOUT 1000
  5907. -#define WMA_TX_FRAME_BUFFER_NO_FREE 0
  5908. -#define WMA_TX_FRAME_BUFFER_FREE 1
  5909.  
  5910. struct wma_tx_ack_work_ctx {
  5911. tp_wma_handle wma_handle;
  5912. @@ -1555,7 +1549,4 @@ typedef struct wma_roam_invoke_cmd
  5913. u_int8_t bssid[6];
  5914. v_U32_t channel;
  5915. }t_wma_roam_invoke_cmd;
  5916. -
  5917. -int wma_crash_inject(tp_wma_handle wma_handle, uint32_t type,
  5918. - uint32_t delay_time_ms);
  5919. #endif
  5920. diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/WMI/wmi_unified.c b/drivers/staging/qcacld-2.0/CORE/SERVICES/WMI/wmi_unified.c
  5921. index 346ea83..3605741 100644
  5922. --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/WMI/wmi_unified.c
  5923. +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/WMI/wmi_unified.c
  5924. @@ -235,7 +235,7 @@ static u_int8_t* get_wmi_cmd_string(WMI_CMD_ID wmi_command)
  5925. CASE_RETURN_STRING(WMI_VDEV_PLMREQ_START_CMDID);
  5926. CASE_RETURN_STRING(WMI_VDEV_PLMREQ_STOP_CMDID);
  5927. CASE_RETURN_STRING(WMI_VDEV_TSF_TSTAMP_ACTION_CMDID);
  5928. - CASE_RETURN_STRING(WMI_VDEV_SET_IE_CMDID);
  5929. +
  5930. /* peer specific commands */
  5931.  
  5932. /** create a peer */
  5933. @@ -486,7 +486,7 @@ static u_int8_t* get_wmi_cmd_string(WMI_CMD_ID wmi_command)
  5934. CASE_RETURN_STRING(WMI_SET_MCASTBCAST_FILTER_CMDID);
  5935. /** set thermal management params **/
  5936. CASE_RETURN_STRING(WMI_THERMAL_MGMT_CMDID);
  5937. - CASE_RETURN_STRING(WMI_RSSI_BREACH_MONITOR_CONFIG_CMDID);
  5938. +
  5939. /* GPIO Configuration */
  5940. CASE_RETURN_STRING(WMI_GPIO_CONFIG_CMDID);
  5941. CASE_RETURN_STRING(WMI_GPIO_OUTPUT_CMDID);
  5942. @@ -576,7 +576,6 @@ static u_int8_t* get_wmi_cmd_string(WMI_CMD_ID wmi_command)
  5943. CASE_RETURN_STRING(WMI_REQUEST_LINK_STATS_CMDID);
  5944. CASE_RETURN_STRING(WMI_START_LINK_STATS_CMDID);
  5945. CASE_RETURN_STRING(WMI_CLEAR_LINK_STATS_CMDID);
  5946. - CASE_RETURN_STRING(WMI_GET_FW_MEM_DUMP_CMDID);
  5947. CASE_RETURN_STRING(WMI_LPI_MGMT_SNOOPING_CONFIG_CMDID);
  5948. CASE_RETURN_STRING(WMI_LPI_START_SCAN_CMDID);
  5949. CASE_RETURN_STRING(WMI_LPI_STOP_SCAN_CMDID);
  5950. @@ -622,11 +621,6 @@ static u_int8_t* get_wmi_cmd_string(WMI_CMD_ID wmi_command)
  5951. CASE_RETURN_STRING(WMI_DCC_CLEAR_STATS_CMDID);
  5952. CASE_RETURN_STRING(WMI_DCC_UPDATE_NDL_CMDID);
  5953. CASE_RETURN_STRING(WMI_ROAM_FILTER_CMDID);
  5954. - CASE_RETURN_STRING(WMI_ROAM_SUBNET_CHANGE_CONFIG_CMDID);
  5955. - CASE_RETURN_STRING(WMI_DEBUG_MESG_FLUSH_CMDID);
  5956. - CASE_RETURN_STRING(WMI_PEER_SET_RATE_REPORT_CONDITION_CMDID);
  5957. - CASE_RETURN_STRING(WMI_SOC_SET_PCL_CMDID);
  5958. - CASE_RETURN_STRING(WMI_SOC_SET_HW_MODE_CMDID);
  5959. }
  5960. return "Invalid WMI cmd";
  5961. }
  5962. diff --git a/drivers/staging/qcacld-2.0/CORE/SME/inc/csrApi.h b/drivers/staging/qcacld-2.0/CORE/SME/inc/csrApi.h
  5963. index 5a4d2ca..c7becac 100644
  5964. --- a/drivers/staging/qcacld-2.0/CORE/SME/inc/csrApi.h
  5965. +++ b/drivers/staging/qcacld-2.0/CORE/SME/inc/csrApi.h
  5966. @@ -1242,7 +1242,6 @@ typedef struct tagCsrConfigParam
  5967.  
  5968. tANI_BOOLEAN obssEnabled;
  5969.  
  5970. - v_U16_t pkt_err_disconn_th;
  5971. }tCsrConfigParam;
  5972.  
  5973. //Tush
  5974. diff --git a/drivers/staging/qcacld-2.0/CORE/SME/inc/csrInternal.h b/drivers/staging/qcacld-2.0/CORE/SME/inc/csrInternal.h
  5975. index a7a00cb..dad34cd 100644
  5976. --- a/drivers/staging/qcacld-2.0/CORE/SME/inc/csrInternal.h
  5977. +++ b/drivers/staging/qcacld-2.0/CORE/SME/inc/csrInternal.h
  5978. @@ -675,7 +675,6 @@ typedef struct tagCsrConfig
  5979. tANI_BOOLEAN isRoamOffloadEnabled;
  5980. #endif
  5981. tANI_BOOLEAN obssEnabled;
  5982. - v_U16_t pkt_err_disconn_th;
  5983. }tCsrConfig;
  5984.  
  5985. typedef struct tagCsrChannelPowerInfo
  5986. @@ -797,9 +796,12 @@ typedef struct tagCsrScanStruct
  5987. tANI_S8 inScanResultBestAPRssi;
  5988. eCsrBand scanBandPreference; //This defines the band perference for scan
  5989. csrScanCompleteCallback callback11dScanDone;
  5990. - bool fcc_constraint;
  5991. }tCsrScanStruct;
  5992.  
  5993. +
  5994. +
  5995. +
  5996. +
  5997. //Save the connected information. This structure + connectedProfile
  5998. //should contain all information about the connection
  5999. typedef struct tagRoamCsrConnectedInfo
  6000. diff --git a/drivers/staging/qcacld-2.0/CORE/SME/inc/sme_Api.h b/drivers/staging/qcacld-2.0/CORE/SME/inc/sme_Api.h
  6001. index 69d803da..320d476 100644
  6002. --- a/drivers/staging/qcacld-2.0/CORE/SME/inc/sme_Api.h
  6003. +++ b/drivers/staging/qcacld-2.0/CORE/SME/inc/sme_Api.h
  6004. @@ -3802,7 +3802,7 @@ tANI_U32 sme_GetChannelBondingMode24G(tHalHandle hHal);
  6005.  
  6006. typedef struct sStatsExtRequestReq {
  6007. tANI_U32 request_data_len;
  6008. - tANI_U8* request_data;
  6009. + const tANI_U8* request_data;
  6010. } tStatsExtRequestReq, *tpStatsExtRequestReq;
  6011.  
  6012. typedef void (* StatsExtCallback)(void *, tStatsExtEvent *);
  6013. @@ -4127,7 +4127,4 @@ uint8_t sme_is_any_session_in_connected_state(tHalHandle h_hal);
  6014.  
  6015. bool smeNeighborRoamIsHandoffInProgress(tHalHandle hHal, tANI_U8 sessionId);
  6016.  
  6017. -eHalStatus sme_disable_non_fcc_channel(tHalHandle hHal,
  6018. - bool fcc_constraint);
  6019. -
  6020. #endif //#if !defined( __SME_API_H )
  6021. diff --git a/drivers/staging/qcacld-2.0/CORE/SME/src/csr/csrApiRoam.c b/drivers/staging/qcacld-2.0/CORE/SME/src/csr/csrApiRoam.c
  6022. index 04cebbb0..68973b3 100644
  6023. --- a/drivers/staging/qcacld-2.0/CORE/SME/src/csr/csrApiRoam.c
  6024. +++ b/drivers/staging/qcacld-2.0/CORE/SME/src/csr/csrApiRoam.c
  6025. @@ -485,12 +485,6 @@ eHalStatus csrUpdateChannelList(tpAniSirGlobal pMac)
  6026.  
  6027. for (i = 0; i < pScan->base20MHzChannels.numChannels; i++)
  6028. {
  6029. - if (pScan->fcc_constraint) {
  6030. - if (pScan->base20MHzChannels.channelList[i] == 12)
  6031. - continue;
  6032. - if (pScan->base20MHzChannels.channelList[i] == 13)
  6033. - continue;
  6034. - }
  6035. channel_state =
  6036. vos_nv_getChannelEnabledState(
  6037. pScan->base20MHzChannels.channelList[i]);
  6038. @@ -1621,7 +1615,6 @@ eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pPa
  6039.  
  6040. if(pParam)
  6041. {
  6042. - pMac->roam.configParam.pkt_err_disconn_th = pParam->pkt_err_disconn_th;
  6043. pMac->roam.configParam.WMMSupportMode = pParam->WMMSupportMode;
  6044. pMac->roam.configParam.Is11eSupportEnabled = pParam->Is11eSupportEnabled;
  6045. pMac->roam.configParam.FragmentationThreshold = pParam->FragmentationThreshold;
  6046. @@ -7857,6 +7850,33 @@ eHalStatus csrRoamSaveConnectedInfomation(tpAniSirGlobal pMac, tANI_U32 sessionI
  6047. return (status);
  6048. }
  6049.  
  6050. +
  6051. +static boolean is_disconnect_pending(tpAniSirGlobal pmac,
  6052. + uint8_t sessionid)
  6053. +{
  6054. + tListElem *entry = NULL;
  6055. + tListElem *next_entry = NULL;
  6056. + tSmeCmd *command = NULL;
  6057. + bool disconnect_cmd_exist = false;
  6058. +
  6059. + csrLLLock(&pmac->sme.smeCmdPendingList);
  6060. + entry = csrLLPeekHead(&pmac->sme.smeCmdPendingList, LL_ACCESS_NOLOCK);
  6061. + while (entry) {
  6062. + next_entry = csrLLNext(&pmac->sme.smeCmdPendingList,
  6063. + entry, LL_ACCESS_NOLOCK);
  6064. +
  6065. + command = GET_BASE_ADDR(entry, tSmeCmd, Link);
  6066. + if (command && CSR_IS_DISCONNECT_COMMAND(command) &&
  6067. + command->sessionId == sessionid){
  6068. + disconnect_cmd_exist = true;
  6069. + break;
  6070. + }
  6071. + entry = next_entry;
  6072. + }
  6073. + csrLLUnlock(&pmac->sme.smeCmdPendingList);
  6074. + return disconnect_cmd_exist;
  6075. +}
  6076. +
  6077. static void csrRoamJoinRspProcessor( tpAniSirGlobal pMac, tSirSmeJoinRsp *pSmeJoinRsp )
  6078. {
  6079. tListElem *pEntry = NULL;
  6080. @@ -7898,6 +7918,7 @@ static void csrRoamJoinRspProcessor( tpAniSirGlobal pMac, tSirSmeJoinRsp *pSmeJo
  6081. else
  6082. {
  6083. tANI_U32 roamId = 0;
  6084. + bool is_dis_pending;
  6085. //The head of the active list is the request we sent
  6086. //Try to get back the same profile and roam again
  6087. if(pCommand)
  6088. @@ -7916,7 +7937,14 @@ static void csrRoamJoinRspProcessor( tpAniSirGlobal pMac, tSirSmeJoinRsp *pSmeJo
  6089. csrNeighborRoamIndicateConnect(pMac, pSmeJoinRsp->sessionId, VOS_STATUS_E_FAILURE);
  6090. }
  6091. #endif
  6092. - if (pCommand && (pSession->join_bssid_count < CSR_MAX_BSSID_COUNT))
  6093. + /*
  6094. + * if userspace has issued disconnection,
  6095. + * driver should not continue connecting
  6096. + */
  6097. + is_dis_pending = is_disconnect_pending(pMac, pSession->sessionId);
  6098. +
  6099. + if (pCommand && (pSession->join_bssid_count < CSR_MAX_BSSID_COUNT) &&
  6100. + !is_dis_pending)
  6101. {
  6102. if(CSR_IS_WDS_STA( &pCommand->u.roamCmd.roamProfile ))
  6103. {
  6104. @@ -7947,6 +7975,10 @@ static void csrRoamJoinRspProcessor( tpAniSirGlobal pMac, tSirSmeJoinRsp *pSmeJo
  6105. if (pSession->join_bssid_count >= CSR_MAX_BSSID_COUNT)
  6106. VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
  6107. FL("Excessive Join Request Failures"));
  6108. +
  6109. + if (is_dis_pending)
  6110. + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
  6111. + FL("disconnect is pending, complete roam"));
  6112. pSession->join_bssid_count = 0;
  6113. csrRoamComplete(pMac, eCsrNothingToJoin, NULL);
  6114. }
  6115. @@ -14967,7 +14999,7 @@ eHalStatus csrSendMBAddSelfStaReqMsg( tpAniSirGlobal pMac,
  6116. pMsg->type = pAddStaReq->type;
  6117. pMsg->subType = pAddStaReq->subType;
  6118. pMsg->sessionId = sessionId;
  6119. - pMsg->pkt_err_disconn_th = pMac->roam.configParam.pkt_err_disconn_th;
  6120. +
  6121. smsLog( pMac, LOG1, FL("selfMac="MAC_ADDRESS_STR),
  6122. MAC_ADDR_ARRAY(pMsg->selfMacAddr));
  6123. status = palSendMBMessage(pMac->hHdd, pMsg);
  6124. diff --git a/drivers/staging/qcacld-2.0/CORE/SME/src/csr/csrApiScan.c b/drivers/staging/qcacld-2.0/CORE/SME/src/csr/csrApiScan.c
  6125. index ae75a70..44c5802 100644
  6126. --- a/drivers/staging/qcacld-2.0/CORE/SME/src/csr/csrApiScan.c
  6127. +++ b/drivers/staging/qcacld-2.0/CORE/SME/src/csr/csrApiScan.c
  6128. @@ -7680,11 +7680,6 @@ void csrSetCfgValidChannelList( tpAniSirGlobal pMac, tANI_U8 *pChannelList, tANI
  6129. {
  6130. VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO,
  6131. "Scan offload is enabled, update default chan list");
  6132. - /*
  6133. - * disable fcc constraint since new country code
  6134. - * is being set
  6135. - */
  6136. - pMac->scan.fcc_constraint = false;
  6137. status = csrUpdateChannelList(pMac);
  6138. if (eHAL_STATUS_SUCCESS != status)
  6139. {
  6140. diff --git a/drivers/staging/qcacld-2.0/CORE/SME/src/sme_common/sme_Api.c b/drivers/staging/qcacld-2.0/CORE/SME/src/sme_common/sme_Api.c
  6141. index 6f2b350..ed3e730 100644
  6142. --- a/drivers/staging/qcacld-2.0/CORE/SME/src/sme_common/sme_Api.c
  6143. +++ b/drivers/staging/qcacld-2.0/CORE/SME/src/sme_common/sme_Api.c
  6144. @@ -444,6 +444,8 @@ tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac )
  6145. }
  6146. pEntry = csrLLNext( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_NOLOCK );
  6147. }
  6148. + /* Increament static variable so that it prints pending command only once*/
  6149. + smeCommandQueueFull++;
  6150. csrLLUnlock(&pMac->sme.smeCmdPendingList);
  6151.  
  6152. idx = 1;
  6153. @@ -11620,19 +11622,19 @@ VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode, tANI_U8 ch
  6154. {
  6155. if (pMac->roam.configParam.channelBondingMode5GHz) {
  6156. if ( channel== 36 || channel == 52 || channel == 100 ||
  6157. - channel == 116 || channel == 149 || channel == 132)
  6158. + channel == 116 || channel == 149 )
  6159. {
  6160. smeConfig.csrConfig.channelBondingMode5GHz =
  6161. eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW;
  6162. }
  6163. else if ( channel == 40 || channel == 56 || channel == 104 ||
  6164. - channel == 120 || channel == 153 || channel == 136)
  6165. + channel == 120 || channel == 153 )
  6166. {
  6167. smeConfig.csrConfig.channelBondingMode5GHz =
  6168. eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW;
  6169. }
  6170. else if ( channel == 44 || channel == 60 || channel == 108 ||
  6171. - channel == 124 || channel == 157 || channel == 140)
  6172. + channel == 124 || channel == 157 )
  6173. {
  6174. smeConfig.csrConfig.channelBondingMode5GHz =
  6175. eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH;
  6176. @@ -11643,11 +11645,21 @@ VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode, tANI_U8 ch
  6177. smeConfig.csrConfig.channelBondingMode5GHz =
  6178. eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH;
  6179. }
  6180. - else if ( channel == 165 )
  6181. + else if ( channel == 165 || channel == 140 )
  6182. {
  6183. smeConfig.csrConfig.channelBondingMode5GHz =
  6184. eCSR_INI_SINGLE_CHANNEL_CENTERED;
  6185. }
  6186. + else if ( channel == 132 )
  6187. + {
  6188. + smeConfig.csrConfig.channelBondingMode5GHz =
  6189. + eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY;
  6190. + }
  6191. + else if ( channel == 136 )
  6192. + {
  6193. + smeConfig.csrConfig.channelBondingMode5GHz =
  6194. + eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY;
  6195. + }
  6196. }
  6197. /*TODO: Set HT40+ / HT40- for channel 5-7 based on ACS */
  6198. if (pMac->roam.configParam.channelBondingMode24GHz) {
  6199. @@ -11661,6 +11673,7 @@ VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode, tANI_U8 ch
  6200. smeConfig.csrConfig.channelBondingMode24GHz =
  6201. eCSR_INI_SINGLE_CHANNEL_CENTERED;
  6202. }
  6203. +
  6204. }
  6205. #endif
  6206.  
  6207. @@ -11671,7 +11684,7 @@ VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode, tANI_U8 ch
  6208. if ( channel== 40 || channel == 48 || channel == 56 ||
  6209. channel == 64 || channel == 104 || channel == 112 ||
  6210. channel == 120 || channel == 128 || channel == 136 ||
  6211. - channel == 153 || channel == 161 || channel == 144)
  6212. + channel == 153 || channel == 161 )
  6213. {
  6214. smeConfig.csrConfig.channelBondingMode5GHz =
  6215. eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY;
  6216. @@ -11679,12 +11692,12 @@ VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode, tANI_U8 ch
  6217. else if ( channel== 36 || channel == 44 || channel == 52 ||
  6218. channel == 60 || channel == 100 || channel == 108 ||
  6219. channel == 116 || channel == 124 || channel == 132 ||
  6220. - channel == 149 || channel == 157 || channel == 140)
  6221. + channel == 149 || channel == 157 )
  6222. {
  6223. smeConfig.csrConfig.channelBondingMode5GHz =
  6224. eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY;
  6225. }
  6226. - else if ( channel == 165 )
  6227. + else if ( channel == 165 || channel == 140)
  6228. {
  6229. smeConfig.csrConfig.channelBondingMode5GHz =
  6230. eCSR_INI_SINGLE_CHANNEL_CENTERED;
  6231. @@ -13168,7 +13181,7 @@ void sme_StatsExtRegisterCallback(tHalHandle hHal, StatsExtCallback callback)
  6232.  
  6233. \return eHalStatus
  6234. ******************************************************************************/
  6235. -eHalStatus sme_StatsExtRequest(tANI_U8 session_id, tpStatsExtRequestReq input)
  6236. +eHalStatus sme_StatsExtRequest(tANI_U8 session_id, const tpStatsExtRequestReq input)
  6237. {
  6238. vos_msg_t msg;
  6239. tpStatsExtRequest data;
  6240. @@ -14302,32 +14315,3 @@ bool smeNeighborRoamIsHandoffInProgress(tHalHandle hHal, tANI_U8 sessionId)
  6241. {
  6242. return csrNeighborRoamIsHandoffInProgress(PMAC_STRUCT(hHal), sessionId);
  6243. }
  6244. -
  6245. -/**
  6246. - * sme_disable_non_fcc_channel() - non-fcc channel disable request
  6247. - * @hal: HAL pointer
  6248. - * @fcc_constraint: true: disable, false; enable
  6249. - *
  6250. - * Return: eHalStatus.
  6251. - */
  6252. -eHalStatus sme_disable_non_fcc_channel(tHalHandle hal, bool fcc_constraint)
  6253. -{
  6254. - eHalStatus status = eHAL_STATUS_SUCCESS;
  6255. - tpAniSirGlobal mac_ptr = PMAC_STRUCT(hal);
  6256. -
  6257. - status = sme_AcquireGlobalLock(&mac_ptr->sme);
  6258. -
  6259. - if (eHAL_STATUS_SUCCESS == status) {
  6260. -
  6261. - if (fcc_constraint != mac_ptr->scan.fcc_constraint) {
  6262. - mac_ptr->scan.fcc_constraint = fcc_constraint;
  6263. -
  6264. - /* update the channel list to the firmware */
  6265. - status = csrUpdateChannelList(mac_ptr);
  6266. - }
  6267. -
  6268. - sme_ReleaseGlobalLock(&mac_ptr->sme);
  6269. - }
  6270. -
  6271. - return status;
  6272. -}
  6273. diff --git a/drivers/staging/qcacld-2.0/CORE/SVC/inc/wlan_nlink_srv.h b/drivers/staging/qcacld-2.0/CORE/SVC/inc/wlan_nlink_srv.h
  6274. index e48e936..f746626 100644
  6275. --- a/drivers/staging/qcacld-2.0/CORE/SVC/inc/wlan_nlink_srv.h
  6276. +++ b/drivers/staging/qcacld-2.0/CORE/SVC/inc/wlan_nlink_srv.h
  6277. @@ -44,7 +44,6 @@
  6278. #include <net/netlink.h>
  6279. #include <wlan_nlink_common.h>
  6280.  
  6281. -#define INVALID_PID -1
  6282. #define NLINK_MAX_CALLBACKS (WLAN_NL_MSG_MAX - WLAN_NL_MSG_BASE)
  6283.  
  6284. typedef int (* nl_srv_msg_callback)(struct sk_buff * skb);
  6285. @@ -59,4 +58,8 @@ int nl_srv_register(tWlanNlModTypes msg_type, nl_srv_msg_callback msg_handler);
  6286. int nl_srv_unregister(tWlanNlModTypes msg_type, nl_srv_msg_callback msg_handler);
  6287. int nl_srv_ucast(struct sk_buff * skb, int dst_pid, int flag);
  6288. int nl_srv_bcast(struct sk_buff * skb);
  6289. +#ifdef WLAN_KD_READY_NOTIFIER
  6290. +void nl_srv_nl_ready_indication(void);
  6291. +void nl_srv_nl_close_indication(int pid);
  6292. +#endif /* WLAN_KD_READY_NOTIFIER */
  6293. #endif
  6294. diff --git a/drivers/staging/qcacld-2.0/CORE/SVC/src/logging/wlan_logging_sock_svc.c b/drivers/staging/qcacld-2.0/CORE/SVC/src/logging/wlan_logging_sock_svc.c
  6295. index 8183c63..8f2eaf2 100644
  6296. --- a/drivers/staging/qcacld-2.0/CORE/SVC/src/logging/wlan_logging_sock_svc.c
  6297. +++ b/drivers/staging/qcacld-2.0/CORE/SVC/src/logging/wlan_logging_sock_svc.c
  6298. @@ -49,6 +49,8 @@
  6299.  
  6300. #define ANI_NL_MSG_LOG_TYPE 89
  6301. #define ANI_NL_MSG_READY_IND_TYPE 90
  6302. +#define INVALID_PID -1
  6303. +
  6304. #define MAX_LOGMSG_LENGTH 4096
  6305.  
  6306. struct log_msg {
  6307. @@ -95,6 +97,64 @@ static struct log_msg *gplog_msg;
  6308.  
  6309. /* PID of the APP to log the message */
  6310. static int gapp_pid = INVALID_PID;
  6311. +static char wlan_logging_ready[] = "WLAN LOGGING READY";
  6312. +
  6313. +/*
  6314. + * Broadcast Logging service ready indication to any Logging application
  6315. + * Each netlink message will have a message of type tAniMsgHdr inside.
  6316. + */
  6317. +void wlan_logging_srv_nl_ready_indication(void)
  6318. +{
  6319. + struct sk_buff *skb = NULL;
  6320. + struct nlmsghdr *nlh;
  6321. + tAniNlHdr *wnl = NULL;
  6322. + int payload_len;
  6323. + int err;
  6324. + static int rate_limit;
  6325. +
  6326. + payload_len = sizeof(tAniHdr) + sizeof(wlan_logging_ready) +
  6327. + sizeof(wnl->radio);
  6328. + skb = dev_alloc_skb(NLMSG_SPACE(payload_len));
  6329. + if (NULL == skb) {
  6330. + if (!rate_limit) {
  6331. + LOGGING_TRACE(VOS_TRACE_LEVEL_ERROR,
  6332. + "NLINK: skb alloc fail %s", __func__);
  6333. + }
  6334. + rate_limit = 1;
  6335. + return;
  6336. + }
  6337. + rate_limit = 0;
  6338. +
  6339. + nlh = nlmsg_put(skb, 0, 0, ANI_NL_MSG_LOG, payload_len,
  6340. + NLM_F_REQUEST);
  6341. + if (NULL == nlh) {
  6342. + LOGGING_TRACE(VOS_TRACE_LEVEL_ERROR,
  6343. + "%s: nlmsg_put() failed for msg size[%d]",
  6344. + __func__, payload_len);
  6345. + kfree_skb(skb);
  6346. + return;
  6347. + }
  6348. +
  6349. + wnl = (tAniNlHdr *) nlh;
  6350. + wnl->radio = 0;
  6351. + wnl->wmsg.type = ANI_NL_MSG_READY_IND_TYPE;
  6352. + wnl->wmsg.length = sizeof(wlan_logging_ready);
  6353. + memcpy((char*)&wnl->wmsg + sizeof(tAniHdr),
  6354. + wlan_logging_ready,
  6355. + sizeof(wlan_logging_ready));
  6356. +
  6357. + /* sender is in group 1<<0 */
  6358. + NETLINK_CB(skb).dst_group = WLAN_NLINK_MCAST_GRP_ID;
  6359. +
  6360. + /*multicast the message to all listening processes*/
  6361. + err = nl_srv_bcast(skb);
  6362. + if (err) {
  6363. + LOGGING_TRACE(VOS_TRACE_LEVEL_INFO_LOW,
  6364. + "NLINK: Ready Indication Send Fail %s, err %d",
  6365. + __func__, err);
  6366. + }
  6367. + return;
  6368. +}
  6369.  
  6370. /* Utility function to send a netlink message to an application
  6371. * in user space
  6372. @@ -397,6 +457,7 @@ static int send_filled_buffers_to_user(void)
  6373. skb = NULL;
  6374. gapp_pid = INVALID_PID;
  6375. clear_default_logtoapp_log_level();
  6376. + wlan_logging_srv_nl_ready_indication();
  6377. } else {
  6378. skb = NULL;
  6379. ret = 0;
  6380. @@ -558,6 +619,8 @@ int wlan_logging_sock_activate_svc(int log_fe_to_console, int num_buf)
  6381.  
  6382. nl_srv_register(ANI_NL_MSG_LOG, wlan_logging_proc_sock_rx_msg);
  6383.  
  6384. + /*Broadcast SVC ready message to logging app/s running*/
  6385. + wlan_logging_srv_nl_ready_indication();
  6386. pr_info("%s: Activated wlan_logging svc\n", __func__);
  6387. return 0;
  6388. }
  6389. diff --git a/drivers/staging/qcacld-2.0/CORE/SVC/src/nlink/wlan_nlink_srv.c b/drivers/staging/qcacld-2.0/CORE/SVC/src/nlink/wlan_nlink_srv.c
  6390. index d212aea..c9cdc7e 100644
  6391. --- a/drivers/staging/qcacld-2.0/CORE/SVC/src/nlink/wlan_nlink_srv.c
  6392. +++ b/drivers/staging/qcacld-2.0/CORE/SVC/src/nlink/wlan_nlink_srv.c
  6393. @@ -43,12 +43,17 @@
  6394. #include <wlan_nlink_srv.h>
  6395. #include <vos_trace.h>
  6396.  
  6397. -/* Global variables */
  6398. +//Global variables
  6399. static DEFINE_MUTEX(nl_srv_sem);
  6400. static struct sock *nl_srv_sock;
  6401. static nl_srv_msg_callback nl_srv_msg_handler[NLINK_MAX_CALLBACKS];
  6402.  
  6403. -/* Forward declaration */
  6404. +#ifdef WLAN_KD_READY_NOTIFIER
  6405. +const char driverLoaded[] = "KNLREADY";
  6406. +const char driverUnLoaded[] = "KNLCLOSE";
  6407. +#endif /* WLAN_KD_READY_NOTIFIER */
  6408. +
  6409. +//Forward declaration
  6410. static void nl_srv_rcv (struct sk_buff *sk);
  6411. static void nl_srv_rcv_skb (struct sk_buff *skb);
  6412. static void nl_srv_rcv_msg (struct sk_buff *skb, struct nlmsghdr *nlh);
  6413. @@ -98,6 +103,12 @@ void nl_srv_exit(int dst_pid)
  6414. void nl_srv_exit(void)
  6415. #endif /* WLAN_KD_READY_NOTIFIER */
  6416. {
  6417. +#ifdef WLAN_KD_READY_NOTIFIER
  6418. + if (0 != dst_pid)
  6419. + {
  6420. + nl_srv_nl_close_indication(dst_pid);
  6421. + }
  6422. +#endif /* WLAN_KD_READY_NOTIFIER */
  6423. netlink_kernel_release(nl_srv_sock);
  6424. }
  6425.  
  6426. @@ -287,3 +298,93 @@ static void nl_srv_rcv_msg (struct sk_buff *skb, struct nlmsghdr *nlh)
  6427. "NLINK: No handler for Netlink Msg [0x%X]", type);
  6428. }
  6429. }
  6430. +
  6431. +#ifdef WLAN_KD_READY_NOTIFIER
  6432. +/*
  6433. + * Send Net Link interface ready indication to application daemon
  6434. + * Each netlink message will have a message of type tAniMsgHdr inside.
  6435. + */
  6436. +void nl_srv_nl_ready_indication
  6437. +(
  6438. + void
  6439. +)
  6440. +{
  6441. + struct sk_buff *skb = NULL;
  6442. + struct nlmsghdr *nlh;
  6443. + int err;
  6444. +
  6445. + skb = alloc_skb(NLMSG_SPACE(sizeof(driverLoaded)), GFP_KERNEL);
  6446. + if (NULL == skb)
  6447. + {
  6448. + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
  6449. + "NLINK: skb alloc fail %s", __func__);
  6450. + return;
  6451. + }
  6452. +
  6453. + nlh = (struct nlmsghdr *)skb->data;
  6454. + nlh->nlmsg_pid = 0; /* from kernel */
  6455. + nlh->nlmsg_flags = 0;
  6456. + nlh->nlmsg_seq = 0;
  6457. + nlh->nlmsg_len = sizeof(driverLoaded);
  6458. + memcpy(((char *)nlh) + sizeof(struct nlmsghdr),
  6459. + driverLoaded,
  6460. + sizeof(driverLoaded));
  6461. + skb_put(skb, NLMSG_SPACE(sizeof(driverLoaded)));
  6462. +
  6463. + /* sender is in group 1<<0 */
  6464. + NETLINK_CB(skb).dst_group = WLAN_NLINK_MCAST_GRP_ID;
  6465. +
  6466. + /*multicast the message to all listening processes*/
  6467. + err = netlink_broadcast(nl_srv_sock, skb, 0, 1, GFP_KERNEL);
  6468. + if (err)
  6469. + {
  6470. + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_LOW,
  6471. + "NLINK: Ready Indication Send Fail %s, err %d",
  6472. + __func__, err);
  6473. + }
  6474. + return;
  6475. +}
  6476. +
  6477. +/*
  6478. + * Send Net Link interface close indication to application daemon
  6479. + * Each netlink message will have a message of type tAniMsgHdr inside.
  6480. + */
  6481. +void nl_srv_nl_close_indication
  6482. +(
  6483. + int pid
  6484. +)
  6485. +{
  6486. + struct sk_buff *skb = NULL;
  6487. + struct nlmsghdr *nlh;
  6488. + int err;
  6489. +
  6490. + skb = alloc_skb(sizeof(driverUnLoaded),GFP_KERNEL);
  6491. + if (NULL == skb)
  6492. + {
  6493. + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
  6494. + "NLINK: skb alloc fail %s", __func__);
  6495. + return;
  6496. + }
  6497. +
  6498. + nlh = (struct nlmsghdr *)skb->data;
  6499. + nlh->nlmsg_pid = 0; /* from kernel */
  6500. + nlh->nlmsg_flags = 0;
  6501. + nlh->nlmsg_seq = 0;
  6502. + nlh->nlmsg_len = sizeof(driverUnLoaded);
  6503. + memcpy(((char *)nlh) + sizeof(struct nlmsghdr),
  6504. + driverUnLoaded,
  6505. + sizeof(driverUnLoaded));
  6506. + skb_put(skb, NLMSG_SPACE(sizeof(driverUnLoaded)));
  6507. +
  6508. + /* sender is in group 1<<0 */
  6509. + NETLINK_CB(skb).dst_group = 0;
  6510. + err = netlink_unicast(nl_srv_sock, skb, pid, MSG_DONTWAIT);
  6511. + if (err)
  6512. + {
  6513. + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_LOW,
  6514. + "NLINK: Close Indication Send Fail %s", __func__);
  6515. + }
  6516. +
  6517. + return;
  6518. +}
  6519. +#endif /* WLAN_KD_READY_NOTIFIER */
  6520. diff --git a/drivers/staging/qcacld-2.0/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c b/drivers/staging/qcacld-2.0/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c
  6521. index 2264d34..d2ea494 100644
  6522. --- a/drivers/staging/qcacld-2.0/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c
  6523. +++ b/drivers/staging/qcacld-2.0/CORE/SVC/src/ptt/wlan_ptt_sock_svc.c
  6524. @@ -115,11 +115,15 @@ static void ptt_sock_proc_reg_req(tAniHdr *wmsg, int radio)
  6525. tAniNlAppRegRsp rspmsg;
  6526. reg_req = (tAniNlAppRegReq *)(wmsg + 1);
  6527. memset((char *)&rspmsg, 0, sizeof(rspmsg));
  6528. - /* send reg response message to the application */
  6529. + //send reg response message to the application
  6530. rspmsg.ret = ANI_NL_MSG_OK;
  6531. rspmsg.regReq.type = reg_req->type;
  6532. -
  6533. - /* Save the pid */
  6534. +#ifdef WLAN_KD_READY_NOTIFIER
  6535. + /* NL client try to registration
  6536. + * to make sure connection, broadcast READY notification */
  6537. + nl_srv_nl_ready_indication();
  6538. +#endif /* WLAN_KD_READY_NOTIFIER */
  6539. + /*Save the pid*/
  6540. pAdapterHandle->ptt_pid = reg_req->pid;
  6541. rspmsg.regReq.pid= reg_req->pid;
  6542. rspmsg.wniHdr.type = cpu_to_be16(ANI_MSG_APP_REG_RSP);
  6543. @@ -162,7 +166,7 @@ static int ptt_sock_rx_nlink_msg (struct sk_buff * skb)
  6544. radio = wnl->radio;
  6545. type = wnl->nlh.nlmsg_type;
  6546. switch (type) {
  6547. - case ANI_NL_MSG_PUMAC: // Message from the PTT socket APP
  6548. + case ANI_NL_MSG_PUMAC: //Message from the PTT socket APP
  6549. PTT_TRACE(VOS_TRACE_LEVEL_INFO, "%s: Received ANI_NL_MSG_PUMAC Msg [0x%X]\n",
  6550. __func__, type);
  6551. ptt_proc_pumac_msg(skb, &wnl->wmsg, radio);
  6552. @@ -176,9 +180,11 @@ static int ptt_sock_rx_nlink_msg (struct sk_buff * skb)
  6553. int ptt_sock_activate_svc(void *pAdapter)
  6554. {
  6555. pAdapterHandle = (struct hdd_context_s*)pAdapter;
  6556. - pAdapterHandle->ptt_pid = INVALID_PID;
  6557. nl_srv_register(ANI_NL_MSG_PUMAC, ptt_sock_rx_nlink_msg);
  6558. nl_srv_register(ANI_NL_MSG_PTT, ptt_sock_rx_nlink_msg);
  6559. +#ifdef WLAN_KD_READY_NOTIFIER
  6560. + nl_srv_nl_ready_indication();
  6561. +#endif /* WLAN_KD_READY_NOTIFIER */
  6562. return 0;
  6563. }
  6564. -#endif // PTT_SOCK_SVC_ENABLE
  6565. +#endif //PTT_SOCK_SVC_ENABLE
  6566. diff --git a/drivers/staging/qcacld-2.0/CORE/SYS/legacy/src/system/src/macInitApi.c b/drivers/staging/qcacld-2.0/CORE/SYS/legacy/src/system/src/macInitApi.c
  6567. index 21a0d50..d50a868 100644
  6568. --- a/drivers/staging/qcacld-2.0/CORE/SYS/legacy/src/system/src/macInitApi.c
  6569. +++ b/drivers/staging/qcacld-2.0/CORE/SYS/legacy/src/system/src/macInitApi.c
  6570. @@ -62,14 +62,41 @@ tSirRetStatus macReset(tpAniSirGlobal pMac, tANI_U32 rc);
  6571.  
  6572. tSirRetStatus macPreStart(tHalHandle hHal)
  6573. {
  6574. + tSirRetStatus status = eSIR_SUCCESS;
  6575. + tANI_BOOLEAN memAllocFailed = eANI_BOOLEAN_FALSE;
  6576. tpAniSirGlobal pMac = (tpAniSirGlobal) hHal;
  6577. + tANI_U8 i;
  6578. +
  6579. + for(i=0; i<MAX_DUMP_TABLE_ENTRY; i++)
  6580. + {
  6581. + pMac->dumpTableEntry[i] = vos_mem_malloc(sizeof(tDumpModuleEntry));
  6582. + if ( NULL == pMac->dumpTableEntry[i] )
  6583. + {
  6584. + memAllocFailed = eANI_BOOLEAN_TRUE;
  6585. + break;
  6586. + }
  6587. + else
  6588. + {
  6589. + vos_mem_set(pMac->dumpTableEntry[i], sizeof(tSirMbMsg), 0);
  6590. + }
  6591. + }
  6592. + if( memAllocFailed )
  6593. + {
  6594. + while(i>0)
  6595. + {
  6596. + i--;
  6597. + vos_mem_free(pMac->dumpTableEntry[i]);
  6598. + }
  6599. + sysLog(pMac, LOGE, FL("pMac->dumpTableEntry is NULL\n"));
  6600. + status = eSIR_FAILURE;
  6601. + }
  6602.  
  6603. #if defined(ANI_LOGDUMP)
  6604. //logDumpInit must be called before any module starts
  6605. logDumpInit(pMac);
  6606. #endif //#if defined(ANI_LOGDUMP)
  6607.  
  6608. - return eSIR_SUCCESS;
  6609. + return status;
  6610. }
  6611.  
  6612. tSirRetStatus macStart(tHalHandle hHal, void* pHalMacStartParams)
  6613. @@ -125,6 +152,7 @@ tSirRetStatus macStart(tHalHandle hHal, void* pHalMacStartParams)
  6614.  
  6615. tSirRetStatus macStop(tHalHandle hHal, tHalStopType stopType)
  6616. {
  6617. + tANI_U8 i;
  6618. tpAniSirGlobal pMac = (tpAniSirGlobal) hHal;
  6619. peStop(pMac);
  6620. cfgCleanup( pMac );
  6621. @@ -135,6 +163,11 @@ tSirRetStatus macStop(tHalHandle hHal, tHalStopType stopType)
  6622. vos_mem_free(pMac->pResetMsg);
  6623. pMac->pResetMsg = NULL;
  6624. }
  6625. + /* Free the DumpTableEntry */
  6626. + for(i=0; i<MAX_DUMP_TABLE_ENTRY; i++)
  6627. + {
  6628. + vos_mem_free(pMac->dumpTableEntry[i]);
  6629. + }
  6630.  
  6631. return eSIR_SUCCESS;
  6632. }
  6633. @@ -153,8 +186,6 @@ tSirRetStatus macOpen(tHalHandle *pHalHandle, tHddHandle hHdd, tMacOpenParameter
  6634. {
  6635. tpAniSirGlobal p_mac = NULL;
  6636. tSirRetStatus status = eSIR_SUCCESS;
  6637. - uint8_t i =0;
  6638. - bool mem_alloc_failed = false;
  6639.  
  6640. if(pHalHandle == NULL)
  6641. return eSIR_FAILURE;
  6642. @@ -215,34 +246,6 @@ tSirRetStatus macOpen(tHalHandle *pHalHandle, tHddHandle hHdd, tMacOpenParameter
  6643. if (eSIR_SUCCESS != status) {
  6644. vos_mem_free(p_mac);
  6645. sysLog(p_mac, LOGE, FL("macOpen failure\n"));
  6646. - return status;
  6647. - }
  6648. -
  6649. - for (i=0; i<MAX_DUMP_TABLE_ENTRY; i++)
  6650. - {
  6651. - p_mac->dumpTableEntry[i] = vos_mem_malloc(sizeof(tDumpModuleEntry));
  6652. - if (NULL == p_mac->dumpTableEntry[i])
  6653. - {
  6654. - mem_alloc_failed = eANI_BOOLEAN_TRUE;
  6655. - break;
  6656. - }
  6657. - else
  6658. - {
  6659. - vos_mem_set(p_mac->dumpTableEntry[i], sizeof(tSirMbMsg), 0);
  6660. - }
  6661. - }
  6662. -
  6663. - if (mem_alloc_failed)
  6664. - {
  6665. - while (i>0)
  6666. - {
  6667. - i--;
  6668. - vos_mem_free(p_mac->dumpTableEntry[i]);
  6669. - }
  6670. -
  6671. - peClose(p_mac);
  6672. - vos_mem_free(p_mac);
  6673. - return eSIR_FAILURE;
  6674. }
  6675.  
  6676. return status;
  6677. @@ -260,7 +263,6 @@ tSirRetStatus macClose(tHalHandle hHal)
  6678. {
  6679.  
  6680. tpAniSirGlobal pMac = (tpAniSirGlobal) hHal;
  6681. - uint8_t i =0;
  6682.  
  6683. peClose(pMac);
  6684. pMac->psOffloadEnabled = FALSE;
  6685. @@ -270,12 +272,6 @@ tSirRetStatus macClose(tHalHandle hHal)
  6686.  
  6687. logDeinit(pMac);
  6688.  
  6689. - /* Free the DumpTableEntry */
  6690. - for(i=0; i<MAX_DUMP_TABLE_ENTRY; i++)
  6691. - {
  6692. - vos_mem_free(pMac->dumpTableEntry[i]);
  6693. - }
  6694. -
  6695. // Finally, de-allocate the global MAC datastructure:
  6696. vos_mem_free( pMac );
  6697.  
  6698. diff --git a/drivers/staging/qcacld-2.0/CORE/SYS/legacy/src/system/src/sysEntryFunc.c b/drivers/staging/qcacld-2.0/CORE/SYS/legacy/src/system/src/sysEntryFunc.c
  6699. index 01082e7..ec3bd6f 100644
  6700. --- a/drivers/staging/qcacld-2.0/CORE/SYS/legacy/src/system/src/sysEntryFunc.c
  6701. +++ b/drivers/staging/qcacld-2.0/CORE/SYS/legacy/src/system/src/sysEntryFunc.c
  6702. @@ -190,9 +190,7 @@ sysBbtProcessMessageCore(tpAniSirGlobal pMac, tpSirMsgQ pMsg, tANI_U32 type,
  6703. ret = (tSirRetStatus) limPostMsgApi(pMac, pMsg);
  6704. if (ret != eSIR_SUCCESS)
  6705. {
  6706. - /* Print only one debug failure out of 512 failure messages */
  6707. - if(pMac->sys.gSysBbtReceived & 0x0200)
  6708. - sysLog(pMac, LOGE, FL("posting to LIM2 failed, ret %d\n"), ret);
  6709. + PELOGE(sysLog(pMac, LOGE, FL("posting to LIM2 failed, ret %d\n"), ret);)
  6710. goto fail;
  6711. }
  6712. pMac->sys.gSysBbtPostedToLim++;
  6713. diff --git a/drivers/staging/qcacld-2.0/CORE/TL/inc/wlan_qct_tl.h b/drivers/staging/qcacld-2.0/CORE/TL/inc/wlan_qct_tl.h
  6714. index 1051889..186fc8f 100644
  6715. --- a/drivers/staging/qcacld-2.0/CORE/TL/inc/wlan_qct_tl.h
  6716. +++ b/drivers/staging/qcacld-2.0/CORE/TL/inc/wlan_qct_tl.h
  6717. @@ -2946,8 +2946,6 @@ WLANTL_TLDebugMessage
  6718.  
  6719. }
  6720.  
  6721. -void WLANTL_PauseUnPauseQs(void *vos_context, v_BOOL_t flag);
  6722. -
  6723. #ifdef QCA_LL_TX_FLOW_CT
  6724. /*=============================================================================
  6725. FUNCTION WLANTL_GetTxResource
  6726. diff --git a/drivers/staging/qcacld-2.0/CORE/UTILS/FWLOG/dbglog_host.c b/drivers/staging/qcacld-2.0/CORE/UTILS/FWLOG/dbglog_host.c
  6727. index 82af3c2..0251f86 100644
  6728. --- a/drivers/staging/qcacld-2.0/CORE/UTILS/FWLOG/dbglog_host.c
  6729. +++ b/drivers/staging/qcacld-2.0/CORE/UTILS/FWLOG/dbglog_host.c
  6730. @@ -60,7 +60,7 @@
  6731. static bool appstarted = FALSE;
  6732. static bool senddriverstatus = FALSE;
  6733. static bool kd_nl_init = FALSE;
  6734. -static int cnss_diag_pid = INVALID_PID;
  6735. +static int cnss_diag_pid = 0;
  6736. static int get_version = 0;
  6737. static int gprint_limiter = 0;
  6738.  
  6739. @@ -1647,7 +1647,13 @@ send_fw_diag_nl_data(wmi_unified_t wmi_handle, const u_int8_t *buffer,
  6740. if (WARN_ON(len > ATH6KL_FWLOG_PAYLOAD_SIZE))
  6741. return -ENODEV;
  6742.  
  6743. - if (cnss_diag_pid != INVALID_PID)
  6744. + /* NL is not ready yet, WLAN KO started first */
  6745. + if ((kd_nl_init) && (!cnss_diag_pid))
  6746. + {
  6747. + nl_srv_nl_ready_indication();
  6748. + }
  6749. +
  6750. + if (cnss_diag_pid)
  6751. {
  6752. skb_out = nlmsg_new(len, 0);
  6753. if (!skb_out)
  6754. @@ -1664,7 +1670,6 @@ send_fw_diag_nl_data(wmi_unified_t wmi_handle, const u_int8_t *buffer,
  6755. {
  6756. AR_DEBUG_PRINTF(ATH_DEBUG_RSVD1,
  6757. ("nl_srv_ucast failed 0x%x \n", res));
  6758. - cnss_diag_pid = INVALID_PID;
  6759. return res;
  6760. }
  6761. }
  6762. @@ -1684,7 +1689,12 @@ send_diag_netlink_data(const u_int8_t *buffer,
  6763. if (WARN_ON(len > ATH6KL_FWLOG_PAYLOAD_SIZE))
  6764. return -ENODEV;
  6765.  
  6766. - if (cnss_diag_pid != INVALID_PID) {
  6767. + /* NL is not ready yet, WLAN KO started first */
  6768. + if ((kd_nl_init) && (!cnss_diag_pid)) {
  6769. + nl_srv_nl_ready_indication();
  6770. + }
  6771. +
  6772. + if (cnss_diag_pid) {
  6773. slot_len = sizeof(*slot) + ATH6KL_FWLOG_PAYLOAD_SIZE;
  6774.  
  6775. skb_out = nlmsg_new(slot_len, 0);
  6776. @@ -1708,7 +1718,6 @@ send_diag_netlink_data(const u_int8_t *buffer,
  6777. if (res < 0) {
  6778. AR_DEBUG_PRINTF(ATH_DEBUG_RSVD1,
  6779. ("nl_srv_ucast failed 0x%x \n", res));
  6780. - cnss_diag_pid = INVALID_PID;
  6781. return res;
  6782. }
  6783. }
  6784. @@ -1729,7 +1738,13 @@ dbglog_process_netlink_data(wmi_unified_t wmi_handle, const u_int8_t *buffer,
  6785. if (WARN_ON(len > ATH6KL_FWLOG_PAYLOAD_SIZE))
  6786. return -ENODEV;
  6787.  
  6788. - if (cnss_diag_pid != INVALID_PID)
  6789. + /* NL is not ready yet, WLAN KO started first */
  6790. + if ((kd_nl_init) && (!cnss_diag_pid))
  6791. + {
  6792. + nl_srv_nl_ready_indication();
  6793. + }
  6794. +
  6795. + if (cnss_diag_pid)
  6796. {
  6797. slot_len = sizeof(*slot) + ATH6KL_FWLOG_PAYLOAD_SIZE;
  6798.  
  6799. @@ -1754,7 +1769,6 @@ dbglog_process_netlink_data(wmi_unified_t wmi_handle, const u_int8_t *buffer,
  6800. {
  6801. AR_DEBUG_PRINTF(ATH_DEBUG_RSVD1,
  6802. ("nl_srv_ucast failed 0x%x \n", res));
  6803. - cnss_diag_pid = INVALID_PID;
  6804. return res;
  6805. }
  6806. }
  6807. @@ -4043,6 +4057,7 @@ int cnss_diag_notify_wlan_close()
  6808. if (0 != cnss_diag_pid)
  6809. {
  6810. cnss_diag_send_driver_unloaded();
  6811. + nl_srv_nl_close_indication(cnss_diag_pid);
  6812. cnss_diag_pid = 0;
  6813. }
  6814. return 0;
  6815. diff --git a/drivers/staging/qcacld-2.0/CORE/UTILS/PKTLOG/pktlog_ac.c b/drivers/staging/qcacld-2.0/CORE/UTILS/PKTLOG/pktlog_ac.c
  6816. index 1bd434e..8010176 100644
  6817. --- a/drivers/staging/qcacld-2.0/CORE/UTILS/PKTLOG/pktlog_ac.c
  6818. +++ b/drivers/staging/qcacld-2.0/CORE/UTILS/PKTLOG/pktlog_ac.c
  6819. @@ -341,6 +341,7 @@ pktlog_enable(struct ol_softc *scn, int32_t log_state)
  6820. return 0;
  6821.  
  6822. if (log_state != 0 && !pl_dev->tgt_pktlog_enabled) {
  6823. +
  6824. if (pl_info->buf == NULL) {
  6825. error = pktlog_alloc_buf(scn);
  6826.  
  6827. diff --git a/drivers/staging/qcacld-2.0/CORE/VOSS/inc/wlan_hdd_misc.h b/drivers/staging/qcacld-2.0/CORE/VOSS/inc/wlan_hdd_misc.h
  6828. index 8b94ccf..6235571 100644
  6829. --- a/drivers/staging/qcacld-2.0/CORE/VOSS/inc/wlan_hdd_misc.h
  6830. +++ b/drivers/staging/qcacld-2.0/CORE/VOSS/inc/wlan_hdd_misc.h
  6831. @@ -44,4 +44,7 @@ VOS_STATUS hdd_read_cfg_file(v_VOID_t *pCtx, char *pFileName, v_VOID_t *pBuffer,
  6832.  
  6833. tVOS_CONCURRENCY_MODE hdd_get_concurrency_mode ( void );
  6834.  
  6835. +// BEGIN MOTOROLA IKJB42MAIN-274, dpn473, 01/02/2013, Add flag to disable/enable MCC mode
  6836. +v_U8_t hdd_get_mcc_mode( void );
  6837. +// END IKJB42MAIN-274
  6838. #endif /* WLAN_HDD_MISC_H */
  6839. diff --git a/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_api.c b/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_api.c
  6840. index 4aec700..12b1bb3 100644
  6841. --- a/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_api.c
  6842. +++ b/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_api.c
  6843. @@ -93,7 +93,7 @@
  6844. #elif defined(HIF_SDIO)
  6845. #include "if_ath_sdio.h"
  6846. #endif
  6847. -#include "wma.h"
  6848. +
  6849.  
  6850. /*---------------------------------------------------------------------------
  6851. * Preprocessor Definitions and Constants
  6852. @@ -704,6 +704,7 @@ VOS_STATUS vos_preStart( v_CONTEXT_t vosContext )
  6853. {
  6854. VOS_TRACE(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_FATAL,
  6855. "Failed to WDA prestart");
  6856. + macStop(gpVosContext->pMACContext, HAL_STOP_TYPE_SYS_DEEP_SLEEP);
  6857. ccmStop(gpVosContext->pMACContext);
  6858. VOS_ASSERT(0);
  6859. return VOS_STATUS_E_FAILURE;
  6860. @@ -728,6 +729,7 @@ VOS_STATUS vos_preStart( v_CONTEXT_t vosContext )
  6861. "%s: Test MC thread by posting a probe message to SYS", __func__);
  6862. wlan_sys_probe();
  6863.  
  6864. + macStop(gpVosContext->pMACContext, HAL_STOP_TYPE_SYS_DEEP_SLEEP);
  6865. ccmStop(gpVosContext->pMACContext);
  6866. VOS_ASSERT( 0 );
  6867. return VOS_STATUS_E_FAILURE;
  6868. @@ -738,6 +740,7 @@ VOS_STATUS vos_preStart( v_CONTEXT_t vosContext )
  6869. {
  6870. VOS_TRACE(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_FATAL,
  6871. "Failed to Start HTC");
  6872. + macStop(gpVosContext->pMACContext, HAL_STOP_TYPE_SYS_DEEP_SLEEP);
  6873. ccmStop(gpVosContext->pMACContext);
  6874. VOS_ASSERT( 0 );
  6875. return VOS_STATUS_E_FAILURE;
  6876. @@ -748,6 +751,7 @@ VOS_STATUS vos_preStart( v_CONTEXT_t vosContext )
  6877. VOS_TRACE(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_FATAL,
  6878. "Failed to get ready event from target firmware");
  6879. HTCSetTargetToSleep(scn);
  6880. + macStop(gpVosContext->pMACContext, HAL_STOP_TYPE_SYS_DEEP_SLEEP);
  6881. ccmStop(gpVosContext->pMACContext);
  6882. HTCStop(gpVosContext->htc_ctx);
  6883. VOS_ASSERT( 0 );
  6884. @@ -2453,47 +2457,22 @@ v_BOOL_t vos_is_packet_log_enabled(void)
  6885. return pHddCtx->cfg_ini->enablePacketLog;
  6886. }
  6887.  
  6888. +#if defined(CONFIG_CNSS)
  6889. +/* worker thread to recover when target does not respond over PCIe */
  6890. +void self_recovery_work_handler(struct work_struct *recovery)
  6891. +{
  6892. + cnss_device_self_recovery();
  6893. +}
  6894. +
  6895. +static DECLARE_WORK(self_recovery_work, self_recovery_work_handler);
  6896. +#endif
  6897. +
  6898. void vos_trigger_recovery(void)
  6899. {
  6900. - pVosContextType vos_context;
  6901. - tp_wma_handle wma_handle;
  6902. - VOS_STATUS status = VOS_STATUS_SUCCESS;
  6903. -
  6904. - vos_context = vos_get_global_context(VOS_MODULE_ID_VOSS, NULL);
  6905. - if (!vos_context) {
  6906. - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
  6907. - "VOS context is invald!");
  6908. - return;
  6909. - }
  6910. -
  6911. - wma_handle = (tp_wma_handle)vos_get_context(VOS_MODULE_ID_WDA,
  6912. - vos_context);
  6913. - if (!wma_handle) {
  6914. - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
  6915. - "WMA context is invald!");
  6916. - return;
  6917. - }
  6918. -
  6919. - wma_crash_inject(wma_handle, RECOVERY_SIM_SELF_RECOVERY, 0);
  6920. -
  6921. - status = vos_wait_single_event(&wma_handle->recovery_event,
  6922. - WMA_CRASH_INJECT_TIMEOUT);
  6923. -
  6924. - if (VOS_STATUS_SUCCESS != status) {
  6925. - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
  6926. - "CRASH_INJECT command is timed out!");
  6927. #ifdef CONFIG_CNSS
  6928. - if (vos_is_logp_in_progress(VOS_MODULE_ID_VOSS, NULL)) {
  6929. - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
  6930. - "LOGP is in progress, ignore!");
  6931. - return;
  6932. - }
  6933. - vos_set_logp_in_progress(VOS_MODULE_ID_VOSS, TRUE);
  6934. - cnss_schedule_recovery_work();
  6935. + vos_set_logp_in_progress(VOS_MODULE_ID_VOSS, TRUE);
  6936. + schedule_work(&self_recovery_work);
  6937. #endif
  6938. -
  6939. - return;
  6940. - }
  6941. }
  6942.  
  6943. v_U64_t vos_get_monotonic_boottime(void)
  6944. diff --git a/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_diag.c b/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_diag.c
  6945. index 89de189..24d6829 100644
  6946. --- a/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_diag.c
  6947. +++ b/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_diag.c
  6948. @@ -143,6 +143,14 @@ void vos_log_submit(v_VOID_t *plog_hdr_ptr)
  6949. return;
  6950. }
  6951.  
  6952. +#ifdef WLAN_KD_READY_NOTIFIER
  6953. + /* NL is not ready yet, WLAN KO started first */
  6954. + if ((pHddCtx->kd_nl_init) && (!pHddCtx->ptt_pid))
  6955. + {
  6956. + nl_srv_nl_ready_indication();
  6957. + }
  6958. +#endif /* WLAN_KD_READY_NOTIFIER */
  6959. +
  6960. /* Send the log data to the ptt app only if it is registered with the wlan driver*/
  6961. if(pHddCtx->ptt_pid)
  6962. {
  6963. @@ -174,13 +182,12 @@ void vos_log_submit(v_VOID_t *plog_hdr_ptr)
  6964.  
  6965. memcpy(pBuf, pHdr,data_len);
  6966.  
  6967. - if(pHddCtx->ptt_pid != INVALID_PID)
  6968. + if(pHddCtx->ptt_pid)
  6969. {
  6970. if( ptt_sock_send_msg_to_app(wmsg, 0, ANI_NL_MSG_PUMAC, pHddCtx->ptt_pid) < 0) {
  6971. VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
  6972. ("Ptt Socket error sending message to the app!!"));
  6973. vos_mem_free((v_VOID_t *)wmsg);
  6974. - pHddCtx->ptt_pid = INVALID_PID;
  6975. return;
  6976. }
  6977.  
  6978. @@ -219,8 +226,16 @@ void vos_event_report_payload(v_U16_t event_Id, v_U16_t length, v_VOID_t *pPaylo
  6979. /*Get the Hdd Context */
  6980. pHddCtx = ((VosContextType*)(pVosContext))->pHDDContext;
  6981.  
  6982. +#ifdef WLAN_KD_READY_NOTIFIER
  6983. + /* NL is not ready yet, WLAN KO started first */
  6984. + if ((pHddCtx->kd_nl_init) && (!pHddCtx->ptt_pid))
  6985. + {
  6986. + nl_srv_nl_ready_indication();
  6987. + }
  6988. +#endif /* WLAN_KD_READY_NOTIFIER */
  6989. +
  6990. /* Send the log data to the ptt app only if it is registered with the wlan driver*/
  6991. - if(pHddCtx->ptt_pid != INVALID_PID)
  6992. + if(pHddCtx->ptt_pid)
  6993. {
  6994. total_len = sizeof(tAniHdr)+sizeof(event_report_t)+length;
  6995.  
  6996. @@ -250,7 +265,6 @@ void vos_event_report_payload(v_U16_t event_Id, v_U16_t length, v_VOID_t *pPaylo
  6997. VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
  6998. ("Ptt Socket error sending message to the app!!"));
  6999. vos_mem_free((v_VOID_t*)wmsg);
  7000. - pHddCtx->ptt_pid = INVALID_PID;
  7001. return;
  7002. }
  7003.  
  7004. diff --git a/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_nvitem.c b/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_nvitem.c
  7005. index 6201329..38b1da9 100644
  7006. --- a/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_nvitem.c
  7007. +++ b/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_nvitem.c
  7008. @@ -95,8 +95,7 @@ static v_BOOL_t init_by_reg_core = VOS_FALSE;
  7009. NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
  7010.  
  7011. #define REG_RULE_2GHZ_ALL REG_RULE_2GHZ_CH01_11, \
  7012. - REG_RULE_2GHZ_CH12_13, \
  7013. -REG_RULE_2GHZ_CH14
  7014. + REG_RULE_2GHZ_CH12_13
  7015.  
  7016. #define REG_RULE_5GHZ_ALL REG_RULE_5GHZ_5150_5350, \
  7017. REG_RULE_5GHZ_5470_5850
  7018. diff --git a/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_sched.c b/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_sched.c
  7019. index 401c6e2..2ff3b9f 100644
  7020. --- a/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_sched.c
  7021. +++ b/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_sched.c
  7022. @@ -1008,7 +1008,7 @@ VosMCThread
  7023. } // while message loop processing
  7024. } // while TRUE
  7025. // If we get here the MC thread must exit
  7026. - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
  7027. + VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO,
  7028. "%s: MC Thread exiting!!!!", __func__);
  7029. complete_and_exit(&pSchedContext->McShutdown, 0);
  7030. } /* VosMCThread() */
  7031. @@ -2427,6 +2427,8 @@ void vos_ssr_protect(const char *caller_func)
  7032. unsigned long irq_flags;
  7033.  
  7034. count = atomic_inc_return(&ssr_protect_entry_count);
  7035. + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
  7036. + "%s: ENTRY ACTIVE %d", caller_func, count);
  7037.  
  7038. spin_lock_irqsave(&ssr_protect_lock, irq_flags);
  7039.  
  7040. @@ -2466,6 +2468,8 @@ void vos_ssr_unprotect(const char *caller_func)
  7041. unsigned long irq_flags;
  7042.  
  7043. count = atomic_dec_return(&ssr_protect_entry_count);
  7044. + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
  7045. + "%s: ENTRY INACTIVE %d", caller_func, count);
  7046.  
  7047. spin_lock_irqsave(&ssr_protect_lock, irq_flags);
  7048.  
  7049. diff --git a/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_timer.c b/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_timer.c
  7050. index 9ea7e72..afaf4a4 100644
  7051. --- a/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_timer.c
  7052. +++ b/drivers/staging/qcacld-2.0/CORE/VOSS/src/vos_timer.c
  7053. @@ -443,10 +443,7 @@ VOS_STATUS vos_timer_init_debug( vos_timer_t *timer, VOS_TIMER_TYPE timerType,
  7054. // set the various members of the timer structure
  7055. // with arguments passed or with default values
  7056. spin_lock_init(&timer->platformInfo.spinlock);
  7057. - if (VOS_TIMER_TYPE_SW == timerType)
  7058. - init_timer_deferrable(&(timer->platformInfo.Timer));
  7059. - else
  7060. - init_timer(&(timer->platformInfo.Timer));
  7061. + init_timer(&(timer->platformInfo.Timer));
  7062. timer->platformInfo.Timer.function = vos_linux_timer_callback;
  7063. timer->platformInfo.Timer.data = (unsigned long)timer;
  7064. timer->callback = callback;
  7065. @@ -474,10 +471,7 @@ VOS_STATUS vos_timer_init( vos_timer_t *timer, VOS_TIMER_TYPE timerType,
  7066. // set the various members of the timer structure
  7067. // with arguments passed or with default values
  7068. spin_lock_init(&timer->platformInfo.spinlock);
  7069. - if (VOS_TIMER_TYPE_SW == timerType)
  7070. - init_timer_deferrable(&(timer->platformInfo.Timer));
  7071. - else
  7072. - init_timer(&(timer->platformInfo.Timer));
  7073. + init_timer(&(timer->platformInfo.Timer));
  7074. timer->platformInfo.Timer.function = vos_linux_timer_callback;
  7075. timer->platformInfo.Timer.data = (unsigned long)timer;
  7076. timer->callback = callback;
  7077. diff --git a/drivers/staging/qcacld-2.0/CORE/WDA/inc/legacy/halMsgApi.h b/drivers/staging/qcacld-2.0/CORE/WDA/inc/legacy/halMsgApi.h
  7078. index ec1306d..cff5fad 100644
  7079. --- a/drivers/staging/qcacld-2.0/CORE/WDA/inc/legacy/halMsgApi.h
  7080. +++ b/drivers/staging/qcacld-2.0/CORE/WDA/inc/legacy/halMsgApi.h
  7081. @@ -632,8 +632,6 @@ typedef enum eSmpsModeValue{
  7082. // Msg Type = SIR_LIM_DELETE_STA_CONTEXT_IND
  7083. //
  7084. typedef struct {
  7085. - bool is_tdls;
  7086. - tANI_U8 vdev_id;
  7087. tANI_U16 assocId;
  7088. tANI_U16 staId;
  7089. tSirMacAddr bssId; // TO SUPPORT BT-AMP
  7090. @@ -1418,13 +1416,12 @@ typedef struct sMaxTxPowerPerBandParams
  7091.  
  7092. typedef struct sAddStaSelfParams
  7093. {
  7094. - tSirMacAddr selfMacAddr;
  7095. - tVOS_CON_MODE currDeviceMode;
  7096. + tSirMacAddr selfMacAddr;
  7097. + tVOS_CON_MODE currDeviceMode;
  7098. tANI_U32 type;
  7099. tANI_U32 subType;
  7100. tANI_U8 sessionId;
  7101. - tANI_U32 status;
  7102. - tANI_U16 pkt_err_disconn_th;
  7103. + tANI_U32 status;
  7104. }tAddStaSelfParams, *tpAddStaSelfParams;
  7105.  
  7106. #ifdef FEATURE_WLAN_TDLS
  7107. diff --git a/drivers/staging/qcacld-2.0/Kbuild b/drivers/staging/qcacld-2.0/Kbuild
  7108. index a6337dd..1b70a30 100644
  7109. --- a/drivers/staging/qcacld-2.0/Kbuild
  7110. +++ b/drivers/staging/qcacld-2.0/Kbuild
  7111. @@ -223,7 +223,7 @@ CONFIG_QCA_SINGLE_BINARY_SUPPORT := 0
  7112. CONFIG_TARGET_RAMDUMP_AFTER_KERNEL_PANIC := 1
  7113.  
  7114. #Flag to enable/disable secure firmware feature
  7115. -CONFIG_FEATURE_SECURE_FIRMWARE := 0
  7116. +CONFIG_FEATURE_SECURE_FIRMWARE := 1
  7117.  
  7118. #Flag to enable Stats Ext implementation
  7119. CONFIG_FEATURE_STATS_EXT := 1
  7120. @@ -239,6 +239,12 @@ HAVE_CFG80211 := 0
  7121. endif
  7122. endif
  7123.  
  7124. +ifeq ($(BOARD_PLATFORM),msm8994)
  7125. +CONFIG_MSM8994 := 1
  7126. +else
  7127. +CONFIG_MSM8994 := 0
  7128. +endif
  7129. +
  7130. ############ COMMON ############
  7131. COMMON_DIR := CORE/SERVICES/COMMON
  7132. COMMON_INC := -I$(WLAN_ROOT)/$(COMMON_DIR)
  7133. @@ -1037,6 +1043,8 @@ endif
  7134. # enable the MAC Address auto-generation feature
  7135. CDEFINES += -DWLAN_AUTOGEN_MACADDR_FEATURE
  7136.  
  7137. +CDEFINES += -DMOTO_UTAGS_MAC
  7138. +
  7139. ifeq ($(CONFIG_WLAN_FEATURE_11W),y)
  7140. CDEFINES += -DWLAN_FEATURE_11W
  7141. endif
  7142. @@ -1120,7 +1128,7 @@ CDEFINES += -DCONFIG_HL_SUPPORT
  7143. endif
  7144.  
  7145. #Enable FW logs through ini
  7146. -CDEFINES += -DCONFIG_FW_LOGS_BASED_ON_INI
  7147. +#CDEFINES += -DCONFIG_FW_LOGS_BASED_ON_INI
  7148.  
  7149. #Enable pci read/write config functions
  7150. ifeq ($(CONFIG_ATH_PCI), 1)
  7151. @@ -1204,9 +1212,6 @@ ifeq ($(CONFIG_SMP),y)
  7152. CDEFINES += -DQCA_CONFIG_SMP
  7153. endif
  7154.  
  7155. -#Enable Channel Matrix restriction for all targets
  7156. -CDEFINES += -DWLAN_ENABLE_CHNL_MATRIX_RESTRICTION
  7157. -
  7158. #features specific to mdm9630
  7159. ifeq ($(CONFIG_ARCH_MDM9630), y)
  7160.  
  7161. @@ -1265,6 +1270,10 @@ ifeq ($(CONFIG_FEATURE_SECURE_FIRMWARE), 1)
  7162. CDEFINES += -DFEATURE_SECURE_FIRMWARE
  7163. endif
  7164.  
  7165. +ifeq ($(CONFIG_MSM8994), 1)
  7166. +CDEFINES += -DCONFIG_MSM8994
  7167. +endif
  7168. +
  7169. #Enable/disable FW hash check for secure firmware feature
  7170. ifeq ($(CONFIG_CLD_DEBUG), y)
  7171. CDEFINES += -DFEATURE_FW_HASH_CHECK
  7172. @@ -1273,7 +1282,7 @@ endif
  7173. ifeq ($(CONFIG_ATH_PCIE_ACCESS_DEBUG), 1)
  7174. CDEFINES += -DCONFIG_ATH_PCIE_ACCESS_DEBUG
  7175. endif
  7176. -
  7177. +CDEFINES += -DCONFIG_FW_LOGS_BASED_ON_INI
  7178. #Flag to enable/disable WLAN D0-WOW
  7179. ifeq ($(CONFIG_PCI_MSM), y)
  7180. CDEFINES += -DFEATURE_WLAN_D0WOW
  7181. @@ -1295,6 +1304,10 @@ ifeq ($(CONFIG_LINUX_QCMBR),y)
  7182. CDEFINES += -DLINUX_QCMBR
  7183. endif
  7184.  
  7185. +ifneq ($(CNSS_LOCALE),)
  7186. +CDEFINES += -DCNSS_LOCALE_$(CNSS_LOCALE)
  7187. +endif
  7188. +
  7189. KBUILD_CPPFLAGS += $(CDEFINES)
  7190.  
  7191. # Currently, for versions of gcc which support it, the kernel Makefile
  7192. diff --git a/drivers/staging/qcacld-2.0/Kconfig b/drivers/staging/qcacld-2.0/Kconfig
  7193. index 523e444..00ecc75 100644
  7194. --- a/drivers/staging/qcacld-2.0/Kconfig
  7195. +++ b/drivers/staging/qcacld-2.0/Kconfig
  7196. @@ -1,13 +1,29 @@
  7197. -comment "Qualcomm Atheros CLD WLAN module"
  7198. +comment "Qualcomm Atheros Prima WLAN module"
  7199.  
  7200. -config QCA_CLD_WLAN
  7201. +config PRIMA_WLAN
  7202.  
  7203. - tristate "Qualcomm Atheros CLD WLAN module"
  7204. + tristate "Qualcomm Atheros Prima WLAN module"
  7205. default n
  7206. help
  7207. - Add support for the Qualcomm Atheros CLD WLAN module
  7208. + Add support for the Qualcomm Atheros Prima WLAN module
  7209.  
  7210. -if QCA_CLD_WLAN != n
  7211. +config PRONTO_WLAN
  7212. +
  7213. + tristate "Qualcomm Atheros Pronto WLAN module"
  7214. + default n
  7215. + help
  7216. + Add support for the Qualcomm Atheros Pronto WLAN module
  7217. +
  7218. +
  7219. +# depends on WLAN
  7220. +# depends on CFG80211
  7221. +# depends on WCNSS_CORE
  7222. +
  7223. +if PRIMA_WLAN != n || PRONTO_WLAN != n
  7224. +
  7225. +config PRIMA_WLAN_BTAMP
  7226. + bool "Enable the Prima WLAN BT-AMP feature"
  7227. + default n
  7228.  
  7229. config QCACLD_WLAN_LFR3
  7230. bool "Enable the WLAN Legacy Fast Roaming feature Version 3"
  7231. @@ -33,16 +49,8 @@ config QCOM_VOWIFI_11R
  7232. bool "Enable Fast Transition (11r) feature"
  7233. default n
  7234.  
  7235. -config FEATURE_NAN
  7236. +config CONFIG_FEATURE_NAN
  7237. bool "Enable NAN feature"
  7238. default n
  7239.  
  7240. -config QCOM_TDLS
  7241. - bool "Enable TDLS feature"
  7242. - default n
  7243. -
  7244. -config QCOM_LTE_COEX
  7245. - bool "Enable QCOM LTE Coex feature"
  7246. - default n
  7247. -
  7248. -endif # QCA_CLD_WLAN
  7249. +endif # PRIMA_WLAN || PRONTO_WLAN
  7250. diff --git a/drivers/staging/qcacld-2.0/firmware_bin/WCNSS_qcom_cfg.ini b/drivers/staging/qcacld-2.0/firmware_bin/WCNSS_qcom_cfg.ini
  7251. index 2316ca7..aa98da0 100755
  7252. --- a/drivers/staging/qcacld-2.0/firmware_bin/WCNSS_qcom_cfg.ini
  7253. +++ b/drivers/staging/qcacld-2.0/firmware_bin/WCNSS_qcom_cfg.ini
  7254. @@ -10,7 +10,6 @@ gEnableImps=1
  7255.  
  7256. gEnableIdleScan=0
  7257.  
  7258. -
  7259. # Increase sleep duration (seconds) during IMPS
  7260. # 0 implies no periodic wake up from IMPS. Periodic wakeup is
  7261. # unnecessary if Idle Scan is disabled.
  7262. @@ -163,9 +162,6 @@ g11dSupportEnabled=0
  7263.  
  7264. g11hSupportEnabled=1
  7265.  
  7266. -# DFS Master Capability
  7267. -gEnableDFSMasterCap=1
  7268. -
  7269. # ESE Support and fast transition
  7270. EseEnabled=1
  7271. ImplicitQosIsEnabled=0
  7272. @@ -397,8 +393,8 @@ gSetRxChainmask1x1=1
  7273. # Scan Timing Parameters
  7274. # gPassiveMaxChannelTime=110
  7275. # gPassiveMinChannelTime=60
  7276. -gActiveMaxChannelTime=80
  7277. -gActiveMinChannelTime=40
  7278. +gActiveMaxChannelTime=40
  7279. +gActiveMinChannelTime=20
  7280.  
  7281. #If set to 0, MCC is not allowed.
  7282. gEnableMCCMode=1
  7283. @@ -416,7 +412,7 @@ gEnableTXSTBC=1
  7284. gEnableRXLDPC=1
  7285.  
  7286. #Enable/Disable Tx beamforming
  7287. -gTxBFEnable=1
  7288. +gTxBFEnable=0
  7289.  
  7290. # Enable Tx beamforming in VHT20MHz
  7291. # Valid values are 0,1. If commented out, the default value is 0.
  7292. @@ -429,10 +425,10 @@ gEnableActiveModeOffload=1
  7293. #Enable Scan Results Aging based on timer
  7294. #Timer value is in seconds
  7295. #If Set to 0 it will not enable the feature
  7296. -gScanAgingTime=0
  7297. +gScanAgingTime=22
  7298.  
  7299. #Enable Scan Results Aging based on number of scans
  7300. -gScanResultAgeCount=1
  7301. +gScanResultAgeCount=2
  7302.  
  7303. #Enable Power saving mechanism Based on Android Framework
  7304. #If set to 0 Driver internally control the Power saving mechanism
  7305. @@ -468,7 +464,10 @@ gFlexConnectPowerFactor=0
  7306. gNumChanCombinedConc=60
  7307.  
  7308. #Enable Power Save offload
  7309. -gEnablePowerSaveOffload=2
  7310. +# 0 disabled
  7311. +# 1 enable the offload in the fw.
  7312. +# 2 enable the offload in the fw + qpower
  7313. +gEnablePowerSaveOffload=1
  7314.  
  7315. #Enable firmware uart print
  7316. gEnablefwprint=0
  7317. @@ -521,7 +520,7 @@ TxPower5g=10
  7318. gEnableOverLapCh=0
  7319.  
  7320. #Enable VHT on 2.4Ghz
  7321. -gEnableVhtFor24GHzBand=1
  7322. +gEnableVhtFor24GHzBand=0
  7323.  
  7324. #Enable or Disable 5G early beacon termination
  7325. gEnable5gEBT=1
  7326. @@ -546,6 +545,8 @@ gEnableMemDeepSleep=1
  7327. gEnableStrictRegulatoryForFCC=0
  7328.  
  7329. #Disable packet log feature
  7330. +# 0 to disable
  7331. +# 1 to enable
  7332. gEnablePacketLog=0
  7333.  
  7334. # Bus bandwidth threshold values in terms of number of packets
  7335. @@ -574,7 +575,8 @@ gEnableGreenAp=1
  7336. # Radar PRI multiplier
  7337. gDFSradarMappingPriMultiplier=4
  7338.  
  7339. -gPNOScanSupport=0
  7340. +# Enable PNO scaning
  7341. +gPNOScanSupport=1
  7342.  
  7343. # Enable/Disable RX full reorder offload
  7344. gReorderOffloadSupported=1
  7345. @@ -591,7 +593,7 @@ gEnableSifsBurst=1
  7346.  
  7347. # Enable or Disable Multi-user MIMO
  7348. # 1=Enable (default), 0=Disable
  7349. -gEnableMuBformee=1
  7350. +gEnableMuBformee=0
  7351.  
  7352. # Enable/Disable channel avoidance for SAP in SCC scenario
  7353. # 0 - disable
  7354. @@ -635,13 +637,26 @@ gTDLSExternalControl=1
  7355. # 1 - enable
  7356. # TDLS off-channel operation will be invoked when there is only one
  7357. # TDLS connection.
  7358. -gEnableTDLSOffChannel=1
  7359. +gEnableTDLSOffChannel=0
  7360. +
  7361. +gEnableTDLSScan=1
  7362. +gTDLSTxStatsPeriod=500
  7363. +gTDLSTxPacketThreshold=10
  7364. +gTDLSIdlePacketThreshold=5
  7365.  
  7366. gEnableSelfRecovery=1
  7367.  
  7368. +# Extra driver logging, for data stall
  7369. +#gFwDebugLogType=3
  7370. +#gFwDebugLogLevel=4
  7371. +#gFwDebugModuleLoglevel=1,0,2,0,4,0,5,0,6,0,8,0,9,0,11,0,13,0,17,0,18,0,19,0,27,0,29,0,31,0,35,0,36,0,38,0
  7372. +
  7373. # Enable or Disable Random MAC (Spoofing)
  7374. # 1=Enable, 0=Disable (default)
  7375. -gEnableMacAddrSpoof=0
  7376. +gEnableMacAddrSpoof=1
  7377. +
  7378. +# DTIM setting
  7379. +gEnableDynamicDTIM=3
  7380.  
  7381. # Enable to check FW hash if secure FW feature is enabled. It's for defconfig
  7382. # builds only since it will be ignored in performance/release builds.
  7383. diff --git a/drivers/staging/qcacld-2.0/tools/fwdebuglog/Android.mk b/drivers/staging/qcacld-2.0/tools/fwdebuglog/Android.mk
  7384. index ff8560d..a035245 100644
  7385. --- a/drivers/staging/qcacld-2.0/tools/fwdebuglog/Android.mk
  7386. +++ b/drivers/staging/qcacld-2.0/tools/fwdebuglog/Android.mk
  7387. @@ -13,8 +13,9 @@ LOCAL_MODULE_TAGS := optional
  7388. LOCAL_C_INCLUDES := $(TARGET_OUT_HEADERS)/diag/include \
  7389. LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/common/inc \
  7390. LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../../../wlan/utils/asf/inc \
  7391. -LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../CORE/SERVICES/COMMON
  7392. -LOCAL_SHARED_LIBRARIES := libc libcutils libdiag libhardware_legacy
  7393. +LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../CORE/SERVICES/COMMON \
  7394. +LOCAL_C_INCLUDES += external/zlib
  7395. +LOCAL_SHARED_LIBRARIES := libc libcutils libdiag libhardware_legacy liblog libz
  7396. LOCAL_SRC_FILES := cld-fwlog-netlink.c parser.c nan-parser.c cld-diag-parser.c
  7397. LOCAL_CFLAGS += -DCONFIG_ANDROID_LOG
  7398. LOCAL_CFLAGS += -DANDROID
  7399. @@ -27,8 +28,9 @@ LOCAL_MODULE_TAGS := optional
  7400. LOCAL_C_INCLUDES := $(TARGET_OUT_HEADERS)/diag/include \
  7401. LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/common/inc \
  7402. LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../../../wlan/utils/asf/inc \
  7403. -LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../CORE/SERVICES/COMMON
  7404. -LOCAL_SHARED_LIBRARIES := libc libcutils libdiag libhardware_legacy
  7405. +LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../CORE/SERVICES/COMMON \
  7406. +LOCAL_C_INCLUDES += external/zlib
  7407. +LOCAL_SHARED_LIBRARIES := libc libcutils libdiag libhardware_legacy liblog libz
  7408. LOCAL_SRC_FILES := cld-fwlog-netlink.c parser.c nan-parser.c cld-diag-parser.c
  7409. LOCAL_CFLAGS += -DCONFIG_ANDROID_LOG
  7410. LOCAL_CFLAGS += -DANDROID
  7411. @@ -40,6 +42,6 @@ include $(CLEAR_VARS)
  7412. LOCAL_MODULE := cld-fwlog-parser
  7413. LOCAL_MODULE_TAGS := optional
  7414. LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../CORE/SERVICES/COMMON
  7415. -LOCAL_SHARED_LIBRARIES := libc libcutils
  7416. +LOCAL_SHARED_LIBRARIES := libc libcutils liblog
  7417. LOCAL_SRC_FILES := cld-fwlog-parser.c
  7418. include $(BUILD_EXECUTABLE)
  7419. diff --git a/drivers/staging/qcacld-2.0/tools/fwdebuglog/cld-diag-parser.c b/drivers/staging/qcacld-2.0/tools/fwdebuglog/cld-diag-parser.c
  7420. index 944293b..2d581d5 100644
  7421. --- a/drivers/staging/qcacld-2.0/tools/fwdebuglog/cld-diag-parser.c
  7422. +++ b/drivers/staging/qcacld-2.0/tools/fwdebuglog/cld-diag-parser.c
  7423. @@ -35,6 +35,14 @@
  7424. #include <sys/socket.h>
  7425. #include <linux/netlink.h>
  7426. #include "cld-diag-parser.h"
  7427. +#ifdef CONFIG_ANDROID_LOG
  7428. +#include <android/log.h>
  7429. +
  7430. +#define FWDEBUG_LOG_NAME "ROME"
  7431. +#define FWDEBUG_NAME "ROME_DEBUG"
  7432. +#define android_printf(...) \
  7433. + __android_log_print(ANDROID_LOG_INFO, FWDEBUG_LOG_NAME, __VA_ARGS__);
  7434. +#endif
  7435.  
  7436. typedef struct diag_entry{
  7437. uint32_t id;
  7438. @@ -744,9 +752,6 @@ cnssdiag_register_kernel_logging(int sock_fd, struct nlmsghdr *nlh)
  7439. wnl->wmsg.length = sizeof(tAniHdr);
  7440. wnl->wmsg.type = ANI_NL_MSG_LOG_REG_TYPE;
  7441. if (sendto(sock_fd, (char*)wnl, nlh->nlmsg_len,0,NULL, 0) < 0) {
  7442. - debug_printf("%s: HOST_MSG:Failed to send message over NL"
  7443. - " errno:%d - %s\n",
  7444. - __func__, errno, strerror(errno));
  7445. return -1;
  7446. }
  7447.  
  7448. @@ -763,9 +768,6 @@ cnssdiag_register_kernel_logging(int sock_fd, struct nlmsghdr *nlh)
  7449. regReq = (tAniNlAppRegReq *)(wnl + 1);
  7450. regReq->pid = getpid();
  7451. if (sendto(sock_fd, (char*)wnl, nlh->nlmsg_len,0,NULL, 0) < 0) {
  7452. - debug_printf("%s: EVENT_LOG:Failed to send message over NL"
  7453. - " errno:%d - %s\n",
  7454. - __func__, errno, strerror(errno));
  7455. return -1;
  7456. }
  7457. return 0;
  7458. @@ -829,15 +831,22 @@ sendcnss_cmd(int sock_fd, int32_t cmd, int len, uint8_t *buf)
  7459.  
  7460.  
  7461. void
  7462. -diag_initialize(int sock_fd, uint32_t optionflag)
  7463. +diag_initialize(boolean isDriverLoaded, int sock_fd, uint32_t optionflag)
  7464. {
  7465. - uint32_t ret;
  7466. - goptionflag = optionflag;
  7467. - diag_free_db();
  7468. - ret = parse_dbfile();
  7469. - if (ret > 1)
  7470. - gisdiag_init = TRUE;
  7471. - gdiag_sock_fd = sock_fd;
  7472. + if (isDriverLoaded) {
  7473. + if (!gisdiag_init) {
  7474. + uint32_t ret;
  7475. + goptionflag = optionflag;
  7476. + diag_free_db();
  7477. + ret = parse_dbfile();
  7478. + if (ret > 1)
  7479. + gisdiag_init = TRUE;
  7480. + gdiag_sock_fd = sock_fd;
  7481. + }
  7482. + } else {
  7483. + gdiag_sock_fd = 0;
  7484. + gisdiag_init = FALSE;
  7485. + }
  7486. }
  7487.  
  7488. void
  7489. @@ -906,7 +915,7 @@ process_diagfw_msg(uint8_t *datap, uint16_t len, uint32_t optionflag,
  7490. * then turn on event not received hence
  7491. * before throwing out error initialize again
  7492. */
  7493. - diag_initialize(sock_fd, optionflag);
  7494. + diag_initialize(1, sock_fd, optionflag);
  7495. if (!gisdiag_init) {
  7496. diag_printf("**ERROR** Diag not Initialized",
  7497. 0, 4, optionflag, 0, NULL);
  7498. @@ -1022,15 +1031,10 @@ process_diagfw_msg(uint8_t *datap, uint16_t len, uint32_t optionflag,
  7499. lrecord++;
  7500. if (!((optionflag & SILENT_FLAG) == SILENT_FLAG))
  7501. printf("%d: %s\n", lrecord, buf);
  7502. -
  7503. res = diag_printf(
  7504. buf, vdevid, vdevlevel, optionflag, timestamp, log_out
  7505. );
  7506. //fseek(log_out, lrecord * res, SEEK_SET);
  7507. - if (lrecord == max_records) {
  7508. - lrecord = 0;
  7509. - fseek(log_out, lrecord * res, SEEK_SET);
  7510. - }
  7511. *record = lrecord;
  7512. }
  7513. if (optionflag & (CONSOLE_FLAG | QXDM_FLAG))
  7514. @@ -1168,10 +1172,6 @@ void process_cnss_host_message(tAniNlHdr *wnl, int32_t optionflag,
  7515. if (!((optionflag & SILENT_FLAG) == SILENT_FLAG))
  7516. printf("%d: %s\n", lrecord, wlanLog);
  7517. res = fprintf(log_out, "%s\n", wlanLog);
  7518. - if (lrecord == max_records) {
  7519. - lrecord = 0;
  7520. - fseek(log_out, lrecord * res, SEEK_SET);
  7521. - }
  7522. *record = lrecord;
  7523. }
  7524. else if (optionflag & CONSOLE_FLAG) {
  7525. diff --git a/drivers/staging/qcacld-2.0/tools/fwdebuglog/cld-diag-parser.h b/drivers/staging/qcacld-2.0/tools/fwdebuglog/cld-diag-parser.h
  7526. index 533b033..3409ad4 100644
  7527. --- a/drivers/staging/qcacld-2.0/tools/fwdebuglog/cld-diag-parser.h
  7528. +++ b/drivers/staging/qcacld-2.0/tools/fwdebuglog/cld-diag-parser.h
  7529. @@ -135,7 +135,6 @@
  7530. #define SILENT_FLAG 0x08
  7531. #define DEBUG_FLAG 0x10
  7532.  
  7533. -#define INIT_WITH_SLEEP 10
  7534. #define ATH6KL_FWLOG_PAYLOAD_SIZE 1500
  7535.  
  7536. #define HDRLEN 16
  7537. @@ -273,17 +272,6 @@ static inline unsigned int aniNlLen(unsigned int len)
  7538.  
  7539. /* KERNEL DEFS END */
  7540.  
  7541. -#ifdef CONFIG_ANDROID_LOG
  7542. -#include <android/log.h>
  7543. -
  7544. -#define FWDEBUG_LOG_NAME "ROME"
  7545. -#define FWDEBUG_NAME "ROME_DEBUG"
  7546. -#define android_printf(...) \
  7547. - __android_log_print(ANDROID_LOG_INFO, FWDEBUG_LOG_NAME, __VA_ARGS__);
  7548. -#else
  7549. -#define android_printf printf
  7550. -#endif
  7551. -
  7552. #define WLAN_NL_MSG_CNSS_DIAG 27 /* Msg type between user space/wlan driver */
  7553. #define WLAN_NL_MSG_CNSS_HOST_MSG 28
  7554. #define WLAN_NL_MSG_CNSS_HOST_EVENT_LOG 17
  7555. @@ -298,10 +286,8 @@ static inline unsigned int aniNlLen(unsigned int len)
  7556. #define MAX_MSG_SIZE 50000
  7557. #define DIAG_MSG_MAX_LEN 4096
  7558. #define DIAG_MSG_OVERHEAD_LEN 48
  7559. -/* PKT SIZE for intf */
  7560. -#define MAX_PKT_SIZE 8192
  7561.  
  7562. -/* SPECIAL DIAG HANDLING */
  7563. +/* SPECIAL DIAG HANDLING*/
  7564. #define DIAG_WLAN_MODULE_STA_PWRSAVE 34292
  7565. #define DIAG_WLAN_MODULE_WAL 42996
  7566. #define DIAG_NAN_MODULE_ID 56820
  7567. @@ -339,7 +325,7 @@ int32_t
  7568. dbglog_parse_debug_logs(u_int8_t *datap, u_int16_t len, u_int16_t dropped);
  7569.  
  7570. void
  7571. -diag_initialize(int sock_fd, uint32_t optionflag);
  7572. +diag_initialize(boolean isDriverLoaded, int sock_fd, uint32_t optionflag);
  7573.  
  7574. void
  7575. process_diaghost_msg(uint8_t *datap, uint16_t len);
  7576. diff --git a/drivers/staging/qcacld-2.0/tools/fwdebuglog/cld-fwlog-netlink.c b/drivers/staging/qcacld-2.0/tools/fwdebuglog/cld-fwlog-netlink.c
  7577. index 31c88ba..f006322 100644
  7578. --- a/drivers/staging/qcacld-2.0/tools/fwdebuglog/cld-fwlog-netlink.c
  7579. +++ b/drivers/staging/qcacld-2.0/tools/fwdebuglog/cld-fwlog-netlink.c
  7580. @@ -40,7 +40,6 @@
  7581. #include <sys/types.h>
  7582. #include <sys/ioctl.h>
  7583. #include <sys/capability.h>
  7584. -#include <sys/prctl.h>
  7585. #include <linux/prctl.h>
  7586. #include <pwd.h>
  7587. #ifdef ANDROID
  7588. @@ -48,19 +47,19 @@
  7589. #endif
  7590. #include <sys/socket.h>
  7591. #include <linux/netlink.h>
  7592. -#include <linux/rtnetlink.h>
  7593. -#include <net/if.h>
  7594. #include "event.h"
  7595. #include "msg.h"
  7596. #include "log.h"
  7597. -
  7598. #include "diag_lsm.h"
  7599. #include "diagpkt.h"
  7600. #include "diagcmd.h"
  7601. #include "diag.h"
  7602. #include "cld-diag-parser.h"
  7603. -
  7604. -#define CNSS_INTF "wlan0"
  7605. +//Begin IKSWL-8571:LAN Firmware and driver logs
  7606. +#include "zlib.h"
  7607. +#include <stdbool.h>
  7608. +#include <dirent.h>
  7609. +//End IKSWL-8571
  7610.  
  7611. #ifdef ANDROID
  7612. /* CAPs needed
  7613. @@ -76,6 +75,14 @@ const uint32_t capabilities = (1 << CAP_NET_RAW) | (1 << CAP_NET_ADMIN);
  7614. * AID_WIFI : WIFI Operation
  7615. */
  7616. const gid_t groups[] = {AID_INET, AID_NET_ADMIN, AID_QCOM_DIAG, AID_WIFI};
  7617. +
  7618. +//Begin IKSWL-8571:LAN Firmware and driver logs
  7619. +char logFilePath[PATH_MAX];
  7620. +char parentDir[] = "/data/misc/wifi";
  7621. +const char logDir[] ="logs";
  7622. +#define MAX_FILES 20
  7623. +//End IKSWL-8571
  7624. +
  7625. #endif
  7626.  
  7627. const char options[] =
  7628. @@ -97,17 +104,26 @@ struct msghdr msg;
  7629. static FILE *fwlog_res;
  7630. FILE *log_out = NULL;
  7631. const char *fwlog_res_file;
  7632. -static int cnss_sock = -1;
  7633. int32_t max_records;
  7634. int32_t record = 0;
  7635. const char *progname;
  7636. -char dbglogoutfile[PATH_MAX];
  7637. +char dbglogoutfile[PATH_MAX]={0}; //IKSWL-8571
  7638. int32_t optionflag = 0;
  7639. -int32_t rec_limit = 100000000; /* Million records is a good default */
  7640. boolean isDriverLoaded = FALSE;
  7641. +const char driverLoaded[] = "KNLREADY";
  7642. +const char driverUnLoaded[] = "KNLCLOSE";
  7643.  
  7644. -static void
  7645. -usage(void)
  7646. +int32_t rec_limit = 100000000; /* Million records is a good default */
  7647. +
  7648. +//Begin IKSWL-8571:LAN Firmware and driver logs
  7649. +void createLogFileName(char * filenme,int len);
  7650. +void handleLogFileMaxSizeLimit ();
  7651. +void compressFile(const char* fromFileName);
  7652. +void processFileClose();
  7653. +//END IKSWL-8571
  7654. +int changeOwnerMod(const char * fileName);
  7655. +
  7656. +static void usage(void)
  7657. {
  7658. fprintf(stderr, "Usage:\n%s options\n", progname);
  7659. fprintf(stderr, "%s\n", options);
  7660. @@ -219,7 +235,7 @@ cnssdiagservice_cap_handle(void)
  7661. /* Set the capabilities */
  7662. if (capset(cap_header, cap_data) < 0)
  7663. {
  7664. - printf("%d failed capset error:%s", __LINE__, strerror(errno));
  7665. + ALOGE("%d failed capset error:%s", __LINE__, strerror(errno)); //IKSWL-8571
  7666. return -1;
  7667. }
  7668. return 0;
  7669. @@ -246,7 +262,7 @@ static void cleanup(void) {
  7670.  
  7671. static void stop(int32_t signum)
  7672. {
  7673. - signum; /* Avoid warning */
  7674. +
  7675. if(optionflag & LOGFILE_FLAG){
  7676. printf("Recording stopped\n");
  7677. cleanup();
  7678. @@ -273,12 +289,16 @@ void process_cnss_log_file(uint8_t *dbgbuf)
  7679. record, timestamp, length, dropped);
  7680. }
  7681. if ((res = fwrite(dbgbuf, RECLEN, 1, log_out)) != 1){
  7682. - perror("fwrite");
  7683. + ALOGE("fwrite error to write to logfile");
  7684. return;
  7685. }
  7686. fflush(log_out);
  7687. - if (record == max_records)
  7688. + //Begin IKSWL-8571:LAN Firmware and driver logs
  7689. + if (record > max_records){
  7690. + handleLogFileMaxSizeLimit();
  7691. record = 0;
  7692. + }
  7693. + //End IKSWL-8571
  7694. }
  7695. /*
  7696. * Process FW debug, FW event and FW log messages
  7697. @@ -305,7 +325,11 @@ void process_cnss_diag_msg(tAniNlHdr *wnl)
  7698.  
  7699. if (wnl->nlh.nlmsg_type == WLAN_NL_MSG_CNSS_HOST_MSG
  7700. && (wnl->wmsg.type == ANI_NL_MSG_LOG_HOST_MSG_TYPE)) {
  7701. - process_cnss_host_message(wnl, optionflag, log_out, &record, max_records);
  7702. + process_cnss_host_message(wnl, optionflag, log_out, &record, max_records);
  7703. + //Begin IKSWL-8571:LAN Firmware and driver logs
  7704. + if (record > max_records)
  7705. + handleLogFileMaxSizeLimit();
  7706. + //End IKSWL-8571
  7707. } else if (wnl->nlh.nlmsg_type == WLAN_NL_MSG_CNSS_HOST_EVENT_LOG
  7708. && (wnl->wmsg.type == ANI_NL_MSG_LOG_HOST_EVENT_LOG_TYPE)) {
  7709. process_cnss_host_diag_events_log((char *)((char *)&wnl->wmsg.length
  7710. @@ -338,6 +362,10 @@ void process_cnss_diag_msg(tAniNlHdr *wnl)
  7711. version = get_le32((uint8_t *)&slot->dropped);
  7712. process_diagfw_msg(&slot->payload[0], length, optionflag, log_out,
  7713. &record, max_records, version, sock_fd);
  7714. + //Begin IKSWL-8571:LAN Firmware and driver logs
  7715. + if (record > max_records)
  7716. + handleLogFileMaxSizeLimit();
  7717. + //End IKSWL-8571
  7718. } else if (diag_type == DIAG_TYPE_HOST_MSG) {
  7719. slot = (struct dbglog_slot *)dbgbuf;
  7720. length = get_32((uint8_t *)&slot->length);
  7721. @@ -379,7 +407,7 @@ static int32_t create_nl_socket()
  7722. return sock_fd;
  7723. }
  7724.  
  7725. -static int initialize(int32_t sock_fd)
  7726. +static uint32_t initialize(int32_t sock_fd)
  7727. {
  7728. char *mesg = "Hello";
  7729.  
  7730. @@ -413,216 +441,17 @@ static int initialize(int32_t sock_fd)
  7731. msg.msg_iov = &iov;
  7732. msg.msg_iovlen = 1;
  7733.  
  7734. - if (sendmsg(sock_fd, &msg, 0) < 0) {
  7735. - android_printf("%s error ", __func__);
  7736. - return -1;
  7737. - }
  7738. - return 1;
  7739. -}
  7740. -
  7741. -static int
  7742. -cnss_read_ifname(struct nlmsghdr *h, size_t len)
  7743. -{
  7744. - struct ifinfomsg *ifi;
  7745. - int attrlen, nlmsg_len, rta_len;
  7746. - struct rtattr *attr;
  7747. -
  7748. - if (!h) {
  7749. - android_printf("%s null error ", __func__);
  7750. - return 0;
  7751. - }
  7752. -
  7753. - if (len < sizeof(*ifi)) {
  7754. - android_printf("%s len error ", __func__);
  7755. - return 0;
  7756. - }
  7757. -
  7758. - ifi = NLMSG_DATA(h);
  7759. -
  7760. - nlmsg_len = NLMSG_ALIGN(sizeof(struct ifinfomsg));
  7761. -
  7762. - attrlen = h->nlmsg_len - nlmsg_len;
  7763. - if (attrlen < 0)
  7764. - return 0;
  7765. -
  7766. - attr = (struct rtattr *) (((char *) ifi) + nlmsg_len);
  7767. -
  7768. - rta_len = RTA_ALIGN(sizeof(struct rtattr));
  7769. - while (RTA_OK(attr, attrlen)) {
  7770. - char ifname[IFNAMSIZ + 1];
  7771. -
  7772. - if (attr->rta_type == IFLA_IFNAME) {
  7773. - int n = attr->rta_len - rta_len;
  7774. - if (n < 0)
  7775. - break;
  7776. -
  7777. - memset(ifname, 0, sizeof(ifname));
  7778. -
  7779. - if ((size_t) n > sizeof(ifname))
  7780. - n = sizeof(ifname);
  7781. - memcpy(ifname, ((char *) attr) + rta_len, n);
  7782. - if (strcmp(ifname, CNSS_INTF) == 0)
  7783. - return 1;
  7784. - else
  7785. - return 0;
  7786. - }
  7787. -
  7788. - attr = RTA_NEXT(attr, attrlen);
  7789. - }
  7790. + sendmsg(sock_fd, &msg, 0);
  7791. return 0;
  7792. }
  7793.  
  7794. -static int cnss_intf_receive(int sock)
  7795. -{
  7796. - char buf[MAX_PKT_SIZE];
  7797. - int left, sleep_cnt = 0;
  7798. - struct sockaddr_nl from;
  7799. - socklen_t fromlen;
  7800. - struct nlmsghdr *h;
  7801. -
  7802. - fromlen = sizeof(from);
  7803. - while ( 1 ) {
  7804. - left = recvfrom(sock, buf, sizeof(buf), MSG_DONTWAIT,
  7805. - (struct sockaddr *) &from, &fromlen);
  7806. - if (left < 0) {
  7807. - return -1;
  7808. - }
  7809. -
  7810. - h = (struct nlmsghdr *) buf;
  7811. - while (left >= (int) sizeof(*h)) {
  7812. - int len, plen;
  7813. -
  7814. - len = h->nlmsg_len;
  7815. - plen = len - sizeof(*h);
  7816. - if (len > left || plen < 0) {
  7817. - break;
  7818. - }
  7819. -
  7820. - switch (h->nlmsg_type) {
  7821. - case RTM_NEWLINK:
  7822. - if (cnss_read_ifname(h, plen)) {
  7823. - if (!isDriverLoaded) {
  7824. - isDriverLoaded = TRUE;
  7825. - sleep_cnt = 0;
  7826. - while ( 1 ) {
  7827. - if (initialize(sock_fd) < 0) {
  7828. - android_printf("%s error retrying",
  7829. - __func__);
  7830. - sleep_cnt++;
  7831. - sleep(1);
  7832. - /* DONT LOOP EVER */
  7833. - if (sleep_cnt >= INIT_WITH_SLEEP)
  7834. - break;
  7835. - else
  7836. - continue;
  7837. - }
  7838. - diag_initialize(sock_fd, optionflag);
  7839. - cnssdiag_register_kernel_logging(sock_fd, nlh);
  7840. - break;
  7841. - }
  7842. - }
  7843. -
  7844. - }
  7845. - break;
  7846. - case RTM_DELLINK:
  7847. - if (cnss_read_ifname(h, plen)) {
  7848. - isDriverLoaded = FALSE;
  7849. - }
  7850. - break;
  7851. - }
  7852. -
  7853. - len = NLMSG_ALIGN(len);
  7854. - left -= len;
  7855. - h = (struct nlmsghdr *) ((char *) h + len);
  7856. - }
  7857. - }
  7858. - return 0;
  7859. -}
  7860. -
  7861. -static int cnss_intf_init()
  7862. -{
  7863. - struct sockaddr_nl local;
  7864. - cnss_sock = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
  7865. - if (cnss_sock < 0) {
  7866. - return -1;
  7867. - }
  7868. -
  7869. - memset(&local, 0, sizeof(local));
  7870. - local.nl_family = AF_NETLINK;
  7871. - local.nl_groups = RTMGRP_LINK;
  7872. - if (bind(cnss_sock, (struct sockaddr *) &local, sizeof(local)) < 0) {
  7873. - close(cnss_sock);
  7874. - return -1;
  7875. - }
  7876. - return 1;
  7877. -}
  7878. -
  7879. -static inline void* cnss_intf_wait_receive(void * arg)
  7880. -{
  7881. - arg; /* Avoid warning */
  7882. - fd_set fds;
  7883. - int oldfd, ret;
  7884. - int sock;
  7885. -
  7886. - cnss_intf_init();
  7887. - sock = cnss_sock;
  7888. -
  7889. - if (sock < 0) {
  7890. - android_printf("%s error Netlink Socket Not Available", __func__);
  7891. - return NULL;
  7892. - }
  7893. - while ( 1 ) {
  7894. - /* Initialize fds */
  7895. - FD_ZERO(&fds);
  7896. - FD_SET(sock, &fds);
  7897. - oldfd = sock;
  7898. -
  7899. - /* Wait for some trigger event */
  7900. - ret = select(oldfd + 1, &fds, NULL, NULL, NULL);
  7901. -
  7902. - if (ret < 0) {
  7903. - /* Error Occurred */
  7904. - android_printf("%s error Netlink select fail", __func__);
  7905. - return NULL;
  7906. - } else if (!ret) {
  7907. - android_printf("%s error Select on Netlink Socket Timed Out",
  7908. - __func__);
  7909. - /* Timeout Occurred */
  7910. - return NULL;
  7911. - }
  7912. -
  7913. - /* Check if any event is available for us */
  7914. - if (FD_ISSET(sock, &fds)) {
  7915. - cnss_intf_receive(sock);
  7916. - }
  7917. - }
  7918. - return NULL;
  7919. -}
  7920. -
  7921. -static inline boolean is_interface(const char *interface, int len)
  7922. -{
  7923. - struct ifreq ifr;
  7924. - int sock = socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP);
  7925. - memset(&ifr, 0, sizeof(ifr));
  7926. - if (interface) {
  7927. - strlcpy(ifr.ifr_name, interface, len);
  7928. - }
  7929. - if (ioctl(sock, SIOCGIFFLAGS, &ifr) < 0) {
  7930. - return FALSE;
  7931. - }
  7932. - close(sock);
  7933. - return TRUE;
  7934. -}
  7935. -
  7936. int32_t main(int32_t argc, char *argv[])
  7937. {
  7938. - int res =0;
  7939. + uint32_t res =0;
  7940. uint8_t *eventbuf = NULL;
  7941. uint8_t *dbgbuf = NULL;
  7942. int32_t c;
  7943. struct dbglog_slot *slot;
  7944. - int cnss_intf_len = strlen(CNSS_INTF) + 1;
  7945. - pthread_t thd_id;
  7946.  
  7947. progname = argv[0];
  7948. uint16_t diag_type = 0;
  7949. @@ -671,12 +500,29 @@ int32_t main(int32_t argc, char *argv[])
  7950. usage();
  7951. }
  7952. }
  7953. -
  7954. + //Begin IKSWL-8571:LAN Firmware and driver logs
  7955. if (!(optionflag & (LOGFILE_FLAG | CONSOLE_FLAG | QXDM_FLAG | SILENT_FLAG
  7956. - | DEBUG_FLAG))) {
  7957. - usage();
  7958. - return -1;
  7959. + | DEBUG_FLAG))) {
  7960. + optionflag |= LOGFILE_FLAG;
  7961. + if(cnssdiagservice_cap_handle()) {
  7962. + printf("Cap bouncing failed EXIT!!!");
  7963. + }
  7964. + memset(logFilePath, 0,sizeof(logFilePath));
  7965. + snprintf(logFilePath,sizeof(logFilePath)-1, "%s/%s", parentDir, logDir);
  7966. + res = mkdir(logFilePath, S_IRWXU | S_IRWXG);
  7967. + if ( ( res != 0 ) && ( errno != EEXIST ) )
  7968. + {
  7969. + ALOGE(" Could not create parent dir errno=%d\n",errno);
  7970. + }
  7971. + res = 0;
  7972. + changeOwnerMod(logFilePath);
  7973. + // process the file that was not zipped at last poweroff
  7974. + processFileClose();
  7975. + createLogFileName(dbglogoutfile,PATH_MAX);
  7976. + optionflag |= LOGFILE_FLAG;
  7977. +
  7978. }
  7979. + //End IKSWL-8571
  7980.  
  7981. if (optionflag & QXDM_FLAG) {
  7982. /* Intialize the fd required for diag APIs */
  7983. @@ -695,18 +541,14 @@ int32_t main(int32_t argc, char *argv[])
  7984. #endif
  7985. }
  7986.  
  7987. - pthread_create(&thd_id, NULL, &cnss_intf_wait_receive, NULL);
  7988. -
  7989. sock_fd = create_nl_socket();
  7990. if (sock_fd < 0) {
  7991. fprintf(stderr, "Socket creation failed sock_fd 0x%x \n", sock_fd);
  7992. return -1;
  7993. }
  7994.  
  7995. - if (is_interface(CNSS_INTF, cnss_intf_len)) {
  7996. - initialize(sock_fd);
  7997. - cnssdiag_register_kernel_logging(sock_fd, nlh);
  7998. - }
  7999. + initialize(sock_fd);
  8000. + cnssdiag_register_kernel_logging(sock_fd, nlh);
  8001.  
  8002. signal(SIGINT, stop);
  8003. signal(SIGTERM, stop);
  8004. @@ -720,12 +562,22 @@ int32_t main(int32_t argc, char *argv[])
  8005. free(nlh);
  8006. return -1;
  8007. }
  8008. - max_records = rec_limit;
  8009. + max_records = rec_limit / RECLEN;
  8010. printf("Storing last %d records\n", max_records);
  8011.  
  8012. log_out = fopen(dbglogoutfile, "w");
  8013. +
  8014. if (log_out == NULL) {
  8015. - perror("Failed to create output file");
  8016. + ALOGE("Failed to create output file %s error=%s ",dbglogoutfile, strerror(errno));
  8017. + close(sock_fd);
  8018. + free(nlh);
  8019. + return -1;
  8020. + }
  8021. + fclose(log_out);
  8022. + changeOwnerMod(dbglogoutfile);
  8023. + log_out = fopen(dbglogoutfile, "w");
  8024. + if (log_out == NULL) {
  8025. + ALOGE("Failed to open output file %s error=%s ",dbglogoutfile, strerror(errno));
  8026. close(sock_fd);
  8027. free(nlh);
  8028. return -1;
  8029. @@ -737,17 +589,44 @@ int32_t main(int32_t argc, char *argv[])
  8030.  
  8031. parser_init();
  8032.  
  8033. - while ( 1 ) {
  8034. - if ((res = recvmsg(sock_fd, &msg, 0)) < 0)
  8035. - continue;
  8036. - if ((res >= (int)sizeof(struct dbglog_slot)) ||
  8037. - (nlh->nlmsg_type == WLAN_NL_MSG_CNSS_HOST_EVENT_LOG)) {
  8038. - process_cnss_diag_msg((tAniNlHdr *)nlh);
  8039. - memset(nlh,0,NLMSG_SPACE(MAX_MSG_SIZE));
  8040. - } else {
  8041. - /* Ignore other messages that might be broadcast */
  8042. - continue;
  8043. - }
  8044. + while ((res = recvmsg(sock_fd, &msg, 0)) > 0) {
  8045. + if ((isDriverLoaded == FALSE) &&
  8046. + (res == SIZEOF_NL_MSG_LOAD)) {
  8047. + eventbuf = (uint8_t *)NLMSG_DATA(nlh);
  8048. + if (0 == strncmp(driverLoaded, (const char *)eventbuf,
  8049. + strlen(driverLoaded))) {
  8050. + isDriverLoaded = TRUE;
  8051. + close(sock_fd);
  8052. + /* Wait for driver to Load */
  8053. + sleep(10);
  8054. + sock_fd = create_nl_socket();
  8055. + if (sock_fd < 0) {
  8056. + printf("create nl sock failed ret %d \n", sock_fd);
  8057. + return -1;
  8058. + }
  8059. + initialize(sock_fd);
  8060. + diag_initialize(isDriverLoaded, sock_fd, optionflag);
  8061. + cnssdiag_register_kernel_logging(sock_fd, nlh);
  8062. + }
  8063. + } else if ((isDriverLoaded == TRUE) &&
  8064. + (res == SIZEOF_NL_MSG_UNLOAD)) {
  8065. + eventbuf = (uint8_t *)NLMSG_DATA(nlh);
  8066. + if (0 == strncmp(driverUnLoaded, (const char *)eventbuf,
  8067. + strlen(driverUnLoaded))) {
  8068. + isDriverLoaded = FALSE;
  8069. + diag_initialize(isDriverLoaded, sock_fd, optionflag);
  8070. + }
  8071. + } else if (((res >= sizeof(struct dbglog_slot)) &&
  8072. + (res != SIZEOF_NL_MSG_LOAD) &&
  8073. + (res != SIZEOF_NL_MSG_UNLOAD)) ||
  8074. + (nlh->nlmsg_type == WLAN_NL_MSG_CNSS_HOST_EVENT_LOG)) {
  8075. + isDriverLoaded = TRUE;
  8076. + process_cnss_diag_msg((tAniNlHdr *)nlh);
  8077. + memset(nlh,0,NLMSG_SPACE(MAX_MSG_SIZE));
  8078. + } else {
  8079. + /* Ignore other messages that might be broadcast */
  8080. + continue;
  8081. + }
  8082. }
  8083. /* Release the handle to Diag*/
  8084. Diag_LSM_DeInit();
  8085. @@ -757,3 +636,227 @@ int32_t main(int32_t argc, char *argv[])
  8086. free(nlh);
  8087. return 0;
  8088. }
  8089. +
  8090. +//Begin IKSWL-8571:LAN Firmware and driver logs
  8091. +void createLogFileName(char * filename,int len) {
  8092. + struct timeval tv;
  8093. + char timestamp_buf[30];
  8094. + time_t curtime;
  8095. + struct tm *tm_ptr = NULL;
  8096. + memset(filename,0,len);
  8097. + snprintf(filename,PATH_MAX,"%s/",logFilePath);
  8098. + gettimeofday(&tv, NULL);
  8099. + curtime=tv.tv_sec;
  8100. + tm_ptr = localtime(&curtime);
  8101. + if (tm_ptr)
  8102. + strftime(timestamp_buf,30,"%Y%m%d_%H%M%S",tm_ptr);
  8103. + else
  8104. + strlcpy(timestamp_buf, "00000000_000000", 30);
  8105. + snprintf( filename+(strlen(logFilePath)+1),len-(strlen(logFilePath)+1),"wlanLog_%s",timestamp_buf);
  8106. + return ;
  8107. +}
  8108. +
  8109. +void handleLogFileMaxSizeLimit () {
  8110. + ALOGD("HandleLogFileMaxSizeLimit enter ");
  8111. + fclose(log_out);
  8112. + log_out = NULL;
  8113. + record =0;
  8114. + processFileClose();
  8115. + createLogFileName(dbglogoutfile,PATH_MAX);
  8116. + log_out = fopen(dbglogoutfile, "w");
  8117. + if (log_out == NULL) {
  8118. + ALOGE("Failed to create output file");
  8119. + close(sock_fd);
  8120. + free(nlh);
  8121. + return;
  8122. + }
  8123. + fclose(log_out);
  8124. + changeOwnerMod(dbglogoutfile);
  8125. + log_out = fopen(dbglogoutfile, "w");
  8126. + if (log_out == NULL) {
  8127. + ALOGE("Failed to open output file %s error=%s ",dbglogoutfile, strerror(errno));
  8128. + close(sock_fd);
  8129. + free(nlh);
  8130. + return;
  8131. + }
  8132. + return;
  8133. +}
  8134. +
  8135. +void compressFile(const char* fromFileName) {
  8136. + FILE* fromFile = NULL;
  8137. + gzFile toFile = NULL;
  8138. + static char buf[8192];
  8139. + char toFilePath[PATH_MAX] ={};
  8140. + char fromFilePath[PATH_MAX] ={};
  8141. + bool isSuccess = false;
  8142. + // Setup the source file.
  8143. + snprintf(fromFilePath, sizeof(fromFilePath), "/%s", fromFileName);
  8144. + fromFile = fopen(fromFilePath, "r");
  8145. + if (NULL == fromFile) {
  8146. + ALOGE("fopen(%s) failed; errno=%s", fromFilePath, strerror(errno));
  8147. + goto cleanup;
  8148. + }
  8149. + // Setup the destination file.
  8150. + snprintf(toFilePath, sizeof(toFilePath), "%s.gz",fromFileName);
  8151. + toFile = gzopen(toFilePath, "w");
  8152. + if (NULL == toFile) {
  8153. + ALOGE("gzopen(%s) failed; errno=%s", toFilePath, strerror(errno));
  8154. + goto cleanup;
  8155. + }
  8156. +
  8157. + memset(buf, 0, sizeof(buf));
  8158. + // Compress & copy.
  8159. + while (!feof(fromFile)) {
  8160. + size_t nBytesRead = fread(&buf[0], sizeof(char), sizeof(buf), fromFile);
  8161. + if (ferror(fromFile)) {
  8162. + if (EINTR == errno) {
  8163. + clearerr(fromFile);
  8164. + } else {
  8165. + ALOGE("fread() failed; errno=%s", strerror(errno));
  8166. + goto cleanup;
  8167. + }
  8168. + }
  8169. + if (0 < nBytesRead) {
  8170. + size_t nBytesWritten = gzwrite(toFile, &buf[0], nBytesRead);
  8171. + if (0 == nBytesWritten) {
  8172. + int gzErr;
  8173. + const char* gzErrStr = gzerror(toFile, &gzErr);
  8174. + if (Z_ERRNO == gzErr) {
  8175. + if (EINTR == errno) {
  8176. + gzclearerr(toFile);
  8177. + } else {
  8178. + ALOGE("gzwrite() failed; errno=%s", strerror(errno));
  8179. + goto cleanup;
  8180. + }
  8181. + } else {
  8182. + ALOGE("gzwrite() failed; gzerror=%s", gzErrStr ? gzErrStr : "(null)");
  8183. + goto cleanup;
  8184. + }
  8185. + }
  8186. + }
  8187. + }
  8188. + isSuccess = true;
  8189. +cleanup:
  8190. + if (fromFile)
  8191. + fclose(fromFile);
  8192. + if (toFile) {
  8193. + gzclose(toFile);
  8194. + changeOwnerMod(toFilePath);
  8195. + }
  8196. +
  8197. + // Delete uncompressed file only if compress is success.
  8198. + if (isSuccess)
  8199. + unlink(fromFilePath);
  8200. +
  8201. + return;
  8202. +}
  8203. +
  8204. +void processFileClose() {
  8205. + struct dirent **eps;
  8206. + char filePath[PATH_MAX] = {0};
  8207. + int fileCount =0;
  8208. + if (dbglogoutfile[0] != 0) {
  8209. + compressFile(dbglogoutfile);
  8210. + } else {
  8211. + //This means we have just started logging service check and compress any uncompressed ones.
  8212. + DIR *dp;
  8213. + struct dirent *ep;
  8214. + dp = opendir(logFilePath);
  8215. + if (dp != NULL) {
  8216. + //traverse through and find uncompressed files
  8217. + while ((ep = readdir(dp)) != NULL){
  8218. + if (ep->d_name[0] == '.'){
  8219. + //donot consider . and .. files
  8220. + continue;
  8221. + }
  8222. +
  8223. + if (strstr(ep->d_name,".gz") == NULL) {
  8224. + snprintf(filePath, sizeof(filePath),"%s/%s",logFilePath,ep->d_name);
  8225. + compressFile(filePath);
  8226. + }
  8227. + }
  8228. + }
  8229. + }
  8230. + //check and remove last modified log file
  8231. + if ( (fileCount = scandir(logFilePath, &eps, 0, alphasort)) < 0) {
  8232. + ALOGE("Scandir failed for %s errorno=%d\n",logFilePath,errno);
  8233. + } else {
  8234. + DIR *dp;
  8235. + struct dirent *ep;
  8236. + struct stat structstat;
  8237. + char oldfile[30];
  8238. + unsigned long modified=0;
  8239. + static char cwd[1024]={};
  8240. + int i = 0;
  8241. +
  8242. + // remember and change dir for stat and unlink
  8243. + if (getcwd(cwd, sizeof(cwd)) == NULL) {
  8244. + ALOGE(" getcwd failed errorno=%d\n",errno);
  8245. + }
  8246. + if (chdir(logFilePath)) {
  8247. + ALOGE(" chdir failed errorno=%d\n",errno);
  8248. + }
  8249. +
  8250. + for (i=0; i++; i<fileCount) {
  8251. + free( eps[i]);
  8252. + }
  8253. + free(eps);
  8254. +
  8255. + //check and remove last modified log file
  8256. + while (fileCount >= (MAX_FILES+4)) {
  8257. + int j=0;
  8258. + dp = opendir(logFilePath);
  8259. + if (dp != NULL) {
  8260. + modified =0;
  8261. + //traverse through and find the oldest file in dir:w
  8262. + while ((ep = readdir(dp)) != NULL){
  8263. + if (ep->d_name[0] == '.'){
  8264. + //donot consider . and .. files
  8265. + continue;
  8266. + }
  8267. + if (stat(ep->d_name, &structstat) <0) {
  8268. + }
  8269. + if ( ! S_ISREG(structstat.st_mode)) {
  8270. + continue;
  8271. + }
  8272. + if ( (modified > structstat.st_mtime) || modified==0) {
  8273. + // copy file based on mofified file name
  8274. + modified = structstat.st_mtime;
  8275. + memset(oldfile,0,sizeof(oldfile));
  8276. + snprintf(oldfile,sizeof(oldfile), "%s", ep->d_name);
  8277. + }
  8278. + }
  8279. + if (closedir(dp))
  8280. + ALOGE("Close dir failed errorno= %d\n",errno);
  8281. + //remove the oldest file
  8282. + if (unlink(oldfile)) {
  8283. + ALOGE(" unlink failed for %s errno = %d\n",oldfile , errno);
  8284. + } else {
  8285. + fileCount--;
  8286. + }
  8287. + } else {
  8288. + ALOGE("Unable to open logs dir...");
  8289. + }
  8290. + }
  8291. + //restore pwd
  8292. + if ((cwd == NULL) || chdir(cwd)) {
  8293. + ALOGE(" chdir restore failed errorno=%d\n",errno);
  8294. + }
  8295. +
  8296. + }
  8297. +}
  8298. +//End IKSWL-8571
  8299. +
  8300. +int changeOwnerMod(const char * filePath) {
  8301. + int status = 0;
  8302. + if (chown(filePath, AID_SYSTEM, AID_WIFI)){
  8303. + ALOGE("Failed to change ownership of gz %s error=%s ",filePath, strerror(errno));
  8304. + status = -1;
  8305. + }
  8306. + if (chmod(filePath, S_IRWXU | S_IRWXG)) {
  8307. + ALOGE("Failed to change mode of gz %s error=%s ",filePath, strerror(errno));
  8308. + if (!status)
  8309. + status = -1;
  8310. + }
  8311. + return status;
  8312. +}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement