Opened 13 years ago

Closed 13 years ago

#295 closed enhancement (fixed)

DDF should support multifunction devices

Reported by: Jiri Svoboda Owned by: Jiri Svoboda
Priority: major Milestone: 0.4.3
Component: helenos/srv/devman Version:
Keywords: Cc: vojtech.horky@…
Blocker for: Depends on:
See also:

Description

Often a single hardware device provides multiple logical functions. Examples: i8042 (two character functions), ata_bd (two block functions), partition driver (if included in DDF).

Currently the DDF assumes a 1-1 relationship between devices and functions (for leaf devices). In order to support multifunction devices, one would have to make a pair of drivers (or a double-driver), namely a nexus driver and a leaf driver. Here the leaf driver would act only as a transparent proxy, resending all commands to the parent nexus.

Since this is a common pattern that would complicate multifunction device drivers, it would be better to support leaf devices with multiple functions directly (compare minor device nodes in UN*X).

Change History (4)

comment:1 by Jiri Svoboda, 13 years ago

Owner: set to Jiri Svoboda
Status: newaccepted

I am working on this (see lp:~jsvoboda/helenos/ddf).

My plan is to split node of the device tree into a device node and a function node. Each device, be it inner or leaf device, will be able to have any number of functions. Each function will be either internal (to DDF) which means devman will attach a child device to it and attempt to find a driver for it, or the function will be external in which case it will be exposed to external clients via devmap/devfs.

A nexus (bus) driver will have mostly internal functions (to which child devices will attach), possibly some special external function to control the bus as such. A leaf driver will only have external functions.

comment:2 by Vojtech Horky, 13 years ago

Cc: vojtech.horky@… added

comment:3 by Jiri Svoboda, 13 years ago

I now have a working implementation in lp:~jsvoboda/helenos/ddf. I still don't like the API so much so I'll probably fiddle with it some more before merging this. Plus I'd like to rename the functions, giving them proper prefixes to fit our naming conventions better.

Last but not least, the drivers need some clean up too. They are now using a pointer to a device or function for context. It would be better to use a pointer to the soft-state structure. Also, the soft-state structures should have the shortest names, due to their importance. For example, the soft state structure for a PCI bus should have the type pci_bus_t, not pci_bus_data_t; the soft-state structure for a ns8250 device should have the type ns8250_t, not ns8250_dev_data_t.

comment:4 by Jiri Svoboda, 13 years ago

Milestone: 0.5.0
Resolution: fixed
Status: acceptedclosed

Available in changeset:mainline,857. This changeset also merges refactoring of the DDF API and of the drivers themselves.

Note: See TracTickets for help on using tickets.