Backports Archive on lore.kernel.org
 help / color / Atom feed
From: Hauke Mehrtens <hauke@hauke-m.de>
To: backports@vger.kernel.org
Cc: johannes@sipsolutions.net, Hauke Mehrtens <hauke@hauke-m.de>
Subject: [PATCH 6/9] backports: virtio_config: Add virtio_find_vqs()
Date: Tue, 21 Apr 2020 00:16:12 +0200
Message-ID: <20200420221615.14734-7-hauke@hauke-m.de> (raw)
In-Reply-To: <20200420221615.14734-1-hauke@hauke-m.de>

The virtio_find_vqs() function is now used by the mac80211_hwsim driver.
This is just a wrapper around the find_vqs callback. The find_vqs
callback changed over the time.
With kernel 4.10 the names parameter was changed from "const char
*names[]" to "const char * const names[]".
With kernel 4.11 the "struct irq_affinity *desc" was added. We have to
define struct irq_affinity here for older kernel versions, because it
is used in this new parameter in kernel >= 4.12 this is already done in
the upstream header file.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 .../backport-include/linux/virtio_config.h    | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 backport/backport-include/linux/virtio_config.h

diff --git a/backport/backport-include/linux/virtio_config.h b/backport/backport-include/linux/virtio_config.h
new file mode 100644
index 00000000..aeb1ba10
--- /dev/null
+++ b/backport/backport-include/linux/virtio_config.h
@@ -0,0 +1,31 @@
+#ifndef _COMPAT_LINUX_VIRTIO_CONFIG_H
+#define _COMPAT_LINUX_VIRTIO_CONFIG_H
+#include_next <linux/virtio_config.h>
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(4,11,0)
+struct irq_affinity;
+#endif
+
+#if LINUX_VERSION_IS_LESS(4,12,0)
+static inline
+int virtio_find_vqs(struct virtio_device *vdev, unsigned nvqs,
+			struct virtqueue *vqs[], vq_callback_t *callbacks[],
+#if LINUX_VERSION_IS_LESS(4,10,0)
+			const char * const names[],
+#else
+			const char *names[],
+#endif
+			struct irq_affinity *desc)
+{
+#if LINUX_VERSION_IS_LESS(4,11,0)
+	return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names);
+#else
+	return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, desc);
+#endif
+}
+#endif /* < 4.12 */
+
+
+#endif	/* _COMPAT_LINUX_VIRTIO_CONFIG_H */
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

  parent reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-20 22:16 [PATCH 0/9] backports: Update to version 5.7-rc2 Hauke Mehrtens
2020-04-20 22:16 ` [PATCH 1/9] backports: Refresh patches on kernel 5.7-rc2 Hauke Mehrtens
2020-04-20 22:16 ` [PATCH 2/9] backports: pm_qos: Add cpu_latency_qos_* functions Hauke Mehrtens
2020-04-20 22:16 ` [PATCH 3/9] backports: genetlink: Add genlmsg_parse() Hauke Mehrtens
2020-04-20 22:16 ` [PATCH 4/9] backports: rculist: Add additional parameter to list_for_each_entry_rcu() Hauke Mehrtens
2020-04-20 22:16 ` [PATCH 5/9] backports: Add include/uapi/linux/virtio_ids.h Hauke Mehrtens
2020-04-20 22:16 ` Hauke Mehrtens [this message]
2020-04-20 22:16 ` [PATCH 7/9] backports: patches: avoid struct spi_delay usage Hauke Mehrtens
2020-04-20 22:16 ` [PATCH 8/9] backports: patches: Avoid struct ethtool_ops.supported_coalesce_params Hauke Mehrtens
2020-04-20 22:16 ` [PATCH 9/9] backports: netdevice: Add netif_is_bridge_port() Hauke Mehrtens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200420221615.14734-7-hauke@hauke-m.de \
    --to=hauke@hauke-m.de \
    --cc=backports@vger.kernel.org \
    --cc=johannes@sipsolutions.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Backports Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/backports/0 backports/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 backports backports/ https://lore.kernel.org/backports \
		backports@vger.kernel.org
	public-inbox-index backports

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.backports


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git