Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
bc83871e
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bc83871e
编写于
5月 04, 2009
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6
上级
e151a60a
a67e899c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
43 addition
and
34 deletion
+43
-34
include/net/bluetooth/hci_core.h
include/net/bluetooth/hci_core.h
+1
-0
net/bluetooth/hci_conn.c
net/bluetooth/hci_conn.c
+2
-0
net/bluetooth/hci_sysfs.c
net/bluetooth/hci_sysfs.c
+40
-34
未找到文件。
include/net/bluetooth/hci_core.h
浏览文件 @
bc83871e
...
...
@@ -457,6 +457,7 @@ int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count);
int
hci_register_sysfs
(
struct
hci_dev
*
hdev
);
void
hci_unregister_sysfs
(
struct
hci_dev
*
hdev
);
void
hci_conn_init_sysfs
(
struct
hci_conn
*
conn
);
void
hci_conn_add_sysfs
(
struct
hci_conn
*
conn
);
void
hci_conn_del_sysfs
(
struct
hci_conn
*
conn
);
...
...
net/bluetooth/hci_conn.c
浏览文件 @
bc83871e
...
...
@@ -248,6 +248,8 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
if
(
hdev
->
notify
)
hdev
->
notify
(
hdev
,
HCI_NOTIFY_CONN_ADD
);
hci_conn_init_sysfs
(
conn
);
tasklet_enable
(
&
hdev
->
tx_task
);
return
conn
;
...
...
net/bluetooth/hci_sysfs.c
浏览文件 @
bc83871e
...
...
@@ -9,7 +9,7 @@
struct
class
*
bt_class
=
NULL
;
EXPORT_SYMBOL_GPL
(
bt_class
);
static
struct
workqueue_struct
*
b
luetooth
;
static
struct
workqueue_struct
*
b
t_workq
;
static
inline
char
*
link_typetostr
(
int
type
)
{
...
...
@@ -89,8 +89,8 @@ static void add_conn(struct work_struct *work)
{
struct
hci_conn
*
conn
=
container_of
(
work
,
struct
hci_conn
,
work_add
);
/* ensure previous
add/
del is complete */
flush_work
queue
(
bluetooth
);
/* ensure previous del is complete */
flush_work
(
&
conn
->
work_del
);
if
(
device_add
(
&
conn
->
dev
)
<
0
)
{
BT_ERR
(
"Failed to register connection device"
);
...
...
@@ -98,27 +98,6 @@ static void add_conn(struct work_struct *work)
}
}
void
hci_conn_add_sysfs
(
struct
hci_conn
*
conn
)
{
struct
hci_dev
*
hdev
=
conn
->
hdev
;
BT_DBG
(
"conn %p"
,
conn
);
conn
->
dev
.
type
=
&
bt_link
;
conn
->
dev
.
class
=
bt_class
;
conn
->
dev
.
parent
=
&
hdev
->
dev
;
dev_set_name
(
&
conn
->
dev
,
"%s:%d"
,
hdev
->
name
,
conn
->
handle
);
dev_set_drvdata
(
&
conn
->
dev
,
conn
);
device_initialize
(
&
conn
->
dev
);
INIT_WORK
(
&
conn
->
work_add
,
add_conn
);
queue_work
(
bluetooth
,
&
conn
->
work_add
);
}
/*
* The rfcomm tty device will possibly retain even when conn
* is down, and sysfs doesn't support move zombie device,
...
...
@@ -134,8 +113,11 @@ static void del_conn(struct work_struct *work)
struct
hci_conn
*
conn
=
container_of
(
work
,
struct
hci_conn
,
work_del
);
struct
hci_dev
*
hdev
=
conn
->
hdev
;
/* ensure previous add/del is complete */
flush_workqueue
(
bluetooth
);
/* ensure previous add is complete */
flush_work
(
&
conn
->
work_add
);
if
(
!
device_is_registered
(
&
conn
->
dev
))
return
;
while
(
1
)
{
struct
device
*
dev
;
...
...
@@ -152,16 +134,40 @@ static void del_conn(struct work_struct *work)
hci_dev_put
(
hdev
);
}
void
hci_conn_
del
_sysfs
(
struct
hci_conn
*
conn
)
void
hci_conn_
init
_sysfs
(
struct
hci_conn
*
conn
)
{
struct
hci_dev
*
hdev
=
conn
->
hdev
;
BT_DBG
(
"conn %p"
,
conn
);
if
(
!
device_is_registered
(
&
conn
->
dev
))
return
;
conn
->
dev
.
type
=
&
bt_link
;
conn
->
dev
.
class
=
bt_class
;
conn
->
dev
.
parent
=
&
hdev
->
dev
;
dev_set_drvdata
(
&
conn
->
dev
,
conn
);
device_initialize
(
&
conn
->
dev
);
INIT_WORK
(
&
conn
->
work_add
,
add_conn
);
INIT_WORK
(
&
conn
->
work_del
,
del_conn
);
}
void
hci_conn_add_sysfs
(
struct
hci_conn
*
conn
)
{
struct
hci_dev
*
hdev
=
conn
->
hdev
;
BT_DBG
(
"conn %p"
,
conn
);
dev_set_name
(
&
conn
->
dev
,
"%s:%d"
,
hdev
->
name
,
conn
->
handle
);
queue_work
(
bt_workq
,
&
conn
->
work_add
);
}
void
hci_conn_del_sysfs
(
struct
hci_conn
*
conn
)
{
BT_DBG
(
"conn %p"
,
conn
);
queue_work
(
b
luetooth
,
&
conn
->
work_del
);
queue_work
(
b
t_workq
,
&
conn
->
work_del
);
}
static
inline
char
*
host_typetostr
(
int
type
)
...
...
@@ -438,13 +444,13 @@ void hci_unregister_sysfs(struct hci_dev *hdev)
int
__init
bt_sysfs_init
(
void
)
{
b
luetooth
=
create_singlethread_workqueue
(
"bluetooth"
);
if
(
!
b
luetooth
)
b
t_workq
=
create_singlethread_workqueue
(
"bluetooth"
);
if
(
!
b
t_workq
)
return
-
ENOMEM
;
bt_class
=
class_create
(
THIS_MODULE
,
"bluetooth"
);
if
(
IS_ERR
(
bt_class
))
{
destroy_workqueue
(
b
luetooth
);
destroy_workqueue
(
b
t_workq
);
return
PTR_ERR
(
bt_class
);
}
...
...
@@ -453,7 +459,7 @@ int __init bt_sysfs_init(void)
void
bt_sysfs_cleanup
(
void
)
{
destroy_workqueue
(
b
luetooth
);
destroy_workqueue
(
b
t_workq
);
class_destroy
(
bt_class
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录