Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci wpi_fix_channel hack no longer needed with recen...



details:   https://anonhg.NetBSD.org/src/rev/f05df91a05ca
branches:  trunk
changeset: 331316:f05df91a05ca
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri Aug 08 10:17:07 2014 +0000

description:
wpi_fix_channel hack no longer needed with recent scanning changes

diffstat:

 sys/dev/pci/if_wpi.c |  46 ++--------------------------------------------
 1 files changed, 2 insertions(+), 44 deletions(-)

diffs (81 lines):

diff -r 220e35f9a475 -r f05df91a05ca sys/dev/pci/if_wpi.c
--- a/sys/dev/pci/if_wpi.c      Fri Aug 08 09:47:28 2014 +0000
+++ b/sys/dev/pci/if_wpi.c      Fri Aug 08 10:17:07 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wpi.c,v 1.67 2014/08/07 22:10:05 jmcneill Exp $     */
+/*     $NetBSD: if_wpi.c,v 1.68 2014/08/08 10:17:07 jmcneill Exp $     */
 
 /*-
  * Copyright (c) 2006, 2007
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.67 2014/08/07 22:10:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.68 2014/08/08 10:17:07 jmcneill Exp $");
 
 /*
  * Driver for Intel PRO/Wireless 3945ABG 802.11 network adapters.
@@ -102,7 +102,6 @@
 static void    wpi_newassoc(struct ieee80211_node *, int);
 static int     wpi_media_change(struct ifnet *);
 static int     wpi_newstate(struct ieee80211com *, enum ieee80211_state, int);
-static void    wpi_fix_channel(struct ieee80211com *, struct mbuf *);
 static void    wpi_mem_lock(struct wpi_softc *);
 static void    wpi_mem_unlock(struct wpi_softc *);
 static uint32_t        wpi_mem_read(struct wpi_softc *, uint16_t);
@@ -987,44 +986,6 @@
 }
 
 /*
- * XXX: Hack to set the current channel to the value advertised in beacons or
- * probe responses. Only used during AP detection.
- * XXX: Duplicated from if_iwi.c
- */
-static void
-wpi_fix_channel(struct ieee80211com *ic, struct mbuf *m)
-{
-       struct ieee80211_frame *wh;
-       uint8_t subtype;
-       uint8_t *frm, *efrm;
-
-       wh = mtod(m, struct ieee80211_frame *);
-
-       if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) != IEEE80211_FC0_TYPE_MGT)
-               return;
-
-       subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK;
-
-       if (subtype != IEEE80211_FC0_SUBTYPE_BEACON &&
-           subtype != IEEE80211_FC0_SUBTYPE_PROBE_RESP)
-               return;
-
-       frm = (uint8_t *)(wh + 1);
-       efrm = mtod(m, uint8_t *) + m->m_len;
-
-       frm += 12;      /* skip tstamp, bintval and capinfo fields */
-       while (frm < efrm) {
-               if (*frm == IEEE80211_ELEMID_DSPARMS)
-#if IEEE80211_CHAN_MAX < 255
-               if (frm[2] <= IEEE80211_CHAN_MAX)
-#endif
-                       ic->ic_curchan = &ic->ic_channels[frm[2]];
-
-               frm += frm[1] + 2;
-       }
-}
-
-/*
  * Grab exclusive access to NIC memory.
  */
 static void
@@ -1554,9 +1515,6 @@
        /* finalize mbuf */
        m->m_pkthdr.rcvif = ifp;
 
-       if (ic->ic_state == IEEE80211_S_SCAN)
-               wpi_fix_channel(ic, m);
-
        if (sc->sc_drvbpf != NULL) {
                struct wpi_rx_radiotap_header *tap = &sc->sc_rxtap;
 



Home | Main Index | Thread Index | Old Index