public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: bubupersonal@tutamail.com
To: Linux Staging <linux-staging@lists.linux.dev>
Cc: Linux Wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] rtw: btcoex: clean up style and documentation
Date: Thu, 5 Feb 2026 18:38:06 +0100 (CET)	[thread overview]
Message-ID: <OkisUHh--F-9@tutamail.com> (raw)
In-Reply-To: <2026020533-commotion-surfacing-e9ea@gregkh>

Here's the correct patch.
// SPDX-License-Identifier: GPL-2.0
/******************************************************************************
*
* Copyright(c) 2013 Realtek Corporation. All rights reserved.
*
******************************************************************************/
#include <drv_types.h>
#include <rtw_btcoex.h>
#include <hal_btcoex.h>

#define BTCOEX_LPS_RF_ON_TIMEOUT	100

/**
* rtw_btcoex_media_status_notify() - Notify BT coexistence of media status
* @adpt: driver private adapter
* @media_status: connection state
*
* Context: process context
* Locking: caller ensures MLME state is stable
*/
void rtw_btcoex_media_status_notify(struct adapter *adpt, u8 media_status)
{
if (media_status == RT_MEDIA_CONNECT &&
    check_fwstate(&adpt->mlmepriv, WIFI_AP_STATE))
rtw_hal_set_hwreg(adpt, HW_VAR_DL_RSVD_PAGE, NULL);

hal_btcoex_MediaStatusNotify(adpt, media_status);
}

/**
* rtw_btcoex_halt_notify() - Notify BT coexistence of device halt
* @adpt: driver private adapter
*
* Context: process context
* Locking: device teardown serialization handled by caller
*/
void rtw_btcoex_halt_notify(struct adapter *adpt)
{
if (!adpt->bup || adpt->bSurpriseRemoved)
return;

hal_btcoex_HaltNotify(adpt);
}

/**
* rtw_btcoex_reject_ap_aggregated_packet() - Control AP-side AMPDU handling
* @adpt: driver private adapter
* @enable: reject aggregation when true
*
* Used by BT coexistence logic to reduce interference by disabling
* AP-side AMPDU negotiation.
*
* Context: process context
* Locking: caller holds appropriate MLME/STA protection
*/
void rtw_btcoex_reject_ap_aggregated_packet(struct adapter *adpt, bool enable)
{
struct mlme_ext_info *mlmeinfo;
struct mlme_priv *mlme;
struct sta_info *sta;

mlme = &adpt->mlmepriv;
mlmeinfo = &adpt->mlmeextpriv.mlmext_info;

if (!enable) {
mlmeinfo->accept_addba_req = true;
return;
}

mlmeinfo->accept_addba_req = false;

sta = rtw_get_stainfo(&adpt->stapriv, get_bssid(mlme));
if (sta)
send_delba(adpt, 0, sta->hwaddr);
}

/**
* rtw_btcoex_lps_enter() - Enter low power state for BT coexistence
* @adpt: driver private adapter
*
* Context: process context
* Locking: power control serialized by caller
*
* This function transitions firmware into LPS mode. State flags are
* updated only after the transition request is issued.
*/
void rtw_btcoex_lps_enter(struct adapter *adpt)
{
struct pwrctrl_priv *pwrpriv;
u8 lps_val;

pwrpriv = adapter_to_pwrctl(adpt);

lps_val = hal_btcoex_LpsVal(adpt);
rtw_set_ps_mode(adpt, PS_MODE_MIN, 0, lps_val, "BTCOEX");

pwrpriv->bpower_saving = true;
}

/**
* rtw_btcoex_lps_leave() - Leave low power state for BT coexistence
* @adpt: driver private adapter
*
* Context: process context
* Locking: power control serialized by caller
*
* Ensures RF is fully powered before clearing power-saving state.
*/
void rtw_btcoex_lps_leave(struct adapter *adpt)
{
struct pwrctrl_priv *pwrpriv;

pwrpriv = adapter_to_pwrctl(adpt);

if (pwrpriv->pwr_mode != PS_MODE_ACTIVE) {
rtw_set_ps_mode(adpt, PS_MODE_ACTIVE, 0, 0,
"BTCOEX");
LPS_RF_ON_check(adpt, BTCOEX_LPS_RF_ON_TIMEOUT);
}

pwrpriv->bpower_saving = false;
}

  parent reply	other threads:[~2026-02-05 17:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-05 16:18 [PATCH] rtw: btcoex: clean up style and documentation bubupersonal
2026-02-05 16:42 ` Greg KH
     [not found]   ` <OkipX2h--N-9@tutamail.com>
     [not found]     ` <2026020533-commotion-surfacing-e9ea@gregkh>
2026-02-05 17:38       ` bubupersonal [this message]
2026-02-06  7:43         ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OkisUHh--F-9@tutamail.com \
    --to=bubupersonal@tutamail.com \
    --cc=linux-staging@lists.linux.dev \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox