mbox series

[v2,0/6] wifi: rtw89: preparation for MLO including AP_LINK_PS feature, ieee80211_ops and links

Message ID 20241118040255.40854-1-pkshih@realtek.com
Headers show
Series wifi: rtw89: preparation for MLO including AP_LINK_PS feature, ieee80211_ops and links | expand

Message

Ping-Ke Shih Nov. 18, 2024, 4:02 a.m. UTC
Add more materials for MLO. First one is AP_LINK_PS feature. Then
implement ieee80211_ops related to links. The last two are to consider
link_id instead of -1.

v2:
  - rebase on top of tree. no other changes.

Zong-Zhe Yang (6):
  wifi: rtw89: 8922a: configure AP_LINK_PS if FW supports
  wifi: rtw89: register ops of can_activate_links
  wifi: rtw89: implement ops of change vif/sta links
  wifi: rtw89: apply MLD pairwise key to dynamically active links
  wifi: rtw89: pass target link_id to ieee80211_gtk_rekey_add()
  wifi: rtw89: pass target link_id to ieee80211_nullfunc_get()

 drivers/net/wireless/realtek/rtw89/cam.c      |  32 +-
 drivers/net/wireless/realtek/rtw89/cam.h      |   5 +
 drivers/net/wireless/realtek/rtw89/core.c     |  45 ++-
 drivers/net/wireless/realtek/rtw89/core.h     |  59 ++++
 drivers/net/wireless/realtek/rtw89/fw.c       |  71 ++++-
 drivers/net/wireless/realtek/rtw89/fw.h       |  19 ++
 drivers/net/wireless/realtek/rtw89/mac.c      |  50 ++++
 drivers/net/wireless/realtek/rtw89/mac.h      |   7 +
 drivers/net/wireless/realtek/rtw89/mac80211.c | 280 +++++++++++++++++-
 drivers/net/wireless/realtek/rtw89/ser.c      |   1 +
 drivers/net/wireless/realtek/rtw89/wow.c      |   5 +-
 11 files changed, 560 insertions(+), 14 deletions(-)

Comments

Ping-Ke Shih Nov. 20, 2024, 3:11 a.m. UTC | #1
Kalle Valo <kvalo@kernel.org> wrote:
> Ping-Ke Shih <pkshih@realtek.com> writes:
> 
> > From: Zong-Zhe Yang <kevin_yang@realtek.com>
> >
> > After FW v0.35.46.0, for AP mode, RTL8922A FW supports a new FW feature,
> > called NOTIFY_AP_INFO, to notify driver information related to AP mode.
> > And, one function of it is to monitor PS states of remote stations. Once
> > one of them changes, FW will send a C2H event to tell driver. With this
> > FW feature, we can declare AP_LINK_PS.
> >
> > For now, driver still needs to determine if a frame is ps-poll or U-APSD
> > trigger. So, add the corresponding RX handling in driver, which activates
> > only when at least one AP is running.
> >
> > Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
> > Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> 
> [...]
> 
> > +static inline void rtw89_assoc_link_clr(struct rtw89_sta_link *rtwsta_link)
> > +{
> > +     struct rtw89_sta *rtwsta = rtwsta_link->rtwsta;
> > +     struct rtw89_dev *rtwdev = rtwsta->rtwdev;
> > +
> > +     rcu_assign_pointer(rtwdev->assoc_link_on_macid[rtwsta_link->mac_id],
> > +                        NULL);
> > +     synchronize_rcu();
> > +}
> 
> In ath12k patches I got feedback that synchronize_rcu() should not be
> used unless we explicitly need it, for example if if we free something
> or similar. Just wanted to mention this, up to you if you want to keep
> it or not.

The 'rtwdev->assoc_link_on_macid[rtwsta_link->mac_id]' is to store pointer of
rtwsta that is drv_priv [] of ieee80211_sta. After returning from this
function (disassoc), ieee80211_sta is going to be freed by kfree, no other
synchronize_rcu(), so I think this is necessary here. 

Thanks for your reminder.
Kalle Valo Nov. 20, 2024, 9:12 a.m. UTC | #2
Ping-Ke Shih <pkshih@realtek.com> writes:

> Kalle Valo <kvalo@kernel.org> wrote:
>
>> Ping-Ke Shih <pkshih@realtek.com> writes:
>> 
>> > From: Zong-Zhe Yang <kevin_yang@realtek.com>
>> >
>> > After FW v0.35.46.0, for AP mode, RTL8922A FW supports a new FW feature,
>> > called NOTIFY_AP_INFO, to notify driver information related to AP mode.
>> > And, one function of it is to monitor PS states of remote stations. Once
>> > one of them changes, FW will send a C2H event to tell driver. With this
>> > FW feature, we can declare AP_LINK_PS.
>> >
>> > For now, driver still needs to determine if a frame is ps-poll or U-APSD
>> > trigger. So, add the corresponding RX handling in driver, which activates
>> > only when at least one AP is running.
>> >
>> > Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
>> > Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
>> 
>> [...]
>> 
>> > +// CLASS 36 - SoftAP
>> 
>> In wireless we prefer '/* */'.
>> 
>
> The checkpatch is changed to allow this style by default, so I didn't catch
> the warning. Add option "--ignore C99_COMMENT_TOLERANCE" to my local script.

Oh, didn't know that. We should then add that to our ath12k-check script
as well.