pst-raid.c (119874) | pst-raid.c (125975) |
---|---|
1/*- 2 * Copyright (c) 2001,2002,2003 S�ren Schmidt <sos@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001,2002,2003 S�ren Schmidt <sos@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/dev/pst/pst-raid.c 119874 2003-09-08 06:28:50Z sos $"); | 30__FBSDID("$FreeBSD: head/sys/dev/pst/pst-raid.c 125975 2004-02-18 21:36:53Z phk $"); |
31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/kernel.h> 35#include <sys/module.h> 36#include <sys/bus.h> 37#include <sys/bio.h> 38#include <sys/conf.h> --- 12 unchanged lines hidden (view full) --- 51#include <geom/geom_disk.h> 52 53#include "dev/pst/pst-iop.h" 54 55struct pst_softc { 56 struct iop_softc *iop; 57 struct i2o_lct_entry *lct; 58 struct i2o_bsa_device *info; | 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/kernel.h> 35#include <sys/module.h> 36#include <sys/bus.h> 37#include <sys/bio.h> 38#include <sys/conf.h> --- 12 unchanged lines hidden (view full) --- 51#include <geom/geom_disk.h> 52 53#include "dev/pst/pst-iop.h" 54 55struct pst_softc { 56 struct iop_softc *iop; 57 struct i2o_lct_entry *lct; 58 struct i2o_bsa_device *info; |
59 struct disk disk; | 59 struct disk *disk; |
60 struct bio_queue_head queue; 61}; 62 63struct pst_request { 64 struct pst_softc *psc; /* pointer to softc */ 65 u_int32_t mfa; /* frame addreess */ 66 struct callout_handle timeout_handle; /* handle for untimeout */ 67 struct bio *bp; /* associated bio ptr */ --- 76 unchanged lines hidden (view full) --- 144#endif 145 bpack(ident->vendor, ident->vendor, 16); 146 bpack(ident->product, ident->product, 16); 147 sprintf(name, "%s %s", ident->vendor, ident->product); 148 contigfree(reply, PAGE_SIZE, M_PSTRAID); 149 150 bioq_init(&psc->queue); 151 | 60 struct bio_queue_head queue; 61}; 62 63struct pst_request { 64 struct pst_softc *psc; /* pointer to softc */ 65 u_int32_t mfa; /* frame addreess */ 66 struct callout_handle timeout_handle; /* handle for untimeout */ 67 struct bio *bp; /* associated bio ptr */ --- 76 unchanged lines hidden (view full) --- 144#endif 145 bpack(ident->vendor, ident->vendor, 16); 146 bpack(ident->product, ident->product, 16); 147 sprintf(name, "%s %s", ident->vendor, ident->product); 148 contigfree(reply, PAGE_SIZE, M_PSTRAID); 149 150 bioq_init(&psc->queue); 151 |
152 psc->disk.d_name = "pst"; 153 psc->disk.d_strategy = pststrategy; 154 psc->disk.d_maxsize = 64 * 1024; /*I2O_SGL_MAX_SEGS * PAGE_SIZE;*/ 155 psc->disk.d_drv1 = psc; 156 disk_create(lun, &psc->disk, DISKFLAG_NOGIANT, NULL, NULL); | 152 psc->disk = disk_alloc(); 153 psc->disk->d_name = "pst"; 154 psc->disk->d_strategy = pststrategy; 155 psc->disk->d_maxsize = 64 * 1024; /*I2O_SGL_MAX_SEGS * PAGE_SIZE;*/ 156 psc->disk->d_drv1 = psc; 157 psc->disk->d_unit = lun; |
157 | 158 |
158 psc->disk.d_sectorsize = psc->info->block_size; 159 psc->disk.d_mediasize = psc->info->capacity; 160 psc->disk.d_fwsectors = 63; 161 psc->disk.d_fwheads = 255; | 159 psc->disk->d_sectorsize = psc->info->block_size; 160 psc->disk->d_mediasize = psc->info->capacity; 161 psc->disk->d_fwsectors = 63; 162 psc->disk->d_fwheads = 255; |
162 | 163 |
164 disk_create(psc->disk, DISK_VERSION); 165 |
|
163 printf("pst%d: %lluMB <%.40s> [%lld/%d/%d] on %.16s\n", lun, 164 (unsigned long long)psc->info->capacity / (1024 * 1024), 165 name, psc->info->capacity/(512*255*63), 255, 63, 166 device_get_nameunit(psc->iop->dev)); 167 168 EVENTHANDLER_REGISTER(shutdown_post_sync, pst_shutdown, 169 dev, SHUTDOWN_PRI_FIRST); 170 return 0; --- 201 unchanged lines hidden --- | 166 printf("pst%d: %lluMB <%.40s> [%lld/%d/%d] on %.16s\n", lun, 167 (unsigned long long)psc->info->capacity / (1024 * 1024), 168 name, psc->info->capacity/(512*255*63), 255, 63, 169 device_get_nameunit(psc->iop->dev)); 170 171 EVENTHANDLER_REGISTER(shutdown_post_sync, pst_shutdown, 172 dev, SHUTDOWN_PRI_FIRST); 173 return 0; --- 201 unchanged lines hidden --- |