Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Add an implementation of MCLGETI.



details:   https://anonhg.NetBSD.org/src/rev/9a8511c582b3
branches:  trunk
changeset: 969694:9a8511c582b3
user:      sevan <sevan%NetBSD.org@localhost>
date:      Thu Feb 27 22:58:57 2020 +0000

description:
Add an implementation of MCLGETI.
Borrowed from sys/dev/pci/if_bwfm_pci.c

diffstat:

 sys/dev/pci/if_rge.c |  23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diffs (44 lines):

diff -r 2512dea4e901 -r 9a8511c582b3 sys/dev/pci/if_rge.c
--- a/sys/dev/pci/if_rge.c      Thu Feb 27 22:12:53 2020 +0000
+++ b/sys/dev/pci/if_rge.c      Thu Feb 27 22:58:57 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_rge.c,v 1.6 2020/02/13 23:05:53 sevan Exp $ */
+/*     $NetBSD: if_rge.c,v 1.7 2020/02/27 22:58:57 sevan Exp $ */
 /*     $OpenBSD: if_rge.c,v 1.2 2020/01/02 09:00:45 kevlo Exp $        */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.6 2020/02/13 23:05:53 sevan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.7 2020/02/27 22:58:57 sevan Exp $");
 
 /* #include "vlan.h" Sevan */
 
@@ -70,6 +70,25 @@
        struct mbuf     *ml_tail;
        u_int   ml_len;
 };
+
+static struct mbuf *
+MCLGETI(struct rge_softc *sc __unused, int how,
+    struct ifnet *ifp __unused, u_int size)
+{
+       struct mbuf *m;
+
+       MGETHDR(m, how, MT_DATA);
+       if (m == NULL)
+               return NULL;
+
+       MEXTMALLOC(m, size, how);
+       if ((m->m_flags & M_EXT) == 0) {
+               m_freem(m);
+               return NULL;
+       }
+       return m;
+}
+
 #ifdef NET_MPSAFE
 #define        RGE_MPSAFE      1
 #define        CALLOUT_FLAGS   CALLOUT_MPSAFE



Home | Main Index | Thread Index | Old Index