rtwn: remove SEQ_SEL, replace with a QOS bit
I've reviewed all of the linux vendor and upstream drivers. This SEQ_SEL field isn't a mask and doesn't ever look like it it was; instead this bit is set to tag QoS data frames. In fact, it effectively was set to 0 for STA frames and potentially 1 for broadcast/multicast frames as the STA macid of 0 and broadcast/ multicast macid of 1 maps to that. In AP modes it would be tagged based on bit 0. So, bring it in line with the vendor and linux drivers. Locally tested: * RTL8192CU, STA, hostap * RTL8188EU, STA * RTL8192EU, STA Differential Revision: https://reviews.freebsd.org/D48092
This commit is contained in:
@@ -64,7 +64,6 @@ r92c_beacon_init(struct rtwn_softc *sc, void *buf, int id)
|
||||
|
||||
rtwn_r92c_tx_setup_macid(sc, buf, id);
|
||||
txd->txdw4 |= htole32(R92C_TXDW4_DRVRATE);
|
||||
txd->txdw4 |= htole32(SM(R92C_TXDW4_SEQ_SEL, id));
|
||||
txd->txdw4 |= htole32(SM(R92C_TXDW4_PORT_ID, id));
|
||||
txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, RTWN_RIDX_CCK1));
|
||||
}
|
||||
|
||||
@@ -272,7 +272,13 @@ r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni,
|
||||
if (ismcast)
|
||||
txd->flags0 |= R92C_FLAGS0_BMCAST;
|
||||
|
||||
if (IEEE80211_IS_QOSDATA(wh))
|
||||
txd->txdw4 |= htole32(R92C_TXDW4_QOS);
|
||||
|
||||
if (!ismcast) {
|
||||
struct rtwn_node *un = RTWN_NODE(ni);
|
||||
macid = un->id;
|
||||
|
||||
/* Unicast frame, check if an ACK is expected. */
|
||||
if (!qos || (qos & IEEE80211_QOS_ACKPOLICY) !=
|
||||
IEEE80211_QOS_ACKPOLICY_NOACK) {
|
||||
@@ -281,9 +287,6 @@ r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni,
|
||||
maxretry));
|
||||
}
|
||||
|
||||
struct rtwn_node *un = RTWN_NODE(ni);
|
||||
macid = un->id;
|
||||
|
||||
if (type == IEEE80211_FC0_TYPE_DATA) {
|
||||
qsel = tid % RTWN_MAX_TID;
|
||||
|
||||
@@ -348,7 +351,6 @@ r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni,
|
||||
if (!hasqos) {
|
||||
/* Use HW sequence numbering for non-QoS frames. */
|
||||
rtwn_r92c_tx_setup_hwseq(sc, txd);
|
||||
txd->txdw4 |= htole32(SM(R92C_TXDW4_SEQ_SEL, uvp->id));
|
||||
} else {
|
||||
uint16_t seqno;
|
||||
|
||||
@@ -409,7 +411,6 @@ r92c_fill_tx_desc_raw(struct rtwn_softc *sc, struct ieee80211_node *ni,
|
||||
if (!IEEE80211_QOS_HAS_SEQ(wh)) {
|
||||
/* Use HW sequence numbering for non-QoS frames. */
|
||||
rtwn_r92c_tx_setup_hwseq(sc, txd);
|
||||
txd->txdw4 |= htole32(SM(R92C_TXDW4_SEQ_SEL, uvp->id));
|
||||
} else {
|
||||
/* Set sequence number. */
|
||||
txd->txdseq |= htole16(M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE);
|
||||
@@ -438,7 +439,6 @@ r92c_fill_tx_desc_null(struct rtwn_softc *sc, void *buf, int is11b,
|
||||
|
||||
if (!qos) {
|
||||
rtwn_r92c_tx_setup_hwseq(sc, txd);
|
||||
txd->txdw4 |= htole32(SM(R92C_TXDW4_SEQ_SEL, id));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,8 +69,7 @@ struct r92c_tx_desc {
|
||||
uint32_t txdw4;
|
||||
#define R92C_TXDW4_RTSRATE_M 0x0000001f
|
||||
#define R92C_TXDW4_RTSRATE_S 0
|
||||
#define R92C_TXDW4_SEQ_SEL_M 0x00000040
|
||||
#define R92C_TXDW4_SEQ_SEL_S 6
|
||||
#define R92C_TXDW4_QOS 0x00000040 /* BIT(6) for 8188cu/8192cu/8723au */
|
||||
#define R92C_TXDW4_HWSEQ_EN 0x00000080
|
||||
#define R92C_TXDW4_DRVRATE 0x00000100
|
||||
#define R92C_TXDW4_CTS2SELF 0x00000800
|
||||
|
||||
Reference in New Issue
Block a user