[2181] in linux-scsi channel archive
Re: More than one SCSI controler & SCSI_IOCTL_GET_IDLUN
daemon@ATHENA.MIT.EDU (Michael Neuffer)
Sat Jul 19 09:09:50 1997
Date: Sat, 19 Jul 1997 12:54:56 +0200 (CEST)
From: Michael Neuffer <neuffer@goofy.zdv.Uni-Mainz.de>
To: Joerg Schilling <schilling@fokus.gmd.de>
cc: eric@andante.jic.com, tn@bv.rz.fh-muenchen.de, linux-scsi@vger.rutgers.edu
In-Reply-To: <199707181058.MAA01020@sherwood.fokus.gmd.de>
On Fri, 18 Jul 1997, Joerg Schilling wrote:
> Here is the version of the patch, I will include in the cdrecord-1.5a5
> release. I modified the Bus # to be an integer and the directory to
> be 'linux' to allow most users to patch their kernels.
>
> I have currently no Linux with SCSI at all and would be happy to
> get test results from people who have more SCSI busses.
This won't work as is. There are multichannel controllers out there.
> ------------------%Snip-----------%Snap---------------------------
> --- linux/drivers/scsi/scsi_ioctl.c.orig Wed Jul 16 18:33:46 1997
> +++ linux/drivers/scsi/scsi_ioctl.c Wed Jul 16 18:46:11 1997
> @@ -343,6 +343,11 @@
> (unsigned long *) arg);
> put_user( dev->host->unique_id, (unsigned long *) arg+1);
> return 0;
> + case SCSI_IOCTL_GET_BUS_NUMBER:
> + result = verify_area(VERIFY_WRITE, (void *) arg, sizeof(long));
> + if (result) return result;
> + put_user( dev->host->host_no, (int *) arg);
> + return 0;
This only gives you the controller/host number but definitively not the
bus number.
You need to use something like this:
put_user( dev->host->host_no + (dev->channel << 8), (int *) arg);
Mike