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 | |
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')
-rw-r--r-- | drivers/atm/ambassador.c | 2 | ||||
-rw-r--r-- | drivers/atm/idt77252.c | 24 | ||||
-rw-r--r-- | drivers/infiniband/hw/cxgb3/iwch_cm.c | 2 | ||||
-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 | ||||
-rw-r--r-- | drivers/usb/atm/usbatm.c | 4 |
9 files changed, 44 insertions, 27 deletions
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c index 3c372e08f77d..59651abfa4f8 100644 --- a/drivers/atm/ambassador.c +++ b/drivers/atm/ambassador.c | |||
@@ -821,7 +821,7 @@ static inline void fill_rx_pool (amb_dev * dev, unsigned char pool, | |||
821 | } | 821 | } |
822 | // cast needed as there is no %? for pointer differences | 822 | // cast needed as there is no %? for pointer differences |
823 | PRINTD (DBG_SKB, "allocated skb at %p, head %p, area %li", | 823 | PRINTD (DBG_SKB, "allocated skb at %p, head %p, area %li", |
824 | skb, skb->head, (long) (skb->end - skb->head)); | 824 | skb, skb->head, (long) (skb_end_pointer(skb) - skb->head)); |
825 | rx.handle = virt_to_bus (skb); | 825 | rx.handle = virt_to_bus (skb); |
826 | rx.host_address = cpu_to_be32 (virt_to_bus (skb->data)); | 826 | rx.host_address = cpu_to_be32 (virt_to_bus (skb->data)); |
827 | if (rx_give (dev, &rx, pool)) | 827 | if (rx_give (dev, &rx, pool)) |
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c index 1e49799cd6cf..20f2a3a82656 100644 --- a/drivers/atm/idt77252.c +++ b/drivers/atm/idt77252.c | |||
@@ -1065,7 +1065,8 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe) | |||
1065 | vcc = vc->rx_vcc; | 1065 | vcc = vc->rx_vcc; |
1066 | 1066 | ||
1067 | pci_dma_sync_single_for_cpu(card->pcidev, IDT77252_PRV_PADDR(skb), | 1067 | pci_dma_sync_single_for_cpu(card->pcidev, IDT77252_PRV_PADDR(skb), |
1068 | skb->end - skb->data, PCI_DMA_FROMDEVICE); | 1068 | skb_end_pointer(skb) - skb->data, |
1069 | PCI_DMA_FROMDEVICE); | ||
1069 | 1070 | ||
1070 | if ((vcc->qos.aal == ATM_AAL0) || | 1071 | if ((vcc->qos.aal == ATM_AAL0) || |
1071 | (vcc->qos.aal == ATM_AAL34)) { | 1072 | (vcc->qos.aal == ATM_AAL34)) { |
@@ -1194,7 +1195,8 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe) | |||
1194 | } | 1195 | } |
1195 | 1196 | ||
1196 | pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb), | 1197 | pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb), |
1197 | skb->end - skb->data, PCI_DMA_FROMDEVICE); | 1198 | skb_end_pointer(skb) - skb->data, |
1199 | PCI_DMA_FROMDEVICE); | ||
1198 | sb_pool_remove(card, skb); | 1200 | sb_pool_remove(card, skb); |
1199 | 1201 | ||
1200 | skb_trim(skb, len); | 1202 | skb_trim(skb, len); |
@@ -1267,7 +1269,7 @@ idt77252_rx_raw(struct idt77252_dev *card) | |||
1267 | tail = readl(SAR_REG_RAWCT); | 1269 | tail = readl(SAR_REG_RAWCT); |
1268 | 1270 | ||
1269 | pci_dma_sync_single_for_cpu(card->pcidev, IDT77252_PRV_PADDR(queue), | 1271 | pci_dma_sync_single_for_cpu(card->pcidev, IDT77252_PRV_PADDR(queue), |
1270 | queue->end - queue->head - 16, | 1272 | skb_end_pointer(queue) - queue->head - 16, |
1271 | PCI_DMA_FROMDEVICE); | 1273 | PCI_DMA_FROMDEVICE); |
1272 | 1274 | ||
1273 | while (head != tail) { | 1275 | while (head != tail) { |
@@ -1363,7 +1365,8 @@ drop: | |||
1363 | queue = card->raw_cell_head; | 1365 | queue = card->raw_cell_head; |
1364 | pci_dma_sync_single_for_cpu(card->pcidev, | 1366 | pci_dma_sync_single_for_cpu(card->pcidev, |
1365 | IDT77252_PRV_PADDR(queue), | 1367 | IDT77252_PRV_PADDR(queue), |
1366 | queue->end - queue->data, | 1368 | (skb_end_pointer(queue) - |
1369 | queue->data), | ||
1367 | PCI_DMA_FROMDEVICE); | 1370 | PCI_DMA_FROMDEVICE); |
1368 | } else { | 1371 | } else { |
1369 | card->raw_cell_head = NULL; | 1372 | card->raw_cell_head = NULL; |
@@ -1875,7 +1878,7 @@ add_rx_skb(struct idt77252_dev *card, int queue, | |||
1875 | } | 1878 | } |
1876 | 1879 | ||
1877 | paddr = pci_map_single(card->pcidev, skb->data, | 1880 | paddr = pci_map_single(card->pcidev, skb->data, |
1878 | skb->end - skb->data, | 1881 | skb_end_pointer(skb) - skb->data, |
1879 | PCI_DMA_FROMDEVICE); | 1882 | PCI_DMA_FROMDEVICE); |
1880 | IDT77252_PRV_PADDR(skb) = paddr; | 1883 | IDT77252_PRV_PADDR(skb) = paddr; |
1881 | 1884 | ||
@@ -1889,7 +1892,7 @@ add_rx_skb(struct idt77252_dev *card, int queue, | |||
1889 | 1892 | ||
1890 | outunmap: | 1893 | outunmap: |
1891 | pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb), | 1894 | pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb), |
1892 | skb->end - skb->data, PCI_DMA_FROMDEVICE); | 1895 | skb_end_pointer(skb) - skb->data, PCI_DMA_FROMDEVICE); |
1893 | 1896 | ||
1894 | handle = IDT77252_PRV_POOL(skb); | 1897 | handle = IDT77252_PRV_POOL(skb); |
1895 | card->sbpool[POOL_QUEUE(handle)].skb[POOL_INDEX(handle)] = NULL; | 1898 | card->sbpool[POOL_QUEUE(handle)].skb[POOL_INDEX(handle)] = NULL; |
@@ -1906,12 +1909,14 @@ recycle_rx_skb(struct idt77252_dev *card, struct sk_buff *skb) | |||
1906 | int err; | 1909 | int err; |
1907 | 1910 | ||
1908 | pci_dma_sync_single_for_device(card->pcidev, IDT77252_PRV_PADDR(skb), | 1911 | pci_dma_sync_single_for_device(card->pcidev, IDT77252_PRV_PADDR(skb), |
1909 | skb->end - skb->data, PCI_DMA_FROMDEVICE); | 1912 | skb_end_pointer(skb) - skb->data, |
1913 | PCI_DMA_FROMDEVICE); | ||
1910 | 1914 | ||
1911 | err = push_rx_skb(card, skb, POOL_QUEUE(handle)); | 1915 | err = push_rx_skb(card, skb, POOL_QUEUE(handle)); |
1912 | if (err) { | 1916 | if (err) { |
1913 | pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb), | 1917 | pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb), |
1914 | skb->end - skb->data, PCI_DMA_FROMDEVICE); | 1918 | skb_end_pointer(skb) - skb->data, |
1919 | PCI_DMA_FROMDEVICE); | ||
1915 | sb_pool_remove(card, skb); | 1920 | sb_pool_remove(card, skb); |
1916 | dev_kfree_skb(skb); | 1921 | dev_kfree_skb(skb); |
1917 | } | 1922 | } |
@@ -3123,7 +3128,8 @@ deinit_card(struct idt77252_dev *card) | |||
3123 | if (skb) { | 3128 | if (skb) { |
3124 | pci_unmap_single(card->pcidev, | 3129 | pci_unmap_single(card->pcidev, |
3125 | IDT77252_PRV_PADDR(skb), | 3130 | IDT77252_PRV_PADDR(skb), |
3126 | skb->end - skb->data, | 3131 | (skb_end_pointer(skb) - |
3132 | skb->data), | ||
3127 | PCI_DMA_FROMDEVICE); | 3133 | PCI_DMA_FROMDEVICE); |
3128 | card->sbpool[i].skb[j] = NULL; | 3134 | card->sbpool[i].skb[j] = NULL; |
3129 | dev_kfree_skb(skb); | 3135 | dev_kfree_skb(skb); |
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c index 66ad4d40ba1d..e842c65a3f4d 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_cm.c +++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c | |||
@@ -477,7 +477,7 @@ static void send_mpa_req(struct iwch_ep *ep, struct sk_buff *skb) | |||
477 | BUG_ON(skb_cloned(skb)); | 477 | BUG_ON(skb_cloned(skb)); |
478 | 478 | ||
479 | mpalen = sizeof(*mpa) + ep->plen; | 479 | mpalen = sizeof(*mpa) + ep->plen; |
480 | if (skb->data + mpalen + sizeof(*req) > skb->end) { | 480 | if (skb->data + mpalen + sizeof(*req) > skb_end_pointer(skb)) { |
481 | kfree_skb(skb); | 481 | kfree_skb(skb); |
482 | skb=alloc_skb(mpalen + sizeof(*req), GFP_KERNEL); | 482 | skb=alloc_skb(mpalen + sizeof(*req), GFP_KERNEL); |
483 | if (!skb) { | 483 | if (!skb) { |
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); |
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c index 4d8f282b23d1..a076f735a7bc 100644 --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c | |||
@@ -335,12 +335,12 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char | |||
335 | 335 | ||
336 | sarb = instance->cached_vcc->sarb; | 336 | sarb = instance->cached_vcc->sarb; |
337 | 337 | ||
338 | if (skb_tail_pointer(sarb) + ATM_CELL_PAYLOAD > sarb->end) { | 338 | if (sarb->tail + ATM_CELL_PAYLOAD > sarb->end) { |
339 | atm_rldbg(instance, "%s: buffer overrun (sarb->len %u, vcc: 0x%p)!\n", | 339 | atm_rldbg(instance, "%s: buffer overrun (sarb->len %u, vcc: 0x%p)!\n", |
340 | __func__, sarb->len, vcc); | 340 | __func__, sarb->len, vcc); |
341 | /* discard cells already received */ | 341 | /* discard cells already received */ |
342 | skb_trim(sarb, 0); | 342 | skb_trim(sarb, 0); |
343 | UDSL_ASSERT(skb_tail_pointer(sarb) + ATM_CELL_PAYLOAD <= sarb->end); | 343 | UDSL_ASSERT(sarb->tail + ATM_CELL_PAYLOAD <= sarb->end); |
344 | } | 344 | } |
345 | 345 | ||
346 | memcpy(skb_tail_pointer(sarb), source + ATM_CELL_HEADER, ATM_CELL_PAYLOAD); | 346 | memcpy(skb_tail_pointer(sarb), source + ATM_CELL_HEADER, ATM_CELL_PAYLOAD); |