Rusty Russell c45a6816c1 virtio: explicit advertisement of driver features
A recent proposed feature addition to the virtio block driver revealed
some flaws in the API: in particular, we assume that feature
negotiation is complete once a driver's probe function returns.

There is nothing in the API to require this, however, and even I
didn't notice when it was violated.

So instead, we require the driver to specify what features it supports
in a table, we can then move the feature negotiation into the virtio
core.  The intersection of device and driver features are presented in
a new 'features' bitmap in the struct virtio_device.

Note that this highlights the difference between Linux unsigned-long
bitmaps where each unsigned long is in native endian, and a
straight-forward little-endian array of bytes.

Drivers can still remove feature bits in their probe routine if they
really have to.

API changes:
- dev->config->feature() no longer gets and acks a feature.
- drivers should advertise their features in the 'feature_table' field
- use virtio_has_feature() for extra sanity when checking feature bits

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-05-02 21:50:50 +10:00
..
2008-04-29 08:06:27 -07:00
2008-04-29 13:46:54 -07:00
2008-04-30 08:29:47 -07:00
2008-05-01 08:03:59 -07:00
2008-04-29 08:06:18 -07:00
2008-05-01 11:15:28 -07:00
2008-05-01 08:04:00 -07:00
2008-05-01 08:04:01 -07:00
2008-04-23 21:25:35 -04:00
2008-04-30 08:29:47 -07:00
2008-04-24 23:57:33 +02:00
2008-04-30 08:29:52 -07:00
2008-04-30 08:29:52 -07:00