summaryrefslogtreecommitdiffstats
path: root/sys/dev/twe
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/twe')
-rw-r--r--sys/dev/twe/twe_compat.h2
-rw-r--r--sys/dev/twe/twe_freebsd.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/twe/twe_compat.h b/sys/dev/twe/twe_compat.h
index 7d2f9c7..aea8ba1 100644
--- a/sys/dev/twe/twe_compat.h
+++ b/sys/dev/twe/twe_compat.h
@@ -166,7 +166,7 @@ typedef struct bio_queue_head twe_bioq;
# define TWE_BIO_LENGTH(bp) (bp)->bio_bcount
# define TWE_BIO_LBA(bp) (bp)->bio_pblkno
# define TWE_BIO_SOFTC(bp) (bp)->bio_disk->d_drv1
-# define TWE_BIO_UNIT(bp) (bp)->bio_disk->d_unit
+# define TWE_BIO_UNIT(bp) *(int *)(bp->bio_driver1)
# define TWE_BIO_SET_ERROR(bp, err) do { (bp)->bio_error = err; (bp)->bio_flags |= BIO_ERROR;} while(0)
# define TWE_BIO_HAS_ERROR(bp) ((bp)->bio_flags & BIO_ERROR)
# define TWE_BIO_RESID(bp) (bp)->bio_resid
diff --git a/sys/dev/twe/twe_freebsd.c b/sys/dev/twe/twe_freebsd.c
index 10d7006..f1f12ae 100644
--- a/sys/dev/twe/twe_freebsd.c
+++ b/sys/dev/twe/twe_freebsd.c
@@ -607,6 +607,7 @@ twed_strategy(twe_bio *bp)
debug_called(4);
+ bp->bio_driver1 = &sc->twed_drive->td_unit;
TWED_BIO_IN;
/* bogus disk? */
OpenPOWER on IntegriCloud