Thu Mar 5 15:33:13 2020 UTC ()
s/Intialize/Initialize/ in comment.


(msaitoh)
diff -r1.116 -r1.117 src/sys/dev/pci/if_ti.c
diff -r1.4 -r1.5 src/sys/dev/pci/qat/qat.c

cvs diff -r1.116 -r1.117 src/sys/dev/pci/if_ti.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_ti.c 2020/03/03 05:41:36 1.116
+++ src/sys/dev/pci/if_ti.c 2020/03/05 15:33:13 1.117
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_ti.c,v 1.116 2020/03/03 05:41:36 msaitoh Exp $ */ 1/* $NetBSD: if_ti.c,v 1.117 2020/03/05 15:33:13 msaitoh Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1997, 1998, 1999 4 * Copyright (c) 1997, 1998, 1999
5 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 5 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -71,27 +71,27 @@ @@ -71,27 +71,27 @@
71 * compiling it requires a GNU toolchain targeted for mips-sgi-irix5.3. 71 * compiling it requires a GNU toolchain targeted for mips-sgi-irix5.3.
72 * 72 *
73 * The following people deserve special thanks: 73 * The following people deserve special thanks:
74 * - Terry Murphy of 3Com, for providing a 3c985 Tigon 1 board 74 * - Terry Murphy of 3Com, for providing a 3c985 Tigon 1 board
75 * for testing 75 * for testing
76 * - Raymond Lee of Netgear, for providing a pair of Netgear 76 * - Raymond Lee of Netgear, for providing a pair of Netgear
77 * GA620 Tigon 2 boards for testing 77 * GA620 Tigon 2 boards for testing
78 * - Ulf Zimmermann, for bringing the GA620 to my attention and 78 * - Ulf Zimmermann, for bringing the GA620 to my attention and
79 * convincing me to write this driver. 79 * convincing me to write this driver.
80 * - Andrew Gallatin for providing FreeBSD/Alpha support. 80 * - Andrew Gallatin for providing FreeBSD/Alpha support.
81 */ 81 */
82 82
83#include <sys/cdefs.h> 83#include <sys/cdefs.h>
84__KERNEL_RCSID(0, "$NetBSD: if_ti.c,v 1.116 2020/03/03 05:41:36 msaitoh Exp $"); 84__KERNEL_RCSID(0, "$NetBSD: if_ti.c,v 1.117 2020/03/05 15:33:13 msaitoh Exp $");
85 85
86#include "opt_inet.h" 86#include "opt_inet.h"
87 87
88#include <sys/param.h> 88#include <sys/param.h>
89#include <sys/systm.h> 89#include <sys/systm.h>
90#include <sys/sockio.h> 90#include <sys/sockio.h>
91#include <sys/mbuf.h> 91#include <sys/mbuf.h>
92#include <sys/malloc.h> 92#include <sys/malloc.h>
93#include <sys/kernel.h> 93#include <sys/kernel.h>
94#include <sys/socket.h> 94#include <sys/socket.h>
95#include <sys/queue.h> 95#include <sys/queue.h>
96#include <sys/device.h> 96#include <sys/device.h>
97#include <sys/reboot.h> 97#include <sys/reboot.h>
@@ -755,27 +755,27 @@ ti_newbuf_std(struct ti_softc *sc, int i @@ -755,27 +755,27 @@ ti_newbuf_std(struct ti_softc *sc, int i
755 r->ti_flags = 0; 755 r->ti_flags = 0;
756 if (sc->ethercom.ec_if.if_capenable & IFCAP_CSUM_IPv4_Rx) 756 if (sc->ethercom.ec_if.if_capenable & IFCAP_CSUM_IPv4_Rx)
757 r->ti_flags |= TI_BDFLAG_IP_CKSUM; 757 r->ti_flags |= TI_BDFLAG_IP_CKSUM;
758 if (sc->ethercom.ec_if.if_capenable & 758 if (sc->ethercom.ec_if.if_capenable &
759 (IFCAP_CSUM_TCPv4_Rx | IFCAP_CSUM_UDPv4_Rx)) 759 (IFCAP_CSUM_TCPv4_Rx | IFCAP_CSUM_UDPv4_Rx))
760 r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM; 760 r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM;
761 r->ti_len = m_new->m_len; /* == ds_len */ 761 r->ti_len = m_new->m_len; /* == ds_len */
762 r->ti_idx = i; 762 r->ti_idx = i;
763 763
764 return (0); 764 return (0);
765} 765}
766 766
767/* 767/*
768 * Intialize a mini receive ring descriptor. This only applies to 768 * Initialize a mini receive ring descriptor. This only applies to
769 * the Tigon 2. 769 * the Tigon 2.
770 */ 770 */
771static int 771static int
772ti_newbuf_mini(struct ti_softc *sc, int i, struct mbuf *m, bus_dmamap_t dmamap) 772ti_newbuf_mini(struct ti_softc *sc, int i, struct mbuf *m, bus_dmamap_t dmamap)
773{ 773{
774 struct mbuf *m_new = NULL; 774 struct mbuf *m_new = NULL;
775 struct ti_rx_desc *r; 775 struct ti_rx_desc *r;
776 int error; 776 int error;
777 777
778 if (dmamap == NULL) { 778 if (dmamap == NULL) {
779 /* if (m) panic() */ 779 /* if (m) panic() */
780 780
781 if ((error = bus_dmamap_create(sc->sc_dmat, MHLEN, 1, 781 if ((error = bus_dmamap_create(sc->sc_dmat, MHLEN, 1,

cvs diff -r1.4 -r1.5 src/sys/dev/pci/qat/qat.c (expand / switch to unified diff)

--- src/sys/dev/pci/qat/qat.c 2020/02/01 13:48:18 1.4
+++ src/sys/dev/pci/qat/qat.c 2020/03/05 15:33:13 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: qat.c,v 1.4 2020/02/01 13:48:18 riastradh Exp $ */ 1/* $NetBSD: qat.c,v 1.5 2020/03/05 15:33:13 msaitoh Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2019 Internet Initiative Japan, Inc. 4 * Copyright (c) 2019 Internet Initiative Japan, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -47,27 +47,27 @@ @@ -47,27 +47,27 @@
47 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 47 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
48 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 48 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
49 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 49 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
50 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 50 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
51 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 51 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
52 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 52 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
53 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 53 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
54 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 54 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
55 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 55 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
56 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 56 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57 */ 57 */
58 58
59#include <sys/cdefs.h> 59#include <sys/cdefs.h>
60__KERNEL_RCSID(0, "$NetBSD: qat.c,v 1.4 2020/02/01 13:48:18 riastradh Exp $"); 60__KERNEL_RCSID(0, "$NetBSD: qat.c,v 1.5 2020/03/05 15:33:13 msaitoh Exp $");
61 61
62#include <sys/param.h> 62#include <sys/param.h>
63#include <sys/systm.h> 63#include <sys/systm.h>
64#include <sys/kernel.h> 64#include <sys/kernel.h>
65#include <sys/device.h> 65#include <sys/device.h>
66#include <sys/module.h> 66#include <sys/module.h>
67#include <sys/kmem.h> 67#include <sys/kmem.h>
68#include <sys/mutex.h> 68#include <sys/mutex.h>
69#include <sys/bitops.h> 69#include <sys/bitops.h>
70#include <sys/atomic.h> 70#include <sys/atomic.h>
71#include <sys/mbuf.h> 71#include <sys/mbuf.h>
72#include <sys/cprng.h> 72#include <sys/cprng.h>
73#include <sys/cpu.h> 73#include <sys/cpu.h>
@@ -1017,27 +1017,27 @@ qat_etr_setup_ring(struct qat_softc *sc, @@ -1017,27 +1017,27 @@ qat_etr_setup_ring(struct qat_softc *sc,
1017 1017
1018 KASSERT(bank < sc->sc_hw.qhw_num_banks); 1018 KASSERT(bank < sc->sc_hw.qhw_num_banks);
1019 1019
1020 /* Allocate a ring from specified bank */ 1020 /* Allocate a ring from specified bank */
1021 qb = &sc->sc_etr_banks[bank]; 1021 qb = &sc->sc_etr_banks[bank];
1022 1022
1023 if (ring >= sc->sc_hw.qhw_num_rings_per_bank) 1023 if (ring >= sc->sc_hw.qhw_num_rings_per_bank)
1024 return EINVAL; 1024 return EINVAL;
1025 if (qb->qb_allocated_rings & (1 << ring)) 1025 if (qb->qb_allocated_rings & (1 << ring))
1026 return ENOENT; 1026 return ENOENT;
1027 qr = &qb->qb_et_rings[ring]; 1027 qr = &qb->qb_et_rings[ring];
1028 qb->qb_allocated_rings |= 1 << ring; 1028 qb->qb_allocated_rings |= 1 << ring;
1029 1029
1030 /* Intialize allocated ring */ 1030 /* Initialize allocated ring */
1031 qr->qr_ring = ring; 1031 qr->qr_ring = ring;
1032 qr->qr_bank = bank; 1032 qr->qr_bank = bank;
1033 qr->qr_name = name; 1033 qr->qr_name = name;
1034 qr->qr_ring_id = qr->qr_bank * sc->sc_hw.qhw_num_rings_per_bank + ring; 1034 qr->qr_ring_id = qr->qr_bank * sc->sc_hw.qhw_num_rings_per_bank + ring;
1035 qr->qr_ring_mask = (1 << ring); 1035 qr->qr_ring_mask = (1 << ring);
1036 qr->qr_cb = cb; 1036 qr->qr_cb = cb;
1037 qr->qr_cb_arg = cb_arg; 1037 qr->qr_cb_arg = cb_arg;
1038 QAT_EVCNT_ATTACH(sc, &qr->qr_ev_rxintr, EVCNT_TYPE_INTR, 1038 QAT_EVCNT_ATTACH(sc, &qr->qr_ev_rxintr, EVCNT_TYPE_INTR,
1039 qr->qr_ev_rxintr_name, "bank%d ring%d rxintr", bank, ring); 1039 qr->qr_ev_rxintr_name, "bank%d ring%d rxintr", bank, ring);
1040 QAT_EVCNT_ATTACH(sc, &qr->qr_ev_rxmsg, EVCNT_TYPE_MISC, 1040 QAT_EVCNT_ATTACH(sc, &qr->qr_ev_rxmsg, EVCNT_TYPE_MISC,
1041 qr->qr_ev_rxmsg_name, "bank%d ring%d rxmsg", bank, ring); 1041 qr->qr_ev_rxmsg_name, "bank%d ring%d rxmsg", bank, ring);
1042 QAT_EVCNT_ATTACH(sc, &qr->qr_ev_txmsg, EVCNT_TYPE_MISC, 1042 QAT_EVCNT_ATTACH(sc, &qr->qr_ev_txmsg, EVCNT_TYPE_MISC,
1043 qr->qr_ev_txmsg_name, "bank%d ring%d txmsg", bank, ring); 1043 qr->qr_ev_txmsg_name, "bank%d ring%d txmsg", bank, ring);