Source-Changes-HG archive

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

[src/bouyer-socketcan]: src/sys/netcan Add can_ifinit_timings() helper functi...



details:   https://anonhg.NetBSD.org/src/rev/92f91377cef4
branches:  bouyer-socketcan
changeset: 820881:92f91377cef4
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Tue Apr 18 20:37:38 2017 +0000

description:
Add can_ifinit_timings() helper function, which initialise timing parameters
to known invalid values.

diffstat:

 sys/netcan/can.c     |  11 +++++++++--
 sys/netcan/can_var.h |   3 ++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diffs (49 lines):

diff -r cd4e92fa2e7f -r 92f91377cef4 sys/netcan/can.c
--- a/sys/netcan/can.c  Tue Apr 18 20:36:27 2017 +0000
+++ b/sys/netcan/can.c  Tue Apr 18 20:37:38 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: can.c,v 1.1.2.7 2017/04/17 20:32:27 bouyer Exp $       */
+/*     $NetBSD: can.c,v 1.1.2.8 2017/04/18 20:37:38 bouyer Exp $       */
 
 /*-
  * Copyright (c) 2003, 2017 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: can.c,v 1.1.2.7 2017/04/17 20:32:27 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: can.c,v 1.1.2.8 2017/04/18 20:37:38 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -202,6 +202,13 @@
        IFQ_SET_READY(&ifp->if_snd);
 }
 
+void
+can_ifinit_timings(struct canif_softc *csc)
+{
+       /* uninitialized parameters is all-one */
+       memset(&csc->csc_timings, 0xff, sizeof(struct can_link_timings));
+}
+
 static int
 can_output(struct mbuf *m, struct canpcb *canp)
 {
diff -r cd4e92fa2e7f -r 92f91377cef4 sys/netcan/can_var.h
--- a/sys/netcan/can_var.h      Tue Apr 18 20:36:27 2017 +0000
+++ b/sys/netcan/can_var.h      Tue Apr 18 20:37:38 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: can_var.h,v 1.1.2.5 2017/04/17 20:32:27 bouyer Exp $   */
+/*     $NetBSD: can_var.h,v 1.1.2.6 2017/04/18 20:37:38 bouyer Exp $   */
 
 /*-
  * Copyright (c) 2003, 2017 The NetBSD Foundation, Inc.
@@ -59,6 +59,7 @@
 extern const struct pr_usrreqs can_usrreqs;
 
 void can_ifattach(struct ifnet *);
+void can_ifinit_timings(struct canif_softc *);
 void can_mbuf_tag_clean(struct mbuf *);
 void can_input(struct ifnet *, struct mbuf *);
 void *can_ctlinput(int, struct sockaddr *, void *);



Home | Main Index | Thread Index | Old Index