diff options
author | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2020-08-07 15:25:12 +0200 |
---|---|---|
committer | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2020-08-30 22:18:35 +0200 |
commit | 4e4ee4649553ab536225060a27fc320bf54e458c (patch) | |
tree | 711fbf5485f94baec8b708edba00c7250b923872 /target/linux/ar71xx/files/arch/mips/ath79/nvram.c | |
parent | 47b2ee2d9a9a1790f9bf8a528640c333af39e4ba (diff) | |
download | upstream-4e4ee4649553ab536225060a27fc320bf54e458c.tar.gz upstream-4e4ee4649553ab536225060a27fc320bf54e458c.tar.bz2 upstream-4e4ee4649553ab536225060a27fc320bf54e458c.zip |
ar71xx: drop target
This target has been mostly replaced by ath79 and won't be included
in the upcoming release anymore. Finally put it to rest.
This also removes all references in packages, tools, etc. as well as
the uboot-ar71xx and vsc73x5-ucode packages.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/ar71xx/files/arch/mips/ath79/nvram.c')
-rw-r--r-- | target/linux/ar71xx/files/arch/mips/ath79/nvram.c | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/nvram.c b/target/linux/ar71xx/files/arch/mips/ath79/nvram.c deleted file mode 100644 index a1de55fb19..0000000000 --- a/target/linux/ar71xx/files/arch/mips/ath79/nvram.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Atheros AR71xx minimal nvram support - * - * Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org> - * - * 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. - */ - -#include <linux/kernel.h> -#include <linux/vmalloc.h> -#include <linux/errno.h> -#include <linux/init.h> -#include <linux/string.h> -#include <linux/etherdevice.h> - -#include "nvram.h" - -char *ath79_nvram_find_var(const char *name, const char *buf, unsigned buf_len) -{ - unsigned len = strlen(name); - char *cur, *last; - - if (buf_len == 0 || len == 0) - return NULL; - - if (buf_len < len) - return NULL; - - if (len == 1) - return memchr(buf, (int) *name, buf_len); - - last = (char *) buf + buf_len - len; - for (cur = (char *) buf; cur <= last; cur++) - if (cur[0] == name[0] && memcmp(cur, name, len) == 0) - return cur + len; - - return NULL; -} - -int ath79_nvram_parse_mac_addr(const char *nvram, unsigned nvram_len, - const char *name, char *mac) -{ - char *buf; - char *mac_str; - int ret; - int t; - - buf = vmalloc(nvram_len); - if (!buf) - return -ENOMEM; - - memcpy(buf, nvram, nvram_len); - buf[nvram_len - 1] = '\0'; - - mac_str = ath79_nvram_find_var(name, buf, nvram_len); - if (!mac_str) { - ret = -EINVAL; - goto free; - } - - if (strlen(mac_str) == 19 && mac_str[0] == '"' && mac_str[18] == '"') { - mac_str[18] = 0; - mac_str++; - } - - t = sscanf(mac_str, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", - &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5]); - - if (t != ETH_ALEN) - t = sscanf(mac_str, "%02hhx-%02hhx-%02hhx-%02hhx-%02hhx-%02hhx", - &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5]); - - if (t != ETH_ALEN) { - ret = -EINVAL; - goto free; - } - - ret = 0; - -free: - vfree(buf); - return ret; -} |