Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75435
b: refs/heads/master
c: 86c6887
h: refs/heads/master
i:
  75433: 6f9f42c
  75431: 5f14652
v: v3
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Jan 12, 2008
1 parent 6d51162 commit d8fcf95
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dfd9a421bed2325059fae04f810769b648fa1302
refs/heads/master: 86c6887e6fea0b395dc939174ac80ad0ae88288c
24 changes: 8 additions & 16 deletions trunk/drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,6 @@ static void tx_init(struct sky2_port *sky2)
le = get_tx_le(sky2);
le->addr = 0;
le->opcode = OP_ADDR64 | HW_OWNER;
sky2->tx_addr64 = 0;
}

static inline struct tx_ring_info *tx_le_re(struct sky2_port *sky2,
Expand Down Expand Up @@ -978,13 +977,11 @@ static void sky2_rx_add(struct sky2_port *sky2, u8 op,
dma_addr_t map, unsigned len)
{
struct sky2_rx_le *le;
u32 hi = upper_32_bits(map);

if (sky2->rx_addr64 != hi) {
if (sizeof(dma_addr_t) > sizeof(u32)) {
le = sky2_next_rx(sky2);
le->addr = cpu_to_le32(hi);
le->addr = cpu_to_le32(upper_32_bits(map));
le->opcode = OP_ADDR64 | HW_OWNER;
sky2->rx_addr64 = upper_32_bits(map + len);
}

le = sky2_next_rx(sky2);
Expand Down Expand Up @@ -1480,7 +1477,6 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
struct tx_ring_info *re;
unsigned i, len;
dma_addr_t mapping;
u32 addr64;
u16 mss;
u8 ctrl;

Expand All @@ -1493,15 +1489,12 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)

len = skb_headlen(skb);
mapping = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE);
addr64 = upper_32_bits(mapping);

/* Send high bits if changed or crosses boundary */
if (addr64 != sky2->tx_addr64 ||
upper_32_bits(mapping + len) != sky2->tx_addr64) {
/* Send high bits if needed */
if (sizeof(dma_addr_t) > sizeof(u32)) {
le = get_tx_le(sky2);
le->addr = cpu_to_le32(addr64);
le->addr = cpu_to_le32(upper_32_bits(mapping));
le->opcode = OP_ADDR64 | HW_OWNER;
sky2->tx_addr64 = upper_32_bits(mapping + len);
}

/* Check for TCP Segmentation Offload */
Expand Down Expand Up @@ -1582,13 +1575,12 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)

mapping = pci_map_page(hw->pdev, frag->page, frag->page_offset,
frag->size, PCI_DMA_TODEVICE);
addr64 = upper_32_bits(mapping);
if (addr64 != sky2->tx_addr64) {

if (sizeof(dma_addr_t) > sizeof(u32)) {
le = get_tx_le(sky2);
le->addr = cpu_to_le32(addr64);
le->addr = cpu_to_le32(upper_32_bits(mapping));
le->ctrl = 0;
le->opcode = OP_ADDR64 | HW_OWNER;
sky2->tx_addr64 = addr64;
}

le = get_tx_le(sky2);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/sky2.h
Original file line number Diff line number Diff line change
Expand Up @@ -1991,14 +1991,14 @@ struct sky2_port {
u16 tx_cons; /* next le to check */
u16 tx_prod; /* next le to use */
u16 tx_next; /* debug only */
u32 tx_addr64;

u16 tx_pending;
u16 tx_last_mss;
u32 tx_tcpsum;

struct rx_ring_info *rx_ring ____cacheline_aligned_in_smp;
struct sky2_rx_le *rx_le;
u32 rx_addr64;

u16 rx_next; /* next re to check */
u16 rx_put; /* next le index to use */
u16 rx_pending;
Expand Down

0 comments on commit d8fcf95

Please sign in to comment.