CVS commit: [phil-wifi] src/sys/net80211

2019-11-19 Thread Phil Nelson
Module Name:src
Committed By:   phil
Date:   Tue Nov 19 19:17:16 UTC 2019

Modified Files:
src/sys/net80211 [phil-wifi]: ieee80211_netbsd.c

Log Message:
Fix an ifdef


To generate a diff of this commit:
cvs rdiff -u -r1.31.2.8 -r1.31.2.9 src/sys/net80211/ieee80211_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net80211/ieee80211_netbsd.c
diff -u src/sys/net80211/ieee80211_netbsd.c:1.31.2.8 src/sys/net80211/ieee80211_netbsd.c:1.31.2.9
--- src/sys/net80211/ieee80211_netbsd.c:1.31.2.8	Mon Jun 10 22:09:46 2019
+++ src/sys/net80211/ieee80211_netbsd.c	Tue Nov 19 19:17:16 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ieee80211_netbsd.c,v 1.31.2.8 2019/06/10 22:09:46 christos Exp $ */
+/* $NetBSD: ieee80211_netbsd.c,v 1.31.2.9 2019/11/19 19:17:16 phil Exp $ */
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -29,7 +29,7 @@
 
 #include 
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_netbsd.c,v 1.31.2.8 2019/06/10 22:09:46 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_netbsd.c,v 1.31.2.9 2019/11/19 19:17:16 phil Exp $");
 #endif
 
 /*
@@ -333,7 +333,7 @@ static struct sysctllog *ieee80211_sysct
 static void
 ieee80211_sysctl_setup(void)
 {
-#ifdef notyet
+#ifdef IEEE80211_DEBUG
 	int rc;
 #endif
 	const struct sysctlnode *rnode;



CVS commit: [phil-wifi] src/sys/net80211

2019-11-19 Thread Phil Nelson
Module Name:src
Committed By:   phil
Date:   Tue Nov 19 19:17:48 UTC 2019

Modified Files:
src/sys/net80211 [phil-wifi]: ieee80211_ratectl.c

Log Message:
Add a FreeBSD ifdef


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/net80211/ieee80211_ratectl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [phil-wifi] src/sys/net80211

2019-11-19 Thread Phil Nelson
Module Name:src
Committed By:   phil
Date:   Tue Nov 19 19:17:16 UTC 2019

Modified Files:
src/sys/net80211 [phil-wifi]: ieee80211_netbsd.c

Log Message:
Fix an ifdef


To generate a diff of this commit:
cvs rdiff -u -r1.31.2.8 -r1.31.2.9 src/sys/net80211/ieee80211_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [phil-wifi] src/sys/net80211

2019-11-19 Thread Phil Nelson
Module Name:src
Committed By:   phil
Date:   Tue Nov 19 19:17:48 UTC 2019

Modified Files:
src/sys/net80211 [phil-wifi]: ieee80211_ratectl.c

Log Message:
Add a FreeBSD ifdef


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/net80211/ieee80211_ratectl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net80211/ieee80211_ratectl.c
diff -u src/sys/net80211/ieee80211_ratectl.c:1.1.2.4 src/sys/net80211/ieee80211_ratectl.c:1.1.2.5
--- src/sys/net80211/ieee80211_ratectl.c:1.1.2.4	Mon Jun 10 22:09:46 2019
+++ src/sys/net80211/ieee80211_ratectl.c	Tue Nov 19 19:17:48 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_ratectl.c,v 1.1.2.4 2019/06/10 22:09:46 christos Exp $ */
+/*	$NetBSD: ieee80211_ratectl.c,v 1.1.2.5 2019/11/19 19:17:48 phil Exp $ */
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -29,12 +29,14 @@
 
 #include 
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_ratectl.c,v 1.1.2.4 2019/06/10 22:09:46 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_ratectl.c,v 1.1.2.5 2019/11/19 19:17:48 phil Exp $");
 #endif
 
 #ifdef _KERNEL_OPT
+#ifdef __FreeBSD__
 #include "opt-wlan.h"
 #endif
+#endif
 
 #include 
 #include 



CVS commit: [phil-wifi] src/sys/dev/usb

2019-06-26 Thread Phil Nelson
Module Name:src
Committed By:   phil
Date:   Wed Jun 26 16:51:29 UTC 2019

Modified Files:
src/sys/dev/usb [phil-wifi]: if_urtwn.c

Log Message:
Remove extra if_register() call.
Move temporary call to vap_create() to end of attach to make sure
attach works when vap_create() will not be called as part of attach.


To generate a diff of this commit:
cvs rdiff -u -r1.59.2.7 -r1.59.2.8 src/sys/dev/usb/if_urtwn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [phil-wifi] src/sys/dev/usb

2019-06-26 Thread Phil Nelson
Module Name:src
Committed By:   phil
Date:   Wed Jun 26 16:51:29 UTC 2019

Modified Files:
src/sys/dev/usb [phil-wifi]: if_urtwn.c

Log Message:
Remove extra if_register() call.
Move temporary call to vap_create() to end of attach to make sure
attach works when vap_create() will not be called as part of attach.


To generate a diff of this commit:
cvs rdiff -u -r1.59.2.7 -r1.59.2.8 src/sys/dev/usb/if_urtwn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/if_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.59.2.7 src/sys/dev/usb/if_urtwn.c:1.59.2.8
--- src/sys/dev/usb/if_urtwn.c:1.59.2.7	Mon Jun 10 22:07:34 2019
+++ src/sys/dev/usb/if_urtwn.c	Wed Jun 26 16:51:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.59.2.7 2019/06/10 22:07:34 christos Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.59.2.8 2019/06/26 16:51:29 phil Exp $	*/
 /*	$OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $	*/
 
 /*-
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.59.2.7 2019/06/10 22:07:34 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.59.2.8 2019/06/26 16:51:29 phil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -529,8 +529,8 @@ urtwn_attach(device_t parent, device_t s
 #else
 	urtwn_getradiocaps(ic, IEEE80211_CHAN_MAX, >ic_nchans, 
 	ic->ic_channels);
-#endif	
-
+#endif
+	/* XXX issues here ...  Figure out proper attach and vap creation */
 	ieee80211_ifattach(ic);
 
 	/* override default methods NNN Need more here? */
@@ -547,29 +547,6 @@ urtwn_attach(device_t parent, device_t s
 	ic->ic_raw_xmit = urtwn_raw_xmit;
 	ic->ic_getradiocaps = urtwn_getradiocaps;
 	
-
-	/* How should this get called the first time?  Not here? */
-	// uint8_t bssid[IEEE80211_ADDR_LEN] = {0};
-
-	struct ieee80211vap *vap =
-	urtwn_vap_create(ic, device_xname(sc->sc_dev),
-	device_unit(sc->sc_dev), IEEE80211_M_STA,
-	IEEE80211_CLONE_MACADDR, ic->ic_macaddr, ic->ic_macaddr);
-
-	if (vap == NULL) {
-		/* Didn't work ... now what! */
-		printf ("NNN vap_create didn't work ...\n");
-		ieee80211_ifdetach(ic);
-		goto fail;
-	}
-
-	/* Debug all! NNN */
-	// vap->iv_debug = IEEE80211_MSG_ANY;
-
-	bpf_attach2(vap->iv_ifp, DLT_IEEE802_11_RADIO,
-	sizeof(struct ieee80211_frame) + IEEE80211_RADIOTAP_HDRLEN,
-	>sc_drvbpf);
-
 	sc->sc_rxtap_len = sizeof(sc->sc_rxtapu);
 	sc->sc_rxtap.wr_ihdr.it_len = htole16(sc->sc_rxtap_len);
 	sc->sc_rxtap.wr_ihdr.it_present = htole32(URTWN_RX_RADIOTAP_PRESENT);
@@ -578,10 +555,6 @@ urtwn_attach(device_t parent, device_t s
 	sc->sc_txtap.wt_ihdr.it_len = htole16(sc->sc_txtap_len);
 	sc->sc_txtap.wt_ihdr.it_present = htole32(URTWN_TX_RADIOTAP_PRESENT);
 
-	struct ifnet *ifp = vap->iv_ifp;
-	ifp->if_percpuq = if_percpuq_create(ifp);
-	if_register(ifp);
-
 	ieee80211_announce(ic);
 
 	usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, sc->sc_dev);
@@ -590,6 +563,21 @@ urtwn_attach(device_t parent, device_t s
 		aprint_error_dev(self, "couldn't establish power handler\n");
 
 	SET(sc->sc_flags, URTWN_FLAG_ATTACHED);
+
+	/* Should be called via an IOCTL.  Temp call here for now. */
+
+	struct ieee80211vap *vap =
+	urtwn_vap_create(ic, device_xname(sc->sc_dev),
+	device_unit(sc->sc_dev), IEEE80211_M_STA,
+	IEEE80211_CLONE_MACADDR, ic->ic_macaddr, ic->ic_macaddr);
+
+	if (vap == NULL) {
+		/* Didn't work ... now what! */
+		printf ("NNN vap_create didn't work ...\n");
+		ieee80211_ifdetach(ic);
+		goto fail;
+	}
+	
 	return;
 
  fail:
@@ -3403,6 +3391,7 @@ urtwn_vap_create(struct ieee80211com *ic
 	vap->iv_reset = urtwn_reset;
 
 	ifp = vap->iv_ifp;
+if_initialize(ifp);
 	ifp->if_init = urtwn_init;
 	ifp->if_ioctl = urtwn_ioctl;
 	ifp->if_start = urtwn_start;
@@ -3411,6 +3400,8 @@ urtwn_vap_create(struct ieee80211com *ic
 	// IFQ_SET_READY(>if_snd);
 	memcpy(ifp->if_xname, device_xname(sc->sc_dev), IFNAMSIZ);
 
+	ifp->if_percpuq = if_percpuq_create(ifp);
+
 	/* Override state transition machine. */
 	/* NNN --- many possible newstate machines ... issue! */
 	sc->sc_newstate = vap->iv_newstate;
@@ -3421,6 +3412,11 @@ urtwn_vap_create(struct ieee80211com *ic
 	ieee80211_media_status, macaddr);
 	ic->ic_opmode = opmode;
 
+	/* Attach the packet filter */
+	bpf_attach2(vap->iv_ifp, DLT_IEEE802_11_RADIO,
+	sizeof(struct ieee80211_frame) + IEEE80211_RADIOTAP_HDRLEN,
+	>sc_drvbpf);
+
 	return vap;
 }
 
@@ -3610,7 +3606,7 @@ urtwn_raw_xmit(struct ieee80211_node *ni
 
 	DPRINTFN(DBG_FN, ("%s: %s\n",device_xname(sc->sc_dev), __func__));
 
-	KASSERT(vap != NULL);  // NNN need these?
+	KASSERT(vap != NULL);   /*  NNN need these? */
 	KASSERT(ic != NULL);
 	KASSERT(sc != NULL);
 	KASSERT(m != NULL);
@@ -3628,8 +3624,8 @@ urtwn_raw_xmit(struct ieee80211_node *ni
 
 	error = urtwn_tx(sc, m, ni, data);
 	if (error != 0) {
-			printf("ERROR3\n");
-			vap->iv_ifp->if_oerrors++;
+		printf("ERROR3\n");
+	

Re: CVS commit: [phil-wifi] src/sys/net80211

2018-06-28 Thread Phil Nelson
On Thursday 28 June 2018 18:01:28 Kimihiro Nonaka wrote:
> Why did you copy the FreeBSD source from the git mirror?
> When you copy the source from git mirror, "$FreeBSD$" is not expanded.
> So we don't know the revision number of the original file.

svnweb did not have them expanded and following the instructions
at freebsd.org for anonymous svn access produced no access after
multiple trys.   With the git commit id, it should be easy to get diffs
for future updates using the git mirror again.   If needed, I can get
them added when I get access to them.

--Phil

-
Phil Nelson, http://pcnelson.net


Re: CVS commit: src/external/bsd/bc/dist

2017-04-10 Thread Phil Nelson
On Monday 10 April 2017 02:26:50 co...@sdf.org wrote:
> -DIGIT [0-9A-F]
> +DIGIT [0-9A-Z]
> 
> Looks off, is that intended?

$ ./bc
ibase
10
obase
10
ibase = Z+1
ibase
36

1679615
obase = Z+1
obase
 01 00

 35 35 35 35
1Z36AQ16836
 01 35 03 06 10 26 01 06 08 03 06
quit

The real question is outputting stuff in base 36 should also use G-Z, but that
might need to be a flag to bc because that breaks POSIX output.  Allowing
base 36 inputs doesn't cause problems with existing programs.

--Phil




Re: CVS commit: src/usr.bin/make

2010-04-29 Thread Phil Nelson
On Thursday 29 April 2010 17:02:50 Joerg Sonnenberger wrote:
 On Thu, Apr 29, 2010 at 11:12:21PM +, Simon J. Gerraty wrote:
  Module Name:  src
  Committed By: sjg
  Date: Thu Apr 29 23:12:21 UTC 2010
  
  Modified Files:
    src/usr.bin/make: main.c parse.c
  
  Log Message:
  fflush stdout, before writing to stderr.
 
 In which situation does it actually help? I think this is supposed to be
 the default behavior for stderr after all.

In a shell that allows you to say:

   make target  logfile 

In this case, stdout defaults to fully buffered mode instead of
line buffered mode and with stderr being unbuffered, the fflush
is needed to make sure that anything written to standard out
appears in the output before the stuff written to stderr.

--Phil



-- 
Phil Nelson (phil at cs.wwu.edu) http://www.cs.wwu.edu/nelson
NetBSD: http://www.NetBSD.org  Coda: http://www.coda.cs.cmu.edu