Parcourir la source

qcacld-3.0: Replace channel ID with channel frequency

Replace channel ID(currentReqChannel) with channel frequency(
curr_req_chan_freq) in struct pe_session.

Remove a few camel cases captured by checkpatch.

Change-Id: I56b5d411632ae3b7069fcfac843626435c5b27a2
CRs-Fixed: 2488084
wadesong il y a 5 ans
Parent
commit
b96f3ba708
2 fichiers modifiés avec 20 ajouts et 16 suppressions
  1. 1 1
      core/mac/src/pe/include/lim_session.h
  2. 19 15
      core/mac/src/pe/lim/lim_utils.c

+ 1 - 1
core/mac/src/pe/include/lim_session.h

@@ -218,7 +218,7 @@ struct pe_session {
 	tSirMacRateSet extRateSet;
 	tSirMacHTOperatingMode htOperMode;
 	uint8_t currentOperChannel;
-	uint8_t currentReqChannel;
+	uint32_t curr_req_chan_freq;
 	uint8_t LimRxedBeaconCntDuringHB;
 
 	/* Time stamp of the last beacon received from the BSS to which STA is connected. */

+ 19 - 15
core/mac/src/pe/lim/lim_utils.c

@@ -2187,7 +2187,9 @@ void lim_switch_channel_cback(struct mac_context *mac, QDF_STATUS status,
 	struct scheduler_msg mmhMsg = { 0 };
 	struct switch_channel_ind *pSirSmeSwitchChInd;
 
-	pe_session->currentOperChannel = pe_session->currentReqChannel;
+	pe_session->currentOperChannel =
+		wlan_reg_freq_to_chan(mac->pdev,
+				      pe_session->curr_req_chan_freq);
 
 	/* We need to restore pre-channelSwitch state on the STA */
 	if (lim_restore_pre_channel_switch_state(mac, pe_session) !=
@@ -2251,24 +2253,25 @@ void lim_switch_channel_cback(struct mac_context *mac, QDF_STATUS status,
  *
  ***NOTE:
  * @param  mac        Pointer to Global MAC structure
- * @param  newChannel  new chnannel ID
+ * @param  new_channel  new chnannel ID
  * @return NONE
  */
-void lim_switch_primary_channel(struct mac_context *mac, uint8_t newChannel,
+void lim_switch_primary_channel(struct mac_context *mac, uint8_t new_channel,
 				struct pe_session *pe_session)
 {
 	pe_debug("old chnl: %d --> new chnl: %d",
-		       pe_session->currentOperChannel, newChannel);
+		       pe_session->currentOperChannel, new_channel);
 
-	pe_session->currentReqChannel = newChannel;
-	pe_session->limRFBand = lim_get_rf_band(newChannel);
+	pe_session->curr_req_chan_freq = wlan_reg_chan_to_freq(mac->pdev,
+							       new_channel);
+	pe_session->limRFBand = lim_get_rf_band(new_channel);
 
 	pe_session->channelChangeReasonCode = LIM_SWITCH_CHANNEL_OPERATION;
 
 	mac->lim.gpchangeChannelCallback = lim_switch_channel_cback;
 	mac->lim.gpchangeChannelData = NULL;
 
-	lim_send_switch_chnl_params(mac, newChannel, 0, 0, CH_WIDTH_20MHZ,
+	lim_send_switch_chnl_params(mac, new_channel, 0, 0, CH_WIDTH_20MHZ,
 				    pe_session->maxTxPower,
 				    pe_session->peSessionId, false, 0, 0);
 	return;
@@ -2286,7 +2289,7 @@ void lim_switch_primary_channel(struct mac_context *mac, uint8_t newChannel,
  *
  ***NOTE:
  * @param  mac        Pointer to Global MAC structure
- * @param  newChannel  New chnannel ID (or current channel ID)
+ * @param  new_channel  New chnannel ID (or current channel ID)
  * @param  subband     CB secondary info:
  *                       - eANI_CB_SECONDARY_NONE
  *                       - eANI_CB_SECONDARY_UP
@@ -2295,30 +2298,31 @@ void lim_switch_primary_channel(struct mac_context *mac, uint8_t newChannel,
  */
 void lim_switch_primary_secondary_channel(struct mac_context *mac,
 					struct pe_session *pe_session,
-					uint8_t newChannel,
+					uint8_t new_channel,
 					uint8_t ch_center_freq_seg0,
 					uint8_t ch_center_freq_seg1,
 					enum phy_ch_width ch_width)
 {
 
 	/* Assign the callback to resume TX once channel is changed. */
-	pe_session->currentReqChannel = newChannel;
-	pe_session->limRFBand = lim_get_rf_band(newChannel);
+	pe_session->curr_req_chan_freq = wlan_reg_chan_to_freq(mac->pdev,
+							       new_channel);
+	pe_session->limRFBand = lim_get_rf_band(new_channel);
 	pe_session->channelChangeReasonCode = LIM_SWITCH_CHANNEL_OPERATION;
 	mac->lim.gpchangeChannelCallback = lim_switch_channel_cback;
 	mac->lim.gpchangeChannelData = NULL;
 
-	lim_send_switch_chnl_params(mac, newChannel, ch_center_freq_seg0,
+	lim_send_switch_chnl_params(mac, new_channel, ch_center_freq_seg0,
 					ch_center_freq_seg1, ch_width,
 					pe_session->maxTxPower,
 					pe_session->peSessionId,
 					false, 0, 0);
 
 	/* Store the new primary and secondary channel in session entries if different */
-	if (pe_session->currentOperChannel != newChannel) {
+	if (pe_session->currentOperChannel != new_channel) {
 		pe_warn("switch old chnl: %d --> new chnl: %d",
-			pe_session->currentOperChannel, newChannel);
-		pe_session->currentOperChannel = newChannel;
+			pe_session->currentOperChannel, new_channel);
+		pe_session->currentOperChannel = new_channel;
 	}
 	if (pe_session->htSecondaryChannelOffset !=
 			pe_session->gLimChannelSwitch.sec_ch_offset) {