diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/net/atl1e/atl1e_main.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'drivers/net/atl1e/atl1e_main.c')
-rw-r--r-- | drivers/net/atl1e/atl1e_main.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/drivers/net/atl1e/atl1e_main.c b/drivers/net/atl1e/atl1e_main.c index 1acea5774e89..86a912283134 100644 --- a/drivers/net/atl1e/atl1e_main.c +++ b/drivers/net/atl1e/atl1e_main.c | |||
@@ -547,8 +547,8 @@ static int __devinit atl1e_sw_init(struct atl1e_adapter *adapter) | |||
547 | hw->device_id = pdev->device; | 547 | hw->device_id = pdev->device; |
548 | hw->subsystem_vendor_id = pdev->subsystem_vendor; | 548 | hw->subsystem_vendor_id = pdev->subsystem_vendor; |
549 | hw->subsystem_id = pdev->subsystem_device; | 549 | hw->subsystem_id = pdev->subsystem_device; |
550 | hw->revision_id = pdev->revision; | ||
550 | 551 | ||
551 | pci_read_config_byte(pdev, PCI_REVISION_ID, &hw->revision_id); | ||
552 | pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word); | 552 | pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word); |
553 | 553 | ||
554 | phy_status_data = AT_READ_REG(hw, REG_PHY_STATUS); | 554 | phy_status_data = AT_READ_REG(hw, REG_PHY_STATUS); |
@@ -691,10 +691,8 @@ static void atl1e_cal_ring_size(struct atl1e_adapter *adapter, u32 *ring_size) | |||
691 | 691 | ||
692 | static void atl1e_init_ring_resources(struct atl1e_adapter *adapter) | 692 | static void atl1e_init_ring_resources(struct atl1e_adapter *adapter) |
693 | { | 693 | { |
694 | struct atl1e_tx_ring *tx_ring = NULL; | ||
695 | struct atl1e_rx_ring *rx_ring = NULL; | 694 | struct atl1e_rx_ring *rx_ring = NULL; |
696 | 695 | ||
697 | tx_ring = &adapter->tx_ring; | ||
698 | rx_ring = &adapter->rx_ring; | 696 | rx_ring = &adapter->rx_ring; |
699 | 697 | ||
700 | rx_ring->real_page_size = adapter->rx_ring.page_size | 698 | rx_ring->real_page_size = adapter->rx_ring.page_size |
@@ -932,11 +930,11 @@ static inline void atl1e_configure_tx(struct atl1e_adapter *adapter) | |||
932 | max_pay_load = ((dev_ctrl_data >> DEVICE_CTRL_MAX_PAYLOAD_SHIFT)) & | 930 | max_pay_load = ((dev_ctrl_data >> DEVICE_CTRL_MAX_PAYLOAD_SHIFT)) & |
933 | DEVICE_CTRL_MAX_PAYLOAD_MASK; | 931 | DEVICE_CTRL_MAX_PAYLOAD_MASK; |
934 | 932 | ||
935 | hw->dmaw_block = min(max_pay_load, hw->dmaw_block); | 933 | hw->dmaw_block = min_t(u32, max_pay_load, hw->dmaw_block); |
936 | 934 | ||
937 | max_pay_load = ((dev_ctrl_data >> DEVICE_CTRL_MAX_RREQ_SZ_SHIFT)) & | 935 | max_pay_load = ((dev_ctrl_data >> DEVICE_CTRL_MAX_RREQ_SZ_SHIFT)) & |
938 | DEVICE_CTRL_MAX_RREQ_SZ_MASK; | 936 | DEVICE_CTRL_MAX_RREQ_SZ_MASK; |
939 | hw->dmar_block = min(max_pay_load, hw->dmar_block); | 937 | hw->dmar_block = min_t(u32, max_pay_load, hw->dmar_block); |
940 | 938 | ||
941 | if (hw->nic_type != athr_l2e_revB) | 939 | if (hw->nic_type != athr_l2e_revB) |
942 | AT_WRITE_REGW(hw, REG_TXQ_CTRL + 2, | 940 | AT_WRITE_REGW(hw, REG_TXQ_CTRL + 2, |
@@ -1331,7 +1329,7 @@ static inline void atl1e_rx_checksum(struct atl1e_adapter *adapter, | |||
1331 | u16 pkt_flags; | 1329 | u16 pkt_flags; |
1332 | u16 err_flags; | 1330 | u16 err_flags; |
1333 | 1331 | ||
1334 | skb->ip_summed = CHECKSUM_NONE; | 1332 | skb_checksum_none_assert(skb); |
1335 | pkt_flags = prrs->pkt_flag; | 1333 | pkt_flags = prrs->pkt_flag; |
1336 | err_flags = prrs->err_flag; | 1334 | err_flags = prrs->err_flag; |
1337 | if (((pkt_flags & RRS_IS_IPV4) || (pkt_flags & RRS_IS_IPV6)) && | 1335 | if (((pkt_flags & RRS_IS_IPV4) || (pkt_flags & RRS_IS_IPV6)) && |
@@ -1649,7 +1647,7 @@ check_sum: | |||
1649 | if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { | 1647 | if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { |
1650 | u8 css, cso; | 1648 | u8 css, cso; |
1651 | 1649 | ||
1652 | cso = skb_transport_offset(skb); | 1650 | cso = skb_checksum_start_offset(skb); |
1653 | if (unlikely(cso & 0x1)) { | 1651 | if (unlikely(cso & 0x1)) { |
1654 | netdev_err(adapter->netdev, | 1652 | netdev_err(adapter->netdev, |
1655 | "payload offset should not ant event number\n"); | 1653 | "payload offset should not ant event number\n"); |
@@ -1814,7 +1812,7 @@ static netdev_tx_t atl1e_xmit_frame(struct sk_buff *skb, | |||
1814 | 1812 | ||
1815 | tpd = atl1e_get_tpd(adapter); | 1813 | tpd = atl1e_get_tpd(adapter); |
1816 | 1814 | ||
1817 | if (unlikely(adapter->vlgrp && vlan_tx_tag_present(skb))) { | 1815 | if (unlikely(vlan_tx_tag_present(skb))) { |
1818 | u16 vlan_tag = vlan_tx_tag_get(skb); | 1816 | u16 vlan_tag = vlan_tx_tag_get(skb); |
1819 | u16 atl1e_vlan_tag; | 1817 | u16 atl1e_vlan_tag; |
1820 | 1818 | ||
@@ -1927,11 +1925,7 @@ void atl1e_down(struct atl1e_adapter *adapter) | |||
1927 | * reschedule our watchdog timer */ | 1925 | * reschedule our watchdog timer */ |
1928 | set_bit(__AT_DOWN, &adapter->flags); | 1926 | set_bit(__AT_DOWN, &adapter->flags); |
1929 | 1927 | ||
1930 | #ifdef NETIF_F_LLTX | ||
1931 | netif_stop_queue(netdev); | 1928 | netif_stop_queue(netdev); |
1932 | #else | ||
1933 | netif_tx_disable(netdev); | ||
1934 | #endif | ||
1935 | 1929 | ||
1936 | /* reset MAC to disable all RX/TX */ | 1930 | /* reset MAC to disable all RX/TX */ |
1937 | atl1e_reset_hw(&adapter->hw); | 1931 | atl1e_reset_hw(&adapter->hw); |
@@ -2051,9 +2045,9 @@ static int atl1e_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2051 | atl1e_read_phy_reg(hw, MII_BMSR, (u16 *)&mii_bmsr_data); | 2045 | atl1e_read_phy_reg(hw, MII_BMSR, (u16 *)&mii_bmsr_data); |
2052 | atl1e_read_phy_reg(hw, MII_BMSR, (u16 *)&mii_bmsr_data); | 2046 | atl1e_read_phy_reg(hw, MII_BMSR, (u16 *)&mii_bmsr_data); |
2053 | 2047 | ||
2054 | mii_advertise_data = MII_AR_10T_HD_CAPS; | 2048 | mii_advertise_data = ADVERTISE_10HALF; |
2055 | 2049 | ||
2056 | if ((atl1e_write_phy_reg(hw, MII_AT001_CR, 0) != 0) || | 2050 | if ((atl1e_write_phy_reg(hw, MII_CTRL1000, 0) != 0) || |
2057 | (atl1e_write_phy_reg(hw, | 2051 | (atl1e_write_phy_reg(hw, |
2058 | MII_ADVERTISE, mii_advertise_data) != 0) || | 2052 | MII_ADVERTISE, mii_advertise_data) != 0) || |
2059 | (atl1e_phy_commit(hw)) != 0) { | 2053 | (atl1e_phy_commit(hw)) != 0) { |
@@ -2223,10 +2217,10 @@ static int atl1e_init_netdev(struct net_device *netdev, struct pci_dev *pdev) | |||
2223 | netdev->watchdog_timeo = AT_TX_WATCHDOG; | 2217 | netdev->watchdog_timeo = AT_TX_WATCHDOG; |
2224 | atl1e_set_ethtool_ops(netdev); | 2218 | atl1e_set_ethtool_ops(netdev); |
2225 | 2219 | ||
2226 | netdev->features = NETIF_F_SG | NETIF_F_HW_CSUM | | 2220 | netdev->hw_features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_TSO | |
2227 | NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; | 2221 | NETIF_F_HW_VLAN_TX; |
2228 | netdev->features |= NETIF_F_LLTX; | 2222 | netdev->features = netdev->hw_features | |
2229 | netdev->features |= NETIF_F_TSO; | 2223 | NETIF_F_HW_VLAN_RX | NETIF_F_LLTX; |
2230 | 2224 | ||
2231 | return 0; | 2225 | return 0; |
2232 | } | 2226 | } |
@@ -2316,7 +2310,7 @@ static int __devinit atl1e_probe(struct pci_dev *pdev, | |||
2316 | netif_napi_add(netdev, &adapter->napi, atl1e_clean, 64); | 2310 | netif_napi_add(netdev, &adapter->napi, atl1e_clean, 64); |
2317 | 2311 | ||
2318 | init_timer(&adapter->phy_config_timer); | 2312 | init_timer(&adapter->phy_config_timer); |
2319 | adapter->phy_config_timer.function = &atl1e_phy_config; | 2313 | adapter->phy_config_timer.function = atl1e_phy_config; |
2320 | adapter->phy_config_timer.data = (unsigned long) adapter; | 2314 | adapter->phy_config_timer.data = (unsigned long) adapter; |
2321 | 2315 | ||
2322 | /* get user settings */ | 2316 | /* get user settings */ |
@@ -2509,7 +2503,7 @@ static struct pci_driver atl1e_driver = { | |||
2509 | .id_table = atl1e_pci_tbl, | 2503 | .id_table = atl1e_pci_tbl, |
2510 | .probe = atl1e_probe, | 2504 | .probe = atl1e_probe, |
2511 | .remove = __devexit_p(atl1e_remove), | 2505 | .remove = __devexit_p(atl1e_remove), |
2512 | /* Power Managment Hooks */ | 2506 | /* Power Management Hooks */ |
2513 | #ifdef CONFIG_PM | 2507 | #ifdef CONFIG_PM |
2514 | .suspend = atl1e_suspend, | 2508 | .suspend = atl1e_suspend, |
2515 | .resume = atl1e_resume, | 2509 | .resume = atl1e_resume, |