diff options
author | mux <mux@FreeBSD.org> | 2003-03-22 12:18:20 +0000 |
---|---|---|
committer | mux <mux@FreeBSD.org> | 2003-03-22 12:18:20 +0000 |
commit | 41824db1c60239f31a899ab05c9bdc7cbf728bd0 (patch) | |
tree | bf4321914b31ede56d450445be309e2854f4c107 /sys/dev/ata/ata-all.c | |
parent | 6aa08c7dda5a26d5cffef6924435fc620e970d5b (diff) | |
download | FreeBSD-src-41824db1c60239f31a899ab05c9bdc7cbf728bd0.zip FreeBSD-src-41824db1c60239f31a899ab05c9bdc7cbf728bd0.tar.gz |
- Add a new ioctl to get the maximum number of ATA channels.
- Use it in atacontrol(8) when listing ATA devices instead of
stopping at the first ENXIO received.
This makes atacontrol list work on my sparc64 where the two ATA
channels I have are numbered 2 and 3.
Reviewed by: sos
Diffstat (limited to 'sys/dev/ata/ata-all.c')
-rw-r--r-- | sys/dev/ata/ata-all.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index 67da2a0..56a7d29 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -304,6 +304,11 @@ ataioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td) if (cmd != IOCATA) return ENOTTY; + if (iocmd->cmd == ATAGMAXCHANNEL) { + iocmd->u.maxchan = devclass_get_maxunit(ata_devclass); + return 0; + } + if (iocmd->channel < -1 || iocmd->device < -1 || iocmd->device > SLAVE) return ENXIO; |