Sun Sep 28 11:27:01 2014 UTC ()
for BIOCDISK_NOVOL, when setting bd_disknovol=false, also set bv_volid


(jmcneill)
diff -r1.30 -r1.31 src/sys/dev/ic/mpt_netbsd.c

cvs diff -r1.30 -r1.31 src/sys/dev/ic/mpt_netbsd.c (expand / switch to unified diff)

--- src/sys/dev/ic/mpt_netbsd.c 2014/09/28 11:20:22 1.30
+++ src/sys/dev/ic/mpt_netbsd.c 2014/09/28 11:27:00 1.31
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mpt_netbsd.c,v 1.30 2014/09/28 11:20:22 jmcneill Exp $ */ 1/* $NetBSD: mpt_netbsd.c,v 1.31 2014/09/28 11:27:00 jmcneill Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2003 Wasabi Systems, Inc. 4 * Copyright (c) 2003 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -67,27 +67,27 @@ @@ -67,27 +67,27 @@
67/* 67/*
68 * mpt_netbsd.c: 68 * mpt_netbsd.c:
69 * 69 *
70 * NetBSD-specific routines for LSI Fusion adapters. Includes some 70 * NetBSD-specific routines for LSI Fusion adapters. Includes some
71 * bus_dma glue, and SCSIPI glue. 71 * bus_dma glue, and SCSIPI glue.
72 * 72 *
73 * Adapted from the FreeBSD "mpt" driver by Jason R. Thorpe for 73 * Adapted from the FreeBSD "mpt" driver by Jason R. Thorpe for
74 * Wasabi Systems, Inc. 74 * Wasabi Systems, Inc.
75 * 75 *
76 * Additional contributions by Garrett D'Amore on behalf of TELES AG. 76 * Additional contributions by Garrett D'Amore on behalf of TELES AG.
77 */ 77 */
78 78
79#include <sys/cdefs.h> 79#include <sys/cdefs.h>
80__KERNEL_RCSID(0, "$NetBSD: mpt_netbsd.c,v 1.30 2014/09/28 11:20:22 jmcneill Exp $"); 80__KERNEL_RCSID(0, "$NetBSD: mpt_netbsd.c,v 1.31 2014/09/28 11:27:00 jmcneill Exp $");
81 81
82#include "bio.h" 82#include "bio.h"
83 83
84#include <dev/ic/mpt.h> /* pulls in all headers */ 84#include <dev/ic/mpt.h> /* pulls in all headers */
85#include <sys/scsiio.h> 85#include <sys/scsiio.h>
86 86
87#if NBIO > 0 87#if NBIO > 0
88#include <dev/biovar.h> 88#include <dev/biovar.h>
89#endif 89#endif
90 90
91static int mpt_poll(mpt_softc_t *, struct scsipi_xfer *, int); 91static int mpt_poll(mpt_softc_t *, struct scsipi_xfer *, int);
92static void mpt_timeout(void *); 92static void mpt_timeout(void *);
93static void mpt_restart(mpt_softc_t *, request_t *); 93static void mpt_restart(mpt_softc_t *, request_t *);
@@ -1989,26 +1989,27 @@ mpt_bio_ioctl_disk_novol(mpt_softc_t *mp @@ -1989,26 +1989,27 @@ mpt_bio_ioctl_disk_novol(mpt_softc_t *mp
1989 bd->bd_disknovol = true; 1989 bd->bd_disknovol = true;
1990 for (v = 0; bd->bd_disknovol && v < ioc2->NumActiveVolumes; v++) { 1990 for (v = 0; bd->bd_disknovol && v < ioc2->NumActiveVolumes; v++) {
1991 ioc2rvol = &ioc2->RaidVolume[v]; 1991 ioc2rvol = &ioc2->RaidVolume[v];
1992 address = ioc2rvol->VolumeID | (ioc2rvol->VolumeBus << 8); 1992 address = ioc2rvol->VolumeID | (ioc2rvol->VolumeBus << 8);
1993 1993
1994 rvol0 = mpt_get_cfg_page_raid_vol0(mpt, address); 1994 rvol0 = mpt_get_cfg_page_raid_vol0(mpt, address);
1995 if (rvol0 == NULL) 1995 if (rvol0 == NULL)
1996 continue; 1996 continue;
1997 1997
1998 for (d = 0; d < rvol0->NumPhysDisks; d++) { 1998 for (d = 0; d < rvol0->NumPhysDisks; d++) {
1999 if (rvol0->PhysDisk[d].PhysDiskNum == 1999 if (rvol0->PhysDisk[d].PhysDiskNum ==
2000 ioc3->PhysDisk[bd->bd_diskid].PhysDiskNum) { 2000 ioc3->PhysDisk[bd->bd_diskid].PhysDiskNum) {
2001 bd->bd_disknovol = false; 2001 bd->bd_disknovol = false;
 2002 bd->bd_volid = v;
2002 break; 2003 break;
2003 } 2004 }
2004 } 2005 }
2005 free(rvol0, M_DEVBUF); 2006 free(rvol0, M_DEVBUF);
2006 } 2007 }
2007 2008
2008 free(ioc3, M_DEVBUF); 2009 free(ioc3, M_DEVBUF);
2009 free(ioc2, M_DEVBUF); 2010 free(ioc2, M_DEVBUF);
2010 2011
2011 return 0; 2012 return 0;
2012 2013
2013fail: 2014fail:
2014 if (ioc3) free(ioc3, M_DEVBUF); 2015 if (ioc3) free(ioc3, M_DEVBUF);