Commit 9eb76e9f authored by Anton Blanchard's avatar Anton Blanchard

Merge samba.org:/scratch/anton/linux-2.5

into samba.org:/scratch/anton/tmp3
parents e16687d5 23dabca3
......@@ -492,16 +492,16 @@ config MIPS_GT96100ETH
help
Say Y here to support the Ethernet subsystem on your GT96100 card.
config MIPS_AU1000_ENET
config MIPS_AU1X00_ENET
bool "MIPS AU1000 Ethernet support"
depends on NET_ETHERNET && MIPS_AU1000
depends on NET_ETHERNET && SOC_AU1X00
help
If you have an Alchemy Semi AU1000 ethernet controller
on an SGI MIPS system, say Y. Otherwise, say N.
If you have an Alchemy Semi AU1X00 based system
say Y. Otherwise, say N.
config NET_SB1250_MAC
tristate "SB1250 Ethernet support"
depends on NET_ETHERNET && SIBYTE_SB1250
depends on NET_ETHERNET && SIBYTE_SB1xxx_SOC
config SGI_IOC3_ETH
bool "SGI IOC3 Ethernet"
......@@ -511,6 +511,10 @@ config SGI_IOC3_ETH
the Ethernet-HOWTO, available from
<http://www.tldp.org/docs.html#howto>.
config SGI_O2MACE_ETH
tristate "SGI O2 MACE Fast Ethernet support"
depends on NET_ETHERNET && SGI_IP32=y
config STNIC
tristate "National DP83902AV support"
depends on NET_ETHERNET && SUPERH
......@@ -1391,6 +1395,10 @@ config CS89x0
<file:Documentation/networking/net-modules.txt>. The module will be
called cs89x.
config TC35815
tristate "TOSHIBA TC35815 Ethernet support"
depends on NET_PCI && PCI
config DGRS
tristate "Digi Intl. RightSwitch SE-X support"
depends on NET_PCI && (PCI || EISA)
......@@ -1839,14 +1847,14 @@ config DE620
The module will be called de620.
config SGISEEQ
bool "SGI Seeq ethernet controller support"
tristate "SGI Seeq ethernet controller support"
depends on NET_ETHERNET && SGI_IP22
help
Say Y here if you have an Seeq based Ethernet network card. This is
used in many Silicon Graphics machines.
config DECLANCE
bool "DEC LANCE ethernet controller support"
tristate "DEC LANCE ethernet controller support"
depends on NET_ETHERNET && DECSTATION
help
This driver is for the series of Ethernet controllers produced by
......
......@@ -117,6 +117,7 @@ obj-$(CONFIG_SUN3_82586) += sun3_82586.o
obj-$(CONFIG_SUN3LANCE) += sun3lance.o
obj-$(CONFIG_DEFXX) += defxx.o
obj-$(CONFIG_SGISEEQ) += sgiseeq.o
obj-$(CONFIG_SGI_O2MACE_ETH) += meth.o
obj-$(CONFIG_AT1700) += at1700.o
obj-$(CONFIG_FMV18X) += fmv18x.o
obj-$(CONFIG_EL1) += 3c501.o
......@@ -156,7 +157,7 @@ obj-$(CONFIG_MVME147_NET) += mvme147.o 7990.o
obj-$(CONFIG_EQUALIZER) += eql.o
obj-$(CONFIG_MIPS_JAZZ_SONIC) += jazzsonic.o
obj-$(CONFIG_MIPS_GT96100ETH) += gt96100eth.o
obj-$(CONFIG_MIPS_AU1000_ENET) += au1000_eth.o
obj-$(CONFIG_MIPS_AU1X00_ENET) += au1000_eth.o
obj-$(CONFIG_SGI_IOC3_ETH) += ioc3-eth.o
obj-$(CONFIG_BAGETLANCE) += bagetlance.o
obj-$(CONFIG_DECLANCE) += declance.o
......
......@@ -24,6 +24,7 @@ obj-$(CONFIG_PCMCIA_FMVJ18X) += crc32.o
obj-$(CONFIG_PCMCIA_SMC91C92) += crc32.o
obj-$(CONFIG_PCMCIA_XIRTULIP) += crc32.o
obj-$(CONFIG_PCNET32) += crc32.o
obj-$(CONFIG_SGI_IOC3_ETH) += crc32.o
obj-$(CONFIG_SIS900) += crc32.o
obj-$(CONFIG_SMC9194) += crc32.o
obj-$(CONFIG_ADAPTEC_STARFIRE) += crc32.o
......
......@@ -82,7 +82,6 @@ extern int sonic_probe(struct net_device *);
extern int SK_init(struct net_device *);
extern int seeq8005_probe(struct net_device *);
extern int smc_init( struct net_device * );
extern int sgiseeq_probe(struct net_device *);
extern int atarilance_probe(struct net_device *);
extern int sun3lance_probe(struct net_device *);
extern int sun3_82586_probe(struct net_device *);
......@@ -343,14 +342,6 @@ static struct devprobe m68k_probes[] __initdata = {
{NULL, 0},
};
static struct devprobe sgi_probes[] __initdata = {
#ifdef CONFIG_SGISEEQ
{sgiseeq_probe, 0},
#endif
{NULL, 0},
};
static struct devprobe mips_probes[] __initdata = {
#ifdef CONFIG_MIPS_JAZZ_SONIC
{sonic_probe, 0},
......@@ -385,8 +376,6 @@ static int __init ethif_probe(struct net_device *dev)
return 0;
if (probe_list(dev, mips_probes) == 0)
return 0;
if (probe_list(dev, sgi_probes) == 0)
return 0;
if (probe_list(dev, eisa_probes) == 0)
return 0;
if (probe_list(dev, mca_probes) == 0)
......
......@@ -3026,9 +3026,6 @@ static int ace_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
return 0;
case ETHTOOL_SSET:
if(!capable(CAP_NET_ADMIN))
return -EPERM;
link = readl(&regs->GigLnkState);
if (link & LNK_1000MB)
speed = SPEED_1000;
......
/*
*
* Alchemy Semi Au1000 ethernet driver
*
* Copyright 2001 MontaVista Software Inc.
* Author: MontaVista Software, Inc.
* ppopov@mvista.com or source@mvista.com
*
* ########################################################################
*
* This program is free software; you can distribute it and/or modify it
* under the terms of the GNU General Public License (Version 2) as
* published by the Free Software Foundation.
......@@ -20,16 +17,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
* ########################################################################
*
*
*/
#ifndef __mips__
#error This driver only works with MIPS architectures!
#endif
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
......@@ -125,7 +114,7 @@ static struct {
},
au1100_iflist[NUM_INTERFACES] = {
{AU1000_ETH0_BASE, AU1000_ETH0_IRQ},
{NULL, NULL}
{0, 0}
};
static char version[] __devinitdata =
......@@ -152,13 +141,6 @@ static unsigned char au1000_mac_addr[6] __devinitdata = {
* code.
*/
static char *phy_link[] =
{"unknown",
"10Base2", "10BaseT",
"AUI",
"100BaseT", "100BaseTX", "100BaseFX"
};
int bcm_5201_init(struct net_device *dev, int phy_addr)
{
s16 data;
......@@ -184,6 +166,11 @@ int bcm_5201_init(struct net_device *dev, int phy_addr)
data &= ~MII_FDX_LED;
mdio_write(dev, phy_addr, MII_INT, data);
/* Enable TX LED instead of FDX */
data = mdio_read(dev, phy_addr, MII_INT);
data &= ~MII_FDX_LED;
mdio_write(dev, phy_addr, MII_INT, data);
if (au1000_debug > 4) dump_mii(dev, phy_addr);
return 0;
}
......@@ -640,7 +627,7 @@ static int __init au1000_init_module(void)
int prid;
int base_addr, irq;
prid = read_32bit_cp0_register(CP0_PRID);
prid = read_c0_prid();
for (i=0; i<NUM_INTERFACES; i++) {
if ( (prid & 0xffff0000) == 0x00030000 ) {
base_addr = au1000_iflist[i].port;
......@@ -657,11 +644,11 @@ static int __init au1000_init_module(void)
}
// check for valid entries, au1100 only has one entry
if (base_addr && irq) {
if (au1000_probe1(NULL, base_addr, irq, i) != 0) {
return -ENODEV;
if (au1000_probe1(NULL, base_addr, irq, i) != 0) {
return -ENODEV;
}
}
}
}
return 0;
}
......@@ -675,10 +662,11 @@ au1000_probe1(struct net_device *dev, long ioaddr, int irq, int port_num)
char *pmac, *argptr;
char ethaddr[6];
if (!request_region(ioaddr, MAC_IOSIZE, "Au1000 ENET"))
if (!request_region(PHYSADDR(ioaddr), MAC_IOSIZE, "Au1000 ENET"))
return -ENODEV;
if (version_printed++ == 0) printk(version);
if (version_printed++ == 0)
printk(version);
if (!dev)
dev = init_etherdev(NULL, sizeof(struct au1000_private));
......@@ -690,7 +678,7 @@ au1000_probe1(struct net_device *dev, long ioaddr, int irq, int port_num)
}
printk("%s: Au1xxx ethernet found at 0x%lx, irq %d\n",
dev->name, ioaddr, irq);
dev->name, ioaddr, irq);
aup = dev->priv;
......@@ -816,7 +804,7 @@ au1000_probe1(struct net_device *dev, long ioaddr, int irq, int port_num)
return 0;
free_region:
release_region(ioaddr, MAC_IOSIZE);
release_region(PHYSADDR(ioaddr), MAC_IOSIZE);
unregister_netdev(dev);
if (aup->vaddr)
dma_free((void *)aup->vaddr,
......@@ -1047,8 +1035,9 @@ static void au1000_tx_ack(struct net_device *dev)
ptxd = aup->tx_dma_ring[aup->tx_tail];
while (ptxd->buff_stat & TX_T_DONE) {
update_tx_stats(dev, ptxd->status, ptxd->len & 0x3ff);
update_tx_stats(dev, ptxd->status, aup->tx_len[aup->tx_tail] & 0x3ff);
ptxd->buff_stat &= ~TX_T_DONE;
aup->tx_len[aup->tx_tail] = 0;
ptxd->len = 0;
au_sync();
......@@ -1088,7 +1077,8 @@ static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
return 1;
}
else if (buff_stat & TX_T_DONE) {
update_tx_stats(dev, ptxd->status, ptxd->len & 0x3ff);
update_tx_stats(dev, ptxd->status, aup->tx_len[aup->tx_head] & 0x3ff);
aup->tx_len[aup->tx_head] = 0;
ptxd->len = 0;
}
......@@ -1103,11 +1093,13 @@ static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
for (i=skb->len; i<MAC_MIN_PKT_SIZE; i++) {
((char *)pDB->vaddr)[i] = 0;
}
aup->tx_len[aup->tx_head] = MAC_MIN_PKT_SIZE;
ptxd->len = MAC_MIN_PKT_SIZE;
}
else
else {
aup->tx_len[aup->tx_head] = skb->len;
ptxd->len = skb->len;
}
ptxd->buff_stat = pDB->dma_addr | TX_DMA_ENABLE;
au_sync();
dev_kfree_skb(skb);
......@@ -1244,6 +1236,8 @@ static void au1000_tx_timeout(struct net_device *dev)
printk(KERN_ERR "%s: au1000_tx_timeout: dev=%p\n", dev->name, dev);
reset_mac(dev);
au1000_init(dev);
dev->trans_start = jiffies;
netif_wake_queue(dev);
}
static void set_rx_mode(struct net_device *dev)
......@@ -1269,7 +1263,8 @@ static void set_rx_mode(struct net_device *dev)
mc_filter[1] = mc_filter[0] = 0;
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
i++, mclist = mclist->next) {
set_bit(ether_crc(ETH_ALEN, mclist->dmi_addr)>>26, mc_filter);
set_bit(ether_crc_le(ETH_ALEN, mclist->dmi_addr)>>26,
mc_filter);
}
aup->mac->multi_hash_high = mc_filter[1];
aup->mac->multi_hash_low = mc_filter[0];
......@@ -1285,18 +1280,21 @@ static int au1000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
/* fixme */
switch(cmd) {
case SIOCGMIIPHY: /* Get the address of the PHY in use. */
case SIOCGMIIPHY: /* Get the address of the PHY in use. */
data[0] = PHY_ADDRESS;
return 0;
case SIOCGMIIREG: /* Read the specified MII register. */
case SIOCGMIIREG: /* Read the specified MII register. */
//data[3] = mdio_read(ioaddr, data[0], data[1]);
return 0;
case SIOCSMIIREG: /* Write the specified MII register */
case SIOCSMIIREG: /* Write the specified MII register */
if (!capable(CAP_NET_ADMIN))
return -EPERM;
//mdio_write(ioaddr, data[0], data[1], data[2]);
return 0;
default:
return -EOPNOTSUPP;
}
......
/*
*
* Alchemy Semi Au1000 ethernet driver include file
*
* Author: Pete Popov <ppopov@mvista.com>
*
* Copyright 2001 MontaVista Software Inc.
*
* ########################################################################
*
* This program is free software; you can distribute it and/or modify it
* under the terms of the GNU General Public License (Version 2) as
* published by the Free Software Foundation.
......@@ -20,11 +17,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
* ########################################################################
*
*
*/
#include <linux/config.h>
#define NUM_INTERFACES 2
......@@ -137,7 +131,7 @@
#define MII_AUX_100 0x0002
#define MII_AUX_F100 0x0004
#define MII_AUX_ANEG 0x0008
#define MII_FDX_LED 0x8000
#define MII_FDX_LED 0x8000
typedef struct mii_phy {
struct mii_phy * next;
......@@ -203,6 +197,7 @@ struct au1000_private {
db_dest_t db[NUM_RX_BUFFS+NUM_TX_BUFFS];
volatile rx_dma_t *rx_dma_ring[NUM_RX_DMA];
volatile tx_dma_t *tx_dma_ring[NUM_TX_DMA];
int tx_len[NUM_TX_DMA];
db_dest_t *rx_db_inuse[NUM_RX_DMA];
db_dest_t *tx_db_inuse[NUM_TX_DMA];
u32 rx_head;
......
This diff is collapsed.
......@@ -3424,10 +3424,6 @@ e100_ethtool_set_settings(struct net_device *dev, struct ifreq *ifr)
int ethtool_new_speed_duplex;
struct ethtool_cmd ecmd;
if (!capable(CAP_NET_ADMIN)) {
return -EPERM;
}
bdp = dev->priv;
if (copy_from_user(&ecmd, ifr->ifr_data, sizeof (ecmd))) {
return -EFAULT;
......@@ -3545,8 +3541,6 @@ e100_ethtool_gregs(struct net_device *dev, struct ifreq *ifr)
void *addr = ifr->ifr_data;
u16 mdi_reg;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
bdp = dev->priv;
if(copy_from_user(&regs, addr, sizeof(regs)))
......@@ -3574,9 +3568,6 @@ e100_ethtool_nway_rst(struct net_device *dev, struct ifreq *ifr)
{
struct e100_private *bdp;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
bdp = dev->priv;
if ((bdp->speed_duplex_caps & SUPPORTED_Autoneg) &&
......@@ -3632,9 +3623,6 @@ e100_ethtool_eeprom(struct net_device *dev, struct ifreq *ifr)
void *ptr;
u8 *eeprom_data_bytes = (u8 *)eeprom_data;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
bdp = dev->priv;
if (copy_from_user(&ecmd, ifr->ifr_data, sizeof (ecmd)))
......@@ -3912,9 +3900,6 @@ e100_ethtool_wol(struct net_device *dev, struct ifreq *ifr)
struct ethtool_wolinfo wolinfo;
int res = 0;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
bdp = dev->priv;
if (copy_from_user(&wolinfo, ifr->ifr_data, sizeof (wolinfo))) {
......
......@@ -1289,8 +1289,6 @@ e1000_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr)
}
case ETHTOOL_SSET: {
struct ethtool_cmd ecmd;
if(!capable(CAP_NET_ADMIN))
return -EPERM;
if(copy_from_user(&ecmd, addr, sizeof(ecmd)))
return -EFAULT;
return e1000_ethtool_sset(adapter, &ecmd);
......@@ -1363,8 +1361,6 @@ e1000_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr)
return 0;
}
case ETHTOOL_NWAY_RST: {
if(!capable(CAP_NET_ADMIN))
return -EPERM;
if(netif_running(netdev)) {
e1000_down(adapter);
e1000_up(adapter);
......@@ -1393,8 +1389,6 @@ e1000_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr)
}
case ETHTOOL_SWOL: {
struct ethtool_wolinfo wol;
if(!capable(CAP_NET_ADMIN))
return -EPERM;
if(copy_from_user(&wol, addr, sizeof(wol)) != 0)
return -EFAULT;
return e1000_ethtool_swol(adapter, &wol);
......@@ -1436,9 +1430,6 @@ e1000_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr)
case ETHTOOL_SEEPROM: {
struct ethtool_eeprom eeprom;
if(!capable(CAP_NET_ADMIN))
return -EPERM;
if(copy_from_user(&eeprom, addr, sizeof(eeprom)))
return -EFAULT;
......@@ -1470,9 +1461,6 @@ e1000_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr)
} test = { {ETHTOOL_TEST} };
int err;
if(!capable(CAP_NET_ADMIN))
return -EPERM;
if(copy_from_user(&test.eth_test, addr, sizeof(test.eth_test)))
return -EFAULT;
......
......@@ -116,6 +116,7 @@ static int options[] = {-1, -1, -1, -1, -1, -1, -1, -1};
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/rtnetlink.h>
#include <linux/skbuff.h>
#include <linux/ethtool.h>
#include <linux/mii.h>
......@@ -670,7 +671,7 @@ static int __devinit speedo_found1(struct pci_dev *pdev,
if (tx_ring_space == NULL)
return -1;
dev = init_etherdev(NULL, sizeof(struct speedo_private));
dev = alloc_etherdev(sizeof(struct speedo_private));
if (dev == NULL) {
printk(KERN_ERR "eepro100: Could not allocate ethernet device.\n");
pci_free_consistent(pdev, size, tx_ring_space, tx_ring_dma);
......@@ -687,6 +688,10 @@ static int __devinit speedo_found1(struct pci_dev *pdev,
else
option = 0;
rtnl_lock();
if (dev_alloc_name(dev, dev->name) < 0)
goto err_free_unlock;
/* Read the station address EEPROM before doing the reset.
Nominally his should even be done before accepting the device, but
then we wouldn't have a device name with which to report the error.
......@@ -881,7 +886,16 @@ static int __devinit speedo_found1(struct pci_dev *pdev,
dev->set_multicast_list = &set_rx_mode;
dev->do_ioctl = &speedo_ioctl;
if (register_netdevice(dev))
goto err_free_unlock;
rtnl_unlock();
return 0;
err_free_unlock:
rtnl_unlock();
kfree(dev);
return -1;
}
static void do_slow_command(struct net_device *dev, int cmd)
......
......@@ -3,8 +3,6 @@
* Author: MontaVista Software, Inc.
* stevel@mvista.com or source@mvista.com
*
* ########################################################################
*
* This program is free software; you can distribute it and/or modify it
* under the terms of the GNU General Public License (Version 2) as
* published by the Free Software Foundation.
......@@ -18,8 +16,6 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
* ########################################################################
*
* Ethernet driver for the MIPS GT96100 Advanced Communication Controller.
*
* Revision history
......@@ -32,18 +28,7 @@
* gt96100_cleanup_module(), and other general code cleanups
* <stevel@mvista.com>.
*/
#ifndef __OPTIMIZE__
#error You must compile this file with the correct options!
#error See the last lines of the source file.
#error You must compile this driver with "-O".
#endif
#ifndef __mips__
#error This driver only works with MIPS architectures!
#endif
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/string.h>
......
......@@ -5,7 +5,7 @@
*
* Driver for SGI's IOC3 based Ethernet cards as found in the PCI card.
*
* Copyright (C) 1999, 2000, 2001 Ralf Baechle
* Copyright (C) 1999, 2000, 2001, 2003 Ralf Baechle
* Copyright (C) 1995, 1999, 2000, 2001 by Silicon Graphics, Inc.
*
* References:
......@@ -36,7 +36,7 @@
#include <linux/pci.h>
#include <linux/crc32.h>
#ifdef CONFIG_SERIAL
#ifdef CONFIG_SERIAL_8250
#include <linux/serial.h>
#include <asm/serial.h>
#define IOC3_BAUD (22000000 / (3*16))
......@@ -377,82 +377,6 @@ static void ioc3_get_eaddr_nic(struct ioc3_private *ip)
ip->dev->dev_addr[i - 2] = nic[i];
}
#if defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_SGI_SN2)
/*
* Get the ether-address on SN1 nodes
*/
static void ioc3_get_eaddr_sn(struct ioc3_private *ip)
{
int ibrick_mac_addr_get(nasid_t, char *);
struct ioc3 *ioc3 = ip->regs;
nasid_t nasid_of_ioc3;
char io7eaddr[20];
long mac;
int err_val;
/*
* err_val = ibrick_mac_addr_get(get_nasid(), io7eaddr );
*
* BAD!! The above call uses get_nasid() and assumes that
* the ioc3 pointed to by struct ioc3 is hooked up to the
* cbrick that we're running on. The proper way to make this call
* is to figure out which nasid the ioc3 is connected to
* and use that to call ibrick_mac_addr_get. Below is
* a hack to do just that.
*/
/*
* Get the nasid of the ioc3 from the ioc3's base addr.
* FIXME: the 8 at the end assumes we're in memory mode,
* not node mode (for that, we'd change it to a 9).
* Is there a call to extract this info from a physical
* addr somewhere in an sn header file already? If so,
* we should probably use that, or restructure this routine
* to use pci_dev and generic numa nodeid getting stuff.
*/
nasid_of_ioc3 = (((unsigned long)ioc3 >> 33) & ~(-1 << 8));
err_val = ibrick_mac_addr_get(nasid_of_ioc3, io7eaddr );
if (err_val) {
/* Couldn't read the eeprom; try OSLoadOptions. */
printk("WARNING: ibrick_mac_addr_get failed: %d\n", err_val);
/* this is where we hardwire the mac address
* 1st ibrick had 08:00:69:11:34:75
* 2nd ibrick had 08:00:69:11:35:35
*
* Eagan Machines:
* mankato1 08:00:69:11:BE:95
* warroad 08:00:69:11:bd:60
* duron 08:00:69:11:34:60
*
* an easy way to get the mac address is to hook
* up an ip35, then from L1 do 'cti serial'
* and then look for MAC line XXX THIS DOESN"T QUITE WORK!!
*/
printk("ioc3_get_eaddr: setting ethernet address to:\n -----> ");
ip->dev->dev_addr[0] = 0x8;
ip->dev->dev_addr[1] = 0x0;
ip->dev->dev_addr[2] = 0x69;
ip->dev->dev_addr[3] = 0x11;
ip->dev->dev_addr[4] = 0x34;
ip->dev->dev_addr[5] = 0x60;
}
else {
long simple_strtol(const char *,char **,unsigned int);
mac = simple_strtol(io7eaddr, (char **)0, 16);
ip->dev->dev_addr[0] = (mac >> 40) & 0xff;
ip->dev->dev_addr[1] = (mac >> 32) & 0xff;
ip->dev->dev_addr[2] = (mac >> 24) & 0xff;
ip->dev->dev_addr[3] = (mac >> 16) & 0xff;
ip->dev->dev_addr[4] = (mac >> 8) & 0xff;
ip->dev->dev_addr[5] = mac & 0xff;
}
}
#endif
/*
* Ok, this is hosed by design. It's necessary to know what machine the
* NIC is in in order to know how to read the NIC address. We also have
......@@ -460,30 +384,15 @@ static void ioc3_get_eaddr_sn(struct ioc3_private *ip)
*/
static void ioc3_get_eaddr(struct ioc3_private *ip)
{
void (*do_get_eaddr)(struct ioc3_private *ip) = NULL;
int i;
/*
* We should also use this code for PCI cards, no matter what host
* machine but how to know that we're a PCI card?
*/
#ifdef CONFIG_SGI_IP27
do_get_eaddr = ioc3_get_eaddr_nic;
#endif
#if defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_SGI_SN2)
do_get_eaddr = ioc3_get_eaddr_sn;
#endif
if (!do_get_eaddr) {
printk(KERN_ERR "Don't know how to read MAC address of this "
"IOC3 NIC\n");
return;
}
ioc3_get_eaddr_nic(ip);
printk("Ethernet address is ");
for (i = 0; i < 6; i++) {
printk("%02x", ip->dev->dev_addr[i]);
if (i < 7)
if (i < 5)
printk(":");
}
printk(".\n");
......@@ -588,7 +497,7 @@ ioc3_rx(struct ioc3_private *ip)
ip->stats.rx_frame_errors++;
next:
ip->rx_skbs[n_entry] = new_skb;
rxr[n_entry] = cpu_to_be32((0xa5UL << 56) |
rxr[n_entry] = cpu_to_be64((0xa5UL << 56) |
((unsigned long) rxb & TO_PHYS_MASK));
rxb->w0 = 0; /* Clear valid flag */
n_entry = (n_entry + 1) & 511; /* Update erpir */
......@@ -1550,7 +1459,7 @@ static int __devinit ioc3_probe(struct pci_dev *pdev,
}
ip->regs = ioc3;
#ifdef CONFIG_SERIAL
#ifdef CONFIG_SERIAL_8250
ioc3_serial_probe(pdev, ioc3);
#endif
......@@ -1613,6 +1522,7 @@ static void __devexit ioc3_remove_one (struct pci_dev *pdev)
struct ioc3_private *ip = dev->priv;
struct ioc3 *ioc3 = ip->regs;
unregister_netdev(dev);
iounmap(ioc3);
pci_release_regions(pdev);
kfree(dev);
......@@ -1844,9 +1754,6 @@ static int ioc3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
return -EFAULT;
return 0;
} else if (ecmd.cmd == ETHTOOL_SSET) {
if (!capable(CAP_NET_ADMIN))
return -EPERM;
/* Verify the settings we care about. */
if (ecmd.autoneg != AUTONEG_ENABLE &&
ecmd.autoneg != AUTONEG_DISABLE)
......
......@@ -289,6 +289,10 @@ config TOSHIBA_FIR
<file:Documentation/modules.txt>.
The module will be called donauboe.
config AU1000_FIR
tristate "Alchemy Au1000 SIR/FIR"
depends on MIPS_AU1000 && IRDA
config SMC_IRCC_OLD
tristate "SMC IrCC (old driver) (EXPERIMENTAL)"
depends on EXPERIMENTAL && IRDA
......
......@@ -28,6 +28,7 @@ obj-$(CONFIG_LITELINK_DONGLE) += litelink.o
obj-$(CONFIG_OLD_BELKIN_DONGLE) += old_belkin.o
obj-$(CONFIG_EP7211_IR) += ep7211_ir.o
obj-$(CONFIG_MCP2120_DONGLE) += mcp2120.o
obj-$(CONFIG_AU1000_FIR) += au1k_ir.o
obj-$(CONFIG_ACT200L_DONGLE) += act200l.o
obj-$(CONFIG_MA600_DONGLE) += ma600.o
# New SIR drivers
......
This diff is collapsed.
......@@ -448,8 +448,6 @@ ixgb_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr)
case ETHTOOL_SSET:{
struct ethtool_cmd ecmd;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
if (copy_from_user(&ecmd, addr, sizeof (ecmd)))
return -EFAULT;
return ixgb_ethtool_sset(adapter, &ecmd);
......@@ -482,9 +480,6 @@ ixgb_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr)
#endif /* ETHTOOL_GREGS */
case ETHTOOL_NWAY_RST:{
IXGB_DBG("ETHTOOL_NWAY_RST\n");
if (!capable(CAP_NET_ADMIN))
return -EPERM;
ixgb_down(adapter);
ixgb_up(adapter);
......@@ -539,9 +534,6 @@ ixgb_ethtool_ioctl(struct net_device *netdev, struct ifreq *ifr)
struct ethtool_eeprom eeprom;
IXGB_DBG("ETHTOOL_SEEPROM\n");
if (!capable(CAP_NET_ADMIN))
return -EPERM;
if (copy_from_user(&eeprom, addr, sizeof (eeprom)))
return -EFAULT;
......
This diff is collapsed.
This diff is collapsed.
......@@ -211,7 +211,6 @@ enum Window4 { /* Window 4: Xcvr/media bits. */
struct el3_private {
dev_link_t link;
struct net_device dev;
dev_node_t node;
struct net_device_stats stats;
u16 advertising, partner; /* NWay media advertisement */
......@@ -291,13 +290,12 @@ static dev_link_t *tc574_attach(void)
flush_stale_links();
/* Create the PC card device object. */
lp = kmalloc(sizeof(*lp), GFP_KERNEL);
if (!lp)
dev = alloc_etherdev(sizeof(struct el3_private));
if (!dev)
return NULL;
memset(lp, 0, sizeof(*lp));
link = &lp->link; dev = &lp->dev;
link->priv = dev->priv = link->irq.Instance = lp;
lp = dev->priv;
link = &lp->link;
link->priv = dev;
init_timer(&link->release);
link->release.function = &tc574_release;
......@@ -312,6 +310,7 @@ static dev_link_t *tc574_attach(void)
for (i = 0; i < 4; i++)
link->irq.IRQInfo2 |= 1 << irq_list[i];
link->irq.Handler = &el3_interrupt;
link->irq.Instance = dev;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
......@@ -323,7 +322,6 @@ static dev_link_t *tc574_attach(void)
dev->get_stats = &el3_get_stats;
dev->do_ioctl = &el3_ioctl;
dev->set_multicast_list = &set_rx_mode;
ether_setup(dev);
dev->open = &el3_open;
dev->stop = &el3_close;
#ifdef HAVE_TX_TIMEOUT
......@@ -364,7 +362,7 @@ static dev_link_t *tc574_attach(void)
static void tc574_detach(dev_link_t *link)
{
struct el3_private *lp = link->priv;
struct net_device *dev = link->priv;
dev_link_t **linkp;
DEBUG(0, "3c574_detach(0x%p)\n", link);
......@@ -390,8 +388,8 @@ static void tc574_detach(dev_link_t *link)
/* Unlink device structure, free bits */
*linkp = link->next;
if (link->dev)
unregister_netdev(&lp->dev);
kfree(lp);
unregister_netdev(dev);
kfree(dev);
} /* tc574_detach */
......@@ -407,8 +405,8 @@ while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
static void tc574_config(dev_link_t *link)
{
client_handle_t handle = link->handle;
struct el3_private *lp = link->priv;
struct net_device *dev = &lp->dev;
struct net_device *dev = link->priv;
struct el3_private *lp = dev->priv;
tuple_t tuple;
cisparse_t parse;
unsigned short buf[32];
......@@ -599,8 +597,7 @@ static int tc574_event(event_t event, int priority,
event_callback_args_t *args)
{
dev_link_t *link = args->client_data;
struct el3_private *lp = link->priv;
struct net_device *dev = &lp->dev;
struct net_device *dev = link->priv;
DEBUG(1, "3c574_event(0x%06x)\n", event);
......@@ -856,7 +853,7 @@ static int el3_open(struct net_device *dev)
tc574_reset(dev);
lp->media.function = &media_check;
lp->media.data = (unsigned long)lp;
lp->media.data = (unsigned long) dev;
lp->media.expires = jiffies + HZ;
add_timer(&lp->media);
......@@ -939,8 +936,8 @@ static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* The EL3 interrupt handler. */
static irqreturn_t el3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
struct el3_private *lp = dev_id;
struct net_device *dev = &lp->dev;
struct net_device *dev = (struct net_device *) dev_id;
struct el3_private *lp = dev->priv;
ioaddr_t ioaddr, status;
int work_budget = max_interrupt_work;
int handled = 0;
......@@ -1032,8 +1029,8 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
*/
static void media_check(unsigned long arg)
{
struct el3_private *lp = (struct el3_private *)arg;
struct net_device *dev = &lp->dev;
struct net_device *dev = (struct net_device *) arg;
struct el3_private *lp = dev->priv;
ioaddr_t ioaddr = dev->base_addr;
unsigned long flags;
unsigned short /* cable, */ media, partner;
......
......@@ -106,7 +106,6 @@ enum RxFilter {
struct el3_private {
dev_link_t link;
struct net_device dev;
dev_node_t node;
struct net_device_stats stats;
/* For transceiver monitoring */
......@@ -213,14 +212,14 @@ static dev_link_t *tc589_attach(void)
flush_stale_links();
/* Create new ethernet device */
lp = kmalloc(sizeof(*lp), GFP_KERNEL);
if (!lp) return NULL;
memset(lp, 0, sizeof(*lp));
dev = alloc_etherdev(sizeof(struct el3_private));
if (!dev)
return NULL;
lp = dev->priv;
link = &lp->link;
link->priv = dev;
spin_lock_init(&lp->lock);
link = &lp->link; dev = &lp->dev;
link->priv = dev->priv = link->irq.Instance = lp;
init_timer(&link->release);
link->release.function = &tc589_release;
link->release.data = (unsigned long)link;
......@@ -234,6 +233,7 @@ static dev_link_t *tc589_attach(void)
for (i = 0; i < 4; i++)
link->irq.IRQInfo2 |= 1 << irq_list[i];
link->irq.Handler = &el3_interrupt;
link->irq.Instance = dev;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
......@@ -246,7 +246,6 @@ static dev_link_t *tc589_attach(void)
dev->set_config = &el3_config;
dev->get_stats = &el3_get_stats;
dev->set_multicast_list = &set_multicast_list;
ether_setup(dev);
dev->open = &el3_open;
dev->stop = &el3_close;
#ifdef HAVE_TX_TIMEOUT
......@@ -288,7 +287,7 @@ static dev_link_t *tc589_attach(void)
static void tc589_detach(dev_link_t *link)
{
struct el3_private *lp = link->priv;
struct net_device *dev = link->priv;
dev_link_t **linkp;
DEBUG(0, "3c589_detach(0x%p)\n", link);
......@@ -314,8 +313,8 @@ static void tc589_detach(dev_link_t *link)
/* Unlink device structure, free bits */
*linkp = link->next;
if (link->dev)
unregister_netdev(&lp->dev);
kfree(lp);
unregister_netdev(dev);
kfree(dev);
} /* tc589_detach */
......@@ -333,8 +332,8 @@ while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
static void tc589_config(dev_link_t *link)
{
client_handle_t handle = link->handle;
struct el3_private *lp = link->priv;
struct net_device *dev = &lp->dev;
struct net_device *dev = link->priv;
struct el3_private *lp = dev->priv;
tuple_t tuple;
cisparse_t parse;
u16 buf[32], *phys_addr;
......@@ -487,8 +486,7 @@ static int tc589_event(event_t event, int priority,
event_callback_args_t *args)
{
dev_link_t *link = args->client_data;
struct el3_private *lp = link->priv;
struct net_device *dev = &lp->dev;
struct net_device *dev = link->priv;
DEBUG(1, "3c589_event(0x%06x)\n", event);
......@@ -738,7 +736,7 @@ static int el3_open(struct net_device *dev)
tc589_reset(dev);
init_timer(&lp->media);
lp->media.function = &media_check;
lp->media.data = (unsigned long)lp;
lp->media.data = (unsigned long) dev;
lp->media.expires = jiffies + HZ;
add_timer(&lp->media);
......@@ -818,8 +816,8 @@ static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* The EL3 interrupt handler. */
static irqreturn_t el3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
struct el3_private *lp = dev_id;
struct net_device *dev = &lp->dev;
struct net_device *dev = (struct net_device *) dev_id;
struct el3_private *lp = dev->priv;
ioaddr_t ioaddr, status;
int i = 0, handled = 1;
......@@ -903,8 +901,8 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static void media_check(unsigned long arg)
{
struct el3_private *lp = (struct el3_private *)(arg);
struct net_device *dev = &lp->dev;
struct net_device *dev = (struct net_device *)(arg);
struct el3_private *lp = dev->priv;
ioaddr_t ioaddr = dev->base_addr;
u16 media, errs;
unsigned long flags;
......
......@@ -130,7 +130,6 @@ typedef enum { MBH10302, MBH10304, TDK, CONTEC, LA501, UNGERMANN,
*/
typedef struct local_info_t {
dev_link_t link;
struct net_device dev;
dev_node_t node;
struct net_device_stats stats;
long open_time;
......@@ -273,11 +272,12 @@ static dev_link_t *fmvj18x_attach(void)
flush_stale_links();
/* Make up a FMVJ18x specific data structure */
lp = kmalloc(sizeof(*lp), GFP_KERNEL);
if (!lp) return NULL;
memset(lp, 0, sizeof(*lp));
link = &lp->link; dev = &lp->dev;
link->priv = dev->priv = link->irq.Instance = lp;
dev = alloc_etherdev(sizeof(local_info_t));
if (!dev)
return NULL;
lp = dev->priv;
link = &lp->link;
link->priv = dev;
init_timer(&link->release);
link->release.function = &fmvj18x_release;
......@@ -297,6 +297,7 @@ static dev_link_t *fmvj18x_attach(void)
for (i = 0; i < 4; i++)
link->irq.IRQInfo2 |= 1 << irq_list[i];
link->irq.Handler = &fjn_interrupt;
link->irq.Instance = dev;
/* General socket configuration */
link->conf.Attributes = CONF_ENABLE_IRQ;
......@@ -309,7 +310,6 @@ static dev_link_t *fmvj18x_attach(void)
dev->set_config = &fjn_config;
dev->get_stats = &fjn_get_stats;
dev->set_multicast_list = &set_rx_mode;
ether_setup(dev);
dev->open = &fjn_open;
dev->stop = &fjn_close;
#ifdef HAVE_TX_TIMEOUT
......@@ -344,7 +344,7 @@ static dev_link_t *fmvj18x_attach(void)
static void fmvj18x_detach(dev_link_t *link)
{
local_info_t *lp = link->priv;
struct net_device *dev = link->priv;
dev_link_t **linkp;
DEBUG(0, "fmvj18x_detach(0x%p)\n", link);
......@@ -371,8 +371,8 @@ static void fmvj18x_detach(dev_link_t *link)
/* Unlink device structure, free pieces */
*linkp = link->next;
if (link->dev)
unregister_netdev(&lp->dev);
kfree(lp);
unregister_netdev(dev);
kfree(dev);
} /* fmvj18x_detach */
......@@ -423,8 +423,8 @@ static int ungermann_try_io_port(dev_link_t *link)
static void fmvj18x_config(dev_link_t *link)
{
client_handle_t handle = link->handle;
local_info_t *lp = link->priv;
struct net_device *dev = &lp->dev;
struct net_device *dev = link->priv;
local_info_t *lp = dev->priv;
tuple_t tuple;
cisparse_t parse;
u_short buf[32];
......@@ -704,8 +704,7 @@ static int fmvj18x_setup_mfc(dev_link_t *link)
memreq_t mem;
u_char *base;
int i, j;
local_info_t *lp = link->priv;
struct net_device *dev = &lp->dev;
struct net_device *dev = link->priv;
ioaddr_t ioaddr;
/* Allocate a small memory window */
......@@ -776,8 +775,7 @@ static int fmvj18x_event(event_t event, int priority,
event_callback_args_t *args)
{
dev_link_t *link = args->client_data;
local_info_t *lp = link->priv;
struct net_device *dev = &lp->dev;
struct net_device *dev = link->priv;
DEBUG(1, "fmvj18x_event(0x%06x)\n", event);
......@@ -847,8 +845,8 @@ module_exit(exit_fmvj18x_cs);
static irqreturn_t fjn_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
local_info_t *lp = dev_id;
struct net_device *dev = &lp->dev;
struct net_device *dev = dev_id;
local_info_t *lp = dev->priv;
ioaddr_t ioaddr;
unsigned short tx_stat, rx_stat;
......
......@@ -359,7 +359,6 @@ typedef struct _mace_statistics {
typedef struct _mace_private {
dev_link_t link;
struct net_device dev;
dev_node_t node;
struct net_device_stats linux_stats; /* Linux statistics counters */
mace_statistics mace_stats; /* MACE chip statistics counters */
......@@ -476,12 +475,13 @@ static dev_link_t *nmclan_attach(void)
flush_stale_links();
/* Create new ethernet device */
lp = kmalloc(sizeof(*lp), GFP_KERNEL);
if (!lp) return NULL;
memset(lp, 0, sizeof(*lp));
link = &lp->link; dev = &lp->dev;
link->priv = dev->priv = link->irq.Instance = lp;
dev = alloc_etherdev(sizeof(mace_private));
if (!dev)
return NULL;
lp = dev->priv;
link = &lp->link;
link->priv = dev;
init_timer(&link->release);
link->release.function = &nmclan_release;
link->release.data = (u_long)link;
......@@ -496,6 +496,7 @@ static dev_link_t *nmclan_attach(void)
for (i = 0; i < 4; i++)
link->irq.IRQInfo2 |= 1 << irq_list[i];
link->irq.Handler = &mace_interrupt;
link->irq.Instance = dev;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
......@@ -510,7 +511,6 @@ static dev_link_t *nmclan_attach(void)
dev->get_stats = &mace_get_stats;
dev->set_multicast_list = &set_multicast_list;
dev->do_ioctl = &mace_ioctl;
ether_setup(dev);
dev->open = &mace_open;
dev->stop = &mace_close;
#ifdef HAVE_TX_TIMEOUT
......@@ -550,7 +550,7 @@ nmclan_detach
static void nmclan_detach(dev_link_t *link)
{
mace_private *lp = link->priv;
struct net_device *dev = link->priv;
dev_link_t **linkp;
DEBUG(0, "nmclan_detach(0x%p)\n", link);
......@@ -576,8 +576,8 @@ static void nmclan_detach(dev_link_t *link)
/* Unlink device structure, free bits */
*linkp = link->next;
if (link->dev)
unregister_netdev(&lp->dev);
kfree(lp);
unregister_netdev(dev);
kfree(dev);
} /* nmclan_detach */
......@@ -710,8 +710,8 @@ while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
static void nmclan_config(dev_link_t *link)
{
client_handle_t handle = link->handle;
mace_private *lp = link->priv;
struct net_device *dev = &lp->dev;
struct net_device *dev = link->priv;;
mace_private *lp = dev->priv;
tuple_t tuple;
cisparse_t parse;
u_char buf[64];
......@@ -836,8 +836,7 @@ static int nmclan_event(event_t event, int priority,
event_callback_args_t *args)
{
dev_link_t *link = args->client_data;
mace_private *lp = link->priv;
struct net_device *dev = &lp->dev;
struct net_device *dev = link->priv;
DEBUG(1, "nmclan_event(0x%06x)\n", event);
......@@ -1145,8 +1144,8 @@ mace_interrupt
---------------------------------------------------------------------------- */
static irqreturn_t mace_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
mace_private *lp = (mace_private *)dev_id;
struct net_device *dev = &lp->dev;
struct net_device *dev = (struct net_device *) dev_id;
mace_private *lp = dev->priv;
ioaddr_t ioaddr = dev->base_addr;
int status;
int IntrCnt = MACE_MAX_IR_ITERATIONS;
......
......@@ -113,7 +113,6 @@ static dev_link_t *dev_list;
struct smc_private {
dev_link_t link;
struct net_device dev;
spinlock_t lock;
u_short manfid;
u_short cardid;
......@@ -344,10 +343,13 @@ static dev_link_t *smc91c92_attach(void)
flush_stale_links();
/* Create new ethernet device */
smc = kmalloc(sizeof(struct smc_private), GFP_KERNEL);
if (!smc) return NULL;
memset(smc, 0, sizeof(struct smc_private));
link = &smc->link; dev = &smc->dev;
dev = alloc_etherdev(sizeof(struct smc_private));
if (!dev)
return NULL;
smc = dev->priv;
link = &smc->link;
link->priv = dev;
spin_lock_init(&smc->lock);
init_timer(&link->release);
link->release.function = &smc91c92_release;
......@@ -363,6 +365,7 @@ static dev_link_t *smc91c92_attach(void)
for (i = 0; i < 4; i++)
link->irq.IRQInfo2 |= 1 << irq_list[i];
link->irq.Handler = &smc_interrupt;
link->irq.Instance = dev;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
......@@ -373,7 +376,6 @@ static dev_link_t *smc91c92_attach(void)
dev->get_stats = &smc_get_stats;
dev->set_config = &s9k_config;
dev->set_multicast_list = &set_rx_mode;
ether_setup(dev);
dev->open = &smc_open;
dev->stop = &smc_close;
dev->do_ioctl = &smc_ioctl;
......@@ -381,7 +383,6 @@ static dev_link_t *smc91c92_attach(void)
dev->tx_timeout = smc_tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT;
#endif
dev->priv = link->priv = link->irq.Instance = smc;
smc->mii_if.dev = dev;
smc->mii_if.mdio_read = mdio_read;
......@@ -421,7 +422,7 @@ static dev_link_t *smc91c92_attach(void)
static void smc91c92_detach(dev_link_t *link)
{
struct smc_private *smc = link->priv;
struct net_device *dev = link->priv;
dev_link_t **linkp;
DEBUG(0, "smc91c92_detach(0x%p)\n", link);
......@@ -447,8 +448,8 @@ static void smc91c92_detach(dev_link_t *link)
/* Unlink device structure, free bits */
*linkp = link->next;
if (link->dev)
unregister_netdev(&smc->dev);
kfree(smc);
unregister_netdev(dev);
kfree(dev);
} /* smc91c92_detach */
......@@ -502,7 +503,8 @@ static int get_tuple(int fn, client_handle_t handle, tuple_t *tuple,
static int mhz_3288_power(dev_link_t *link)
{
struct smc_private *smc = link->priv;
struct net_device *dev = link->priv;
struct smc_private *smc = dev->priv;
u_char tmp;
/* Read the ISR twice... */
......@@ -523,8 +525,8 @@ static int mhz_3288_power(dev_link_t *link)
static int mhz_mfc_config(dev_link_t *link)
{
struct smc_private *smc = link->priv;
struct net_device *dev = &smc->dev;
struct net_device *dev = link->priv;
struct smc_private *smc = dev->priv;
tuple_t tuple;
cisparse_t parse;
u_char buf[255];
......@@ -590,8 +592,7 @@ static int mhz_mfc_config(dev_link_t *link)
static int mhz_setup(dev_link_t *link)
{
client_handle_t handle = link->handle;
struct smc_private *smc = link->priv;
struct net_device *dev = &smc->dev;
struct net_device *dev = link->priv;
tuple_t tuple;
cisparse_t parse;
u_char buf[255], *station_addr;
......@@ -638,8 +639,8 @@ static int mhz_setup(dev_link_t *link)
static void mot_config(dev_link_t *link)
{
struct smc_private *smc = link->priv;
struct net_device *dev = &smc->dev;
struct net_device *dev = link->priv;
struct smc_private *smc = dev->priv;
ioaddr_t ioaddr = dev->base_addr;
ioaddr_t iouart = link->io.BasePort2;
......@@ -659,8 +660,7 @@ static void mot_config(dev_link_t *link)
static int mot_setup(dev_link_t *link)
{
struct smc_private *smc = link->priv;
struct net_device *dev = &smc->dev;
struct net_device *dev = link->priv;
ioaddr_t ioaddr = dev->base_addr;
int i, wait, loop;
u_int addr;
......@@ -694,8 +694,7 @@ static int mot_setup(dev_link_t *link)
static int smc_config(dev_link_t *link)
{
struct smc_private *smc = link->priv;
struct net_device *dev = &smc->dev;
struct net_device *dev = link->priv;
tuple_t tuple;
cisparse_t parse;
u_char buf[255];
......@@ -727,8 +726,7 @@ static int smc_config(dev_link_t *link)
static int smc_setup(dev_link_t *link)
{
client_handle_t handle = link->handle;
struct smc_private *smc = link->priv;
struct net_device *dev = &smc->dev;
struct net_device *dev = link->priv;
tuple_t tuple;
cisparse_t parse;
cistpl_lan_node_id_t *node_id;
......@@ -755,7 +753,6 @@ static int smc_setup(dev_link_t *link)
return 0;
}
}
/* Try the third string in the Version 1 Version/ID tuple. */
tuple.DesiredTuple = CISTPL_VERS_1;
if (first_tuple(handle, &tuple, &parse) != CS_SUCCESS)
......@@ -771,8 +768,7 @@ static int smc_setup(dev_link_t *link)
static int osi_config(dev_link_t *link)
{
struct smc_private *smc = link->priv;
struct net_device *dev = &smc->dev;
struct net_device *dev = link->priv;
static ioaddr_t com[4] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
int i, j;
......@@ -806,8 +802,7 @@ static int osi_config(dev_link_t *link)
static int osi_setup(dev_link_t *link, u_short manfid, u_short cardid)
{
client_handle_t handle = link->handle;
struct smc_private *smc = link->priv;
struct net_device *dev = &smc->dev;
struct net_device *dev = link->priv;
tuple_t tuple;
u_char buf[255];
int i;
......@@ -862,8 +857,7 @@ static int osi_setup(dev_link_t *link, u_short manfid, u_short cardid)
static int check_sig(dev_link_t *link)
{
struct smc_private *smc = link->priv;
struct net_device *dev = &smc->dev;
struct net_device *dev = link->priv;
ioaddr_t ioaddr = dev->base_addr;
int width;
u_short s;
......@@ -921,8 +915,8 @@ if (ret != CS_SUCCESS) { cs_error(link->handle, svc, ret); goto label; }
static void smc91c92_config(dev_link_t *link)
{
client_handle_t handle = link->handle;
struct smc_private *smc = link->priv;
struct net_device *dev = &smc->dev;
struct net_device *dev = link->priv;
struct smc_private *smc = dev->priv;
tuple_t tuple;
cisparse_t parse;
u_short buf[32];
......@@ -1090,7 +1084,6 @@ static void smc91c92_config(dev_link_t *link)
static void smc91c92_release(u_long arg)
{
dev_link_t *link = (dev_link_t *)arg;
struct smc_private *smc = link->priv;
DEBUG(0, "smc91c92_release(0x%p)\n", link);
......@@ -1105,6 +1098,8 @@ static void smc91c92_release(u_long arg)
CardServices(ReleaseIO, link->handle, &link->io);
CardServices(ReleaseIRQ, link->handle, &link->irq);
if (link->win) {
struct net_device *dev = link->priv;
struct smc_private *smc = dev->priv;
iounmap(smc->base);
CardServices(ReleaseWindow, link->win);
}
......@@ -1126,8 +1121,8 @@ static int smc91c92_event(event_t event, int priority,
event_callback_args_t *args)
{
dev_link_t *link = args->client_data;
struct smc_private *smc = link->priv;
struct net_device *dev = &smc->dev;
struct net_device *dev = link->priv;
struct smc_private *smc = dev->priv;
int i;
DEBUG(1, "smc91c92_event(0x%06x)\n", event);
......@@ -1302,7 +1297,7 @@ static int smc_open(struct net_device *dev)
smc_reset(dev);
init_timer(&smc->media);
smc->media.function = &media_check;
smc->media.data = (u_long)smc;
smc->media.data = (u_long) dev;
smc->media.expires = jiffies + HZ;
add_timer(&smc->media);
......@@ -1576,8 +1571,8 @@ static void smc_eph_irq(struct net_device *dev)
static irqreturn_t smc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
struct smc_private *smc = dev_id;
struct net_device *dev = &smc->dev;
struct net_device *dev = dev_id;
struct smc_private *smc = dev->priv;
ioaddr_t ioaddr;
u_short saved_bank, saved_pointer, mask, status;
unsigned int handled = 1;
......@@ -1967,8 +1962,8 @@ static void smc_reset(struct net_device *dev)
static void media_check(u_long arg)
{
struct smc_private *smc = (struct smc_private *)(arg);
struct net_device *dev = &smc->dev;
struct net_device *dev = (struct net_device *) arg;
struct smc_private *smc = dev->priv;
ioaddr_t ioaddr = dev->base_addr;
u_short i, media, saved_bank;
u_short link;
......
This diff is collapsed.
This diff is collapsed.
/* $Id: sgiseeq.h,v 1.4 1999/10/09 00:01:24 ralf Exp $
/*
* sgiseeq.h: Defines for the Seeq8003 ethernet controller.
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
......
......@@ -2384,9 +2384,6 @@ static int gem_ethtool_ioctl(struct net_device *dev, void *ep_user)
return 0;
case ETHTOOL_SSET:
if (!capable(CAP_NET_ADMIN))
return -EPERM;
/* Verify the settings we care about. */
if (ecmd.autoneg != AUTONEG_ENABLE &&
ecmd.autoneg != AUTONEG_DISABLE)
......
......@@ -2481,9 +2481,6 @@ static int happy_meal_ioctl(struct net_device *dev,
return -EFAULT;
return 0;
} else if (ecmd.cmd == ETHTOOL_SSET) {
if (!capable(CAP_NET_ADMIN))
return -EPERM;
/* Verify the settings we care about. */
if (ecmd.autoneg != AUTONEG_ENABLE &&
ecmd.autoneg != AUTONEG_DISABLE)
......
......@@ -94,6 +94,8 @@ static int csr0 = 0x01A00000 | 0x8000;
static int csr0 = 0x01A00000 | 0x9000;
#elif defined(__arm__) || defined(__sh__)
static int csr0 = 0x01A00000 | 0x4800;
#elif defined(__mips__)
static int csr0 = 0x00200000 | 0x4000;
#else
#warning Processor architecture undefined!
static int csr0 = 0x00A00000 | 0x4800;
......@@ -1491,6 +1493,16 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
tp->flags &= ~HAS_MEDIA_TABLE;
}
#endif
#ifdef CONFIG_MIPS_COBALT
if ((pdev->bus->number == 0) &&
((PCI_SLOT(pdev->devfn) == 7) ||
(PCI_SLOT(pdev->devfn) == 12))) {
/* Cobalt MAC address in first EEPROM locations. */
sa_offset = 0;
/* No media table either */
tp->flags &= ~HAS_MEDIA_TABLE;
}
#endif
#ifdef __hppa__
/* 3x5 HSC (J3514A) has a broken srom */
if(ee_data[0] == 0x61 && ee_data[1] == 0x10) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment