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
nexedi
linux
Commits
1a6fe614
Commit
1a6fe614
authored
May 09, 2003
by
Maksim Krasnyanskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bluetooth] RFCOMM must wait for MSC exchange to complete before sending data.
parent
ca619c62
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
include/net/bluetooth/rfcomm.h
include/net/bluetooth/rfcomm.h
+7
-2
net/bluetooth/rfcomm/core.c
net/bluetooth/rfcomm/core.c
+11
-5
No files found.
include/net/bluetooth/rfcomm.h
View file @
1a6fe614
...
...
@@ -186,10 +186,10 @@ struct rfcomm_dlc {
u8
dlci
;
u8
addr
;
u8
priority
;
uint
mtu
;
u8
v24_sig
;
u8
mscex
;
uint
mtu
;
uint
credits
;
uint
rx_credits
;
uint
tx_credits
;
...
...
@@ -214,6 +214,11 @@ struct rfcomm_dlc {
#define RFCOMM_SCHED_TIMEO 3
#define RFCOMM_SCHED_WAKEUP 31
/* MSC exchange flags */
#define RFCOMM_MSCEX_TX 1
#define RFCOMM_MSCEX_RX 2
#define RFCOMM_MSCEX_OK (RFCOMM_MSCEX_TX + RFCOMM_MSCEX_RX)
extern
struct
task_struct
*
rfcomm_thread
;
extern
unsigned
long
rfcomm_event
;
...
...
net/bluetooth/rfcomm/core.c
View file @
1a6fe614
...
...
@@ -203,6 +203,7 @@ static void rfcomm_dlc_clear_state(struct rfcomm_dlc *d)
d
->
state
=
BT_OPEN
;
d
->
flags
=
0
;
d
->
mscex
=
0
;
d
->
mtu
=
RFCOMM_DEFAULT_MTU
;
d
->
v24_sig
=
RFCOMM_V24_RTC
|
RFCOMM_V24_RTR
|
RFCOMM_V24_DV
;
...
...
@@ -1288,11 +1289,11 @@ static int rfcomm_recv_msc(struct rfcomm_session *s, int cr, struct sk_buff *skb
BT_DBG
(
"dlci %d cr %d v24 0x%x"
,
dlci
,
cr
,
msc
->
v24_sig
);
if
(
!
cr
)
d
=
rfcomm_dlc_get
(
s
,
dlci
);
if
(
!
d
)
return
0
;
d
=
rfcomm_dlc_get
(
s
,
dlci
);
if
(
d
)
{
if
(
cr
)
{
if
(
msc
->
v24_sig
&
RFCOMM_V24_FC
&&
!
d
->
credits
)
set_bit
(
RFCOMM_TX_THROTTLED
,
&
d
->
flags
);
else
...
...
@@ -1304,7 +1305,11 @@ static int rfcomm_recv_msc(struct rfcomm_session *s, int cr, struct sk_buff *skb
rfcomm_dlc_unlock
(
d
);
rfcomm_send_msc
(
s
,
0
,
dlci
,
msc
->
v24_sig
);
}
d
->
mscex
|=
RFCOMM_MSCEX_RX
;
}
else
d
->
mscex
|=
RFCOMM_MSCEX_TX
;
return
0
;
}
...
...
@@ -1528,7 +1533,8 @@ static inline void rfcomm_process_dlcs(struct rfcomm_session *s)
continue
;
}
if
(
d
->
state
==
BT_CONNECTED
||
d
->
state
==
BT_DISCONN
)
if
((
d
->
state
==
BT_CONNECTED
||
d
->
state
==
BT_DISCONN
)
&&
d
->
mscex
==
RFCOMM_MSCEX_OK
)
rfcomm_process_tx
(
d
);
}
}
...
...
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