Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170634
b: refs/heads/master
c: 7fe13c5
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Oct 12, 2009
1 parent 44c2e03 commit fcd6c47
Show file tree
Hide file tree
Showing 38 changed files with 465 additions and 261 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8aa0f64ac3835a6daf84d0b0e07c4c01d7d8eddc
refs/heads/master: 7fe13c5733790ef582769a54693fa6a5abf3c032
7 changes: 7 additions & 0 deletions trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3643,6 +3643,13 @@ F: Documentation/blockdev/nbd.txt
F: drivers/block/nbd.c
F: include/linux/nbd.h

NETWORK DROP MONITOR
M: Neil Horman <nhorman@tuxdriver.com>
L: netdev@vger.kernel.org
S: Maintained
W: https://fedorahosted.org/dropwatch/
F: net/core/drop_monitor.c

NETWORKING [GENERAL]
M: "David S. Miller" <davem@davemloft.net>
L: netdev@vger.kernel.org
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# Makefile for the Linux network (ethercard) device drivers.
#

obj-$(CONFIG_MII) += mii.o
obj-$(CONFIG_MDIO) += mdio.o
obj-$(CONFIG_PHYLIB) += phy/

obj-$(CONFIG_TI_DAVINCI_EMAC) += davinci_emac.o

obj-$(CONFIG_E1000) += e1000/
Expand Down Expand Up @@ -100,10 +104,6 @@ obj-$(CONFIG_SH_ETH) += sh_eth.o
# end link order section
#

obj-$(CONFIG_MII) += mii.o
obj-$(CONFIG_MDIO) += mdio.o
obj-$(CONFIG_PHYLIB) += phy/

obj-$(CONFIG_SUNDANCE) += sundance.o
obj-$(CONFIG_HAMACHI) += hamachi.o
obj-$(CONFIG_NET) += Space.o loopback.o
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/net/au1000_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ static inline void update_rx_stats(struct net_device *dev, u32 status)
ps->rx_errors++;
if (status & RX_MISSED_FRAME)
ps->rx_missed_errors++;
if (status & (RX_OVERLEN | RX_OVERLEN | RX_LEN_ERROR))
if (status & (RX_OVERLEN | RX_RUNT | RX_LEN_ERROR))
ps->rx_length_errors++;
if (status & RX_CRC_ERROR)
ps->rx_crc_errors++;
Expand Down Expand Up @@ -794,8 +794,6 @@ static int au1000_rx(struct net_device *dev)
printk("rx len error\n");
if (status & RX_U_CNTRL_FRAME)
printk("rx u control frame\n");
if (status & RX_MISSED_FRAME)
printk("rx miss\n");
}
}
prxd->buff_stat = (u32)(pDB->dma_addr | RX_DMA_ENABLE);
Expand Down
81 changes: 54 additions & 27 deletions trunk/drivers/net/ethoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#include <linux/platform_device.h>
#include <net/ethoc.h>

static int buffer_size = 0x8000; /* 32 KBytes */
module_param(buffer_size, int, 0);
MODULE_PARM_DESC(buffer_size, "DMA buffer allocation size");

/* register offsets */
#define MODER 0x00
#define INT_SOURCE 0x04
Expand Down Expand Up @@ -167,6 +171,7 @@
* struct ethoc - driver-private device structure
* @iobase: pointer to I/O memory region
* @membase: pointer to buffer memory region
* @dma_alloc: dma allocated buffer size
* @num_tx: number of send buffers
* @cur_tx: last send buffer written
* @dty_tx: last buffer actually sent
Expand All @@ -185,6 +190,7 @@
struct ethoc {
void __iomem *iobase;
void __iomem *membase;
int dma_alloc;

unsigned int num_tx;
unsigned int cur_tx;
Expand Down Expand Up @@ -284,7 +290,7 @@ static int ethoc_init_ring(struct ethoc *dev)
dev->cur_rx = 0;

/* setup transmission buffers */
bd.addr = 0;
bd.addr = virt_to_phys(dev->membase);
bd.stat = TX_BD_IRQ | TX_BD_CRC;

for (i = 0; i < dev->num_tx; i++) {
Expand All @@ -295,7 +301,6 @@ static int ethoc_init_ring(struct ethoc *dev)
bd.addr += ETHOC_BUFSIZ;
}

bd.addr = dev->num_tx * ETHOC_BUFSIZ;
bd.stat = RX_BD_EMPTY | RX_BD_IRQ;

for (i = 0; i < dev->num_rx; i++) {
Expand Down Expand Up @@ -400,8 +405,12 @@ static int ethoc_rx(struct net_device *dev, int limit)
if (ethoc_update_rx_stats(priv, &bd) == 0) {
int size = bd.stat >> 16;
struct sk_buff *skb = netdev_alloc_skb(dev, size);

size -= 4; /* strip the CRC */
skb_reserve(skb, 2); /* align TCP/IP header */

if (likely(skb)) {
void *src = priv->membase + bd.addr;
void *src = phys_to_virt(bd.addr);
memcpy_fromio(skb_put(skb, size), src, size);
skb->protocol = eth_type_trans(skb, dev);
priv->stats.rx_packets++;
Expand Down Expand Up @@ -653,9 +662,9 @@ static int ethoc_open(struct net_device *dev)
if (ret)
return ret;

/* calculate the number of TX/RX buffers */
num_bd = (dev->mem_end - dev->mem_start + 1) / ETHOC_BUFSIZ;
priv->num_tx = min(min_tx, num_bd / 4);
/* calculate the number of TX/RX buffers, maximum 128 supported */
num_bd = min(128, (dev->mem_end - dev->mem_start + 1) / ETHOC_BUFSIZ);
priv->num_tx = max(min_tx, num_bd / 4);
priv->num_rx = num_bd - priv->num_tx;
ethoc_write(priv, TX_BD_NUM, priv->num_tx);

Expand Down Expand Up @@ -823,7 +832,7 @@ static netdev_tx_t ethoc_start_xmit(struct sk_buff *skb, struct net_device *dev)
else
bd.stat &= ~TX_BD_PAD;

dest = priv->membase + bd.addr;
dest = phys_to_virt(bd.addr);
memcpy_toio(dest, skb->data, skb->len);

bd.stat &= ~(TX_BD_STATS | TX_BD_LEN_MASK);
Expand Down Expand Up @@ -903,22 +912,19 @@ static int ethoc_probe(struct platform_device *pdev)

/* obtain buffer memory space */
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!res) {
dev_err(&pdev->dev, "cannot obtain memory space\n");
ret = -ENXIO;
goto free;
}

mem = devm_request_mem_region(&pdev->dev, res->start,
if (res) {
mem = devm_request_mem_region(&pdev->dev, res->start,
res->end - res->start + 1, res->name);
if (!mem) {
dev_err(&pdev->dev, "cannot request memory space\n");
ret = -ENXIO;
goto free;
if (!mem) {
dev_err(&pdev->dev, "cannot request memory space\n");
ret = -ENXIO;
goto free;
}

netdev->mem_start = mem->start;
netdev->mem_end = mem->end;
}

netdev->mem_start = mem->start;
netdev->mem_end = mem->end;

/* obtain device IRQ number */
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
Expand All @@ -933,6 +939,7 @@ static int ethoc_probe(struct platform_device *pdev)
/* setup driver-private data */
priv = netdev_priv(netdev);
priv->netdev = netdev;
priv->dma_alloc = 0;

priv->iobase = devm_ioremap_nocache(&pdev->dev, netdev->base_addr,
mmio->end - mmio->start + 1);
Expand All @@ -942,12 +949,27 @@ static int ethoc_probe(struct platform_device *pdev)
goto error;
}

priv->membase = devm_ioremap_nocache(&pdev->dev, netdev->mem_start,
mem->end - mem->start + 1);
if (!priv->membase) {
dev_err(&pdev->dev, "cannot remap memory space\n");
ret = -ENXIO;
goto error;
if (netdev->mem_end) {
priv->membase = devm_ioremap_nocache(&pdev->dev,
netdev->mem_start, mem->end - mem->start + 1);
if (!priv->membase) {
dev_err(&pdev->dev, "cannot remap memory space\n");
ret = -ENXIO;
goto error;
}
} else {
/* Allocate buffer memory */
priv->membase = dma_alloc_coherent(NULL,
buffer_size, (void *)&netdev->mem_start,
GFP_KERNEL);
if (!priv->membase) {
dev_err(&pdev->dev, "cannot allocate %dB buffer\n",
buffer_size);
ret = -ENOMEM;
goto error;
}
netdev->mem_end = netdev->mem_start + buffer_size;
priv->dma_alloc = buffer_size;
}

/* Allow the platform setup code to pass in a MAC address. */
Expand Down Expand Up @@ -1034,6 +1056,9 @@ static int ethoc_probe(struct platform_device *pdev)
kfree(priv->mdio->irq);
mdiobus_free(priv->mdio);
free:
if (priv->dma_alloc)
dma_free_coherent(NULL, priv->dma_alloc, priv->membase,
netdev->mem_start);
free_netdev(netdev);
out:
return ret;
Expand All @@ -1059,7 +1084,9 @@ static int ethoc_remove(struct platform_device *pdev)
kfree(priv->mdio->irq);
mdiobus_free(priv->mdio);
}

if (priv->dma_alloc)
dma_free_coherent(NULL, priv->dma_alloc, priv->membase,
netdev->mem_start);
unregister_netdev(netdev);
free_netdev(netdev);
}
Expand Down
7 changes: 5 additions & 2 deletions trunk/drivers/net/ibm_newemac/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ static u32 __emac_calc_base_mr1(struct emac_instance *dev, int tx_size, int rx_s
ret |= EMAC_MR1_TFS_2K;
break;
default:
printk(KERN_WARNING "%s: Unknown Rx FIFO size %d\n",
printk(KERN_WARNING "%s: Unknown Tx FIFO size %d\n",
dev->ndev->name, tx_size);
}

Expand All @@ -470,14 +470,17 @@ static u32 __emac4_calc_base_mr1(struct emac_instance *dev, int tx_size, int rx_
DBG2(dev, "__emac4_calc_base_mr1" NL);

switch(tx_size) {
case 16384:
ret |= EMAC4_MR1_TFS_16K;
break;
case 4096:
ret |= EMAC4_MR1_TFS_4K;
break;
case 2048:
ret |= EMAC4_MR1_TFS_2K;
break;
default:
printk(KERN_WARNING "%s: Unknown Rx FIFO size %d\n",
printk(KERN_WARNING "%s: Unknown Tx FIFO size %d\n",
dev->ndev->name, tx_size);
}

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/ibm_newemac/emac.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ struct emac_regs {
#define EMAC4_MR1_RFS_16K 0x00280000
#define EMAC4_MR1_TFS_2K 0x00020000
#define EMAC4_MR1_TFS_4K 0x00030000
#define EMAC4_MR1_TFS_16K 0x00050000
#define EMAC4_MR1_TR 0x00008000
#define EMAC4_MR1_MWSW_001 0x00001000
#define EMAC4_MR1_JPSM 0x00000800
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/netxen/netxen_nic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,7 @@ netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
/* 4 fragments per cmd des */
no_of_desc = (frag_count + 3) >> 2;

if (unlikely(no_of_desc + 2) > netxen_tx_avail(tx_ring)) {
if (unlikely(no_of_desc + 2 > netxen_tx_avail(tx_ring))) {
netif_stop_queue(netdev);
return NETDEV_TX_BUSY;
}
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/pasemi_mac_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ pasemi_mac_ethtool_get_settings(struct net_device *netdev,
struct pasemi_mac *mac = netdev_priv(netdev);
struct phy_device *phydev = mac->phydev;

if (!phydev)
return -EOPNOTSUPP;

return phy_ethtool_gset(phydev, cmd);
}

Expand Down
10 changes: 9 additions & 1 deletion trunk/drivers/net/qlge/qlge.h
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,12 @@ enum {
MB_CMD_SET_PORT_CFG = 0x00000122,
MB_CMD_GET_PORT_CFG = 0x00000123,
MB_CMD_GET_LINK_STS = 0x00000124,
MB_CMD_SET_MGMNT_TFK_CTL = 0x00000160, /* Set Mgmnt Traffic Control */
MB_SET_MPI_TFK_STOP = (1 << 0),
MB_SET_MPI_TFK_RESUME = (1 << 1),
MB_CMD_GET_MGMNT_TFK_CTL = 0x00000161, /* Get Mgmnt Traffic Control */
MB_GET_MPI_TFK_STOPPED = (1 << 0),
MB_GET_MPI_TFK_FIFO_EMPTY = (1 << 1),

/* Mailbox Command Status. */
MB_CMD_STS_GOOD = 0x00004000, /* Success. */
Expand Down Expand Up @@ -1168,7 +1174,7 @@ struct ricb {
#define RSS_RI6 0x40
#define RSS_RT6 0x80
__le16 mask;
__le32 hash_cq_id[256];
u8 hash_cq_id[1024];
__le32 ipv6_hash_key[10];
__le32 ipv4_hash_key[4];
} __attribute((packed));
Expand Down Expand Up @@ -1605,6 +1611,8 @@ int ql_read_mpi_reg(struct ql_adapter *qdev, u32 reg, u32 *data);
int ql_mb_about_fw(struct ql_adapter *qdev);
void ql_link_on(struct ql_adapter *qdev);
void ql_link_off(struct ql_adapter *qdev);
int ql_mb_set_mgmnt_traffic_ctl(struct ql_adapter *qdev, u32 control);
int ql_wait_fifo_empty(struct ql_adapter *qdev);

#if 1
#define QL_ALL_DUMP
Expand Down
Loading

0 comments on commit fcd6c47

Please sign in to comment.