Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
virtio_config.h File Reference
#include <linux/err.h>
#include <linux/bug.h>
#include <linux/virtio.h>
#include <uapi/linux/virtio_config.h>

Go to the source code of this file.

Data Structures

struct  virtio_config_ops
 

Macros

#define virtio_config_val(vdev, fbit, offset, v)   virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(*v))
 
#define virtio_config_val_len(vdev, fbit, offset, v, len)   virtio_config_buf((vdev), (fbit), (offset), (v), (len))
 

Typedefs

typedef void vq_callback_t (struct virtqueue *)
 

Functions

void virtio_check_driver_offered_feature (const struct virtio_device *vdev, unsigned int fbit)
 

Macro Definition Documentation

#define virtio_config_val (   vdev,
  fbit,
  offset,
  v 
)    virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(*v))

virtio_config_val - look for a feature and get a virtio config entry. : the virtio device : the feature bit : the type to search for. : a pointer to the value to fill in.

The return value is -ENOENT if the feature doesn't exist. Otherwise the config value is copied into whatever is pointed to by v.

Definition at line 108 of file virtio_config.h.

#define virtio_config_val_len (   vdev,
  fbit,
  offset,
  v,
  len 
)    virtio_config_buf((vdev), (fbit), (offset), (v), (len))

Definition at line 111 of file virtio_config.h.

Typedef Documentation

typedef void vq_callback_t(struct virtqueue *)

virtio_config_ops - operations for configuring a virtio device : read the value of a configuration field vdev: the virtio_device offset: the offset of the configuration field buf: the buffer to write the field value into. len: the length of the buffer : write the value of a configuration field vdev: the virtio_device offset: the offset of the configuration field buf: the buffer to read the field value from. len: the length of the buffer : read the status byte vdev: the virtio_device Returns the status byte : write the status byte vdev: the virtio_device status: the new status byte : reset the device vdev: the virtio device After this, status and feature negotiation must be done again Device must not be reset from its vq/config callbacks, or in parallel with being added/removed. : find virtqueues and instantiate them. vdev: the virtio_device nvqs: the number of virtqueues to find vqs: on success, includes new virtqueues callbacks: array of callbacks, for each virtqueue include a NULL entry for vqs that do not need a callback names: array of virtqueue names (mainly for debugging) include a NULL entry for vqs unused by driver Returns 0 on success or error status : free virtqueues found by find_vqs(). : get the array of feature bits for this device. vdev: the virtio_device Returns the first 32 feature bits (all we currently need). : confirm what device features we'll be using. vdev: the virtio_device This gives the final feature bits for the device: it can change the dev->feature bits if it wants. : return the bus name associated with the device vdev: the virtio_device This returns a pointer to the bus name a la pci_name from which the caller can then copy. : set the affinity for a virtqueue.

Definition at line 55 of file virtio_config.h.

Function Documentation

void virtio_check_driver_offered_feature ( const struct virtio_device vdev,
unsigned int  fbit 
)

Definition at line 97 of file virtio.c.