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

Commit f3cab8a0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [NETFILTER]: Rename init functions.
  [TCP]: Fix RFC2465 typo.
  [INET]: Introduce tunnel4/tunnel6
  [NET]: deinline 200+ byte inlines in sock.h
  [ECONET]: Convert away from SOCKOPS_WRAPPED
  [NET]: Fix ipx/econet/appletalk/irda ioctl crashes
  [NET]: Kill Documentation/networking/TODO
  [TG3]: Update version and reldate
  [TG3]: Skip timer code during full lock
  [TG3]: Speed up SRAM access
  [TG3]: Fix PHY loopback on 5700
  [TG3]: Fix bug in 40-bit DMA workaround code
  [TG3]: Fix probe failure due to invalid MAC address
parents 76babde1 65b4b4e8
Loading
Loading
Loading
Loading

Documentation/networking/TODO

deleted100644 → 0
+0 −18
Original line number Diff line number Diff line
To-do items for network drivers
-------------------------------

* Move ethernet crc routine to generic code

* (for 2.5) Integrate Jamal Hadi Salim's netdev Rx polling API change

* Audit all net drivers to make sure magic packet / wake-on-lan /
  similar features are disabled in the driver by default.

* Audit all net drivers to make sure the module always prints out a
  version string when loaded as a module, but only prints a version
  string when built into the kernel if a device is detected.

* Add ETHTOOL_GDRVINFO ioctl support to all ethernet drivers.

* dmfe PCI DMA is totally wrong and only works on x86
+1 −0
Original line number Diff line number Diff line
@@ -1885,6 +1885,7 @@ NETWORKING [GENERAL]
P:	Networking Team
M:	netdev@vger.kernel.org
L:	netdev@vger.kernel.org
W:	http://linux-net.osdl.org/
S:	Maintained

NETWORKING [IPv4/IPv6]
+69 −49
Original line number Diff line number Diff line
@@ -69,8 +69,8 @@

#define DRV_MODULE_NAME		"tg3"
#define PFX DRV_MODULE_NAME	": "
#define DRV_MODULE_VERSION	"3.54"
#define DRV_MODULE_RELDATE	"Mar 23, 2006"
#define DRV_MODULE_VERSION	"3.55"
#define DRV_MODULE_RELDATE	"Mar 27, 2006"

#define TG3_DEF_MAC_MODE	0
#define TG3_DEF_RX_MODE		0
@@ -497,21 +497,20 @@ static void tg3_write_mem(struct tg3 *tp, u32 off, u32 val)
	unsigned long flags;

	spin_lock_irqsave(&tp->indirect_lock, flags);
	if (tp->write32 != tg3_write_indirect_reg32) {
		tw32_f(TG3PCI_MEM_WIN_BASE_ADDR, off);
		tw32_f(TG3PCI_MEM_WIN_DATA, val);

		/* Always leave this as zero. */
		tw32_f(TG3PCI_MEM_WIN_BASE_ADDR, 0);
	} else {
		pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off);
		pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val);

		/* Always leave this as zero. */
		pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0);
	spin_unlock_irqrestore(&tp->indirect_lock, flags);
	}

static void tg3_write_mem_fast(struct tg3 *tp, u32 off, u32 val)
{
	/* If no workaround is needed, write to mem space directly */
	if (tp->write32 != tg3_write_indirect_reg32)
		tw32(NIC_SRAM_WIN_BASE + off, val);
	else
		tg3_write_mem(tp, off, val);
	spin_unlock_irqrestore(&tp->indirect_lock, flags);
}

static void tg3_read_mem(struct tg3 *tp, u32 off, u32 *val)
@@ -519,11 +518,19 @@ static void tg3_read_mem(struct tg3 *tp, u32 off, u32 *val)
	unsigned long flags;

	spin_lock_irqsave(&tp->indirect_lock, flags);
	if (tp->write32 != tg3_write_indirect_reg32) {
		tw32_f(TG3PCI_MEM_WIN_BASE_ADDR, off);
		*val = tr32(TG3PCI_MEM_WIN_DATA);

		/* Always leave this as zero. */
		tw32_f(TG3PCI_MEM_WIN_BASE_ADDR, 0);
	} else {
		pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off);
		pci_read_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val);

		/* Always leave this as zero. */
		pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0);
	}
	spin_unlock_irqrestore(&tp->indirect_lock, flags);
}

@@ -1367,12 +1374,12 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
		}
	}

	tg3_write_sig_post_reset(tp, RESET_KIND_SHUTDOWN);

	/* Finally, set the new power state. */
	pci_write_config_word(tp->pdev, pm + PCI_PM_CTRL, power_control);
	udelay(100);	/* Delay after power state change */

	tg3_write_sig_post_reset(tp, RESET_KIND_SHUTDOWN);

	return 0;
}

@@ -3600,7 +3607,7 @@ static inline int tg3_40bit_overflow_test(struct tg3 *tp, dma_addr_t mapping,
					  int len)
{
#if defined(CONFIG_HIGHMEM) && (BITS_PER_LONG == 64)
	if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)
	if (tp->tg3_flags & TG3_FLAG_40BIT_DMA_BUG)
		return (((u64) mapping + len) > DMA_40BIT_MASK);
	return 0;
#else
@@ -6461,6 +6468,9 @@ static void tg3_timer(unsigned long __opaque)
{
	struct tg3 *tp = (struct tg3 *) __opaque;

	if (tp->irq_sync)
		goto restart_timer;

	spin_lock(&tp->lock);

	if (!(tp->tg3_flags & TG3_FLAG_TAGGED_STATUS)) {
@@ -6537,11 +6547,11 @@ static void tg3_timer(unsigned long __opaque)
		if (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) {
			u32 val;

			tg3_write_mem_fast(tp, NIC_SRAM_FW_CMD_MBOX,
			tg3_write_mem(tp, NIC_SRAM_FW_CMD_MBOX,
				      FWCMD_NICDRV_ALIVE2);
			tg3_write_mem_fast(tp, NIC_SRAM_FW_CMD_LEN_MBOX, 4);
			tg3_write_mem(tp, NIC_SRAM_FW_CMD_LEN_MBOX, 4);
			/* 5 seconds timeout */
			tg3_write_mem_fast(tp, NIC_SRAM_FW_CMD_DATA_MBOX, 5);
			tg3_write_mem(tp, NIC_SRAM_FW_CMD_DATA_MBOX, 5);
			val = tr32(GRC_RX_CPU_EVENT);
			val |= (1 << 14);
			tw32(GRC_RX_CPU_EVENT, val);
@@ -6551,6 +6561,7 @@ static void tg3_timer(unsigned long __opaque)

	spin_unlock(&tp->lock);

restart_timer:
	tp->timer.expires = jiffies + tp->timer_offset;
	add_timer(&tp->timer);
}
@@ -8399,8 +8410,11 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
		}
		mac_mode = (tp->mac_mode & ~MAC_MODE_PORT_MODE_MASK) |
			   MAC_MODE_LINK_POLARITY | MAC_MODE_PORT_MODE_GMII;
		if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401)
		if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401) {
			mac_mode &= ~MAC_MODE_LINK_POLARITY;
			tg3_writephy(tp, MII_TG3_EXT_CTRL,
				     MII_TG3_EXT_CTRL_LNK3_LED_MODE);
		}
		tw32(MAC_MODE, mac_mode);
	}
	else
@@ -10531,6 +10545,7 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
{
	struct net_device *dev = tp->dev;
	u32 hi, lo, mac_offset;
	int addr_ok = 0;

#ifdef CONFIG_SPARC64
	if (!tg3_get_macaddr_sparc(tp))
@@ -10560,9 +10575,13 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
		dev->dev_addr[3] = (lo >> 16) & 0xff;
		dev->dev_addr[4] = (lo >>  8) & 0xff;
		dev->dev_addr[5] = (lo >>  0) & 0xff;

		/* Some old bootcode may report a 0 MAC address in SRAM */
		addr_ok = is_valid_ether_addr(&dev->dev_addr[0]);
	}
	if (!addr_ok) {
		/* Next, try NVRAM. */
	else if (!(tp->tg3_flags & TG3_FLG2_SUN_570X) &&
		if (!(tp->tg3_flags & TG3_FLG2_SUN_570X) &&
		    !tg3_nvram_read(tp, mac_offset + 0, &hi) &&
		    !tg3_nvram_read(tp, mac_offset + 4, &lo)) {
			dev->dev_addr[0] = ((hi >> 16) & 0xff);
@@ -10584,6 +10603,7 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
			dev->dev_addr[1] = hi & 0xff;
			dev->dev_addr[0] = (hi >> 8) & 0xff;
		}
	}

	if (!is_valid_ether_addr(&dev->dev_addr[0])) {
#ifdef CONFIG_SPARC64
+4 −87
Original line number Diff line number Diff line
@@ -938,28 +938,7 @@ static inline void sock_put(struct sock *sk)
		sk_free(sk);
}

static inline int sk_receive_skb(struct sock *sk, struct sk_buff *skb)
{
	int rc = NET_RX_SUCCESS;

	if (sk_filter(sk, skb, 0))
		goto discard_and_relse;

	skb->dev = NULL;

	bh_lock_sock(sk);
	if (!sock_owned_by_user(sk))
		rc = sk->sk_backlog_rcv(sk, skb);
	else
		sk_add_backlog(sk, skb);
	bh_unlock_sock(sk);
out:
	sock_put(sk);
	return rc;
discard_and_relse:
	kfree_skb(skb);
	goto out;
}
extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb);

/* Detach socket from process context.
 * Announce socket dead, detach it from wait queue and inode.
@@ -1044,33 +1023,9 @@ sk_dst_reset(struct sock *sk)
	write_unlock(&sk->sk_dst_lock);
}

static inline struct dst_entry *
__sk_dst_check(struct sock *sk, u32 cookie)
{
	struct dst_entry *dst = sk->sk_dst_cache;

	if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) {
		sk->sk_dst_cache = NULL;
		dst_release(dst);
		return NULL;
	}

	return dst;
}

static inline struct dst_entry *
sk_dst_check(struct sock *sk, u32 cookie)
{
	struct dst_entry *dst = sk_dst_get(sk);

	if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) {
		sk_dst_reset(sk);
		dst_release(dst);
		return NULL;
	}
extern struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie);

	return dst;
}
extern struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie);

static inline void sk_setup_caps(struct sock *sk, struct dst_entry *dst)
{
@@ -1140,45 +1095,7 @@ extern void sk_reset_timer(struct sock *sk, struct timer_list* timer,

extern void sk_stop_timer(struct sock *sk, struct timer_list* timer);

static inline int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
{
	int err = 0;
	int skb_len;

	/* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
	   number of warnings when compiling with -W --ANK
	 */
	if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
	    (unsigned)sk->sk_rcvbuf) {
		err = -ENOMEM;
		goto out;
	}

	/* It would be deadlock, if sock_queue_rcv_skb is used
	   with socket lock! We assume that users of this
	   function are lock free.
	*/
	err = sk_filter(sk, skb, 1);
	if (err)
		goto out;

	skb->dev = NULL;
	skb_set_owner_r(skb, sk);

	/* Cache the SKB length before we tack it onto the receive
	 * queue.  Once it is added it no longer belongs to us and
	 * may be freed by other threads of control pulling packets
	 * from the queue.
	 */
	skb_len = skb->len;

	skb_queue_tail(&sk->sk_receive_queue, skb);

	if (!sock_flag(sk, SOCK_DEAD))
		sk->sk_data_ready(sk, skb_len);
out:
	return err;
}
extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);

static inline int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
{
+11 −5
Original line number Diff line number Diff line
@@ -864,13 +864,19 @@ struct xfrm_algo_desc {
/* XFRM tunnel handlers.  */
struct xfrm_tunnel {
	int (*handler)(struct sk_buff *skb);
	void (*err_handler)(struct sk_buff *skb, __u32 info);
	int (*err_handler)(struct sk_buff *skb, __u32 info);

	struct xfrm_tunnel *next;
	int priority;
};

struct xfrm6_tunnel {
	int (*handler)(struct sk_buff **pskb);
	void (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt,
	int (*handler)(struct sk_buff *skb);
	int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt,
			   int type, int code, int offset, __u32 info);

	struct xfrm6_tunnel *next;
	int priority;
};

extern void xfrm_init(void);
@@ -906,7 +912,7 @@ extern int xfrm4_rcv(struct sk_buff *skb);
extern int xfrm4_output(struct sk_buff *skb);
extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler);
extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler);
extern int xfrm6_rcv_spi(struct sk_buff **pskb, u32 spi);
extern int xfrm6_rcv_spi(struct sk_buff *skb, u32 spi);
extern int xfrm6_rcv(struct sk_buff **pskb);
extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler);
extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler);
Loading