mirror of https://github.com/hak5/openwrt-owl.git
Remove some configuration files, workarounds are now in the ethernet driver, thanks sn9
SVN-Revision: 13062owl
parent
8128c624bc
commit
412a26cd00
|
@ -1,19 +0,0 @@
|
||||||
# Copyright (C) 2008 OpenWrt.org
|
|
||||||
|
|
||||||
config interface loopback
|
|
||||||
option ifname lo
|
|
||||||
option proto static
|
|
||||||
option ipaddr 127.0.0.1
|
|
||||||
option netmask 255.0.0.0
|
|
||||||
|
|
||||||
config interface lan
|
|
||||||
option ifname eth1
|
|
||||||
option type bridge
|
|
||||||
option proto static
|
|
||||||
option ipaddr 192.168.1.1
|
|
||||||
option netmask 255.255.255.0
|
|
||||||
|
|
||||||
config interface wan
|
|
||||||
option ifname eth0
|
|
||||||
option proto dhcp
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
::sysinit:/etc/init.d/rcS S boot
|
|
||||||
::shutdown:/etc/init.d/rcS K stop
|
|
||||||
tts/0::askfirst:/bin/ash --login
|
|
||||||
ttyS0::askfirst:/bin/ash --login
|
|
||||||
ttyS1::askfirst:/bin/ash --login
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Copyright (C) 2008 OpenWrt.org
|
||||||
|
|
||||||
|
ash -c ". /etc/functions.sh
|
||||||
|
hdr=\$(find_mtd_part productinfo)
|
||||||
|
[ \$(find_mtd_part productinfo_parthdr) ] || rev=reverse
|
||||||
|
[ \"\$hdr\" ] && mac=\$(hexdump -n 6 -e '6/1 \",0x%X\"' \$hdr |cut -c2-)
|
||||||
|
[ \"\$mac\" = \"0x0,0x0,0x0,0x0,0x0,0x0\" ] && unset mac
|
||||||
|
[ \"\$mac\" ] && insmod r6040 \$rev mac_base=\$mac"
|
|
@ -242,14 +242,21 @@ struct r6040_private {
|
||||||
void __iomem *base;
|
void __iomem *base;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct net_device *parent_dev;
|
|
||||||
static char *parent = "wlan0";
|
static char *parent = "wlan0";
|
||||||
module_param(parent, charp, 0444);
|
module_param(parent, charp, 0444);
|
||||||
MODULE_PARM_DESC(parent, "Parent network device name to get the MAC address from");
|
MODULE_PARM_DESC(parent, "Parent network device name to get the MAC address from");
|
||||||
|
|
||||||
static char version[] __devinitdata = KERN_INFO DRV_NAME
|
static u8 mac_base[ETH_ALEN] = {0,0x50,0xfc,2,3,4};
|
||||||
|
module_param_array(mac_base, byte, NULL, 0444);
|
||||||
|
MODULE_PARM_DESC(mac_base, "Starting MAC address");
|
||||||
|
|
||||||
|
static int reverse = 1;
|
||||||
|
module_param(reverse, invbool, 0444);
|
||||||
|
MODULE_PARM_DESC(reverse, "Reverse card indices");
|
||||||
|
|
||||||
|
static char version[] __devinitdata = DRV_NAME
|
||||||
": RDC R6040 NAPI net driver,"
|
": RDC R6040 NAPI net driver,"
|
||||||
"version "DRV_VERSION " (" DRV_RELDATE ")\n";
|
"version "DRV_VERSION " (" DRV_RELDATE ")";
|
||||||
|
|
||||||
static int phy_table[] = { PHY1_ADDR, PHY2_ADDR };
|
static int phy_table[] = { PHY1_ADDR, PHY2_ADDR };
|
||||||
|
|
||||||
|
@ -1226,12 +1233,11 @@ static struct ethtool_ops netdev_ethtool_ops = {
|
||||||
int __devinit r6040_init_one(struct pci_dev *pdev,
|
int __devinit r6040_init_one(struct pci_dev *pdev,
|
||||||
const struct pci_device_id *ent)
|
const struct pci_device_id *ent)
|
||||||
{
|
{
|
||||||
struct net_device *dev;
|
struct net_device *dev, *parent_dev;
|
||||||
struct r6040_private *lp;
|
struct r6040_private *lp;
|
||||||
void __iomem *ioaddr;
|
void __iomem *ioaddr;
|
||||||
int err, io_size = R6040_IO_SIZE;
|
int err, io_size = R6040_IO_SIZE;
|
||||||
static int card_idx = -1;
|
static int card_idx = -1;
|
||||||
int bar = 0;
|
|
||||||
long pioaddr;
|
long pioaddr;
|
||||||
|
|
||||||
printk(KERN_INFO "%s\n", version);
|
printk(KERN_INFO "%s\n", version);
|
||||||
|
@ -1276,7 +1282,7 @@ int __devinit r6040_init_one(struct pci_dev *pdev,
|
||||||
goto err_out_disable;
|
goto err_out_disable;
|
||||||
}
|
}
|
||||||
|
|
||||||
ioaddr = pci_iomap(pdev, bar, io_size);
|
ioaddr = pci_iomap(pdev, 0, io_size);
|
||||||
if (!ioaddr) {
|
if (!ioaddr) {
|
||||||
printk(KERN_ERR "ioremap failed for device %s\n",
|
printk(KERN_ERR "ioremap failed for device %s\n",
|
||||||
pci_name(pdev));
|
pci_name(pdev));
|
||||||
|
@ -1313,21 +1319,18 @@ int __devinit r6040_init_one(struct pci_dev *pdev,
|
||||||
dev->tx_timeout = &r6040_tx_timeout;
|
dev->tx_timeout = &r6040_tx_timeout;
|
||||||
dev->watchdog_timeo = TX_TIMEOUT;
|
dev->watchdog_timeo = TX_TIMEOUT;
|
||||||
|
|
||||||
{
|
/*
|
||||||
/* TODO: fix the setting of the MAC address.
|
You must specify a netdevice with a "parent=" parameter, whose address
|
||||||
Right now you must either specify a netdevice with "parent=", whose
|
is copied, or an array of bytes comprising a literal address; otherwise
|
||||||
address is copied or the (default) address of the Sitecom WL-153
|
the (default) address of the Sitecom WL-153 bootloader is used.
|
||||||
bootloader is used */
|
*/
|
||||||
static const u8 dflt_addr[ETH_ALEN] = {0,0x50,0xfc,2,3,4};
|
memcpy(dev->dev_addr, mac_base, ETH_ALEN);
|
||||||
if (parent_dev) {
|
if (parent) {
|
||||||
|
parent_dev = __dev_get_by_name(&init_net, parent);
|
||||||
|
if (parent_dev)
|
||||||
memcpy(dev->dev_addr, parent_dev->dev_addr, ETH_ALEN);
|
memcpy(dev->dev_addr, parent_dev->dev_addr, ETH_ALEN);
|
||||||
} else {
|
|
||||||
printk(KERN_WARNING "%s: no parent - using default mac address\n",
|
|
||||||
dev->name);
|
|
||||||
memcpy(dev->dev_addr, dflt_addr, ETH_ALEN);
|
|
||||||
}
|
|
||||||
dev->dev_addr[ETH_ALEN-1] += card_idx ^ 1; /* + 0 or 1 */
|
|
||||||
}
|
}
|
||||||
|
dev->dev_addr[ETH_ALEN-1] += card_idx ^ reverse; /* + 0 or 1 */
|
||||||
|
|
||||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||||
dev->poll_controller = r6040_poll_controller;
|
dev->poll_controller = r6040_poll_controller;
|
||||||
|
@ -1340,6 +1343,14 @@ int __devinit r6040_init_one(struct pci_dev *pdev,
|
||||||
lp->mii_if.phy_id_mask = 0x1f;
|
lp->mii_if.phy_id_mask = 0x1f;
|
||||||
lp->mii_if.reg_num_mask = 0x1f;
|
lp->mii_if.reg_num_mask = 0x1f;
|
||||||
|
|
||||||
|
if (reverse && ((card_idx & 1) == 0) && (dev_alloc_name(dev, dev->name)
|
||||||
|
>= 0))
|
||||||
|
for (err = strlen(dev->name); err; err--) {
|
||||||
|
if (dev->name[err - 1]++ != '9')
|
||||||
|
break;
|
||||||
|
dev->name[err - 1] = '0';
|
||||||
|
}
|
||||||
|
|
||||||
/* Register net device. After this dev->name assign */
|
/* Register net device. After this dev->name assign */
|
||||||
err = register_netdev(dev);
|
err = register_netdev(dev);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -1388,9 +1399,6 @@ static struct pci_driver r6040_driver = {
|
||||||
|
|
||||||
static int __init r6040_init(void)
|
static int __init r6040_init(void)
|
||||||
{
|
{
|
||||||
if (parent)
|
|
||||||
parent_dev = dev_get_by_name(&init_net, parent);
|
|
||||||
|
|
||||||
return pci_register_driver(&r6040_driver);
|
return pci_register_driver(&r6040_driver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue