Bladeren bron

qcacld-3.0: Replace typedef tSirKeepAliveReq

The Linux Coding Style enumerates a few special cases where typedefs
are useful, but stresses "NEVER EVER use a typedef unless you can
clearly match one of those rules." The tSirKeepAliveReq typedef does
not meet any of those criteria, so replace it (and the "tp" variant)
with a reference to the underlying struct.

Further note the Linux Coding Style frowns upon mixed-case names and
so-called Hungarian notation, so in conjunction rename the underlying
struct to be in compliance.

Change-Id: I68e1607c76c1ed1b7bc570ecae677e9c790803cb
CRs-Fixed: 2396065
Jeff Johnson 6 jaren geleden
bovenliggende
commit
562ccad1e9

+ 1 - 1
core/hdd/src/wlan_hdd_power.c

@@ -685,7 +685,7 @@ static int hdd_set_grat_arp_keepalive(struct hdd_adapter *adapter)
 	int exit_code;
 	struct hdd_context *hdd_ctx;
 	struct hdd_station_ctx *sta_ctx;
-	tSirKeepAliveReq req = {
+	struct keep_alive_req req = {
 		.packetType = SIR_KEEP_ALIVE_UNSOLICIT_ARP_RSP,
 		.dest_macaddr = QDF_MAC_ADDR_BCAST_INIT,
 	};

+ 3 - 3
core/hdd/src/wlan_hdd_wext.c

@@ -8763,7 +8763,7 @@ static int __iw_set_keepalive_params(struct net_device *dev,
 				     union iwreq_data *wrqu, char *extra)
 {
 	struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	tpSirKeepAliveReq request = (tpSirKeepAliveReq) extra;
+	struct keep_alive_req *request = (struct keep_alive_req *)extra;
 	struct hdd_context *hdd_ctx;
 	int ret;
 
@@ -8792,7 +8792,7 @@ static int __iw_set_keepalive_params(struct net_device *dev,
 
 	/* Debug display of request components. */
 	hdd_debug("Set Keep Alive Request : TimePeriod %d size %zu",
-		request->timePeriod, sizeof(tSirKeepAliveReq));
+		request->timePeriod, sizeof(struct keep_alive_req));
 
 	switch (request->packetType) {
 	case WLAN_KEEP_ALIVE_NULL_PKT:
@@ -10916,7 +10916,7 @@ static const struct iw_priv_args we_private_args[] = {
 	 "getWlanStats"},
 
 	{WLAN_SET_KEEPALIVE_PARAMS,
-	 IW_PRIV_TYPE_BYTE | sizeof(tSirKeepAliveReq) |
+	 IW_PRIV_TYPE_BYTE | sizeof(struct keep_alive_req) |
 	 IW_PRIV_SIZE_FIXED,
 	 0,
 	 "setKeepAlive"},

+ 2 - 2
core/mac/inc/sir_api.h

@@ -2007,7 +2007,7 @@ struct sir_host_offload_req {
 #define SIR_KEEP_ALIVE_UNSOLICIT_ARP_RSP     2
 
 /* Keep Alive request. */
-typedef struct sSirKeepAliveReq {
+struct keep_alive_req {
 	uint8_t packetType;
 	uint32_t timePeriod;
 	tSirIpv4Addr hostIpv4Addr;
@@ -2015,7 +2015,7 @@ typedef struct sSirKeepAliveReq {
 	struct qdf_mac_addr dest_macaddr;
 	struct qdf_mac_addr bssid;
 	uint8_t sessionId;
-} tSirKeepAliveReq, *tpSirKeepAliveReq;
+};
 
 typedef struct sSirSmeMgmtFrameInd {
 	uint16_t frame_len;

+ 1 - 1
core/sme/inc/sme_api.h

@@ -664,7 +664,7 @@ QDF_STATUS sme_change_mcc_beacon_interval(uint8_t sessionId);
 QDF_STATUS sme_set_host_offload(mac_handle_t mac_handle, uint8_t sessionId,
 		struct sir_host_offload_req *pRequest);
 QDF_STATUS sme_set_keep_alive(mac_handle_t mac_handle, uint8_t sessionId,
-		tpSirKeepAliveReq pRequest);
+		struct keep_alive_req *pRequest);
 QDF_STATUS sme_get_operation_channel(mac_handle_t mac_handle,
 				     uint32_t *pChannel,
 				     uint8_t sessionId);

+ 4 - 4
core/sme/src/common/sme_api.c

@@ -4500,9 +4500,9 @@ QDF_STATUS sme_set_host_offload(mac_handle_t mac_handle, uint8_t sessionId,
  * Return QDF_STATUS
  */
 QDF_STATUS sme_set_keep_alive(mac_handle_t mac_handle, uint8_t session_id,
-			      tpSirKeepAliveReq request)
+			      struct keep_alive_req *request)
 {
-	tpSirKeepAliveReq request_buf;
+	struct keep_alive_req *request_buf;
 	struct scheduler_msg msg = {0};
 	struct mac_context *mac = MAC_CONTEXT(mac_handle);
 	struct csr_roam_session *pSession = CSR_GET_SESSION(mac, session_id);
@@ -4515,12 +4515,12 @@ QDF_STATUS sme_set_keep_alive(mac_handle_t mac_handle, uint8_t session_id,
 				FL("Session not Found"));
 		return QDF_STATUS_E_FAILURE;
 	}
-	request_buf = qdf_mem_malloc(sizeof(tSirKeepAliveReq));
+	request_buf = qdf_mem_malloc(sizeof(*request_buf));
 	if (!request_buf)
 		return QDF_STATUS_E_NOMEM;
 
 	qdf_copy_macaddr(&request->bssid, &pSession->connectedProfile.bssid);
-	qdf_mem_copy(request_buf, request, sizeof(tSirKeepAliveReq));
+	qdf_mem_copy(request_buf, request, sizeof(*request_buf));
 
 	QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
 			"buff TP %d input TP %d ", request_buf->timePeriod,

+ 1 - 1
core/wma/inc/wma_internal.h

@@ -788,7 +788,7 @@ QDF_STATUS wma_set_ap_vdev_up(tp_wma_handle wma, uint8_t vdev_id);
 void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info);
 
 void wma_set_keepalive_req(tp_wma_handle wma,
-				  tSirKeepAliveReq *keepalive);
+				  struct keep_alive_req *keepalive);
 
 void wma_beacon_miss_handler(tp_wma_handle wma, uint32_t vdev_id,
 			     int32_t rssi);

+ 1 - 2
core/wma/src/wma_main.c

@@ -8431,8 +8431,7 @@ static QDF_STATUS wma_mc_process_msg(struct scheduler_msg *msg)
 				     (tpMaxTxPowerParams) msg->bodyptr);
 		break;
 	case WMA_SET_KEEP_ALIVE:
-		wma_set_keepalive_req(wma_handle,
-				      (tSirKeepAliveReq *) msg->bodyptr);
+		wma_set_keepalive_req(wma_handle, msg->bodyptr);
 		break;
 #ifdef FEATURE_WLAN_ESE
 	case WMA_SET_PLM_REQ:

+ 1 - 1
core/wma/src/wma_mgmt.c

@@ -3124,7 +3124,7 @@ send_rsp:
  * Return: none
  */
 void wma_set_keepalive_req(tp_wma_handle wma,
-			   tSirKeepAliveReq *keepalive)
+			   struct keep_alive_req *keepalive)
 {
 	WMA_LOGD("KEEPALIVE:PacketType:%d", keepalive->packetType);
 	wma_set_sta_keep_alive(wma, keepalive->sessionId,