[Midnightbsd-cvs] src [10032] trunk/sys/dev/wi: sync with freebsd

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun May 27 18:23:31 EDT 2018


Revision: 10032
          http://svnweb.midnightbsd.org/src/?rev=10032
Author:   laffer1
Date:     2018-05-27 18:23:30 -0400 (Sun, 27 May 2018)
Log Message:
-----------
sync with freebsd

Modified Paths:
--------------
    trunk/sys/dev/wi/if_wavelan_ieee.h
    trunk/sys/dev/wi/if_wi.c
    trunk/sys/dev/wi/if_wi_pccard.c
    trunk/sys/dev/wi/if_wi_pci.c
    trunk/sys/dev/wi/if_wireg.h
    trunk/sys/dev/wi/if_wivar.h

Modified: trunk/sys/dev/wi/if_wavelan_ieee.h
===================================================================
--- trunk/sys/dev/wi/if_wavelan_ieee.h	2018-05-27 22:22:25 UTC (rev 10031)
+++ trunk/sys/dev/wi/if_wavelan_ieee.h	2018-05-27 22:23:30 UTC (rev 10032)
@@ -1,4 +1,4 @@
-/* $MidnightBSD: src/sys/dev/wi/if_wavelan_ieee.h,v 1.2 2008/12/02 22:43:17 laffer1 Exp $ */
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1997, 1998, 1999
  *	Bill Paul <wpaul at ctr.columbia.edu>.  All rights reserved.
@@ -30,7 +30,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/dev/wi/if_wavelan_ieee.h 192492 2009-05-20 22:28:55Z imp $
  */
 
 #ifndef _IF_WAVELAN_IEEE_H

Modified: trunk/sys/dev/wi/if_wi.c
===================================================================
--- trunk/sys/dev/wi/if_wi.c	2018-05-27 22:22:25 UTC (rev 10031)
+++ trunk/sys/dev/wi/if_wi.c	2018-05-27 22:23:30 UTC (rev 10032)
@@ -1,6 +1,4 @@
 /* $MidnightBSD$ */
-/*	$NetBSD: wi.c,v 1.109 2003/01/09 08:52:19 dyoung Exp $	*/
-
 /*-
  * Copyright (c) 1997, 1998, 1999
  *	Bill Paul <wpaul at ctr.columbia.edu>.  All rights reserved.
@@ -63,8 +61,10 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/wi/if_wi.c 262007 2014-02-17 01:36:53Z kevlo $");
 
+#include "opt_wlan.h"
+
 #define WI_HERMES_STATS_WAR	/* Work around stats counter bug. */
 
 #include <sys/param.h>
@@ -1004,7 +1004,7 @@
 		    mtod(m0, const uint8_t *) + ieee80211_hdrsize(wh));
 		frmhdr.wi_ehdr.ether_type = llc->llc_snap.ether_type;
 		frmhdr.wi_tx_ctl = htole16(WI_ENC_TX_802_11|WI_TXCNTL_TX_EX);
-		if (wh->i_fc[1] & IEEE80211_FC1_WEP) {
+		if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) {
 			k = ieee80211_crypto_encap(ni, m0);
 			if (k == NULL) {
 				ieee80211_free_node(ni);
@@ -1107,7 +1107,7 @@
 	frmhdr.wi_tx_ctl = htole16(WI_ENC_TX_802_11|WI_TXCNTL_TX_EX);
 	if (params && (params->ibp_flags & IEEE80211_BPF_NOACK))
 		frmhdr.wi_tx_ctl |= htole16(WI_TXCNTL_ALTRTRY);
-	if ((wh->i_fc[1] & IEEE80211_FC1_WEP) &&
+	if ((wh->i_fc[1] & IEEE80211_FC1_PROTECTED) &&
 	    (!params || (params && (params->ibp_flags & IEEE80211_BPF_CRYPTO)))) {
 		k = ieee80211_crypto_encap(ni, m0);
 		if (k == NULL) {
@@ -1512,6 +1512,10 @@
 	case WI_INFO_LINK_STAT:
 		wi_read_bap(sc, fid, sizeof(ltbuf), &stat, sizeof(stat));
 		DPRINTF(("wi_info_intr: LINK_STAT 0x%x\n", le16toh(stat)));
+
+		if (vap == NULL)
+			goto finish;
+
 		switch (le16toh(stat)) {
 		case WI_INFO_LINK_STAT_CONNECTED:
 			if (vap->iv_state == IEEE80211_S_RUN &&
@@ -1567,6 +1571,7 @@
 		    le16toh(ltbuf[1]), le16toh(ltbuf[0])));
 		break;
 	}
+finish:
 	CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_INFO);
 }
 
@@ -1901,8 +1906,7 @@
 static int
 wi_read_bap(struct wi_softc *sc, int id, int off, void *buf, int buflen)
 {
-	u_int16_t *ptr;
-	int i, error, cnt;
+	int error, cnt;
 
 	if (buflen == 0)
 		return 0;
@@ -1911,9 +1915,7 @@
 			return error;
 	}
 	cnt = (buflen + 1) / 2;
-	ptr = (u_int16_t *)buf;
-	for (i = 0; i < cnt; i++)
-		*ptr++ = CSR_READ_2(sc, WI_DATA0);
+	CSR_READ_MULTI_STREAM_2(sc, WI_DATA0, (u_int16_t *)buf, cnt);
 	sc->sc_bap_off += cnt * 2;
 	return 0;
 }
@@ -1921,8 +1923,7 @@
 static int
 wi_write_bap(struct wi_softc *sc, int id, int off, void *buf, int buflen)
 {
-	u_int16_t *ptr;
-	int i, error, cnt;
+	int error, cnt;
 
 	if (buflen == 0)
 		return 0;
@@ -1932,9 +1933,7 @@
 			return error;
 	}
 	cnt = (buflen + 1) / 2;
-	ptr = (u_int16_t *)buf;
-	for (i = 0; i < cnt; i++)
-		CSR_WRITE_2(sc, WI_DATA0, ptr[i]);
+	CSR_WRITE_MULTI_STREAM_2(sc, WI_DATA0, (u_int16_t *)buf, cnt);
 	sc->sc_bap_off += cnt * 2;
 
 	return 0;

Modified: trunk/sys/dev/wi/if_wi_pccard.c
===================================================================
--- trunk/sys/dev/wi/if_wi_pccard.c	2018-05-27 22:22:25 UTC (rev 10031)
+++ trunk/sys/dev/wi/if_wi_pccard.c	2018-05-27 22:23:30 UTC (rev 10032)
@@ -1,4 +1,4 @@
-/* $MidnightBSD: src/sys/dev/wi/if_wi_pccard.c,v 1.2 2008/12/02 22:43:17 laffer1 Exp $ */
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1997, 1998, 1999
  *	Bill Paul <wpaul at ctr.columbia.edu>.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/dev/wi/if_wi_pccard.c 182250 2008-08-27 05:39:44Z imp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>

Modified: trunk/sys/dev/wi/if_wi_pci.c
===================================================================
--- trunk/sys/dev/wi/if_wi_pci.c	2018-05-27 22:22:25 UTC (rev 10031)
+++ trunk/sys/dev/wi/if_wi_pci.c	2018-05-27 22:23:30 UTC (rev 10032)
@@ -1,4 +1,4 @@
-/* $MidnightBSD: src/sys/dev/wi/if_wi_pci.c,v 1.2 2008/12/02 22:43:17 laffer1 Exp $ */
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1997, 1998, 1999
  *	Bill Paul <wpaul at ctr.columbia.edu>.  All rights reserved.
@@ -30,7 +30,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/dev/wi/if_wi_pci.c 254263 2013-08-12 23:30:01Z scottl $
  */
 
 /*
@@ -138,7 +138,7 @@
 wi_pci_attach(device_t dev)
 {
 	struct wi_softc		*sc;
-	u_int32_t		command, wanted;
+	u_int32_t		command;
 	u_int16_t		reg;
 	int			error;
 	int			timeout;
@@ -145,16 +145,6 @@
 
 	sc = device_get_softc(dev);
 
-	command = pci_read_config(dev, PCIR_COMMAND, 4);
-	wanted = PCIM_CMD_PORTEN|PCIM_CMD_MEMEN;
-	command |= wanted;
-	pci_write_config(dev, PCIR_COMMAND, command, 4);
-	command = pci_read_config(dev, PCIR_COMMAND, 4);
-	if ((command & wanted) != wanted) {
-		device_printf(dev, "wi_pci_attach() failed to enable pci!\n");
-		return (ENXIO);
-	}
-
 	if (sc->wi_bus_type != WI_BUS_PCI_NATIVE) {
 		error = wi_alloc(dev, WI_PCI_IORES);
 		if (error)

Modified: trunk/sys/dev/wi/if_wireg.h
===================================================================
--- trunk/sys/dev/wi/if_wireg.h	2018-05-27 22:22:25 UTC (rev 10031)
+++ trunk/sys/dev/wi/if_wireg.h	2018-05-27 22:23:30 UTC (rev 10032)
@@ -1,4 +1,4 @@
-/* $MidnightBSD: src/sys/dev/wi/if_wireg.h,v 1.3 2009/01/18 19:29:05 laffer1 Exp $ */
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1997, 1998, 1999
  *	Bill Paul <wpaul at ctr.columbia.edu>.  All rights reserved.
@@ -30,7 +30,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/dev/wi/if_wireg.h 192468 2009-05-20 20:00:40Z sam $
  */
 
 #define WI_DELAY	5
@@ -85,6 +85,9 @@
 #ifdef __NetBSD__
 #define OS_STRING_NAME	"NetBSD"
 #endif
+#ifdef __FreeBSD__
+#define OS_STRING_NAME	"FreeBSD"
+#endif
 #ifdef __OpenBSD__
 #define OS_STRING_NAME	"OpenBSD"
 #endif

Modified: trunk/sys/dev/wi/if_wivar.h
===================================================================
--- trunk/sys/dev/wi/if_wivar.h	2018-05-27 22:22:25 UTC (rev 10031)
+++ trunk/sys/dev/wi/if_wivar.h	2018-05-27 22:23:30 UTC (rev 10032)
@@ -1,4 +1,4 @@
-/* $MidnightBSD: src/sys/dev/wi/if_wivar.h,v 1.2 2008/12/02 22:43:17 laffer1 Exp $ */
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2002
  *	M Warner Losh <imp at freebsd.org>.  All rights reserved.
@@ -32,7 +32,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD$
+ * $FreeBSD: stable/10/sys/dev/wi/if_wivar.h 194023 2009-06-11 17:14:28Z avg $
  */
 
 /*



More information about the Midnightbsd-cvs mailing list