Eric Miao wrote:I didn't read and understand all of your post. Nevertheless I dare to comment on these last 3 points here, because they don't fully match what we already have been dealing with for a long time now. For example, SCSI (including newer transport types over serial buses or networks) deals with target devices which have children called logical units. Logical units of the same target can have very different functionality (= implement different command sets) while there is still a dependency of the logical units on the target which provides them. Other example: USB presumably deals with multi-function devices with some inner structure and dependency too. (I don't know details.) Ditto FireWire: There are "nodes" on a bus, and each node can have 0..n "units". The units can implement various different protocols. During the presence of a node on the bus, units on it can come and go at any time. (Our drivers handle this in a simplified manner though.) The ieee1394 driver stack and its future replacement, the firewire stack, instantiate a struct device for each node, and a struct device for each unit. There are appropriate parent-child relationships between them. (Furthermore, node devices are children of the respective bus controller device.) All these devices have the same bus_type. The older ieee1394 core distinguishes between node devices and unit devices by means of different class devices. The newer, leaner firewire core distinguishes between them by means of different device_type. There are high-level drivers which are bound to unit devices, but not to node devices. These drivers have the necessary knowledge of the hierarchy though because their business with a unit device typically also involves some dealings with the parent and grandparent. (Types of the new stack: struct fw_device and struct fw_unit in drivers/firewire/fw-device.[hc], types of the old stack: struct node_entry and struct unit_directory in drivers/ieee1394/nodemgr.[hc]) Anyway; there are several approaches to multi-function devices possible. Wherever you go, the goal should be to keep it simple. (The ieee1394 stack is not a good example for this; the firewire stack is better in this regard.) It typically makes a lot of sense to create struct device based objects _not_ based on which boundaries the silicon draws, but which functionality is there. E.g. if you can operate the various functions of a hardware by means of separate drivers that don't interfere a lot with each other (a core layer may control such interferences), then separate struct device embedding objects for each functionality are a good idea. And you may not even have to resort to the term "virtual" when talking about devices or device types or bus types if you structure it all nicely and reasonably simple. -- Stefan Richter -=====-==--- =--- =-==- http://arcgraph.de/sr/ --
| Ian Campbell | Re: [PATCH] x86: Construct 32 bit boot time page tables in native format. |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Justin Piszcz | Linux Software RAID 5 Performance Optimizations: 2.6.19.1: (211MB/s read & 195... |
| Alan | Re: [RFC] Heads up on sys_fallocate() |
| Matthias Scheler | Re: HEADS UP: timecounters (branch simonb-timecounters) merged into -current |
| David Laight | long usernames |
| Quentin Garnier | Re: Understanding foo_open, foo_read, etc. |
| Jared D. McNeill | Breaking binary compatibility for /dev/joy |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| David Miller | [GIT]: Networking |
| Natalie Protasevich | [BUG] New Kernel Bugs |
