Deleted Added
full compact
if_vtnet.c (234270) if_vtnet.c (238360)
1/*-
2 * Copyright (c) 2011, Bryan Venteicher <bryanv@daemoninthecloset.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27/* Driver for VirtIO network devices. */
28
29#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2011, Bryan Venteicher <bryanv@daemoninthecloset.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27/* Driver for VirtIO network devices. */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/dev/virtio/network/if_vtnet.c 234270 2012-04-14 05:48:04Z grehan $");
30__FBSDID("$FreeBSD: head/sys/dev/virtio/network/if_vtnet.c 238360 2012-07-11 02:57:19Z grehan $");
31
32#ifdef HAVE_KERNEL_OPTION_HEADERS
33#include "opt_device_polling.h"
34#endif
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/kernel.h>

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

743 offsetof(struct virtio_net_config, status));
744
745 return ((status & VIRTIO_NET_S_LINK_UP) != 0);
746}
747
748static void
749vtnet_update_link_status(struct vtnet_softc *sc)
750{
31
32#ifdef HAVE_KERNEL_OPTION_HEADERS
33#include "opt_device_polling.h"
34#endif
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/kernel.h>

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

743 offsetof(struct virtio_net_config, status));
744
745 return ((status & VIRTIO_NET_S_LINK_UP) != 0);
746}
747
748static void
749vtnet_update_link_status(struct vtnet_softc *sc)
750{
751 device_t dev;
752 struct ifnet *ifp;
753 int link;
754
751 struct ifnet *ifp;
752 int link;
753
755 dev = sc->vtnet_dev;
756 ifp = sc->vtnet_ifp;
757
758 link = vtnet_is_link_up(sc);
759
760 if (link && ((sc->vtnet_flags & VTNET_FLAG_LINK) == 0)) {
761 sc->vtnet_flags |= VTNET_FLAG_LINK;
762 if_link_state_change(ifp, LINK_STATE_UP);
763 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))

--- 1986 unchanged lines hidden ---
754 ifp = sc->vtnet_ifp;
755
756 link = vtnet_is_link_up(sc);
757
758 if (link && ((sc->vtnet_flags & VTNET_FLAG_LINK) == 0)) {
759 sc->vtnet_flags |= VTNET_FLAG_LINK;
760 if_link_state_change(ifp, LINK_STATE_UP);
761 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))

--- 1986 unchanged lines hidden ---