tun.c (25bd55bbabd8957693c1ffc2fe1bf16cb4fdabd4) tun.c (7d82410950aa74adccf035c332e409af2bb93e92)
1/*
2 * TUN - Universal TUN/TAP device driver.
3 * Copyright (C) 1999-2002 Maxim Krasnyansky <maxk@qualcomm.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.

--- 194 unchanged lines hidden (view full) ---

203 unsigned int numdisabled;
204 struct list_head disabled;
205 void *security;
206 u32 flow_count;
207};
208
209static inline bool tun_is_little_endian(struct tun_struct *tun)
210{
1/*
2 * TUN - Universal TUN/TAP device driver.
3 * Copyright (C) 1999-2002 Maxim Krasnyansky <maxk@qualcomm.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.

--- 194 unchanged lines hidden (view full) ---

203 unsigned int numdisabled;
204 struct list_head disabled;
205 void *security;
206 u32 flow_count;
207};
208
209static inline bool tun_is_little_endian(struct tun_struct *tun)
210{
211 return tun->flags & TUN_VNET_LE;
211 return tun->flags & TUN_VNET_LE ||
212 virtio_legacy_is_little_endian();
212}
213
214static inline u16 tun16_to_cpu(struct tun_struct *tun, __virtio16 val)
215{
216 return __virtio16_to_cpu(tun_is_little_endian(tun), val);
217}
218
219static inline __virtio16 cpu_to_tun16(struct tun_struct *tun, u16 val)

--- 2149 unchanged lines hidden ---
213}
214
215static inline u16 tun16_to_cpu(struct tun_struct *tun, __virtio16 val)
216{
217 return __virtio16_to_cpu(tun_is_little_endian(tun), val);
218}
219
220static inline __virtio16 cpu_to_tun16(struct tun_struct *tun, u16 val)

--- 2149 unchanged lines hidden ---