Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src-draft/trunk]: src/sys/dev/usb urtwn(4): reduce some unclear differences ...



details:   https://anonhg.NetBSD.org/src-all/rev/c33f3589b17c
branches:  trunk
changeset: 367219:c33f3589b17c
user:      Martin Husemann <martin%NetBSD.org@localhost>
date:      Sun Feb 27 15:14:24 2022 +0100

description:
urtwn(4): reduce some unclear differences to the driver in HEAD

diffstat:

 sys/dev/usb/if_urtwn.c |  44 +++++++++++++++++++++++---------------------
 1 files changed, 23 insertions(+), 21 deletions(-)

diffs (80 lines):

diff -r d1c8925fb65e -r c33f3589b17c sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Sun Feb 27 15:03:02 2022 +0100
+++ b/sys/dev/usb/if_urtwn.c    Sun Feb 27 15:14:24 2022 +0100
@@ -2326,7 +2326,7 @@
        struct r92c_tx_desc_usb *txd;
        unsigned i, padsize, txd_len;
        uint16_t seq, sum;
-       uint8_t raid, type, tid;
+       uint8_t type, tid;
        int hasqos;
 
        URTWNHIST_FUNC(); URTWNHIST_CALLED();
@@ -2387,21 +2387,23 @@
                DPRINTFN(DBG_TX, "padding: size=%ju", padsize, 0, 0, 0);
                txd->txdw1 |= htole32(SM(R92C_TXDW1_PKTOFF, (padsize / 8)));
        }
-       if (ic->ic_curmode == IEEE80211_MODE_11B) {
-               raid = R92C_RAID_11B;
-               txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 0));
-       } else if (ic->ic_curmode == IEEE80211_MODE_11G) {
-               raid = R92C_RAID_11BG;
-               txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 11));
-       } else {        /* IEEE80211_MODE_11NG */
-               raid = R92C_RAID_11GN;
-               txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 19));
-               txd->txdw5 |= htole32(R92C_TXDW5_SGI);
-       }
-
 
        if (!IEEE80211_IS_MULTICAST(wh->i_addr1) &&
            type == IEEE80211_FC0_TYPE_DATA) {
+               uint8_t raid;
+
+               if (ic->ic_curmode == IEEE80211_MODE_11B) {
+                       raid = R92C_RAID_11B;
+                       txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 0));
+               } else if (ic->ic_curmode == IEEE80211_MODE_11G) {
+                       raid = R92C_RAID_11BG;
+                       txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 11));
+               } else {        /* IEEE80211_MODE_11NG */
+                       raid = R92C_RAID_11GN;
+                       txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 19));
+                       txd->txdw5 |= htole32(R92C_TXDW5_SGI);
+               }
+
                DPRINTFN(DBG_TX,
                    "data packet: tid=%jd, raid=%jd", tid, raid, 0, 0);
 
@@ -2448,23 +2450,23 @@
                txd->txdw1 |= htole32(
                    SM(R92C_TXDW1_MACID, RTWN_MACID_BSS) |
                    SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_MGNT) |
-                   SM(R92C_TXDW1_RAID, raid));
-
-#if 0
+                   SM(R92C_TXDW1_RAID, R92C_RAID_11B));
+
                /* Force CCK1. */
                txd->txdw4 |= htole32(R92C_TXDW4_DRVRATE);
-#endif
+               /* Use 1Mbps */
+               txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 0));
        } else {
                /* broadcast or multicast packets */
                DPRINTFN(DBG_TX, "bc or mc packet", 0, 0, 0, 0);
                txd->txdw1 |= htole32(
                    SM(R92C_TXDW1_MACID, RTWN_MACID_BC) |
-                   SM(R92C_TXDW1_RAID, raid));
-
-#if 0
+                   SM(R92C_TXDW1_RAID, R92C_RAID_11B));
+
                /* Force CCK1. */
                txd->txdw4 |= htole32(R92C_TXDW4_DRVRATE);
-#endif
+               /* Use 1Mbps */
+               txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 0));
        }
        /* Set sequence number */
        seq = LE_READ_2(&wh->i_seq[0]) >> IEEE80211_SEQ_SEQ_SHIFT;



Home | Main Index | Thread Index | Old Index