Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
ae01d279
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看板
提交
ae01d279
编写于
9月 13, 2005
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
差异文件
Merge master.kernel.org:/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6
上级
adcb5ad1
0915e886
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
90 addition
and
8 deletion
+90
-8
drivers/bluetooth/hci_usb.c
drivers/bluetooth/hci_usb.c
+18
-1
drivers/bluetooth/hci_usb.h
drivers/bluetooth/hci_usb.h
+3
-2
include/net/bluetooth/hci.h
include/net/bluetooth/hci.h
+11
-0
net/bluetooth/hci_event.c
net/bluetooth/hci_event.c
+33
-0
net/bluetooth/rfcomm/sock.c
net/bluetooth/rfcomm/sock.c
+25
-5
未找到文件。
drivers/bluetooth/hci_usb.c
浏览文件 @
ae01d279
...
@@ -65,13 +65,15 @@
...
@@ -65,13 +65,15 @@
#endif
#endif
static
int
ignore
=
0
;
static
int
ignore
=
0
;
static
int
ignore_csr
=
0
;
static
int
ignore_sniffer
=
0
;
static
int
reset
=
0
;
static
int
reset
=
0
;
#ifdef CONFIG_BT_HCIUSB_SCO
#ifdef CONFIG_BT_HCIUSB_SCO
static
int
isoc
=
2
;
static
int
isoc
=
2
;
#endif
#endif
#define VERSION "2.
8
"
#define VERSION "2.
9
"
static
struct
usb_driver
hci_usb_driver
;
static
struct
usb_driver
hci_usb_driver
;
...
@@ -98,6 +100,9 @@ static struct usb_device_id bluetooth_ids[] = {
...
@@ -98,6 +100,9 @@ static struct usb_device_id bluetooth_ids[] = {
MODULE_DEVICE_TABLE
(
usb
,
bluetooth_ids
);
MODULE_DEVICE_TABLE
(
usb
,
bluetooth_ids
);
static
struct
usb_device_id
blacklist_ids
[]
=
{
static
struct
usb_device_id
blacklist_ids
[]
=
{
/* CSR BlueCore devices */
{
USB_DEVICE
(
0x0a12
,
0x0001
),
.
driver_info
=
HCI_CSR
},
/* Broadcom BCM2033 without firmware */
/* Broadcom BCM2033 without firmware */
{
USB_DEVICE
(
0x0a5c
,
0x2033
),
.
driver_info
=
HCI_IGNORE
},
{
USB_DEVICE
(
0x0a5c
,
0x2033
),
.
driver_info
=
HCI_IGNORE
},
...
@@ -836,6 +841,12 @@ static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id
...
@@ -836,6 +841,12 @@ static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id
if
(
ignore
||
id
->
driver_info
&
HCI_IGNORE
)
if
(
ignore
||
id
->
driver_info
&
HCI_IGNORE
)
return
-
ENODEV
;
return
-
ENODEV
;
if
(
ignore_csr
&&
id
->
driver_info
&
HCI_CSR
)
return
-
ENODEV
;
if
(
ignore_sniffer
&&
id
->
driver_info
&
HCI_SNIFFER
)
return
-
ENODEV
;
if
(
intf
->
cur_altsetting
->
desc
.
bInterfaceNumber
>
0
)
if
(
intf
->
cur_altsetting
->
desc
.
bInterfaceNumber
>
0
)
return
-
ENODEV
;
return
-
ENODEV
;
...
@@ -1061,6 +1072,12 @@ module_exit(hci_usb_exit);
...
@@ -1061,6 +1072,12 @@ module_exit(hci_usb_exit);
module_param
(
ignore
,
bool
,
0644
);
module_param
(
ignore
,
bool
,
0644
);
MODULE_PARM_DESC
(
ignore
,
"Ignore devices from the matching table"
);
MODULE_PARM_DESC
(
ignore
,
"Ignore devices from the matching table"
);
module_param
(
ignore_csr
,
bool
,
0644
);
MODULE_PARM_DESC
(
ignore_csr
,
"Ignore devices with id 0a12:0001"
);
module_param
(
ignore_sniffer
,
bool
,
0644
);
MODULE_PARM_DESC
(
ignore_sniffer
,
"Ignore devices with id 0a12:0002"
);
module_param
(
reset
,
bool
,
0644
);
module_param
(
reset
,
bool
,
0644
);
MODULE_PARM_DESC
(
reset
,
"Send HCI reset command on initialization"
);
MODULE_PARM_DESC
(
reset
,
"Send HCI reset command on initialization"
);
...
...
drivers/bluetooth/hci_usb.h
浏览文件 @
ae01d279
...
@@ -31,9 +31,10 @@
...
@@ -31,9 +31,10 @@
#define HCI_IGNORE 0x01
#define HCI_IGNORE 0x01
#define HCI_RESET 0x02
#define HCI_RESET 0x02
#define HCI_DIGIANSWER 0x04
#define HCI_DIGIANSWER 0x04
#define HCI_
SNIFFER
0x08
#define HCI_
CSR
0x08
#define HCI_
BROKEN_ISOC
0x10
#define HCI_
SNIFFER
0x10
#define HCI_BCM92035 0x20
#define HCI_BCM92035 0x20
#define HCI_BROKEN_ISOC 0x40
#define HCI_MAX_IFACE_NUM 3
#define HCI_MAX_IFACE_NUM 3
...
...
include/net/bluetooth/hci.h
浏览文件 @
ae01d279
...
@@ -463,6 +463,17 @@ struct inquiry_info_with_rssi_and_pscan_mode {
...
@@ -463,6 +463,17 @@ struct inquiry_info_with_rssi_and_pscan_mode {
__s8
rssi
;
__s8
rssi
;
}
__attribute__
((
packed
));
}
__attribute__
((
packed
));
#define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2F
struct
extended_inquiry_info
{
bdaddr_t
bdaddr
;
__u8
pscan_rep_mode
;
__u8
pscan_period_mode
;
__u8
dev_class
[
3
];
__u16
clock_offset
;
__s8
rssi
;
__u8
data
[
240
];
}
__attribute__
((
packed
));
#define HCI_EV_CONN_COMPLETE 0x03
#define HCI_EV_CONN_COMPLETE 0x03
struct
hci_ev_conn_complete
{
struct
hci_ev_conn_complete
{
__u8
status
;
__u8
status
;
...
...
net/bluetooth/hci_event.c
浏览文件 @
ae01d279
...
@@ -558,6 +558,35 @@ static inline void hci_inquiry_result_with_rssi_evt(struct hci_dev *hdev, struct
...
@@ -558,6 +558,35 @@ static inline void hci_inquiry_result_with_rssi_evt(struct hci_dev *hdev, struct
hci_dev_unlock
(
hdev
);
hci_dev_unlock
(
hdev
);
}
}
/* Extended Inquiry Result */
static
inline
void
hci_extended_inquiry_result_evt
(
struct
hci_dev
*
hdev
,
struct
sk_buff
*
skb
)
{
struct
inquiry_data
data
;
struct
extended_inquiry_info
*
info
=
(
struct
extended_inquiry_info
*
)
(
skb
->
data
+
1
);
int
num_rsp
=
*
((
__u8
*
)
skb
->
data
);
BT_DBG
(
"%s num_rsp %d"
,
hdev
->
name
,
num_rsp
);
if
(
!
num_rsp
)
return
;
hci_dev_lock
(
hdev
);
for
(;
num_rsp
;
num_rsp
--
)
{
bacpy
(
&
data
.
bdaddr
,
&
info
->
bdaddr
);
data
.
pscan_rep_mode
=
info
->
pscan_rep_mode
;
data
.
pscan_period_mode
=
info
->
pscan_period_mode
;
data
.
pscan_mode
=
0x00
;
memcpy
(
data
.
dev_class
,
info
->
dev_class
,
3
);
data
.
clock_offset
=
info
->
clock_offset
;
data
.
rssi
=
info
->
rssi
;
info
++
;
hci_inquiry_cache_update
(
hdev
,
&
data
);
}
hci_dev_unlock
(
hdev
);
}
/* Connect Request */
/* Connect Request */
static
inline
void
hci_conn_request_evt
(
struct
hci_dev
*
hdev
,
struct
sk_buff
*
skb
)
static
inline
void
hci_conn_request_evt
(
struct
hci_dev
*
hdev
,
struct
sk_buff
*
skb
)
{
{
...
@@ -940,6 +969,10 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
...
@@ -940,6 +969,10 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
hci_inquiry_result_with_rssi_evt
(
hdev
,
skb
);
hci_inquiry_result_with_rssi_evt
(
hdev
,
skb
);
break
;
break
;
case
HCI_EV_EXTENDED_INQUIRY_RESULT
:
hci_extended_inquiry_result_evt
(
hdev
,
skb
);
break
;
case
HCI_EV_CONN_REQUEST
:
case
HCI_EV_CONN_REQUEST
:
hci_conn_request_evt
(
hdev
,
skb
);
hci_conn_request_evt
(
hdev
,
skb
);
break
;
break
;
...
...
net/bluetooth/rfcomm/sock.c
浏览文件 @
ae01d279
...
@@ -363,6 +363,11 @@ static int rfcomm_sock_bind(struct socket *sock, struct sockaddr *addr, int addr
...
@@ -363,6 +363,11 @@ static int rfcomm_sock_bind(struct socket *sock, struct sockaddr *addr, int addr
goto
done
;
goto
done
;
}
}
if
(
sk
->
sk_type
!=
SOCK_STREAM
)
{
err
=
-
EINVAL
;
goto
done
;
}
write_lock_bh
(
&
rfcomm_sk_list
.
lock
);
write_lock_bh
(
&
rfcomm_sk_list
.
lock
);
if
(
sa
->
rc_channel
&&
__rfcomm_get_sock_by_addr
(
sa
->
rc_channel
,
&
sa
->
rc_bdaddr
))
{
if
(
sa
->
rc_channel
&&
__rfcomm_get_sock_by_addr
(
sa
->
rc_channel
,
&
sa
->
rc_bdaddr
))
{
...
@@ -393,13 +398,17 @@ static int rfcomm_sock_connect(struct socket *sock, struct sockaddr *addr, int a
...
@@ -393,13 +398,17 @@ static int rfcomm_sock_connect(struct socket *sock, struct sockaddr *addr, int a
if
(
addr
->
sa_family
!=
AF_BLUETOOTH
||
alen
<
sizeof
(
struct
sockaddr_rc
))
if
(
addr
->
sa_family
!=
AF_BLUETOOTH
||
alen
<
sizeof
(
struct
sockaddr_rc
))
return
-
EINVAL
;
return
-
EINVAL
;
if
(
sk
->
sk_state
!=
BT_OPEN
&&
sk
->
sk_state
!=
BT_BOUND
)
lock_sock
(
sk
);
return
-
EBADFD
;
if
(
sk
->
sk_type
!=
SOCK_STREAM
)
if
(
sk
->
sk_state
!=
BT_OPEN
&&
sk
->
sk_state
!=
BT_BOUND
)
{
return
-
EINVAL
;
err
=
-
EBADFD
;
goto
done
;
}
lock_sock
(
sk
);
if
(
sk
->
sk_type
!=
SOCK_STREAM
)
{
err
=
-
EINVAL
;
goto
done
;
}
sk
->
sk_state
=
BT_CONNECT
;
sk
->
sk_state
=
BT_CONNECT
;
bacpy
(
&
bt_sk
(
sk
)
->
dst
,
&
sa
->
rc_bdaddr
);
bacpy
(
&
bt_sk
(
sk
)
->
dst
,
&
sa
->
rc_bdaddr
);
...
@@ -410,6 +419,7 @@ static int rfcomm_sock_connect(struct socket *sock, struct sockaddr *addr, int a
...
@@ -410,6 +419,7 @@ static int rfcomm_sock_connect(struct socket *sock, struct sockaddr *addr, int a
err
=
bt_sock_wait_state
(
sk
,
BT_CONNECTED
,
err
=
bt_sock_wait_state
(
sk
,
BT_CONNECTED
,
sock_sndtimeo
(
sk
,
flags
&
O_NONBLOCK
));
sock_sndtimeo
(
sk
,
flags
&
O_NONBLOCK
));
done:
release_sock
(
sk
);
release_sock
(
sk
);
return
err
;
return
err
;
}
}
...
@@ -428,6 +438,11 @@ static int rfcomm_sock_listen(struct socket *sock, int backlog)
...
@@ -428,6 +438,11 @@ static int rfcomm_sock_listen(struct socket *sock, int backlog)
goto
done
;
goto
done
;
}
}
if
(
sk
->
sk_type
!=
SOCK_STREAM
)
{
err
=
-
EINVAL
;
goto
done
;
}
if
(
!
rfcomm_pi
(
sk
)
->
channel
)
{
if
(
!
rfcomm_pi
(
sk
)
->
channel
)
{
bdaddr_t
*
src
=
&
bt_sk
(
sk
)
->
src
;
bdaddr_t
*
src
=
&
bt_sk
(
sk
)
->
src
;
u8
channel
;
u8
channel
;
...
@@ -472,6 +487,11 @@ static int rfcomm_sock_accept(struct socket *sock, struct socket *newsock, int f
...
@@ -472,6 +487,11 @@ static int rfcomm_sock_accept(struct socket *sock, struct socket *newsock, int f
goto
done
;
goto
done
;
}
}
if
(
sk
->
sk_type
!=
SOCK_STREAM
)
{
err
=
-
EINVAL
;
goto
done
;
}
timeo
=
sock_rcvtimeo
(
sk
,
flags
&
O_NONBLOCK
);
timeo
=
sock_rcvtimeo
(
sk
,
flags
&
O_NONBLOCK
);
BT_DBG
(
"sk %p timeo %ld"
,
sk
,
timeo
);
BT_DBG
(
"sk %p timeo %ld"
,
sk
,
timeo
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录