rtwn: enable LDPC support where possible
Tested with RTL8821AU, STA mode.
This commit is contained in:
parent
c5bba9da5a
commit
3111723c09
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=312597
@ -695,6 +695,7 @@ rtwn_ioctl_reset(struct ieee80211vap *vap, u_long cmd)
|
|||||||
case IEEE80211_IOC_RTSTHRESHOLD:
|
case IEEE80211_IOC_RTSTHRESHOLD:
|
||||||
case IEEE80211_IOC_PROTMODE:
|
case IEEE80211_IOC_PROTMODE:
|
||||||
case IEEE80211_IOC_HTPROTMODE:
|
case IEEE80211_IOC_HTPROTMODE:
|
||||||
|
case IEEE80211_IOC_LDPC:
|
||||||
error = 0;
|
error = 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -252,7 +252,9 @@ r12a_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs,
|
|||||||
rxdw4 = le32toh(stat->rxdw4);
|
rxdw4 = le32toh(stat->rxdw4);
|
||||||
rate = MS(rxdw3, R12A_RXDW3_RATE);
|
rate = MS(rxdw3, R12A_RXDW3_RATE);
|
||||||
|
|
||||||
/* TODO: STBC, LDPC */
|
/* TODO: STBC */
|
||||||
|
if (rxdw4 & R12A_RXDW4_LDPC)
|
||||||
|
rxs->c_pktflags |= IEEE80211_RX_F_LDPC;
|
||||||
if (rxdw1 & R12A_RXDW1_AMPDU) {
|
if (rxdw1 & R12A_RXDW1_AMPDU) {
|
||||||
if (rxdw0 & R92C_RXDW0_PHYST)
|
if (rxdw0 & R92C_RXDW0_PHYST)
|
||||||
rxs->c_pktflags |= IEEE80211_RX_F_AMPDU;
|
rxs->c_pktflags |= IEEE80211_RX_F_AMPDU;
|
||||||
|
@ -214,6 +214,17 @@ r12a_tx_set_sgi(struct rtwn_softc *sc, void *buf, struct ieee80211_node *ni)
|
|||||||
txd->txdw5 |= htole32(R12A_TXDW5_DATA_SHORT);
|
txd->txdw5 |= htole32(R12A_TXDW5_DATA_SHORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
r12a_tx_set_ldpc(struct rtwn_softc *sc, struct r12a_tx_desc *txd,
|
||||||
|
struct ieee80211_node *ni)
|
||||||
|
{
|
||||||
|
struct ieee80211vap *vap = ni->ni_vap;
|
||||||
|
|
||||||
|
if ((vap->iv_flags_ht & IEEE80211_FHT_LDPC_TX) &&
|
||||||
|
(ni->ni_htcap & IEEE80211_HTCAP_LDPC))
|
||||||
|
txd->txdw5 |= htole32(R12A_TXDW5_DATA_LDPC);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
r12a_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni,
|
r12a_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni,
|
||||||
struct mbuf *m, void *buf, uint8_t ridx, int maxretry)
|
struct mbuf *m, void *buf, uint8_t ridx, int maxretry)
|
||||||
@ -284,6 +295,7 @@ r12a_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni,
|
|||||||
if (ridx >= RTWN_RIDX_MCS(0)) {
|
if (ridx >= RTWN_RIDX_MCS(0)) {
|
||||||
r12a_tx_set_ht40(sc, txd, ni);
|
r12a_tx_set_ht40(sc, txd, ni);
|
||||||
r12a_tx_set_sgi(sc, txd, ni);
|
r12a_tx_set_sgi(sc, txd, ni);
|
||||||
|
r12a_tx_set_ldpc(sc, txd, ni);
|
||||||
prot = ic->ic_htprotmode;
|
prot = ic->ic_htprotmode;
|
||||||
} else if (ic->ic_flags & IEEE80211_F_USEPROT)
|
} else if (ic->ic_flags & IEEE80211_F_USEPROT)
|
||||||
prot = ic->ic_protmode;
|
prot = ic->ic_protmode;
|
||||||
|
@ -168,7 +168,15 @@ r12a_read_chipid_vendor(struct rtwn_softc *sc, uint32_t reg_sys_cfg)
|
|||||||
static void
|
static void
|
||||||
r12au_adj_devcaps(struct rtwn_softc *sc)
|
r12au_adj_devcaps(struct rtwn_softc *sc)
|
||||||
{
|
{
|
||||||
/* TODO: LDPC, STBC etc */
|
struct r12a_softc *rs = sc->sc_priv;
|
||||||
|
struct ieee80211com *ic = &sc->sc_ic;
|
||||||
|
|
||||||
|
if (rs->chip & R12A_CHIP_C_CUT) {
|
||||||
|
ic->ic_htcaps |= IEEE80211_HTCAP_LDPC |
|
||||||
|
IEEE80211_HTC_TXLDPC;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* TODO: STBC, VHT etc */
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -157,10 +157,11 @@ r21au_adj_devcaps(struct rtwn_softc *sc)
|
|||||||
struct ieee80211com *ic = &sc->sc_ic;
|
struct ieee80211com *ic = &sc->sc_ic;
|
||||||
struct r12a_softc *rs = sc->sc_priv;
|
struct r12a_softc *rs = sc->sc_priv;
|
||||||
|
|
||||||
|
ic->ic_htcaps |= IEEE80211_HTC_TXLDPC;
|
||||||
if (rs->rs_radar != 0)
|
if (rs->rs_radar != 0)
|
||||||
ic->ic_caps |= IEEE80211_C_DFS;
|
ic->ic_caps |= IEEE80211_C_DFS;
|
||||||
|
|
||||||
/* TODO: LDPC etc */
|
/* TODO: VHT */
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user