qcacmn: Add new function free_samp_msg_skb()
Add a new API free_samp_msg_skb(), to free SAMP msg buffer, if error in phyerr processing for 160/80p80 MHz modes. Call this API from reset_160mhz_delivery_state_machine(), to avoid redundancy. CRs-Fixed: 2961987 Change-Id: I3a0488997e474fef6f4f57e3fbfd1a163c91ac7b
This commit is contained in:

committed by
Madan Koyyalamudi

parent
a66fec0ada
commit
8a5bf47771
@@ -2081,6 +2081,38 @@ is_ch_width_160_or_80p80(enum phy_ch_width ch_width)
|
||||
return (ch_width == CH_WIDTH_160MHZ || ch_width == CH_WIDTH_80P80MHZ);
|
||||
}
|
||||
|
||||
/**
|
||||
* free_samp_msg_skb() - Free SAMP message skb
|
||||
* @spectral: Pointer to Spectral
|
||||
* @smode: Spectral Scan mode
|
||||
*
|
||||
* Free SAMP message skb, if error in report processing
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static inline void
|
||||
free_samp_msg_skb(struct target_if_spectral *spectral,
|
||||
enum spectral_scan_mode smode)
|
||||
{
|
||||
enum spectral_msg_type smsg_type;
|
||||
QDF_STATUS ret;
|
||||
|
||||
if (smode >= SPECTRAL_SCAN_MODE_MAX) {
|
||||
spectral_err_rl("Invalid Spectral mode %d", smode);
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_ch_width_160_or_80p80(spectral->ch_width[smode])) {
|
||||
ret = target_if_get_spectral_msg_type(smode, &smsg_type);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
spectral_err("Failed to get spectral message type");
|
||||
return;
|
||||
}
|
||||
spectral->nl_cb.free_sbuff(spectral->pdev_obj,
|
||||
smsg_type);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* init_160mhz_delivery_state_machine() - Initialize 160MHz Spectral
|
||||
* state machine
|
||||
@@ -2113,26 +2145,16 @@ static inline void
|
||||
reset_160mhz_delivery_state_machine(struct target_if_spectral *spectral,
|
||||
enum spectral_scan_mode smode)
|
||||
{
|
||||
enum spectral_msg_type smsg_type;
|
||||
QDF_STATUS ret;
|
||||
|
||||
if (smode >= SPECTRAL_SCAN_MODE_MAX) {
|
||||
spectral_err_rl("Invalid Spectral mode %d", smode);
|
||||
return;
|
||||
}
|
||||
|
||||
free_samp_msg_skb(spectral, smode);
|
||||
|
||||
if (is_ch_width_160_or_80p80(spectral->ch_width[smode])) {
|
||||
spectral->state_160mhz_delivery[smode] =
|
||||
SPECTRAL_REPORT_WAIT_PRIMARY80;
|
||||
|
||||
ret = target_if_get_spectral_msg_type(smode, &smsg_type);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
spectral_err("Failed to get spectral message type");
|
||||
return;
|
||||
}
|
||||
|
||||
spectral->nl_cb.free_sbuff(spectral->pdev_obj,
|
||||
smsg_type);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1570,6 +1570,7 @@ fail:
|
||||
spectral_debug_level = DEBUG_SPECTRAL;
|
||||
|
||||
spectral_err_rl("Error while processing Spectral report");
|
||||
free_samp_msg_skb(spectral, SPECTRAL_SCAN_MODE_NORMAL);
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user