Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 065a3e17 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (33 commits)
  [PATCH] myri10ge - drop workaround pci_save_state() disabling MSI
  [PATCH] myri10ge - drop workaround for the missing AER ext cap on nVidia CK804
  via-velocity: the link is not correctly detected when the device starts
  [PATCH] add b44 to maintainers
  [PATCH] WAN: ioremap() failure checks in drivers
  [PATCH] WAN: register_hdlc_device() doesn't need dev_alloc_name()
  [PATCH] skb_padto()-area fixes in 8390, wavelan
  [PATCH] make drivers/net/forcedeth.c:nv_update_pause() static
  [PATCH] network driver for Hilscher netx
  [PATCH] Dereference in tokenring/olympic.c
  [PATCH] Array overrun in drivers/net/wireless/wavelan.c
  [PATCH] Remove useless check in drivers/net/pcmcia/xirc2ps_cs.c
  [PATCH] 8139cp: add ethtool eeprom support
  [PATCH] 8139cp: fix eeprom read command length
  [PATCH] b44: update b44 Kconfig entry
  [PATCH] b44: update version to 1.01
  [PATCH] b44: add wol for old nic
  [PATCH] b44: add parameter
  [PATCH] b44: add wol
  [PATCH] b44: fix manual speed/duplex/autoneg settings
  ...
parents 45c091bb bfcbb008
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -574,6 +574,12 @@ L: linuxppc-dev@ozlabs.org
W:	http://www.penguinppc.org/ppc64/
W:	http://www.penguinppc.org/ppc64/
S:	Supported
S:	Supported


BROADCOM B44 10/100 ETHERNET DRIVER
P:	Gary Zambrano
M:	zambrano@broadcom.com
L:	netdev@vger.kernel.org
S:	Supported

BROADCOM BNX2 GIGABIT ETHERNET DRIVER
BROADCOM BNX2 GIGABIT ETHERNET DRIVER
P:	Michael Chan
P:	Michael Chan
M:	mchan@broadcom.com
M:	mchan@broadcom.com
+167 −12
Original line number Original line Diff line number Diff line
@@ -401,6 +401,11 @@ static void cp_clean_rings (struct cp_private *cp);
#ifdef CONFIG_NET_POLL_CONTROLLER
#ifdef CONFIG_NET_POLL_CONTROLLER
static void cp_poll_controller(struct net_device *dev);
static void cp_poll_controller(struct net_device *dev);
#endif
#endif
static int cp_get_eeprom_len(struct net_device *dev);
static int cp_get_eeprom(struct net_device *dev,
			 struct ethtool_eeprom *eeprom, u8 *data);
static int cp_set_eeprom(struct net_device *dev,
			 struct ethtool_eeprom *eeprom, u8 *data);


static struct pci_device_id cp_pci_tbl[] = {
static struct pci_device_id cp_pci_tbl[] = {
	{ PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8139,
	{ PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8139,
@@ -1577,6 +1582,9 @@ static struct ethtool_ops cp_ethtool_ops = {
	.get_strings		= cp_get_strings,
	.get_strings		= cp_get_strings,
	.get_ethtool_stats	= cp_get_ethtool_stats,
	.get_ethtool_stats	= cp_get_ethtool_stats,
	.get_perm_addr		= ethtool_op_get_perm_addr,
	.get_perm_addr		= ethtool_op_get_perm_addr,
	.get_eeprom_len		= cp_get_eeprom_len,
	.get_eeprom		= cp_get_eeprom,
	.set_eeprom		= cp_set_eeprom,
};
};


static int cp_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
static int cp_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
@@ -1612,24 +1620,32 @@ static int cp_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
#define eeprom_delay()	readl(ee_addr)
#define eeprom_delay()	readl(ee_addr)


/* The EEPROM commands include the alway-set leading bit. */
/* The EEPROM commands include the alway-set leading bit. */
#define EE_EXTEND_CMD	(4)
#define EE_WRITE_CMD	(5)
#define EE_WRITE_CMD	(5)
#define EE_READ_CMD		(6)
#define EE_READ_CMD		(6)
#define EE_ERASE_CMD	(7)
#define EE_ERASE_CMD	(7)


static int read_eeprom (void __iomem *ioaddr, int location, int addr_len)
#define EE_EWDS_ADDR	(0)
{
#define EE_WRAL_ADDR	(1)
	int i;
#define EE_ERAL_ADDR	(2)
	unsigned retval = 0;
#define EE_EWEN_ADDR	(3)
	void __iomem *ee_addr = ioaddr + Cfg9346;

	int read_cmd = location | (EE_READ_CMD << addr_len);
#define CP_EEPROM_MAGIC PCI_DEVICE_ID_REALTEK_8139


static void eeprom_cmd_start(void __iomem *ee_addr)
{
	writeb (EE_ENB & ~EE_CS, ee_addr);
	writeb (EE_ENB & ~EE_CS, ee_addr);
	writeb (EE_ENB, ee_addr);
	writeb (EE_ENB, ee_addr);
	eeprom_delay ();
	eeprom_delay ();
}


	/* Shift the read command bits out. */
static void eeprom_cmd(void __iomem *ee_addr, int cmd, int cmd_len)
	for (i = 4 + addr_len; i >= 0; i--) {
{
		int dataval = (read_cmd & (1 << i)) ? EE_DATA_WRITE : 0;
	int i;

	/* Shift the command bits out. */
	for (i = cmd_len - 1; i >= 0; i--) {
		int dataval = (cmd & (1 << i)) ? EE_DATA_WRITE : 0;
		writeb (EE_ENB | dataval, ee_addr);
		writeb (EE_ENB | dataval, ee_addr);
		eeprom_delay ();
		eeprom_delay ();
		writeb (EE_ENB | dataval | EE_SHIFT_CLK, ee_addr);
		writeb (EE_ENB | dataval | EE_SHIFT_CLK, ee_addr);
@@ -1637,6 +1653,33 @@ static int read_eeprom (void __iomem *ioaddr, int location, int addr_len)
	}
	}
	writeb (EE_ENB, ee_addr);
	writeb (EE_ENB, ee_addr);
	eeprom_delay ();
	eeprom_delay ();
}

static void eeprom_cmd_end(void __iomem *ee_addr)
{
	writeb (~EE_CS, ee_addr);
	eeprom_delay ();
}

static void eeprom_extend_cmd(void __iomem *ee_addr, int extend_cmd,
			      int addr_len)
{
	int cmd = (EE_EXTEND_CMD << addr_len) | (extend_cmd << (addr_len - 2));

	eeprom_cmd_start(ee_addr);
	eeprom_cmd(ee_addr, cmd, 3 + addr_len);
	eeprom_cmd_end(ee_addr);
}

static u16 read_eeprom (void __iomem *ioaddr, int location, int addr_len)
{
	int i;
	u16 retval = 0;
	void __iomem *ee_addr = ioaddr + Cfg9346;
	int read_cmd = location | (EE_READ_CMD << addr_len);

	eeprom_cmd_start(ee_addr);
	eeprom_cmd(ee_addr, read_cmd, 3 + addr_len);


	for (i = 16; i > 0; i--) {
	for (i = 16; i > 0; i--) {
		writeb (EE_ENB | EE_SHIFT_CLK, ee_addr);
		writeb (EE_ENB | EE_SHIFT_CLK, ee_addr);
@@ -1648,13 +1691,125 @@ static int read_eeprom (void __iomem *ioaddr, int location, int addr_len)
		eeprom_delay ();
		eeprom_delay ();
	}
	}


	/* Terminate the EEPROM access. */
	eeprom_cmd_end(ee_addr);
	writeb (~EE_CS, ee_addr);
	eeprom_delay ();


	return retval;
	return retval;
}
}


static void write_eeprom(void __iomem *ioaddr, int location, u16 val,
			 int addr_len)
{
	int i;
	void __iomem *ee_addr = ioaddr + Cfg9346;
	int write_cmd = location | (EE_WRITE_CMD << addr_len);

	eeprom_extend_cmd(ee_addr, EE_EWEN_ADDR, addr_len);

	eeprom_cmd_start(ee_addr);
	eeprom_cmd(ee_addr, write_cmd, 3 + addr_len);
	eeprom_cmd(ee_addr, val, 16);
	eeprom_cmd_end(ee_addr);

	eeprom_cmd_start(ee_addr);
	for (i = 0; i < 20000; i++)
		if (readb(ee_addr) & EE_DATA_READ)
			break;
	eeprom_cmd_end(ee_addr);

	eeprom_extend_cmd(ee_addr, EE_EWDS_ADDR, addr_len);
}

static int cp_get_eeprom_len(struct net_device *dev)
{
	struct cp_private *cp = netdev_priv(dev);
	int size;

	spin_lock_irq(&cp->lock);
	size = read_eeprom(cp->regs, 0, 8) == 0x8129 ? 256 : 128;
	spin_unlock_irq(&cp->lock);

	return size;
}

static int cp_get_eeprom(struct net_device *dev,
			 struct ethtool_eeprom *eeprom, u8 *data)
{
	struct cp_private *cp = netdev_priv(dev);
	unsigned int addr_len;
	u16 val;
	u32 offset = eeprom->offset >> 1;
	u32 len = eeprom->len;
	u32 i = 0;

	eeprom->magic = CP_EEPROM_MAGIC;

	spin_lock_irq(&cp->lock);

	addr_len = read_eeprom(cp->regs, 0, 8) == 0x8129 ? 8 : 6;

	if (eeprom->offset & 1) {
		val = read_eeprom(cp->regs, offset, addr_len);
		data[i++] = (u8)(val >> 8);
		offset++;
	}

	while (i < len - 1) {
		val = read_eeprom(cp->regs, offset, addr_len);
		data[i++] = (u8)val;
		data[i++] = (u8)(val >> 8);
		offset++;
	}

	if (i < len) {
		val = read_eeprom(cp->regs, offset, addr_len);
		data[i] = (u8)val;
	}

	spin_unlock_irq(&cp->lock);
	return 0;
}

static int cp_set_eeprom(struct net_device *dev,
			 struct ethtool_eeprom *eeprom, u8 *data)
{
	struct cp_private *cp = netdev_priv(dev);
	unsigned int addr_len;
	u16 val;
	u32 offset = eeprom->offset >> 1;
	u32 len = eeprom->len;
	u32 i = 0;

	if (eeprom->magic != CP_EEPROM_MAGIC)
		return -EINVAL;

	spin_lock_irq(&cp->lock);

	addr_len = read_eeprom(cp->regs, 0, 8) == 0x8129 ? 8 : 6;

	if (eeprom->offset & 1) {
		val = read_eeprom(cp->regs, offset, addr_len) & 0xff;
		val |= (u16)data[i++] << 8;
		write_eeprom(cp->regs, offset, val, addr_len);
		offset++;
	}

	while (i < len - 1) {
		val = (u16)data[i++];
		val |= (u16)data[i++] << 8;
		write_eeprom(cp->regs, offset, val, addr_len);
		offset++;
	}

	if (i < len) {
		val = read_eeprom(cp->regs, offset, addr_len) & 0xff00;
		val |= (u16)data[i];
		write_eeprom(cp->regs, offset, val, addr_len);
	}

	spin_unlock_irq(&cp->lock);
	return 0;
}

/* Put the board into D3cold state and wait for WakeUp signal */
/* Put the board into D3cold state and wait for WakeUp signal */
static void cp_set_d3_state (struct cp_private *cp)
static void cp_set_d3_state (struct cp_private *cp)
{
{
+6 −4
Original line number Original line Diff line number Diff line
@@ -275,12 +275,14 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
	int send_length = skb->len, output_page;
	int send_length = skb->len, output_page;
	unsigned long flags;
	unsigned long flags;
	char buf[ETH_ZLEN];
	char *data = skb->data;


	if (skb->len < ETH_ZLEN) {
	if (skb->len < ETH_ZLEN) {
		skb = skb_padto(skb, ETH_ZLEN);
		memset(buf, 0, ETH_ZLEN);	/* more efficient than doing just the needed bits */
		if (skb == NULL)
		memcpy(buf, data, skb->len);
			return 0;
		send_length = ETH_ZLEN;
		send_length = ETH_ZLEN;
		data = buf;
	}
	}


	/* Mask interrupts from the ethercard. 
	/* Mask interrupts from the ethercard. 
@@ -347,7 +349,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
	 * trigger the send later, upon receiving a Tx done interrupt.
	 * trigger the send later, upon receiving a Tx done interrupt.
	 */
	 */
	 
	 
	ei_block_output(dev, send_length, skb->data, output_page);
	ei_block_output(dev, send_length, data, output_page);
		
		
	if (! ei_local->txing) 
	if (! ei_local->txing) 
	{
	{
+13 −2
Original line number Original line Diff line number Diff line
@@ -854,6 +854,17 @@ config SMC9194
	  <file:Documentation/networking/net-modules.txt>. The module
	  <file:Documentation/networking/net-modules.txt>. The module
	  will be called smc9194.
	  will be called smc9194.


config NET_NETX
	tristate "NetX Ethernet support"
	select MII
	depends on NET_ETHERNET && ARCH_NETX
	help
	  This is support for the Hilscher netX builtin Ethernet ports

	  To compile this driver as a module, choose M here and read
	  <file:Documentation/networking/net-modules.txt>. The module
	  will be called netx-eth.

config DM9000
config DM9000
	tristate "DM9000 support"
	tristate "DM9000 support"
	depends on (ARM || MIPS) && NET_ETHERNET
	depends on (ARM || MIPS) && NET_ETHERNET
@@ -1376,8 +1387,8 @@ config APRICOT
	  called apricot.
	  called apricot.


config B44
config B44
	tristate "Broadcom 4400 ethernet support (EXPERIMENTAL)"
	tristate "Broadcom 4400 ethernet support"
	depends on NET_PCI && PCI && EXPERIMENTAL
	depends on NET_PCI && PCI
	select MII
	select MII
	help
	help
	  If you have a network (Ethernet) controller of this type, say Y and
	  If you have a network (Ethernet) controller of this type, say Y and
+1 −0
Original line number Original line Diff line number Diff line
@@ -187,6 +187,7 @@ obj-$(CONFIG_MACSONIC) += macsonic.o
obj-$(CONFIG_MACMACE) += macmace.o
obj-$(CONFIG_MACMACE) += macmace.o
obj-$(CONFIG_MAC89x0) += mac89x0.o
obj-$(CONFIG_MAC89x0) += mac89x0.o
obj-$(CONFIG_TUN) += tun.o
obj-$(CONFIG_TUN) += tun.o
obj-$(CONFIG_NET_NETX) += netx-eth.o
obj-$(CONFIG_DL2K) += dl2k.o
obj-$(CONFIG_DL2K) += dl2k.o
obj-$(CONFIG_R8169) += r8169.o
obj-$(CONFIG_R8169) += r8169.o
obj-$(CONFIG_AMD8111_ETH) += amd8111e.o
obj-$(CONFIG_AMD8111_ETH) += amd8111e.o
Loading