Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
ae01d279
Commit
ae01d279
authored
Sep 13, 2005
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge master.kernel.org:/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6
parents
adcb5ad1
0915e886
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
8 deletions
+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
No files found.
drivers/bluetooth/hci_usb.c
View file @
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
View file @
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
View file @
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
View file @
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
View file @
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment