Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
fa05f128
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
fa05f128
编写于
10月 22, 2007
作者:
J
Jens Axboe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update net/ to use sg helpers
Signed-off-by:
N
Jens Axboe
<
jens.axboe@oracle.com
>
上级
60c74f81
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
25 addition
and
33 deletion
+25
-33
net/core/skbuff.c
net/core/skbuff.c
+2
-2
net/ieee80211/ieee80211_crypt_tkip.c
net/ieee80211/ieee80211_crypt_tkip.c
+5
-8
net/ieee80211/ieee80211_crypt_wep.c
net/ieee80211/ieee80211_crypt_wep.c
+2
-6
net/mac80211/wep.c
net/mac80211/wep.c
+2
-6
net/sctp/auth.c
net/sctp/auth.c
+2
-1
net/sctp/sm_make_chunk.c
net/sctp/sm_make_chunk.c
+4
-2
net/sunrpc/auth_gss/gss_krb5_crypto.c
net/sunrpc/auth_gss/gss_krb5_crypto.c
+5
-5
net/sunrpc/xdr.c
net/sunrpc/xdr.c
+1
-1
net/xfrm/xfrm_algo.c
net/xfrm/xfrm_algo.c
+2
-2
未找到文件。
net/core/skbuff.c
浏览文件 @
fa05f128
...
...
@@ -2045,7 +2045,7 @@ skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len)
if
(
copy
>
0
)
{
if
(
copy
>
len
)
copy
=
len
;
sg
[
elt
].
page
=
virt_to_page
(
skb
->
data
+
offset
);
sg
_set_page
(
&
sg
[
elt
],
virt_to_page
(
skb
->
data
+
offset
)
);
sg
[
elt
].
offset
=
(
unsigned
long
)(
skb
->
data
+
offset
)
%
PAGE_SIZE
;
sg
[
elt
].
length
=
copy
;
elt
++
;
...
...
@@ -2065,7 +2065,7 @@ skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len)
if
(
copy
>
len
)
copy
=
len
;
sg
[
elt
].
page
=
frag
->
page
;
sg
_set_page
(
&
sg
[
elt
],
frag
->
page
)
;
sg
[
elt
].
offset
=
frag
->
page_offset
+
offset
-
start
;
sg
[
elt
].
length
=
copy
;
elt
++
;
...
...
net/ieee80211/ieee80211_crypt_tkip.c
浏览文件 @
fa05f128
...
...
@@ -390,9 +390,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
icv
[
3
]
=
crc
>>
24
;
crypto_blkcipher_setkey
(
tkey
->
tx_tfm_arc4
,
rc4key
,
16
);
sg
.
page
=
virt_to_page
(
pos
);
sg
.
offset
=
offset_in_page
(
pos
);
sg
.
length
=
len
+
4
;
sg_init_one
(
&
sg
,
pos
,
len
+
4
);
return
crypto_blkcipher_encrypt
(
&
desc
,
&
sg
,
&
sg
,
len
+
4
);
}
...
...
@@ -485,9 +483,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
plen
=
skb
->
len
-
hdr_len
-
12
;
crypto_blkcipher_setkey
(
tkey
->
rx_tfm_arc4
,
rc4key
,
16
);
sg
.
page
=
virt_to_page
(
pos
);
sg
.
offset
=
offset_in_page
(
pos
);
sg
.
length
=
plen
+
4
;
sg_init_one
(
&
sg
,
pos
,
plen
+
4
);
if
(
crypto_blkcipher_decrypt
(
&
desc
,
&
sg
,
&
sg
,
plen
+
4
))
{
if
(
net_ratelimit
())
{
printk
(
KERN_DEBUG
": TKIP: failed to decrypt "
...
...
@@ -539,11 +535,12 @@ static int michael_mic(struct crypto_hash *tfm_michael, u8 * key, u8 * hdr,
printk
(
KERN_WARNING
"michael_mic: tfm_michael == NULL
\n
"
);
return
-
1
;
}
sg
[
0
].
page
=
virt_to_page
(
hdr
);
sg_init_table
(
sg
,
2
);
sg_set_page
(
&
sg
[
0
],
virt_to_page
(
hdr
));
sg
[
0
].
offset
=
offset_in_page
(
hdr
);
sg
[
0
].
length
=
16
;
sg
[
1
].
page
=
virt_to_page
(
data
);
sg
_set_page
(
&
sg
[
1
],
virt_to_page
(
data
)
);
sg
[
1
].
offset
=
offset_in_page
(
data
);
sg
[
1
].
length
=
data_len
;
...
...
net/ieee80211/ieee80211_crypt_wep.c
浏览文件 @
fa05f128
...
...
@@ -170,9 +170,7 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
icv
[
3
]
=
crc
>>
24
;
crypto_blkcipher_setkey
(
wep
->
tx_tfm
,
key
,
klen
);
sg
.
page
=
virt_to_page
(
pos
);
sg
.
offset
=
offset_in_page
(
pos
);
sg
.
length
=
len
+
4
;
sg_init_one
(
&
sg
,
pos
,
len
+
4
);
return
crypto_blkcipher_encrypt
(
&
desc
,
&
sg
,
&
sg
,
len
+
4
);
}
...
...
@@ -212,9 +210,7 @@ static int prism2_wep_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
plen
=
skb
->
len
-
hdr_len
-
8
;
crypto_blkcipher_setkey
(
wep
->
rx_tfm
,
key
,
klen
);
sg
.
page
=
virt_to_page
(
pos
);
sg
.
offset
=
offset_in_page
(
pos
);
sg
.
length
=
plen
+
4
;
sg_init_one
(
&
sg
,
pos
,
plen
+
4
);
if
(
crypto_blkcipher_decrypt
(
&
desc
,
&
sg
,
&
sg
,
plen
+
4
))
return
-
7
;
...
...
net/mac80211/wep.c
浏览文件 @
fa05f128
...
...
@@ -138,9 +138,7 @@ void ieee80211_wep_encrypt_data(struct crypto_blkcipher *tfm, u8 *rc4key,
*
icv
=
cpu_to_le32
(
~
crc32_le
(
~
0
,
data
,
data_len
));
crypto_blkcipher_setkey
(
tfm
,
rc4key
,
klen
);
sg
.
page
=
virt_to_page
(
data
);
sg
.
offset
=
offset_in_page
(
data
);
sg
.
length
=
data_len
+
WEP_ICV_LEN
;
sg_init_one
(
&
sg
,
data
,
data_len
+
WEP_ICV_LEN
);
crypto_blkcipher_encrypt
(
&
desc
,
&
sg
,
&
sg
,
sg
.
length
);
}
...
...
@@ -204,9 +202,7 @@ int ieee80211_wep_decrypt_data(struct crypto_blkcipher *tfm, u8 *rc4key,
__le32
crc
;
crypto_blkcipher_setkey
(
tfm
,
rc4key
,
klen
);
sg
.
page
=
virt_to_page
(
data
);
sg
.
offset
=
offset_in_page
(
data
);
sg
.
length
=
data_len
+
WEP_ICV_LEN
;
sg_init_one
(
&
sg
,
data
,
data_len
+
WEP_ICV_LEN
);
crypto_blkcipher_decrypt
(
&
desc
,
&
sg
,
&
sg
,
sg
.
length
);
crc
=
cpu_to_le32
(
~
crc32_le
(
~
0
,
data
,
data_len
));
...
...
net/sctp/auth.c
浏览文件 @
fa05f128
...
...
@@ -726,7 +726,8 @@ void sctp_auth_calculate_hmac(const struct sctp_association *asoc,
/* set up scatter list */
end
=
skb_tail_pointer
(
skb
);
sg
.
page
=
virt_to_page
(
auth
);
sg_init_table
(
&
sg
,
1
);
sg_set_page
(
&
sg
,
virt_to_page
(
auth
));
sg
.
offset
=
(
unsigned
long
)(
auth
)
%
PAGE_SIZE
;
sg
.
length
=
end
-
(
unsigned
char
*
)
auth
;
...
...
net/sctp/sm_make_chunk.c
浏览文件 @
fa05f128
...
...
@@ -1513,7 +1513,8 @@ static sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
struct
hash_desc
desc
;
/* Sign the message. */
sg
.
page
=
virt_to_page
(
&
cookie
->
c
);
sg_init_table
(
&
sg
,
1
);
sg_set_page
(
&
sg
,
virt_to_page
(
&
cookie
->
c
));
sg
.
offset
=
(
unsigned
long
)(
&
cookie
->
c
)
%
PAGE_SIZE
;
sg
.
length
=
bodysize
;
keylen
=
SCTP_SECRET_SIZE
;
...
...
@@ -1585,7 +1586,8 @@ struct sctp_association *sctp_unpack_cookie(
/* Check the signature. */
keylen
=
SCTP_SECRET_SIZE
;
sg
.
page
=
virt_to_page
(
bear_cookie
);
sg_init_table
(
&
sg
,
1
);
sg_set_page
(
&
sg
,
virt_to_page
(
bear_cookie
));
sg
.
offset
=
(
unsigned
long
)(
bear_cookie
)
%
PAGE_SIZE
;
sg
.
length
=
bodysize
;
key
=
(
char
*
)
ep
->
secret_key
[
ep
->
current_key
];
...
...
net/sunrpc/auth_gss/gss_krb5_crypto.c
浏览文件 @
fa05f128
...
...
@@ -197,9 +197,9 @@ encryptor(struct scatterlist *sg, void *data)
int
i
=
(
page_pos
+
outbuf
->
page_base
)
>>
PAGE_CACHE_SHIFT
;
in_page
=
desc
->
pages
[
i
];
}
else
{
in_page
=
sg
->
page
;
in_page
=
sg
_page
(
sg
)
;
}
desc
->
infrags
[
desc
->
fragno
].
page
=
in_page
;
sg_set_page
(
&
desc
->
infrags
[
desc
->
fragno
],
in_page
)
;
desc
->
fragno
++
;
desc
->
fraglen
+=
sg
->
length
;
desc
->
pos
+=
sg
->
length
;
...
...
@@ -215,11 +215,11 @@ encryptor(struct scatterlist *sg, void *data)
if
(
ret
)
return
ret
;
if
(
fraglen
)
{
desc
->
outfrags
[
0
].
page
=
sg
->
page
;
sg_set_page
(
&
desc
->
outfrags
[
0
],
sg_page
(
sg
))
;
desc
->
outfrags
[
0
].
offset
=
sg
->
offset
+
sg
->
length
-
fraglen
;
desc
->
outfrags
[
0
].
length
=
fraglen
;
desc
->
infrags
[
0
]
=
desc
->
outfrags
[
0
];
desc
->
infrags
[
0
].
page
=
in_page
;
sg_set_page
(
&
desc
->
infrags
[
0
],
in_page
)
;
desc
->
fragno
=
1
;
desc
->
fraglen
=
fraglen
;
}
else
{
...
...
@@ -287,7 +287,7 @@ decryptor(struct scatterlist *sg, void *data)
if
(
ret
)
return
ret
;
if
(
fraglen
)
{
desc
->
frags
[
0
].
page
=
sg
->
page
;
sg_set_page
(
&
desc
->
frags
[
0
],
sg_page
(
sg
))
;
desc
->
frags
[
0
].
offset
=
sg
->
offset
+
sg
->
length
-
fraglen
;
desc
->
frags
[
0
].
length
=
fraglen
;
desc
->
fragno
=
1
;
...
...
net/sunrpc/xdr.c
浏览文件 @
fa05f128
...
...
@@ -1059,7 +1059,7 @@ xdr_process_buf(struct xdr_buf *buf, unsigned int offset, unsigned int len,
do
{
if
(
thislen
>
page_len
)
thislen
=
page_len
;
sg
->
page
=
buf
->
pages
[
i
]
;
sg
_set_page
(
sg
,
buf
->
pages
[
i
])
;
sg
->
offset
=
page_offset
;
sg
->
length
=
thislen
;
ret
=
actor
(
sg
,
data
);
...
...
net/xfrm/xfrm_algo.c
浏览文件 @
fa05f128
...
...
@@ -552,7 +552,7 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
if
(
copy
>
len
)
copy
=
len
;
sg
.
page
=
virt_to_page
(
skb
->
data
+
offset
);
sg
_set_page
(
&
sg
,
virt_to_page
(
skb
->
data
+
offset
)
);
sg
.
offset
=
(
unsigned
long
)(
skb
->
data
+
offset
)
%
PAGE_SIZE
;
sg
.
length
=
copy
;
...
...
@@ -577,7 +577,7 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
if
(
copy
>
len
)
copy
=
len
;
sg
.
page
=
frag
->
page
;
sg
_set_page
(
&
sg
,
frag
->
page
)
;
sg
.
offset
=
frag
->
page_offset
+
offset
-
start
;
sg
.
length
=
copy
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录