Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
e3a61d47
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e3a61d47
编写于
3月 21, 2010
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6
上级
634a4b20
c2c77ec8
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
119 addition
and
51 deletion
+119
-51
include/net/bluetooth/bluetooth.h
include/net/bluetooth/bluetooth.h
+1
-1
net/bluetooth/hci_sysfs.c
net/bluetooth/hci_sysfs.c
+1
-2
net/bluetooth/l2cap.c
net/bluetooth/l2cap.c
+35
-13
net/bluetooth/rfcomm/core.c
net/bluetooth/rfcomm/core.c
+29
-12
net/bluetooth/rfcomm/sock.c
net/bluetooth/rfcomm/sock.c
+27
-11
net/bluetooth/sco.c
net/bluetooth/sco.c
+26
-12
未找到文件。
include/net/bluetooth/bluetooth.h
浏览文件 @
e3a61d47
...
...
@@ -176,6 +176,6 @@ extern void hci_sock_cleanup(void);
extern
int
bt_sysfs_init
(
void
);
extern
void
bt_sysfs_cleanup
(
void
);
extern
struct
class
*
bt_clas
s
;
extern
struct
dentry
*
bt_debugf
s
;
#endif
/* __BLUETOOTH_H */
net/bluetooth/hci_sysfs.c
浏览文件 @
e3a61d47
...
...
@@ -8,8 +8,7 @@
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
struct
class
*
bt_class
=
NULL
;
EXPORT_SYMBOL_GPL
(
bt_class
);
static
struct
class
*
bt_class
;
struct
dentry
*
bt_debugfs
=
NULL
;
EXPORT_SYMBOL_GPL
(
bt_debugfs
);
...
...
net/bluetooth/l2cap.c
浏览文件 @
e3a61d47
...
...
@@ -40,6 +40,8 @@
#include <linux/skbuff.h>
#include <linux/list.h>
#include <linux/device.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <linux/uaccess.h>
#include <linux/crc16.h>
#include <net/sock.h>
...
...
@@ -2830,6 +2832,11 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hdr
int
len
=
cmd
->
len
-
sizeof
(
*
rsp
);
char
req
[
64
];
if
(
len
>
sizeof
(
req
)
-
sizeof
(
struct
l2cap_conf_req
))
{
l2cap_send_disconn_req
(
conn
,
sk
);
goto
done
;
}
/* throw out any old stored conf requests */
result
=
L2CAP_CONF_SUCCESS
;
len
=
l2cap_parse_conf_rsp
(
sk
,
rsp
->
data
,
...
...
@@ -3937,31 +3944,42 @@ static int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 fl
return
0
;
}
static
ssize_t
l2cap_sysfs_show
(
struct
class
*
dev
,
struct
class_attribute
*
attr
,
char
*
buf
)
static
int
l2cap_debugfs_show
(
struct
seq_file
*
f
,
void
*
p
)
{
struct
sock
*
sk
;
struct
hlist_node
*
node
;
char
*
str
=
buf
;
read_lock_bh
(
&
l2cap_sk_list
.
lock
);
sk_for_each
(
sk
,
node
,
&
l2cap_sk_list
.
head
)
{
struct
l2cap_pinfo
*
pi
=
l2cap_pi
(
sk
);
str
+=
sprintf
(
str
,
"%s %s %d %d 0x%4.4x 0x%4.4x %d %d %d
\n
"
,
batostr
(
&
bt_sk
(
sk
)
->
src
),
batostr
(
&
bt_sk
(
sk
)
->
dst
),
sk
->
sk_state
,
__le16_to_cpu
(
pi
->
psm
),
pi
->
scid
,
pi
->
dcid
,
pi
->
imtu
,
pi
->
omtu
,
pi
->
sec_level
);
seq_printf
(
f
,
"%s %s %d %d 0x%4.4x 0x%4.4x %d %d %d
\n
"
,
batostr
(
&
bt_sk
(
sk
)
->
src
),
batostr
(
&
bt_sk
(
sk
)
->
dst
),
sk
->
sk_state
,
__le16_to_cpu
(
pi
->
psm
),
pi
->
scid
,
pi
->
dcid
,
pi
->
imtu
,
pi
->
omtu
,
pi
->
sec_level
);
}
read_unlock_bh
(
&
l2cap_sk_list
.
lock
);
return
str
-
buf
;
return
0
;
}
static
CLASS_ATTR
(
l2cap
,
S_IRUGO
,
l2cap_sysfs_show
,
NULL
);
static
int
l2cap_debugfs_open
(
struct
inode
*
inode
,
struct
file
*
file
)
{
return
single_open
(
file
,
l2cap_debugfs_show
,
inode
->
i_private
);
}
static
const
struct
file_operations
l2cap_debugfs_fops
=
{
.
open
=
l2cap_debugfs_open
,
.
read
=
seq_read
,
.
llseek
=
seq_lseek
,
.
release
=
single_release
,
};
static
struct
dentry
*
l2cap_debugfs
;
static
const
struct
proto_ops
l2cap_sock_ops
=
{
.
family
=
PF_BLUETOOTH
,
...
...
@@ -4021,8 +4039,12 @@ static int __init l2cap_init(void)
goto
error
;
}
if
(
class_create_file
(
bt_class
,
&
class_attr_l2cap
)
<
0
)
BT_ERR
(
"Failed to create L2CAP info file"
);
if
(
bt_debugfs
)
{
l2cap_debugfs
=
debugfs_create_file
(
"l2cap"
,
0444
,
bt_debugfs
,
NULL
,
&
l2cap_debugfs_fops
);
if
(
!
l2cap_debugfs
)
BT_ERR
(
"Failed to create L2CAP debug file"
);
}
BT_INFO
(
"L2CAP ver %s"
,
VERSION
);
BT_INFO
(
"L2CAP socket layer initialized"
);
...
...
@@ -4036,7 +4058,7 @@ static int __init l2cap_init(void)
static
void
__exit
l2cap_exit
(
void
)
{
class_remove_file
(
bt_class
,
&
class_attr_l2cap
);
debugfs_remove
(
l2cap_debugfs
);
if
(
bt_sock_unregister
(
BTPROTO_L2CAP
)
<
0
)
BT_ERR
(
"L2CAP socket unregistration failed"
);
...
...
net/bluetooth/rfcomm/core.c
浏览文件 @
e3a61d47
...
...
@@ -33,6 +33,8 @@
#include <linux/init.h>
#include <linux/wait.h>
#include <linux/device.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <linux/net.h>
#include <linux/mutex.h>
#include <linux/kthread.h>
...
...
@@ -2098,13 +2100,10 @@ static struct hci_cb rfcomm_cb = {
.
security_cfm
=
rfcomm_security_cfm
};
static
ssize_t
rfcomm_dlc_sysfs_show
(
struct
class
*
dev
,
struct
class_attribute
*
attr
,
char
*
buf
)
static
int
rfcomm_dlc_debugfs_show
(
struct
seq_file
*
f
,
void
*
x
)
{
struct
rfcomm_session
*
s
;
struct
list_head
*
pp
,
*
p
;
char
*
str
=
buf
;
rfcomm_lock
();
...
...
@@ -2114,18 +2113,32 @@ static ssize_t rfcomm_dlc_sysfs_show(struct class *dev,
struct
sock
*
sk
=
s
->
sock
->
sk
;
struct
rfcomm_dlc
*
d
=
list_entry
(
pp
,
struct
rfcomm_dlc
,
list
);
str
+=
sprintf
(
str
,
"%s %s %ld %d %d %d %d
\n
"
,
batostr
(
&
bt_sk
(
sk
)
->
src
),
batostr
(
&
bt_sk
(
sk
)
->
dst
),
d
->
state
,
d
->
dlci
,
d
->
mtu
,
d
->
rx_credits
,
d
->
tx_credits
);
seq_printf
(
f
,
"%s %s %ld %d %d %d %d
\n
"
,
batostr
(
&
bt_sk
(
sk
)
->
src
),
batostr
(
&
bt_sk
(
sk
)
->
dst
),
d
->
state
,
d
->
dlci
,
d
->
mtu
,
d
->
rx_credits
,
d
->
tx_credits
);
}
}
rfcomm_unlock
();
return
(
str
-
buf
)
;
return
0
;
}
static
CLASS_ATTR
(
rfcomm_dlc
,
S_IRUGO
,
rfcomm_dlc_sysfs_show
,
NULL
);
static
int
rfcomm_dlc_debugfs_open
(
struct
inode
*
inode
,
struct
file
*
file
)
{
return
single_open
(
file
,
rfcomm_dlc_debugfs_show
,
inode
->
i_private
);
}
static
const
struct
file_operations
rfcomm_dlc_debugfs_fops
=
{
.
open
=
rfcomm_dlc_debugfs_open
,
.
read
=
seq_read
,
.
llseek
=
seq_lseek
,
.
release
=
single_release
,
};
static
struct
dentry
*
rfcomm_dlc_debugfs
;
/* ---- Initialization ---- */
static
int
__init
rfcomm_init
(
void
)
...
...
@@ -2142,8 +2155,12 @@ static int __init rfcomm_init(void)
goto
unregister
;
}
if
(
class_create_file
(
bt_class
,
&
class_attr_rfcomm_dlc
)
<
0
)
BT_ERR
(
"Failed to create RFCOMM info file"
);
if
(
bt_debugfs
)
{
rfcomm_dlc_debugfs
=
debugfs_create_file
(
"rfcomm_dlc"
,
0444
,
bt_debugfs
,
NULL
,
&
rfcomm_dlc_debugfs_fops
);
if
(
!
rfcomm_dlc_debugfs
)
BT_ERR
(
"Failed to create RFCOMM debug file"
);
}
err
=
rfcomm_init_ttys
();
if
(
err
<
0
)
...
...
@@ -2171,7 +2188,7 @@ static int __init rfcomm_init(void)
static
void
__exit
rfcomm_exit
(
void
)
{
class_remove_file
(
bt_class
,
&
class_attr_rfcomm_dlc
);
debugfs_remove
(
rfcomm_dlc_debugfs
);
hci_unregister_cb
(
&
rfcomm_cb
);
...
...
net/bluetooth/rfcomm/sock.c
浏览文件 @
e3a61d47
...
...
@@ -40,6 +40,8 @@
#include <linux/skbuff.h>
#include <linux/list.h>
#include <linux/device.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <net/sock.h>
#include <asm/system.h>
...
...
@@ -1061,28 +1063,38 @@ int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc *
return
result
;
}
static
ssize_t
rfcomm_sock_sysfs_show
(
struct
class
*
dev
,
struct
class_attribute
*
attr
,
char
*
buf
)
static
int
rfcomm_sock_debugfs_show
(
struct
seq_file
*
f
,
void
*
p
)
{
struct
sock
*
sk
;
struct
hlist_node
*
node
;
char
*
str
=
buf
;
read_lock_bh
(
&
rfcomm_sk_list
.
lock
);
sk_for_each
(
sk
,
node
,
&
rfcomm_sk_list
.
head
)
{
str
+=
sprintf
(
str
,
"%s %s %d %d
\n
"
,
batostr
(
&
bt_sk
(
sk
)
->
src
),
batostr
(
&
bt_sk
(
sk
)
->
dst
),
seq_printf
(
f
,
"%s %s %d %d
\n
"
,
batostr
(
&
bt_sk
(
sk
)
->
src
),
batostr
(
&
bt_sk
(
sk
)
->
dst
),
sk
->
sk_state
,
rfcomm_pi
(
sk
)
->
channel
);
}
read_unlock_bh
(
&
rfcomm_sk_list
.
lock
);
return
(
str
-
buf
)
;
return
0
;
}
static
CLASS_ATTR
(
rfcomm
,
S_IRUGO
,
rfcomm_sock_sysfs_show
,
NULL
);
static
int
rfcomm_sock_debugfs_open
(
struct
inode
*
inode
,
struct
file
*
file
)
{
return
single_open
(
file
,
rfcomm_sock_debugfs_show
,
inode
->
i_private
);
}
static
const
struct
file_operations
rfcomm_sock_debugfs_fops
=
{
.
open
=
rfcomm_sock_debugfs_open
,
.
read
=
seq_read
,
.
llseek
=
seq_lseek
,
.
release
=
single_release
,
};
static
struct
dentry
*
rfcomm_sock_debugfs
;
static
const
struct
proto_ops
rfcomm_sock_ops
=
{
.
family
=
PF_BLUETOOTH
,
...
...
@@ -1122,8 +1134,12 @@ int __init rfcomm_init_sockets(void)
if
(
err
<
0
)
goto
error
;
if
(
class_create_file
(
bt_class
,
&
class_attr_rfcomm
)
<
0
)
BT_ERR
(
"Failed to create RFCOMM info file"
);
if
(
bt_debugfs
)
{
rfcomm_sock_debugfs
=
debugfs_create_file
(
"rfcomm"
,
0444
,
bt_debugfs
,
NULL
,
&
rfcomm_sock_debugfs_fops
);
if
(
!
rfcomm_sock_debugfs
)
BT_ERR
(
"Failed to create RFCOMM debug file"
);
}
BT_INFO
(
"RFCOMM socket layer initialized"
);
...
...
@@ -1137,7 +1153,7 @@ int __init rfcomm_init_sockets(void)
void
rfcomm_cleanup_sockets
(
void
)
{
class_remove_file
(
bt_class
,
&
class_attr_rfcomm
);
debugfs_remove
(
rfcomm_sock_debugfs
);
if
(
bt_sock_unregister
(
BTPROTO_RFCOMM
)
<
0
)
BT_ERR
(
"RFCOMM socket layer unregistration failed"
);
...
...
net/bluetooth/sco.c
浏览文件 @
e3a61d47
...
...
@@ -38,6 +38,8 @@
#include <linux/socket.h>
#include <linux/skbuff.h>
#include <linux/device.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <linux/list.h>
#include <net/sock.h>
...
...
@@ -953,28 +955,36 @@ static int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb)
return
0
;
}
static
ssize_t
sco_sysfs_show
(
struct
class
*
dev
,
struct
class_attribute
*
attr
,
char
*
buf
)
static
int
sco_debugfs_show
(
struct
seq_file
*
f
,
void
*
p
)
{
struct
sock
*
sk
;
struct
hlist_node
*
node
;
char
*
str
=
buf
;
read_lock_bh
(
&
sco_sk_list
.
lock
);
sk_for_each
(
sk
,
node
,
&
sco_sk_list
.
head
)
{
str
+=
sprintf
(
str
,
"%s %s %d
\n
"
,
batostr
(
&
bt_sk
(
sk
)
->
src
),
batostr
(
&
bt_sk
(
sk
)
->
dst
),
sk
->
sk_state
);
seq_printf
(
f
,
"%s %s %d
\n
"
,
batostr
(
&
bt_sk
(
sk
)
->
src
),
batostr
(
&
bt_sk
(
sk
)
->
dst
),
sk
->
sk_state
);
}
read_unlock_bh
(
&
sco_sk_list
.
lock
);
return
(
str
-
buf
)
;
return
0
;
}
static
CLASS_ATTR
(
sco
,
S_IRUGO
,
sco_sysfs_show
,
NULL
);
static
int
sco_debugfs_open
(
struct
inode
*
inode
,
struct
file
*
file
)
{
return
single_open
(
file
,
sco_debugfs_show
,
inode
->
i_private
);
}
static
const
struct
file_operations
sco_debugfs_fops
=
{
.
open
=
sco_debugfs_open
,
.
read
=
seq_read
,
.
llseek
=
seq_lseek
,
.
release
=
single_release
,
};
static
struct
dentry
*
sco_debugfs
;
static
const
struct
proto_ops
sco_sock_ops
=
{
.
family
=
PF_BLUETOOTH
,
...
...
@@ -1032,8 +1042,12 @@ static int __init sco_init(void)
goto
error
;
}
if
(
class_create_file
(
bt_class
,
&
class_attr_sco
)
<
0
)
BT_ERR
(
"Failed to create SCO info file"
);
if
(
bt_debugfs
)
{
sco_debugfs
=
debugfs_create_file
(
"sco"
,
0444
,
bt_debugfs
,
NULL
,
&
sco_debugfs_fops
);
if
(
!
sco_debugfs
)
BT_ERR
(
"Failed to create SCO debug file"
);
}
BT_INFO
(
"SCO (Voice Link) ver %s"
,
VERSION
);
BT_INFO
(
"SCO socket layer initialized"
);
...
...
@@ -1047,7 +1061,7 @@ static int __init sco_init(void)
static
void
__exit
sco_exit
(
void
)
{
class_remove_file
(
bt_class
,
&
class_attr_sco
);
debugfs_remove
(
sco_debugfs
);
if
(
bt_sock_unregister
(
BTPROTO_SCO
)
<
0
)
BT_ERR
(
"SCO socket unregistration failed"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录