Stanley Wu <[EMAIL PROTECTED]> wrote:
> I'm not aware of MAKDEV script, but MKDEV is a kernel
> function call. It takes the major and minor number as
> parameters and should make a devcie instance, I think.

Infact, as far as I know, MKDEV will transform a major/minor
pair into a kdev_t, the opaque structure used internally in
the kernel.

Then, you use MAJOR(x) and MINOR(y) to get back those values.
Infact, I have never really used MKDEV, MAJOR or MINOR at
all, so my explanation might be a bit flaky.

For me, those functions should stricly be reserved in the
user-space-to-kernel-space translations (e.g. stat(),
or open-a-device-special-file).

The only case you can see a MKDEV in drivers/scsi/*.[ch]
seems to be for partition table validation in sd devices,
presumably because it uses a high level function needing
a kdev_t or something.

What is important is that, in the general case, to access
a device from user-space, you need an entry in /dev, created
with the mknod command.

You could also use one of the reserved majors
(see Documentation/devices.txt) so that you can have
static entries in /dev. Once the device driver is distributed
seriously, you can register officially the number.

SCSI device which are character-devices are 'sg' and 'st', look
in drivers/scsi.


-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]

Reply via email to