summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2011-12-06 06:28:32 +0000
committergrehan <grehan@FreeBSD.org>2011-12-06 06:28:32 +0000
commit8c9f6bae53fac4f5558a5a8f10f71486e50701ce (patch)
treeb8fc4729dc76f73a94a04abddf35b86d98118a8c /sys/dev
parent9c8a75d791cffa7aac7d2db7d46ce7711b31494f (diff)
downloadFreeBSD-src-8c9f6bae53fac4f5558a5a8f10f71486e50701ce.zip
FreeBSD-src-8c9f6bae53fac4f5558a5a8f10f71486e50701ce.tar.gz
Catch up with Bryan Venteicher's virtio Hg repo:
c162516 Remove vtblk_sector_size c162515 Wrap long license lines c162514 Remove vtblk_unit c162513 Wrap long lines in the license. c162512 Remove verbose messages when link goes up/down. A similar message is printed elsewhere as a result of if_link_state_change(). c162511 Explicity compare pointer to NULL c162510 Allocate the mac filter table at attach time. c162509 Add real BSD licenses to the header files copied from Linux. The chases upstream changes made in Linux awhile ago. c162508 Only notify if we actually dequeued something. c162507 Change a couple of if () { KASSERT(...) } to just KASSERTs. In non-debug kernels, the if() { } probably get optomized away, but I guess this is clearer. c162506 Remove VIRTIO_BLK_F_TOPOLOGY fields in the config. TOPOLOGY has since been removed from the spec, and the FreeBSD didn't really do anything with the fields anyways. c162505 Move vtblk_enqueue_request() outside the locks when getting the ident. c162504 Remove soon to be uneeded trylock during dump [1]. http://lists.freebsd.org/pipermail/freebsd-current/2011-November/029226.html c162503 Remove emtpy line c162502 Drop frame if cannot allocate a vtnet_tx_header. If we don't, we set OACTIVE, but if there are no other frames in flight, vtnet_txeof() will never be called to unset OACTIVE. The interface would have to be down/up'ed in order to become usable. We could be cuter here and only do this if the virtqueue is emtpy, but its probably not worth the complication. c162501 Start mbuf replacement loop at 1 for clarity Obtained from: Bryan Venteicher bryanv at daemoninthecloset dot org
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/virtio/balloon/virtio_balloon.c1
-rw-r--r--sys/dev/virtio/balloon/virtio_balloon.h25
-rw-r--r--sys/dev/virtio/block/virtio_blk.c29
-rw-r--r--sys/dev/virtio/block/virtio_blk.h35
-rw-r--r--sys/dev/virtio/network/if_vtnet.c75
-rw-r--r--sys/dev/virtio/network/if_vtnetvar.h1
-rw-r--r--sys/dev/virtio/network/virtio_net.h25
-rw-r--r--sys/dev/virtio/pci/virtio_pci.h25
-rw-r--r--sys/dev/virtio/virtio.h25
-rw-r--r--sys/dev/virtio/virtio_ring.h34
10 files changed, 196 insertions, 79 deletions
diff --git a/sys/dev/virtio/balloon/virtio_balloon.c b/sys/dev/virtio/balloon/virtio_balloon.c
index ef7aca9..61ae4b1 100644
--- a/sys/dev/virtio/balloon/virtio_balloon.c
+++ b/sys/dev/virtio/balloon/virtio_balloon.c
@@ -475,7 +475,6 @@ vtballoon_update_size(struct vtballoon_softc *sc)
virtio_write_dev_config_4(sc->vtballoon_dev,
offsetof(struct virtio_balloon_config, actual),
htole32(sc->vtballoon_current_npages));
-
}
static int
diff --git a/sys/dev/virtio/balloon/virtio_balloon.h b/sys/dev/virtio/balloon/virtio_balloon.h
index cea84ba..1a52733 100644
--- a/sys/dev/virtio/balloon/virtio_balloon.h
+++ b/sys/dev/virtio/balloon/virtio_balloon.h
@@ -1,7 +1,30 @@
-/*
+/*-
* This header is BSD licensed so anyone can use the definitions to implement
* compatible drivers/servers.
*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of IBM nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
* $FreeBSD$
*/
diff --git a/sys/dev/virtio/block/virtio_blk.c b/sys/dev/virtio/block/virtio_blk.c
index 09783a8..dca19ba 100644
--- a/sys/dev/virtio/block/virtio_blk.c
+++ b/sys/dev/virtio/block/virtio_blk.c
@@ -87,9 +87,7 @@ struct vtblk_softc {
struct taskqueue *vtblk_tq;
struct task vtblk_intr_task;
- int vtblk_sector_size;
int vtblk_max_nsegs;
- int vtblk_unit;
int vtblk_request_count;
struct vtblk_request vtblk_dump_request;
@@ -185,7 +183,6 @@ TUNABLE_INT("hw.vtblk.no_ident", &vtblk_no_ident);
mtx_init(VTBLK_MTX((_sc)), (_name), \
"VTBLK Lock", MTX_DEF)
#define VTBLK_LOCK(_sc) mtx_lock(VTBLK_MTX((_sc)))
-#define VTBLK_TRYLOCK(_sc) mtx_trylock(VTBLK_MTX((_sc)))
#define VTBLK_UNLOCK(_sc) mtx_unlock(VTBLK_MTX((_sc)))
#define VTBLK_LOCK_DESTROY(_sc) mtx_destroy(VTBLK_MTX((_sc)))
#define VTBLK_LOCK_ASSERT(_sc) mtx_assert(VTBLK_MTX((_sc)), MA_OWNED)
@@ -281,7 +278,6 @@ vtblk_attach(device_t dev)
sc = device_get_softc(dev);
sc->vtblk_dev = dev;
- sc->vtblk_unit = device_get_unit(dev);
VTBLK_LOCK_INIT(sc, device_get_nameunit(dev));
@@ -299,13 +295,8 @@ vtblk_attach(device_t dev)
sc->vtblk_flags |= VTBLK_FLAG_READONLY;
/* Get local copy of config. */
- if (virtio_with_feature(dev, VIRTIO_BLK_F_TOPOLOGY) == 0) {
- bzero(&blkcfg, sizeof(struct virtio_blk_config));
- virtio_read_device_config(dev, 0, &blkcfg,
- offsetof(struct virtio_blk_config, physical_block_exp));
- } else
- virtio_read_device_config(dev, 0, &blkcfg,
- sizeof(struct virtio_blk_config));
+ virtio_read_device_config(dev, 0, &blkcfg,
+ sizeof(struct virtio_blk_config));
/*
* With the current sglist(9) implementation, it is not easy
@@ -498,12 +489,6 @@ vtblk_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset,
if ((sc = dp->d_drv1) == NULL)
return (ENXIO);
- if (VTBLK_TRYLOCK(sc) == 0) {
- device_printf(sc->vtblk_dev,
- "softc already locked, cannot dump...\n");
- return (EBUSY);
- }
-
if ((sc->vtblk_flags & VTBLK_FLAG_DUMPING) == 0) {
vtblk_prepare_dump(sc);
sc->vtblk_flags |= VTBLK_FLAG_DUMPING;
@@ -622,7 +607,7 @@ vtblk_alloc_disk(struct vtblk_softc *sc, struct virtio_blk_config *blkcfg)
dp->d_ioctl = vtblk_ioctl;
dp->d_strategy = vtblk_strategy;
dp->d_name = VTBLK_DISK_NAME;
- dp->d_unit = sc->vtblk_unit;
+ dp->d_unit = device_get_unit(dev);
dp->d_drv1 = sc;
if ((sc->vtblk_flags & VTBLK_FLAG_READONLY) == 0)
@@ -632,10 +617,9 @@ vtblk_alloc_disk(struct vtblk_softc *sc, struct virtio_blk_config *blkcfg)
dp->d_mediasize = blkcfg->capacity * 512;
if (virtio_with_feature(dev, VIRTIO_BLK_F_BLK_SIZE))
- sc->vtblk_sector_size = blkcfg->blk_size;
+ dp->d_sectorsize = blkcfg->blk_size;
else
- sc->vtblk_sector_size = 512;
- dp->d_sectorsize = sc->vtblk_sector_size;
+ dp->d_sectorsize = 512;
/*
* The VirtIO maximum I/O size is given in terms of segments.
@@ -905,9 +889,10 @@ vtblk_get_ident(struct vtblk_softc *sc)
VTBLK_LOCK(sc);
error = vtblk_poll_request(sc, req);
- vtblk_enqueue_request(sc, req);
VTBLK_UNLOCK(sc);
+ vtblk_enqueue_request(sc, req);
+
if (error) {
device_printf(sc->vtblk_dev,
"error getting device identifier: %d\n", error);
diff --git a/sys/dev/virtio/block/virtio_blk.h b/sys/dev/virtio/block/virtio_blk.h
index 4fb32e0..f26c649 100644
--- a/sys/dev/virtio/block/virtio_blk.h
+++ b/sys/dev/virtio/block/virtio_blk.h
@@ -1,7 +1,30 @@
-/*
+/*-
* This header is BSD licensed so anyone can use the definitions to implement
* compatible drivers/servers.
*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of IBM nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
* $FreeBSD$
*/
@@ -39,16 +62,6 @@ struct virtio_blk_config {
/* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */
uint32_t blk_size;
-
- /* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY */
- /* exponent for physical block per logical block. */
- uint8_t physical_block_exp;
- /* alignment offset in logical blocks. */
- uint8_t alignment_offset;
- /* minimum I/O size without performance penalty in logical blocks. */
- uint16_t min_io_size;
- /* optimal sustained I/O size in logical blocks. */
- uint32_t opt_io_size;
} __packed;
/*
diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c
index 22becb1..ca57aec 100644
--- a/sys/dev/virtio/network/if_vtnet.c
+++ b/sys/dev/virtio/network/if_vtnet.c
@@ -317,8 +317,20 @@ vtnet_attach(device_t dev)
if (virtio_with_feature(dev, VIRTIO_NET_F_CTRL_VQ)) {
sc->vtnet_flags |= VTNET_FLAG_CTRL_VQ;
- if (virtio_with_feature(dev, VIRTIO_NET_F_CTRL_RX))
+ if (virtio_with_feature(dev, VIRTIO_NET_F_CTRL_RX)) {
+ sc->vtnet_mac_filter = malloc(
+ sizeof(struct vtnet_mac_filter), M_DEVBUF,
+ M_NOWAIT | M_ZERO);
+ if (sc->vtnet_mac_filter == NULL) {
+ device_printf(dev,
+ "cannot allocate mac filter table\n");
+ error = ENOMEM;
+ goto fail;
+ }
+
sc->vtnet_flags |= VTNET_FLAG_CTRL_RX;
+ }
+
if (virtio_with_feature(dev, VIRTIO_NET_F_CTRL_VLAN))
sc->vtnet_flags |= VTNET_FLAG_VLAN_FILTER;
}
@@ -505,7 +517,12 @@ vtnet_detach(device_t dev)
sc->vtnet_vlan_detach = NULL;
}
- if (ifp) {
+ if (sc->vtnet_mac_filter != NULL) {
+ free(sc->vtnet_mac_filter, M_DEVBUF);
+ sc->vtnet_mac_filter = NULL;
+ }
+
+ if (ifp != NULL) {
if_free(ifp);
sc->vtnet_ifp = NULL;
}
@@ -742,17 +759,11 @@ vtnet_update_link_status(struct vtnet_softc *sc)
if (link && ((sc->vtnet_flags & VTNET_FLAG_LINK) == 0)) {
sc->vtnet_flags |= VTNET_FLAG_LINK;
- if (bootverbose)
- device_printf(dev, "Link is up\n");
-
if_link_state_change(ifp, LINK_STATE_UP);
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
vtnet_start_locked(ifp);
} else if (!link && (sc->vtnet_flags & VTNET_FLAG_LINK)) {
sc->vtnet_flags &= ~VTNET_FLAG_LINK;
- if (bootverbose)
- device_printf(dev, "Link is down\n");
-
if_link_state_change(ifp, LINK_STATE_DOWN);
}
}
@@ -1105,7 +1116,7 @@ vtnet_alloc_rxbuf(struct vtnet_softc *sc, int nbufs, struct mbuf **m_tailp)
KASSERT(sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG,
("chained Rx mbuf requested without LRO_NOMRG"));
- for (i = 0; i < nbufs - 1; i++) {
+ for (i = 1; i < nbufs; i++) {
m = m_getjcl(M_DONTWAIT, MT_DATA, 0, clsize);
if (m == NULL)
goto fail;
@@ -1143,9 +1154,8 @@ vtnet_replace_rxbuf(struct vtnet_softc *sc, struct mbuf *m0, int len0)
clsize = sc->vtnet_rx_mbuf_size;
nreplace = 0;
- if (m->m_next != NULL)
- KASSERT(sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG,
- ("chained Rx mbuf without LRO_NOMRG"));
+ KASSERT(sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG ||
+ m->m_next == NULL, ("chained Rx mbuf without LRO_NOMRG"));
/*
* Since LRO_NOMRG mbuf chains are so large, we want to avoid
@@ -1275,8 +1285,8 @@ vtnet_enqueue_rxbuf(struct vtnet_softc *sc, struct mbuf *m)
int offset, error;
VTNET_LOCK_ASSERT(sc);
- if ((sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG) == 0)
- KASSERT(m->m_next == NULL, ("chained Rx mbuf"));
+ KASSERT(sc->vtnet_flags & VTNET_FLAG_LRO_NOMRG ||
+ m->m_next == NULL, ("chained Rx mbuf without LRO_NOMRG"));
sglist_init(&sg, VTNET_MAX_RX_SEGS, segs);
@@ -1688,7 +1698,8 @@ vtnet_rxeof(struct vtnet_softc *sc, int count, int *rx_npktsp)
break;
}
- virtqueue_notify(vq);
+ if (deq > 0)
+ virtqueue_notify(vq);
if (rx_npktsp != NULL)
*rx_npktsp = rx_npkts;
@@ -1946,9 +1957,14 @@ vtnet_encap(struct vtnet_softc *sc, struct mbuf **m_head)
struct mbuf *m;
int error;
+ m = *m_head;
+
txhdr = uma_zalloc(vtnet_tx_header_zone, M_NOWAIT | M_ZERO);
- if (txhdr == NULL)
+ if (txhdr == NULL) {
+ *m_head = NULL;
+ m_freem(m);
return (ENOMEM);
+ }
/*
* Always use the non-mergeable header to simplify things. When
@@ -1957,21 +1973,22 @@ vtnet_encap(struct vtnet_softc *sc, struct mbuf **m_head)
* the correct header size to the host.
*/
hdr = &txhdr->vth_uhdr.hdr;
- m = *m_head;
-
- error = ENOBUFS;
if (m->m_flags & M_VLANTAG) {
m = ether_vlanencap(m, m->m_pkthdr.ether_vtag);
- if ((*m_head = m) == NULL)
+ if ((*m_head = m) == NULL) {
+ error = ENOBUFS;
goto fail;
+ }
m->m_flags &= ~M_VLANTAG;
}
if (m->m_pkthdr.csum_flags != 0) {
m = vtnet_tx_offload(sc, m, hdr);
- if ((*m_head = m) == NULL)
+ if ((*m_head = m) == NULL) {
+ error = ENOBUFS;
goto fail;
+ }
}
error = vtnet_enqueue_txbuf(sc, m_head, txhdr);
@@ -2387,6 +2404,7 @@ vtnet_rx_filter_mac(struct vtnet_softc *sc)
uint8_t ack;
ifp = sc->vtnet_ifp;
+ filter = sc->vtnet_mac_filter;
ucnt = 0;
mcnt = 0;
promisc = 0;
@@ -2397,19 +2415,6 @@ vtnet_rx_filter_mac(struct vtnet_softc *sc)
KASSERT(sc->vtnet_flags & VTNET_FLAG_CTRL_RX,
("CTRL_RX feature not negotiated"));
- /*
- * Allocate the MAC filtering table. Note we could do this
- * at attach time, but it is probably not worth keeping it
- * around for an infrequent occurrence.
- */
- filter = malloc(sizeof(struct vtnet_mac_filter), M_DEVBUF,
- M_NOWAIT | M_ZERO);
- if (filter == NULL) {
- device_printf(sc->vtnet_dev,
- "cannot allocate MAC address filtering table\n");
- return;
- }
-
/* Unicast MAC addresses: */
if_addr_rlock(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
@@ -2481,8 +2486,6 @@ vtnet_rx_filter_mac(struct vtnet_softc *sc)
if_printf(ifp, "error setting host MAC filter table\n");
out:
- free(filter, M_DEVBUF);
-
if (promisc)
if (vtnet_set_promisc(sc, 1) != 0)
if_printf(ifp, "cannot enable promiscuous mode\n");
diff --git a/sys/dev/virtio/network/if_vtnetvar.h b/sys/dev/virtio/network/if_vtnetvar.h
index 613b2b0..184870e 100644
--- a/sys/dev/virtio/network/if_vtnetvar.h
+++ b/sys/dev/virtio/network/if_vtnetvar.h
@@ -99,6 +99,7 @@ struct vtnet_softc {
#define VTNET_MEDIATYPE (IFM_ETHER | IFM_1000_T | IFM_FDX)
char vtnet_hwaddr[ETHER_ADDR_LEN];
+ struct vtnet_mac_filter *vtnet_mac_filter;
/*
* During reset, the host's VLAN filtering table is lost. The
* array below is used to restore all the VLANs configured on
diff --git a/sys/dev/virtio/network/virtio_net.h b/sys/dev/virtio/network/virtio_net.h
index 7361aa1..058f29f 100644
--- a/sys/dev/virtio/network/virtio_net.h
+++ b/sys/dev/virtio/network/virtio_net.h
@@ -1,7 +1,30 @@
-/*
+/*-
* This header is BSD licensed so anyone can use the definitions to implement
* compatible drivers/servers.
*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of IBM nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
* $FreeBSD$
*/
diff --git a/sys/dev/virtio/pci/virtio_pci.h b/sys/dev/virtio/pci/virtio_pci.h
index 6ebfdd5..d8daa31 100644
--- a/sys/dev/virtio/pci/virtio_pci.h
+++ b/sys/dev/virtio/pci/virtio_pci.h
@@ -1,4 +1,4 @@
-/*
+/*-
* Copyright IBM Corp. 2007
*
* Authors:
@@ -7,6 +7,29 @@
* This header is BSD licensed so anyone can use the definitions to implement
* compatible drivers/servers.
*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of IBM nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
* $FreeBSD$
*/
diff --git a/sys/dev/virtio/virtio.h b/sys/dev/virtio/virtio.h
index ebd3c74..00d2d5f 100644
--- a/sys/dev/virtio/virtio.h
+++ b/sys/dev/virtio/virtio.h
@@ -1,7 +1,30 @@
-/*
+/*-
* This header is BSD licensed so anyone can use the definitions to implement
* compatible drivers/servers.
*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of IBM nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
* $FreeBSD$
*/
diff --git a/sys/dev/virtio/virtio_ring.h b/sys/dev/virtio/virtio_ring.h
index 124cb4d..b0ab946 100644
--- a/sys/dev/virtio/virtio_ring.h
+++ b/sys/dev/virtio/virtio_ring.h
@@ -1,10 +1,34 @@
-/*
- * This header is BSD licensed so anyone can use the definitions
- * to implement compatible drivers/servers.
- *
+/*-
* Copyright Rusty Russell IBM Corporation 2007.
+ *
+ * This header is BSD licensed so anyone can use the definitions to implement
+ * compatible drivers/servers.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of IBM nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
*/
-/* $FreeBSD$ */
#ifndef VIRTIO_RING_H
#define VIRTIO_RING_H
OpenPOWER on IntegriCloud