Source-Changes-HG archive

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

[src/trunk]: src/sys/net Sync with FreeBSD. Spelling fix. Make ieee80211_deca...



details:   https://anonhg.NetBSD.org/src/rev/c4c9f47d4570
branches:  trunk
changeset: 547117:c4c9f47d4570
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Tue May 13 10:05:05 2003 +0000

description:
Sync with FreeBSD. Spelling fix. Make ieee80211_decap a little more
readable. Accomodate both FreeBSD arpcom and NetBSD ethercom with
conditional compilation.

diffstat:

 sys/net/if_ieee80211.h     |   8 +++++++-
 sys/net/if_ieee80211subr.c |  20 +++++++++++---------
 2 files changed, 18 insertions(+), 10 deletions(-)

diffs (97 lines):

diff -r 5162b03dfd6f -r c4c9f47d4570 sys/net/if_ieee80211.h
--- a/sys/net/if_ieee80211.h    Tue May 13 10:03:43 2003 +0000
+++ b/sys/net/if_ieee80211.h    Tue May 13 10:05:05 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ieee80211.h,v 1.30 2003/05/13 09:31:56 dyoung Exp $ */
+/*     $NetBSD: if_ieee80211.h,v 1.31 2003/05/13 10:05:05 dyoung Exp $ */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -497,7 +497,13 @@
 };
 
 struct ieee80211com {
+#ifdef __NetBSD__
        struct ethercom         ic_ec;
+#endif
+#ifdef __FreeBSD__
+       struct arpcom           ic_ac;
+       struct mtx              ic_mtx;
+#endif
        void                    (*ic_recv_mgmt[16])(struct ieee80211com *,
                                    struct mbuf *, int, u_int32_t);
        int                     (*ic_send_mgmt[16])(struct ieee80211com *,
diff -r 5162b03dfd6f -r c4c9f47d4570 sys/net/if_ieee80211subr.c
--- a/sys/net/if_ieee80211subr.c        Tue May 13 10:03:43 2003 +0000
+++ b/sys/net/if_ieee80211subr.c        Tue May 13 10:05:05 2003 +0000
@@ -1,4 +1,5 @@
-/*     $NetBSD: if_ieee80211subr.c,v 1.30 2003/05/13 09:53:07 dyoung Exp $     */
+/*     $NetBSD: if_ieee80211subr.c,v 1.31 2003/05/13 10:05:05 dyoung Exp $     */
+/*     $FreeBSD: src/sys/net/if_ieee80211subr.c,v 1.4 2003/01/21 08:55:59 alfred Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -41,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ieee80211subr.c,v 1.30 2003/05/13 09:53:07 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ieee80211subr.c,v 1.31 2003/05/13 10:05:05 dyoung Exp $");
 
 #include "opt_inet.h"
 #include "bpfilter.h"
@@ -171,7 +172,7 @@
        if (ic->ic_max_aid == 0)
                ic->ic_max_aid = IEEE80211_MAX_AID;
 
-       /* initialize management frame handler */
+       /* initialize management frame handlers */
        ic->ic_recv_mgmt[IEEE80211_FC0_SUBTYPE_PROBE_RESP
            >> IEEE80211_FC0_SUBTYPE_SHIFT] = ieee80211_recv_beacon;
        ic->ic_recv_mgmt[IEEE80211_FC0_SUBTYPE_BEACON
@@ -410,8 +411,8 @@
                        } else
                                goto out;
                }
+               /* copy to listener after decrypt */
 #if NBPFILTER > 0
-               /* copy to listener after decrypt */
                if (ic->ic_rawbpf)
                        bpf_mtap(ic->ic_rawbpf, m);
 #endif
@@ -713,12 +714,13 @@
        if (!ALIGNED_POINTER(mtod(m, caddr_t) + sizeof(*eh), u_int32_t)) {
                struct mbuf *n, *n0, **np;
                caddr_t newdata;
-               int off;
+               int off, pktlen;
 
                n0 = NULL;
                np = &n0;
                off = 0;
-               while (m->m_pkthdr.len > off) {
+               pktlen = m->m_pkthdr.len;
+               while (pktlen > off) {
                        if (n0 == NULL) {
                                MGETHDR(n, M_DONTWAIT, MT_DATA);
                                if (n == NULL) {
@@ -736,7 +738,7 @@
                                }
                                n->m_len = MLEN;
                        }
-                       if (m->m_pkthdr.len - off >= MINCLSIZE) {
+                       if (pktlen - off >= MINCLSIZE) {
                                MCLGET(n, M_DONTWAIT);
                                if (n->m_flags & M_EXT)
                                        n->m_len = n->m_ext.ext_size;
@@ -748,8 +750,8 @@
                                n->m_len -= newdata - n->m_data;
                                n->m_data = newdata;
                        }
-                       if (n->m_len > m->m_pkthdr.len - off)
-                               n->m_len = m->m_pkthdr.len - off;
+                       if (n->m_len > pktlen - off)
+                               n->m_len = pktlen - off;
                        m_copydata(m, off, n->m_len, mtod(n, caddr_t));
                        off += n->m_len;
                        *np = n;



Home | Main Index | Thread Index | Old Index