aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ray_cs.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andy.shevchenko@gmail.com>2010-07-22 23:18:09 -0400
committerDavid S. Miller <davem@davemloft.net>2010-07-23 15:50:51 -0400
commit882d829a23756dd827d8ed30000f73f1b035ad29 (patch)
tree642dbabc1fcdac8cbfc122bcefce82387bf0498b /drivers/net/wireless/ray_cs.c
parentfd1f170dfc9d432061540422ddc97058154d94b9 (diff)
wireless: use newly introduced hex_to_bin()
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Corey Thomas <coreythomas@charter.net> Cc: "John W. Linville" <linville@tuxdriver.com> Cc: linux-wireless@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/ray_cs.c')
-rw-r--r--drivers/net/wireless/ray_cs.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index abff8934db13..9c38fc331dca 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -97,7 +97,6 @@ static iw_stats *ray_get_wireless_stats(struct net_device *dev);
97static const struct iw_handler_def ray_handler_def; 97static const struct iw_handler_def ray_handler_def;
98 98
99/***** Prototypes for raylink functions **************************************/ 99/***** Prototypes for raylink functions **************************************/
100static int asc_to_int(char a);
101static void authenticate(ray_dev_t *local); 100static void authenticate(ray_dev_t *local);
102static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type); 101static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type);
103static void authenticate_timeout(u_long); 102static void authenticate_timeout(u_long);
@@ -1717,24 +1716,6 @@ static void authenticate_timeout(u_long data)
1717} 1716}
1718 1717
1719/*===========================================================================*/ 1718/*===========================================================================*/
1720static int asc_to_int(char a)
1721{
1722 if (a < '0')
1723 return -1;
1724 if (a <= '9')
1725 return (a - '0');
1726 if (a < 'A')
1727 return -1;
1728 if (a <= 'F')
1729 return (10 + a - 'A');
1730 if (a < 'a')
1731 return -1;
1732 if (a <= 'f')
1733 return (10 + a - 'a');
1734 return -1;
1735}
1736
1737/*===========================================================================*/
1738static int parse_addr(char *in_str, UCHAR *out) 1719static int parse_addr(char *in_str, UCHAR *out)
1739{ 1720{
1740 int len; 1721 int len;
@@ -1754,14 +1735,14 @@ static int parse_addr(char *in_str, UCHAR *out)
1754 i = 5; 1735 i = 5;
1755 1736
1756 while (j > 0) { 1737 while (j > 0) {
1757 if ((k = asc_to_int(in_str[j--])) != -1) 1738 if ((k = hex_to_bin(in_str[j--])) != -1)
1758 out[i] = k; 1739 out[i] = k;
1759 else 1740 else
1760 return 0; 1741 return 0;
1761 1742
1762 if (j == 0) 1743 if (j == 0)
1763 break; 1744 break;
1764 if ((k = asc_to_int(in_str[j--])) != -1) 1745 if ((k = hex_to_bin(in_str[j--])) != -1)
1765 out[i] += k << 4; 1746 out[i] += k << 4;
1766 else 1747 else
1767 return 0; 1748 return 0;