Skip to content

Commit

Permalink
LinuxKPI: 802.11: adjustments for v6.11 iwlwifi, rtw88 and rtw89
Browse files Browse the repository at this point in the history
Bring in the LinuxKPI 802.11 compat bits which are altering
the mac80211 KPI.

* In struct ieee80211_bss_conf chandef -> chanreq.
* Various struct ieee80211_ops gained a link_id arguemnt,
  stop gained a suspend flag.
* Various functions gained a link_id argument.
* ieee80211_tx_status() was renamed to ieee80211_tx_status_skb()

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 7b43f4d064195bcf66816cb9fe350a1392fe24ce)
  • Loading branch information
Bjoern A. Zeeb authored and fichtner committed Feb 18, 2025
1 parent 0f5c5ae commit 59333e8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 21 deletions.
22 changes: 12 additions & 10 deletions sys/compat/linuxkpi/common/include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ struct ieee80211_bss_conf {
uint8_t transmitter_bssid[ETH_ALEN];
struct ieee80211_ftm_responder_params *ftmr_params;
struct ieee80211_p2p_noa_attr p2p_noa_attr;
struct cfg80211_chan_def chandef;
struct ieee80211_chanreq chanreq;
__be32 arp_addr_list[1]; /* XXX TODO */
struct ieee80211_rate *beacon_rate;
struct {
Expand Down Expand Up @@ -797,7 +797,9 @@ enum ieee80211_vif_driver_flags {
IEEE80211_VIF_BEACON_FILTER = BIT(0),
IEEE80211_VIF_SUPPORTS_CQM_RSSI = BIT(1),
IEEE80211_VIF_SUPPORTS_UAPSD = BIT(2),
#if defined(LINUXKPI_VERSION) && (LINUXKPI_VERSION < 60600) /* v6.6 */
IEEE80211_VIF_DISABLE_SMPS_OVERRIDE = BIT(3), /* Renamed to IEEE80211_VIF_EML_ACTIVE. */
#endif
IEEE80211_VIF_EML_ACTIVE = BIT(4),
IEEE80211_VIF_IGNORE_OFDMA_WIDER_BW = BIT(5),
};
Expand Down Expand Up @@ -971,7 +973,7 @@ enum ieee80211_offload_flags {
struct ieee80211_ops {
/* TODO FIXME */
int (*start)(struct ieee80211_hw *);
void (*stop)(struct ieee80211_hw *);
void (*stop)(struct ieee80211_hw *, bool);

int (*config)(struct ieee80211_hw *, u32);
void (*reconfig_complete)(struct ieee80211_hw *, enum ieee80211_reconfig_type);
Expand All @@ -994,7 +996,7 @@ struct ieee80211_ops {

void (*mgd_prepare_tx)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_prep_tx_info *);
void (*mgd_complete_tx)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_prep_tx_info *);
void (*mgd_protect_tdls_discover)(struct ieee80211_hw *, struct ieee80211_vif *);
void (*mgd_protect_tdls_discover)(struct ieee80211_hw *, struct ieee80211_vif *, unsigned int);

void (*flush)(struct ieee80211_hw *, struct ieee80211_vif *, u32, bool);
void (*flush_sta)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *);
Expand Down Expand Up @@ -1025,10 +1027,10 @@ struct ieee80211_ops {
bool (*can_aggregate_in_amsdu)(struct ieee80211_hw *, struct sk_buff *, struct sk_buff *);

int (*pre_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel_switch *);
int (*post_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *);
int (*post_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *);
void (*channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel_switch *);
void (*channel_switch_beacon)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_chan_def *);
void (*abort_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *);
void (*abort_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *);
void (*channel_switch_rx_beacon)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel_switch *);
int (*tdls_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, u8, struct cfg80211_chan_def *, struct sk_buff *, u32);
void (*tdls_cancel_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *);
Expand Down Expand Up @@ -1565,7 +1567,7 @@ ieee80211_beacon_loss(struct ieee80211_vif *vif)
}

static __inline void
ieee80211_chswitch_done(struct ieee80211_vif *vif, bool t)
ieee80211_chswitch_done(struct ieee80211_vif *vif, bool t, uint32_t link_id)
{
TODO();
}
Expand All @@ -1591,7 +1593,7 @@ ieee80211_csa_update_counter(struct ieee80211_vif *vif)
}

static __inline void
ieee80211_csa_finish(struct ieee80211_vif *vif)
ieee80211_csa_finish(struct ieee80211_vif *vif, uint32_t link_id)
{
TODO();
}
Expand Down Expand Up @@ -2115,7 +2117,7 @@ ieee80211_queue_work(struct ieee80211_hw *hw, struct work_struct *w)
}

static __inline void
ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
ieee80211_tx_status_skb(struct ieee80211_hw *hw, struct sk_buff *skb)
{
linuxkpi_ieee80211_tx_status(hw, skb);
}
Expand Down Expand Up @@ -2229,7 +2231,7 @@ ieee80211_beacon_set_cntdwn(struct ieee80211_vif *vif, u8 counter)
}

static __inline int
ieee80211_beacon_update_cntdwn(struct ieee80211_vif *vif)
ieee80211_beacon_update_cntdwn(struct ieee80211_vif *vif, uint32_t link_id)
{
TODO();
return (-1);
Expand All @@ -2244,7 +2246,7 @@ ieee80211_get_vht_max_nss(struct ieee80211_vht_cap *vht_cap, uint32_t chanwidth,
}

static __inline bool
ieee80211_beacon_cntdwn_is_complete(struct ieee80211_vif *vif)
ieee80211_beacon_cntdwn_is_complete(struct ieee80211_vif *vif, uint32_t link_id)
{
TODO();
return (true);
Expand Down
14 changes: 7 additions & 7 deletions sys/compat/linuxkpi/common/src/linux_80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1268,9 +1268,9 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int
} else {
error = lkpi_80211_mo_add_chanctx(hw, chanctx_conf);
if (error == 0 || error == EOPNOTSUPP) {
vif->bss_conf.chandef.chan = chanctx_conf->def.chan;
vif->bss_conf.chandef.width = chanctx_conf->def.width;
vif->bss_conf.chandef.center_freq1 =
vif->bss_conf.chanreq.oper.chan = chanctx_conf->def.chan;
vif->bss_conf.chanreq.oper.width = chanctx_conf->def.width;
vif->bss_conf.chanreq.oper.center_freq1 =
chanctx_conf->def.center_freq1;
#ifdef LKPI_80211_HT
if (vif->bss_conf.chandef.width == NL80211_CHAN_WIDTH_40) {
Expand All @@ -1281,7 +1281,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int
vif->bss_conf.chandef.center_freq1 -= 10;
}
#endif
vif->bss_conf.chandef.center_freq2 =
vif->bss_conf.chanreq.oper.center_freq2 =
chanctx_conf->def.center_freq2;
} else {
ic_printf(vap->iv_ic, "%s:%d: mo_add_chanctx "
Expand Down Expand Up @@ -2834,7 +2834,7 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ],
lvif->lvif_ifllevent = EVENTHANDLER_REGISTER(iflladdr_event,
lkpi_vif_iflladdr, vif, EVENTHANDLER_PRI_ANY);
vif->bss_conf.link_id = 0; /* Non-MLO operation. */
vif->bss_conf.chandef.width = NL80211_CHAN_WIDTH_20_NOHT;
vif->bss_conf.chanreq.oper.width = NL80211_CHAN_WIDTH_20_NOHT;
vif->bss_conf.use_short_preamble = false; /* vap->iv_flags IEEE80211_F_SHPREAMBLE */
vif->bss_conf.use_short_slot = false; /* vap->iv_flags IEEE80211_F_SHSLOT */
vif->bss_conf.qos = false;
Expand Down Expand Up @@ -3020,7 +3020,7 @@ lkpi_ic_vap_delete(struct ieee80211vap *vap)
lkpi_80211_mo_remove_interface(hw, vif);

/* Single VAP, so we can do this here. */
lkpi_80211_mo_stop(hw);
lkpi_80211_mo_stop(hw, false); /* XXX SUSPEND */

mtx_destroy(&lvif->mtx);
free(lvif, M_80211_VAP);
Expand Down Expand Up @@ -3077,7 +3077,7 @@ lkpi_ic_parent(struct ieee80211com *ic)
start_all = true;
} else {
#ifdef HW_START_STOP
lkpi_80211_mo_stop(hw);
lkpi_80211_mo_stop(hw, false); /* XXX SUSPEND */
#endif
}
LKPI_80211_LHW_UNLOCK(lhw);
Expand Down
2 changes: 1 addition & 1 deletion sys/compat/linuxkpi/common/src/linux_80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ struct lkpi_wiphy {
mtx_assert(&(_ltxq)->ltxq_mtx, MA_NOTOWNED)

int lkpi_80211_mo_start(struct ieee80211_hw *);
void lkpi_80211_mo_stop(struct ieee80211_hw *);
void lkpi_80211_mo_stop(struct ieee80211_hw *, bool);
int lkpi_80211_mo_get_antenna(struct ieee80211_hw *, u32 *, u32 *);
int lkpi_80211_mo_set_frag_threshold(struct ieee80211_hw *, uint32_t);
int lkpi_80211_mo_set_rts_threshold(struct ieee80211_hw *, uint32_t);
Expand Down
6 changes: 3 additions & 3 deletions sys/compat/linuxkpi/common/src/linux_80211_macops.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ lkpi_80211_mo_start(struct ieee80211_hw *hw)
}

void
lkpi_80211_mo_stop(struct ieee80211_hw *hw)
lkpi_80211_mo_stop(struct ieee80211_hw *hw, bool suspend)
{
struct lkpi_hw *lhw;

lhw = HW_TO_LHW(hw);
if (lhw->ops->stop == NULL)
return;

LKPI_80211_TRACE_MO("hw %p", hw);
lhw->ops->stop(hw);
LKPI_80211_TRACE_MO("hw %p suspend %d", hw, suspend);
lhw->ops->stop(hw, suspend);
lhw->sc_flags &= ~LKPI_MAC80211_DRV_STARTED;
}

Expand Down

0 comments on commit 59333e8

Please sign in to comment.