Sat Feb 12 02:58:50 2022 UTC ()
ips(4): Missed a couple spots in device_t/softc split.


(riastradh)
diff -r1.5 -r1.6 src/sys/dev/pci/ips.c

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

--- src/sys/dev/pci/ips.c 2022/02/12 02:40:39 1.5
+++ src/sys/dev/pci/ips.c 2022/02/12 02:58:50 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ips.c,v 1.5 2022/02/12 02:40:39 riastradh Exp $ */ 1/* $NetBSD: ips.c,v 1.6 2022/02/12 02:58:50 riastradh Exp $ */
2/* $OpenBSD: ips.c,v 1.113 2016/08/14 04:08:03 dlg Exp $ */ 2/* $OpenBSD: ips.c,v 1.113 2016/08/14 04:08:03 dlg Exp $ */
3 3
4/*- 4/*-
5 * Copyright (c) 2017 The NetBSD Foundation, Inc. 5 * Copyright (c) 2017 The NetBSD Foundation, Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -38,27 +38,27 @@ @@ -38,27 +38,27 @@
38 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 38 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
39 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 39 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
40 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 40 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
41 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 41 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
42 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 42 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
43 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 43 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
44 */ 44 */
45 45
46/* 46/*
47 * IBM (Adaptec) ServeRAID controllers driver. 47 * IBM (Adaptec) ServeRAID controllers driver.
48 */ 48 */
49 49
50#include <sys/cdefs.h> 50#include <sys/cdefs.h>
51__KERNEL_RCSID(0, "$NetBSD: ips.c,v 1.5 2022/02/12 02:40:39 riastradh Exp $"); 51__KERNEL_RCSID(0, "$NetBSD: ips.c,v 1.6 2022/02/12 02:58:50 riastradh Exp $");
52 52
53#include "bio.h" 53#include "bio.h"
54 54
55#include <sys/param.h> 55#include <sys/param.h>
56#include <sys/systm.h> 56#include <sys/systm.h>
57#include <sys/device.h> 57#include <sys/device.h>
58#include <sys/kernel.h> 58#include <sys/kernel.h>
59#include <sys/queue.h> 59#include <sys/queue.h>
60#include <sys/buf.h> 60#include <sys/buf.h>
61#include <sys/endian.h> 61#include <sys/endian.h>
62#include <sys/conf.h> 62#include <sys/conf.h>
63#include <sys/malloc.h> 63#include <sys/malloc.h>
64#include <sys/ioctl.h> 64#include <sys/ioctl.h>
@@ -812,27 +812,27 @@ ips_attach(struct device *parent, struct @@ -812,27 +812,27 @@ ips_attach(struct device *parent, struct
812 chan->chan_channel = i; 812 chan->chan_channel = i;
813 chan->chan_ntargets = IPS_MAXTARGETS; 813 chan->chan_ntargets = IPS_MAXTARGETS;
814 chan->chan_nluns = lastarget + 1; 814 chan->chan_nluns = lastarget + 1;
815 chan->chan_id = i; 815 chan->chan_id = i;
816 chan->chan_flags = SCSIPI_CHAN_NOSETTLE; 816 chan->chan_flags = SCSIPI_CHAN_NOSETTLE;
817 config_found(self, chan, scsiprint, CFARGS_NONE); 817 config_found(self, chan, scsiprint, CFARGS_NONE);
818 } 818 }
819 819
820 /* Enable interrupts */ 820 /* Enable interrupts */
821 ips_intren(sc); 821 ips_intren(sc);
822 822
823#if NBIO > 0 823#if NBIO > 0
824 /* Install ioctl handler */ 824 /* Install ioctl handler */
825 if (bio_register(&sc->sc_dev, ips_ioctl)) 825 if (bio_register(sc->sc_dev, ips_ioctl))
826 device_printf(sc->sc_dev, "no ioctl support\n"); 826 device_printf(sc->sc_dev, "no ioctl support\n");
827#endif 827#endif
828 828
829 return; 829 return;
830fail5: 830fail5:
831 ips_ccb_free(sc, sc->sc_ccb, sc->sc_nccbs); 831 ips_ccb_free(sc, sc->sc_ccb, sc->sc_nccbs);
832fail4: 832fail4:
833 if (sc->sc_chip->ic_id == IPS_CHIP_COPPERHEAD) 833 if (sc->sc_chip->ic_id == IPS_CHIP_COPPERHEAD)
834 ips_dmamem_free(&sc->sc_sqm); 834 ips_dmamem_free(&sc->sc_sqm);
835fail3: 835fail3:
836 ips_dmamem_free(&sc->sc_infom); 836 ips_dmamem_free(&sc->sc_infom);
837fail2: 837fail2:
838 ips_dmamem_free(&sc->sc_cmdbm); 838 ips_dmamem_free(&sc->sc_cmdbm);
@@ -1129,27 +1129,27 @@ ips_ioctl_vol(struct ips_softc *sc, stru @@ -1129,27 +1129,27 @@ ips_ioctl_vol(struct ips_softc *sc, stru
1129 struct ips_dev *dev; 1129 struct ips_dev *dev;
1130 int chan, target; 1130 int chan, target;
1131 1131
1132 for (chan = 0; chan < IPS_MAXCHANS; chan++) 1132 for (chan = 0; chan < IPS_MAXCHANS; chan++)
1133 for (target = 0; target < IPS_MAXTARGETS; target++) { 1133 for (target = 0; target < IPS_MAXTARGETS; target++) {
1134 dev = &conf->dev[chan][target]; 1134 dev = &conf->dev[chan][target];
1135 if (dev->state && !(dev->state & 1135 if (dev->state && !(dev->state &
1136 IPS_DVS_MEMBER) && 1136 IPS_DVS_MEMBER) &&
1137 (dev->params & SID_TYPE) == T_DIRECT) 1137 (dev->params & SID_TYPE) == T_DIRECT)
1138 bv->bv_nodisk++; 1138 bv->bv_nodisk++;
1139 } 1139 }
1140 } 1140 }
1141 1141
1142 dv = &sc->sc_dev; 1142 dv = sc->sc_dev;
1143 strlcpy(bv->bv_dev, device_xname(dv), sizeof(bv->bv_dev)); 1143 strlcpy(bv->bv_dev, device_xname(dv), sizeof(bv->bv_dev));
1144 strlcpy(bv->bv_vendor, "IBM", sizeof(bv->bv_vendor)); 1144 strlcpy(bv->bv_vendor, "IBM", sizeof(bv->bv_vendor));
1145 1145
1146 DPRINTF(IPS_D_INFO, ("%s: ips_ioctl_vol: vid %d, state 0x%02x, " 1146 DPRINTF(IPS_D_INFO, ("%s: ips_ioctl_vol: vid %d, state 0x%02x, "
1147 "total %u, done %u, size %llu, level %d, nodisk %d, dev %s\n", 1147 "total %u, done %u, size %llu, level %d, nodisk %d, dev %s\n",
1148 device_xname(sc->sc_dev), vid, ld->state, total, done, bv->bv_size, 1148 device_xname(sc->sc_dev), vid, ld->state, total, done, bv->bv_size,
1149 bv->bv_level, bv->bv_nodisk, bv->bv_dev)); 1149 bv->bv_level, bv->bv_nodisk, bv->bv_dev));
1150 1150
1151 return (0); 1151 return (0);
1152} 1152}
1153 1153
1154int 1154int
1155ips_ioctl_disk(struct ips_softc *sc, struct bioc_disk *bd) 1155ips_ioctl_disk(struct ips_softc *sc, struct bioc_disk *bd)