diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-04-19 23:43:29 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:26:29 -0400 |
commit | 4305b541357ddbd205aa145dc378926b7cb12283 (patch) | |
tree | 9b1f57ee4ee757a9324c48a7dea84bc8c279ad82 /drivers/net | |
parent | 27a884dc3cb63b93c2b3b643f5b31eed5f8a4d26 (diff) |
[SK_BUFF]: Convert skb->end to sk_buff_data_t
Now to convert the last one, skb->data, that will allow many simplifications
and removal of some of the offset helpers.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/cris/eth_v10.c | 3 | ||||
-rw-r--r-- | drivers/net/forcedeth.c | 30 | ||||
-rw-r--r-- | drivers/net/macb.c | 2 | ||||
-rw-r--r-- | drivers/net/wan/lmc/lmc_main.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_80211_rx.c | 2 |
5 files changed, 25 insertions, 14 deletions
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c index 7feb9c561147..5bdf5ca85a65 100644 --- a/drivers/net/cris/eth_v10.c +++ b/drivers/net/cris/eth_v10.c | |||
@@ -1348,7 +1348,8 @@ e100_rx(struct net_device *dev) | |||
1348 | 1348 | ||
1349 | #ifdef ETHDEBUG | 1349 | #ifdef ETHDEBUG |
1350 | printk("head = 0x%x, data = 0x%x, tail = 0x%x, end = 0x%x\n", | 1350 | printk("head = 0x%x, data = 0x%x, tail = 0x%x, end = 0x%x\n", |
1351 | skb->head, skb->data, skb_tail_pointer(skb), skb->end); | 1351 | skb->head, skb->data, skb_tail_pointer(skb), |
1352 | skb_end_pointer(skb)); | ||
1352 | printk("copying packet to 0x%x.\n", skb_data_ptr); | 1353 | printk("copying packet to 0x%x.\n", skb_data_ptr); |
1353 | #endif | 1354 | #endif |
1354 | 1355 | ||
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index d5d458c3421f..d3f4bcaa9692 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -1386,9 +1386,13 @@ static int nv_alloc_rx(struct net_device *dev) | |||
1386 | struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz + NV_RX_ALLOC_PAD); | 1386 | struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz + NV_RX_ALLOC_PAD); |
1387 | if (skb) { | 1387 | if (skb) { |
1388 | np->put_rx_ctx->skb = skb; | 1388 | np->put_rx_ctx->skb = skb; |
1389 | np->put_rx_ctx->dma = pci_map_single(np->pci_dev, skb->data, | 1389 | np->put_rx_ctx->dma = pci_map_single(np->pci_dev, |
1390 | skb->end-skb->data, PCI_DMA_FROMDEVICE); | 1390 | skb->data, |
1391 | np->put_rx_ctx->dma_len = skb->end-skb->data; | 1391 | (skb_end_pointer(skb) - |
1392 | skb->data), | ||
1393 | PCI_DMA_FROMDEVICE); | ||
1394 | np->put_rx_ctx->dma_len = (skb_end_pointer(skb) - | ||
1395 | skb->data); | ||
1392 | np->put_rx.orig->buf = cpu_to_le32(np->put_rx_ctx->dma); | 1396 | np->put_rx.orig->buf = cpu_to_le32(np->put_rx_ctx->dma); |
1393 | wmb(); | 1397 | wmb(); |
1394 | np->put_rx.orig->flaglen = cpu_to_le32(np->rx_buf_sz | NV_RX_AVAIL); | 1398 | np->put_rx.orig->flaglen = cpu_to_le32(np->rx_buf_sz | NV_RX_AVAIL); |
@@ -1416,9 +1420,13 @@ static int nv_alloc_rx_optimized(struct net_device *dev) | |||
1416 | struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz + NV_RX_ALLOC_PAD); | 1420 | struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz + NV_RX_ALLOC_PAD); |
1417 | if (skb) { | 1421 | if (skb) { |
1418 | np->put_rx_ctx->skb = skb; | 1422 | np->put_rx_ctx->skb = skb; |
1419 | np->put_rx_ctx->dma = pci_map_single(np->pci_dev, skb->data, | 1423 | np->put_rx_ctx->dma = pci_map_single(np->pci_dev, |
1420 | skb->end-skb->data, PCI_DMA_FROMDEVICE); | 1424 | skb->data, |
1421 | np->put_rx_ctx->dma_len = skb->end-skb->data; | 1425 | (skb_end_pointer(skb) - |
1426 | skb->data), | ||
1427 | PCI_DMA_FROMDEVICE); | ||
1428 | np->put_rx_ctx->dma_len = (skb_end_pointer(skb) - | ||
1429 | skb->data); | ||
1422 | np->put_rx.ex->bufhigh = cpu_to_le64(np->put_rx_ctx->dma) >> 32; | 1430 | np->put_rx.ex->bufhigh = cpu_to_le64(np->put_rx_ctx->dma) >> 32; |
1423 | np->put_rx.ex->buflow = cpu_to_le64(np->put_rx_ctx->dma) & 0x0FFFFFFFF; | 1431 | np->put_rx.ex->buflow = cpu_to_le64(np->put_rx_ctx->dma) & 0x0FFFFFFFF; |
1424 | wmb(); | 1432 | wmb(); |
@@ -1602,8 +1610,9 @@ static void nv_drain_rx(struct net_device *dev) | |||
1602 | wmb(); | 1610 | wmb(); |
1603 | if (np->rx_skb[i].skb) { | 1611 | if (np->rx_skb[i].skb) { |
1604 | pci_unmap_single(np->pci_dev, np->rx_skb[i].dma, | 1612 | pci_unmap_single(np->pci_dev, np->rx_skb[i].dma, |
1605 | np->rx_skb[i].skb->end-np->rx_skb[i].skb->data, | 1613 | (skb_end_pointer(np->rx_skb[i].skb) - |
1606 | PCI_DMA_FROMDEVICE); | 1614 | np->rx_skb[i].skb->data), |
1615 | PCI_DMA_FROMDEVICE); | ||
1607 | dev_kfree_skb(np->rx_skb[i].skb); | 1616 | dev_kfree_skb(np->rx_skb[i].skb); |
1608 | np->rx_skb[i].skb = NULL; | 1617 | np->rx_skb[i].skb = NULL; |
1609 | } | 1618 | } |
@@ -4378,7 +4387,8 @@ static int nv_loopback_test(struct net_device *dev) | |||
4378 | for (i = 0; i < pkt_len; i++) | 4387 | for (i = 0; i < pkt_len; i++) |
4379 | pkt_data[i] = (u8)(i & 0xff); | 4388 | pkt_data[i] = (u8)(i & 0xff); |
4380 | test_dma_addr = pci_map_single(np->pci_dev, tx_skb->data, | 4389 | test_dma_addr = pci_map_single(np->pci_dev, tx_skb->data, |
4381 | tx_skb->end-tx_skb->data, PCI_DMA_FROMDEVICE); | 4390 | (skb_end_pointer(tx_skb) - |
4391 | tx_skb->data), PCI_DMA_FROMDEVICE); | ||
4382 | 4392 | ||
4383 | if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) { | 4393 | if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) { |
4384 | np->tx_ring.orig[0].buf = cpu_to_le32(test_dma_addr); | 4394 | np->tx_ring.orig[0].buf = cpu_to_le32(test_dma_addr); |
@@ -4435,7 +4445,7 @@ static int nv_loopback_test(struct net_device *dev) | |||
4435 | } | 4445 | } |
4436 | 4446 | ||
4437 | pci_unmap_page(np->pci_dev, test_dma_addr, | 4447 | pci_unmap_page(np->pci_dev, test_dma_addr, |
4438 | tx_skb->end-tx_skb->data, | 4448 | (skb_end_pointer(tx_skb) - tx_skb->data), |
4439 | PCI_DMA_TODEVICE); | 4449 | PCI_DMA_TODEVICE); |
4440 | dev_kfree_skb_any(tx_skb); | 4450 | dev_kfree_skb_any(tx_skb); |
4441 | out: | 4451 | out: |
diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 98bf51afcee7..9e233f8216a7 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c | |||
@@ -576,7 +576,7 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
576 | dev_dbg(&bp->pdev->dev, | 576 | dev_dbg(&bp->pdev->dev, |
577 | "start_xmit: len %u head %p data %p tail %p end %p\n", | 577 | "start_xmit: len %u head %p data %p tail %p end %p\n", |
578 | skb->len, skb->head, skb->data, | 578 | skb->len, skb->head, skb->data, |
579 | skb_tail_pointer(skb), skb->end); | 579 | skb_tail_pointer(skb), skb_end_pointer(skb)); |
580 | dev_dbg(&bp->pdev->dev, | 580 | dev_dbg(&bp->pdev->dev, |
581 | "data:"); | 581 | "data:"); |
582 | for (i = 0; i < 16; i++) | 582 | for (i = 0; i < 16; i++) |
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c index b731f3aae0df..5bb18c0955bc 100644 --- a/drivers/net/wan/lmc/lmc_main.c +++ b/drivers/net/wan/lmc/lmc_main.c | |||
@@ -1932,7 +1932,7 @@ static void lmc_softreset (lmc_softc_t * const sc) /*fold00*/ | |||
1932 | sc->lmc_rxring[i].status = 0x80000000; | 1932 | sc->lmc_rxring[i].status = 0x80000000; |
1933 | 1933 | ||
1934 | /* used to be PKT_BUF_SZ now uses skb since we lose some to head room */ | 1934 | /* used to be PKT_BUF_SZ now uses skb since we lose some to head room */ |
1935 | sc->lmc_rxring[i].length = skb->end - skb->data; | 1935 | sc->lmc_rxring[i].length = skb_end_pointer(skb) - skb->data; |
1936 | 1936 | ||
1937 | /* use to be tail which is dumb since you're thinking why write | 1937 | /* use to be tail which is dumb since you're thinking why write |
1938 | * to the end of the packj,et but since there's nothing there tail == data | 1938 | * to the end of the packj,et but since there's nothing there tail == data |
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c index 5e3e9e262706..35a3a50724fe 100644 --- a/drivers/net/wireless/hostap/hostap_80211_rx.c +++ b/drivers/net/wireless/hostap/hostap_80211_rx.c | |||
@@ -922,7 +922,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, | |||
922 | if (frag != 0) | 922 | if (frag != 0) |
923 | flen -= hdrlen; | 923 | flen -= hdrlen; |
924 | 924 | ||
925 | if (skb_tail_pointer(frag_skb) + flen > frag_skb->end) { | 925 | if (frag_skb->tail + flen > frag_skb->end) { |
926 | printk(KERN_WARNING "%s: host decrypted and " | 926 | printk(KERN_WARNING "%s: host decrypted and " |
927 | "reassembled frame did not fit skb\n", | 927 | "reassembled frame did not fit skb\n", |
928 | dev->name); | 928 | dev->name); |