From: Felix Fietkau <nbd@openwrt.org>
To: linux-wireless <linux-wireless@vger.kernel.org>
Cc: "Luis R. Rodriguez" <lrodriguez@atheros.com>
Subject: [PATCH] compat: backport pm_qos_*_request
Date: Wed, 10 Nov 2010 23:46:49 +0100 [thread overview]
Message-ID: <4CDB20D9.603@openwrt.org> (raw)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
--- a/include/linux/compat-2.6.36.h
+++ b/include/linux/compat-2.6.36.h
@@ -8,6 +8,7 @@
#include <linux/usb.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
+#include <linux/pm_qos_params.h>
#define kparam_block_sysfs_write(a)
#define kparam_unblock_sysfs_write(a)
@@ -58,6 +59,39 @@ static inline int pcmcia_write_config_by
#define PCI_EEPROM_WIDTH_93C86 8
+struct pm_qos_request_list {
+ u32 qos;
+ void *request;
+};
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
+
+#define pm_qos_add_request(_req, _class, _value) do { \
+ (_req)->request = #_req; \
+ (_req)->qos = _class; \
+ pm_qos_add_requirement((_class), (_req)->request, (_value)); \
+ } while(0)
+
+#define pm_qos_update_request(_req, _value) \
+ pm_qos_update_requirement((_req)->qos, (_req)->request, (_value))
+
+#define pm_qos_remove_request(_req) \
+ pm_qos_remove_requirement((_req)->qos, (_req)->request)
+
+#else
+
+#define pm_qos_add_request(_req, _class, _value) do { \
+ (_req)->request = pm_qos_add_request((_class), (_value)); \
+ } while (0)
+
+#define pm_qos_update_request(_req, _value) \
+ pm_qos_update_request((_req)->request, (_value)
+
+#define pm_qos_remove_request(_req) \
+ pm_qos_remove_request((_req)->request)
+
+#endif
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) */
#endif /* LINUX_26_36_COMPAT_H */
next reply other threads:[~2010-11-10 22:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-10 22:46 Felix Fietkau [this message]
2010-11-10 22:50 ` [PATCH] compat: backport pm_qos_*_request Luis R. Rodriguez
2010-11-10 22:52 ` Luis R. Rodriguez
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=4CDB20D9.603@openwrt.org \
--to=nbd@openwrt.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lrodriguez@atheros.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).