Jeff Garzik wrote:
> I don't think that 'card_idx' is a good way to associate an interface to
> an instance of a PCI driver however... A driver is well within its
> rights to export more than one interface to the world, for example a
> complex block device driver might export a character device for control
> purposes, so you don't even have a one-one correspondence between PCI
> driver instances and interfaces...
The old CardBus interface was set up so that a driver's attach() entry
point returned a linked list of device descriptors, of the form:
struct dev_node_t {
char dev_name[DEV_NAME_LEN];
u_short major, minor;
struct dev_node_t *next;
}
and this information was bounced out to user space. Drivers would not
return every major/minor instance; they would return more or less one
per physical device, and let user space construct the rest. A dual
network interface would return two dev_node_t structures; a hard drive
with N partitions would return one structure with the minor # for the
whole device; a multiport serial card would return the major/minor for
each callout device; etc. Apart from implementation details like
kdev_t versus major/minor #'s, this might be a useful model.
-- Dave Hinds
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:19 EST