aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsmh22@tempest.cl.cam.ac.uk <smh22@tempest.cl.cam.ac.uk>2004-02-23 14:02:44 +0000
committersmh22@tempest.cl.cam.ac.uk <smh22@tempest.cl.cam.ac.uk>2004-02-23 14:02:44 +0000
commite910516362082096a3f77229e9ce19d8ba07b2c8 (patch)
tree38bc97de7cd25a609623855677be4f2e18e7514b
parent65cb849092a0e0d6f6cc3c6d16c710f6e6dd86fa (diff)
downloadxen-e910516362082096a3f77229e9ce19d8ba07b2c8.tar.gz
xen-e910516362082096a3f77229e9ce19d8ba07b2c8.tar.bz2
xen-e910516362082096a3f77229e9ce19d8ba07b2c8.zip
bitkeeper revision 1.736.1.1 (403a080497wPGih2o-t3yWbCwW8kKw)
fix xen support for cciss
-rw-r--r--xen/common/domain.c2
-rw-r--r--xen/drivers/block/cciss.c42
-rw-r--r--xen/drivers/block/xen_block.c6
3 files changed, 48 insertions, 2 deletions
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 4f45a88b91..41ca90c1b7 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -570,6 +570,7 @@ int setup_guestos(struct task_struct *p, dom0_createdomain_t *params,
extern void ide_probe_devices(xen_disk_info_t *);
extern void scsi_probe_devices(xen_disk_info_t *);
+ extern void cciss_probe_devices(xen_disk_info_t *);
xen_disk_info_t xdi;
xen_disk_t *xd;
@@ -803,6 +804,7 @@ int setup_guestos(struct task_struct *p, dom0_createdomain_t *params,
xdi.disks = xd;
ide_probe_devices(&xdi);
scsi_probe_devices(&xdi);
+ cciss_probe_devices(&xdi);
for ( i = 0; i < xdi.count; i++ )
{
xen_extent_t e;
diff --git a/xen/drivers/block/cciss.c b/xen/drivers/block/cciss.c
index 0c49aae5d0..6e7096c890 100644
--- a/xen/drivers/block/cciss.c
+++ b/xen/drivers/block/cciss.c
@@ -433,6 +433,44 @@ static void cciss_geninit( int ctlr)
}
hba[ctlr]->gendisk.nr_real = hba[ctlr]->highest_lun+1;
}
+
+
+void cciss_probe_devices(xen_disk_info_t *xdi)
+{
+ int i, ctlr;
+ drive_info_struct *drv;
+ xen_disk_t *xd = &xdi->disks[xdi->count];
+
+ ctlr = 0; /* XXX SMH: only deal with 1 controller for now */
+
+ /* Loop through each real device */
+ for(i=0; i < NWD; i++) {
+
+ drv = &(hba[ctlr]->drv[i]);
+
+ if (!(drv->nr_blocks))
+ continue;
+
+ if ( xdi->count == xdi->max )
+ BUG();
+
+
+ hba[ctlr]->hd[i << NWD_SHIFT].nr_sects =
+ hba[ctlr]->sizes[i << NWD_SHIFT] = drv->nr_blocks;
+
+ /* We export 'raw' linux device numbers to domain 0. */
+ xd->device = MKDEV(hba[ctlr]->major, i << 4);
+ xd->info = XD_TYPE_DISK; /* XXX should check properly */
+ xd->capacity = drv->nr_blocks; /* in terms of 512byte sectors */
+ xd->domain = 0;
+
+ xdi->count++;
+ xd++;
+
+ }
+
+}
+
/*
* Open. Make sure the device is really there.
*/
@@ -2394,8 +2432,8 @@ next:
seg = 0;
lastdataend = ~0ULL;
while(bh) {
-// if (bh_phys(bh) == lastdataend)
- if ((page_to_phys(bh->b_page) + bh_offset(bh))== lastdataend)
+
+ if (bh_phys(bh) == lastdataend)
{ /* tack it on to the last segment */
tmp_sg[seg-1].length +=bh->b_size;
lastdataend += bh->b_size;
diff --git a/xen/drivers/block/xen_block.c b/xen/drivers/block/xen_block.c
index 937086a6a0..eaf901a328 100644
--- a/xen/drivers/block/xen_block.c
+++ b/xen/drivers/block/xen_block.c
@@ -499,7 +499,13 @@ static void dispatch_rw_block_io(struct task_struct *p,
bh->b_size = phys_seg[i].nr_sects << 9;
bh->b_dev = phys_seg[i].dev;
bh->b_rsector = (unsigned long)phys_seg[i].sector_number;
+
+ /* SMH: we store a 'pseudo-virtual' bogus address in b_data since
+ later code will undo this transformation (i.e. +-PAGE_OFFSET). */
bh->b_data = phys_to_virt(phys_seg[i].buffer);
+
+ /* SMH: bh_phys() uses the below field as a 'cheap' virt_to_phys */
+ bh->b_page = &frame_table[phys_seg[i].buffer>>PAGE_SHIFT];
bh->b_end_io = end_block_io_op;
bh->pending_req = pending_req;