summaryrefslogtreecommitdiff
path: root/target/linux/generic/files
diff options
context:
space:
mode:
authorJonas Gorski <jogo@openwrt.org>2012-01-19 19:51:54 +0000
committerJonas Gorski <jogo@openwrt.org>2012-01-19 19:51:54 +0000
commitaa8f9171f2e779040d655db2cf96234b6e98610c (patch)
tree595553c3edea82a60c729b32416c7ec619258afd /target/linux/generic/files
parent9fd38863652081fd4a31178fdb68e5e2a118eba8 (diff)
downloadmtk-20170518-aa8f9171f2e779040d655db2cf96234b6e98610c.zip
mtk-20170518-aa8f9171f2e779040d655db2cf96234b6e98610c.tar.gz
mtk-20170518-aa8f9171f2e779040d655db2cf96234b6e98610c.tar.bz2
kernel: fix OCF for linux 3.2
Add skb_frag_page from 3.2 to OCF for 3.1 and earlier and use it. SVN-Revision: 29818
Diffstat (limited to 'target/linux/generic/files')
-rw-r--r--target/linux/generic/files/crypto/ocf/c7108/aes-7108.c4
-rw-r--r--target/linux/generic/files/crypto/ocf/criov.c2
-rw-r--r--target/linux/generic/files/crypto/ocf/cryptocteon/cryptocteon.c2
-rw-r--r--target/linux/generic/files/crypto/ocf/cryptosoft.c2
-rw-r--r--target/linux/generic/files/crypto/ocf/hifn/hifn7751.c2
-rw-r--r--target/linux/generic/files/crypto/ocf/ocf-compat.h9
-rw-r--r--target/linux/generic/files/crypto/ocf/safe/safe.c2
-rw-r--r--target/linux/generic/files/crypto/ocf/ubsec_ssb/ubsec_ssb.c6
8 files changed, 19 insertions, 10 deletions
diff --git a/target/linux/generic/files/crypto/ocf/c7108/aes-7108.c b/target/linux/generic/files/crypto/ocf/c7108/aes-7108.c
index a5ac054..d03540b 100644
--- a/target/linux/generic/files/crypto/ocf/c7108/aes-7108.c
+++ b/target/linux/generic/files/crypto/ocf/c7108/aes-7108.c
@@ -592,13 +592,13 @@ c7108_process(void *arg, struct cryptop *crp, int hint)
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;
diff --git a/target/linux/generic/files/crypto/ocf/criov.c b/target/linux/generic/files/crypto/ocf/criov.c
index d3d8cfd..cdc731e 100644
--- a/target/linux/generic/files/crypto/ocf/criov.c
+++ b/target/linux/generic/files/crypto/ocf/criov.c
@@ -156,7 +156,7 @@ skb_copy_bits_back(struct sk_buff *skb, int offset, caddr_t cp, int len)
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;
diff --git a/target/linux/generic/files/crypto/ocf/cryptocteon/cryptocteon.c b/target/linux/generic/files/crypto/ocf/cryptocteon/cryptocteon.c
index 741e4fa..b0c10a2 100644
--- a/target/linux/generic/files/crypto/ocf/cryptocteon/cryptocteon.c
+++ b/target/linux/generic/files/crypto/ocf/cryptocteon/cryptocteon.c
@@ -473,7 +473,7 @@ octo_process(device_t dev, struct cryptop *crp, int hint)
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++;
diff --git a/target/linux/generic/files/crypto/ocf/cryptosoft.c b/target/linux/generic/files/crypto/ocf/cryptosoft.c
index 79aac92..f9ecdf9 100644
--- a/target/linux/generic/files/crypto/ocf/cryptosoft.c
+++ b/target/linux/generic/files/crypto/ocf/cryptosoft.c
@@ -777,7 +777,7 @@ static void swcr_process_req(struct swcr_req *req)
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;
diff --git a/target/linux/generic/files/crypto/ocf/hifn/hifn7751.c b/target/linux/generic/files/crypto/ocf/hifn/hifn7751.c
index 4803a83..b7df819 100644
--- a/target/linux/generic/files/crypto/ocf/hifn/hifn7751.c
+++ b/target/linux/generic/files/crypto/ocf/hifn/hifn7751.c
@@ -241,7 +241,7 @@ pci_map_skb(struct hifn_softc *sc,struct hifn_operand *buf,struct sk_buff *skb)
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;
diff --git a/target/linux/generic/files/crypto/ocf/ocf-compat.h b/target/linux/generic/files/crypto/ocf/ocf-compat.h
index 2d98536..b76c369 100644
--- a/target/linux/generic/files/crypto/ocf/ocf-compat.h
+++ b/target/linux/generic/files/crypto/ocf/ocf-compat.h
@@ -359,6 +359,15 @@ static inline int ocf_run_thread(void *arg)
#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__ */
/****************************************************************************/
diff --git a/target/linux/generic/files/crypto/ocf/safe/safe.c b/target/linux/generic/files/crypto/ocf/safe/safe.c
index 189b95f..7d9b541 100644
--- a/target/linux/generic/files/crypto/ocf/safe/safe.c
+++ b/target/linux/generic/files/crypto/ocf/safe/safe.c
@@ -208,7 +208,7 @@ pci_map_skb(struct safe_softc *sc,struct safe_operand *buf,struct sk_buff *skb)
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);
}
diff --git a/target/linux/generic/files/crypto/ocf/ubsec_ssb/ubsec_ssb.c b/target/linux/generic/files/crypto/ocf/ubsec_ssb/ubsec_ssb.c
index aa0733f..f5d7762 100644
--- a/target/linux/generic/files/crypto/ocf/ubsec_ssb/ubsec_ssb.c
+++ b/target/linux/generic/files/crypto/ocf/ubsec_ssb/ubsec_ssb.c
@@ -297,18 +297,18 @@ dma_map_skb(struct ubsec_softc *sc, struct ubsec_dma_alloc* q_map, struct sk_buf
#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;