Source
x
wake_up_interruptible_poll(sk_sleep(&q->sk), EPOLLIN | EPOLLRDNORM | EPOLLRDBAND);
static inline bool tap_legacy_is_little_endian(struct tap_queue *q)
{
return q->flags & TAP_VNET_BE ? false :
virtio_legacy_is_little_endian();
}
static long tap_get_vnet_be(struct tap_queue *q, int __user *sp)
{
int s = !!(q->flags & TAP_VNET_BE);
if (put_user(s, sp))
return -EFAULT;
return 0;
}
static long tap_set_vnet_be(struct tap_queue *q, int __user *sp)
{
int s;
if (get_user(s, sp))
return -EFAULT;
if (s)
q->flags |= TAP_VNET_BE;
else
q->flags &= ~TAP_VNET_BE;
return 0;
}
static inline bool tap_legacy_is_little_endian(struct tap_queue *q)
{
return virtio_legacy_is_little_endian();
}
static long tap_get_vnet_be(struct tap_queue *q, int __user *argp)
{
return -EINVAL;
}
static long tap_set_vnet_be(struct tap_queue *q, int __user *argp)
{
return -EINVAL;
}
/* CONFIG_TUN_VNET_CROSS_LE */
static inline bool tap_is_little_endian(struct tap_queue *q)
{
return q->flags & TAP_VNET_LE ||
tap_legacy_is_little_endian(q);
}
static inline u16 tap16_to_cpu(struct tap_queue *q, __virtio16 val)
{
return __virtio16_to_cpu(tap_is_little_endian(q), val);
}
static inline __virtio16 cpu_to_tap16(struct tap_queue *q, u16 val)
{
return __cpu_to_virtio16(tap_is_little_endian(q), val);