| Index: chromeos/drivers/ath6kl/os/linux/eeprom.c
|
| diff --git a/chromeos/drivers/ath6kl/os/linux/eeprom.c b/chromeos/drivers/ath6kl/os/linux/eeprom.c
|
| index 1c182751a93904e50d3da0f2582ecfdf87a06dcb..be77fb87ebf53b8698dc025d93dd8e47837f4834 100644
|
| --- a/chromeos/drivers/ath6kl/os/linux/eeprom.c
|
| +++ b/chromeos/drivers/ath6kl/os/linux/eeprom.c
|
| @@ -1,21 +1,25 @@
|
| -/*
|
| - *
|
| - * Copyright (c) 2004-2009 Atheros Communications Inc.
|
| - * All rights reserved.
|
| - *
|
| - *
|
| -// 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;
|
| +//------------------------------------------------------------------------------
|
| +// Copyright (c) 2004-2010 Atheros Communications Inc.
|
| +// All rights reserved.
|
| //
|
| -// Software distributed under the License is distributed on an "AS
|
| -// IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
| -// implied. See the License for the specific language governing
|
| -// rights and limitations under the License.
|
| +//
|
| //
|
| +// Permission to use, copy, modify, and/or distribute this software for any
|
| +// purpose with or without fee is hereby granted, provided that the above
|
| +// copyright notice and this permission notice appear in all copies.
|
| //
|
| - *
|
| - */
|
| +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
| +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
| +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
| +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| +//
|
| +//
|
| +//
|
| +// Author(s): ="Atheros"
|
| +//------------------------------------------------------------------------------
|
|
|
|
|
| #include "ar6000_drv.h"
|
| @@ -67,24 +71,22 @@ wmic_ether_aton(const char *orig, A_UINT8 *eth)
|
| i = 0;
|
| for(bufp = orig; *bufp != '\0'; ++bufp) {
|
| unsigned int val;
|
| - unsigned char c = *bufp++;
|
| - if (c >= '0' && c <= '9') val = c - '0';
|
| - else if (c >= 'a' && c <= 'f') val = c - 'a' + 10;
|
| - else if (c >= 'A' && c <= 'F') val = c - 'A' + 10;
|
| - else {
|
| - printk("%s: MAC value is invalid\n", __FUNCTION__);
|
| - break;
|
| - }
|
| + int h, l;
|
|
|
| - val <<= 4;
|
| - c = *bufp++;
|
| - if (c >= '0' && c <= '9') val |= c - '0';
|
| - else if (c >= 'a' && c <= 'f') val |= c - 'a' + 10;
|
| - else if (c >= 'A' && c <= 'F') val |= c - 'A' + 10;
|
| - else {
|
| - printk("%s: MAC value is invalid\n", __FUNCTION__);
|
| - break;
|
| - }
|
| + h = hex_to_bin(*bufp++);
|
| +
|
| + if (h < 0) {
|
| + printk("%s: MAC value is invalid\n", __FUNCTION__);
|
| + break;
|
| + }
|
| +
|
| + l = hex_to_bin(*bufp++);
|
| + if (l < 0) {
|
| + printk("%s: MAC value is invalid\n", __FUNCTION__);
|
| + break;
|
| + }
|
| +
|
| + val = (h << 4) | l;
|
|
|
| eth[i] = (unsigned char) (val & 0377);
|
| if(++i == ATH_MAC_LEN) {
|
| @@ -398,12 +400,7 @@ void eeprom_ar6000_transfer(HIF_DEVICE *device, char *fake_file, char *p_mac)
|
| return;
|
| }
|
|
|
| -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
|
| - inode = filp->f_path.dentry->d_inode;
|
| -#else
|
| - inode = filp->f_dentry->d_inode;
|
| -#endif
|
| -
|
| + inode = GET_INODE_FROM_FILEP(filep);
|
| if (!inode) {
|
| printk("%s: Get inode from filp failed\n", __FUNCTION__);
|
| filp_close(filp, NULL);
|
| @@ -482,11 +479,7 @@ void eeprom_ar6000_transfer(HIF_DEVICE *device, char *fake_file, char *p_mac)
|
| return;
|
| }
|
|
|
| -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
|
| - inode = filp->f_path.dentry->d_inode;
|
| -#else
|
| - inode = filp->f_dentry->d_inode;
|
| -#endif
|
| + inode = GET_INODE_FROM_FILEP(filep);
|
| if (!inode) {
|
| printk("%s: Get inode from filp failed\n", __FUNCTION__);
|
| filp_close(filp, NULL);
|
|
|