diff options
author | phk <phk@FreeBSD.org> | 2003-03-15 12:16:33 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-03-15 12:16:33 +0000 |
commit | 8384dd63c2bcc426bf63354ceaa757380ea7348f (patch) | |
tree | 4a1ae652cc0bbc577ce452e567d0c24d39c91d7f /sys/dev/twe | |
parent | b122ce59431db328d6fbeef096c4e29e5eb6694a (diff) | |
download | FreeBSD-src-8384dd63c2bcc426bf63354ceaa757380ea7348f.zip FreeBSD-src-8384dd63c2bcc426bf63354ceaa757380ea7348f.tar.gz |
Fix a bug I introduced by overlooking the fact that "unit number" can
be one of several things in this driver.
Spotted & Tested by: alfred
Diffstat (limited to 'sys/dev/twe')
-rw-r--r-- | sys/dev/twe/twe_compat.h | 2 | ||||
-rw-r--r-- | sys/dev/twe/twe_freebsd.c | 1 |
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? */ |