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

Commit a2e4e108 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (77 commits)
  [IPV6]: Reorg struct ifmcaddr6 to save some bytes
  [INET_TIMEWAIT_SOCK]: Reorganize struct inet_timewait_sock to save some bytes
  [DCCP]: Reorganize struct dccp_sock to save 8 bytes
  [INET6]: Reorganize struct inet6_dev to save 8 bytes
  [SOCK] proto: Add hashinfo member to struct proto
  EMAC driver: Fix bug: The clock divisor is set to all ones at reset.
  EMAC driver: fix bug - invalidate data cache of new_skb->data range when cache is WB
  EMAC driver: add power down mode
  EMAC driver: ADSP-BF52x arch/mach support
  EMAC driver: use simpler comment headers and strip out information that is maintained in the scm's log
  EMAC driver: bf537 MAC multicast hash filtering patch
  EMAC driver: define MDC_CLK=2.5MHz and caculate mdc_div according to SCLK.
  EMAC driver: shorten the mdelay value to solve netperf performance issue
  [netdrvr] sis190: build fix
  sky2: fix Wake On Lan interaction with BIOS
  sky2: restore multicast addresses after recovery
  pci-skeleton: Misc fixes to build neatly
  phylib: Add Realtek 821x eth PHY support
  natsemi: Update locking documentation
  PHYLIB: Locking fixes for PHY I/O potentially sleeping
  ...
parents a6cc48ee a80f509f
Loading
Loading
Loading
Loading
+0 −25
Original line number Diff line number Diff line
@@ -84,13 +84,6 @@ S: Status, one of the following:
			it has been replaced by a better system and you
			should be using that.

3C359 NETWORK DRIVER
P:	Mike Phillips
M:	mikep@linuxtr.net
L:	netdev@vger.kernel.org
W:	http://www.linuxtr.net
S:	Maintained

3C505 NETWORK DRIVER
P:	Philip Blundell
M:	philb@gnu.org
@@ -939,8 +932,6 @@ M: maxk@qualcomm.com
S:	Maintained

BONDING DRIVER
P:	Chad Tindel
M:	ctindel@users.sourceforge.net
P:	Jay Vosburgh
M:	fubar@us.ibm.com
L:	bonding-devel@lists.sourceforge.net
@@ -2864,15 +2855,6 @@ L: ocfs2-devel@oss.oracle.com
W:	http://oss.oracle.com/projects/ocfs2/
S:	Supported

OLYMPIC NETWORK DRIVER
P:	Peter De Shrijver
M:	p2@ace.ulyssis.student.kuleuven.ac.be
P:	Mike Phillips
M:	mikep@linuxtr.net
L:	netdev@vger.kernel.org
W:	http://www.linuxtr.net
S:	Maintained

OMNIKEY CARDMAN 4000 DRIVER
P:	Harald Welte
M:	laforge@gnumonks.org
@@ -3788,13 +3770,6 @@ L: tlan-devel@lists.sourceforge.net (subscribers-only)
W:	http://sourceforge.net/projects/tlan/
S:	Maintained

TOKEN-RING NETWORK DRIVER
P:	Mike Phillips
M:	mikep@linuxtr.net
L:	netdev@vger.kernel.org
W:	http://www.linuxtr.net
S:	Maintained

TOSHIBA ACPI EXTRAS DRIVER
P:	John Belmonte
M:	toshiba_acpi@memebeam.org
+6 −5
Original line number Diff line number Diff line
@@ -814,8 +814,8 @@ config ULTRA32
	  will be called smc-ultra32.

config BFIN_MAC
	tristate "Blackfin 536/537 on-chip mac support"
	depends on NET_ETHERNET && (BF537 || BF536) && (!BF537_PORT_H)
	tristate "Blackfin 527/536/537 on-chip mac support"
	depends on NET_ETHERNET && (BF527 || BF537 || BF536) && (!BF537_PORT_H)
	select CRC32
	select MII
	select PHYLIB
@@ -828,7 +828,7 @@ config BFIN_MAC

config BFIN_MAC_USE_L1
	bool "Use L1 memory for rx/tx packets"
	depends on BFIN_MAC && BF537
	depends on BFIN_MAC && (BF527 || BF537)
	default y
	help
	  To get maximum network performance, you should use L1 memory as rx/tx buffers.
@@ -855,7 +855,8 @@ config BFIN_RX_DESC_NUM
config BFIN_MAC_RMII
	bool "RMII PHY Interface (EXPERIMENTAL)"
	depends on BFIN_MAC && EXPERIMENTAL
	default n
	default y if BFIN527_EZKIT
	default n if BFIN537_STAMP
	help
	  Use Reduced PHY MII Interface

@@ -1199,7 +1200,7 @@ config NE2_MCA

config IBMLANA
	tristate "IBM LAN Adapter/A support"
	depends on MCA && MCA_LEGACY
	depends on MCA
	---help---
	  This is a Micro Channel Ethernet adapter.  You need to set
	  CONFIG_MCA to use this driver.  It is both available as an in-kernel
+1 −1
Original line number Diff line number Diff line
@@ -384,7 +384,7 @@ static void reset_phy(struct net_device *dev)
	/* Wait until PHY reset is complete */
	do {
		read_phy(lp->phy_address, MII_BMCR, &bmcr);
	} while (!(bmcr && BMCR_RESET));
	} while (!(bmcr & BMCR_RESET));

	disable_mdi();
	spin_unlock_irq(&lp->lock);
+23 −17
Original line number Diff line number Diff line
@@ -137,11 +137,12 @@ static int ax_initial_check(struct net_device *dev)
static void ax_reset_8390(struct net_device *dev)
{
	struct ei_device *ei_local = netdev_priv(dev);
	struct ax_device  *ax = to_ax_dev(dev);
	unsigned long reset_start_time = jiffies;
	void __iomem *addr = (void __iomem *)dev->base_addr;

	if (ei_debug > 1)
		printk(KERN_DEBUG "resetting the 8390 t=%ld...", jiffies);
		dev_dbg(&ax->dev->dev, "resetting the 8390 t=%ld\n", jiffies);

	ei_outb(ei_inb(addr + NE_RESET), addr + NE_RESET);

@@ -151,7 +152,7 @@ static void ax_reset_8390(struct net_device *dev)
	/* This check _should_not_ be necessary, omit eventually. */
	while ((ei_inb(addr + EN0_ISR) & ENISR_RESET) == 0) {
		if (jiffies - reset_start_time > 2*HZ/100) {
			printk(KERN_WARNING "%s: %s did not complete.\n",
			dev_warn(&ax->dev->dev, "%s: %s did not complete.\n",
			       __FUNCTION__, dev->name);
			break;
		}
@@ -165,11 +166,13 @@ static void ax_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
			    int ring_page)
{
	struct ei_device *ei_local = netdev_priv(dev);
	struct ax_device  *ax = to_ax_dev(dev);
	void __iomem *nic_base = ei_local->mem;

	/* This *shouldn't* happen. If it does, it's the last thing you'll see */
	if (ei_status.dmaing) {
		printk(KERN_EMERG "%s: DMAing conflict in %s [DMAstat:%d][irqlock:%d].\n",
		dev_err(&ax->dev->dev, "%s: DMAing conflict in %s "
			"[DMAstat:%d][irqlock:%d].\n",
			dev->name, __FUNCTION__,
			ei_status.dmaing, ei_status.irqlock);
		return;
@@ -204,13 +207,16 @@ static void ax_block_input(struct net_device *dev, int count,
			   struct sk_buff *skb, int ring_offset)
{
	struct ei_device *ei_local = netdev_priv(dev);
	struct ax_device  *ax = to_ax_dev(dev);
	void __iomem *nic_base = ei_local->mem;
	char *buf = skb->data;

	if (ei_status.dmaing) {
		printk(KERN_EMERG "%s: DMAing conflict in ax_block_input "
		dev_err(&ax->dev->dev,
			"%s: DMAing conflict in %s "
			"[DMAstat:%d][irqlock:%d].\n",
			dev->name, ei_status.dmaing, ei_status.irqlock);
			dev->name, __FUNCTION__,
			ei_status.dmaing, ei_status.irqlock);
		return;
	}

@@ -239,6 +245,7 @@ static void ax_block_output(struct net_device *dev, int count,
			    const unsigned char *buf, const int start_page)
{
	struct ei_device *ei_local = netdev_priv(dev);
	struct ax_device  *ax = to_ax_dev(dev);
	void __iomem *nic_base = ei_local->mem;
	unsigned long dma_start;

@@ -251,7 +258,7 @@ static void ax_block_output(struct net_device *dev, int count,

	/* This *shouldn't* happen. If it does, it's the last thing you'll see */
	if (ei_status.dmaing) {
		printk(KERN_EMERG "%s: DMAing conflict in %s."
		dev_err(&ax->dev->dev, "%s: DMAing conflict in %s."
			"[DMAstat:%d][irqlock:%d]\n",
			dev->name, __FUNCTION__,
		       ei_status.dmaing, ei_status.irqlock);
@@ -281,7 +288,8 @@ static void ax_block_output(struct net_device *dev, int count,

	while ((ei_inb(nic_base + EN0_ISR) & ENISR_RDC) == 0) {
		if (jiffies - dma_start > 2*HZ/100) {		/* 20ms */
			printk(KERN_WARNING "%s: timeout waiting for Tx RDC.\n", dev->name);
			dev_warn(&ax->dev->dev,
				 "%s: timeout waiting for Tx RDC.\n", dev->name);
			ax_reset_8390(dev);
			ax_NS8390_init(dev,1);
			break;
@@ -424,9 +432,10 @@ static void
ax_phy_write(struct net_device *dev, int phy_addr, int reg, int value)
{
	struct ei_device *ei = (struct ei_device *) netdev_priv(dev);
	struct ax_device  *ax = to_ax_dev(dev);
	unsigned long flags;

	printk(KERN_DEBUG "%s: %p, %04x, %04x %04x\n",
	dev_dbg(&ax->dev->dev, "%s: %p, %04x, %04x %04x\n",
		__FUNCTION__, dev, phy_addr, reg, value);

      	spin_lock_irqsave(&ei->page_lock, flags);
@@ -750,14 +759,11 @@ static int ax_init_dev(struct net_device *dev, int first_init)
	ax_NS8390_init(dev, 0);

	if (first_init) {
		printk("AX88796: %dbit, irq %d, %lx, MAC: ",
		       ei_status.word16 ? 16:8, dev->irq, dev->base_addr);

		for (i = 0; i < ETHER_ADDR_LEN; i++)
			printk("%2.2x%c", dev->dev_addr[i],
			       (i < (ETHER_ADDR_LEN-1) ? ':' : ' '));
		DECLARE_MAC_BUF(mac);

		printk("\n");
		dev_info(&ax->dev->dev, "%dbit, irq %d, %lx, MAC: %s\n",
			 ei_status.word16 ? 16:8, dev->irq, dev->base_addr,
			 print_mac(mac, dev->dev_addr));
	}

	ret = register_netdev(dev);
+69 −38
Original line number Diff line number Diff line
/*
 * File:	drivers/net/bfin_mac.c
 * Based on:
 * Maintainer:
 * 		Bryan Wu <bryan.wu@analog.com>
 * Blackfin On-Chip MAC Driver
 *
 * Original author:
 * 		Luke Yang <luke.yang@analog.com>
 * Copyright 2004-2007 Analog Devices Inc.
 *
 * Created:
 * Description:
 * Enter bugs at http://blackfin.uclinux.org/
 *
 * Modified:
 *		Copyright 2004-2006 Analog Devices Inc.
 *
 * Bugs:	Enter bugs at http://blackfin.uclinux.org/
 *
 * This program is free software ;  you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation ;  either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY ;  without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program ;  see the file COPYING.
 * If not, write to the Free Software Foundation,
 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 * Licensed under the GPL-2 or later.
 */

#include <linux/init.h>
@@ -65,7 +42,7 @@
#define DRV_NAME	"bfin_mac"
#define DRV_VERSION	"1.1"
#define DRV_AUTHOR	"Bryan Wu, Luke Yang"
#define DRV_DESC	"Blackfin BF53[67] on-chip Ethernet MAC driver"
#define DRV_DESC	"Blackfin BF53[67] BF527 on-chip Ethernet MAC driver"

MODULE_AUTHOR(DRV_AUTHOR);
MODULE_LICENSE("GPL");
@@ -296,7 +273,7 @@ static void mdio_poll(void)

	/* poll the STABUSY bit */
	while ((bfin_read_EMAC_STAADD()) & STABUSY) {
		mdelay(10);
		udelay(1);
		if (timeout_cnt-- < 0) {
			printk(KERN_ERR DRV_NAME
			": wait MDC/MDIO transaction to complete timeout\n");
@@ -412,20 +389,26 @@ static void bf537_adjust_link(struct net_device *dev)
	spin_unlock_irqrestore(&lp->lock, flags);
}

/* MDC  = 2.5 MHz */
#define MDC_CLK 2500000

static int mii_probe(struct net_device *dev)
{
	struct bf537mac_local *lp = netdev_priv(dev);
	struct phy_device *phydev = NULL;
	unsigned short sysctl;
	int i;
	u32 sclk, mdc_div;

	/* Enable PHY output early */
	if (!(bfin_read_VR_CTL() & PHYCLKOE))
		bfin_write_VR_CTL(bfin_read_VR_CTL() | PHYCLKOE);

	/* MDC  = 2.5 MHz */
	sclk = get_sclk();
	mdc_div = ((sclk / MDC_CLK) / 2) - 1;

	sysctl = bfin_read_EMAC_SYSCTL();
	sysctl |= SET_MDCDIV(24);
	sysctl = (sysctl & ~MDCDIV) | SET_MDCDIV(mdc_div);
	bfin_write_EMAC_SYSCTL(sysctl);

	/* search for connect PHY device */
@@ -477,8 +460,10 @@ static int mii_probe(struct net_device *dev)
	lp->phydev = phydev;

	printk(KERN_INFO "%s: attached PHY driver [%s] "
	       "(mii_bus:phy_addr=%s, irq=%d)\n",
	       DRV_NAME, phydev->drv->name, phydev->dev.bus_id, phydev->irq);
	       "(mii_bus:phy_addr=%s, irq=%d, mdc_clk=%dHz(mdc_div=%d)"
	       "@sclk=%dMHz)\n",
	       DRV_NAME, phydev->drv->name, phydev->dev.bus_id, phydev->irq,
	       MDC_CLK, mdc_div, sclk/1000000);

	return 0;
}
@@ -551,7 +536,7 @@ static void adjust_tx_list(void)
	 */
	if (current_tx_ptr->next->next == tx_list_head) {
		while (tx_list_head->status.status_word == 0) {
			mdelay(10);
			mdelay(1);
			if (tx_list_head->status.status_word != 0
			    || !(bfin_read_DMA2_IRQ_STATUS() & 0x08)) {
				goto adjust_head;
@@ -666,6 +651,12 @@ static void bf537mac_rx(struct net_device *dev)
	current_rx_ptr->skb = new_skb;
	current_rx_ptr->desc_a.start_addr = (unsigned long)new_skb->data - 2;

	/* Invidate the data cache of skb->data range when it is write back
	 * cache. It will prevent overwritting the new data from DMA
	 */
	blackfin_dcache_invalidate_range((unsigned long)new_skb->head,
					 (unsigned long)new_skb->end);

	len = (unsigned short)((current_rx_ptr->status.status_word) & RX_FRLEN);
	skb_put(skb, len);
	blackfin_dcache_invalidate_range((unsigned long)skb->head,
@@ -767,7 +758,7 @@ static void bf537mac_enable(void)

#if defined(CONFIG_BFIN_MAC_RMII)
	opmode |= RMII; /* For Now only 100MBit are supported */
#ifdef CONFIG_BF_REV_0_2
#if (defined(CONFIG_BF537) || defined(CONFIG_BF536)) && CONFIG_BF_REV_0_2
	opmode |= TE;
#endif
#endif
@@ -792,6 +783,39 @@ static void bf537mac_timeout(struct net_device *dev)
	netif_wake_queue(dev);
}

static void bf537mac_multicast_hash(struct net_device *dev)
{
	u32 emac_hashhi, emac_hashlo;
	struct dev_mc_list *dmi = dev->mc_list;
	char *addrs;
	int i;
	u32 crc;

	emac_hashhi = emac_hashlo = 0;

	for (i = 0; i < dev->mc_count; i++) {
		addrs = dmi->dmi_addr;
		dmi = dmi->next;

		/* skip non-multicast addresses */
		if (!(*addrs & 1))
			continue;

		crc = ether_crc(ETH_ALEN, addrs);
		crc >>= 26;

		if (crc & 0x20)
			emac_hashhi |= 1 << (crc & 0x1f);
		else
			emac_hashlo |= 1 << (crc & 0x1f);
	}

	bfin_write_EMAC_HASHHI(emac_hashhi);
	bfin_write_EMAC_HASHLO(emac_hashlo);

	return;
}

/*
 * This routine will, depending on the values passed to it,
 * either make it accept multicast packets, go into
@@ -807,11 +831,17 @@ static void bf537mac_set_multicast_list(struct net_device *dev)
		sysctl = bfin_read_EMAC_OPMODE();
		sysctl |= RAF;
		bfin_write_EMAC_OPMODE(sysctl);
	} else if (dev->flags & IFF_ALLMULTI || dev->mc_count) {
	} else if (dev->flags & IFF_ALLMULTI) {
		/* accept all multicast */
		sysctl = bfin_read_EMAC_OPMODE();
		sysctl |= PAM;
		bfin_write_EMAC_OPMODE(sysctl);
	} else if (dev->mc_count) {
		/* set up multicast hash table */
		sysctl = bfin_read_EMAC_OPMODE();
		sysctl |= HM;
		bfin_write_EMAC_OPMODE(sysctl);
		bf537mac_multicast_hash(dev);
	} else {
		/* clear promisc or multicast mode */
		sysctl = bfin_read_EMAC_OPMODE();
@@ -860,10 +890,10 @@ static int bf537mac_open(struct net_device *dev)
		return retval;

	phy_start(lp->phydev);
	phy_write(lp->phydev, MII_BMCR, BMCR_RESET);
	setup_system_regs(dev);
	bf537mac_disable();
	bf537mac_enable();

	pr_debug("hardware init finished\n");
	netif_start_queue(dev);
	netif_carrier_on(dev);
@@ -886,6 +916,7 @@ static int bf537mac_close(struct net_device *dev)
	netif_carrier_off(dev);

	phy_stop(lp->phydev);
	phy_write(lp->phydev, MII_BMCR, BMCR_PDOWN);

	/* clear everything */
	bf537mac_shutdown(dev);
@@ -970,7 +1001,7 @@ static int __init bf537mac_probe(struct net_device *dev)
	/* register irq handler */
	if (request_irq
	    (IRQ_MAC_RX, bf537mac_interrupt, IRQF_DISABLED | IRQF_SHARED,
	     "BFIN537_MAC_RX", dev)) {
	     "EMAC_RX", dev)) {
		printk(KERN_WARNING DRV_NAME
		       ": Unable to attach BlackFin MAC RX interrupt\n");
		return -EBUSY;
Loading