Ver código fonte

qcacld-3.0: Add HTC Credit History Feature flag

Add compilation flag to compile out HTC credit History
feature cleanly from the cld-3.2 driver binary.

Change-Id: I5f5e73e430d282c99d3077fb82ed1cb8eb79715a
CRs-Fixed: 2190545
Rachit Kankane 7 anos atrás
pai
commit
b103562c27
5 arquivos alterados com 100 adições e 27 exclusões
  1. 11 0
      Kbuild
  2. 21 4
      core/cds/inc/cds_api.h
  3. 1 1
      core/cds/src/cds_api.c
  4. 2 15
      core/hdd/src/wlan_hdd_wext.c
  5. 65 7
      core/wma/inc/wma.h

+ 11 - 0
Kbuild

@@ -398,6 +398,9 @@ CONFIG_FEATURE_SECURE_FIRMWARE := 0
 #Flag to enable Stats Ext implementation
 #Flag to enable Stats Ext implementation
 CONFIG_FEATURE_STATS_EXT := 1
 CONFIG_FEATURE_STATS_EXT := 1
 
 
+#Flag to enable HTC credit history feature
+CONFIG_FEATURE_HTC_CREDIT_HISTORY := 1
+
 ifeq ($(CONFIG_CFG80211),y)
 ifeq ($(CONFIG_CFG80211),y)
 HAVE_CFG80211 := 1
 HAVE_CFG80211 := 1
 else
 else
@@ -1383,6 +1386,10 @@ HTC_OBJS := $(WLAN_COMMON_ROOT)/$(HTC_DIR)/htc.o \
             $(WLAN_COMMON_ROOT)/$(HTC_DIR)/htc_recv.o \
             $(WLAN_COMMON_ROOT)/$(HTC_DIR)/htc_recv.o \
             $(WLAN_COMMON_ROOT)/$(HTC_DIR)/htc_services.o
             $(WLAN_COMMON_ROOT)/$(HTC_DIR)/htc_services.o
 
 
+ifeq ($(CONFIG_FEATURE_HTC_CREDIT_HISTORY), 1)
+HTC_OBJS += $(WLAN_COMMON_ROOT)/$(HTC_DIR)/htc_credit_history.o
+endif
+
 ########### HIF ###########
 ########### HIF ###########
 HIF_DIR := hif
 HIF_DIR := hif
 HIF_CE_DIR := $(HIF_DIR)/src/ce
 HIF_CE_DIR := $(HIF_DIR)/src/ce
@@ -1809,6 +1816,10 @@ CDEFINES += -DFEATURE_OEM_DATA_SUPPORT
 endif
 endif
 ####################################
 ####################################
 
 
+ifeq ($(CONFIG_FEATURE_HTC_CREDIT_HISTORY), 1)
+CDEFINES += -DFEATURE_HTC_CREDIT_HISTORY
+endif
+
 ifneq ($(CONFIG_HIF_USB), 1)
 ifneq ($(CONFIG_HIF_USB), 1)
 CDEFINES += -DWLAN_LOGGING_SOCK_SVC_ENABLE
 CDEFINES += -DWLAN_LOGGING_SOCK_SVC_ENABLE
 endif
 endif

+ 21 - 4
core/cds/inc/cds_api.h

@@ -551,11 +551,28 @@ void cds_pkt_stats_to_logger_thread(void *pl_hdr, void *pkt_dump, void *data)
 }
 }
 #endif
 #endif
 
 
-#ifdef WMI_INTERFACE_EVENT_LOGGING
-void cds_print_htc_credit_history(uint32_t count, qdf_abstract_print * print,
-				  void *print_priv);
-#endif
+#ifdef FEATURE_HTC_CREDIT_HISTORY
+/**
+ * cds_print_htc_credit_history() - Helper function to copy HTC credit
+ *				    history via htc_print_credit_history()
+ *
+ * @count:	Number of lines to be copied
+ * @print:	Print callback to print in the buffer
+ *
+ * Return:	none
+ */
+void cds_print_htc_credit_history(uint32_t count,
+				qdf_abstract_print * print,
+				void *print_priv);
+#else
 
 
+static inline
+void cds_print_htc_credit_history(uint32_t count,
+				qdf_abstract_print *print,
+				void *print_priv)
+{
+}
+#endif
 /**
 /**
  * cds_is_group_addr() - checks whether addr is multi cast
  * cds_is_group_addr() - checks whether addr is multi cast
  * @mac_addr: address to be checked for multicast
  * @mac_addr: address to be checked for multicast

+ 1 - 1
core/cds/src/cds_api.c

@@ -2762,7 +2762,7 @@ enum QDF_GLOBAL_MODE cds_get_conparam(void)
 	return con_mode;
 	return con_mode;
 }
 }
 
 
-#ifdef WMI_INTERFACE_EVENT_LOGGING
+#ifdef FEATURE_HTC_CREDIT_HISTORY
 inline void
 inline void
 cds_print_htc_credit_history(uint32_t count, qdf_abstract_print *print,
 cds_print_htc_credit_history(uint32_t count, qdf_abstract_print *print,
 			     void *print_priv)
 			     void *print_priv)

+ 2 - 15
core/hdd/src/wlan_hdd_wext.c

@@ -10604,7 +10604,6 @@ int wlan_hdd_set_mon_chan(struct hdd_adapter *adapter, uint32_t chan,
 	return qdf_status_to_os_return(status);
 	return qdf_status_to_os_return(status);
 }
 }
 
 
-#ifdef WMI_INTERFACE_EVENT_LOGGING
 static int printk_adapter(void *priv, const char *fmt, ...)
 static int printk_adapter(void *priv, const char *fmt, ...)
 {
 {
 	int ret;
 	int ret;
@@ -10624,36 +10623,27 @@ static void hdd_ioctl_log_buffer(int log_id, uint32_t count)
 
 
 	switch (log_id) {
 	switch (log_id) {
 	case HTC_CREDIT_HISTORY_LOG:
 	case HTC_CREDIT_HISTORY_LOG:
-		print(NULL, "HTC Credit History (count %u)", count);
 		cds_print_htc_credit_history(count, print, NULL);
 		cds_print_htc_credit_history(count, print, NULL);
 		break;
 		break;
 	case COMMAND_LOG:
 	case COMMAND_LOG:
-		print(NULL, "Command Log (count %u)", count);
 		wma_print_wmi_cmd_log(count, print, NULL);
 		wma_print_wmi_cmd_log(count, print, NULL);
 		break;
 		break;
 	case COMMAND_TX_CMP_LOG:
 	case COMMAND_TX_CMP_LOG:
-		print(NULL, "Command Tx Complete Log (count %u)", count);
 		wma_print_wmi_cmd_tx_cmp_log(count, print, NULL);
 		wma_print_wmi_cmd_tx_cmp_log(count, print, NULL);
 		break;
 		break;
 	case MGMT_COMMAND_LOG:
 	case MGMT_COMMAND_LOG:
-		print(NULL, "Management Command Log (count %u)", count);
 		wma_print_wmi_mgmt_cmd_log(count, print, NULL);
 		wma_print_wmi_mgmt_cmd_log(count, print, NULL);
 		break;
 		break;
 	case MGMT_COMMAND_TX_CMP_LOG:
 	case MGMT_COMMAND_TX_CMP_LOG:
-		print(NULL, "Management Command Tx Complete Log (count %u)",
-		      count);
 		wma_print_wmi_mgmt_cmd_tx_cmp_log(count, print, NULL);
 		wma_print_wmi_mgmt_cmd_tx_cmp_log(count, print, NULL);
 		break;
 		break;
 	case EVENT_LOG:
 	case EVENT_LOG:
-		print(NULL, "Event Log (count %u)", count);
 		wma_print_wmi_event_log(count, print, NULL);
 		wma_print_wmi_event_log(count, print, NULL);
 		break;
 		break;
 	case RX_EVENT_LOG:
 	case RX_EVENT_LOG:
-		print(NULL, "Rx Event Log (count %u)", count);
 		wma_print_wmi_rx_event_log(count, print, NULL);
 		wma_print_wmi_rx_event_log(count, print, NULL);
 		break;
 		break;
 	case MGMT_EVENT_LOG:
 	case MGMT_EVENT_LOG:
-		print(NULL, "Management Event Log (count %u)", count);
 		wma_print_wmi_mgmt_event_log(count, print, NULL);
 		wma_print_wmi_mgmt_event_log(count, print, NULL);
 		break;
 		break;
 	default:
 	default:
@@ -10661,11 +10651,6 @@ static void hdd_ioctl_log_buffer(int log_id, uint32_t count)
 		break;
 		break;
 	}
 	}
 }
 }
-#else
-static inline void hdd_ioctl_log_buffer(int log_id, uint32_t count)
-{
-}
-#endif /* WMI_INTERFACE_EVENT_LOGGING */
 
 
 static int __iw_set_two_ints_getnone(struct net_device *dev,
 static int __iw_set_two_ints_getnone(struct net_device *dev,
 				     struct iw_request_info *info,
 				     struct iw_request_info *info,
@@ -11998,11 +11983,13 @@ static const struct iw_priv_args we_private_args[] = {
 	 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
 	 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
 	 0, "crash_inject"}
 	 0, "crash_inject"}
 	,
 	,
+#if defined(WMI_INTERFACE_EVENT_LOGGING) || defined(FEATURE_HTC_CREDIT_HISTORY)
 	{WE_LOG_BUFFER,
 	{WE_LOG_BUFFER,
 	 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
 	 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
 	 0, "log_buffer"}
 	 0, "log_buffer"}
 	,
 	,
 #endif
 #endif
+#endif
 #ifdef WLAN_SUSPEND_RESUME_TEST
 #ifdef WLAN_SUSPEND_RESUME_TEST
 	{WE_SET_WLAN_SUSPEND,
 	{WE_SET_WLAN_SUSPEND,
 	 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
 	 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,

+ 65 - 7
core/wma/inc/wma.h

@@ -2500,8 +2500,10 @@ static inline void wma_print_wmi_cmd_log(uint32_t count,
 {
 {
 	t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
 	t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
 
 
-	if (wma)
+	if (wma) {
+		print(print_priv, "Command Log (count %u)", count);
 		wmi_print_cmd_log(wma->wmi_handle, count, print, print_priv);
 		wmi_print_cmd_log(wma->wmi_handle, count, print, print_priv);
+	}
 }
 }
 
 
 static inline void wma_print_wmi_cmd_tx_cmp_log(uint32_t count,
 static inline void wma_print_wmi_cmd_tx_cmp_log(uint32_t count,
@@ -2510,9 +2512,11 @@ static inline void wma_print_wmi_cmd_tx_cmp_log(uint32_t count,
 {
 {
 	t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
 	t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
 
 
-	if (wma)
+	if (wma) {
+		print(print_priv, "Command Tx Complete Log (count %u)", count);
 		wmi_print_cmd_tx_cmp_log(wma->wmi_handle, count, print,
 		wmi_print_cmd_tx_cmp_log(wma->wmi_handle, count, print,
 					 print_priv);
 					 print_priv);
+	}
 }
 }
 
 
 static inline void wma_print_wmi_mgmt_cmd_log(uint32_t count,
 static inline void wma_print_wmi_mgmt_cmd_log(uint32_t count,
@@ -2521,9 +2525,11 @@ static inline void wma_print_wmi_mgmt_cmd_log(uint32_t count,
 {
 {
 	t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
 	t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
 
 
-	if (wma)
+	if (wma) {
+		print(print_priv, "Management Command Log (count %u)", count);
 		wmi_print_mgmt_cmd_log(wma->wmi_handle, count, print,
 		wmi_print_mgmt_cmd_log(wma->wmi_handle, count, print,
 				       print_priv);
 				       print_priv);
+	}
 }
 }
 
 
 static inline void wma_print_wmi_mgmt_cmd_tx_cmp_log(uint32_t count,
 static inline void wma_print_wmi_mgmt_cmd_tx_cmp_log(uint32_t count,
@@ -2532,9 +2538,12 @@ static inline void wma_print_wmi_mgmt_cmd_tx_cmp_log(uint32_t count,
 {
 {
 	t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
 	t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
 
 
-	if (wma)
+	if (wma) {
+		print(print_priv,
+		"Management Command Tx Complete Log (count %u)", count);
 		wmi_print_mgmt_cmd_tx_cmp_log(wma->wmi_handle, count, print,
 		wmi_print_mgmt_cmd_tx_cmp_log(wma->wmi_handle, count, print,
 					      print_priv);
 					      print_priv);
+	}
 }
 }
 
 
 static inline void wma_print_wmi_event_log(uint32_t count,
 static inline void wma_print_wmi_event_log(uint32_t count,
@@ -2543,8 +2552,10 @@ static inline void wma_print_wmi_event_log(uint32_t count,
 {
 {
 	t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
 	t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
 
 
-	if (wma)
+	if (wma) {
+		print(print_priv, "Event Log (count %u)", count);
 		wmi_print_event_log(wma->wmi_handle, count, print, print_priv);
 		wmi_print_event_log(wma->wmi_handle, count, print, print_priv);
+	}
 }
 }
 
 
 static inline void wma_print_wmi_rx_event_log(uint32_t count,
 static inline void wma_print_wmi_rx_event_log(uint32_t count,
@@ -2553,9 +2564,11 @@ static inline void wma_print_wmi_rx_event_log(uint32_t count,
 {
 {
 	t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
 	t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
 
 
-	if (wma)
+	if (wma) {
+		print(print_priv, "Rx Event Log (count %u)", count);
 		wmi_print_rx_event_log(wma->wmi_handle, count, print,
 		wmi_print_rx_event_log(wma->wmi_handle, count, print,
 				       print_priv);
 				       print_priv);
+	}
 }
 }
 
 
 static inline void wma_print_wmi_mgmt_event_log(uint32_t count,
 static inline void wma_print_wmi_mgmt_event_log(uint32_t count,
@@ -2564,9 +2577,54 @@ static inline void wma_print_wmi_mgmt_event_log(uint32_t count,
 {
 {
 	t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
 	t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
 
 
-	if (wma)
+	if (wma) {
+		print(print_priv, "Management Event Log (count %u)", count);
 		wmi_print_mgmt_event_log(wma->wmi_handle, count, print,
 		wmi_print_mgmt_event_log(wma->wmi_handle, count, print,
 					 print_priv);
 					 print_priv);
+	}
+}
+#else
+
+static inline void wma_print_wmi_cmd_log(uint32_t count,
+					 qdf_abstract_print *print,
+					 void *print_priv)
+{
+}
+
+static inline void wma_print_wmi_cmd_tx_cmp_log(uint32_t count,
+						qdf_abstract_print *print,
+						void *print_priv)
+{
+}
+
+static inline void wma_print_wmi_mgmt_cmd_log(uint32_t count,
+					      qdf_abstract_print *print,
+					      void *print_priv)
+{
+}
+
+static inline void wma_print_wmi_mgmt_cmd_tx_cmp_log(uint32_t count,
+						     qdf_abstract_print *print,
+						     void *print_priv)
+{
+}
+
+static inline void wma_print_wmi_event_log(uint32_t count,
+					   qdf_abstract_print *print,
+					   void *print_priv)
+{
+}
+
+static inline void wma_print_wmi_rx_event_log(uint32_t count,
+					      qdf_abstract_print *print,
+					      void *print_priv)
+{
+}
+
+static inline void wma_print_wmi_mgmt_event_log(uint32_t count,
+						qdf_abstract_print *print,
+						void *print_priv)
+{
 }
 }
 #endif /* WMI_INTERFACE_EVENT_LOGGING */
 #endif /* WMI_INTERFACE_EVENT_LOGGING */