lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 17 Nov 2010 16:42:22 -0600
From:	Timur Tabi <>
To:	Greg KH <>
CC:	Arnd Bergmann <>,
	Linux Kernel Mailing List <>,
	Scott Wood <>,
	Stuart Yoder <>
Subject: Re: How do I choose an arbitrary minor number for my tty device?

Greg KH wrote:
> I think you are forgetting that your byte channel devices must be
> "devices" in the system here, right?  There is a 'struct bus_id" for
> your bus that these devices live on.

Do you mean "struct bus_type"?  I don't have any concept of a "bus" in my
driver.  I didn't know I needed to create one, and I'm not sure how, either.

I guess my real problem is that I'm not really sure what I should be doing.  I
already have a plain character driver that creates devices for each byte
channel.  First I call alloc_chrdev_region() to get a started dev_id.  Then I
iterate over the byte channels and call device_create() for each one, with NULL
for the parent.  At the end, I call cdev_init() and cdev_add().

Now I'm trying to register these byte channels as tty devices, because I'd like
to use them for the system console, and not just plain character devices.  My
plan was to just call tty_register_device() instead of device_create(), so I
don't understand where the "bus" comes in.  What bus?

>  Then you create a tty device in
> your tty driver that attaches to the byte channel that shows up as a tty
> device on your bus.

Are you saying that when I call tty_register_device(), the third parameter
should be the return value from the previous call to device_create(), like this:

bc->dev_id = MKDEV(MAJOR(dev_id), MINOR(dev_id) + i);
bc->dev = device_create(ehv_bc_class, NULL, bc->dev_id, bc, "bc%u", bc->handle);
tty_register_device(ehv_bc_driver, MINOR(bc->dev_id), bc->dev);

Timur Tabi
Linux kernel developer at Freescale

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists