linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kshitij Kulshreshtha <kkhere.geo@gmail.com>
To: "Luis R. Rodriguez" <lrodriguez@atheros.com>,
	Hauke Mehrtens <hauke@hauke-m.de>
Cc: linux-wireless@vger.kernel.org,
	Kshitij Kulshreshtha <kkhere.geo@gmail.com>
Subject: [PATCH] compat: backport pcmcia_{read,write}_config byte from v2.6.36
Date: Wed,  4 Aug 2010 16:18:35 +0200	[thread overview]
Message-ID: <1280931516-29665-2-git-send-email-kkhere.geo@gmail.com> (raw)
In-Reply-To: <1280931516-29665-1-git-send-email-kkhere.geo@gmail.com>

Signed-off-by: Kshitij Kulshreshtha <kkhere.geo@gmail.com>
---
 include/pcmcia/ds.h |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)
 create mode 100644 include/pcmcia/ds.h

diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
new file mode 100644
index 0000000..fc43703
--- /dev/null
+++ b/include/pcmcia/ds.h
@@ -0,0 +1,36 @@
+#ifndef _COMPAT_PCMCIA_DS_H
+#define _COMPAT_PCMCIA_DS_H
+#include <linux/version.h>
+
+#include_next <pcmcia/ds.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+/**
+ * pcmcia_read_config_byte() - read a byte from a card configuration register
+ *
+ * pcmcia_read_config_byte() reads a byte from a configuration register in
+ * attribute memory.
+ */
+static inline int pcmcia_read_config_byte(struct pcmcia_device *p_dev, off_t where, u8 *val)
+{
+        int ret;
+        conf_reg_t reg = { 0, CS_READ, where, 0 };
+        ret = pcmcia_access_configuration_register(p_dev, &reg);
+        *val = reg.Value;
+        return ret;
+}
+
+/**
+ * pcmcia_write_config_byte() - write a byte to a card configuration register
+ *
+ * pcmcia_write_config_byte() writes a byte to a configuration register in
+ * attribute memory.
+ */
+static inline int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t where, u8 val)
+{
+	conf_reg_t reg = { 0, CS_WRITE, where, val };
+	return pcmcia_access_configuration_register(p_dev, &reg);
+}
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) */
+
+#endif
-- 
1.7.1


  reply	other threads:[~2010-08-04 14:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-04 14:18 [PATCH] build fixes for compat-wireless due to PCMCIA changes Kshitij Kulshreshtha
2010-08-04 14:18 ` Kshitij Kulshreshtha [this message]
2010-08-04 14:18 ` [PATCH] compat-wireless: more PCMCIA backporting Kshitij Kulshreshtha
2010-08-05 18:27 ` [PATCH] build fixes for compat-wireless due to PCMCIA changes 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=1280931516-29665-2-git-send-email-kkhere.geo@gmail.com \
    --to=kkhere.geo@gmail.com \
    --cc=hauke@hauke-m.de \
    --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).