Source-Changes-HG archive

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

[src-draft/trunk]: src/sys/dev/pci As scanning is handled within the driver f...



details:   https://anonhg.NetBSD.org/src-all/rev/5985ff262e06
branches:  trunk
changeset: 939593:5985ff262e06
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Thu Sep 03 21:07:30 2020 +1000

description:
As scanning is handled within the driver for this device, add
the appropriate scanning variables to the devs softc.

diffstat:

 sys/dev/pci/if_iwm.c    |  29 +++++++++++++++--------------
 sys/dev/pci/if_iwmvar.h |   2 ++
 2 files changed, 17 insertions(+), 14 deletions(-)

diffs (99 lines):

diff -r 3f358110ff04 -r 5985ff262e06 sys/dev/pci/if_iwm.c
--- a/sys/dev/pci/if_iwm.c      Sat Aug 29 10:23:40 2020 +1000
+++ b/sys/dev/pci/if_iwm.c      Thu Sep 03 21:07:30 2020 +1000
@@ -5355,8 +5355,8 @@
 
        memset(preq, 0, sizeof(*preq));
 
-       KASSERT(ic->ic_des_esslen < sizeof(ic->ic_des_essid));
-       if (remain < sizeof(*wh) + 2 + ic->ic_des_esslen)
+       KASSERT(sc->sc_des_esslen < sizeof(sc->sc_des_essid));
+       if (remain < sizeof(*wh) + 2 + sc->sc_des_esslen)
                return ENOBUFS;
 
        /*
@@ -5373,7 +5373,7 @@
        *(uint16_t *)&wh->i_seq[0] = 0; /* filled by HW */
 
        frm = (uint8_t *)(wh + 1);
-       frm = ieee80211_add_ssid(frm, ic->ic_des_essid, ic->ic_des_esslen);
+       frm = ieee80211_add_ssid(frm, sc->sc_des_essid, sc->sc_des_esslen);
 
        /* Tell the firmware where the MAC header is. */
        preq->mac_header.offset = 0;
@@ -5480,7 +5480,7 @@
        req->scan_flags = htole32(IWM_LMAC_SCAN_FLAG_PASS_ALL |
            IWM_LMAC_SCAN_FLAG_ITER_COMPLETE |
            IWM_LMAC_SCAN_FLAG_EXTENDED_DWELL);
-       if (ic->ic_des_esslen == 0)
+       if (sc->sc_des_esslen == 0)
                req->scan_flags |= htole32(IWM_LMAC_SCAN_FLAG_PASSIVE);
        else
                req->scan_flags |= htole32(IWM_LMAC_SCAN_FLAG_PRE_CONNECTION);
@@ -5509,16 +5509,16 @@
        req->tx_cmd[1].sta_id = IWM_AUX_STA_ID;
 
        /* Check if we're doing an active directed scan. */
-       if (ic->ic_des_esslen != 0) {
+       if (sc->sc_des_esslen != 0) {
                req->direct_scan[0].id = IEEE80211_ELEMID_SSID;
-               req->direct_scan[0].len = ic->ic_des_esslen;
-               memcpy(req->direct_scan[0].ssid, ic->ic_des_essid,
-                   ic->ic_des_esslen);
+               req->direct_scan[0].len = sc->sc_des_esslen;
+               memcpy(req->direct_scan[0].ssid, sc->sc_des_essid,
+                   sc->sc_des_esslen);
        }
 
        req->n_channels = iwm_lmac_scan_fill_channels(sc,
            (struct iwm_scan_channel_cfg_lmac *)req->data,
-           ic->ic_des_esslen != 0);
+           sc->sc_des_esslen != 0);
 
        err = iwm_fill_probe_req(sc,
            (struct iwm_scan_probe_req *)(req->data +
@@ -5655,7 +5655,7 @@
 
        req->n_channels = iwm_umac_scan_fill_channels(sc,
            (struct iwm_scan_channel_cfg_umac *)req->data,
-           ic->ic_des_esslen != 0);
+           sc->sc_des_esslen != 0);
 
        req->general_flags = htole32(IWM_UMAC_SCAN_GEN_FLAGS_PASS_ALL |
            IWM_UMAC_SCAN_GEN_FLAGS_ITER_COMPLETE |
@@ -5666,11 +5666,11 @@
                        sc->sc_capa_n_scan_channels);
 
        /* Check if we're doing an active directed scan. */
-       if (ic->ic_des_esslen != 0) {
+       if (sc->sc_des_esslen != 0) {
                tail->direct_scan[0].id = IEEE80211_ELEMID_SSID;
-               tail->direct_scan[0].len = ic->ic_des_esslen;
-               memcpy(tail->direct_scan[0].ssid, ic->ic_des_essid,
-                   ic->ic_des_esslen);
+               tail->direct_scan[0].len = sc->sc_des_esslen;
+               memcpy(tail->direct_scan[0].ssid, sc->sc_des_essid,
+                   sc->sc_des_esslen);
                req->general_flags |=
                    htole32(IWM_UMAC_SCAN_GEN_FLAGS_PRE_CONNECT);
        } else
@@ -8494,6 +8494,7 @@
        sc->sc_newstate = vap->iv_newstate;
        vap->iv_newstate = iwm_newstate;
 
+       sc->sc_des_esslen = IEEE80211_NWID_LEN;
 #if 0
        /* Attach the packet filter */
        bpf_attach2(vap->iv_ifp, DLT_IEEE802_11_RADIO,
diff -r 3f358110ff04 -r 5985ff262e06 sys/dev/pci/if_iwmvar.h
--- a/sys/dev/pci/if_iwmvar.h   Sat Aug 29 10:23:40 2020 +1000
+++ b/sys/dev/pci/if_iwmvar.h   Thu Sep 03 21:07:30 2020 +1000
@@ -514,6 +514,8 @@
        } sc_txtapu;
 #define sc_txtap       sc_txtapu.th
        int                     sc_txtap_len;
+       uint8_t         sc_des_essid[IEEE80211_NWID_LEN];
+       int             sc_des_esslen;
 };
 
 struct iwm_node {



Home | Main Index | Thread Index | Old Index