Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
c09db0b2
Commit
c09db0b2
authored
Dec 08, 2004
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge
http://linux-mh.bkbits.net/bluetooth-2.6
into nuts.davemloft.net:/disk1/BK/net-2.6
parents
ca322389
4865782e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
31 deletions
+63
-31
drivers/bluetooth/hci_usb.c
drivers/bluetooth/hci_usb.c
+3
-3
include/net/bluetooth/hci_core.h
include/net/bluetooth/hci_core.h
+13
-2
net/bluetooth/hci_conn.c
net/bluetooth/hci_conn.c
+4
-3
net/bluetooth/hci_core.c
net/bluetooth/hci_core.c
+15
-7
net/bluetooth/hci_event.c
net/bluetooth/hci_event.c
+22
-10
net/bluetooth/hci_sysfs.c
net/bluetooth/hci_sysfs.c
+6
-6
No files found.
drivers/bluetooth/hci_usb.c
View file @
c09db0b2
...
...
@@ -67,7 +67,7 @@
#endif
#ifdef CONFIG_BT_HCIUSB_SCO
static
int
isoc
=
1
;
static
int
isoc
=
2
;
#endif
#define VERSION "2.7"
...
...
@@ -898,7 +898,7 @@ static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id
switch
(
ep
->
desc
.
bmAttributes
&
USB_ENDPOINT_XFERTYPE_MASK
)
{
case
USB_ENDPOINT_XFER_ISOC
:
if
(
ep
->
desc
.
wMaxPacketSize
<
size
||
uif
->
desc
.
bAlternateSetting
>
2
)
uif
->
desc
.
bAlternateSetting
!=
isoc
)
break
;
size
=
ep
->
desc
.
wMaxPacketSize
;
...
...
@@ -1037,7 +1037,7 @@ module_init(hci_usb_init);
module_exit
(
hci_usb_exit
);
#ifdef CONFIG_BT_HCIUSB_SCO
module_param
(
isoc
,
bool
,
0
);
module_param
(
isoc
,
int
,
0644
);
MODULE_PARM_DESC
(
isoc
,
"Set isochronous transfers for SCO over HCI support"
);
#endif
...
...
include/net/bluetooth/hci_core.h
View file @
c09db0b2
...
...
@@ -38,10 +38,20 @@ extern struct proc_dir_entry *proc_bt_hci;
/* HCI Core structures */
struct
inquiry_data
{
bdaddr_t
bdaddr
;
__u8
pscan_rep_mode
;
__u8
pscan_period_mode
;
__u8
pscan_mode
;
__u8
dev_class
[
3
];
__u16
clock_offset
;
__s8
rssi
;
};
struct
inquiry_entry
{
struct
inquiry_entry
*
next
;
__u32
timestamp
;
struct
inquiry_
info
info
;
struct
inquiry_
data
data
;
};
struct
inquiry_cache
{
...
...
@@ -142,6 +152,7 @@ struct hci_conn {
__u16
state
;
__u8
type
;
__u8
out
;
__u8
dev_class
[
3
];
__u32
link_mode
;
unsigned
long
pend
;
...
...
@@ -199,7 +210,7 @@ static inline long inquiry_entry_age(struct inquiry_entry *e)
}
struct
inquiry_entry
*
hci_inquiry_cache_lookup
(
struct
hci_dev
*
hdev
,
bdaddr_t
*
bdaddr
);
void
hci_inquiry_cache_update
(
struct
hci_dev
*
hdev
,
struct
inquiry_
info
*
info
);
void
hci_inquiry_cache_update
(
struct
hci_dev
*
hdev
,
struct
inquiry_
data
*
data
);
/* ----- HCI Connections ----- */
enum
{
...
...
net/bluetooth/hci_conn.c
View file @
c09db0b2
...
...
@@ -71,9 +71,10 @@ void hci_acl_connect(struct hci_conn *conn)
if
((
ie
=
hci_inquiry_cache_lookup
(
hdev
,
&
conn
->
dst
))
&&
inquiry_entry_age
(
ie
)
<=
INQUIRY_ENTRY_AGE_MAX
)
{
cp
.
pscan_rep_mode
=
ie
->
info
.
pscan_rep_mode
;
cp
.
pscan_mode
=
ie
->
info
.
pscan_mode
;
cp
.
clock_offset
=
ie
->
info
.
clock_offset
|
__cpu_to_le16
(
0x8000
);
cp
.
pscan_rep_mode
=
ie
->
data
.
pscan_rep_mode
;
cp
.
pscan_mode
=
ie
->
data
.
pscan_mode
;
cp
.
clock_offset
=
ie
->
data
.
clock_offset
|
__cpu_to_le16
(
0x8000
);
memcpy
(
conn
->
dev_class
,
ie
->
data
.
dev_class
,
3
);
}
cp
.
pkt_type
=
__cpu_to_le16
(
hdev
->
pkt_type
&
ACL_PTYPE_MASK
);
...
...
net/bluetooth/hci_core.c
View file @
c09db0b2
...
...
@@ -313,19 +313,19 @@ struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *b
BT_DBG
(
"cache %p, %s"
,
cache
,
batostr
(
bdaddr
));
for
(
e
=
cache
->
list
;
e
;
e
=
e
->
next
)
if
(
!
bacmp
(
&
e
->
info
.
bdaddr
,
bdaddr
))
if
(
!
bacmp
(
&
e
->
data
.
bdaddr
,
bdaddr
))
break
;
return
e
;
}
void
hci_inquiry_cache_update
(
struct
hci_dev
*
hdev
,
struct
inquiry_
info
*
info
)
void
hci_inquiry_cache_update
(
struct
hci_dev
*
hdev
,
struct
inquiry_
data
*
data
)
{
struct
inquiry_cache
*
cache
=
&
hdev
->
inq_cache
;
struct
inquiry_entry
*
e
;
BT_DBG
(
"cache %p, %s"
,
cache
,
batostr
(
&
info
->
bdaddr
));
BT_DBG
(
"cache %p, %s"
,
cache
,
batostr
(
&
data
->
bdaddr
));
if
(
!
(
e
=
hci_inquiry_cache_lookup
(
hdev
,
&
info
->
bdaddr
)))
{
if
(
!
(
e
=
hci_inquiry_cache_lookup
(
hdev
,
&
data
->
bdaddr
)))
{
/* Entry not in the cache. Add new one. */
if
(
!
(
e
=
kmalloc
(
sizeof
(
struct
inquiry_entry
),
GFP_ATOMIC
)))
return
;
...
...
@@ -334,7 +334,7 @@ void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_info *info)
cache
->
list
=
e
;
}
memcpy
(
&
e
->
info
,
info
,
sizeof
(
*
info
));
memcpy
(
&
e
->
data
,
data
,
sizeof
(
*
data
));
e
->
timestamp
=
jiffies
;
cache
->
timestamp
=
jiffies
;
}
...
...
@@ -346,8 +346,16 @@ static int inquiry_cache_dump(struct hci_dev *hdev, int num, __u8 *buf)
struct
inquiry_entry
*
e
;
int
copied
=
0
;
for
(
e
=
cache
->
list
;
e
&&
copied
<
num
;
e
=
e
->
next
,
copied
++
)
memcpy
(
info
++
,
&
e
->
info
,
sizeof
(
*
info
));
for
(
e
=
cache
->
list
;
e
&&
copied
<
num
;
e
=
e
->
next
,
copied
++
)
{
struct
inquiry_data
*
data
=
&
e
->
data
;
bacpy
(
&
info
->
bdaddr
,
&
data
->
bdaddr
);
info
->
pscan_rep_mode
=
data
->
pscan_rep_mode
;
info
->
pscan_period_mode
=
data
->
pscan_period_mode
;
info
->
pscan_mode
=
data
->
pscan_mode
;
memcpy
(
info
->
dev_class
,
data
->
dev_class
,
3
);
info
->
clock_offset
=
data
->
clock_offset
;
info
++
;
}
BT_DBG
(
"cache %p, copied %d"
,
cache
,
copied
);
return
copied
;
...
...
net/bluetooth/hci_event.c
View file @
c09db0b2
...
...
@@ -491,8 +491,18 @@ static inline void hci_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff *
BT_DBG
(
"%s num_rsp %d"
,
hdev
->
name
,
num_rsp
);
hci_dev_lock
(
hdev
);
for
(;
num_rsp
;
num_rsp
--
)
hci_inquiry_cache_update
(
hdev
,
info
++
);
for
(;
num_rsp
;
num_rsp
--
)
{
struct
inquiry_data
data
;
bacpy
(
&
data
.
bdaddr
,
&
info
->
bdaddr
);
data
.
pscan_rep_mode
=
info
->
pscan_rep_mode
;
data
.
pscan_period_mode
=
info
->
pscan_period_mode
;
data
.
pscan_mode
=
info
->
pscan_mode
;
memcpy
(
data
.
dev_class
,
info
->
dev_class
,
3
);
data
.
clock_offset
=
info
->
clock_offset
;
data
.
rssi
=
0x00
;
info
++
;
hci_inquiry_cache_update
(
hdev
,
&
data
);
}
hci_dev_unlock
(
hdev
);
}
...
...
@@ -506,15 +516,16 @@ static inline void hci_inquiry_result_with_rssi_evt(struct hci_dev *hdev, struct
hci_dev_lock
(
hdev
);
for
(;
num_rsp
;
num_rsp
--
)
{
struct
inquiry_info
tmp
;
bacpy
(
&
tmp
.
bdaddr
,
&
info
->
bdaddr
);
tmp
.
pscan_rep_mode
=
info
->
pscan_rep_mode
;
tmp
.
pscan_period_mode
=
info
->
pscan_period_mode
;
tmp
.
pscan_mode
=
0x00
;
memcpy
(
tmp
.
dev_class
,
&
info
->
dev_class
,
3
);
tmp
.
clock_offset
=
info
->
clock_offset
;
struct
inquiry_data
data
;
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
,
&
tmp
);
hci_inquiry_cache_update
(
hdev
,
&
data
);
}
hci_dev_unlock
(
hdev
);
}
...
...
@@ -544,6 +555,7 @@ static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *sk
return
;
}
}
memcpy
(
conn
->
dev_class
,
ev
->
dev_class
,
3
);
conn
->
state
=
BT_CONNECT
;
hci_dev_unlock
(
hdev
);
...
...
net/bluetooth/hci_sysfs.c
View file @
c09db0b2
...
...
@@ -48,14 +48,14 @@ static ssize_t show_inquiry_cache(struct class_device *cdev, char *buf)
hci_dev_lock_bh
(
hdev
);
for
(
e
=
cache
->
list
;
e
;
e
=
e
->
next
)
{
struct
inquiry_
info
*
info
=
&
e
->
info
;
struct
inquiry_
data
*
data
=
&
e
->
data
;
bdaddr_t
bdaddr
;
baswap
(
&
bdaddr
,
&
info
->
bdaddr
);
n
+=
sprintf
(
buf
+
n
,
"%s %d %d %d 0x%.2x%.2x%.2x 0x%.4x
0x%.2x
%u
\n
"
,
baswap
(
&
bdaddr
,
&
data
->
bdaddr
);
n
+=
sprintf
(
buf
+
n
,
"%s %d %d %d 0x%.2x%.2x%.2x 0x%.4x
%d
%u
\n
"
,
batostr
(
&
bdaddr
),
info
->
pscan_rep_mode
,
info
->
pscan_period_mode
,
info
->
pscan_mode
,
info
->
dev_class
[
2
],
info
->
dev_class
[
1
],
info
->
dev_class
[
0
],
info
->
clock_offset
,
0
,
e
->
timestamp
);
data
->
pscan_rep_mode
,
data
->
pscan_period_mode
,
data
->
pscan_mode
,
data
->
dev_class
[
2
],
data
->
dev_class
[
1
],
data
->
dev_class
[
0
],
data
->
clock_offset
,
data
->
rssi
,
e
->
timestamp
);
}
hci_dev_unlock_bh
(
hdev
);
...
...
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