search for: virtio_cread8

Displaying 20 results from an estimated 31 matches for "virtio_cread8".

Did you mean: virtio_cread
2015 Mar 31
2
[PATCH] virtio_config: reorder functions
...inux/virtio_config.h b/include/linux/virtio_config.h index ed1e0d5..1e306f7 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -298,13 +298,6 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val) } \ } while(0) -static inline u8 virtio_cread8(struct virtio_device *vdev, unsigned int offset) -{ - u8 ret; - vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; -} - /* Read @count fields, @bytes each. */ static inline void __virtio_cread_many(struct virtio_device *vdev, unsigned int offset, @@ -326,7 +31...
2015 Mar 31
2
[PATCH] virtio_config: reorder functions
...inux/virtio_config.h b/include/linux/virtio_config.h index ed1e0d5..1e306f7 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -298,13 +298,6 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val) } \ } while(0) -static inline u8 virtio_cread8(struct virtio_device *vdev, unsigned int offset) -{ - u8 ret; - vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; -} - /* Read @count fields, @bytes each. */ static inline void __virtio_cread_many(struct virtio_device *vdev, unsigned int offset, @@ -326,7 +31...
2015 Apr 08
0
[PATCH] virtio_config: reorder functions
...tio_config.h > index ed1e0d5..1e306f7 100644 > --- a/include/linux/virtio_config.h > +++ b/include/linux/virtio_config.h > @@ -298,13 +298,6 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val) > } \ > } while(0) > > -static inline u8 virtio_cread8(struct virtio_device *vdev, unsigned int offset) > -{ > - u8 ret; > - vdev->config->get(vdev, offset, &ret, sizeof(ret)); > - return ret; > -} > - > /* Read @count fields, @bytes each. */ > static inline void __virtio_cread_many(struct virtio_device *vdev, >...
2020 Aug 05
1
[PATCH v3 38/38] virtio_net: use LE accessors for speed/duplex
...re(vi->vdev, VIRTIO_NET_F_SPEED_DUPLEX)) return; - speed = virtio_cread32(vi->vdev, offsetof(struct virtio_net_config, - speed)); + virtio_cread_le(vi->vdev, struct virtio_net_config, speed, &speed); + if (ethtool_validate_speed(speed)) vi->speed = speed; - duplex = virtio_cread8(vi->vdev, offsetof(struct virtio_net_config, - duplex)); + + virtio_cread_le(vi->vdev, struct virtio_net_config, duplex, &duplex); + if (ethtool_validate_duplex(duplex)) vi->duplex = duplex; } diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h i...
2018 Jan 04
2
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...vi->status = v; + if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_SPEED_DUPLEX)) { + u32 speed; + u8 duplex; + + speed = virtio_cread32(vi->vdev, + offsetof(struct virtio_net_config, + speed)); + if (ethtool_validate_speed(speed)) + vi->speed = speed; + duplex = virtio_cread8(vi->vdev, + offsetof(struct virtio_net_config, + duplex)); + if (ethtool_validate_duplex(duplex)) + vi->duplex = duplex; + } + if (vi->status & VIRTIO_NET_S_LINK_UP) { netif_carrier_on(vi->dev); netif_tx_wake_all_queues(vi->dev); @@ -2796,7 +2812,8 @@ st...
2018 Jan 04
3
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...). > >> + u32 speed; >> + u8 duplex; >> + >> + speed = virtio_cread32(vi->vdev, >> + offsetof(struct virtio_net_config, >> + speed)); >> + if (ethtool_validate_speed(speed)) >> + vi->speed = speed; >> + duplex = virtio_cread8(vi->vdev, >> + offsetof(struct virtio_net_config, >> + duplex)); >> + if (ethtool_validate_duplex(duplex)) >> + vi->duplex = duplex; >> + } >> + >> if (vi->status & VIRTIO_NET_S_LINK_UP) { >> netif_carrier_on(vi-&gt...
2018 Jan 04
3
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...). > >> + u32 speed; >> + u8 duplex; >> + >> + speed = virtio_cread32(vi->vdev, >> + offsetof(struct virtio_net_config, >> + speed)); >> + if (ethtool_validate_speed(speed)) >> + vi->speed = speed; >> + duplex = virtio_cread8(vi->vdev, >> + offsetof(struct virtio_net_config, >> + duplex)); >> + if (ethtool_validate_duplex(duplex)) >> + vi->duplex = duplex; >> + } >> + >> if (vi->status & VIRTIO_NET_S_LINK_UP) { >> netif_carrier_on(vi-&gt...
2018 Jan 04
1
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...DUPLEX)) { >> + u32 speed; >> + u8 duplex; >> + >> + speed = virtio_cread32(vi->vdev, >> + offsetof(struct virtio_net_config, >> + speed)); >> + if (ethtool_validate_speed(speed)) >> + vi->speed = speed; >> + duplex = virtio_cread8(vi->vdev, >> + offsetof(struct virtio_net_config, >> + duplex)); >> + if (ethtool_validate_duplex(duplex)) >> + vi->duplex = duplex; >> + } >> + >> if (vi->status & VIRTIO_NET_S_LINK_UP) { >> netif_carrier_on(vi-&gt...
2018 Jan 04
1
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...DUPLEX)) { >> + u32 speed; >> + u8 duplex; >> + >> + speed = virtio_cread32(vi->vdev, >> + offsetof(struct virtio_net_config, >> + speed)); >> + if (ethtool_validate_speed(speed)) >> + vi->speed = speed; >> + duplex = virtio_cread8(vi->vdev, >> + offsetof(struct virtio_net_config, >> + duplex)); >> + if (ethtool_validate_duplex(duplex)) >> + vi->duplex = duplex; >> + } >> + >> if (vi->status & VIRTIO_NET_S_LINK_UP) { >> netif_carrier_on(vi-&gt...
2017 Dec 22
6
[PATCH 2/3] qemu: use 64-bit values for feature flags in virtio-net
In prepartion for using some of the high order feature bits, make sure that virtio-net uses 64-bit values everywhere. Signed-off-by: Jason Baron <jbaron at akamai.com> Cc: "Michael S. Tsirkin" <mst at redhat.com> Cc: Jason Wang <jasowang at redhat.com> --- hw/net/virtio-net.c | 54 +++++++++++++++++++++--------------------- include/hw/virtio/virtio-net.h |
2018 Jan 04
5
[PATCH v3 0/3] virtio_net: allow hypervisor to indicate linkspeed and duplex setting
We have found it useful to be able to set the linkspeed and duplex settings from the host-side for virtio_net. This obviates the need for guest changes and settings for these fields, and does not require custom ethtool commands for virtio_net. The ability to set linkspeed and duplex is useful in various cases as described here: 16032be virtio_net: add ethtool support for set and get of settings
2016 Apr 01
0
[patch] virtio: silence uninitialized variable warnings
...oracle.com> diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 6e6cb0c9..597dbef 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -334,7 +334,7 @@ static inline void virtio_cread_bytes(struct virtio_device *vdev, static inline u8 virtio_cread8(struct virtio_device *vdev, unsigned int offset) { - u8 ret; + u8 ret = 0; vdev->config->get(vdev, offset, &ret, sizeof(ret)); return ret; } @@ -348,7 +348,7 @@ static inline void virtio_cwrite8(struct virtio_device *vdev, static inline u16 virtio_cread16(struct virtio_device *vdev...
2020 Aug 05
0
[PATCH] virtio_net: use LE accessors for speed/duplex
...re(vi->vdev, VIRTIO_NET_F_SPEED_DUPLEX)) return; - speed = virtio_cread32(vi->vdev, offsetof(struct virtio_net_config, - speed)); + virtio_cread_le(vi->vdev, struct virtio_net_config, speed, &speed); + if (ethtool_validate_speed(speed)) vi->speed = speed; - duplex = virtio_cread8(vi->vdev, offsetof(struct virtio_net_config, - duplex)); + + virtio_cread_le(vi->vdev, struct virtio_net_config, duplex, &duplex); + if (ethtool_validate_duplex(duplex)) vi->duplex = duplex; } diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h i...
2016 Apr 01
0
[patch] virtio: silence uninitialized variable warnings
...oracle.com> diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 6e6cb0c9..597dbef 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -334,7 +334,7 @@ static inline void virtio_cread_bytes(struct virtio_device *vdev, static inline u8 virtio_cread8(struct virtio_device *vdev, unsigned int offset) { - u8 ret; + u8 ret = 0; vdev->config->get(vdev, offset, &ret, sizeof(ret)); return ret; } @@ -348,7 +348,7 @@ static inline void virtio_cwrite8(struct virtio_device *vdev, static inline u16 virtio_cread16(struct virtio_device *vdev...
2014 Dec 15
0
[PATCH 6/6] virtio: core support for config generation
..., unsigned offset, const void *buf, unsigned len); + u32 (*generation)(struct virtio_device *vdev); u8 (*get_status)(struct virtio_device *vdev); void (*set_status)(struct virtio_device *vdev, u8 status); void (*reset)(struct virtio_device *vdev); @@ -301,14 +305,33 @@ static inline u8 virtio_cread8(struct virtio_device *vdev, unsigned int offset) return ret; } +/* Read @count fields, @bytes each. */ +static inline void __virtio_cread_many(struct virtio_device *vdev, + unsigned int offset, + void *buf, size_t count, size_t bytes) +{ + u32 old, gen = vdev->config-&gt...
2014 Dec 15
0
[PATCH 6/6] virtio: core support for config generation
..., unsigned offset, const void *buf, unsigned len); + u32 (*generation)(struct virtio_device *vdev); u8 (*get_status)(struct virtio_device *vdev); void (*set_status)(struct virtio_device *vdev, u8 status); void (*reset)(struct virtio_device *vdev); @@ -301,14 +305,33 @@ static inline u8 virtio_cread8(struct virtio_device *vdev, unsigned int offset) return ret; } +/* Read @count fields, @bytes each. */ +static inline void __virtio_cread_many(struct virtio_device *vdev, + unsigned int offset, + void *buf, size_t count, size_t bytes) +{ + u32 old, gen = vdev->config-&gt...
2018 Jan 04
0
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...ure(vi->vdev, VIRTIO_NET_F_SPEED_DUPLEX)) { > + u32 speed; > + u8 duplex; > + > + speed = virtio_cread32(vi->vdev, > + offsetof(struct virtio_net_config, > + speed)); > + if (ethtool_validate_speed(speed)) > + vi->speed = speed; > + duplex = virtio_cread8(vi->vdev, > + offsetof(struct virtio_net_config, > + duplex)); > + if (ethtool_validate_duplex(duplex)) > + vi->duplex = duplex; > + } > + > if (vi->status & VIRTIO_NET_S_LINK_UP) { > netif_carrier_on(vi->dev); > netif_tx_wake_all...
2018 Jan 04
0
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...hen link goes down. Not a big deal but still. > + u32 speed; > + u8 duplex; > + > + speed = virtio_cread32(vi->vdev, > + offsetof(struct virtio_net_config, > + speed)); > + if (ethtool_validate_speed(speed)) > + vi->speed = speed; > + duplex = virtio_cread8(vi->vdev, > + offsetof(struct virtio_net_config, > + duplex)); > + if (ethtool_validate_duplex(duplex)) > + vi->duplex = duplex; > + } > + > if (vi->status & VIRTIO_NET_S_LINK_UP) { > netif_carrier_on(vi->dev); > netif_tx_wake_all...
2018 Jan 05
0
[PATCH net-next v4 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...struct virtnet_info *vi) +{ + u32 speed; + u8 duplex; + + if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_SPEED_DUPLEX)) + return; + + speed = virtio_cread32(vi->vdev, offsetof(struct virtio_net_config, + speed)); + if (ethtool_validate_speed(speed)) + vi->speed = speed; + duplex = virtio_cread8(vi->vdev, offsetof(struct virtio_net_config, + duplex)); + if (ethtool_validate_duplex(duplex)) + vi->duplex = duplex; +} + static const struct ethtool_ops virtnet_ethtool_ops = { .get_drvinfo = virtnet_get_drvinfo, .get_link = ethtool_op_get_link, @@ -2147,6 +2165,7 @@ static vo...
2018 Jan 04
0
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...gt;> + u8 duplex; > >> + > >> + speed = virtio_cread32(vi->vdev, > >> + offsetof(struct virtio_net_config, > >> + speed)); > >> + if (ethtool_validate_speed(speed)) > >> + vi->speed = speed; > >> + duplex = virtio_cread8(vi->vdev, > >> + offsetof(struct virtio_net_config, > >> + duplex)); > >> + if (ethtool_validate_duplex(duplex)) > >> + vi->duplex = duplex; > >> + } > >> + > >> if (vi->status & VIRTIO_NET_S_LINK_UP) {...