Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
22bd002e
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
153
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
22bd002e
编写于
9月 22, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rtl8188eu: remove dead code
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
79b185dd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
213 deletion
+0
-213
drivers/staging/rtl8188eu/include/osdep_service.h
drivers/staging/rtl8188eu/include/osdep_service.h
+0
-5
drivers/staging/rtl8188eu/os_dep/osdep_service.c
drivers/staging/rtl8188eu/os_dep/osdep_service.c
+0
-208
未找到文件。
drivers/staging/rtl8188eu/include/osdep_service.h
浏览文件 @
22bd002e
...
...
@@ -430,11 +430,6 @@ int ATOMIC_SUB_RETURN(ATOMIC_T *v, int i);
int
ATOMIC_INC_RETURN
(
ATOMIC_T
*
v
);
int
ATOMIC_DEC_RETURN
(
ATOMIC_T
*
v
);
/* File operation APIs, just for linux now */
int
rtw_is_file_readable
(
char
*
path
);
int
rtw_retrive_from_file
(
char
*
path
,
u8
__user
*
buf
,
u32
sz
);
int
rtw_store_to_file
(
char
*
path
,
u8
__user
*
buf
,
u32
sz
);
struct
rtw_netdev_priv_indicator
{
void
*
priv
;
u32
sizeof_priv
;
...
...
drivers/staging/rtl8188eu/os_dep/osdep_service.c
浏览文件 @
22bd002e
...
...
@@ -356,214 +356,6 @@ inline int ATOMIC_DEC_RETURN(ATOMIC_T *v)
return
atomic_dec_return
(
v
);
}
/* Open a file with the specific @param path, @param flag, @param mode
* @param fpp the pointer of struct file pointer to get struct file pointer while file opening is success
* @param path the path of the file to open
* @param flag file operation flags, please refer to linux document
* @param mode please refer to linux document
* @return Linux specific error code
*/
static
int
openfile
(
struct
file
**
fpp
,
char
*
path
,
int
flag
,
int
mode
)
{
struct
file
*
fp
;
fp
=
filp_open
(
path
,
flag
,
mode
);
if
(
IS_ERR
(
fp
))
{
*
fpp
=
NULL
;
return
PTR_ERR
(
fp
);
}
else
{
*
fpp
=
fp
;
return
0
;
}
}
/* Close the file with the specific @param fp
* @param fp the pointer of struct file to close
* @return always 0
*/
static
int
closefile
(
struct
file
*
fp
)
{
filp_close
(
fp
,
NULL
);
return
0
;
}
static
int
readfile
(
struct
file
*
fp
,
char
__user
*
buf
,
int
len
)
{
int
rlen
=
0
,
sum
=
0
;
if
(
!
fp
->
f_op
||
!
fp
->
f_op
->
read
)
return
-
EPERM
;
while
(
sum
<
len
)
{
rlen
=
fp
->
f_op
->
read
(
fp
,
buf
+
sum
,
len
-
sum
,
&
fp
->
f_pos
);
if
(
rlen
>
0
)
sum
+=
rlen
;
else
if
(
0
!=
rlen
)
return
rlen
;
else
break
;
}
return
sum
;
}
static
int
writefile
(
struct
file
*
fp
,
char
__user
*
buf
,
int
len
)
{
int
wlen
=
0
,
sum
=
0
;
if
(
!
fp
->
f_op
||
!
fp
->
f_op
->
write
)
return
-
EPERM
;
while
(
sum
<
len
)
{
wlen
=
fp
->
f_op
->
write
(
fp
,
buf
+
sum
,
len
-
sum
,
&
fp
->
f_pos
);
if
(
wlen
>
0
)
sum
+=
wlen
;
else
if
(
0
!=
wlen
)
return
wlen
;
else
break
;
}
return
sum
;
}
/* Test if the specifi @param path is a file and readable
* @param path the path of the file to test
* @return Linux specific error code
*/
static
int
isfilereadable
(
char
*
path
)
{
struct
file
*
fp
;
int
ret
=
0
;
mm_segment_t
oldfs
;
char
__user
buf
;
fp
=
filp_open
(
path
,
O_RDONLY
,
0
);
if
(
IS_ERR
(
fp
))
{
ret
=
PTR_ERR
(
fp
);
}
else
{
oldfs
=
get_fs
();
set_fs
(
get_ds
());
if
(
1
!=
readfile
(
fp
,
&
buf
,
1
))
ret
=
PTR_ERR
(
fp
);
set_fs
(
oldfs
);
filp_close
(
fp
,
NULL
);
}
return
ret
;
}
/* Open the file with @param path and retrive the file content into
* memory starting from @param buf for @param sz at most
* @param path the path of the file to open and read
* @param buf the starting address of the buffer to store file content
* @param sz how many bytes to read at most
* @return the byte we've read, or Linux specific error code
*/
static
int
retrievefromfile
(
char
*
path
,
u8
__user
*
buf
,
u32
sz
)
{
int
ret
=
-
1
;
mm_segment_t
oldfs
;
struct
file
*
fp
;
if
(
path
&&
buf
)
{
ret
=
openfile
(
&
fp
,
path
,
O_RDONLY
,
0
);
if
(
0
==
ret
)
{
DBG_88E
(
"%s openfile path:%s fp =%p
\n
"
,
__func__
,
path
,
fp
);
oldfs
=
get_fs
();
set_fs
(
get_ds
());
ret
=
readfile
(
fp
,
buf
,
sz
);
set_fs
(
oldfs
);
closefile
(
fp
);
DBG_88E
(
"%s readfile, ret:%d
\n
"
,
__func__
,
ret
);
}
else
{
DBG_88E
(
"%s openfile path:%s Fail, ret:%d
\n
"
,
__func__
,
path
,
ret
);
}
}
else
{
DBG_88E
(
"%s NULL pointer
\n
"
,
__func__
);
ret
=
-
EINVAL
;
}
return
ret
;
}
/*
* Open the file with @param path and wirte @param sz byte of data starting from @param buf into the file
* @param path the path of the file to open and write
* @param buf the starting address of the data to write into file
* @param sz how many bytes to write at most
* @return the byte we've written, or Linux specific error code
*/
static
int
storetofile
(
char
*
path
,
u8
__user
*
buf
,
u32
sz
)
{
int
ret
=
0
;
mm_segment_t
oldfs
;
struct
file
*
fp
;
if
(
path
&&
buf
)
{
ret
=
openfile
(
&
fp
,
path
,
O_CREAT
|
O_WRONLY
,
0666
);
if
(
0
==
ret
)
{
DBG_88E
(
"%s openfile path:%s fp =%p
\n
"
,
__func__
,
path
,
fp
);
oldfs
=
get_fs
();
set_fs
(
get_ds
());
ret
=
writefile
(
fp
,
buf
,
sz
);
set_fs
(
oldfs
);
closefile
(
fp
);
DBG_88E
(
"%s writefile, ret:%d
\n
"
,
__func__
,
ret
);
}
else
{
DBG_88E
(
"%s openfile path:%s Fail, ret:%d
\n
"
,
__func__
,
path
,
ret
);
}
}
else
{
DBG_88E
(
"%s NULL pointer
\n
"
,
__func__
);
ret
=
-
EINVAL
;
}
return
ret
;
}
/*
* Test if the specifi @param path is a file and readable
* @param path the path of the file to test
* @return true or false
*/
int
rtw_is_file_readable
(
char
*
path
)
{
if
(
isfilereadable
(
path
)
==
0
)
return
true
;
else
return
false
;
}
/*
* Open the file with @param path and retrive the file content into memory starting from @param buf for @param sz at most
* @param path the path of the file to open and read
* @param buf the starting address of the buffer to store file content
* @param sz how many bytes to read at most
* @return the byte we've read
*/
int
rtw_retrive_from_file
(
char
*
path
,
u8
__user
*
buf
,
u32
sz
)
{
int
ret
=
retrievefromfile
(
path
,
buf
,
sz
);
return
ret
>=
0
?
ret
:
0
;
}
/*
* Open the file with @param path and wirte @param sz byte of data
* starting from @param buf into the file
* @param path the path of the file to open and write
* @param buf the starting address of the data to write into file
* @param sz how many bytes to write at most
* @return the byte we've written
*/
int
rtw_store_to_file
(
char
*
path
,
u8
__user
*
buf
,
u32
sz
)
{
int
ret
=
storetofile
(
path
,
buf
,
sz
);
return
ret
>=
0
?
ret
:
0
;
}
struct
net_device
*
rtw_alloc_etherdev_with_old_priv
(
int
sizeof_priv
,
void
*
old_priv
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录