Skip to content

Commit

Permalink
Merge branch 'upstream' of master.kernel.org:/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/jgarzik/netdev-2.6
  • Loading branch information
Linus Torvalds committed Sep 8, 2005
2 parents 946e91f + 0edd5b4 commit 55faed1
Show file tree
Hide file tree
Showing 38 changed files with 5,357 additions and 2,306 deletions.
7 changes: 7 additions & 0 deletions drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2058,6 +2058,13 @@ config BNX2
To compile this driver as a module, choose M here: the module
will be called bnx2. This is recommended.

config SPIDER_NET
tristate "Spider Gigabit Ethernet driver"
depends on PCI && PPC_BPA
help
This driver supports the Gigabit Ethernet chips present on the
Cell Processor-Based Blades from IBM.

config GIANFAR
tristate "Gianfar Ethernet"
depends on 85xx || 83xx
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ obj-$(CONFIG_STNIC) += stnic.o 8390.o
obj-$(CONFIG_FEALNX) += fealnx.o
obj-$(CONFIG_TIGON3) += tg3.o
obj-$(CONFIG_BNX2) += bnx2.o
spidernet-y += spider_net.o spider_net_ethtool.o sungem_phy.o
obj-$(CONFIG_SPIDER_NET) += spidernet.o
obj-$(CONFIG_TC35815) += tc35815.o
obj-$(CONFIG_SKGE) += skge.o
obj-$(CONFIG_SK98LIN) += sk98lin/
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ac3200.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ static int __init ac_probe1(int ioaddr, struct net_device *dev)
return 0;
out2:
if (ei_status.reg0)
iounmap((void *)dev->mem_start);
iounmap(ei_status.mem);
out1:
free_irq(dev->irq, dev);
out:
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/atarilance.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ struct lance_private {
#define MEM lp->mem
#define DREG IO->data
#define AREG IO->addr
#define REGA(a) ( AREG = (a), DREG )
#define REGA(a) (*( AREG = (a), &DREG ))

/* Definitions for packet buffer access: */
#define PKT_BUF_SZ 1544
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/dm9000.c
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ dm9000_phy_write(struct net_device *dev, int phyaddr_unused, int reg, int value)
}

static int
dm9000_drv_suspend(struct device *dev, u32 state, u32 level)
dm9000_drv_suspend(struct device *dev, pm_message_t state, u32 level)
{
struct net_device *ndev = dev_get_drvdata(dev);

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/forcedeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ static int nv_change_mtu(struct net_device *dev, int new_mtu)

/* synchronized against open : rtnl_lock() held by caller */
if (netif_running(dev)) {
u8 *base = get_hwbase(dev);
u8 __iomem *base = get_hwbase(dev);
/*
* It seems that the nic preloads valid ring entries into an
* internal buffer. The procedure for flushing everything is
Expand Down Expand Up @@ -1423,7 +1423,7 @@ static int nv_change_mtu(struct net_device *dev, int new_mtu)

static void nv_copy_mac_to_hw(struct net_device *dev)
{
u8 *base = get_hwbase(dev);
u8 __iomem *base = get_hwbase(dev);
u32 mac[2];

mac[0] = (dev->dev_addr[0] << 0) + (dev->dev_addr[1] << 8) +
Expand Down
1 change: 1 addition & 0 deletions drivers/net/iseries_veth.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Copyright (C) 2001 Kyle A. Lucke (klucke@us.ibm.com), IBM Corp.
* Substantially cleaned up by:
* Copyright (C) 2003 David Gibson <dwg@au1.ibm.com>, IBM Corporation.
* Copyright (C) 2004-2005 Michael Ellerman, IBM Corporation.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand Down
13 changes: 8 additions & 5 deletions drivers/net/s2io-regs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/************************************************************************
* regs.h: A Linux PCI-X Ethernet driver for S2IO 10GbE Server NIC
* regs.h: A Linux PCI-X Ethernet driver for Neterion 10GbE Server NIC
* Copyright(c) 2002-2005 Neterion Inc.
* This software may be used and distributed according to the terms of
Expand Down Expand Up @@ -713,13 +713,16 @@ typedef struct _XENA_dev_config {
u64 mc_err_reg;
#define MC_ERR_REG_ECC_DB_ERR_L BIT(14)
#define MC_ERR_REG_ECC_DB_ERR_U BIT(15)
#define MC_ERR_REG_MIRI_ECC_DB_ERR_0 BIT(18)
#define MC_ERR_REG_MIRI_ECC_DB_ERR_1 BIT(20)
#define MC_ERR_REG_MIRI_CRI_ERR_0 BIT(22)
#define MC_ERR_REG_MIRI_CRI_ERR_1 BIT(23)
#define MC_ERR_REG_SM_ERR BIT(31)
#define MC_ERR_REG_ECC_ALL_SNG (BIT(6) | \
BIT(7) | BIT(17) | BIT(19))
#define MC_ERR_REG_ECC_ALL_DBL (BIT(14) | \
BIT(15) | BIT(18) | BIT(20))
#define MC_ERR_REG_ECC_ALL_SNG (BIT(2) | BIT(3) | BIT(4) | BIT(5) |\
BIT(6) | BIT(7) | BIT(17) | BIT(19))
#define MC_ERR_REG_ECC_ALL_DBL (BIT(10) | BIT(11) | BIT(12) |\
BIT(13) | BIT(14) | BIT(15) |\
BIT(18) | BIT(20))
u64 mc_err_mask;
u64 mc_err_alarm;

Expand Down
98 changes: 76 additions & 22 deletions drivers/net/s2io.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/************************************************************************
* s2io.c: A Linux PCI-X Ethernet driver for S2IO 10GbE Server NIC
* s2io.c: A Linux PCI-X Ethernet driver for Neterion 10GbE Server NIC
* Copyright(c) 2002-2005 Neterion Inc.
* This software may be used and distributed according to the terms of
Expand Down Expand Up @@ -28,7 +28,7 @@
* explaination of all the variables.
* rx_ring_num : This can be used to program the number of receive rings used
* in the driver.
* rx_ring_len: This defines the number of descriptors each ring can have. This
* rx_ring_sz: This defines the number of descriptors each ring can have. This
* is also an array of size 8.
* tx_fifo_num: This defines the number of Tx FIFOs thats used int the driver.
* tx_fifo_len: This too is an array of 8. Each element defines the number of
Expand Down Expand Up @@ -67,7 +67,7 @@

/* S2io Driver name & version. */
static char s2io_driver_name[] = "Neterion";
static char s2io_driver_version[] = "Version 2.0.3.1";
static char s2io_driver_version[] = "Version 2.0.8.1";

static inline int RXD_IS_UP2DT(RxD_t *rxdp)
{
Expand Down Expand Up @@ -404,7 +404,7 @@ static int init_shared_mem(struct s2io_nic *nic)
config->tx_cfg[i].fifo_len - 1;
mac_control->fifos[i].fifo_no = i;
mac_control->fifos[i].nic = nic;
mac_control->fifos[i].max_txds = MAX_SKB_FRAGS;
mac_control->fifos[i].max_txds = MAX_SKB_FRAGS + 1;

for (j = 0; j < page_num; j++) {
int k = 0;
Expand All @@ -418,6 +418,26 @@ static int init_shared_mem(struct s2io_nic *nic)
DBG_PRINT(ERR_DBG, "failed for TxDL\n");
return -ENOMEM;
}
/* If we got a zero DMA address(can happen on
* certain platforms like PPC), reallocate.
* Store virtual address of page we don't want,
* to be freed later.
*/
if (!tmp_p) {
mac_control->zerodma_virt_addr = tmp_v;
DBG_PRINT(INIT_DBG,
"%s: Zero DMA address for TxDL. ", dev->name);
DBG_PRINT(INIT_DBG,
"Virtual address %llx\n", (u64)tmp_v);
tmp_v = pci_alloc_consistent(nic->pdev,
PAGE_SIZE, &tmp_p);
if (!tmp_v) {
DBG_PRINT(ERR_DBG,
"pci_alloc_consistent ");
DBG_PRINT(ERR_DBG, "failed for TxDL\n");
return -ENOMEM;
}
}
while (k < lst_per_page) {
int l = (j * lst_per_page) + k;
if (l == config->tx_cfg[i].fifo_len)
Expand Down Expand Up @@ -600,7 +620,7 @@ static void free_shared_mem(struct s2io_nic *nic)
mac_info_t *mac_control;
struct config_param *config;
int lst_size, lst_per_page;

struct net_device *dev = nic->dev;

if (!nic)
return;
Expand All @@ -616,9 +636,10 @@ static void free_shared_mem(struct s2io_nic *nic)
lst_per_page);
for (j = 0; j < page_num; j++) {
int mem_blks = (j * lst_per_page);
if ((!mac_control->fifos[i].list_info) ||
(!mac_control->fifos[i].list_info[mem_blks].
list_virt_addr))
if (!mac_control->fifos[i].list_info)
return;
if (!mac_control->fifos[i].list_info[mem_blks].
list_virt_addr)
break;
pci_free_consistent(nic->pdev, PAGE_SIZE,
mac_control->fifos[i].
Expand All @@ -628,6 +649,18 @@ static void free_shared_mem(struct s2io_nic *nic)
list_info[mem_blks].
list_phy_addr);
}
/* If we got a zero DMA address during allocation,
* free the page now
*/
if (mac_control->zerodma_virt_addr) {
pci_free_consistent(nic->pdev, PAGE_SIZE,
mac_control->zerodma_virt_addr,
(dma_addr_t)0);
DBG_PRINT(INIT_DBG,
"%s: Freeing TxDL with zero DMA addr. ", dev->name);
DBG_PRINT(INIT_DBG, "Virtual address %llx\n",
(u64)(mac_control->zerodma_virt_addr));
}
kfree(mac_control->fifos[i].list_info);
}

Expand Down Expand Up @@ -2479,9 +2512,10 @@ static void rx_intr_handler(ring_info_t *ring_data)
#endif
spin_lock(&nic->rx_lock);
if (atomic_read(&nic->card_state) == CARD_DOWN) {
DBG_PRINT(ERR_DBG, "%s: %s going down for reset\n",
DBG_PRINT(INTR_DBG, "%s: %s going down for reset\n",
__FUNCTION__, dev->name);
spin_unlock(&nic->rx_lock);
return;
}

get_info = ring_data->rx_curr_get_info;
Expand Down Expand Up @@ -2596,8 +2630,14 @@ static void tx_intr_handler(fifo_info_t *fifo_data)
if (txdlp->Control_1 & TXD_T_CODE) {
unsigned long long err;
err = txdlp->Control_1 & TXD_T_CODE;
DBG_PRINT(ERR_DBG, "***TxD error %llx\n",
err);
if ((err >> 48) == 0xA) {
DBG_PRINT(TX_DBG, "TxD returned due \
to loss of link\n");
}
else {
DBG_PRINT(ERR_DBG, "***TxD error \
%llx\n", err);
}
}

skb = (struct sk_buff *) ((unsigned long)
Expand Down Expand Up @@ -2689,12 +2729,16 @@ static void alarm_intr_handler(struct s2io_nic *nic)
if (val64 & MC_ERR_REG_ECC_ALL_DBL) {
nic->mac_control.stats_info->sw_stat.
double_ecc_errs++;
DBG_PRINT(ERR_DBG, "%s: Device indicates ",
DBG_PRINT(INIT_DBG, "%s: Device indicates ",
dev->name);
DBG_PRINT(ERR_DBG, "double ECC error!!\n");
DBG_PRINT(INIT_DBG, "double ECC error!!\n");
if (nic->device_type != XFRAME_II_DEVICE) {
netif_stop_queue(dev);
schedule_work(&nic->rst_timer_task);
/* Reset XframeI only if critical error */
if (val64 & (MC_ERR_REG_MIRI_ECC_DB_ERR_0 |
MC_ERR_REG_MIRI_ECC_DB_ERR_1)) {
netif_stop_queue(dev);
schedule_work(&nic->rst_timer_task);
}
}
} else {
nic->mac_control.stats_info->sw_stat.
Expand All @@ -2706,7 +2750,8 @@ static void alarm_intr_handler(struct s2io_nic *nic)
val64 = readq(&bar0->serr_source);
if (val64 & SERR_SOURCE_ANY) {
DBG_PRINT(ERR_DBG, "%s: Device indicates ", dev->name);
DBG_PRINT(ERR_DBG, "serious error!!\n");
DBG_PRINT(ERR_DBG, "serious error %llx!!\n",
(unsigned long long)val64);
netif_stop_queue(dev);
schedule_work(&nic->rst_timer_task);
}
Expand Down Expand Up @@ -3130,7 +3175,7 @@ int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
queue_len = mac_control->fifos[queue].tx_curr_put_info.fifo_len + 1;
/* Avoid "put" pointer going beyond "get" pointer */
if (txdp->Host_Control || (((put_off + 1) % queue_len) == get_off)) {
DBG_PRINT(ERR_DBG, "Error in xmit, No free TXDs.\n");
DBG_PRINT(TX_DBG, "Error in xmit, No free TXDs.\n");
netif_stop_queue(dev);
dev_kfree_skb(skb);
spin_unlock_irqrestore(&sp->tx_lock, flags);
Expand Down Expand Up @@ -3528,7 +3573,7 @@ static void s2io_set_multicast(struct net_device *dev)

val64 = readq(&bar0->mac_cfg);
sp->promisc_flg = 1;
DBG_PRINT(ERR_DBG, "%s: entered promiscuous mode\n",
DBG_PRINT(INFO_DBG, "%s: entered promiscuous mode\n",
dev->name);
} else if (!(dev->flags & IFF_PROMISC) && (sp->promisc_flg)) {
/* Remove the NIC from promiscuous mode */
Expand All @@ -3543,7 +3588,7 @@ static void s2io_set_multicast(struct net_device *dev)

val64 = readq(&bar0->mac_cfg);
sp->promisc_flg = 0;
DBG_PRINT(ERR_DBG, "%s: left promiscuous mode\n",
DBG_PRINT(INFO_DBG, "%s: left promiscuous mode\n",
dev->name);
}

Expand Down Expand Up @@ -5325,7 +5370,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
break;
}
}
config->max_txds = MAX_SKB_FRAGS;
config->max_txds = MAX_SKB_FRAGS + 1;

/* Rx side parameters. */
if (rx_ring_sz[0] == 0)
Expand Down Expand Up @@ -5525,9 +5570,14 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
if (sp->device_type & XFRAME_II_DEVICE) {
DBG_PRINT(ERR_DBG, "%s: Neterion Xframe II 10GbE adapter ",
dev->name);
DBG_PRINT(ERR_DBG, "(rev %d), Driver %s\n",
DBG_PRINT(ERR_DBG, "(rev %d), %s",
get_xena_rev_id(sp->pdev),
s2io_driver_version);
#ifdef CONFIG_2BUFF_MODE
DBG_PRINT(ERR_DBG, ", Buffer mode %d",2);
#endif

DBG_PRINT(ERR_DBG, "\nCopyright(c) 2002-2005 Neterion Inc.\n");
DBG_PRINT(ERR_DBG, "MAC ADDR: %02x:%02x:%02x:%02x:%02x:%02x\n",
sp->def_mac_addr[0].mac_addr[0],
sp->def_mac_addr[0].mac_addr[1],
Expand All @@ -5544,9 +5594,13 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
} else {
DBG_PRINT(ERR_DBG, "%s: Neterion Xframe I 10GbE adapter ",
dev->name);
DBG_PRINT(ERR_DBG, "(rev %d), Driver %s\n",
DBG_PRINT(ERR_DBG, "(rev %d), %s",
get_xena_rev_id(sp->pdev),
s2io_driver_version);
#ifdef CONFIG_2BUFF_MODE
DBG_PRINT(ERR_DBG, ", Buffer mode %d",2);
#endif
DBG_PRINT(ERR_DBG, "\nCopyright(c) 2002-2005 Neterion Inc.\n");
DBG_PRINT(ERR_DBG, "MAC ADDR: %02x:%02x:%02x:%02x:%02x:%02x\n",
sp->def_mac_addr[0].mac_addr[0],
sp->def_mac_addr[0].mac_addr[1],
Expand Down
5 changes: 4 additions & 1 deletion drivers/net/s2io.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/************************************************************************
* s2io.h: A Linux PCI-X Ethernet driver for S2IO 10GbE Server NIC
* s2io.h: A Linux PCI-X Ethernet driver for Neterion 10GbE Server NIC
* Copyright(c) 2002-2005 Neterion Inc.
* This software may be used and distributed according to the terms of
Expand Down Expand Up @@ -622,6 +622,9 @@ typedef struct mac_info {
/* Fifo specific structure */
fifo_info_t fifos[MAX_TX_FIFOS];

/* Save virtual address of TxD page with zero DMA addr(if any) */
void *zerodma_virt_addr;

/* rx side stuff */
/* Ring specific structure */
ring_info_t rings[MAX_RX_RINGS];
Expand Down
Loading

0 comments on commit 55faed1

Please sign in to comment.