diff options
author | Paul Mackerras <paulus@samba.org> | 2008-01-23 18:07:21 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-01-23 18:07:21 -0500 |
commit | 9156ad48338e0306e508ead5c0d9986050744475 (patch) | |
tree | 37f3a90e38190052ecf3cdf9171dfdddd37b56fd /drivers/net/sky2.c | |
parent | fa28237cfcc5827553044cbd6ee52e33692b0faa (diff) | |
parent | 8f7b3d156d348b6766833cd4e272d0d19b501e64 (diff) |
Merge branch 'linux-2.6'
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r-- | drivers/net/sky2.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index a74fc11a6482..bc15940ce1bc 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -944,7 +944,6 @@ static void tx_init(struct sky2_port *sky2) | |||
944 | le = get_tx_le(sky2); | 944 | le = get_tx_le(sky2); |
945 | le->addr = 0; | 945 | le->addr = 0; |
946 | le->opcode = OP_ADDR64 | HW_OWNER; | 946 | le->opcode = OP_ADDR64 | HW_OWNER; |
947 | sky2->tx_addr64 = 0; | ||
948 | } | 947 | } |
949 | 948 | ||
950 | static inline struct tx_ring_info *tx_le_re(struct sky2_port *sky2, | 949 | static inline struct tx_ring_info *tx_le_re(struct sky2_port *sky2, |
@@ -978,13 +977,11 @@ static void sky2_rx_add(struct sky2_port *sky2, u8 op, | |||
978 | dma_addr_t map, unsigned len) | 977 | dma_addr_t map, unsigned len) |
979 | { | 978 | { |
980 | struct sky2_rx_le *le; | 979 | struct sky2_rx_le *le; |
981 | u32 hi = upper_32_bits(map); | ||
982 | 980 | ||
983 | if (sky2->rx_addr64 != hi) { | 981 | if (sizeof(dma_addr_t) > sizeof(u32)) { |
984 | le = sky2_next_rx(sky2); | 982 | le = sky2_next_rx(sky2); |
985 | le->addr = cpu_to_le32(hi); | 983 | le->addr = cpu_to_le32(upper_32_bits(map)); |
986 | le->opcode = OP_ADDR64 | HW_OWNER; | 984 | le->opcode = OP_ADDR64 | HW_OWNER; |
987 | sky2->rx_addr64 = upper_32_bits(map + len); | ||
988 | } | 985 | } |
989 | 986 | ||
990 | le = sky2_next_rx(sky2); | 987 | le = sky2_next_rx(sky2); |
@@ -1168,6 +1165,7 @@ static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp | |||
1168 | TX_VLAN_TAG_OFF); | 1165 | TX_VLAN_TAG_OFF); |
1169 | } | 1166 | } |
1170 | 1167 | ||
1168 | sky2_read32(hw, B0_Y2_SP_LISR); | ||
1171 | napi_enable(&hw->napi); | 1169 | napi_enable(&hw->napi); |
1172 | netif_tx_unlock_bh(dev); | 1170 | netif_tx_unlock_bh(dev); |
1173 | } | 1171 | } |
@@ -1479,7 +1477,6 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev) | |||
1479 | struct tx_ring_info *re; | 1477 | struct tx_ring_info *re; |
1480 | unsigned i, len; | 1478 | unsigned i, len; |
1481 | dma_addr_t mapping; | 1479 | dma_addr_t mapping; |
1482 | u32 addr64; | ||
1483 | u16 mss; | 1480 | u16 mss; |
1484 | u8 ctrl; | 1481 | u8 ctrl; |
1485 | 1482 | ||
@@ -1492,15 +1489,12 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev) | |||
1492 | 1489 | ||
1493 | len = skb_headlen(skb); | 1490 | len = skb_headlen(skb); |
1494 | mapping = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE); | 1491 | mapping = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE); |
1495 | addr64 = upper_32_bits(mapping); | ||
1496 | 1492 | ||
1497 | /* Send high bits if changed or crosses boundary */ | 1493 | /* Send high bits if needed */ |
1498 | if (addr64 != sky2->tx_addr64 || | 1494 | if (sizeof(dma_addr_t) > sizeof(u32)) { |
1499 | upper_32_bits(mapping + len) != sky2->tx_addr64) { | ||
1500 | le = get_tx_le(sky2); | 1495 | le = get_tx_le(sky2); |
1501 | le->addr = cpu_to_le32(addr64); | 1496 | le->addr = cpu_to_le32(upper_32_bits(mapping)); |
1502 | le->opcode = OP_ADDR64 | HW_OWNER; | 1497 | le->opcode = OP_ADDR64 | HW_OWNER; |
1503 | sky2->tx_addr64 = upper_32_bits(mapping + len); | ||
1504 | } | 1498 | } |
1505 | 1499 | ||
1506 | /* Check for TCP Segmentation Offload */ | 1500 | /* Check for TCP Segmentation Offload */ |
@@ -1581,13 +1575,12 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev) | |||
1581 | 1575 | ||
1582 | mapping = pci_map_page(hw->pdev, frag->page, frag->page_offset, | 1576 | mapping = pci_map_page(hw->pdev, frag->page, frag->page_offset, |
1583 | frag->size, PCI_DMA_TODEVICE); | 1577 | frag->size, PCI_DMA_TODEVICE); |
1584 | addr64 = upper_32_bits(mapping); | 1578 | |
1585 | if (addr64 != sky2->tx_addr64) { | 1579 | if (sizeof(dma_addr_t) > sizeof(u32)) { |
1586 | le = get_tx_le(sky2); | 1580 | le = get_tx_le(sky2); |
1587 | le->addr = cpu_to_le32(addr64); | 1581 | le->addr = cpu_to_le32(upper_32_bits(mapping)); |
1588 | le->ctrl = 0; | 1582 | le->ctrl = 0; |
1589 | le->opcode = OP_ADDR64 | HW_OWNER; | 1583 | le->opcode = OP_ADDR64 | HW_OWNER; |
1590 | sky2->tx_addr64 = addr64; | ||
1591 | } | 1584 | } |
1592 | 1585 | ||
1593 | le = get_tx_le(sky2); | 1586 | le = get_tx_le(sky2); |
@@ -2043,6 +2036,7 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu) | |||
2043 | err = sky2_rx_start(sky2); | 2036 | err = sky2_rx_start(sky2); |
2044 | sky2_write32(hw, B0_IMSK, imask); | 2037 | sky2_write32(hw, B0_IMSK, imask); |
2045 | 2038 | ||
2039 | sky2_read32(hw, B0_Y2_SP_LISR); | ||
2046 | napi_enable(&hw->napi); | 2040 | napi_enable(&hw->napi); |
2047 | 2041 | ||
2048 | if (err) | 2042 | if (err) |
@@ -3861,6 +3855,7 @@ static int sky2_debug_show(struct seq_file *seq, void *v) | |||
3861 | last = sky2_read16(hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_PUT_IDX)), | 3855 | last = sky2_read16(hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_PUT_IDX)), |
3862 | sky2_read16(hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_LAST_IDX))); | 3856 | sky2_read16(hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_LAST_IDX))); |
3863 | 3857 | ||
3858 | sky2_read32(hw, B0_Y2_SP_LISR); | ||
3864 | napi_enable(&hw->napi); | 3859 | napi_enable(&hw->napi); |
3865 | return 0; | 3860 | return 0; |
3866 | } | 3861 | } |