diff options
author | Paul Mackerras <paulus@samba.org> | 2008-04-16 17:45:35 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-04-16 17:45:35 -0400 |
commit | c7cd5b98072f7e04a50415b9501793bd905ecc16 (patch) | |
tree | 1c0bdbf863dcc4262abebf8dc3a4d7f5218c22b2 /drivers/net | |
parent | e92716f2aa68cdfbf6ec24d6f31f08b072e1a246 (diff) | |
parent | 7132799b0e49c48cf119dbe02d20810860d20991 (diff) |
Merge branch 'for-2.6.26' of master.kernel.org:/pub/scm/linux/kernel/git/olof/pasemi
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/pasemi_mac.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index c50f0f4de6d8..965f2e4b3452 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c | |||
@@ -404,6 +404,7 @@ static void pasemi_mac_free_csring(struct pasemi_mac_csring *csring) | |||
404 | pasemi_dma_free_flag(csring->events[1]); | 404 | pasemi_dma_free_flag(csring->events[1]); |
405 | pasemi_dma_free_ring(&csring->chan); | 405 | pasemi_dma_free_ring(&csring->chan); |
406 | pasemi_dma_free_chan(&csring->chan); | 406 | pasemi_dma_free_chan(&csring->chan); |
407 | pasemi_dma_free_fun(csring->fun); | ||
407 | } | 408 | } |
408 | 409 | ||
409 | static int pasemi_mac_setup_rx_resources(const struct net_device *dev) | 410 | static int pasemi_mac_setup_rx_resources(const struct net_device *dev) |
@@ -1150,7 +1151,10 @@ static int pasemi_mac_open(struct net_device *dev) | |||
1150 | if (!mac->tx) | 1151 | if (!mac->tx) |
1151 | goto out_tx_ring; | 1152 | goto out_tx_ring; |
1152 | 1153 | ||
1153 | if (dev->mtu > 1500) { | 1154 | /* We might already have allocated rings in case mtu was changed |
1155 | * before interface was brought up. | ||
1156 | */ | ||
1157 | if (dev->mtu > 1500 && !mac->num_cs) { | ||
1154 | pasemi_mac_setup_csrings(mac); | 1158 | pasemi_mac_setup_csrings(mac); |
1155 | if (!mac->num_cs) | 1159 | if (!mac->num_cs) |
1156 | goto out_tx_ring; | 1160 | goto out_tx_ring; |
@@ -1388,8 +1392,12 @@ static int pasemi_mac_close(struct net_device *dev) | |||
1388 | free_irq(mac->tx->chan.irq, mac->tx); | 1392 | free_irq(mac->tx->chan.irq, mac->tx); |
1389 | free_irq(mac->rx->chan.irq, mac->rx); | 1393 | free_irq(mac->rx->chan.irq, mac->rx); |
1390 | 1394 | ||
1391 | for (i = 0; i < mac->num_cs; i++) | 1395 | for (i = 0; i < mac->num_cs; i++) { |
1392 | pasemi_mac_free_csring(mac->cs[i]); | 1396 | pasemi_mac_free_csring(mac->cs[i]); |
1397 | mac->cs[i] = NULL; | ||
1398 | } | ||
1399 | |||
1400 | mac->num_cs = 0; | ||
1393 | 1401 | ||
1394 | /* Free resources */ | 1402 | /* Free resources */ |
1395 | pasemi_mac_free_rx_resources(mac); | 1403 | pasemi_mac_free_rx_resources(mac); |
@@ -1640,6 +1648,26 @@ static int pasemi_mac_poll(struct napi_struct *napi, int budget) | |||
1640 | return pkts; | 1648 | return pkts; |
1641 | } | 1649 | } |
1642 | 1650 | ||
1651 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
1652 | /* | ||
1653 | * Polling 'interrupt' - used by things like netconsole to send skbs | ||
1654 | * without having to re-enable interrupts. It's not called while | ||
1655 | * the interrupt routine is executing. | ||
1656 | */ | ||
1657 | static void pasemi_mac_netpoll(struct net_device *dev) | ||
1658 | { | ||
1659 | const struct pasemi_mac *mac = netdev_priv(dev); | ||
1660 | |||
1661 | disable_irq(mac->tx->chan.irq); | ||
1662 | pasemi_mac_tx_intr(mac->tx->chan.irq, mac->tx); | ||
1663 | enable_irq(mac->tx->chan.irq); | ||
1664 | |||
1665 | disable_irq(mac->rx->chan.irq); | ||
1666 | pasemi_mac_rx_intr(mac->rx->chan.irq, mac->rx); | ||
1667 | enable_irq(mac->rx->chan.irq); | ||
1668 | } | ||
1669 | #endif | ||
1670 | |||
1643 | static int pasemi_mac_change_mtu(struct net_device *dev, int new_mtu) | 1671 | static int pasemi_mac_change_mtu(struct net_device *dev, int new_mtu) |
1644 | { | 1672 | { |
1645 | struct pasemi_mac *mac = netdev_priv(dev); | 1673 | struct pasemi_mac *mac = netdev_priv(dev); |
@@ -1799,6 +1827,9 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1799 | dev->mtu = PE_DEF_MTU; | 1827 | dev->mtu = PE_DEF_MTU; |
1800 | /* 1500 MTU + ETH_HLEN + VLAN_HLEN + 2 64B cachelines */ | 1828 | /* 1500 MTU + ETH_HLEN + VLAN_HLEN + 2 64B cachelines */ |
1801 | mac->bufsz = dev->mtu + ETH_HLEN + ETH_FCS_LEN + LOCAL_SKB_ALIGN + 128; | 1829 | mac->bufsz = dev->mtu + ETH_HLEN + ETH_FCS_LEN + LOCAL_SKB_ALIGN + 128; |
1830 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
1831 | dev->poll_controller = pasemi_mac_netpoll; | ||
1832 | #endif | ||
1802 | 1833 | ||
1803 | dev->change_mtu = pasemi_mac_change_mtu; | 1834 | dev->change_mtu = pasemi_mac_change_mtu; |
1804 | dev->ethtool_ops = &pasemi_mac_ethtool_ops; | 1835 | dev->ethtool_ops = &pasemi_mac_ethtool_ops; |