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
cc25be8d
Commit
cc25be8d
authored
Apr 16, 2003
by
Maksim Krasnyanskiy
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://linux-bt.bkbits.net/marcel-2.5
into qualcomm.com:/home/kernel/bt-2.5
parents
e9424938
55ce9e7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
include/net/bluetooth/rfcomm.h
include/net/bluetooth/rfcomm.h
+5
-0
net/bluetooth/rfcomm/core.c
net/bluetooth/rfcomm/core.c
+51
-0
No files found.
include/net/bluetooth/rfcomm.h
View file @
cc25be8d
...
...
@@ -146,6 +146,11 @@ struct rfcomm_rpn {
u16
param_mask
;
}
__attribute__
((
packed
));
struct
rfcomm_rls
{
u8
dlci
;
u8
status
;
}
__attribute__
((
packed
));
struct
rfcomm_msc
{
u8
dlci
;
u8
v24_sig
;
...
...
net/bluetooth/rfcomm/core.c
View file @
cc25be8d
...
...
@@ -798,6 +798,33 @@ static int rfcomm_send_rpn(struct rfcomm_session *s, int cr, u8 dlci,
return
rfcomm_send_frame
(
s
,
buf
,
ptr
-
buf
);
}
static
int
rfcomm_send_rls
(
struct
rfcomm_session
*
s
,
int
cr
,
u8
dlci
,
u8
status
)
{
struct
rfcomm_hdr
*
hdr
;
struct
rfcomm_mcc
*
mcc
;
struct
rfcomm_rls
*
rls
;
u8
buf
[
16
],
*
ptr
=
buf
;
BT_DBG
(
"%p cr %d status 0x%x"
,
s
,
cr
,
status
);
hdr
=
(
void
*
)
ptr
;
ptr
+=
sizeof
(
*
hdr
);
hdr
->
addr
=
__addr
(
s
->
initiator
,
0
);
hdr
->
ctrl
=
__ctrl
(
RFCOMM_UIH
,
0
);
hdr
->
len
=
__len8
(
sizeof
(
*
mcc
)
+
sizeof
(
*
rls
));
mcc
=
(
void
*
)
ptr
;
ptr
+=
sizeof
(
*
mcc
);
mcc
->
type
=
__mcc_type
(
cr
,
RFCOMM_RLS
);
mcc
->
len
=
__len8
(
sizeof
(
*
rls
));
rls
=
(
void
*
)
ptr
;
ptr
+=
sizeof
(
*
rls
);
rls
->
dlci
=
__addr
(
1
,
dlci
);
rls
->
status
=
status
;
*
ptr
=
__fcs
(
buf
);
ptr
++
;
return
rfcomm_send_frame
(
s
,
buf
,
ptr
-
buf
);
}
static
int
rfcomm_send_msc
(
struct
rfcomm_session
*
s
,
int
cr
,
u8
dlci
,
u8
v24_sig
)
{
struct
rfcomm_hdr
*
hdr
;
...
...
@@ -1229,6 +1256,26 @@ static int rfcomm_recv_rpn(struct rfcomm_session *s, int cr, int len, struct sk_
return
0
;
}
static
int
rfcomm_recv_rls
(
struct
rfcomm_session
*
s
,
int
cr
,
struct
sk_buff
*
skb
)
{
struct
rfcomm_rls
*
rls
=
(
void
*
)
skb
->
data
;
u8
dlci
=
__get_dlci
(
rls
->
dlci
);
BT_DBG
(
"dlci %d cr %d status 0x%x"
,
dlci
,
cr
,
rls
->
status
);
if
(
!
cr
)
return
0
;
/* FIXME: We should probably do something with this
information here. But for now it's sufficient just
to reply -- Bluetooth 1.1 says it's mandatory to
recognise and respond to RLS */
rfcomm_send_rls
(
s
,
0
,
dlci
,
rls
->
status
);
return
0
;
}
static
int
rfcomm_recv_msc
(
struct
rfcomm_session
*
s
,
int
cr
,
struct
sk_buff
*
skb
)
{
struct
rfcomm_msc
*
msc
=
(
void
*
)
skb
->
data
;
...
...
@@ -1279,6 +1326,10 @@ static int rfcomm_recv_mcc(struct rfcomm_session *s, struct sk_buff *skb)
rfcomm_recv_rpn
(
s
,
cr
,
len
,
skb
);
break
;
case
RFCOMM_RLS
:
rfcomm_recv_rls
(
s
,
cr
,
skb
);
break
;
case
RFCOMM_MSC
:
rfcomm_recv_msc
(
s
,
cr
,
skb
);
break
;
...
...
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