Re: More leaves on the device tree ?
- From: Alfred Perlstein <alfred@xxxxxxxxxxx>
- Date: Sun, 23 Dec 2007 01:29:41 -0800
I think we're getting a little off track of the TODO items
for the inclusion of the usb code.
I think the original post mentions that devinfo(?) works for
the time being, although perhaps some work later on presentation
could be done.
Let's stick with devinfo and hit up the next tasks on the
inclusion list.
I think the next thing is the SMP locking? Or do you have
anything you have in mind from the list you would like to
tackle next?
thank you,
-Alfred
* Hans Petter Selasky <hselasky@xxxxxxx> [071223 00:42] wrote:
On Sunday 23 December 2007, Poul-Henning Kamp wrote:
In message <20071222.234526.246317277.imp@xxxxxxxxxx>, "M. Warner Losh"writes:
In message: <200712202005.33263.hselasky@xxxxxxx>
Hans Petter Selasky <hselasky@xxxxxxx> writes:
: "make_dev" takes an additional "device_t parent_device" argument and
: creates a child device with some magic flags set.
What do you do for all the devices in /dev/ for which there is no
device_t parent?
Hi,
If the parent is NULL, then no dev_t node is created.
Regarding cloned devices my opinion is that they should always create a
visible entry. What I have done for a while now is to create a dummy dev_t
node. It is so annoying with invisible devices. Then you never know what you
have got. For example "/dev/usbXXX".
What I do is simply to create "/dev/usb0 " with a space in the end. This file
is not openable. Really there sould be a flag for that. Then you
open "/dev/usb0" instead, but this device is never created. That's the clone
device. Then clones appear like "/dev/usb0.XX":
/dev/usb0 % /dev/usb1 % /dev/usb2 % /dev/usb3 %
/dev/usb0.00% /dev/usb1.00% /dev/usb2.00% /dev/usb3.00%
I second Warners comments here.
device_t is a handle for a hardware, dev_t is for a device in /dev,
they are very different thing and have no reasonable mapping between
them ([0..N]:[0..M])
I'm not saying that every make_dev() should take a device_t parent. If there
is no "device_t" parent then there will be no node created.
Another approach is to add something like:
void device_enlist_subdev(device_t parent, dev_t sub);
void device_delist_subdev(device_t parent, dev_t sub);
struct device {
...
LIST_HEAD(struct cdev) dv_cdev_children;
...
};
struct cdev {
LIST_ENTRY( .... ) dv_list;
};
For example if you have 8 USB serial port adapters, then you just get 8 TTY
devices like /dev/cuaUXXX . And finding out where the USB devices are
actually connected could be very simple if we could put some hints perhaps in
the device_t tree ?
--HPS
--
- Alfred Perlstein
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: More leaves on the device tree ?
- From: Hans Petter Selasky
- Re: More leaves on the device tree ?
- References:
- Re: More leaves on the device tree ?
- From: Poul-Henning Kamp
- Re: More leaves on the device tree ?
- From: Hans Petter Selasky
- Re: More leaves on the device tree ?
- Prev by Date: Re: More leaves on the device tree ?
- Next by Date: Re: More leaves on the device tree ?
- Previous by thread: Re: More leaves on the device tree ?
- Next by thread: Re: More leaves on the device tree ?
- Index(es):
Relevant Pages
|
|