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

Commit 1f1c2881 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: (37 commits)
  forcedeth bug fix: realtek phy
  forcedeth bug fix: vitesse phy
  forcedeth bug fix: cicada phy
  atl1: reorder atl1_main functions
  atl1: fix excessively indented code
  atl1: cleanup atl1_main
  atl1: header file cleanup
  atl1: remove irq_sem
  cdc-subset to support new vendor/product ID
  8139cp: implement the missing dev->tx_timeout
  myri10ge: Remove nonsensical limit in the tx done routine
  gianfar: kill unused header
  EP93XX_ETH must select MII
  macb: Add multicast capability
  macb: Use generic PHY layer
  s390: add barriers to qeth driver
  s390: scatter-gather for inbound traffic in qeth driver
  eHEA: Introducing support vor DLPAR memory add
  Fix a potential NULL pointer dereference in free_shared_mem() in drivers/net/s2io.c
  [PATCH] softmac: Fix ESSID problem
  ...
parents 7608a864 c5e3ae88
Loading
Loading
Loading
Loading
+24 −3
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@

	TODO:
	* Test Tx checksumming thoroughly
	* Implement dev->tx_timeout

	Low priority TODO:
	* Complete reset on PciErr
@@ -1218,6 +1217,30 @@ static int cp_close (struct net_device *dev)
	return 0;
}

static void cp_tx_timeout(struct net_device *dev)
{
	struct cp_private *cp = netdev_priv(dev);
	unsigned long flags;
	int rc;

	printk(KERN_WARNING "%s: Transmit timeout, status %2x %4x %4x %4x\n",
	       dev->name, cpr8(Cmd), cpr16(CpCmd),
	       cpr16(IntrStatus), cpr16(IntrMask));

	spin_lock_irqsave(&cp->lock, flags);

	cp_stop_hw(cp);
	cp_clean_rings(cp);
	rc = cp_init_rings(cp);
	cp_start_hw(cp);

	netif_wake_queue(dev);

	spin_unlock_irqrestore(&cp->lock, flags);

	return;
}

#ifdef BROKEN
static int cp_change_mtu(struct net_device *dev, int new_mtu)
{
@@ -1920,10 +1943,8 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
	dev->change_mtu = cp_change_mtu;
#endif
	dev->ethtool_ops = &cp_ethtool_ops;
#if 0
	dev->tx_timeout = cp_tx_timeout;
	dev->watchdog_timeo = TX_TIMEOUT;
#endif

#if CP_VLAN_TAG_USED
	dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
+1 −1
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ config MII
config MACB
	tristate "Atmel MACB support"
	depends on AVR32 || ARCH_AT91SAM9260 || ARCH_AT91SAM9263
	select MII
	select PHYLIB
	help
	  The Atmel MACB ethernet interface is found on many AT32 and AT91
	  parts. Say Y to include support for the MACB chip.
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ config ARM_AT91_ETHER
config EP93XX_ETH
	tristate "EP93xx Ethernet support"
	depends on ARM && ARCH_EP93XX
	select MII
	help
	  This is a driver for the ethernet hardware included in EP93xx CPUs.
	  Say Y if you are building a kernel for EP93xx based devices.
+80 −76
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ extern const struct ethtool_ops atl1_ethtool_ops;
struct atl1_adapter;

#define ATL1_MAX_INTR		3
#define ATL1_MAX_TX_BUF_LEN	0x3000	/* 12288 bytes */

#define ATL1_DEFAULT_TPD	256
#define ATL1_MAX_TPD		1024
@@ -57,29 +58,45 @@ struct atl1_adapter;
#define ATL1_RRD_DESC(R, i)	ATL1_GET_DESC(R, i, struct rx_return_desc)

/*
 * This detached comment is preserved for documentation purposes only.
 * It was originally attached to some code that got deleted, but seems
 * important enough to keep around...
 *
 * <begin detached comment>
 * Some workarounds require millisecond delays and are run during interrupt
 * context.  Most notably, when establishing link, the phy may need tweaking
 * but cannot process phy register reads/writes faster than millisecond
 * intervals...and we establish link due to a "link status change" interrupt.
 * <end detached comment>
 */

/*
 * atl1_ring_header represents a single, contiguous block of DMA space
 * mapped for the three descriptor rings (tpd, rfd, rrd) and the two
 * message blocks (cmb, smb) described below
 */
struct atl1_ring_header {
	void *desc;		/* virtual address */
	dma_addr_t dma;		/* physical address*/
	unsigned int size;	/* length in bytes */
};

/*
 * wrapper around a pointer to a socket buffer,
 * so a DMA handle can be stored along with the buffer
 * atl1_buffer is wrapper around a pointer to a socket buffer
 * so a DMA handle can be stored along with the skb
 */
struct atl1_buffer {
	struct sk_buff *skb;
	u16 length;
	u16 alloced;
	struct sk_buff *skb;	/* socket buffer */
	u16 length;		/* rx buffer length */
	u16 alloced;		/* 1 if skb allocated */
	dma_addr_t dma;
};

#define MAX_TX_BUF_LEN		0x3000	/* 12KB */

/* transmit packet descriptor (tpd) ring */
struct atl1_tpd_ring {
	void *desc;		/* pointer to the descriptor ring memory */
	dma_addr_t dma;		/* physical adress of the descriptor ring */
	u16 size;		/* length of descriptor ring in bytes */
	void *desc;		/* descriptor ring virtual address */
	dma_addr_t dma;		/* descriptor ring physical address */
	u16 size;		/* descriptor ring length in bytes */
	u16 count;		/* number of descriptors in the ring */
	u16 hw_idx;		/* hardware index */
	atomic_t next_to_clean;
@@ -87,36 +104,34 @@ struct atl1_tpd_ring {
	struct atl1_buffer *buffer_info;
};

/* receive free descriptor (rfd) ring */
struct atl1_rfd_ring {
	void *desc;
	dma_addr_t dma;
	u16 size;
	u16 count;
	void *desc;		/* descriptor ring virtual address */
	dma_addr_t dma;		/* descriptor ring physical address */
	u16 size;		/* descriptor ring length in bytes */
	u16 count;		/* number of descriptors in the ring */
	atomic_t next_to_use;
	u16 next_to_clean;
	struct atl1_buffer *buffer_info;
};

/* receive return descriptor (rrd) ring */
struct atl1_rrd_ring {
	void *desc;
	dma_addr_t dma;
	unsigned int size;
	u16 count;
	void *desc;		/* descriptor ring virtual address */
	dma_addr_t dma;		/* descriptor ring physical address */
	unsigned int size;	/* descriptor ring length in bytes */
	u16 count;		/* number of descriptors in the ring */
	u16 next_to_use;
	atomic_t next_to_clean;
};

struct atl1_ring_header {
	void *desc;		/* pointer to the descriptor ring memory */
	dma_addr_t dma;		/* physical adress of the descriptor ring */
	unsigned int size;	/* length of descriptor ring in bytes */
};

/* coalescing message block (cmb) */
struct atl1_cmb {
	struct coals_msg_block *cmb;
	dma_addr_t dma;
};

/* statistics message block (smb) */
struct atl1_smb {
	struct stats_msg_block *smb;
	dma_addr_t dma;
@@ -141,24 +156,26 @@ struct atl1_sft_stats {
	u64 tx_aborted_errors;
	u64 tx_window_errors;
	u64 tx_carrier_errors;

	u64 tx_pause;		/* num Pause packet transmitted. */
	u64 excecol;		/* num tx packets aborted due to excessive collisions. */
	u64 deffer;		/* num deferred tx packets */
	u64 scc;		/* num packets subsequently transmitted successfully w/ single prior collision. */
	u64 mcc;		/* num packets subsequently transmitted successfully w/ multiple prior collisions. */
	u64 tx_pause;		/* num pause packets transmitted. */
	u64 excecol;		/* num tx packets w/ excessive collisions. */
	u64 deffer;		/* num tx packets deferred */
	u64 scc;		/* num packets subsequently transmitted
				 * successfully w/ single prior collision. */
	u64 mcc;		/* num packets subsequently transmitted
				 * successfully w/ multiple prior collisions. */
	u64 latecol;		/* num tx packets  w/ late collisions. */
	u64 tx_underun;		/* num tx packets aborted due to transmit FIFO underrun, or TRD FIFO underrun */
	u64 tx_trunc;		/* num tx packets truncated due to size exceeding MTU, regardless whether truncated by Selene or not. (The name doesn't really reflect the meaning in this case.) */
	u64 tx_underun;		/* num tx packets aborted due to transmit
				 * FIFO underrun, or TRD FIFO underrun */
	u64 tx_trunc;		/* num tx packets truncated due to size
				 * exceeding MTU, regardless whether truncated
				 * by the chip or not. (The name doesn't really
				 * reflect the meaning in this case.) */
	u64 rx_pause;		/* num Pause packets received. */
	u64 rx_rrd_ov;
	u64 rx_trunc;
};

/* board specific private data structure */
#define ATL1_REGS_LEN	8

/* Structure containing variables used by the shared code */
/* hardware structure */
struct atl1_hw {
	u8 __iomem *hw_addr;
	struct atl1_adapter *back;
@@ -167,24 +184,35 @@ struct atl1_hw {
	enum atl1_dma_req_block dmar_block;
	enum atl1_dma_req_block dmaw_block;
	u8 preamble_len;
	u8 max_retry;		/* Retransmission maximum, after which the packet will be discarded */
	u8 jam_ipg;		/* IPG to start JAM for collision based flow control in half-duplex mode. In units of 8-bit time */
	u8 ipgt;		/* Desired back to back inter-packet gap. The default is 96-bit time */
	u8 min_ifg;		/* Minimum number of IFG to enforce in between RX frames. Frame gap below such IFP is dropped */
	u8 max_retry;		/* Retransmission maximum, after which the
				 * packet will be discarded */
	u8 jam_ipg;		/* IPG to start JAM for collision based flow
				 * control in half-duplex mode. In units of
				 * 8-bit time */
	u8 ipgt;		/* Desired back to back inter-packet gap.
				 * The default is 96-bit time */
	u8 min_ifg;		/* Minimum number of IFG to enforce in between
				 * receive frames. Frame gap below such IFP
				 * is dropped */
	u8 ipgr1;		/* 64bit Carrier-Sense window */
	u8 ipgr2;		/* 96-bit IPG window */
	u8 tpd_burst;		/* Number of TPD to prefetch in cache-aligned burst. Each TPD is 16 bytes long */
	u8 rfd_burst;		/* Number of RFD to prefetch in cache-aligned burst. Each RFD is 12 bytes long */
	u8 tpd_burst;		/* Number of TPD to prefetch in cache-aligned
				 * burst. Each TPD is 16 bytes long */
	u8 rfd_burst;		/* Number of RFD to prefetch in cache-aligned
				 * burst. Each RFD is 12 bytes long */
	u8 rfd_fetch_gap;
	u8 rrd_burst;		/* Threshold number of RRDs that can be retired in a burst. Each RRD is 16 bytes long */
	u8 rrd_burst;		/* Threshold number of RRDs that can be retired
				 * in a burst. Each RRD is 16 bytes long */
	u8 tpd_fetch_th;
	u8 tpd_fetch_gap;
	u16 tx_jumbo_task_th;
	u16 txf_burst;		/* Number of data bytes to read in a cache-aligned burst. Each SRAM entry is
				   8 bytes long */
	u16 rx_jumbo_th;	/* Jumbo packet size for non-VLAN packet. VLAN packets should add 4 bytes */
	u16 txf_burst;		/* Number of data bytes to read in a cache-
				 * aligned burst. Each SRAM entry is 8 bytes */
	u16 rx_jumbo_th;	/* Jumbo packet size for non-VLAN packet. VLAN
				 * packets should add 4 bytes */
	u16 rx_jumbo_lkah;
	u16 rrd_ret_timer;	/* RRD retirement timer. Decrement by 1 after every 512ns passes. */
	u16 rrd_ret_timer;	/* RRD retirement timer. Decrement by 1 after
				 * every 512ns passes. */
	u16 lcol;		/* Collision Window */

	u16 cmb_tpd;
@@ -194,48 +222,35 @@ struct atl1_hw {
	u32 smb_timer;
	u16 media_type;
	u16 autoneg_advertised;
	u16 pci_cmd_word;

	u16 mii_autoneg_adv_reg;
	u16 mii_1000t_ctrl_reg;

	u32 mem_rang;
	u32 txcw;
	u32 max_frame_size;
	u32 min_frame_size;
	u32 mc_filter_type;
	u32 num_mc_addrs;
	u32 collision_delta;
	u32 tx_packet_delta;
	u16 phy_spd_default;

	u16 dev_rev;

	/* spi flash */
	u8 flash_vendor;

	u8 dma_fairness;
	u8 mac_addr[ETH_ALEN];
	u8 perm_mac_addr[ETH_ALEN];

	/* bool phy_preamble_sup; */
	bool phy_configured;
};

struct atl1_adapter {
	/* OS defined structs */
	struct net_device *netdev;
	struct pci_dev *pdev;
	struct net_device_stats net_stats;
	struct atl1_sft_stats soft_stats;

	struct vlan_group *vlgrp;
	u32 rx_buffer_len;
	u32 wol;
	u16 link_speed;
	u16 link_duplex;
	spinlock_t lock;
	atomic_t irq_sem;
	struct work_struct tx_timeout_task;
	struct work_struct link_chg_task;
	struct work_struct pcie_dma_to_rst_task;
@@ -243,9 +258,7 @@ struct atl1_adapter {
	struct timer_list phy_config_timer;
	bool phy_timer_pending;

	bool mac_disabled;

	/* All descriptor rings' memory */
	/* all descriptor rings' memory */
	struct atl1_ring_header ring_header;

	/* TX */
@@ -258,16 +271,9 @@ struct atl1_adapter {
	u64 hw_csum_err;
	u64 hw_csum_good;

	u32 gorcl;
	u64 gorcl_old;

	/* Interrupt Moderator timer ( 2us resolution) */
	u16 imt;
	/* Interrupt Clear timer (2us resolution) */
	u16 ict;

	/* MII interface info */
	struct mii_if_info mii;
	u16 imt;	/* interrupt moderator timer (2us resolution */
	u16 ict;	/* interrupt clear timer (2us resolution */
	struct mii_if_info mii;		/* MII interface info */

	/* structs defined in atl1_hw.h */
	u32 bd_number;			/* board number */
@@ -275,8 +281,6 @@ struct atl1_adapter {
	struct atl1_hw hw;
	struct atl1_smb smb;
	struct atl1_cmb cmb;

	u32 pci_state[16];
};

#endif	/* _ATL1_H_ */
+1331 −1323

File changed.

Preview size limit exceeded, changes collapsed.

Loading