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 1/3] compat: backport hex_to_bin first introduced in v2.6.35
Date: Mon,  2 Aug 2010 00:02:49 +0200	[thread overview]
Message-ID: <1280700173-14690-2-git-send-email-kkhere.geo@gmail.com> (raw)
In-Reply-To: <4C55D22A.5040302@hauke-m.de>

Signed-off-by: Kshitij Kulshreshtha <kkhere.geo@gmail.com>
---
 compat/Makefile               |    1 +
 compat/compat-2.6.35.c        |   34 ++++++++++++++++++++++++++++++++++
 include/linux/compat-2.6.35.h |    2 ++
 3 files changed, 37 insertions(+), 0 deletions(-)
 create mode 100644 compat/compat-2.6.35.c

diff --git a/compat/Makefile b/compat/Makefile
index 2005ff3..bcd8fe7 100644
--- a/compat/Makefile
+++ b/compat/Makefile
@@ -26,3 +26,4 @@ compat-$(CONFIG_COMPAT_KERNEL_30) += compat-2.6.30.o
 compat-$(CONFIG_COMPAT_KERNEL_31) += compat-2.6.31.o
 compat-$(CONFIG_COMPAT_KERNEL_32) += compat-2.6.32.o
 compat-$(CONFIG_COMPAT_KERNEL_33) += compat-2.6.33.o
+compat-$(CONFIG_COMPAT_KERNEL_35) += compat-2.6.35.o
diff --git a/compat/compat-2.6.35.c b/compat/compat-2.6.35.c
new file mode 100644
index 0000000..0d702ed
--- /dev/null
+++ b/compat/compat-2.6.35.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2010    Kshitij Kulshreshtha <kkhere.geo@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Compatibility file for Linux wireless for kernels 2.6.35.
+ */
+
+#include <linux/compat.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+#include <linux/ctype.h>
+
+/**
+ * hex_to_bin - convert a hex digit to its real value
+ * @ch: ascii character represents hex digit
+ *
+ * hex_to_bin() converts one hex digit to its actual value or -1 in case of bad
+ * input.
+ */
+int hex_to_bin(char ch)
+{
+	if ((ch >= '0') && (ch <= '9'))
+		return ch - '0';
+	ch = tolower(ch);
+	if ((ch >= 'a') && (ch <= 'f'))
+		return ch - 'a' + 10;
+	return -1;
+}
+EXPORT_SYMBOL(hex_to_bin);
+
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) */
diff --git a/include/linux/compat-2.6.35.h b/include/linux/compat-2.6.35.h
index c6e7136..f0562cd 100644
--- a/include/linux/compat-2.6.35.h
+++ b/include/linux/compat-2.6.35.h
@@ -25,6 +25,8 @@ static inline wait_queue_head_t *sk_sleep(struct sock *sk)
 
 #define sdio_writeb_readb(func, write_byte, addr, err_ret) sdio_readb(func, addr, err_ret)
 
+int hex_to_bin(char ch);
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) */
 
 #endif /* LINUX_26_35_COMPAT_H */
-- 
1.7.1


  parent reply	other threads:[~2010-08-01 22:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-29 13:40 compat-wireless-2010-07-28.tar.bz2 fails to compile with 2.6.34.1 Kshitij Kulshreshtha
2010-08-01 19:59 ` Hauke Mehrtens
2010-08-01 22:02   ` [PATCH] build fixes for compat.git and compat-wireless.git Kshitij Kulshreshtha
2010-08-01 22:02   ` Kshitij Kulshreshtha [this message]
2010-08-01 22:02   ` [PATCH 2/3] compat: header <pcmcia/cs_types.h> was removed in v2.6.36 Kshitij Kulshreshtha
2010-08-01 22:02   ` [PATCH 3/3] compat: define struct va_format introduced " Kshitij Kulshreshtha
2010-08-02 18:00     ` Luis R. Rodriguez
2010-08-02 19:39       ` Kshitij Kulshreshtha
2010-08-02 19:48         ` Joe Perches
2010-08-02 19:54           ` Kshitij Kulshreshtha
2010-08-02 20:08             ` Joe Perches
2010-08-02 20:42               ` Luis R. Rodriguez
2010-08-01 22:02   ` [PATCH 4/5] compat-wireless: allow compilation of compat-2.6.35.c from compat Kshitij Kulshreshtha
2010-08-01 22:02   ` [PATCH 5/5] compat-wireless: copy headers in include/pcmcia " Kshitij Kulshreshtha

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=1280700173-14690-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).