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 6, 2005
2 parents 1e231ef + 3a48c4c commit 5bcaa15
Show file tree
Hide file tree
Showing 21 changed files with 1,736 additions and 234 deletions.
9 changes: 6 additions & 3 deletions drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ config SUN3LANCE
If you're not building a kernel for a Sun 3, say N.

config SUN3_82586
tristate "Sun3 on-board Intel 82586 support"
bool "Sun3 on-board Intel 82586 support"
depends on NET_ETHERNET && SUN3
help
This driver enables support for the on-board Intel 82586 based
Expand Down Expand Up @@ -1924,12 +1924,15 @@ config R8169_VLAN
If in doubt, say Y.

config SIS190
tristate "SiS190 gigabit ethernet support"
tristate "SiS190/SiS191 gigabit ethernet support"
depends on PCI
select CRC32
select MII
---help---
Say Y here if you have a SiS 190 PCI Gigabit Ethernet adapter.
Say Y here if you have a SiS 190 PCI Fast Ethernet adapter or
a SiS 191 PCI Gigabit Ethernet adapter. Both are expected to
appear in lan on motherboard designs which are based on SiS 965
and SiS 966 south bridge.

To compile this driver as a module, choose M here: the module
will be called sis190. This is recommended.
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/chelsio/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ struct t1_rx_mode {

static inline u8 *t1_get_next_mcaddr(struct t1_rx_mode *rm)
{
u8 *addr = 0;
u8 *addr = NULL;

if (rm->idx++ < rm->dev->mc_count) {
addr = rm->list->dmi_addr;
Expand Down Expand Up @@ -190,7 +190,7 @@ struct sge;
struct peespi;

struct adapter {
u8 *regs;
u8 __iomem *regs;
struct pci_dev *pdev;
unsigned long registered_device_map;
unsigned long open_device_map;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/chelsio/cxgb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ static void cxgb_proc_cleanup(struct adapter *adapter,
static int t1_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
{
struct adapter *adapter = dev->priv;
struct mii_ioctl_data *data = (struct mii_ioctl_data *)&req->ifr_data;
struct mii_ioctl_data *data = if_mii(req);

switch (cmd) {
case SIOCGMIIPHY:
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/e1000/e1000_hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ struct e1000_hw_stats {

/* Structure containing variables used by the shared code (e1000_hw.c) */
struct e1000_hw {
uint8_t *hw_addr;
uint8_t __iomem *hw_addr;
uint8_t *flash_address;
e1000_mac_type mac_type;
e1000_phy_type phy_type;
Expand Down
139 changes: 60 additions & 79 deletions drivers/net/mv643xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@

#define INT_CAUSE_UNMASK_ALL 0x0007ffff
#define INT_CAUSE_UNMASK_ALL_EXT 0x0011ffff
#ifdef MV643XX_RX_QUEUE_FILL_ON_TASK
#define INT_CAUSE_MASK_ALL 0x00000000
#define INT_CAUSE_MASK_ALL_EXT 0x00000000
#define INT_CAUSE_CHECK_BITS INT_CAUSE_UNMASK_ALL
#define INT_CAUSE_CHECK_BITS_EXT INT_CAUSE_UNMASK_ALL_EXT
#endif

#ifdef MV643XX_CHECKSUM_OFFLOAD_TX
#define MAX_DESCS_PER_SKB (MAX_SKB_FRAGS + 1)
Expand Down Expand Up @@ -259,14 +258,13 @@ static void mv643xx_eth_update_mac_address(struct net_device *dev)
static void mv643xx_eth_set_rx_mode(struct net_device *dev)
{
struct mv643xx_private *mp = netdev_priv(dev);
u32 config_reg;

config_reg = ethernet_get_config_reg(mp->port_num);
if (dev->flags & IFF_PROMISC)
config_reg |= (u32) MV643XX_ETH_UNICAST_PROMISCUOUS_MODE;
mp->port_config |= (u32) MV643XX_ETH_UNICAST_PROMISCUOUS_MODE;
else
config_reg &= ~(u32) MV643XX_ETH_UNICAST_PROMISCUOUS_MODE;
ethernet_set_config_reg(mp->port_num, config_reg);
mp->port_config &= ~(u32) MV643XX_ETH_UNICAST_PROMISCUOUS_MODE;

mv_write(MV643XX_ETH_PORT_CONFIG_REG(mp->port_num), mp->port_config);
}

/*
Expand Down Expand Up @@ -369,15 +367,6 @@ static int mv643xx_eth_free_tx_queue(struct net_device *dev,

dev_kfree_skb_irq(pkt_info.return_info);
released = 0;

/*
* Decrement the number of outstanding skbs counter on
* the TX queue.
*/
if (mp->tx_ring_skbs == 0)
panic("ERROR - TX outstanding SKBs"
" counter is corrupted");
mp->tx_ring_skbs--;
} else
dma_unmap_page(NULL, pkt_info.buf_ptr,
pkt_info.byte_cnt, DMA_TO_DEVICE);
Expand Down Expand Up @@ -412,15 +401,13 @@ static int mv643xx_eth_receive_queue(struct net_device *dev)
struct pkt_info pkt_info;

#ifdef MV643XX_NAPI
while (eth_port_receive(mp, &pkt_info) == ETH_OK && budget > 0) {
while (budget-- > 0 && eth_port_receive(mp, &pkt_info) == ETH_OK) {
#else
while (eth_port_receive(mp, &pkt_info) == ETH_OK) {
#endif
mp->rx_ring_skbs--;
received_packets++;
#ifdef MV643XX_NAPI
budget--;
#endif

/* Update statistics. Note byte count includes 4 byte CRC count */
stats->rx_packets++;
stats->rx_bytes += pkt_info.byte_cnt;
Expand Down Expand Up @@ -1044,9 +1031,6 @@ static void mv643xx_tx(struct net_device *dev)
DMA_TO_DEVICE);

dev_kfree_skb_irq(pkt_info.return_info);

if (mp->tx_ring_skbs)
mp->tx_ring_skbs--;
} else
dma_unmap_page(NULL, pkt_info.buf_ptr,
pkt_info.byte_cnt, DMA_TO_DEVICE);
Expand Down Expand Up @@ -1189,7 +1173,6 @@ static int mv643xx_eth_start_xmit(struct sk_buff *skb, struct net_device *dev)
pkt_info.buf_ptr = dma_map_single(NULL, skb->data, skb->len,
DMA_TO_DEVICE);
pkt_info.return_info = skb;
mp->tx_ring_skbs++;
status = eth_port_send(mp, &pkt_info);
if ((status == ETH_ERROR) || (status == ETH_QUEUE_FULL))
printk(KERN_ERR "%s: Error on transmitting packet\n",
Expand Down Expand Up @@ -1274,7 +1257,6 @@ static int mv643xx_eth_start_xmit(struct sk_buff *skb, struct net_device *dev)
pkt_info.cmd_sts |= ETH_TX_ENABLE_INTERRUPT |
ETH_TX_LAST_DESC;
pkt_info.return_info = skb;
mp->tx_ring_skbs++;
} else {
pkt_info.return_info = 0;
}
Expand Down Expand Up @@ -1311,7 +1293,6 @@ static int mv643xx_eth_start_xmit(struct sk_buff *skb, struct net_device *dev)
pkt_info.buf_ptr = dma_map_single(NULL, skb->data, skb->len,
DMA_TO_DEVICE);
pkt_info.return_info = skb;
mp->tx_ring_skbs++;
status = eth_port_send(mp, &pkt_info);
if ((status == ETH_ERROR) || (status == ETH_QUEUE_FULL))
printk(KERN_ERR "%s: Error on transmitting packet\n",
Expand Down Expand Up @@ -1356,6 +1337,43 @@ static struct net_device_stats *mv643xx_eth_get_stats(struct net_device *dev)
return &mp->stats;
}

#ifdef CONFIG_NET_POLL_CONTROLLER
static inline void mv643xx_enable_irq(struct mv643xx_private *mp)
{
int port_num = mp->port_num;
unsigned long flags;

spin_lock_irqsave(&mp->lock, flags);
mv_write(MV643XX_ETH_INTERRUPT_MASK_REG(port_num),
INT_CAUSE_UNMASK_ALL);
mv_write(MV643XX_ETH_INTERRUPT_EXTEND_MASK_REG(port_num),
INT_CAUSE_UNMASK_ALL_EXT);
spin_unlock_irqrestore(&mp->lock, flags);
}

static inline void mv643xx_disable_irq(struct mv643xx_private *mp)
{
int port_num = mp->port_num;
unsigned long flags;

spin_lock_irqsave(&mp->lock, flags);
mv_write(MV643XX_ETH_INTERRUPT_MASK_REG(port_num),
INT_CAUSE_MASK_ALL);
mv_write(MV643XX_ETH_INTERRUPT_EXTEND_MASK_REG(port_num),
INT_CAUSE_MASK_ALL_EXT);
spin_unlock_irqrestore(&mp->lock, flags);
}

static void mv643xx_netpoll(struct net_device *netdev)
{
struct mv643xx_private *mp = netdev_priv(netdev);

mv643xx_disable_irq(mp);
mv643xx_eth_int_handler(netdev->irq, netdev, NULL);
mv643xx_enable_irq(mp);
}
#endif

/*/
* mv643xx_eth_probe
*
Expand Down Expand Up @@ -1406,6 +1424,10 @@ static int mv643xx_eth_probe(struct device *ddev)
dev->weight = 64;
#endif

#ifdef CONFIG_NET_POLL_CONTROLLER
dev->poll_controller = mv643xx_netpoll;
#endif

dev->watchdog_timeo = 2 * HZ;
dev->tx_queue_len = mp->tx_ring_size;
dev->base_addr = 0;
Expand Down Expand Up @@ -1883,6 +1905,9 @@ static void eth_port_start(struct mv643xx_private *mp)
/* Enable port Rx. */
mv_write(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num),
mp->port_rx_queue_command);

/* Disable port bandwidth limits by clearing MTU register */
mv_write(MV643XX_ETH_MAXIMUM_TRANSMIT_UNIT(port_num), 0);
}

/*
Expand Down Expand Up @@ -2292,34 +2317,6 @@ static void eth_port_reset(unsigned int port_num)
mv_write(MV643XX_ETH_PORT_SERIAL_CONTROL_REG(port_num), reg_data);
}

/*
* ethernet_set_config_reg - Set specified bits in configuration register.
*
* DESCRIPTION:
* This function sets specified bits in the given ethernet
* configuration register.
*
* INPUT:
* unsigned int eth_port_num Ethernet Port number.
* unsigned int value 32 bit value.
*
* OUTPUT:
* The set bits in the value parameter are set in the configuration
* register.
*
* RETURN:
* None.
*
*/
static void ethernet_set_config_reg(unsigned int eth_port_num,
unsigned int value)
{
unsigned int eth_config_reg;

eth_config_reg = mv_read(MV643XX_ETH_PORT_CONFIG_REG(eth_port_num));
eth_config_reg |= value;
mv_write(MV643XX_ETH_PORT_CONFIG_REG(eth_port_num), eth_config_reg);
}

static int eth_port_autoneg_supported(unsigned int eth_port_num)
{
Expand All @@ -2345,31 +2342,6 @@ static int eth_port_link_is_up(unsigned int eth_port_num)
return 0;
}

/*
* ethernet_get_config_reg - Get the port configuration register
*
* DESCRIPTION:
* This function returns the configuration register value of the given
* ethernet port.
*
* INPUT:
* unsigned int eth_port_num Ethernet Port number.
*
* OUTPUT:
* None.
*
* RETURN:
* Port configuration register value.
*/
static unsigned int ethernet_get_config_reg(unsigned int eth_port_num)
{
unsigned int eth_config_reg;

eth_config_reg = mv_read(MV643XX_ETH_PORT_CONFIG_EXTEND_REG
(eth_port_num));
return eth_config_reg;
}

/*
* eth_port_read_smi_reg - Read PHY registers
*
Expand Down Expand Up @@ -2528,6 +2500,9 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp,
return ETH_ERROR;
}

mp->tx_ring_skbs++;
BUG_ON(mp->tx_ring_skbs > mp->tx_ring_size);

/* Get the Tx Desc ring indexes */
tx_desc_curr = mp->tx_curr_desc_q;
tx_desc_used = mp->tx_used_desc_q;
Expand Down Expand Up @@ -2594,6 +2569,9 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp,
if (mp->tx_resource_err)
return ETH_QUEUE_FULL;

mp->tx_ring_skbs++;
BUG_ON(mp->tx_ring_skbs > mp->tx_ring_size);

/* Get the Tx Desc ring indexes */
tx_desc_curr = mp->tx_curr_desc_q;
tx_desc_used = mp->tx_used_desc_q;
Expand Down Expand Up @@ -2694,6 +2672,9 @@ static ETH_FUNC_RET_STATUS eth_tx_return_desc(struct mv643xx_private *mp,
/* Any Tx return cancels the Tx resource error status */
mp->tx_resource_err = 0;

BUG_ON(mp->tx_ring_skbs == 0);
mp->tx_ring_skbs--;

return ETH_OK;
}

Expand Down
4 changes: 0 additions & 4 deletions drivers/net/mv643xx_eth.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,6 @@ static void eth_port_init(struct mv643xx_private *mp);
static void eth_port_reset(unsigned int eth_port_num);
static void eth_port_start(struct mv643xx_private *mp);

static void ethernet_set_config_reg(unsigned int eth_port_num,
unsigned int value);
static unsigned int ethernet_get_config_reg(unsigned int eth_port_num);

/* Port MAC address routines */
static void eth_port_uc_addr_set(unsigned int eth_port_num,
unsigned char *p_addr);
Expand Down
9 changes: 3 additions & 6 deletions drivers/net/ne3210.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
Updated to EISA probing API 5/2003 by Marc Zyngier.
*/

static const char *version =
"ne3210.c: Driver revision v0.03, 30/09/98\n";

#include <linux/module.h>
#include <linux/eisa.h>
#include <linux/kernel.h>
Expand Down Expand Up @@ -197,7 +194,7 @@ static int __init ne3210_eisa_probe (struct device *device)
ei_status.priv = phys_mem;

if (ei_debug > 0)
printk(version);
printk("ne3210 loaded.\n");

ei_status.reset_8390 = &ne3210_reset_8390;
ei_status.block_input = &ne3210_block_input;
Expand Down Expand Up @@ -360,12 +357,12 @@ MODULE_DESCRIPTION("NE3210 EISA Ethernet driver");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(eisa, ne3210_ids);

int ne3210_init(void)
static int ne3210_init(void)
{
return eisa_driver_register (&ne3210_eisa_driver);
}

void ne3210_cleanup(void)
static void ne3210_cleanup(void)
{
eisa_driver_unregister (&ne3210_eisa_driver);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/phy/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ menu "PHY device support"

config PHYLIB
tristate "PHY Device support and infrastructure"
depends on NET_ETHERNET
depends on NET_ETHERNET && (BROKEN || !ARCH_S390)
help
Ethernet controllers are usually attached to PHY
devices. This option provides infrastructure for
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/phy/mdio_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ int __init mdio_bus_init(void)
return bus_register(&mdio_bus_type);
}

void __exit mdio_bus_exit(void)
void mdio_bus_exit(void)
{
bus_unregister(&mdio_bus_type);
}
Loading

0 comments on commit 5bcaa15

Please sign in to comment.