Add skb_frag_page from 3.2 to OCF for 3.1 and earlier and use it.
SVN-Revision: 29818
define KernelPackage/crypto-ocf
TITLE:=OCF modules
- DEPENDS:=+@OPENSSL_ENGINE @!TARGET_uml +kmod-crypto-manager @!LINUX_3_2||BROKEN
+ DEPENDS:=+@OPENSSL_ENGINE @!TARGET_uml +kmod-crypto-manager
KCONFIG:= \
CONFIG_OCF_OCF \
CONFIG_OCF_CRYPTODEV \
i < skb_shinfo(skb)->nr_frags &&
sg_num < SCATTERLIST_MAX; i++) {
if (skip < skb_shinfo(skb)->frags[i].size) {
- //sg[sg_num].page = skb_shinfo(skb)->frags[i].page;
+ //sg[sg_num].page = skb_frag_page(&kb_shinfo(skb)->frags[i]);
//sg[sg_num].offset = skb_shinfo(skb)->frags[i].page_offset + skip;
len = skb_shinfo(skb)->frags[i].size - skip;
if (len + sg_len > crd->crd_len)
len = crd->crd_len - sg_len;
//sg[sg_num].length = len;
- sg_set_page(&sg[sg_num], skb_shinfo(skb)->frags[i].page, len, skb_shinfo(skb)->frags[i].page_offset + skip);
+ sg_set_page(&sg[sg_num], skb_frag_page(&skb_shinfo(skb)->frags[i]), len, skb_shinfo(skb)->frags[i].page_offset + skip);
sg_len += sg[sg_num].length;
sg_num++;
skip = 0;
offset -= skb_headlen(skb);
for (i = 0; len > 0 && i < skb_shinfo(skb)->nr_frags; i++) {
if (offset < skb_shinfo(skb)->frags[i].size) {
- memcpy(page_address(skb_shinfo(skb)->frags[i].page) +
+ memcpy(page_address(skb_frag_page(&skb_shinfo(skb)->frags[i])) +
skb_shinfo(skb)->frags[i].page_offset,
cp, min_t(int, skb_shinfo(skb)->frags[i].size, len));
len -= skb_shinfo(skb)->frags[i].size;
for (i = 0; i < skb_shinfo(skb)->nr_frags && sg_num < SCATTERLIST_MAX;
i++) {
len = skb_shinfo(skb)->frags[i].size;
- sg_set_page(&sg[sg_num], skb_shinfo(skb)->frags[i].page,
+ sg_set_page(&sg[sg_num], skb_frag_page(&skb_shinfo(skb)->frags[i]),
len, skb_shinfo(skb)->frags[i].page_offset);
sg_len += len;
sg_num++;
if (len + sg_len > crd->crd_len)
len = crd->crd_len - sg_len;
sg_set_page(&req->sg[sg_num],
- skb_shinfo(skb)->frags[i].page,
+ skb_frag_page(&skb_shinfo(skb)->frags[i]),
len,
skb_shinfo(skb)->frags[i].page_offset + skip);
sg_len += len;
for (i = 0; i < skb_shinfo(skb)->nr_frags; ) {
buf->segs[buf->nsegs].ds_len = skb_shinfo(skb)->frags[i].size;
buf->segs[buf->nsegs].ds_addr = pci_map_single(sc->sc_pcidev,
- page_address(skb_shinfo(skb)->frags[i].page) +
+ page_address(skb_frag_page(&skb_shinfo(skb)->frags[i])) +
skb_shinfo(skb)->frags[i].page_offset,
buf->segs[buf->nsegs].ds_len, PCI_DMA_BIDIRECTIONAL);
buf->mapsize += buf->segs[buf->nsegs].ds_len;
#include <linux/kthread.h>
#endif
+#include <linux/skbuff.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
+static inline struct page *skb_frag_page(const skb_frag_t *frag)
+{
+ return frag->page;
+}
+#endif
+
#endif /* __KERNEL__ */
/****************************************************************************/
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
pci_map_linear(sc, buf,
- page_address(skb_shinfo(skb)->frags[i].page) +
+ page_address(skb_frag_page(&skb_shinfo(skb)->frags[i])) +
skb_shinfo(skb)->frags[i].page_offset,
skb_shinfo(skb)->frags[i].size);
}
#ifdef UBSEC_VERBOSE_DEBUG
DPRINTF("%s - map %d 0x%x %d\n", __FUNCTION__, i + 1,
- (unsigned int)page_address(skb_shinfo(skb)->frags[i].page) +
+ (unsigned int)page_address(skb_frag_page(&skb_shinfo(skb)->frags[i])) +
skb_shinfo(skb)->frags[i].page_offset, skb_shinfo(skb)->frags[i].size);
#endif
tmp = dma_map_single(sc->sc_dv,
- page_address(skb_shinfo(skb)->frags[i].page) +
+ page_address(skb_frag_page(&skb_shinfo(skb)->frags[i])) +
skb_shinfo(skb)->frags[i].page_offset,
skb_shinfo(skb)->frags[i].size,
DMA_BIDIRECTIONAL);
q_map[i + 1].dma_paddr = tmp;
- q_map[i + 1].dma_vaddr = (void*)(page_address(skb_shinfo(skb)->frags[i].page) +
+ q_map[i + 1].dma_vaddr = (void*)(page_address(skb_frag_page(&skb_shinfo(skb)->frags[i])) +
skb_shinfo(skb)->frags[i].page_offset);
q_map[i + 1].dma_size = skb_shinfo(skb)->frags[i].size;