aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/dts/AWUSFREE1.dts
Commit message (Collapse)AuthorAgeFilesLines
* ramips: add support for ALFA Network AWUSFREE1Piotr Dymacz2018-02-221-0/+164
ALFA Network AWUSFREE1 is an USB Wi-Fi N300 adapter based on MT7628. Specification: - MT7628AN (580 MHz) - 64 MB of RAM (DDR2) - 8 MB of FLASH (SPI NOR) - 2T2R 2.4 GHz (MT7628) with external FEM (RFFM4203) - 2x detachable antennas (RP-SMA) - ASIX AX88772 USB to Ethernet bridge (connected with MT7628 PHY0) - 4x LED (2 driven by GPIO) - 1x button (reset) - 1x mini USB for host and main power input - UART header on PCB Flash instruction: You can use sysupgrade image directly in vendor firmware which is based on LEDE/OpenWrt. Alternatively, you can use web recovery mode in U-Boot: 1. Power device with reset button pressed and release it after ~5 sec. 2. Setup static IP 192.168.1.2/4 on your PC. 3. Go to 192.168.1.1 in browser and upload "sysupgrade" image. Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
id='n54' href='#n54'>54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
/*****************************************************************************
 *
 * Utility functions for Xen network devices.
 *
 * Copyright (c) 2005 XenSource Ltd.
 * 
 * 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; or, when distributed
 * separately from the Linux kernel or incorporated into other
 * software packages, subject to the following license:
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this source file (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use, copy, modify,
 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
 * and to permit persons to whom the Software is furnished to do so, subject
 * to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */

#include <linux/if_ether.h>
#include <linux/err.h>
#include <linux/module.h>
#include <xen/net_driver_util.h>


int xen_net_read_mac(struct xenbus_device *dev, u8 mac[])
{
	char *s;
	int i;
	char *e;
	char *macstr = xenbus_read(XBT_NULL, dev->nodename, "mac", NULL);
	if (IS_ERR(macstr))
		return PTR_ERR(macstr);
	s = macstr;
	for (i = 0; i < ETH_ALEN; i++) {
		mac[i] = simple_strtoul(s, &e, 16);
		if (s == e || (e[0] != ':' && e[0] != 0)) {
			kfree(macstr);
			return -ENOENT;
		}
		s = &e[1];
	}
	kfree(macstr);
	return 0;
}
EXPORT_SYMBOL_GPL(xen_net_read_mac);

/*
 * Local variables:
 *  c-file-style: "linux"
 *  indent-tabs-mode: t
 *  c-indent-level: 8
 *  c-basic-offset: 8
 *  tab-width: 8
 * End:
 */