Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (64 commits) phylib: Fix delay argument of schedule_delayed_work NET/ixgbe: Fix powering off during shutdown NET/e1000e: Fix powering off during shutdown NET/e1000: Fix powering off during shutdown packet: avoid warnings when high-order page allocation fails gianfar: stop send queue before resetting gianfar myr10ge: again fix lro_gen_skb() alignment declance: convert to net_device_ops bfin_mac: convert to net_device_ops au1000: convert to net_device_ops atarilance: convert to net_device_ops a2065: convert to net_device_ops ixgbe: update real_num_tx_queues on changing num_rx_queues ixgbe: fix tx queue index Revert "rose: zero length frame filtering in af_rose.c" sfc: Use correct macro to set event bitfield sfc: Match calls to netif_napi_add() and netif_napi_del() bonding: Remove debug printk e1000/e1000: fix compile warning ehea: Fix incomplete conversion to net_device_ops ...
This commit is contained in:
commit
cd97824994
|
@ -1242,7 +1242,7 @@ monitoring is enabled, and vice-versa.
|
||||||
To add ARP targets:
|
To add ARP targets:
|
||||||
# echo +192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
|
# echo +192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
|
||||||
# echo +192.168.0.101 > /sys/class/net/bond0/bonding/arp_ip_target
|
# echo +192.168.0.101 > /sys/class/net/bond0/bonding/arp_ip_target
|
||||||
NOTE: up to 10 target addresses may be specified.
|
NOTE: up to 16 target addresses may be specified.
|
||||||
|
|
||||||
To remove an ARP target:
|
To remove an ARP target:
|
||||||
# echo -192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
|
# echo -192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
|
||||||
|
|
13
MAINTAINERS
13
MAINTAINERS
|
@ -3917,19 +3917,12 @@ F: Documentation/blockdev/nbd.txt
|
||||||
F: drivers/block/nbd.c
|
F: drivers/block/nbd.c
|
||||||
F: include/linux/nbd.h
|
F: include/linux/nbd.h
|
||||||
|
|
||||||
NETWORK DEVICE DRIVERS
|
|
||||||
P: Jeff Garzik
|
|
||||||
M: jgarzik@pobox.com
|
|
||||||
L: netdev@vger.kernel.org
|
|
||||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git
|
|
||||||
S: Maintained
|
|
||||||
F: drivers/net/
|
|
||||||
|
|
||||||
NETWORKING [GENERAL]
|
NETWORKING [GENERAL]
|
||||||
P: Networking Team
|
P: David S. Miller
|
||||||
M: netdev@vger.kernel.org
|
M: davem@davemloft.net
|
||||||
L: netdev@vger.kernel.org
|
L: netdev@vger.kernel.org
|
||||||
W: http://linux-net.osdl.org/
|
W: http://linux-net.osdl.org/
|
||||||
|
T: git kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git
|
||||||
S: Maintained
|
S: Maintained
|
||||||
F: net/
|
F: net/
|
||||||
F: include/net/
|
F: include/net/
|
||||||
|
|
|
@ -692,6 +692,17 @@ static struct zorro_driver a2065_driver = {
|
||||||
.remove = __devexit_p(a2065_remove_one),
|
.remove = __devexit_p(a2065_remove_one),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct net_device_ops lance_netdev_ops = {
|
||||||
|
.ndo_open = lance_open,
|
||||||
|
.ndo_stop = lance_close,
|
||||||
|
.ndo_start_xmit = lance_start_xmit,
|
||||||
|
.ndo_tx_timeout = lance_tx_timeout,
|
||||||
|
.ndo_set_multicast_list = lance_set_multicast,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
};
|
||||||
|
|
||||||
static int __devinit a2065_init_one(struct zorro_dev *z,
|
static int __devinit a2065_init_one(struct zorro_dev *z,
|
||||||
const struct zorro_device_id *ent)
|
const struct zorro_device_id *ent)
|
||||||
{
|
{
|
||||||
|
@ -753,12 +764,8 @@ static int __devinit a2065_init_one(struct zorro_dev *z,
|
||||||
priv->rx_ring_mod_mask = RX_RING_MOD_MASK;
|
priv->rx_ring_mod_mask = RX_RING_MOD_MASK;
|
||||||
priv->tx_ring_mod_mask = TX_RING_MOD_MASK;
|
priv->tx_ring_mod_mask = TX_RING_MOD_MASK;
|
||||||
|
|
||||||
dev->open = &lance_open;
|
dev->netdev_ops = &lance_netdev_ops;
|
||||||
dev->stop = &lance_close;
|
|
||||||
dev->hard_start_xmit = &lance_start_xmit;
|
|
||||||
dev->tx_timeout = &lance_tx_timeout;
|
|
||||||
dev->watchdog_timeo = 5*HZ;
|
dev->watchdog_timeo = 5*HZ;
|
||||||
dev->set_multicast_list = &lance_set_multicast;
|
|
||||||
dev->dma = 0;
|
dev->dma = 0;
|
||||||
|
|
||||||
init_timer(&priv->multicast_timer);
|
init_timer(&priv->multicast_timer);
|
||||||
|
|
|
@ -155,6 +155,18 @@ static struct zorro_driver ariadne_driver = {
|
||||||
.remove = __devexit_p(ariadne_remove_one),
|
.remove = __devexit_p(ariadne_remove_one),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct net_device_ops ariadne_netdev_ops = {
|
||||||
|
.ndo_open = ariadne_open,
|
||||||
|
.ndo_stop = ariadne_close,
|
||||||
|
.ndo_start_xmit = ariadne_start_xmit,
|
||||||
|
.ndo_tx_timeout = ariadne_tx_timeout,
|
||||||
|
.ndo_get_stats = ariadne_get_stats,
|
||||||
|
.ndo_set_multicast_list = set_multicast_list,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
};
|
||||||
|
|
||||||
static int __devinit ariadne_init_one(struct zorro_dev *z,
|
static int __devinit ariadne_init_one(struct zorro_dev *z,
|
||||||
const struct zorro_device_id *ent)
|
const struct zorro_device_id *ent)
|
||||||
{
|
{
|
||||||
|
@ -197,13 +209,8 @@ static int __devinit ariadne_init_one(struct zorro_dev *z,
|
||||||
dev->mem_start = ZTWO_VADDR(mem_start);
|
dev->mem_start = ZTWO_VADDR(mem_start);
|
||||||
dev->mem_end = dev->mem_start+ARIADNE_RAM_SIZE;
|
dev->mem_end = dev->mem_start+ARIADNE_RAM_SIZE;
|
||||||
|
|
||||||
dev->open = &ariadne_open;
|
dev->netdev_ops = &ariadne_netdev_ops;
|
||||||
dev->stop = &ariadne_close;
|
|
||||||
dev->hard_start_xmit = &ariadne_start_xmit;
|
|
||||||
dev->tx_timeout = &ariadne_tx_timeout;
|
|
||||||
dev->watchdog_timeo = 5*HZ;
|
dev->watchdog_timeo = 5*HZ;
|
||||||
dev->get_stats = &ariadne_get_stats;
|
|
||||||
dev->set_multicast_list = &set_multicast_list;
|
|
||||||
|
|
||||||
err = register_netdev(dev);
|
err = register_netdev(dev);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
|
@ -665,6 +665,20 @@ static void __init am79c961_banner(void)
|
||||||
if (net_debug && version_printed++ == 0)
|
if (net_debug && version_printed++ == 0)
|
||||||
printk(KERN_INFO "%s", version);
|
printk(KERN_INFO "%s", version);
|
||||||
}
|
}
|
||||||
|
static const struct net_device_ops am79c961_netdev_ops = {
|
||||||
|
.ndo_open = am79c961_open,
|
||||||
|
.ndo_stop = am79c961_close,
|
||||||
|
.ndo_start_xmit = am79c961_sendpacket,
|
||||||
|
.ndo_get_stats = am79c961_getstats,
|
||||||
|
.ndo_set_multicast_list = am79c961_setmulticastlist,
|
||||||
|
.ndo_tx_timeout = am79c961_timeout,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||||
|
.ndo_poll_controller = am79c961_poll_controller,
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
static int __init am79c961_probe(struct platform_device *pdev)
|
static int __init am79c961_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
@ -732,15 +746,7 @@ static int __init am79c961_probe(struct platform_device *pdev)
|
||||||
if (am79c961_hw_init(dev))
|
if (am79c961_hw_init(dev))
|
||||||
goto release;
|
goto release;
|
||||||
|
|
||||||
dev->open = am79c961_open;
|
dev->netdev_ops = &am79c961_netdev_ops;
|
||||||
dev->stop = am79c961_close;
|
|
||||||
dev->hard_start_xmit = am79c961_sendpacket;
|
|
||||||
dev->get_stats = am79c961_getstats;
|
|
||||||
dev->set_multicast_list = am79c961_setmulticastlist;
|
|
||||||
dev->tx_timeout = am79c961_timeout;
|
|
||||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
|
||||||
dev->poll_controller = am79c961_poll_controller;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ret = register_netdev(dev);
|
ret = register_netdev(dev);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
|
|
|
@ -577,7 +577,7 @@ static void at91ether_sethashtable(struct net_device *dev)
|
||||||
/*
|
/*
|
||||||
* Enable/Disable promiscuous and multicast modes.
|
* Enable/Disable promiscuous and multicast modes.
|
||||||
*/
|
*/
|
||||||
static void at91ether_set_rx_mode(struct net_device *dev)
|
static void at91ether_set_multicast_list(struct net_device *dev)
|
||||||
{
|
{
|
||||||
unsigned long cfg;
|
unsigned long cfg;
|
||||||
|
|
||||||
|
@ -808,7 +808,7 @@ static int at91ether_close(struct net_device *dev)
|
||||||
/*
|
/*
|
||||||
* Transmit packet.
|
* Transmit packet.
|
||||||
*/
|
*/
|
||||||
static int at91ether_tx(struct sk_buff *skb, struct net_device *dev)
|
static int at91ether_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct at91_private *lp = netdev_priv(dev);
|
struct at91_private *lp = netdev_priv(dev);
|
||||||
|
|
||||||
|
@ -828,7 +828,7 @@ static int at91ether_tx(struct sk_buff *skb, struct net_device *dev)
|
||||||
|
|
||||||
dev->trans_start = jiffies;
|
dev->trans_start = jiffies;
|
||||||
} else {
|
} else {
|
||||||
printk(KERN_ERR "at91_ether.c: at91ether_tx() called, but device is busy!\n");
|
printk(KERN_ERR "at91_ether.c: at91ether_start_xmit() called, but device is busy!\n");
|
||||||
return 1; /* if we return anything but zero, dev.c:1055 calls kfree_skb(skb)
|
return 1; /* if we return anything but zero, dev.c:1055 calls kfree_skb(skb)
|
||||||
on this skb, he also reports -ENETDOWN and printk's, so either
|
on this skb, he also reports -ENETDOWN and printk's, so either
|
||||||
we free and return(0) or don't free and return 1 */
|
we free and return(0) or don't free and return 1 */
|
||||||
|
@ -965,6 +965,21 @@ static void at91ether_poll_controller(struct net_device *dev)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static const struct net_device_ops at91ether_netdev_ops = {
|
||||||
|
.ndo_open = at91ether_open,
|
||||||
|
.ndo_stop = at91ether_close,
|
||||||
|
.ndo_start_xmit = at91ether_start_xmit,
|
||||||
|
.ndo_get_stats = at91ether_stats,
|
||||||
|
.ndo_set_multicast_list = at91ether_set_multicast_list,
|
||||||
|
.ndo_set_mac_address = set_mac_address,
|
||||||
|
.ndo_do_ioctl = at91ether_ioctl,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||||
|
.ndo_poll_controller = at91ether_poll_controller,
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the ethernet interface
|
* Initialize the ethernet interface
|
||||||
*/
|
*/
|
||||||
|
@ -1005,17 +1020,8 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add
|
||||||
spin_lock_init(&lp->lock);
|
spin_lock_init(&lp->lock);
|
||||||
|
|
||||||
ether_setup(dev);
|
ether_setup(dev);
|
||||||
dev->open = at91ether_open;
|
dev->netdev_ops = &at91ether_netdev_ops;
|
||||||
dev->stop = at91ether_close;
|
|
||||||
dev->hard_start_xmit = at91ether_tx;
|
|
||||||
dev->get_stats = at91ether_stats;
|
|
||||||
dev->set_multicast_list = at91ether_set_rx_mode;
|
|
||||||
dev->set_mac_address = set_mac_address;
|
|
||||||
dev->ethtool_ops = &at91ether_ethtool_ops;
|
dev->ethtool_ops = &at91ether_ethtool_ops;
|
||||||
dev->do_ioctl = at91ether_ioctl;
|
|
||||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
|
||||||
dev->poll_controller = at91ether_poll_controller;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SET_NETDEV_DEV(dev, &pdev->dev);
|
SET_NETDEV_DEV(dev, &pdev->dev);
|
||||||
|
|
||||||
|
|
|
@ -770,7 +770,18 @@ static struct ethtool_ops ep93xx_ethtool_ops = {
|
||||||
.get_link = ep93xx_get_link,
|
.get_link = ep93xx_get_link,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct net_device *ep93xx_dev_alloc(struct ep93xx_eth_data *data)
|
static const struct net_device_ops ep93xx_netdev_ops = {
|
||||||
|
.ndo_open = ep93xx_open,
|
||||||
|
.ndo_stop = ep93xx_close,
|
||||||
|
.ndo_start_xmit = ep93xx_xmit,
|
||||||
|
.ndo_get_stats = ep93xx_get_stats,
|
||||||
|
.ndo_do_ioctl = ep93xx_ioctl,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct net_device *ep93xx_dev_alloc(struct ep93xx_eth_data *data)
|
||||||
{
|
{
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
|
|
||||||
|
@ -780,12 +791,8 @@ struct net_device *ep93xx_dev_alloc(struct ep93xx_eth_data *data)
|
||||||
|
|
||||||
memcpy(dev->dev_addr, data->dev_addr, ETH_ALEN);
|
memcpy(dev->dev_addr, data->dev_addr, ETH_ALEN);
|
||||||
|
|
||||||
dev->get_stats = ep93xx_get_stats;
|
|
||||||
dev->ethtool_ops = &ep93xx_ethtool_ops;
|
dev->ethtool_ops = &ep93xx_ethtool_ops;
|
||||||
dev->hard_start_xmit = ep93xx_xmit;
|
dev->netdev_ops = &ep93xx_netdev_ops;
|
||||||
dev->open = ep93xx_open;
|
|
||||||
dev->stop = ep93xx_close;
|
|
||||||
dev->do_ioctl = ep93xx_ioctl;
|
|
||||||
|
|
||||||
dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM;
|
dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM;
|
||||||
|
|
||||||
|
|
|
@ -991,6 +991,18 @@ static void __devinit ether1_banner(void)
|
||||||
printk(KERN_INFO "%s", version);
|
printk(KERN_INFO "%s", version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct net_device_ops ether1_netdev_ops = {
|
||||||
|
.ndo_open = ether1_open,
|
||||||
|
.ndo_stop = ether1_close,
|
||||||
|
.ndo_start_xmit = ether1_sendpacket,
|
||||||
|
.ndo_get_stats = ether1_getstats,
|
||||||
|
.ndo_set_multicast_list = ether1_setmulticastlist,
|
||||||
|
.ndo_tx_timeout = ether1_timeout,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
};
|
||||||
|
|
||||||
static int __devinit
|
static int __devinit
|
||||||
ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
|
ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
|
||||||
{
|
{
|
||||||
|
@ -1031,12 +1043,7 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
|
||||||
goto free;
|
goto free;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev->open = ether1_open;
|
dev->netdev_ops = ðer1_netdev_ops;
|
||||||
dev->stop = ether1_close;
|
|
||||||
dev->hard_start_xmit = ether1_sendpacket;
|
|
||||||
dev->get_stats = ether1_getstats;
|
|
||||||
dev->set_multicast_list = ether1_setmulticastlist;
|
|
||||||
dev->tx_timeout = ether1_timeout;
|
|
||||||
dev->watchdog_timeo = 5 * HZ / 100;
|
dev->watchdog_timeo = 5 * HZ / 100;
|
||||||
|
|
||||||
ret = register_netdev(dev);
|
ret = register_netdev(dev);
|
||||||
|
|
|
@ -770,6 +770,18 @@ static void __devinit ether3_banner(void)
|
||||||
printk(KERN_INFO "%s", version);
|
printk(KERN_INFO "%s", version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct net_device_ops ether3_netdev_ops = {
|
||||||
|
.ndo_open = ether3_open,
|
||||||
|
.ndo_stop = ether3_close,
|
||||||
|
.ndo_start_xmit = ether3_sendpacket,
|
||||||
|
.ndo_get_stats = ether3_getstats,
|
||||||
|
.ndo_set_multicast_list = ether3_setmulticastlist,
|
||||||
|
.ndo_tx_timeout = ether3_timeout,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
};
|
||||||
|
|
||||||
static int __devinit
|
static int __devinit
|
||||||
ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
|
ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
|
||||||
{
|
{
|
||||||
|
@ -846,12 +858,7 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
|
||||||
goto free;
|
goto free;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev->open = ether3_open;
|
dev->netdev_ops = ðer3_netdev_ops;
|
||||||
dev->stop = ether3_close;
|
|
||||||
dev->hard_start_xmit = ether3_sendpacket;
|
|
||||||
dev->get_stats = ether3_getstats;
|
|
||||||
dev->set_multicast_list = ether3_setmulticastlist;
|
|
||||||
dev->tx_timeout = ether3_timeout;
|
|
||||||
dev->watchdog_timeo = 5 * HZ / 100;
|
dev->watchdog_timeo = 5 * HZ / 100;
|
||||||
|
|
||||||
ret = register_netdev(dev);
|
ret = register_netdev(dev);
|
||||||
|
|
|
@ -453,6 +453,16 @@ static noinline int __init addr_accessible(volatile void *regp, int wordflag,
|
||||||
return( ret );
|
return( ret );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct net_device_ops lance_netdev_ops = {
|
||||||
|
.ndo_open = lance_open,
|
||||||
|
.ndo_stop = lance_close,
|
||||||
|
.ndo_start_xmit = lance_start_xmit,
|
||||||
|
.ndo_set_multicast_list = set_multicast_list,
|
||||||
|
.ndo_set_mac_address = lance_set_mac_address,
|
||||||
|
.ndo_tx_timeout = lance_tx_timeout,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
};
|
||||||
|
|
||||||
static unsigned long __init lance_probe1( struct net_device *dev,
|
static unsigned long __init lance_probe1( struct net_device *dev,
|
||||||
struct lance_addr *init_rec )
|
struct lance_addr *init_rec )
|
||||||
|
@ -623,15 +633,9 @@ static unsigned long __init lance_probe1( struct net_device *dev,
|
||||||
if (did_version++ == 0)
|
if (did_version++ == 0)
|
||||||
DPRINTK( 1, ( version ));
|
DPRINTK( 1, ( version ));
|
||||||
|
|
||||||
/* The LANCE-specific entries in the device structure. */
|
dev->netdev_ops = &lance_netdev_ops;
|
||||||
dev->open = &lance_open;
|
|
||||||
dev->hard_start_xmit = &lance_start_xmit;
|
|
||||||
dev->stop = &lance_close;
|
|
||||||
dev->set_multicast_list = &set_multicast_list;
|
|
||||||
dev->set_mac_address = &lance_set_mac_address;
|
|
||||||
|
|
||||||
/* XXX MSch */
|
/* XXX MSch */
|
||||||
dev->tx_timeout = lance_tx_timeout;
|
|
||||||
dev->watchdog_timeo = TX_TIMEOUT;
|
dev->watchdog_timeo = TX_TIMEOUT;
|
||||||
|
|
||||||
return( 1 );
|
return( 1 );
|
||||||
|
|
|
@ -1004,12 +1004,12 @@ static void au1000_tx_timeout(struct net_device *dev)
|
||||||
netif_wake_queue(dev);
|
netif_wake_queue(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_rx_mode(struct net_device *dev)
|
static void au1000_multicast_list(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct au1000_private *aup = netdev_priv(dev);
|
struct au1000_private *aup = netdev_priv(dev);
|
||||||
|
|
||||||
if (au1000_debug > 4)
|
if (au1000_debug > 4)
|
||||||
printk("%s: set_rx_mode: flags=%x\n", dev->name, dev->flags);
|
printk("%s: au1000_multicast_list: flags=%x\n", dev->name, dev->flags);
|
||||||
|
|
||||||
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
|
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
|
||||||
aup->mac->control |= MAC_PROMISCUOUS;
|
aup->mac->control |= MAC_PROMISCUOUS;
|
||||||
|
@ -1047,6 +1047,18 @@ static int au1000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
|
||||||
return phy_mii_ioctl(aup->phy_dev, if_mii(rq), cmd);
|
return phy_mii_ioctl(aup->phy_dev, if_mii(rq), cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct net_device_ops au1000_netdev_ops = {
|
||||||
|
.ndo_open = au1000_open,
|
||||||
|
.ndo_stop = au1000_close,
|
||||||
|
.ndo_start_xmit = au1000_tx,
|
||||||
|
.ndo_set_multicast_list = au1000_multicast_list,
|
||||||
|
.ndo_do_ioctl = au1000_ioctl,
|
||||||
|
.ndo_tx_timeout = au1000_tx_timeout,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
};
|
||||||
|
|
||||||
static struct net_device * au1000_probe(int port_num)
|
static struct net_device * au1000_probe(int port_num)
|
||||||
{
|
{
|
||||||
static unsigned version_printed = 0;
|
static unsigned version_printed = 0;
|
||||||
|
@ -1197,13 +1209,8 @@ static struct net_device * au1000_probe(int port_num)
|
||||||
|
|
||||||
dev->base_addr = base;
|
dev->base_addr = base;
|
||||||
dev->irq = irq;
|
dev->irq = irq;
|
||||||
dev->open = au1000_open;
|
dev->netdev_ops = &au1000_netdev_ops;
|
||||||
dev->hard_start_xmit = au1000_tx;
|
|
||||||
dev->stop = au1000_close;
|
|
||||||
dev->set_multicast_list = &set_rx_mode;
|
|
||||||
dev->do_ioctl = &au1000_ioctl;
|
|
||||||
SET_ETHTOOL_OPS(dev, &au1000_ethtool_ops);
|
SET_ETHTOOL_OPS(dev, &au1000_ethtool_ops);
|
||||||
dev->tx_timeout = au1000_tx_timeout;
|
|
||||||
dev->watchdog_timeo = ETH_TX_TIMEOUT;
|
dev->watchdog_timeo = ETH_TX_TIMEOUT;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -319,7 +319,7 @@ be_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
|
||||||
|
|
||||||
be_cmd_get_flow_control(&adapter->ctrl, &ecmd->tx_pause,
|
be_cmd_get_flow_control(&adapter->ctrl, &ecmd->tx_pause,
|
||||||
&ecmd->rx_pause);
|
&ecmd->rx_pause);
|
||||||
ecmd->autoneg = AUTONEG_ENABLE;
|
ecmd->autoneg = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -328,7 +328,7 @@ be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
|
||||||
struct be_adapter *adapter = netdev_priv(netdev);
|
struct be_adapter *adapter = netdev_priv(netdev);
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
if (ecmd->autoneg != AUTONEG_ENABLE)
|
if (ecmd->autoneg != 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
status = be_cmd_set_flow_control(&adapter->ctrl, ecmd->tx_pause,
|
status = be_cmd_set_flow_control(&adapter->ctrl, ecmd->tx_pause,
|
||||||
|
|
|
@ -979,6 +979,20 @@ static int bfin_mac_open(struct net_device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct net_device_ops bfin_mac_netdev_ops = {
|
||||||
|
.ndo_open = bfin_mac_open,
|
||||||
|
.ndo_stop = bfin_mac_close,
|
||||||
|
.ndo_start_xmit = bfin_mac_hard_start_xmit,
|
||||||
|
.ndo_set_mac_address = bfin_mac_set_mac_address,
|
||||||
|
.ndo_tx_timeout = bfin_mac_timeout,
|
||||||
|
.ndo_set_multicast_list = bfin_mac_set_multicast_list,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||||
|
.ndo_poll_controller = bfin_mac_poll,
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* this makes the board clean up everything that it can
|
* this makes the board clean up everything that it can
|
||||||
|
@ -1086,15 +1100,7 @@ static int __devinit bfin_mac_probe(struct platform_device *pdev)
|
||||||
/* Fill in the fields of the device structure with ethernet values. */
|
/* Fill in the fields of the device structure with ethernet values. */
|
||||||
ether_setup(ndev);
|
ether_setup(ndev);
|
||||||
|
|
||||||
ndev->open = bfin_mac_open;
|
ndev->netdev_ops = &bfin_mac_netdev_ops;
|
||||||
ndev->stop = bfin_mac_close;
|
|
||||||
ndev->hard_start_xmit = bfin_mac_hard_start_xmit;
|
|
||||||
ndev->set_mac_address = bfin_mac_set_mac_address;
|
|
||||||
ndev->tx_timeout = bfin_mac_timeout;
|
|
||||||
ndev->set_multicast_list = bfin_mac_set_multicast_list;
|
|
||||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
|
||||||
ndev->poll_controller = bfin_mac_poll;
|
|
||||||
#endif
|
|
||||||
ndev->ethtool_ops = &bfin_mac_ethtool_ops;
|
ndev->ethtool_ops = &bfin_mac_ethtool_ops;
|
||||||
|
|
||||||
spin_lock_init(&lp->lock);
|
spin_lock_init(&lp->lock);
|
||||||
|
|
|
@ -370,8 +370,6 @@ static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct
|
||||||
|
|
||||||
if (arp->op_code == htons(ARPOP_REPLY)) {
|
if (arp->op_code == htons(ARPOP_REPLY)) {
|
||||||
/* update rx hash table for this ARP */
|
/* update rx hash table for this ARP */
|
||||||
printk("rar: update orig %s bond_dev %s\n", orig_dev->name,
|
|
||||||
bond_dev->name);
|
|
||||||
bond = netdev_priv(bond_dev);
|
bond = netdev_priv(bond_dev);
|
||||||
rlb_update_entry_from_arp(bond, arp);
|
rlb_update_entry_from_arp(bond, arp);
|
||||||
pr_debug("Server received an ARP Reply from client\n");
|
pr_debug("Server received an ARP Reply from client\n");
|
||||||
|
|
|
@ -2570,7 +2570,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
|
||||||
|
|
||||||
for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) {
|
for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) {
|
||||||
if (!targets[i])
|
if (!targets[i])
|
||||||
continue;
|
break;
|
||||||
pr_debug("basa: target %x\n", targets[i]);
|
pr_debug("basa: target %x\n", targets[i]);
|
||||||
if (list_empty(&bond->vlan_list)) {
|
if (list_empty(&bond->vlan_list)) {
|
||||||
pr_debug("basa: empty vlan: arp_send\n");
|
pr_debug("basa: empty vlan: arp_send\n");
|
||||||
|
@ -2677,7 +2677,6 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32
|
||||||
int i;
|
int i;
|
||||||
__be32 *targets = bond->params.arp_targets;
|
__be32 *targets = bond->params.arp_targets;
|
||||||
|
|
||||||
targets = bond->params.arp_targets;
|
|
||||||
for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) {
|
for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) {
|
||||||
pr_debug("bva: sip %pI4 tip %pI4 t[%d] %pI4 bhti(tip) %d\n",
|
pr_debug("bva: sip %pI4 tip %pI4 t[%d] %pI4 bhti(tip) %d\n",
|
||||||
&sip, &tip, i, &targets[i], bond_has_this_ip(bond, tip));
|
&sip, &tip, i, &targets[i], bond_has_this_ip(bond, tip));
|
||||||
|
@ -3303,7 +3302,7 @@ static void bond_info_show_master(struct seq_file *seq)
|
||||||
|
|
||||||
for(i = 0; (i < BOND_MAX_ARP_TARGETS) ;i++) {
|
for(i = 0; (i < BOND_MAX_ARP_TARGETS) ;i++) {
|
||||||
if (!bond->params.arp_targets[i])
|
if (!bond->params.arp_targets[i])
|
||||||
continue;
|
break;
|
||||||
if (printed)
|
if (printed)
|
||||||
seq_printf(seq, ",");
|
seq_printf(seq, ",");
|
||||||
seq_printf(seq, " %pI4", &bond->params.arp_targets[i]);
|
seq_printf(seq, " %pI4", &bond->params.arp_targets[i]);
|
||||||
|
|
|
@ -684,17 +684,15 @@ static ssize_t bonding_store_arp_targets(struct device *d,
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
/* look for an empty slot to put the target in, and check for dupes */
|
/* look for an empty slot to put the target in, and check for dupes */
|
||||||
for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) {
|
for (i = 0; (i < BOND_MAX_ARP_TARGETS) && !done; i++) {
|
||||||
if (targets[i] == newtarget) { /* duplicate */
|
if (targets[i] == newtarget) { /* duplicate */
|
||||||
printk(KERN_ERR DRV_NAME
|
printk(KERN_ERR DRV_NAME
|
||||||
": %s: ARP target %pI4 is already present\n",
|
": %s: ARP target %pI4 is already present\n",
|
||||||
bond->dev->name, &newtarget);
|
bond->dev->name, &newtarget);
|
||||||
if (done)
|
|
||||||
targets[i] = 0;
|
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (targets[i] == 0 && !done) {
|
if (targets[i] == 0) {
|
||||||
printk(KERN_INFO DRV_NAME
|
printk(KERN_INFO DRV_NAME
|
||||||
": %s: adding ARP target %pI4.\n",
|
": %s: adding ARP target %pI4.\n",
|
||||||
bond->dev->name, &newtarget);
|
bond->dev->name, &newtarget);
|
||||||
|
@ -720,12 +718,16 @@ static ssize_t bonding_store_arp_targets(struct device *d,
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) {
|
for (i = 0; (i < BOND_MAX_ARP_TARGETS) && !done; i++) {
|
||||||
if (targets[i] == newtarget) {
|
if (targets[i] == newtarget) {
|
||||||
|
int j;
|
||||||
printk(KERN_INFO DRV_NAME
|
printk(KERN_INFO DRV_NAME
|
||||||
": %s: removing ARP target %pI4.\n",
|
": %s: removing ARP target %pI4.\n",
|
||||||
bond->dev->name, &newtarget);
|
bond->dev->name, &newtarget);
|
||||||
targets[i] = 0;
|
for (j = i; (j < (BOND_MAX_ARP_TARGETS-1)) && targets[j+1]; j++)
|
||||||
|
targets[j] = targets[j+1];
|
||||||
|
|
||||||
|
targets[j] = 0;
|
||||||
done = 1;
|
done = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -257,6 +257,23 @@ struct transceiver_ops transceivers[] =
|
||||||
|
|
||||||
struct transceiver_ops* transceiver = &transceivers[0];
|
struct transceiver_ops* transceiver = &transceivers[0];
|
||||||
|
|
||||||
|
static const struct net_device_ops e100_netdev_ops = {
|
||||||
|
.ndo_open = e100_open,
|
||||||
|
.ndo_stop = e100_close,
|
||||||
|
.ndo_start_xmit = e100_send_packet,
|
||||||
|
.ndo_tx_timeout = e100_tx_timeout,
|
||||||
|
.ndo_get_stats = e100_get_stats,
|
||||||
|
.ndo_set_multicast_list = set_multicast_list,
|
||||||
|
.ndo_do_ioctl = e100_ioctl,
|
||||||
|
.ndo_set_mac_address = e100_set_mac_address,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
.ndo_set_config = e100_set_config,
|
||||||
|
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||||
|
.ndo_poll_controller = e100_netpoll,
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
#define tx_done(dev) (*R_DMA_CH0_CMD == 0)
|
#define tx_done(dev) (*R_DMA_CH0_CMD == 0)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -300,19 +317,8 @@ etrax_ethernet_init(void)
|
||||||
|
|
||||||
/* fill in our handlers so the network layer can talk to us in the future */
|
/* fill in our handlers so the network layer can talk to us in the future */
|
||||||
|
|
||||||
dev->open = e100_open;
|
|
||||||
dev->hard_start_xmit = e100_send_packet;
|
|
||||||
dev->stop = e100_close;
|
|
||||||
dev->get_stats = e100_get_stats;
|
|
||||||
dev->set_multicast_list = set_multicast_list;
|
|
||||||
dev->set_mac_address = e100_set_mac_address;
|
|
||||||
dev->ethtool_ops = &e100_ethtool_ops;
|
dev->ethtool_ops = &e100_ethtool_ops;
|
||||||
dev->do_ioctl = e100_ioctl;
|
dev->netdev_ops = &e100_netdev_ops;
|
||||||
dev->set_config = e100_set_config;
|
|
||||||
dev->tx_timeout = e100_tx_timeout;
|
|
||||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
|
||||||
dev->poll_controller = e100_netpoll;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
spin_lock_init(&np->lock);
|
spin_lock_init(&np->lock);
|
||||||
spin_lock_init(&np->led_lock);
|
spin_lock_init(&np->led_lock);
|
||||||
|
|
|
@ -1010,6 +1010,17 @@ static void lance_set_multicast_retry(unsigned long _opaque)
|
||||||
lance_set_multicast(dev);
|
lance_set_multicast(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct net_device_ops lance_netdev_ops = {
|
||||||
|
.ndo_open = lance_open,
|
||||||
|
.ndo_stop = lance_close,
|
||||||
|
.ndo_start_xmit = lance_start_xmit,
|
||||||
|
.ndo_tx_timeout = lance_tx_timeout,
|
||||||
|
.ndo_set_multicast_list = lance_set_multicast,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
};
|
||||||
|
|
||||||
static int __init dec_lance_probe(struct device *bdev, const int type)
|
static int __init dec_lance_probe(struct device *bdev, const int type)
|
||||||
{
|
{
|
||||||
static unsigned version_printed;
|
static unsigned version_printed;
|
||||||
|
@ -1223,12 +1234,8 @@ static int __init dec_lance_probe(struct device *bdev, const int type)
|
||||||
|
|
||||||
printk(", addr = %pM, irq = %d\n", dev->dev_addr, dev->irq);
|
printk(", addr = %pM, irq = %d\n", dev->dev_addr, dev->irq);
|
||||||
|
|
||||||
dev->open = &lance_open;
|
dev->netdev_ops = &lance_netdev_ops;
|
||||||
dev->stop = &lance_close;
|
|
||||||
dev->hard_start_xmit = &lance_start_xmit;
|
|
||||||
dev->tx_timeout = &lance_tx_timeout;
|
|
||||||
dev->watchdog_timeo = 5*HZ;
|
dev->watchdog_timeo = 5*HZ;
|
||||||
dev->set_multicast_list = &lance_set_multicast;
|
|
||||||
|
|
||||||
/* lp->ll is the location of the registers for lance card */
|
/* lp->ll is the location of the registers for lance card */
|
||||||
lp->ll = ll;
|
lp->ll = ll;
|
||||||
|
|
|
@ -156,8 +156,8 @@ static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid);
|
||||||
static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid);
|
static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid);
|
||||||
static void e1000_restore_vlan(struct e1000_adapter *adapter);
|
static void e1000_restore_vlan(struct e1000_adapter *adapter);
|
||||||
|
|
||||||
static int e1000_suspend(struct pci_dev *pdev, pm_message_t state);
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
|
static int e1000_suspend(struct pci_dev *pdev, pm_message_t state);
|
||||||
static int e1000_resume(struct pci_dev *pdev);
|
static int e1000_resume(struct pci_dev *pdev);
|
||||||
#endif
|
#endif
|
||||||
static void e1000_shutdown(struct pci_dev *pdev);
|
static void e1000_shutdown(struct pci_dev *pdev);
|
||||||
|
@ -3834,7 +3834,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
|
||||||
struct e1000_buffer *buffer_info;
|
struct e1000_buffer *buffer_info;
|
||||||
unsigned int i, eop;
|
unsigned int i, eop;
|
||||||
unsigned int count = 0;
|
unsigned int count = 0;
|
||||||
bool cleaned;
|
bool cleaned = false;
|
||||||
unsigned int total_tx_bytes=0, total_tx_packets=0;
|
unsigned int total_tx_bytes=0, total_tx_packets=0;
|
||||||
|
|
||||||
i = tx_ring->next_to_clean;
|
i = tx_ring->next_to_clean;
|
||||||
|
@ -4601,7 +4601,7 @@ int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
|
static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)
|
||||||
{
|
{
|
||||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
struct net_device *netdev = pci_get_drvdata(pdev);
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
|
@ -4664,22 +4664,18 @@ static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||||
|
|
||||||
ew32(WUC, E1000_WUC_PME_EN);
|
ew32(WUC, E1000_WUC_PME_EN);
|
||||||
ew32(WUFC, wufc);
|
ew32(WUFC, wufc);
|
||||||
pci_enable_wake(pdev, PCI_D3hot, 1);
|
|
||||||
pci_enable_wake(pdev, PCI_D3cold, 1);
|
|
||||||
} else {
|
} else {
|
||||||
ew32(WUC, 0);
|
ew32(WUC, 0);
|
||||||
ew32(WUFC, 0);
|
ew32(WUFC, 0);
|
||||||
pci_enable_wake(pdev, PCI_D3hot, 0);
|
|
||||||
pci_enable_wake(pdev, PCI_D3cold, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
e1000_release_manageability(adapter);
|
e1000_release_manageability(adapter);
|
||||||
|
|
||||||
|
*enable_wake = !!wufc;
|
||||||
|
|
||||||
/* make sure adapter isn't asleep if manageability is enabled */
|
/* make sure adapter isn't asleep if manageability is enabled */
|
||||||
if (adapter->en_mng_pt) {
|
if (adapter->en_mng_pt)
|
||||||
pci_enable_wake(pdev, PCI_D3hot, 1);
|
*enable_wake = true;
|
||||||
pci_enable_wake(pdev, PCI_D3cold, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hw->phy_type == e1000_phy_igp_3)
|
if (hw->phy_type == e1000_phy_igp_3)
|
||||||
e1000_phy_powerdown_workaround(hw);
|
e1000_phy_powerdown_workaround(hw);
|
||||||
|
@ -4693,12 +4689,29 @@ static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||||
|
|
||||||
pci_disable_device(pdev);
|
pci_disable_device(pdev);
|
||||||
|
|
||||||
pci_set_power_state(pdev, pci_choose_state(pdev, state));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
|
static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||||
|
{
|
||||||
|
int retval;
|
||||||
|
bool wake;
|
||||||
|
|
||||||
|
retval = __e1000_shutdown(pdev, &wake);
|
||||||
|
if (retval)
|
||||||
|
return retval;
|
||||||
|
|
||||||
|
if (wake) {
|
||||||
|
pci_prepare_to_sleep(pdev);
|
||||||
|
} else {
|
||||||
|
pci_wake_from_d3(pdev, false);
|
||||||
|
pci_set_power_state(pdev, PCI_D3hot);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int e1000_resume(struct pci_dev *pdev)
|
static int e1000_resume(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
struct net_device *netdev = pci_get_drvdata(pdev);
|
||||||
|
@ -4753,7 +4766,14 @@ static int e1000_resume(struct pci_dev *pdev)
|
||||||
|
|
||||||
static void e1000_shutdown(struct pci_dev *pdev)
|
static void e1000_shutdown(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
e1000_suspend(pdev, PMSG_SUSPEND);
|
bool wake;
|
||||||
|
|
||||||
|
__e1000_shutdown(pdev, &wake);
|
||||||
|
|
||||||
|
if (system_state == SYSTEM_POWER_OFF) {
|
||||||
|
pci_wake_from_d3(pdev, wake);
|
||||||
|
pci_set_power_state(pdev, PCI_D3hot);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||||
|
|
|
@ -621,7 +621,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
|
||||||
struct e1000_buffer *buffer_info;
|
struct e1000_buffer *buffer_info;
|
||||||
unsigned int i, eop;
|
unsigned int i, eop;
|
||||||
unsigned int count = 0;
|
unsigned int count = 0;
|
||||||
bool cleaned;
|
bool cleaned = false;
|
||||||
unsigned int total_tx_bytes = 0, total_tx_packets = 0;
|
unsigned int total_tx_bytes = 0, total_tx_packets = 0;
|
||||||
|
|
||||||
i = tx_ring->next_to_clean;
|
i = tx_ring->next_to_clean;
|
||||||
|
@ -4346,7 +4346,7 @@ static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
|
static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)
|
||||||
{
|
{
|
||||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
struct net_device *netdev = pci_get_drvdata(pdev);
|
||||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
|
@ -4409,20 +4409,16 @@ static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||||
|
|
||||||
ew32(WUC, E1000_WUC_PME_EN);
|
ew32(WUC, E1000_WUC_PME_EN);
|
||||||
ew32(WUFC, wufc);
|
ew32(WUFC, wufc);
|
||||||
pci_enable_wake(pdev, PCI_D3hot, 1);
|
|
||||||
pci_enable_wake(pdev, PCI_D3cold, 1);
|
|
||||||
} else {
|
} else {
|
||||||
ew32(WUC, 0);
|
ew32(WUC, 0);
|
||||||
ew32(WUFC, 0);
|
ew32(WUFC, 0);
|
||||||
pci_enable_wake(pdev, PCI_D3hot, 0);
|
|
||||||
pci_enable_wake(pdev, PCI_D3cold, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*enable_wake = !!wufc;
|
||||||
|
|
||||||
/* make sure adapter isn't asleep if manageability is enabled */
|
/* make sure adapter isn't asleep if manageability is enabled */
|
||||||
if (adapter->flags & FLAG_MNG_PT_ENABLED) {
|
if (adapter->flags & FLAG_MNG_PT_ENABLED)
|
||||||
pci_enable_wake(pdev, PCI_D3hot, 1);
|
*enable_wake = true;
|
||||||
pci_enable_wake(pdev, PCI_D3cold, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (adapter->hw.phy.type == e1000_phy_igp_3)
|
if (adapter->hw.phy.type == e1000_phy_igp_3)
|
||||||
e1000e_igp3_phy_powerdown_workaround_ich8lan(&adapter->hw);
|
e1000e_igp3_phy_powerdown_workaround_ich8lan(&adapter->hw);
|
||||||
|
@ -4435,6 +4431,26 @@ static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||||
|
|
||||||
pci_disable_device(pdev);
|
pci_disable_device(pdev);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void e1000_power_off(struct pci_dev *pdev, bool sleep, bool wake)
|
||||||
|
{
|
||||||
|
if (sleep && wake) {
|
||||||
|
pci_prepare_to_sleep(pdev);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pci_wake_from_d3(pdev, wake);
|
||||||
|
pci_set_power_state(pdev, PCI_D3hot);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void e1000_complete_shutdown(struct pci_dev *pdev, bool sleep,
|
||||||
|
bool wake)
|
||||||
|
{
|
||||||
|
struct net_device *netdev = pci_get_drvdata(pdev);
|
||||||
|
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The pci-e switch on some quad port adapters will report a
|
* The pci-e switch on some quad port adapters will report a
|
||||||
* correctable error when the MAC transitions from D0 to D3. To
|
* correctable error when the MAC transitions from D0 to D3. To
|
||||||
|
@ -4450,14 +4466,12 @@ static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||||
pci_write_config_word(us_dev, pos + PCI_EXP_DEVCTL,
|
pci_write_config_word(us_dev, pos + PCI_EXP_DEVCTL,
|
||||||
(devctl & ~PCI_EXP_DEVCTL_CERE));
|
(devctl & ~PCI_EXP_DEVCTL_CERE));
|
||||||
|
|
||||||
pci_set_power_state(pdev, pci_choose_state(pdev, state));
|
e1000_power_off(pdev, sleep, wake);
|
||||||
|
|
||||||
pci_write_config_word(us_dev, pos + PCI_EXP_DEVCTL, devctl);
|
pci_write_config_word(us_dev, pos + PCI_EXP_DEVCTL, devctl);
|
||||||
} else {
|
} else {
|
||||||
pci_set_power_state(pdev, pci_choose_state(pdev, state));
|
e1000_power_off(pdev, sleep, wake);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void e1000e_disable_l1aspm(struct pci_dev *pdev)
|
static void e1000e_disable_l1aspm(struct pci_dev *pdev)
|
||||||
|
@ -4486,6 +4500,18 @@ static void e1000e_disable_l1aspm(struct pci_dev *pdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
|
static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||||
|
{
|
||||||
|
int retval;
|
||||||
|
bool wake;
|
||||||
|
|
||||||
|
retval = __e1000_shutdown(pdev, &wake);
|
||||||
|
if (!retval)
|
||||||
|
e1000_complete_shutdown(pdev, true, wake);
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
static int e1000_resume(struct pci_dev *pdev)
|
static int e1000_resume(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
struct net_device *netdev = pci_get_drvdata(pdev);
|
||||||
|
@ -4549,7 +4575,12 @@ static int e1000_resume(struct pci_dev *pdev)
|
||||||
|
|
||||||
static void e1000_shutdown(struct pci_dev *pdev)
|
static void e1000_shutdown(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
e1000_suspend(pdev, PMSG_SUSPEND);
|
bool wake = false;
|
||||||
|
|
||||||
|
__e1000_shutdown(pdev, &wake);
|
||||||
|
|
||||||
|
if (system_state == SYSTEM_POWER_OFF)
|
||||||
|
e1000_complete_shutdown(pdev, false, wake);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||||
|
|
|
@ -3080,7 +3080,8 @@ static const struct net_device_ops ehea_netdev_ops = {
|
||||||
.ndo_change_mtu = ehea_change_mtu,
|
.ndo_change_mtu = ehea_change_mtu,
|
||||||
.ndo_vlan_rx_register = ehea_vlan_rx_register,
|
.ndo_vlan_rx_register = ehea_vlan_rx_register,
|
||||||
.ndo_vlan_rx_add_vid = ehea_vlan_rx_add_vid,
|
.ndo_vlan_rx_add_vid = ehea_vlan_rx_add_vid,
|
||||||
.ndo_vlan_rx_kill_vid = ehea_vlan_rx_kill_vid
|
.ndo_vlan_rx_kill_vid = ehea_vlan_rx_kill_vid,
|
||||||
|
.ndo_tx_timeout = ehea_tx_watchdog,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
|
struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
|
||||||
|
@ -3142,7 +3143,6 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
|
||||||
| NETIF_F_HIGHDMA | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX
|
| NETIF_F_HIGHDMA | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX
|
||||||
| NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER
|
| NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER
|
||||||
| NETIF_F_LLTX;
|
| NETIF_F_LLTX;
|
||||||
dev->tx_timeout = &ehea_tx_watchdog;
|
|
||||||
dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT;
|
dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT;
|
||||||
|
|
||||||
INIT_WORK(&port->reset_task, ehea_reset_port);
|
INIT_WORK(&port->reset_task, ehea_reset_port);
|
||||||
|
|
|
@ -3745,14 +3745,14 @@ static int nv_napi_poll(struct napi_struct *napi, int budget)
|
||||||
mod_timer(&np->nic_poll, jiffies + POLL_WAIT);
|
mod_timer(&np->nic_poll, jiffies + POLL_WAIT);
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&np->lock, flags);
|
spin_unlock_irqrestore(&np->lock, flags);
|
||||||
__napi_complete(napi);
|
napi_complete(napi);
|
||||||
return rx_work;
|
return rx_work;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rx_work < budget) {
|
if (rx_work < budget) {
|
||||||
/* re-enable interrupts
|
/* re-enable interrupts
|
||||||
(msix not enabled in napi) */
|
(msix not enabled in napi) */
|
||||||
__napi_complete(napi);
|
napi_complete(napi);
|
||||||
|
|
||||||
writel(np->irqmask, base + NvRegIrqMask);
|
writel(np->irqmask, base + NvRegIrqMask);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1019,6 +1019,22 @@ out_put_phy:
|
||||||
#define IS_FEC(match) 0
|
#define IS_FEC(match) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static const struct net_device_ops fs_enet_netdev_ops = {
|
||||||
|
.ndo_open = fs_enet_open,
|
||||||
|
.ndo_stop = fs_enet_close,
|
||||||
|
.ndo_get_stats = fs_enet_get_stats,
|
||||||
|
.ndo_start_xmit = fs_enet_start_xmit,
|
||||||
|
.ndo_tx_timeout = fs_timeout,
|
||||||
|
.ndo_set_multicast_list = fs_set_multicast_list,
|
||||||
|
.ndo_do_ioctl = fs_ioctl,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||||
|
.ndo_poll_controller = fs_enet_netpoll,
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
static int __devinit fs_enet_probe(struct of_device *ofdev,
|
static int __devinit fs_enet_probe(struct of_device *ofdev,
|
||||||
const struct of_device_id *match)
|
const struct of_device_id *match)
|
||||||
{
|
{
|
||||||
|
@ -1093,22 +1109,13 @@ static int __devinit fs_enet_probe(struct of_device *ofdev,
|
||||||
fep->tx_ring = fpi->tx_ring;
|
fep->tx_ring = fpi->tx_ring;
|
||||||
fep->rx_ring = fpi->rx_ring;
|
fep->rx_ring = fpi->rx_ring;
|
||||||
|
|
||||||
ndev->open = fs_enet_open;
|
ndev->netdev_ops = &fs_enet_netdev_ops;
|
||||||
ndev->hard_start_xmit = fs_enet_start_xmit;
|
|
||||||
ndev->tx_timeout = fs_timeout;
|
|
||||||
ndev->watchdog_timeo = 2 * HZ;
|
ndev->watchdog_timeo = 2 * HZ;
|
||||||
ndev->stop = fs_enet_close;
|
|
||||||
ndev->get_stats = fs_enet_get_stats;
|
|
||||||
ndev->set_multicast_list = fs_set_multicast_list;
|
|
||||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
|
||||||
ndev->poll_controller = fs_enet_netpoll;
|
|
||||||
#endif
|
|
||||||
if (fpi->use_napi)
|
if (fpi->use_napi)
|
||||||
netif_napi_add(ndev, &fep->napi, fs_enet_rx_napi,
|
netif_napi_add(ndev, &fep->napi, fs_enet_rx_napi,
|
||||||
fpi->napi_weight);
|
fpi->napi_weight);
|
||||||
|
|
||||||
ndev->ethtool_ops = &fs_ethtool_ops;
|
ndev->ethtool_ops = &fs_ethtool_ops;
|
||||||
ndev->do_ioctl = fs_ioctl;
|
|
||||||
|
|
||||||
init_timer(&fep->phy_timer_list);
|
init_timer(&fep->phy_timer_list);
|
||||||
|
|
||||||
|
|
|
@ -1583,8 +1583,10 @@ static void gfar_reset_task(struct work_struct *work)
|
||||||
struct net_device *dev = priv->ndev;
|
struct net_device *dev = priv->ndev;
|
||||||
|
|
||||||
if (dev->flags & IFF_UP) {
|
if (dev->flags & IFF_UP) {
|
||||||
|
netif_stop_queue(dev);
|
||||||
stop_gfar(dev);
|
stop_gfar(dev);
|
||||||
startup_gfar(dev);
|
startup_gfar(dev);
|
||||||
|
netif_start_queue(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
netif_tx_schedule_all(dev);
|
netif_tx_schedule_all(dev);
|
||||||
|
|
|
@ -2686,6 +2686,32 @@ static int __devinit emac_init_config(struct emac_instance *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct net_device_ops emac_netdev_ops = {
|
||||||
|
.ndo_open = emac_open,
|
||||||
|
.ndo_stop = emac_close,
|
||||||
|
.ndo_get_stats = emac_stats,
|
||||||
|
.ndo_set_multicast_list = emac_set_multicast_list,
|
||||||
|
.ndo_do_ioctl = emac_ioctl,
|
||||||
|
.ndo_tx_timeout = emac_tx_timeout,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
.ndo_start_xmit = emac_start_xmit,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct net_device_ops emac_gige_netdev_ops = {
|
||||||
|
.ndo_open = emac_open,
|
||||||
|
.ndo_stop = emac_close,
|
||||||
|
.ndo_get_stats = emac_stats,
|
||||||
|
.ndo_set_multicast_list = emac_set_multicast_list,
|
||||||
|
.ndo_do_ioctl = emac_ioctl,
|
||||||
|
.ndo_tx_timeout = emac_tx_timeout,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
.ndo_start_xmit = emac_start_xmit_sg,
|
||||||
|
.ndo_change_mtu = emac_change_mtu,
|
||||||
|
};
|
||||||
|
|
||||||
static int __devinit emac_probe(struct of_device *ofdev,
|
static int __devinit emac_probe(struct of_device *ofdev,
|
||||||
const struct of_device_id *match)
|
const struct of_device_id *match)
|
||||||
{
|
{
|
||||||
|
@ -2827,23 +2853,14 @@ static int __devinit emac_probe(struct of_device *ofdev,
|
||||||
if (err != 0)
|
if (err != 0)
|
||||||
goto err_detach_tah;
|
goto err_detach_tah;
|
||||||
|
|
||||||
/* Fill in the driver function table */
|
|
||||||
ndev->open = &emac_open;
|
|
||||||
if (dev->tah_dev)
|
if (dev->tah_dev)
|
||||||
ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
|
ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
|
||||||
ndev->tx_timeout = &emac_tx_timeout;
|
|
||||||
ndev->watchdog_timeo = 5 * HZ;
|
ndev->watchdog_timeo = 5 * HZ;
|
||||||
ndev->stop = &emac_close;
|
|
||||||
ndev->get_stats = &emac_stats;
|
|
||||||
ndev->set_multicast_list = &emac_set_multicast_list;
|
|
||||||
ndev->do_ioctl = &emac_ioctl;
|
|
||||||
if (emac_phy_supports_gige(dev->phy_mode)) {
|
if (emac_phy_supports_gige(dev->phy_mode)) {
|
||||||
ndev->hard_start_xmit = &emac_start_xmit_sg;
|
ndev->netdev_ops = &emac_gige_netdev_ops;
|
||||||
ndev->change_mtu = &emac_change_mtu;
|
|
||||||
dev->commac.ops = &emac_commac_sg_ops;
|
dev->commac.ops = &emac_commac_sg_ops;
|
||||||
} else {
|
} else
|
||||||
ndev->hard_start_xmit = &emac_start_xmit;
|
ndev->netdev_ops = &emac_netdev_ops;
|
||||||
}
|
|
||||||
SET_ETHTOOL_OPS(ndev, &emac_ethtool_ops);
|
SET_ETHTOOL_OPS(ndev, &emac_ethtool_ops);
|
||||||
|
|
||||||
netif_carrier_off(ndev);
|
netif_carrier_off(ndev);
|
||||||
|
|
|
@ -111,7 +111,7 @@ void igb_clear_vfta(struct e1000_hw *hw)
|
||||||
* Writes value at the given offset in the register array which stores
|
* Writes value at the given offset in the register array which stores
|
||||||
* the VLAN filter table.
|
* the VLAN filter table.
|
||||||
**/
|
**/
|
||||||
void igb_write_vfta(struct e1000_hw *hw, u32 offset, u32 value)
|
static void igb_write_vfta(struct e1000_hw *hw, u32 offset, u32 value)
|
||||||
{
|
{
|
||||||
array_wr32(E1000_VFTA, offset, value);
|
array_wr32(E1000_VFTA, offset, value);
|
||||||
wrfl();
|
wrfl();
|
||||||
|
|
|
@ -66,7 +66,6 @@ void igb_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);
|
||||||
s32 igb_check_alt_mac_addr(struct e1000_hw *hw);
|
s32 igb_check_alt_mac_addr(struct e1000_hw *hw);
|
||||||
void igb_reset_adaptive(struct e1000_hw *hw);
|
void igb_reset_adaptive(struct e1000_hw *hw);
|
||||||
void igb_update_adaptive(struct e1000_hw *hw);
|
void igb_update_adaptive(struct e1000_hw *hw);
|
||||||
void igb_write_vfta(struct e1000_hw *hw, u32 offset, u32 value);
|
|
||||||
|
|
||||||
bool igb_enable_mng_pass_thru(struct e1000_hw *hw);
|
bool igb_enable_mng_pass_thru(struct e1000_hw *hw);
|
||||||
|
|
||||||
|
|
|
@ -188,7 +188,7 @@ out:
|
||||||
* returns SUCCESS if it successfully received a message notification and
|
* returns SUCCESS if it successfully received a message notification and
|
||||||
* copied it into the receive buffer.
|
* copied it into the receive buffer.
|
||||||
**/
|
**/
|
||||||
s32 igb_read_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
|
static s32 igb_read_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
|
||||||
{
|
{
|
||||||
struct e1000_mbx_info *mbx = &hw->mbx;
|
struct e1000_mbx_info *mbx = &hw->mbx;
|
||||||
s32 ret_val = -E1000_ERR_MBX;
|
s32 ret_val = -E1000_ERR_MBX;
|
||||||
|
@ -214,7 +214,7 @@ out:
|
||||||
* returns SUCCESS if it successfully copied message into the buffer and
|
* returns SUCCESS if it successfully copied message into the buffer and
|
||||||
* received an ack to that message within delay * timeout period
|
* received an ack to that message within delay * timeout period
|
||||||
**/
|
**/
|
||||||
s32 igb_write_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
|
static s32 igb_write_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
|
||||||
{
|
{
|
||||||
struct e1000_mbx_info *mbx = &hw->mbx;
|
struct e1000_mbx_info *mbx = &hw->mbx;
|
||||||
s32 ret_val = 0;
|
s32 ret_val = 0;
|
||||||
|
@ -232,19 +232,6 @@ out:
|
||||||
return ret_val;
|
return ret_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* e1000_init_mbx_ops_generic - Initialize NVM function pointers
|
|
||||||
* @hw: pointer to the HW structure
|
|
||||||
*
|
|
||||||
* Setups up the function pointers to no-op functions
|
|
||||||
**/
|
|
||||||
void e1000_init_mbx_ops_generic(struct e1000_hw *hw)
|
|
||||||
{
|
|
||||||
struct e1000_mbx_info *mbx = &hw->mbx;
|
|
||||||
mbx->ops.read_posted = igb_read_posted_mbx;
|
|
||||||
mbx->ops.write_posted = igb_write_posted_mbx;
|
|
||||||
}
|
|
||||||
|
|
||||||
static s32 igb_check_for_bit_pf(struct e1000_hw *hw, u32 mask)
|
static s32 igb_check_for_bit_pf(struct e1000_hw *hw, u32 mask)
|
||||||
{
|
{
|
||||||
u32 mbvficr = rd32(E1000_MBVFICR);
|
u32 mbvficr = rd32(E1000_MBVFICR);
|
||||||
|
|
|
@ -67,8 +67,6 @@
|
||||||
|
|
||||||
s32 igb_read_mbx(struct e1000_hw *, u32 *, u16, u16);
|
s32 igb_read_mbx(struct e1000_hw *, u32 *, u16, u16);
|
||||||
s32 igb_write_mbx(struct e1000_hw *, u32 *, u16, u16);
|
s32 igb_write_mbx(struct e1000_hw *, u32 *, u16, u16);
|
||||||
s32 igb_read_posted_mbx(struct e1000_hw *, u32 *, u16, u16);
|
|
||||||
s32 igb_write_posted_mbx(struct e1000_hw *, u32 *, u16, u16);
|
|
||||||
s32 igb_check_for_msg(struct e1000_hw *, u16);
|
s32 igb_check_for_msg(struct e1000_hw *, u16);
|
||||||
s32 igb_check_for_ack(struct e1000_hw *, u16);
|
s32 igb_check_for_ack(struct e1000_hw *, u16);
|
||||||
s32 igb_check_for_rst(struct e1000_hw *, u16);
|
s32 igb_check_for_rst(struct e1000_hw *, u16);
|
||||||
|
|
|
@ -1261,25 +1261,32 @@ static int __devinit igb_probe(struct pci_dev *pdev,
|
||||||
int i;
|
int i;
|
||||||
unsigned char mac_addr[ETH_ALEN];
|
unsigned char mac_addr[ETH_ALEN];
|
||||||
|
|
||||||
if (num_vfs)
|
if (num_vfs) {
|
||||||
adapter->vf_data = kcalloc(num_vfs,
|
adapter->vf_data = kcalloc(num_vfs,
|
||||||
sizeof(struct vf_data_storage),
|
sizeof(struct vf_data_storage),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!adapter->vf_data) {
|
if (!adapter->vf_data) {
|
||||||
dev_err(&pdev->dev, "Could not allocate VF private "
|
dev_err(&pdev->dev,
|
||||||
"data - IOV enable failed\n");
|
"Could not allocate VF private data - "
|
||||||
} else {
|
"IOV enable failed\n");
|
||||||
err = pci_enable_sriov(pdev, num_vfs);
|
|
||||||
if (!err) {
|
|
||||||
adapter->vfs_allocated_count = num_vfs;
|
|
||||||
dev_info(&pdev->dev, "%d vfs allocated\n", num_vfs);
|
|
||||||
for (i = 0; i < adapter->vfs_allocated_count; i++) {
|
|
||||||
random_ether_addr(mac_addr);
|
|
||||||
igb_set_vf_mac(adapter, i, mac_addr);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
kfree(adapter->vf_data);
|
err = pci_enable_sriov(pdev, num_vfs);
|
||||||
adapter->vf_data = NULL;
|
if (!err) {
|
||||||
|
adapter->vfs_allocated_count = num_vfs;
|
||||||
|
dev_info(&pdev->dev,
|
||||||
|
"%d vfs allocated\n",
|
||||||
|
num_vfs);
|
||||||
|
for (i = 0;
|
||||||
|
i < adapter->vfs_allocated_count;
|
||||||
|
i++) {
|
||||||
|
random_ether_addr(mac_addr);
|
||||||
|
igb_set_vf_mac(adapter, i,
|
||||||
|
mac_addr);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
kfree(adapter->vf_data);
|
||||||
|
adapter->vf_data = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -321,14 +321,11 @@ extern void igbvf_set_ethtool_ops(struct net_device *);
|
||||||
extern int igbvf_up(struct igbvf_adapter *);
|
extern int igbvf_up(struct igbvf_adapter *);
|
||||||
extern void igbvf_down(struct igbvf_adapter *);
|
extern void igbvf_down(struct igbvf_adapter *);
|
||||||
extern void igbvf_reinit_locked(struct igbvf_adapter *);
|
extern void igbvf_reinit_locked(struct igbvf_adapter *);
|
||||||
extern void igbvf_reset(struct igbvf_adapter *);
|
|
||||||
extern int igbvf_setup_rx_resources(struct igbvf_adapter *, struct igbvf_ring *);
|
extern int igbvf_setup_rx_resources(struct igbvf_adapter *, struct igbvf_ring *);
|
||||||
extern int igbvf_setup_tx_resources(struct igbvf_adapter *, struct igbvf_ring *);
|
extern int igbvf_setup_tx_resources(struct igbvf_adapter *, struct igbvf_ring *);
|
||||||
extern void igbvf_free_rx_resources(struct igbvf_ring *);
|
extern void igbvf_free_rx_resources(struct igbvf_ring *);
|
||||||
extern void igbvf_free_tx_resources(struct igbvf_ring *);
|
extern void igbvf_free_tx_resources(struct igbvf_ring *);
|
||||||
extern void igbvf_update_stats(struct igbvf_adapter *);
|
extern void igbvf_update_stats(struct igbvf_adapter *);
|
||||||
extern void igbvf_set_interrupt_capability(struct igbvf_adapter *);
|
|
||||||
extern void igbvf_reset_interrupt_capability(struct igbvf_adapter *);
|
|
||||||
|
|
||||||
extern unsigned int copybreak;
|
extern unsigned int copybreak;
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,9 @@ static const char igbvf_driver_string[] =
|
||||||
static const char igbvf_copyright[] = "Copyright (c) 2009 Intel Corporation.";
|
static const char igbvf_copyright[] = "Copyright (c) 2009 Intel Corporation.";
|
||||||
|
|
||||||
static int igbvf_poll(struct napi_struct *napi, int budget);
|
static int igbvf_poll(struct napi_struct *napi, int budget);
|
||||||
|
static void igbvf_reset(struct igbvf_adapter *);
|
||||||
|
static void igbvf_set_interrupt_capability(struct igbvf_adapter *);
|
||||||
|
static void igbvf_reset_interrupt_capability(struct igbvf_adapter *);
|
||||||
|
|
||||||
static struct igbvf_info igbvf_vf_info = {
|
static struct igbvf_info igbvf_vf_info = {
|
||||||
.mac = e1000_vfadapt,
|
.mac = e1000_vfadapt,
|
||||||
|
@ -990,7 +993,7 @@ static void igbvf_configure_msix(struct igbvf_adapter *adapter)
|
||||||
e1e_flush();
|
e1e_flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
void igbvf_reset_interrupt_capability(struct igbvf_adapter *adapter)
|
static void igbvf_reset_interrupt_capability(struct igbvf_adapter *adapter)
|
||||||
{
|
{
|
||||||
if (adapter->msix_entries) {
|
if (adapter->msix_entries) {
|
||||||
pci_disable_msix(adapter->pdev);
|
pci_disable_msix(adapter->pdev);
|
||||||
|
@ -1005,7 +1008,7 @@ void igbvf_reset_interrupt_capability(struct igbvf_adapter *adapter)
|
||||||
* Attempt to configure interrupts using the best available
|
* Attempt to configure interrupts using the best available
|
||||||
* capabilities of the hardware and kernel.
|
* capabilities of the hardware and kernel.
|
||||||
**/
|
**/
|
||||||
void igbvf_set_interrupt_capability(struct igbvf_adapter *adapter)
|
static void igbvf_set_interrupt_capability(struct igbvf_adapter *adapter)
|
||||||
{
|
{
|
||||||
int err = -ENOMEM;
|
int err = -ENOMEM;
|
||||||
int i;
|
int i;
|
||||||
|
@ -1447,7 +1450,7 @@ static void igbvf_configure(struct igbvf_adapter *adapter)
|
||||||
* set/changed during runtime. After reset the device needs to be
|
* set/changed during runtime. After reset the device needs to be
|
||||||
* properly configured for Rx, Tx etc.
|
* properly configured for Rx, Tx etc.
|
||||||
*/
|
*/
|
||||||
void igbvf_reset(struct igbvf_adapter *adapter)
|
static void igbvf_reset(struct igbvf_adapter *adapter)
|
||||||
{
|
{
|
||||||
struct e1000_mac_info *mac = &adapter->hw.mac;
|
struct e1000_mac_info *mac = &adapter->hw.mac;
|
||||||
struct net_device *netdev = adapter->netdev;
|
struct net_device *netdev = adapter->netdev;
|
||||||
|
|
|
@ -44,7 +44,7 @@ static s32 e1000_set_vfta_vf(struct e1000_hw *, u16, bool);
|
||||||
* e1000_init_mac_params_vf - Inits MAC params
|
* e1000_init_mac_params_vf - Inits MAC params
|
||||||
* @hw: pointer to the HW structure
|
* @hw: pointer to the HW structure
|
||||||
**/
|
**/
|
||||||
s32 e1000_init_mac_params_vf(struct e1000_hw *hw)
|
static s32 e1000_init_mac_params_vf(struct e1000_hw *hw)
|
||||||
{
|
{
|
||||||
struct e1000_mac_info *mac = &hw->mac;
|
struct e1000_mac_info *mac = &hw->mac;
|
||||||
|
|
||||||
|
|
|
@ -259,7 +259,6 @@ struct e1000_hw {
|
||||||
/* These functions must be implemented by drivers */
|
/* These functions must be implemented by drivers */
|
||||||
void e1000_rlpml_set_vf(struct e1000_hw *, u16);
|
void e1000_rlpml_set_vf(struct e1000_hw *, u16);
|
||||||
void e1000_init_function_pointers_vf(struct e1000_hw *hw);
|
void e1000_init_function_pointers_vf(struct e1000_hw *hw);
|
||||||
s32 e1000_init_mac_params_vf(struct e1000_hw *hw);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* _E1000_VF_H_ */
|
#endif /* _E1000_VF_H_ */
|
||||||
|
|
|
@ -1214,6 +1214,19 @@ static void __devinit ioc3_serial_probe(struct pci_dev *pdev, struct ioc3 *ioc3)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static const struct net_device_ops ioc3_netdev_ops = {
|
||||||
|
.ndo_open = ioc3_open,
|
||||||
|
.ndo_stop = ioc3_close,
|
||||||
|
.ndo_start_xmit = ioc3_start_xmit,
|
||||||
|
.ndo_tx_timeout = ioc3_timeout,
|
||||||
|
.ndo_get_stats = ioc3_get_stats,
|
||||||
|
.ndo_set_multicast_list = ioc3_set_multicast_list,
|
||||||
|
.ndo_do_ioctl = ioc3_ioctl,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_set_mac_address = ioc3_set_mac_address,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
};
|
||||||
|
|
||||||
static int __devinit ioc3_probe(struct pci_dev *pdev,
|
static int __devinit ioc3_probe(struct pci_dev *pdev,
|
||||||
const struct pci_device_id *ent)
|
const struct pci_device_id *ent)
|
||||||
{
|
{
|
||||||
|
@ -1310,15 +1323,8 @@ static int __devinit ioc3_probe(struct pci_dev *pdev,
|
||||||
ioc3_get_eaddr(ip);
|
ioc3_get_eaddr(ip);
|
||||||
|
|
||||||
/* The IOC3-specific entries in the device structure. */
|
/* The IOC3-specific entries in the device structure. */
|
||||||
dev->open = ioc3_open;
|
|
||||||
dev->hard_start_xmit = ioc3_start_xmit;
|
|
||||||
dev->tx_timeout = ioc3_timeout;
|
|
||||||
dev->watchdog_timeo = 5 * HZ;
|
dev->watchdog_timeo = 5 * HZ;
|
||||||
dev->stop = ioc3_close;
|
dev->netdev_ops = &ioc3_netdev_ops;
|
||||||
dev->get_stats = ioc3_get_stats;
|
|
||||||
dev->do_ioctl = ioc3_ioctl;
|
|
||||||
dev->set_multicast_list = ioc3_set_multicast_list;
|
|
||||||
dev->set_mac_address = ioc3_set_mac_address;
|
|
||||||
dev->ethtool_ops = &ioc3_ethtool_ops;
|
dev->ethtool_ops = &ioc3_ethtool_ops;
|
||||||
dev->features = NETIF_F_IP_CSUM;
|
dev->features = NETIF_F_IP_CSUM;
|
||||||
|
|
||||||
|
|
|
@ -181,6 +181,18 @@ out:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static const struct net_device_ops netcard_netdev_ops = {
|
||||||
|
.ndo_open = net_open,
|
||||||
|
.ndo_stop = net_close,
|
||||||
|
.ndo_start_xmit = net_send_packet,
|
||||||
|
.ndo_get_stats = net_get_stats,
|
||||||
|
.ndo_set_multicast_list = set_multicast_list,
|
||||||
|
.ndo_tx_timeout = net_tx_timeout,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is the real probe routine. Linux has a history of friendly device
|
* This is the real probe routine. Linux has a history of friendly device
|
||||||
* probes on the ISA bus. A good device probes avoids doing writes, and
|
* probes on the ISA bus. A good device probes avoids doing writes, and
|
||||||
|
@ -303,13 +315,7 @@ static int __init netcard_probe1(struct net_device *dev, int ioaddr)
|
||||||
np = netdev_priv(dev);
|
np = netdev_priv(dev);
|
||||||
spin_lock_init(&np->lock);
|
spin_lock_init(&np->lock);
|
||||||
|
|
||||||
dev->open = net_open;
|
dev->netdev_ops = &netcard_netdev_ops;
|
||||||
dev->stop = net_close;
|
|
||||||
dev->hard_start_xmit = net_send_packet;
|
|
||||||
dev->get_stats = net_get_stats;
|
|
||||||
dev->set_multicast_list = &set_multicast_list;
|
|
||||||
|
|
||||||
dev->tx_timeout = &net_tx_timeout;
|
|
||||||
dev->watchdog_timeo = MY_TX_TIMEOUT;
|
dev->watchdog_timeo = MY_TX_TIMEOUT;
|
||||||
|
|
||||||
err = register_netdev(dev);
|
err = register_netdev(dev);
|
||||||
|
|
|
@ -884,61 +884,6 @@ static s32 ixgbe_clear_vfta_82598(struct ixgbe_hw *hw)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ixgbe_blink_led_start_82598 - Blink LED based on index.
|
|
||||||
* @hw: pointer to hardware structure
|
|
||||||
* @index: led number to blink
|
|
||||||
**/
|
|
||||||
static s32 ixgbe_blink_led_start_82598(struct ixgbe_hw *hw, u32 index)
|
|
||||||
{
|
|
||||||
ixgbe_link_speed speed = 0;
|
|
||||||
bool link_up = 0;
|
|
||||||
u32 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC);
|
|
||||||
u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Link must be up to auto-blink the LEDs on the 82598EB MAC;
|
|
||||||
* force it if link is down.
|
|
||||||
*/
|
|
||||||
hw->mac.ops.check_link(hw, &speed, &link_up, false);
|
|
||||||
|
|
||||||
if (!link_up) {
|
|
||||||
autoc_reg |= IXGBE_AUTOC_FLU;
|
|
||||||
IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg);
|
|
||||||
msleep(10);
|
|
||||||
}
|
|
||||||
|
|
||||||
led_reg &= ~IXGBE_LED_MODE_MASK(index);
|
|
||||||
led_reg |= IXGBE_LED_BLINK(index);
|
|
||||||
IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, led_reg);
|
|
||||||
IXGBE_WRITE_FLUSH(hw);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ixgbe_blink_led_stop_82598 - Stop blinking LED based on index.
|
|
||||||
* @hw: pointer to hardware structure
|
|
||||||
* @index: led number to stop blinking
|
|
||||||
**/
|
|
||||||
static s32 ixgbe_blink_led_stop_82598(struct ixgbe_hw *hw, u32 index)
|
|
||||||
{
|
|
||||||
u32 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC);
|
|
||||||
u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
|
|
||||||
|
|
||||||
autoc_reg &= ~IXGBE_AUTOC_FLU;
|
|
||||||
autoc_reg |= IXGBE_AUTOC_AN_RESTART;
|
|
||||||
IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg);
|
|
||||||
|
|
||||||
led_reg &= ~IXGBE_LED_MODE_MASK(index);
|
|
||||||
led_reg &= ~IXGBE_LED_BLINK(index);
|
|
||||||
led_reg |= IXGBE_LED_LINK_ACTIVE << IXGBE_LED_MODE_SHIFT(index);
|
|
||||||
IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, led_reg);
|
|
||||||
IXGBE_WRITE_FLUSH(hw);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ixgbe_read_analog_reg8_82598 - Reads 8 bit Atlas analog register
|
* ixgbe_read_analog_reg8_82598 - Reads 8 bit Atlas analog register
|
||||||
* @hw: pointer to hardware structure
|
* @hw: pointer to hardware structure
|
||||||
|
@ -1128,8 +1073,8 @@ static struct ixgbe_mac_operations mac_ops_82598 = {
|
||||||
.get_link_capabilities = &ixgbe_get_link_capabilities_82598,
|
.get_link_capabilities = &ixgbe_get_link_capabilities_82598,
|
||||||
.led_on = &ixgbe_led_on_generic,
|
.led_on = &ixgbe_led_on_generic,
|
||||||
.led_off = &ixgbe_led_off_generic,
|
.led_off = &ixgbe_led_off_generic,
|
||||||
.blink_led_start = &ixgbe_blink_led_start_82598,
|
.blink_led_start = &ixgbe_blink_led_start_generic,
|
||||||
.blink_led_stop = &ixgbe_blink_led_stop_82598,
|
.blink_led_stop = &ixgbe_blink_led_stop_generic,
|
||||||
.set_rar = &ixgbe_set_rar_generic,
|
.set_rar = &ixgbe_set_rar_generic,
|
||||||
.clear_rar = &ixgbe_clear_rar_generic,
|
.clear_rar = &ixgbe_clear_rar_generic,
|
||||||
.set_vmdq = &ixgbe_set_vmdq_82598,
|
.set_vmdq = &ixgbe_set_vmdq_82598,
|
||||||
|
|
|
@ -68,8 +68,6 @@ s32 ixgbe_clear_vmdq_82599(struct ixgbe_hw *hw, u32 rar, u32 vmdq);
|
||||||
s32 ixgbe_set_vfta_82599(struct ixgbe_hw *hw, u32 vlan,
|
s32 ixgbe_set_vfta_82599(struct ixgbe_hw *hw, u32 vlan,
|
||||||
u32 vind, bool vlan_on);
|
u32 vind, bool vlan_on);
|
||||||
s32 ixgbe_clear_vfta_82599(struct ixgbe_hw *hw);
|
s32 ixgbe_clear_vfta_82599(struct ixgbe_hw *hw);
|
||||||
s32 ixgbe_blink_led_stop_82599(struct ixgbe_hw *hw, u32 index);
|
|
||||||
s32 ixgbe_blink_led_start_82599(struct ixgbe_hw *hw, u32 index);
|
|
||||||
s32 ixgbe_init_uta_tables_82599(struct ixgbe_hw *hw);
|
s32 ixgbe_init_uta_tables_82599(struct ixgbe_hw *hw);
|
||||||
s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val);
|
s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val);
|
||||||
s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val);
|
s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val);
|
||||||
|
@ -990,40 +988,6 @@ s32 ixgbe_clear_vfta_82599(struct ixgbe_hw *hw)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ixgbe_blink_led_start_82599 - Blink LED based on index.
|
|
||||||
* @hw: pointer to hardware structure
|
|
||||||
* @index: led number to blink
|
|
||||||
**/
|
|
||||||
s32 ixgbe_blink_led_start_82599(struct ixgbe_hw *hw, u32 index)
|
|
||||||
{
|
|
||||||
u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
|
|
||||||
|
|
||||||
led_reg &= ~IXGBE_LED_MODE_MASK(index);
|
|
||||||
led_reg |= IXGBE_LED_BLINK(index);
|
|
||||||
IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, led_reg);
|
|
||||||
IXGBE_WRITE_FLUSH(hw);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ixgbe_blink_led_stop_82599 - Stop blinking LED based on index.
|
|
||||||
* @hw: pointer to hardware structure
|
|
||||||
* @index: led number to stop blinking
|
|
||||||
**/
|
|
||||||
s32 ixgbe_blink_led_stop_82599(struct ixgbe_hw *hw, u32 index)
|
|
||||||
{
|
|
||||||
u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
|
|
||||||
|
|
||||||
led_reg &= ~IXGBE_LED_MODE_MASK(index);
|
|
||||||
led_reg &= ~IXGBE_LED_BLINK(index);
|
|
||||||
IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, led_reg);
|
|
||||||
IXGBE_WRITE_FLUSH(hw);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ixgbe_init_uta_tables_82599 - Initialize the Unicast Table Array
|
* ixgbe_init_uta_tables_82599 - Initialize the Unicast Table Array
|
||||||
* @hw: pointer to hardware structure
|
* @hw: pointer to hardware structure
|
||||||
|
@ -1243,8 +1207,8 @@ static struct ixgbe_mac_operations mac_ops_82599 = {
|
||||||
.get_link_capabilities = &ixgbe_get_link_capabilities_82599,
|
.get_link_capabilities = &ixgbe_get_link_capabilities_82599,
|
||||||
.led_on = &ixgbe_led_on_generic,
|
.led_on = &ixgbe_led_on_generic,
|
||||||
.led_off = &ixgbe_led_off_generic,
|
.led_off = &ixgbe_led_off_generic,
|
||||||
.blink_led_start = &ixgbe_blink_led_start_82599,
|
.blink_led_start = &ixgbe_blink_led_start_generic,
|
||||||
.blink_led_stop = &ixgbe_blink_led_stop_82599,
|
.blink_led_stop = &ixgbe_blink_led_stop_generic,
|
||||||
.set_rar = &ixgbe_set_rar_generic,
|
.set_rar = &ixgbe_set_rar_generic,
|
||||||
.clear_rar = &ixgbe_clear_rar_generic,
|
.clear_rar = &ixgbe_clear_rar_generic,
|
||||||
.set_vmdq = &ixgbe_set_vmdq_82599,
|
.set_vmdq = &ixgbe_set_vmdq_82599,
|
||||||
|
|
|
@ -2071,3 +2071,58 @@ s32 ixgbe_enable_rx_dma_generic(struct ixgbe_hw *hw, u32 regval)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ixgbe_blink_led_start_generic - Blink LED based on index.
|
||||||
|
* @hw: pointer to hardware structure
|
||||||
|
* @index: led number to blink
|
||||||
|
**/
|
||||||
|
s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index)
|
||||||
|
{
|
||||||
|
ixgbe_link_speed speed = 0;
|
||||||
|
bool link_up = 0;
|
||||||
|
u32 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC);
|
||||||
|
u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Link must be up to auto-blink the LEDs;
|
||||||
|
* Force it if link is down.
|
||||||
|
*/
|
||||||
|
hw->mac.ops.check_link(hw, &speed, &link_up, false);
|
||||||
|
|
||||||
|
if (!link_up) {
|
||||||
|
autoc_reg |= IXGBE_AUTOC_FLU;
|
||||||
|
IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg);
|
||||||
|
msleep(10);
|
||||||
|
}
|
||||||
|
|
||||||
|
led_reg &= ~IXGBE_LED_MODE_MASK(index);
|
||||||
|
led_reg |= IXGBE_LED_BLINK(index);
|
||||||
|
IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, led_reg);
|
||||||
|
IXGBE_WRITE_FLUSH(hw);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ixgbe_blink_led_stop_generic - Stop blinking LED based on index.
|
||||||
|
* @hw: pointer to hardware structure
|
||||||
|
* @index: led number to stop blinking
|
||||||
|
**/
|
||||||
|
s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index)
|
||||||
|
{
|
||||||
|
u32 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC);
|
||||||
|
u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
|
||||||
|
|
||||||
|
autoc_reg &= ~IXGBE_AUTOC_FLU;
|
||||||
|
autoc_reg |= IXGBE_AUTOC_AN_RESTART;
|
||||||
|
IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg);
|
||||||
|
|
||||||
|
led_reg &= ~IXGBE_LED_MODE_MASK(index);
|
||||||
|
led_reg &= ~IXGBE_LED_BLINK(index);
|
||||||
|
led_reg |= IXGBE_LED_LINK_ACTIVE << IXGBE_LED_MODE_SHIFT(index);
|
||||||
|
IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, led_reg);
|
||||||
|
IXGBE_WRITE_FLUSH(hw);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
@ -76,6 +76,9 @@ s32 ixgbe_disable_pcie_master(struct ixgbe_hw *hw);
|
||||||
s32 ixgbe_read_analog_reg8_generic(struct ixgbe_hw *hw, u32 reg, u8 *val);
|
s32 ixgbe_read_analog_reg8_generic(struct ixgbe_hw *hw, u32 reg, u8 *val);
|
||||||
s32 ixgbe_write_analog_reg8_generic(struct ixgbe_hw *hw, u32 reg, u8 val);
|
s32 ixgbe_write_analog_reg8_generic(struct ixgbe_hw *hw, u32 reg, u8 val);
|
||||||
|
|
||||||
|
s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index);
|
||||||
|
s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index);
|
||||||
|
|
||||||
#define IXGBE_WRITE_REG(a, reg, value) writel((value), ((a)->hw_addr + (reg)))
|
#define IXGBE_WRITE_REG(a, reg, value) writel((value), ((a)->hw_addr + (reg)))
|
||||||
|
|
||||||
#ifndef writeq
|
#ifndef writeq
|
||||||
|
|
|
@ -943,6 +943,24 @@ static void ixgbe_get_strings(struct net_device *netdev, u32 stringset,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int ixgbe_wol_exclusion(struct ixgbe_adapter *adapter,
|
||||||
|
struct ethtool_wolinfo *wol)
|
||||||
|
{
|
||||||
|
struct ixgbe_hw *hw = &adapter->hw;
|
||||||
|
int retval = 1;
|
||||||
|
|
||||||
|
switch(hw->device_id) {
|
||||||
|
case IXGBE_DEV_ID_82599_KX4:
|
||||||
|
retval = 0;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
wol->supported = 0;
|
||||||
|
retval = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
static void ixgbe_get_wol(struct net_device *netdev,
|
static void ixgbe_get_wol(struct net_device *netdev,
|
||||||
struct ethtool_wolinfo *wol)
|
struct ethtool_wolinfo *wol)
|
||||||
{
|
{
|
||||||
|
@ -952,7 +970,8 @@ static void ixgbe_get_wol(struct net_device *netdev,
|
||||||
WAKE_BCAST | WAKE_MAGIC;
|
WAKE_BCAST | WAKE_MAGIC;
|
||||||
wol->wolopts = 0;
|
wol->wolopts = 0;
|
||||||
|
|
||||||
if (!device_can_wakeup(&adapter->pdev->dev))
|
if (ixgbe_wol_exclusion(adapter, wol) ||
|
||||||
|
!device_can_wakeup(&adapter->pdev->dev))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (adapter->wol & IXGBE_WUFC_EX)
|
if (adapter->wol & IXGBE_WUFC_EX)
|
||||||
|
@ -974,6 +993,9 @@ static int ixgbe_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
|
||||||
if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE))
|
if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE))
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
|
if (ixgbe_wol_exclusion(adapter, wol))
|
||||||
|
return wol->wolopts ? -EOPNOTSUPP : 0;
|
||||||
|
|
||||||
adapter->wol = 0;
|
adapter->wol = 0;
|
||||||
|
|
||||||
if (wol->wolopts & WAKE_UCAST)
|
if (wol->wolopts & WAKE_UCAST)
|
||||||
|
|
|
@ -2723,17 +2723,21 @@ static inline bool ixgbe_set_rss_queues(struct ixgbe_adapter *adapter)
|
||||||
**/
|
**/
|
||||||
static void ixgbe_set_num_queues(struct ixgbe_adapter *adapter)
|
static void ixgbe_set_num_queues(struct ixgbe_adapter *adapter)
|
||||||
{
|
{
|
||||||
/* Start with base case */
|
|
||||||
adapter->num_rx_queues = 1;
|
|
||||||
adapter->num_tx_queues = 1;
|
|
||||||
|
|
||||||
#ifdef CONFIG_IXGBE_DCB
|
#ifdef CONFIG_IXGBE_DCB
|
||||||
if (ixgbe_set_dcb_queues(adapter))
|
if (ixgbe_set_dcb_queues(adapter))
|
||||||
return;
|
goto done;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
if (ixgbe_set_rss_queues(adapter))
|
if (ixgbe_set_rss_queues(adapter))
|
||||||
return;
|
goto done;
|
||||||
|
|
||||||
|
/* fallback to base case */
|
||||||
|
adapter->num_rx_queues = 1;
|
||||||
|
adapter->num_tx_queues = 1;
|
||||||
|
|
||||||
|
done:
|
||||||
|
/* Notify the stack of the (possibly) reduced Tx Queue count. */
|
||||||
|
adapter->netdev->real_num_tx_queues = adapter->num_tx_queues;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ixgbe_acquire_msix_vectors(struct ixgbe_adapter *adapter,
|
static void ixgbe_acquire_msix_vectors(struct ixgbe_adapter *adapter,
|
||||||
|
@ -2992,9 +2996,6 @@ try_msi:
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
/* Notify the stack of the (possibly) reduced Tx Queue count. */
|
|
||||||
adapter->netdev->real_num_tx_queues = adapter->num_tx_queues;
|
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3611,9 +3612,9 @@ static int ixgbe_resume(struct pci_dev *pdev)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM */
|
||||||
static int ixgbe_suspend(struct pci_dev *pdev, pm_message_t state)
|
|
||||||
|
static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)
|
||||||
{
|
{
|
||||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
struct net_device *netdev = pci_get_drvdata(pdev);
|
||||||
struct ixgbe_adapter *adapter = netdev_priv(netdev);
|
struct ixgbe_adapter *adapter = netdev_priv(netdev);
|
||||||
|
@ -3672,18 +3673,46 @@ static int ixgbe_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||||
pci_enable_wake(pdev, PCI_D3cold, 0);
|
pci_enable_wake(pdev, PCI_D3cold, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*enable_wake = !!wufc;
|
||||||
|
|
||||||
ixgbe_release_hw_control(adapter);
|
ixgbe_release_hw_control(adapter);
|
||||||
|
|
||||||
pci_disable_device(pdev);
|
pci_disable_device(pdev);
|
||||||
|
|
||||||
pci_set_power_state(pdev, pci_choose_state(pdev, state));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_PM
|
||||||
|
static int ixgbe_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||||
|
{
|
||||||
|
int retval;
|
||||||
|
bool wake;
|
||||||
|
|
||||||
|
retval = __ixgbe_shutdown(pdev, &wake);
|
||||||
|
if (retval)
|
||||||
|
return retval;
|
||||||
|
|
||||||
|
if (wake) {
|
||||||
|
pci_prepare_to_sleep(pdev);
|
||||||
|
} else {
|
||||||
|
pci_wake_from_d3(pdev, false);
|
||||||
|
pci_set_power_state(pdev, PCI_D3hot);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
static void ixgbe_shutdown(struct pci_dev *pdev)
|
static void ixgbe_shutdown(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
ixgbe_suspend(pdev, PMSG_SUSPEND);
|
bool wake;
|
||||||
|
|
||||||
|
__ixgbe_shutdown(pdev, &wake);
|
||||||
|
|
||||||
|
if (system_state == SYSTEM_POWER_OFF) {
|
||||||
|
pci_wake_from_d3(pdev, wake);
|
||||||
|
pci_set_power_state(pdev, PCI_D3hot);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4342,7 +4371,7 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
|
||||||
int count = 0;
|
int count = 0;
|
||||||
unsigned int f;
|
unsigned int f;
|
||||||
|
|
||||||
r_idx = (adapter->num_tx_queues - 1) & skb->queue_mapping;
|
r_idx = skb->queue_mapping;
|
||||||
tx_ring = &adapter->tx_ring[r_idx];
|
tx_ring = &adapter->tx_ring[r_idx];
|
||||||
|
|
||||||
if (adapter->vlgrp && vlan_tx_tag_present(skb)) {
|
if (adapter->vlgrp && vlan_tx_tag_present(skb)) {
|
||||||
|
|
|
@ -168,6 +168,17 @@ writereg(struct net_device *dev, int portno, int value)
|
||||||
nubus_writew(swab16(value), dev->mem_start + portno);
|
nubus_writew(swab16(value), dev->mem_start + portno);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct net_device_ops mac89x0_netdev_ops = {
|
||||||
|
.ndo_open = net_open,
|
||||||
|
.ndo_stop = net_close,
|
||||||
|
.ndo_start_xmit = net_send_packet,
|
||||||
|
.ndo_get_stats = net_get_stats,
|
||||||
|
.ndo_set_multicast_list = set_multicast_list,
|
||||||
|
.ndo_set_mac_address = set_mac_address,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
};
|
||||||
|
|
||||||
/* Probe for the CS8900 card in slot E. We won't bother looking
|
/* Probe for the CS8900 card in slot E. We won't bother looking
|
||||||
anywhere else until we have a really good reason to do so. */
|
anywhere else until we have a really good reason to do so. */
|
||||||
struct net_device * __init mac89x0_probe(int unit)
|
struct net_device * __init mac89x0_probe(int unit)
|
||||||
|
@ -280,12 +291,7 @@ struct net_device * __init mac89x0_probe(int unit)
|
||||||
|
|
||||||
printk(" IRQ %d ADDR %pM\n", dev->irq, dev->dev_addr);
|
printk(" IRQ %d ADDR %pM\n", dev->irq, dev->dev_addr);
|
||||||
|
|
||||||
dev->open = net_open;
|
dev->netdev_ops = &mac89x0_netdev_ops;
|
||||||
dev->stop = net_close;
|
|
||||||
dev->hard_start_xmit = net_send_packet;
|
|
||||||
dev->get_stats = net_get_stats;
|
|
||||||
dev->set_multicast_list = &set_multicast_list;
|
|
||||||
dev->set_mac_address = &set_mac_address;
|
|
||||||
|
|
||||||
err = register_netdev(dev);
|
err = register_netdev(dev);
|
||||||
if (err)
|
if (err)
|
||||||
|
|
|
@ -1100,6 +1100,18 @@ static int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
|
||||||
return phy_mii_ioctl(phydev, if_mii(rq), cmd);
|
return phy_mii_ioctl(phydev, if_mii(rq), cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct net_device_ops macb_netdev_ops = {
|
||||||
|
.ndo_open = macb_open,
|
||||||
|
.ndo_stop = macb_close,
|
||||||
|
.ndo_start_xmit = macb_start_xmit,
|
||||||
|
.ndo_set_multicast_list = macb_set_rx_mode,
|
||||||
|
.ndo_get_stats = macb_get_stats,
|
||||||
|
.ndo_do_ioctl = macb_ioctl,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
};
|
||||||
|
|
||||||
static int __init macb_probe(struct platform_device *pdev)
|
static int __init macb_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct eth_platform_data *pdata;
|
struct eth_platform_data *pdata;
|
||||||
|
@ -1175,12 +1187,7 @@ static int __init macb_probe(struct platform_device *pdev)
|
||||||
goto err_out_iounmap;
|
goto err_out_iounmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev->open = macb_open;
|
dev->netdev_ops = &macb_netdev_ops;
|
||||||
dev->stop = macb_close;
|
|
||||||
dev->hard_start_xmit = macb_start_xmit;
|
|
||||||
dev->get_stats = macb_get_stats;
|
|
||||||
dev->set_multicast_list = macb_set_rx_mode;
|
|
||||||
dev->do_ioctl = macb_ioctl;
|
|
||||||
netif_napi_add(dev, &bp->napi, macb_poll, 64);
|
netif_napi_add(dev, &bp->napi, macb_poll, 64);
|
||||||
dev->ethtool_ops = &macb_ethtool_ops;
|
dev->ethtool_ops = &macb_ethtool_ops;
|
||||||
|
|
||||||
|
|
|
@ -167,6 +167,18 @@ static int macsonic_close(struct net_device* dev)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct net_device_ops macsonic_netdev_ops = {
|
||||||
|
.ndo_open = macsonic_open,
|
||||||
|
.ndo_stop = macsonic_close,
|
||||||
|
.ndo_start_xmit = sonic_send_packet,
|
||||||
|
.ndo_set_multicast_list = sonic_multicast_list,
|
||||||
|
.ndo_tx_timeout = sonic_tx_timeout,
|
||||||
|
.ndo_get_stats = sonic_get_stats,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
};
|
||||||
|
|
||||||
static int __init macsonic_init(struct net_device *dev)
|
static int __init macsonic_init(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct sonic_local* lp = netdev_priv(dev);
|
struct sonic_local* lp = netdev_priv(dev);
|
||||||
|
@ -198,12 +210,7 @@ static int __init macsonic_init(struct net_device *dev)
|
||||||
lp->rra_laddr = lp->rda_laddr + (SIZEOF_SONIC_RD * SONIC_NUM_RDS
|
lp->rra_laddr = lp->rda_laddr + (SIZEOF_SONIC_RD * SONIC_NUM_RDS
|
||||||
* SONIC_BUS_SCALE(lp->dma_bitmode));
|
* SONIC_BUS_SCALE(lp->dma_bitmode));
|
||||||
|
|
||||||
dev->open = macsonic_open;
|
dev->netdev_ops = &macsonic_netdev_ops;
|
||||||
dev->stop = macsonic_close;
|
|
||||||
dev->hard_start_xmit = sonic_send_packet;
|
|
||||||
dev->get_stats = sonic_get_stats;
|
|
||||||
dev->set_multicast_list = &sonic_multicast_list;
|
|
||||||
dev->tx_timeout = sonic_tx_timeout;
|
|
||||||
dev->watchdog_timeo = TX_TIMEOUT;
|
dev->watchdog_timeo = TX_TIMEOUT;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -2447,6 +2447,7 @@ static int myri10ge_open(struct net_device *dev)
|
||||||
lro_mgr->lro_arr = ss->rx_done.lro_desc;
|
lro_mgr->lro_arr = ss->rx_done.lro_desc;
|
||||||
lro_mgr->get_frag_header = myri10ge_get_frag_header;
|
lro_mgr->get_frag_header = myri10ge_get_frag_header;
|
||||||
lro_mgr->max_aggr = myri10ge_lro_max_pkts;
|
lro_mgr->max_aggr = myri10ge_lro_max_pkts;
|
||||||
|
lro_mgr->frag_align_pad = 2;
|
||||||
if (lro_mgr->max_aggr > MAX_SKB_FRAGS)
|
if (lro_mgr->max_aggr > MAX_SKB_FRAGS)
|
||||||
lro_mgr->max_aggr = MAX_SKB_FRAGS;
|
lro_mgr->max_aggr = MAX_SKB_FRAGS;
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <linux/mii.h>
|
#include <linux/mii.h>
|
||||||
#include <linux/phy.h>
|
#include <linux/phy.h>
|
||||||
#include <linux/phy_fixed.h>
|
#include <linux/phy_fixed.h>
|
||||||
|
#include <linux/err.h>
|
||||||
|
|
||||||
#define MII_REGS_NUM 29
|
#define MII_REGS_NUM 29
|
||||||
|
|
||||||
|
@ -207,8 +208,8 @@ static int __init fixed_mdio_bus_init(void)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
pdev = platform_device_register_simple("Fixed MDIO bus", 0, NULL, 0);
|
pdev = platform_device_register_simple("Fixed MDIO bus", 0, NULL, 0);
|
||||||
if (!pdev) {
|
if (IS_ERR(pdev)) {
|
||||||
ret = -ENOMEM;
|
ret = PTR_ERR(pdev);
|
||||||
goto err_pdev;
|
goto err_pdev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,11 @@
|
||||||
#define MII_M1111_COPPER 0
|
#define MII_M1111_COPPER 0
|
||||||
#define MII_M1111_FIBER 1
|
#define MII_M1111_FIBER 1
|
||||||
|
|
||||||
|
#define MII_88E1121_PHY_LED_CTRL 16
|
||||||
|
#define MII_88E1121_PHY_LED_PAGE 3
|
||||||
|
#define MII_88E1121_PHY_LED_DEF 0x0030
|
||||||
|
#define MII_88E1121_PHY_PAGE 22
|
||||||
|
|
||||||
#define MII_M1011_PHY_STATUS 0x11
|
#define MII_M1011_PHY_STATUS 0x11
|
||||||
#define MII_M1011_PHY_STATUS_1000 0x8000
|
#define MII_M1011_PHY_STATUS_1000 0x8000
|
||||||
#define MII_M1011_PHY_STATUS_100 0x4000
|
#define MII_M1011_PHY_STATUS_100 0x4000
|
||||||
|
@ -154,6 +159,30 @@ static int marvell_config_aneg(struct phy_device *phydev)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int m88e1121_config_aneg(struct phy_device *phydev)
|
||||||
|
{
|
||||||
|
int err, temp;
|
||||||
|
|
||||||
|
err = phy_write(phydev, MII_BMCR, BMCR_RESET);
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
err = phy_write(phydev, MII_M1011_PHY_SCR,
|
||||||
|
MII_M1011_PHY_SCR_AUTO_CROSS);
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
temp = phy_read(phydev, MII_88E1121_PHY_PAGE);
|
||||||
|
|
||||||
|
phy_write(phydev, MII_88E1121_PHY_PAGE, MII_88E1121_PHY_LED_PAGE);
|
||||||
|
phy_write(phydev, MII_88E1121_PHY_LED_CTRL, MII_88E1121_PHY_LED_DEF);
|
||||||
|
phy_write(phydev, MII_88E1121_PHY_PAGE, temp);
|
||||||
|
|
||||||
|
err = genphy_config_aneg(phydev);
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
static int m88e1111_config_init(struct phy_device *phydev)
|
static int m88e1111_config_init(struct phy_device *phydev)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
@ -429,6 +458,18 @@ static int marvell_read_status(struct phy_device *phydev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int m88e1121_did_interrupt(struct phy_device *phydev)
|
||||||
|
{
|
||||||
|
int imask;
|
||||||
|
|
||||||
|
imask = phy_read(phydev, MII_M1011_IEVENT);
|
||||||
|
|
||||||
|
if (imask & MII_M1011_IMASK_INIT)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static struct phy_driver marvell_drivers[] = {
|
static struct phy_driver marvell_drivers[] = {
|
||||||
{
|
{
|
||||||
.phy_id = 0x01410c60,
|
.phy_id = 0x01410c60,
|
||||||
|
@ -481,6 +522,19 @@ static struct phy_driver marvell_drivers[] = {
|
||||||
.config_intr = &marvell_config_intr,
|
.config_intr = &marvell_config_intr,
|
||||||
.driver = {.owner = THIS_MODULE,},
|
.driver = {.owner = THIS_MODULE,},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.phy_id = 0x01410cb0,
|
||||||
|
.phy_id_mask = 0xfffffff0,
|
||||||
|
.name = "Marvell 88E1121R",
|
||||||
|
.features = PHY_GBIT_FEATURES,
|
||||||
|
.flags = PHY_HAS_INTERRUPT,
|
||||||
|
.config_aneg = &m88e1121_config_aneg,
|
||||||
|
.read_status = &marvell_read_status,
|
||||||
|
.ack_interrupt = &marvell_ack_interrupt,
|
||||||
|
.config_intr = &marvell_config_intr,
|
||||||
|
.did_interrupt = &m88e1121_did_interrupt,
|
||||||
|
.driver = { .owner = THIS_MODULE },
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.phy_id = 0x01410cd0,
|
.phy_id = 0x01410cd0,
|
||||||
.phy_id_mask = 0xfffffff0,
|
.phy_id_mask = 0xfffffff0,
|
||||||
|
|
|
@ -434,7 +434,7 @@ void phy_start_machine(struct phy_device *phydev,
|
||||||
phydev->adjust_state = handler;
|
phydev->adjust_state = handler;
|
||||||
|
|
||||||
INIT_DELAYED_WORK(&phydev->state_queue, phy_state_machine);
|
INIT_DELAYED_WORK(&phydev->state_queue, phy_state_machine);
|
||||||
schedule_delayed_work(&phydev->state_queue, jiffies + HZ);
|
schedule_delayed_work(&phydev->state_queue, HZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -655,6 +655,10 @@ static void phy_change(struct work_struct *work)
|
||||||
struct phy_device *phydev =
|
struct phy_device *phydev =
|
||||||
container_of(work, struct phy_device, phy_queue);
|
container_of(work, struct phy_device, phy_queue);
|
||||||
|
|
||||||
|
if (phydev->drv->did_interrupt &&
|
||||||
|
!phydev->drv->did_interrupt(phydev))
|
||||||
|
goto ignore;
|
||||||
|
|
||||||
err = phy_disable_interrupts(phydev);
|
err = phy_disable_interrupts(phydev);
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
|
@ -681,6 +685,11 @@ static void phy_change(struct work_struct *work)
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
ignore:
|
||||||
|
atomic_dec(&phydev->irq_disable);
|
||||||
|
enable_irq(phydev->irq);
|
||||||
|
return;
|
||||||
|
|
||||||
irq_enable_err:
|
irq_enable_err:
|
||||||
disable_irq(phydev->irq);
|
disable_irq(phydev->irq);
|
||||||
atomic_inc(&phydev->irq_disable);
|
atomic_inc(&phydev->irq_disable);
|
||||||
|
@ -937,6 +946,5 @@ static void phy_state_machine(struct work_struct *work)
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
phy_error(phydev);
|
phy_error(phydev);
|
||||||
|
|
||||||
schedule_delayed_work(&phydev->state_queue,
|
schedule_delayed_work(&phydev->state_queue, PHY_STATE_TIME * HZ);
|
||||||
jiffies + PHY_STATE_TIME * HZ);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -448,9 +448,6 @@ static void efx_init_channels(struct efx_nic *efx)
|
||||||
|
|
||||||
WARN_ON(channel->rx_pkt != NULL);
|
WARN_ON(channel->rx_pkt != NULL);
|
||||||
efx_rx_strategy(channel);
|
efx_rx_strategy(channel);
|
||||||
|
|
||||||
netif_napi_add(channel->napi_dev, &channel->napi_str,
|
|
||||||
efx_poll, napi_weight);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1321,6 +1318,8 @@ static int efx_init_napi(struct efx_nic *efx)
|
||||||
|
|
||||||
efx_for_each_channel(channel, efx) {
|
efx_for_each_channel(channel, efx) {
|
||||||
channel->napi_dev = efx->net_dev;
|
channel->napi_dev = efx->net_dev;
|
||||||
|
netif_napi_add(channel->napi_dev, &channel->napi_str,
|
||||||
|
efx_poll, napi_weight);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1330,6 +1329,8 @@ static void efx_fini_napi(struct efx_nic *efx)
|
||||||
struct efx_channel *channel;
|
struct efx_channel *channel;
|
||||||
|
|
||||||
efx_for_each_channel(channel, efx) {
|
efx_for_each_channel(channel, efx) {
|
||||||
|
if (channel->napi_dev)
|
||||||
|
netif_napi_del(&channel->napi_str);
|
||||||
channel->napi_dev = NULL;
|
channel->napi_dev = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1176,9 +1176,9 @@ void falcon_sim_phy_event(struct efx_nic *efx)
|
||||||
|
|
||||||
EFX_POPULATE_QWORD_1(phy_event, EV_CODE, GLOBAL_EV_DECODE);
|
EFX_POPULATE_QWORD_1(phy_event, EV_CODE, GLOBAL_EV_DECODE);
|
||||||
if (EFX_IS10G(efx))
|
if (EFX_IS10G(efx))
|
||||||
EFX_SET_OWORD_FIELD(phy_event, XG_PHY_INTR, 1);
|
EFX_SET_QWORD_FIELD(phy_event, XG_PHY_INTR, 1);
|
||||||
else
|
else
|
||||||
EFX_SET_OWORD_FIELD(phy_event, G_PHY0_INTR, 1);
|
EFX_SET_QWORD_FIELD(phy_event, G_PHY0_INTR, 1);
|
||||||
|
|
||||||
falcon_generate_event(&efx->channel[0], &phy_event);
|
falcon_generate_event(&efx->channel[0], &phy_event);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1188,6 +1188,19 @@ out:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct net_device_ops sh_eth_netdev_ops = {
|
||||||
|
.ndo_open = sh_eth_open,
|
||||||
|
.ndo_stop = sh_eth_close,
|
||||||
|
.ndo_start_xmit = sh_eth_start_xmit,
|
||||||
|
.ndo_get_stats = sh_eth_get_stats,
|
||||||
|
.ndo_set_multicast_list = sh_eth_set_multicast_list,
|
||||||
|
.ndo_tx_timeout = sh_eth_tx_timeout,
|
||||||
|
.ndo_do_ioctl = sh_eth_do_ioctl,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
};
|
||||||
|
|
||||||
static int sh_eth_drv_probe(struct platform_device *pdev)
|
static int sh_eth_drv_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
int ret, i, devno = 0;
|
int ret, i, devno = 0;
|
||||||
|
@ -1240,13 +1253,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
|
||||||
mdp->edmac_endian = pd->edmac_endian;
|
mdp->edmac_endian = pd->edmac_endian;
|
||||||
|
|
||||||
/* set function */
|
/* set function */
|
||||||
ndev->open = sh_eth_open;
|
ndev->netdev_ops = &sh_eth_netdev_ops;
|
||||||
ndev->hard_start_xmit = sh_eth_start_xmit;
|
|
||||||
ndev->stop = sh_eth_close;
|
|
||||||
ndev->get_stats = sh_eth_get_stats;
|
|
||||||
ndev->set_multicast_list = sh_eth_set_multicast_list;
|
|
||||||
ndev->do_ioctl = sh_eth_do_ioctl;
|
|
||||||
ndev->tx_timeout = sh_eth_tx_timeout;
|
|
||||||
ndev->watchdog_timeo = TX_TIMEOUT;
|
ndev->watchdog_timeo = TX_TIMEOUT;
|
||||||
|
|
||||||
mdp->post_rx = POST_RX >> (devno << 1);
|
mdp->post_rx = POST_RX >> (devno << 1);
|
||||||
|
|
|
@ -2674,7 +2674,7 @@ static int skge_down(struct net_device *dev)
|
||||||
if (netif_msg_ifdown(skge))
|
if (netif_msg_ifdown(skge))
|
||||||
printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);
|
printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);
|
||||||
|
|
||||||
netif_stop_queue(dev);
|
netif_tx_disable(dev);
|
||||||
|
|
||||||
if (hw->chip_id == CHIP_ID_GENESIS && hw->phy_type == SK_PHY_XMAC)
|
if (hw->chip_id == CHIP_ID_GENESIS && hw->phy_type == SK_PHY_XMAC)
|
||||||
del_timer_sync(&skge->link_timer);
|
del_timer_sync(&skge->link_timer);
|
||||||
|
@ -2881,7 +2881,6 @@ static void skge_tx_clean(struct net_device *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
skge->tx_ring.to_clean = e;
|
skge->tx_ring.to_clean = e;
|
||||||
netif_wake_queue(dev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void skge_tx_timeout(struct net_device *dev)
|
static void skge_tx_timeout(struct net_device *dev)
|
||||||
|
@ -2893,6 +2892,7 @@ static void skge_tx_timeout(struct net_device *dev)
|
||||||
|
|
||||||
skge_write8(skge->hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_STOP);
|
skge_write8(skge->hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_STOP);
|
||||||
skge_tx_clean(dev);
|
skge_tx_clean(dev);
|
||||||
|
netif_wake_queue(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int skge_change_mtu(struct net_device *dev, int new_mtu)
|
static int skge_change_mtu(struct net_device *dev, int new_mtu)
|
||||||
|
|
|
@ -331,6 +331,18 @@ out:
|
||||||
return ERR_PTR(err);
|
return ERR_PTR(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct net_device_ops sun3_82586_netdev_ops = {
|
||||||
|
.ndo_open = sun3_82586_open,
|
||||||
|
.ndo_stop = sun3_82586_close,
|
||||||
|
.ndo_start_xmit = sun3_82586_send_packet,
|
||||||
|
.ndo_set_multicast_list = set_multicast_list,
|
||||||
|
.ndo_tx_timeout = sun3_82586_timeout,
|
||||||
|
.ndo_get_stats = sun3_82586_get_stats,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
};
|
||||||
|
|
||||||
static int __init sun3_82586_probe1(struct net_device *dev,int ioaddr)
|
static int __init sun3_82586_probe1(struct net_device *dev,int ioaddr)
|
||||||
{
|
{
|
||||||
int i, size, retval;
|
int i, size, retval;
|
||||||
|
@ -381,13 +393,8 @@ static int __init sun3_82586_probe1(struct net_device *dev,int ioaddr)
|
||||||
|
|
||||||
printk("Memaddr: 0x%lx, Memsize: %d, IRQ %d\n",dev->mem_start,size, dev->irq);
|
printk("Memaddr: 0x%lx, Memsize: %d, IRQ %d\n",dev->mem_start,size, dev->irq);
|
||||||
|
|
||||||
dev->open = sun3_82586_open;
|
dev->netdev_ops = &sun3_82586_netdev_ops;
|
||||||
dev->stop = sun3_82586_close;
|
|
||||||
dev->get_stats = sun3_82586_get_stats;
|
|
||||||
dev->tx_timeout = sun3_82586_timeout;
|
|
||||||
dev->watchdog_timeo = HZ/20;
|
dev->watchdog_timeo = HZ/20;
|
||||||
dev->hard_start_xmit = sun3_82586_send_packet;
|
|
||||||
dev->set_multicast_list = set_multicast_list;
|
|
||||||
|
|
||||||
dev->if_port = 0;
|
dev->if_port = 0;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -862,6 +862,22 @@ static int __devinit tc35815_init_dev_addr(struct net_device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct net_device_ops tc35815_netdev_ops = {
|
||||||
|
.ndo_open = tc35815_open,
|
||||||
|
.ndo_stop = tc35815_close,
|
||||||
|
.ndo_start_xmit = tc35815_send_packet,
|
||||||
|
.ndo_get_stats = tc35815_get_stats,
|
||||||
|
.ndo_set_multicast_list = tc35815_set_multicast_list,
|
||||||
|
.ndo_tx_timeout = tc35815_tx_timeout,
|
||||||
|
.ndo_do_ioctl = tc35815_ioctl,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||||
|
.ndo_poll_controller = tc35815_poll_controller,
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
static int __devinit tc35815_init_one(struct pci_dev *pdev,
|
static int __devinit tc35815_init_one(struct pci_dev *pdev,
|
||||||
const struct pci_device_id *ent)
|
const struct pci_device_id *ent)
|
||||||
{
|
{
|
||||||
|
@ -904,21 +920,12 @@ static int __devinit tc35815_init_one(struct pci_dev *pdev,
|
||||||
ioaddr = pcim_iomap_table(pdev)[1];
|
ioaddr = pcim_iomap_table(pdev)[1];
|
||||||
|
|
||||||
/* Initialize the device structure. */
|
/* Initialize the device structure. */
|
||||||
dev->open = tc35815_open;
|
dev->netdev_ops = &tc35815_netdev_ops;
|
||||||
dev->hard_start_xmit = tc35815_send_packet;
|
|
||||||
dev->stop = tc35815_close;
|
|
||||||
dev->get_stats = tc35815_get_stats;
|
|
||||||
dev->set_multicast_list = tc35815_set_multicast_list;
|
|
||||||
dev->do_ioctl = tc35815_ioctl;
|
|
||||||
dev->ethtool_ops = &tc35815_ethtool_ops;
|
dev->ethtool_ops = &tc35815_ethtool_ops;
|
||||||
dev->tx_timeout = tc35815_tx_timeout;
|
|
||||||
dev->watchdog_timeo = TC35815_TX_TIMEOUT;
|
dev->watchdog_timeo = TC35815_TX_TIMEOUT;
|
||||||
#ifdef TC35815_NAPI
|
#ifdef TC35815_NAPI
|
||||||
netif_napi_add(dev, &lp->napi, tc35815_poll, NAPI_WEIGHT);
|
netif_napi_add(dev, &lp->napi, tc35815_poll, NAPI_WEIGHT);
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
|
||||||
dev->poll_controller = tc35815_poll_controller;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
dev->irq = pdev->irq;
|
dev->irq = pdev->irq;
|
||||||
dev->base_addr = (unsigned long)ioaddr;
|
dev->base_addr = (unsigned long)ioaddr;
|
||||||
|
|
|
@ -12443,8 +12443,13 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
|
||||||
/* Next, try NVRAM. */
|
/* Next, try NVRAM. */
|
||||||
if (!tg3_nvram_read_be32(tp, mac_offset + 0, &hi) &&
|
if (!tg3_nvram_read_be32(tp, mac_offset + 0, &hi) &&
|
||||||
!tg3_nvram_read_be32(tp, mac_offset + 4, &lo)) {
|
!tg3_nvram_read_be32(tp, mac_offset + 4, &lo)) {
|
||||||
memcpy(&dev->dev_addr[0], ((char *)&hi) + 2, 2);
|
dev->dev_addr[0] = ((hi >> 16) & 0xff);
|
||||||
memcpy(&dev->dev_addr[2], (char *)&lo, sizeof(lo));
|
dev->dev_addr[1] = ((hi >> 24) & 0xff);
|
||||||
|
dev->dev_addr[2] = ((lo >> 0) & 0xff);
|
||||||
|
dev->dev_addr[3] = ((lo >> 8) & 0xff);
|
||||||
|
dev->dev_addr[4] = ((lo >> 16) & 0xff);
|
||||||
|
dev->dev_addr[5] = ((lo >> 24) & 0xff);
|
||||||
|
|
||||||
}
|
}
|
||||||
/* Finally just fetch it out of the MAC control regs. */
|
/* Finally just fetch it out of the MAC control regs. */
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -1561,6 +1561,18 @@ static const struct ethtool_ops tsi108_ethtool_ops = {
|
||||||
.set_settings = tsi108_set_settings,
|
.set_settings = tsi108_set_settings,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct net_device_ops tsi108_netdev_ops = {
|
||||||
|
.ndo_open = tsi108_open,
|
||||||
|
.ndo_stop = tsi108_close,
|
||||||
|
.ndo_start_xmit = tsi108_send_packet,
|
||||||
|
.ndo_set_multicast_list = tsi108_set_rx_mode,
|
||||||
|
.ndo_get_stats = tsi108_get_stats,
|
||||||
|
.ndo_do_ioctl = tsi108_do_ioctl,
|
||||||
|
.ndo_set_mac_address = tsi108_set_mac,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
tsi108_init_one(struct platform_device *pdev)
|
tsi108_init_one(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
@ -1616,14 +1628,8 @@ tsi108_init_one(struct platform_device *pdev)
|
||||||
data->phy_type = einfo->phy_type;
|
data->phy_type = einfo->phy_type;
|
||||||
data->irq_num = einfo->irq_num;
|
data->irq_num = einfo->irq_num;
|
||||||
data->id = pdev->id;
|
data->id = pdev->id;
|
||||||
dev->open = tsi108_open;
|
|
||||||
dev->stop = tsi108_close;
|
|
||||||
dev->hard_start_xmit = tsi108_send_packet;
|
|
||||||
dev->set_mac_address = tsi108_set_mac;
|
|
||||||
dev->set_multicast_list = tsi108_set_rx_mode;
|
|
||||||
dev->get_stats = tsi108_get_stats;
|
|
||||||
netif_napi_add(dev, &data->napi, tsi108_poll, 64);
|
netif_napi_add(dev, &data->napi, tsi108_poll, 64);
|
||||||
dev->do_ioctl = tsi108_do_ioctl;
|
dev->netdev_ops = &tsi108_netdev_ops;
|
||||||
dev->ethtool_ops = &tsi108_ethtool_ops;
|
dev->ethtool_ops = &tsi108_ethtool_ops;
|
||||||
|
|
||||||
/* Apparently, the Linux networking code won't use scatter-gather
|
/* Apparently, the Linux networking code won't use scatter-gather
|
||||||
|
|
|
@ -518,7 +518,7 @@ static inline struct sk_buff *tun_alloc_skb(struct tun_struct *tun,
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
/* Under a page? Don't bother with paged skb. */
|
/* Under a page? Don't bother with paged skb. */
|
||||||
if (prepad + len < PAGE_SIZE)
|
if (prepad + len < PAGE_SIZE || !linear)
|
||||||
linear = len;
|
linear = len;
|
||||||
|
|
||||||
skb = sock_alloc_send_pskb(sk, prepad + linear, len - linear, noblock,
|
skb = sock_alloc_send_pskb(sk, prepad + linear, len - linear, noblock,
|
||||||
|
@ -565,7 +565,8 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun,
|
||||||
|
|
||||||
if ((tun->flags & TUN_TYPE_MASK) == TUN_TAP_DEV) {
|
if ((tun->flags & TUN_TYPE_MASK) == TUN_TAP_DEV) {
|
||||||
align = NET_IP_ALIGN;
|
align = NET_IP_ALIGN;
|
||||||
if (unlikely(len < ETH_HLEN))
|
if (unlikely(len < ETH_HLEN ||
|
||||||
|
(gso.hdr_len && gso.hdr_len < ETH_HLEN)))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -377,7 +377,7 @@ static void velocity_print_info(struct velocity_info *vptr);
|
||||||
static int velocity_open(struct net_device *dev);
|
static int velocity_open(struct net_device *dev);
|
||||||
static int velocity_change_mtu(struct net_device *dev, int mtu);
|
static int velocity_change_mtu(struct net_device *dev, int mtu);
|
||||||
static int velocity_xmit(struct sk_buff *skb, struct net_device *dev);
|
static int velocity_xmit(struct sk_buff *skb, struct net_device *dev);
|
||||||
static int velocity_intr(int irq, void *dev_instance);
|
static irqreturn_t velocity_intr(int irq, void *dev_instance);
|
||||||
static void velocity_set_multi(struct net_device *dev);
|
static void velocity_set_multi(struct net_device *dev);
|
||||||
static struct net_device_stats *velocity_get_stats(struct net_device *dev);
|
static struct net_device_stats *velocity_get_stats(struct net_device *dev);
|
||||||
static int velocity_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
static int velocity_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
||||||
|
@ -2215,7 +2215,7 @@ out:
|
||||||
* efficiently as possible.
|
* efficiently as possible.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int velocity_intr(int irq, void *dev_instance)
|
static irqreturn_t velocity_intr(int irq, void *dev_instance)
|
||||||
{
|
{
|
||||||
struct net_device *dev = dev_instance;
|
struct net_device *dev = dev_instance;
|
||||||
struct velocity_info *vptr = netdev_priv(dev);
|
struct velocity_info *vptr = netdev_priv(dev);
|
||||||
|
|
|
@ -108,6 +108,18 @@ static int xtsonic_close(struct net_device *dev)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct net_device_ops xtsonic_netdev_ops = {
|
||||||
|
.ndo_open = xtsonic_open,
|
||||||
|
.ndo_stop = xtsonic_close,
|
||||||
|
.ndo_start_xmit = sonic_send_packet,
|
||||||
|
.ndo_get_stats = sonic_get_stats,
|
||||||
|
.ndo_set_multicast_list = sonic_multicast_list,
|
||||||
|
.ndo_tx_timeout = sonic_tx_timeout,
|
||||||
|
.ndo_validate_addr = eth_validate_addr,
|
||||||
|
.ndo_change_mtu = eth_change_mtu,
|
||||||
|
.ndo_set_mac_address = eth_mac_addr,
|
||||||
|
};
|
||||||
|
|
||||||
static int __init sonic_probe1(struct net_device *dev)
|
static int __init sonic_probe1(struct net_device *dev)
|
||||||
{
|
{
|
||||||
static unsigned version_printed = 0;
|
static unsigned version_printed = 0;
|
||||||
|
@ -205,12 +217,7 @@ static int __init sonic_probe1(struct net_device *dev)
|
||||||
lp->rra_laddr = lp->rda_laddr + (SIZEOF_SONIC_RD * SONIC_NUM_RDS
|
lp->rra_laddr = lp->rda_laddr + (SIZEOF_SONIC_RD * SONIC_NUM_RDS
|
||||||
* SONIC_BUS_SCALE(lp->dma_bitmode));
|
* SONIC_BUS_SCALE(lp->dma_bitmode));
|
||||||
|
|
||||||
dev->open = xtsonic_open;
|
dev->netdev_ops = &xtsonic_netdev_ops;
|
||||||
dev->stop = xtsonic_close;
|
|
||||||
dev->hard_start_xmit = sonic_send_packet;
|
|
||||||
dev->get_stats = sonic_get_stats;
|
|
||||||
dev->set_multicast_list = &sonic_multicast_list;
|
|
||||||
dev->tx_timeout = sonic_tx_timeout;
|
|
||||||
dev->watchdog_timeo = TX_TIMEOUT;
|
dev->watchdog_timeo = TX_TIMEOUT;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -388,6 +388,12 @@ struct phy_driver {
|
||||||
/* Enables or disables interrupts */
|
/* Enables or disables interrupts */
|
||||||
int (*config_intr)(struct phy_device *phydev);
|
int (*config_intr)(struct phy_device *phydev);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Checks if the PHY generated an interrupt.
|
||||||
|
* For multi-PHY devices with shared PHY interrupt pin
|
||||||
|
*/
|
||||||
|
int (*did_interrupt)(struct phy_device *phydev);
|
||||||
|
|
||||||
/* Clears up any memory if needed */
|
/* Clears up any memory if needed */
|
||||||
void (*remove)(struct phy_device *phydev);
|
void (*remove)(struct phy_device *phydev);
|
||||||
|
|
||||||
|
|
|
@ -124,8 +124,6 @@ static inline void udp_lib_close(struct sock *sk, long timeout)
|
||||||
sk_common_release(sk);
|
sk_common_release(sk);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int ipv4_rcv_saddr_equal(const struct sock *sk1,
|
|
||||||
const struct sock *sk2);
|
|
||||||
extern int udp_lib_get_port(struct sock *sk, unsigned short snum,
|
extern int udp_lib_get_port(struct sock *sk, unsigned short snum,
|
||||||
int (*)(const struct sock*,const struct sock*));
|
int (*)(const struct sock*,const struct sock*));
|
||||||
|
|
||||||
|
|
|
@ -561,6 +561,9 @@ static int rif_seq_show(struct seq_file *seq, void *v)
|
||||||
}
|
}
|
||||||
seq_putc(seq, '\n');
|
seq_putc(seq, '\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dev)
|
||||||
|
dev_put(dev);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,8 +121,10 @@ int vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
|
||||||
if (!skb)
|
if (!skb)
|
||||||
return NET_RX_DROP;
|
return NET_RX_DROP;
|
||||||
|
|
||||||
if (netpoll_rx_on(skb))
|
if (netpoll_rx_on(skb)) {
|
||||||
|
skb->protocol = eth_type_trans(skb, skb->dev);
|
||||||
return vlan_hwaccel_receive_skb(skb, grp, vlan_tci);
|
return vlan_hwaccel_receive_skb(skb, grp, vlan_tci);
|
||||||
|
}
|
||||||
|
|
||||||
return napi_frags_finish(napi, skb,
|
return napi_frags_finish(napi, skb,
|
||||||
vlan_gro_common(napi, grp, vlan_tci, skb));
|
vlan_gro_common(napi, grp, vlan_tci, skb));
|
||||||
|
|
|
@ -1430,7 +1430,7 @@ void netif_device_detach(struct net_device *dev)
|
||||||
{
|
{
|
||||||
if (test_and_clear_bit(__LINK_STATE_PRESENT, &dev->state) &&
|
if (test_and_clear_bit(__LINK_STATE_PRESENT, &dev->state) &&
|
||||||
netif_running(dev)) {
|
netif_running(dev)) {
|
||||||
netif_stop_queue(dev);
|
netif_tx_stop_all_queues(dev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(netif_device_detach);
|
EXPORT_SYMBOL(netif_device_detach);
|
||||||
|
@ -1445,7 +1445,7 @@ void netif_device_attach(struct net_device *dev)
|
||||||
{
|
{
|
||||||
if (!test_and_set_bit(__LINK_STATE_PRESENT, &dev->state) &&
|
if (!test_and_set_bit(__LINK_STATE_PRESENT, &dev->state) &&
|
||||||
netif_running(dev)) {
|
netif_running(dev)) {
|
||||||
netif_wake_queue(dev);
|
netif_tx_wake_all_queues(dev);
|
||||||
__netdev_watchdog_up(dev);
|
__netdev_watchdog_up(dev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2328,8 +2328,10 @@ static int napi_gro_complete(struct sk_buff *skb)
|
||||||
struct list_head *head = &ptype_base[ntohs(type) & PTYPE_HASH_MASK];
|
struct list_head *head = &ptype_base[ntohs(type) & PTYPE_HASH_MASK];
|
||||||
int err = -ENOENT;
|
int err = -ENOENT;
|
||||||
|
|
||||||
if (NAPI_GRO_CB(skb)->count == 1)
|
if (NAPI_GRO_CB(skb)->count == 1) {
|
||||||
|
skb_shinfo(skb)->gso_size = 0;
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
list_for_each_entry_rcu(ptype, head, list) {
|
list_for_each_entry_rcu(ptype, head, list) {
|
||||||
|
@ -2348,7 +2350,6 @@ static int napi_gro_complete(struct sk_buff *skb)
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
skb_shinfo(skb)->gso_size = 0;
|
|
||||||
return netif_receive_skb(skb);
|
return netif_receive_skb(skb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -928,6 +928,8 @@ static void tcp_init_metrics(struct sock *sk)
|
||||||
tcp_set_rto(sk);
|
tcp_set_rto(sk);
|
||||||
if (inet_csk(sk)->icsk_rto < TCP_TIMEOUT_INIT && !tp->rx_opt.saw_tstamp)
|
if (inet_csk(sk)->icsk_rto < TCP_TIMEOUT_INIT && !tp->rx_opt.saw_tstamp)
|
||||||
goto reset;
|
goto reset;
|
||||||
|
|
||||||
|
cwnd:
|
||||||
tp->snd_cwnd = tcp_init_cwnd(tp, dst);
|
tp->snd_cwnd = tcp_init_cwnd(tp, dst);
|
||||||
tp->snd_cwnd_stamp = tcp_time_stamp;
|
tp->snd_cwnd_stamp = tcp_time_stamp;
|
||||||
return;
|
return;
|
||||||
|
@ -942,6 +944,7 @@ reset:
|
||||||
tp->mdev = tp->mdev_max = tp->rttvar = TCP_TIMEOUT_INIT;
|
tp->mdev = tp->mdev_max = tp->rttvar = TCP_TIMEOUT_INIT;
|
||||||
inet_csk(sk)->icsk_rto = TCP_TIMEOUT_INIT;
|
inet_csk(sk)->icsk_rto = TCP_TIMEOUT_INIT;
|
||||||
}
|
}
|
||||||
|
goto cwnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tcp_update_reordering(struct sock *sk, const int metric,
|
static void tcp_update_reordering(struct sock *sk, const int metric,
|
||||||
|
|
|
@ -222,7 +222,7 @@ fail:
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ipv4_rcv_saddr_equal(const struct sock *sk1, const struct sock *sk2)
|
static int ipv4_rcv_saddr_equal(const struct sock *sk1, const struct sock *sk2)
|
||||||
{
|
{
|
||||||
struct inet_sock *inet1 = inet_sk(sk1), *inet2 = inet_sk(sk2);
|
struct inet_sock *inet1 = inet_sk(sk1), *inet2 = inet_sk(sk2);
|
||||||
|
|
||||||
|
@ -1823,7 +1823,6 @@ EXPORT_SYMBOL(udp_lib_getsockopt);
|
||||||
EXPORT_SYMBOL(udp_lib_setsockopt);
|
EXPORT_SYMBOL(udp_lib_setsockopt);
|
||||||
EXPORT_SYMBOL(udp_poll);
|
EXPORT_SYMBOL(udp_poll);
|
||||||
EXPORT_SYMBOL(udp_lib_get_port);
|
EXPORT_SYMBOL(udp_lib_get_port);
|
||||||
EXPORT_SYMBOL(ipv4_rcv_saddr_equal);
|
|
||||||
|
|
||||||
#ifdef CONFIG_PROC_FS
|
#ifdef CONFIG_PROC_FS
|
||||||
EXPORT_SYMBOL(udp_proc_register);
|
EXPORT_SYMBOL(udp_proc_register);
|
||||||
|
|
|
@ -380,10 +380,6 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
|
||||||
default:
|
default:
|
||||||
goto sticky_done;
|
goto sticky_done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((rthdr->hdrlen & 1) ||
|
|
||||||
(rthdr->hdrlen >> 1) != rthdr->segments_left)
|
|
||||||
goto sticky_done;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
retv = 0;
|
retv = 0;
|
||||||
|
|
|
@ -53,6 +53,8 @@ int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2)
|
||||||
{
|
{
|
||||||
const struct in6_addr *sk_rcv_saddr6 = &inet6_sk(sk)->rcv_saddr;
|
const struct in6_addr *sk_rcv_saddr6 = &inet6_sk(sk)->rcv_saddr;
|
||||||
const struct in6_addr *sk2_rcv_saddr6 = inet6_rcv_saddr(sk2);
|
const struct in6_addr *sk2_rcv_saddr6 = inet6_rcv_saddr(sk2);
|
||||||
|
__be32 sk_rcv_saddr = inet_sk(sk)->rcv_saddr;
|
||||||
|
__be32 sk2_rcv_saddr = inet_rcv_saddr(sk2);
|
||||||
int sk_ipv6only = ipv6_only_sock(sk);
|
int sk_ipv6only = ipv6_only_sock(sk);
|
||||||
int sk2_ipv6only = inet_v6_ipv6only(sk2);
|
int sk2_ipv6only = inet_v6_ipv6only(sk2);
|
||||||
int addr_type = ipv6_addr_type(sk_rcv_saddr6);
|
int addr_type = ipv6_addr_type(sk_rcv_saddr6);
|
||||||
|
@ -60,7 +62,9 @@ int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2)
|
||||||
|
|
||||||
/* if both are mapped, treat as IPv4 */
|
/* if both are mapped, treat as IPv4 */
|
||||||
if (addr_type == IPV6_ADDR_MAPPED && addr_type2 == IPV6_ADDR_MAPPED)
|
if (addr_type == IPV6_ADDR_MAPPED && addr_type2 == IPV6_ADDR_MAPPED)
|
||||||
return ipv4_rcv_saddr_equal(sk, sk2);
|
return (!sk2_ipv6only &&
|
||||||
|
(!sk_rcv_saddr || !sk2_rcv_saddr ||
|
||||||
|
sk_rcv_saddr == sk2_rcv_saddr));
|
||||||
|
|
||||||
if (addr_type2 == IPV6_ADDR_ANY &&
|
if (addr_type2 == IPV6_ADDR_ANY &&
|
||||||
!(sk2_ipv6only && addr_type == IPV6_ADDR_MAPPED))
|
!(sk2_ipv6only && addr_type == IPV6_ADDR_MAPPED))
|
||||||
|
|
|
@ -1758,8 +1758,9 @@ static void free_pg_vec(char **pg_vec, unsigned int order, unsigned int len)
|
||||||
|
|
||||||
static inline char *alloc_one_pg_vec_page(unsigned long order)
|
static inline char *alloc_one_pg_vec_page(unsigned long order)
|
||||||
{
|
{
|
||||||
return (char *) __get_free_pages(GFP_KERNEL | __GFP_COMP | __GFP_ZERO,
|
gfp_t gfp_flags = GFP_KERNEL | __GFP_COMP | __GFP_ZERO | __GFP_NOWARN;
|
||||||
order);
|
|
||||||
|
return (char *) __get_free_pages(gfp_flags, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char **alloc_pg_vec(struct tpacket_req *req, int order)
|
static char **alloc_pg_vec(struct tpacket_req *req, int order)
|
||||||
|
|
|
@ -1072,10 +1072,6 @@ static int rose_sendmsg(struct kiocb *iocb, struct socket *sock,
|
||||||
unsigned char *asmptr;
|
unsigned char *asmptr;
|
||||||
int n, size, qbit = 0;
|
int n, size, qbit = 0;
|
||||||
|
|
||||||
/* ROSE empty frame has no meaning : don't send */
|
|
||||||
if (len == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT))
|
if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
@ -1273,12 +1269,6 @@ static int rose_recvmsg(struct kiocb *iocb, struct socket *sock,
|
||||||
skb_reset_transport_header(skb);
|
skb_reset_transport_header(skb);
|
||||||
copied = skb->len;
|
copied = skb->len;
|
||||||
|
|
||||||
/* ROSE empty frame has no meaning : ignore it */
|
|
||||||
if (copied == 0) {
|
|
||||||
skb_free_datagram(sk, skb);
|
|
||||||
return copied;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (copied > size) {
|
if (copied > size) {
|
||||||
copied = size;
|
copied = size;
|
||||||
msg->msg_flags |= MSG_TRUNC;
|
msg->msg_flags |= MSG_TRUNC;
|
||||||
|
|
|
@ -176,8 +176,10 @@ META_COLLECTOR(var_dev)
|
||||||
|
|
||||||
META_COLLECTOR(int_vlan_tag)
|
META_COLLECTOR(int_vlan_tag)
|
||||||
{
|
{
|
||||||
unsigned short uninitialized_var(tag);
|
unsigned short tag;
|
||||||
if (vlan_get_tag(skb, &tag) < 0)
|
|
||||||
|
tag = vlan_tx_tag_get(skb);
|
||||||
|
if (!tag && __vlan_get_tag(skb, &tag))
|
||||||
*err = -1;
|
*err = -1;
|
||||||
else
|
else
|
||||||
dst->value = tag;
|
dst->value = tag;
|
||||||
|
|
Loading…
Reference in New Issue