Source-Changes-HG archive

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

[src-draft/trunk]: src/sys/net80211 Merge changes from FreeBSD current upto r...



details:   https://anonhg.NetBSD.org/src-all/rev/e745ccdb57c2
branches:  trunk
changeset: 990814:e745ccdb57c2
user:      Martin Husemann <martin%NetBSD.org@localhost>
date:      Thu Jun 25 17:11:30 2020 +0200

description:
Merge changes from FreeBSD current upto rev 362210

Does not work nor compile yet

diffstat:

 sys/net80211/CHANGES                  |    8 +
 sys/net80211/_ieee80211.h             |    8 +-
 sys/net80211/ieee80211.c              |   64 +++-
 sys/net80211/ieee80211.h              |    6 +-
 sys/net80211/ieee80211_acl.c          |    2 +-
 sys/net80211/ieee80211_action.c       |    2 +-
 sys/net80211/ieee80211_action.h       |    2 +-
 sys/net80211/ieee80211_adhoc.c        |   37 ++-
 sys/net80211/ieee80211_adhoc.h        |    2 +-
 sys/net80211/ieee80211_ageq.c         |    2 +-
 sys/net80211/ieee80211_ageq.h         |    2 +-
 sys/net80211/ieee80211_alq.c          |    8 +-
 sys/net80211/ieee80211_alq.h          |    2 +-
 sys/net80211/ieee80211_amrr.c         |   65 ++++-
 sys/net80211/ieee80211_amrr.h         |    2 +-
 sys/net80211/ieee80211_crypto.c       |   13 +-
 sys/net80211/ieee80211_crypto.h       |    2 +-
 sys/net80211/ieee80211_crypto_ccmp.c  |    2 +-
 sys/net80211/ieee80211_crypto_none.c  |    2 +-
 sys/net80211/ieee80211_crypto_tkip.c  |    2 +-
 sys/net80211/ieee80211_crypto_wep.c   |    2 +-
 sys/net80211/ieee80211_ddb.c          |   16 +-
 sys/net80211/ieee80211_dfs.c          |    5 +-
 sys/net80211/ieee80211_dfs.h          |    2 +-
 sys/net80211/ieee80211_hostap.c       |   24 +-
 sys/net80211/ieee80211_hostap.h       |    2 +-
 sys/net80211/ieee80211_ht.c           |  400 +++++++++++++++++++++++++--------
 sys/net80211/ieee80211_ht.h           |   15 +-
 sys/net80211/ieee80211_hwmp.c         |   35 +-
 sys/net80211/ieee80211_input.c        |    2 +-
 sys/net80211/ieee80211_input.h        |    5 +-
 sys/net80211/ieee80211_ioctl.c        |  130 ++++++++--
 sys/net80211/ieee80211_ioctl.h        |    4 +-
 sys/net80211/ieee80211_mesh.c         |   46 ++-
 sys/net80211/ieee80211_mesh.h         |    2 +-
 sys/net80211/ieee80211_monitor.c      |    2 +-
 sys/net80211/ieee80211_monitor.h      |    2 +-
 sys/net80211/ieee80211_netbsd.h       |    7 +-
 sys/net80211/ieee80211_node.c         |   70 ++++-
 sys/net80211/ieee80211_node.h         |    6 +-
 sys/net80211/ieee80211_output.c       |  263 ++++++++++++++++++---
 sys/net80211/ieee80211_phy.c          |    2 +-
 sys/net80211/ieee80211_phy.h          |   17 +-
 sys/net80211/ieee80211_power.c        |    2 +-
 sys/net80211/ieee80211_power.h        |    2 +-
 sys/net80211/ieee80211_proto.c        |  140 ++++++++++-
 sys/net80211/ieee80211_proto.h        |   25 +-
 sys/net80211/ieee80211_radiotap.c     |    2 +-
 sys/net80211/ieee80211_radiotap.h     |    2 +-
 sys/net80211/ieee80211_ratectl.c      |    2 +-
 sys/net80211/ieee80211_ratectl.h      |    2 +-
 sys/net80211/ieee80211_ratectl_none.c |    2 +-
 sys/net80211/ieee80211_regdomain.c    |    2 +-
 sys/net80211/ieee80211_regdomain.h    |    2 +-
 sys/net80211/ieee80211_rssadapt.c     |   40 ++-
 sys/net80211/ieee80211_rssadapt.h     |    2 +-
 sys/net80211/ieee80211_scan.c         |   14 +-
 sys/net80211/ieee80211_scan.h         |    2 +-
 sys/net80211/ieee80211_scan_sta.c     |   83 ++++--
 sys/net80211/ieee80211_scan_sw.c      |   57 +++-
 sys/net80211/ieee80211_scan_sw.h      |    2 +-
 sys/net80211/ieee80211_sta.c          |   91 +++++-
 sys/net80211/ieee80211_sta.h          |   11 +-
 sys/net80211/ieee80211_superg.c       |    9 +-
 sys/net80211/ieee80211_superg.h       |    2 +-
 sys/net80211/ieee80211_tdma.c         |    5 +-
 sys/net80211/ieee80211_tdma.h         |    2 +-
 sys/net80211/ieee80211_var.h          |   39 ++-
 sys/net80211/ieee80211_vht.c          |    2 +-
 sys/net80211/ieee80211_vht.h          |    2 +-
 sys/net80211/ieee80211_wds.c          |   12 +-
 sys/net80211/ieee80211_wds.h          |    2 +-
 sys/net80211/ieee80211_wps.h          |  149 ++++++++++++
 sys/net80211/ieee80211_xauth.c        |    2 +-
 74 files changed, 1542 insertions(+), 461 deletions(-)

diffs (truncated from 4411 to 300 lines):

diff -r bda156417cd9 -r e745ccdb57c2 sys/net80211/CHANGES
--- a/sys/net80211/CHANGES      Wed Jul 01 20:54:21 2020 +1000
+++ b/sys/net80211/CHANGES      Thu Jun 25 17:11:30 2020 +0200
@@ -1,3 +1,10 @@
+*** Changes in 2020 for WiFi refresh.
+
+2020-06-25 12:00 Martin
+
+Update to FreeBSD HEAD on 2020-06-21: highest rev 362210
+
+
 *** Changes in 2018 for WiFi refresh.
 
 2018-06-28 13:47 Phil 
@@ -7,6 +14,7 @@
 to ieee80211_netbsd.[ch].
 This is subversion revision 335773: ssh://svn.freebsd.org/base/head@335773
 
+
 ***
 *** Summary of changes between 2005-05-18 and 2005-11-01.
 ***
diff -r bda156417cd9 -r e745ccdb57c2 sys/net80211/_ieee80211.h
--- a/sys/net80211/_ieee80211.h Wed Jul 01 20:54:21 2020 +1000
+++ b/sys/net80211/_ieee80211.h Thu Jun 25 17:11:30 2020 +0200
@@ -27,7 +27,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: head/sys/net80211/_ieee80211.h 326272 2017-11-27 15:23:17Z pfg $
+ * $FreeBSD: head/sys/net80211/_ieee80211.h 362210 2020-06-16 00:27:32Z adrian $$
  */
 #ifndef _NET80211__IEEE80211_H_
 #define _NET80211__IEEE80211_H_
@@ -490,6 +490,7 @@
 #define        IEEE80211_C_MBSS        0x00040000      /* CAPABILITY: MBSS available */
 #define        IEEE80211_C_SWSLEEP     0x00080000      /* CAPABILITY: do sleep here */
 #define        IEEE80211_C_SWAMSDUTX   0x00100000      /* CAPABILITY: software A-MSDU TX */
+#define        IEEE80211_C_UAPSD       0x00200000      /* CAPABILITY: U-APSD */
 /* 0x7c0000 available */
 #define        IEEE80211_C_WPA1        0x00800000      /* CAPABILITY: WPA1 avail */
 #define        IEEE80211_C_WPA2        0x01000000      /* CAPABILITY: WPA2 avail */
@@ -531,10 +532,13 @@
 #define        IEEE80211_HTC_TXUNEQUAL 0x00800000      /* CAPABILITY: TX unequal MCS */
 #define        IEEE80211_HTC_TXMCS32   0x01000000      /* CAPABILITY: MCS32 support */
 #define        IEEE80211_HTC_TXLDPC    0x02000000      /* CAPABILITY: TX using LDPC */
+#define        IEEE80211_HTC_RX_AMSDU_AMPDU    0x04000000      /* CAPABILITY: RX A-MSDU in A-MPDU */
+#define        IEEE80211_HTC_TX_AMSDU_AMPDU    0x08000000      /* CAPABILITY: TX A-MSDU in A-MPDU */
 
 #define        IEEE80211_C_HTCAP_BITS \
        "\20\1LDPC\2CHWIDTH40\5GREENFIELD\6SHORTGI20\7SHORTGI40\10TXSTBC" \
-       "\21AMPDU\22AMSDU\23HT\24SMPS\25RIFS\32TXLDPC"
+       "\21AMPDU\22AMSDU\23HT\24SMPS\25RIFS\32TXLDPC\33RXAMSDUAMPDU" \
+       "\34TXAMSDUAMPDU"
 
 /*
  * RX status notification - which fields are valid.
diff -r bda156417cd9 -r e745ccdb57c2 sys/net80211/ieee80211.c
--- a/sys/net80211/ieee80211.c  Wed Jul 01 20:54:21 2020 +1000
+++ b/sys/net80211/ieee80211.c  Thu Jun 25 17:11:30 2020 +0200
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #ifdef __FreeBSD__
-__FBSDID("$FreeBSD: head/sys/net80211/ieee80211.c 326272 2017-11-27 15:23:17Z pfg $");
+__FBSDID("$FreeBSD: head/sys/net80211/ieee80211.c 362210 2020-06-16 00:27:32Z adrian $$");
 #endif
 #ifdef __NetBSD__
 __KERNEL_RCSID(0, "$NetBSD: ieee80211.c,v 1.61 2021/08/21 11:55:25 andvar Exp $");
@@ -304,31 +304,18 @@
        ic_printf(ic, "%s: need callback\n", __func__);
 }
 
-#ifdef __FreeBSD__
 int
 ic_printf(struct ieee80211com *ic, const char * fmt, ...)
-{ 
+{
        va_list ap;
        int retval;
 
        retval = printf("%s: ", ic->ic_name);
        va_start(ap, fmt);
        retval += vprintf(fmt, ap);
-       va_end(ap);  
+       va_end(ap);
        return (retval);
 }
-#elif __NetBSD__
-void
-ic_printf(struct ieee80211com *ic, const char * fmt, ...)
-{ 
-       va_list ap;
-
-       printf("%s: ", ic->ic_name);
-       va_start(ap, fmt);
-       vprintf(fmt, ap);
-       va_end(ap);  
-}
-#endif
 
 static LIST_HEAD(, ieee80211com) ic_head = LIST_HEAD_INITIALIZER(ic_head);
 #ifdef __FreeBSD__
@@ -462,6 +449,15 @@
 {
        struct ieee80211vap *vap;
 
+       /*
+        * We use this as an indicator that ifattach never had a chance to be
+        * called, e.g. early driver attach failed and ifdetach was called
+        * during subsequent detach.  Never fear, for we have nothing to do
+        * here.
+        */
+       if (ic->ic_tq == NULL)
+               return;
+
        mtx_lock(&ic_list_mtx);
        LIST_REMOVE(ic, ic_next);
        mtx_unlock(&ic_list_mtx);
@@ -474,8 +470,10 @@
         * The VAP is responsible for setting and clearing
         * the VIMAGE context.
         */
-       while ((vap = TAILQ_FIRST(&ic->ic_vaps)) != NULL)
+       while ((vap = TAILQ_FIRST(&ic->ic_vaps)) != NULL) {
+               ieee80211_com_vdetach(vap);
                ieee80211_vap_destroy(vap);
+       }
        ieee80211_waitfor_parent(ic);
 
        ieee80211_sysctl_detach(ic);
@@ -691,6 +689,12 @@
        if (vap->iv_opmode == IEEE80211_M_HOSTAP &&
            (vap->iv_caps & IEEE80211_C_DFS))
                vap->iv_flags_ext |= IEEE80211_FEXT_DFS;
+       /* NB: only flip on U-APSD for hostap/sta for now */
+       if ((vap->iv_opmode == IEEE80211_M_STA)
+           || (vap->iv_opmode == IEEE80211_M_HOSTAP)) {
+               if (vap->iv_caps & IEEE80211_C_UAPSD)
+                       vap->iv_flags_ext |= IEEE80211_FEXT_UAPSD;
+       }
 
        vap->iv_des_chan = IEEE80211_CHAN_ANYC;         /* any channel is ok */
        vap->iv_bmissthreshold = IEEE80211_HWBMISS_DEFAULT;
@@ -720,6 +724,7 @@
        ieee80211_scan_vattach(vap);
        ieee80211_regdomain_vattach(vap);
        ieee80211_radiotap_vattach(vap);
+       ieee80211_vap_reset_erp(vap);
        ieee80211_ratectl_set(vap, IEEE80211_RATECTL_NONE);
 
        return 0;
@@ -796,7 +801,7 @@
        return 1;
 }
 
-/* 
+/*
  * Tear down vap state and reclaim the ifnet.
  * The driver is assumed to have prepared for
  * this; e.g. by turning off interrupts for the
@@ -1471,6 +1476,8 @@
 
 /*
  * Add one 20 MHz channel into specified channel list.
+ * You MUST NOT mix bands when calling this.  It will not add 5ghz
+ * channels if you have any B/G/N band bit set.
  */
 /* XXX VHT */
 int
@@ -1717,6 +1724,17 @@
 }
 
 int
+ieee80211_add_channels_default_2ghz(struct ieee80211_channel chans[],
+    int maxchans, int *nchans, const uint8_t bands[], int ht40)
+{
+       const uint8_t default_chan_list[] =
+           { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 };
+
+       return (ieee80211_add_channel_list_2ghz(chans, maxchans, nchans,
+           default_chan_list, nitems(default_chan_list), bands, ht40));
+}
+
+int
 ieee80211_add_channel_list_5ghz(struct ieee80211_channel chans[], int maxchans,
     int *nchans, const uint8_t ieee[], int nieee, const uint8_t bands[],
     int ht40)
@@ -1856,7 +1874,7 @@
 #define        ADD(_ic, _s, _o) \
        ifmedia_add(media, \
                IFM_MAKEWORD(IFM_IEEE80211, (_s), (_o), 0), 0, NULL)
-       static const u_int mopts[IEEE80211_MODE_MAX] = { 
+       static const u_int mopts[IEEE80211_MODE_MAX] = {
            [IEEE80211_MODE_AUTO]       = IFM_AUTO,
            [IEEE80211_MODE_11A]        = IFM_IEEE80211_11A,
            [IEEE80211_MODE_11B]        = IFM_IEEE80211_11B,
@@ -2288,7 +2306,7 @@
                ieee80211_setbasicrates(&ic->ic_sup_rates[mode], mode);
 
        ic->ic_curmode = mode;
-       ieee80211_reset_erp(ic);        /* reset ERP state */
+       ieee80211_reset_erp(ic);        /* reset global ERP state */
 
        return 0;
 }
@@ -2498,13 +2516,13 @@
        case IEEE80211_MODE_11NA:
        case IEEE80211_MODE_TURBO_A:
        case IEEE80211_MODE_STURBO_A:
-               return findmedia(rates, nitems(rates), 
+               return findmedia(rates, nitems(rates),
                    rate | IFM_IEEE80211_11A);
        case IEEE80211_MODE_11B:
-               return findmedia(rates, nitems(rates), 
+               return findmedia(rates, nitems(rates),
                    rate | IFM_IEEE80211_11B);
        case IEEE80211_MODE_FH:
-               return findmedia(rates, nitems(rates), 
+               return findmedia(rates, nitems(rates),
                    rate | IFM_IEEE80211_FH);
        case IEEE80211_MODE_AUTO:
                /* NB: ic may be NULL for some drivers */
diff -r bda156417cd9 -r e745ccdb57c2 sys/net80211/ieee80211.h
--- a/sys/net80211/ieee80211.h  Wed Jul 01 20:54:21 2020 +1000
+++ b/sys/net80211/ieee80211.h  Thu Jun 25 17:11:30 2020 +0200
@@ -27,7 +27,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: head/sys/net80211/ieee80211.h 326272 2017-11-27 15:23:17Z pfg $
+ * $FreeBSD: head/sys/net80211/ieee80211.h 361819 2020-06-05 04:04:47Z adrian $$
  */
 #ifndef _NET80211_IEEE80211_H_
 #define _NET80211_IEEE80211_H_
@@ -432,6 +432,8 @@
 #define        IEEE80211_BAPS_TID_S    2
 #define        IEEE80211_BAPS_POLICY   0x0002          /* block ack policy */
 #define        IEEE80211_BAPS_POLICY_S 1
+#define        IEEE80211_BAPS_AMSDU    0x0001          /* A-MSDU permitted */
+#define        IEEE80211_BAPS_AMSDU_S  0
 
 #define        IEEE80211_BAPS_POLICY_DELAYED   (0<<IEEE80211_BAPS_POLICY_S)
 #define        IEEE80211_BAPS_POLICY_IMMEDIATE (1<<IEEE80211_BAPS_POLICY_S)
@@ -953,9 +955,11 @@
        IEEE80211_ELEMID_ERP            = 42,
        IEEE80211_ELEMID_HTCAP          = 45,
        IEEE80211_ELEMID_QOS            = 46,
+       IEEE80211_ELEMID_RESERVED_47    = 47,
        IEEE80211_ELEMID_RSN            = 48,
        IEEE80211_ELEMID_XRATES         = 50,
        IEEE80211_ELEMID_APCHANREP      = 51,
+       IEEE80211_ELEMID_MOBILITY_DOMAIN        = 54,
        IEEE80211_ELEMID_HTINFO         = 61,
        IEEE80211_ELEMID_SECCHAN_OFFSET = 62,
        IEEE80211_ELEMID_RRM_ENACAPS    = 70,
diff -r bda156417cd9 -r e745ccdb57c2 sys/net80211/ieee80211_acl.c
--- a/sys/net80211/ieee80211_acl.c      Wed Jul 01 20:54:21 2020 +1000
+++ b/sys/net80211/ieee80211_acl.c      Thu Jun 25 17:11:30 2020 +0200
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #ifdef __FreeBSD__
-__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_acl.c 326272 2017-11-27 15:23:17Z pfg $");
+__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_acl.c 326272 2017-11-27 15:23:17Z pfg $$");
 #endif
 #ifdef __NetBSD__
 __KERNEL_RCSID(0, "$NetBSD: ieee80211_acl.c,v 1.9.54.5 2020/04/13 08:05:16 martin Exp $");
diff -r bda156417cd9 -r e745ccdb57c2 sys/net80211/ieee80211_action.c
--- a/sys/net80211/ieee80211_action.c   Wed Jul 01 20:54:21 2020 +1000
+++ b/sys/net80211/ieee80211_action.c   Thu Jun 25 17:11:30 2020 +0200
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #ifdef __FreeBSD__
-__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_action.c 326272 2017-11-27 15:23:17Z pfg $");
+__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_action.c 326272 2017-11-27 15:23:17Z pfg $$");
 #endif
 #ifdef __NetBSD__
 __KERNEL_RCSID(0, "$NetBSD: ieee80211_action.c,v 1.1.2.3 2019/06/10 22:09:46 christos Exp $");
diff -r bda156417cd9 -r e745ccdb57c2 sys/net80211/ieee80211_action.h
--- a/sys/net80211/ieee80211_action.h   Wed Jul 01 20:54:21 2020 +1000
+++ b/sys/net80211/ieee80211_action.h   Thu Jun 25 17:11:30 2020 +0200
@@ -26,7 +26,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: head/sys/net80211/ieee80211_action.h 326272 2017-11-27 15:23:17Z pfg $
+ * $FreeBSD: head/sys/net80211/ieee80211_action.h 326272 2017-11-27 15:23:17Z pfg $$
  */
 #ifndef _NET80211_IEEE80211_ACTION_H_
 #define _NET80211_IEEE80211_ACTION_H_
diff -r bda156417cd9 -r e745ccdb57c2 sys/net80211/ieee80211_adhoc.c
--- a/sys/net80211/ieee80211_adhoc.c    Wed Jul 01 20:54:21 2020 +1000
+++ b/sys/net80211/ieee80211_adhoc.c    Thu Jun 25 17:11:30 2020 +0200
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #ifdef __FreeBSD__
-__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_adhoc.c 326272 2017-11-27 15:23:17Z pfg $");



Home | Main Index | Thread Index | Old Index