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
b5578b5e
Commit
b5578b5e
authored
Jul 26, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Jul 26, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] bluetooth annotations
Signed-off-by:
Linus Torvalds
<
torvalds@osdl.org
>
parent
eb0296b9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
57 deletions
+28
-57
net/bluetooth/bnep/bnep.h
net/bluetooth/bnep/bnep.h
+1
-1
net/bluetooth/bnep/core.c
net/bluetooth/bnep/core.c
+8
-14
net/bluetooth/cmtp/core.c
net/bluetooth/cmtp/core.c
+2
-6
net/bluetooth/hidp/core.c
net/bluetooth/hidp/core.c
+2
-6
net/bluetooth/rfcomm/core.c
net/bluetooth/rfcomm/core.c
+15
-30
No files found.
net/bluetooth/bnep/bnep.h
View file @
b5578b5e
...
@@ -139,7 +139,7 @@ struct bnep_conninfo {
...
@@ -139,7 +139,7 @@ struct bnep_conninfo {
struct
bnep_connlist_req
{
struct
bnep_connlist_req
{
__u32
cnum
;
__u32
cnum
;
struct
bnep_conninfo
*
ci
;
struct
bnep_conninfo
__user
*
ci
;
};
};
struct
bnep_proto_filter
{
struct
bnep_proto_filter
{
...
...
net/bluetooth/bnep/core.c
View file @
b5578b5e
...
@@ -99,11 +99,9 @@ static void __bnep_unlink_session(struct bnep_session *s)
...
@@ -99,11 +99,9 @@ static void __bnep_unlink_session(struct bnep_session *s)
static
int
bnep_send
(
struct
bnep_session
*
s
,
void
*
data
,
size_t
len
)
static
int
bnep_send
(
struct
bnep_session
*
s
,
void
*
data
,
size_t
len
)
{
{
struct
socket
*
sock
=
s
->
sock
;
struct
socket
*
sock
=
s
->
sock
;
struct
io
vec
iv
=
{
data
,
len
};
struct
k
vec
iv
=
{
data
,
len
};
s
->
msg
.
msg_iov
=
&
iv
;
return
kernel_sendmsg
(
sock
,
&
s
->
msg
,
&
iv
,
1
,
len
);
s
->
msg
.
msg_iovlen
=
1
;
return
sock_sendmsg
(
sock
,
&
s
->
msg
,
len
);
}
}
static
int
bnep_send_rsp
(
struct
bnep_session
*
s
,
u8
ctrl
,
u16
resp
)
static
int
bnep_send_rsp
(
struct
bnep_session
*
s
,
u8
ctrl
,
u16
resp
)
...
@@ -389,7 +387,7 @@ static inline int bnep_tx_frame(struct bnep_session *s, struct sk_buff *skb)
...
@@ -389,7 +387,7 @@ static inline int bnep_tx_frame(struct bnep_session *s, struct sk_buff *skb)
{
{
struct
ethhdr
*
eh
=
(
void
*
)
skb
->
data
;
struct
ethhdr
*
eh
=
(
void
*
)
skb
->
data
;
struct
socket
*
sock
=
s
->
sock
;
struct
socket
*
sock
=
s
->
sock
;
struct
io
vec
iv
[
3
];
struct
k
vec
iv
[
3
];
int
len
=
0
,
il
=
0
;
int
len
=
0
,
il
=
0
;
u8
type
=
0
;
u8
type
=
0
;
...
@@ -400,7 +398,7 @@ static inline int bnep_tx_frame(struct bnep_session *s, struct sk_buff *skb)
...
@@ -400,7 +398,7 @@ static inline int bnep_tx_frame(struct bnep_session *s, struct sk_buff *skb)
goto
send
;
goto
send
;
}
}
iv
[
il
++
]
=
(
struct
io
vec
)
{
&
type
,
1
};
iv
[
il
++
]
=
(
struct
k
vec
)
{
&
type
,
1
};
len
++
;
len
++
;
if
(
!
memcmp
(
eh
->
h_dest
,
s
->
eh
.
h_source
,
ETH_ALEN
))
if
(
!
memcmp
(
eh
->
h_dest
,
s
->
eh
.
h_source
,
ETH_ALEN
))
...
@@ -415,25 +413,23 @@ static inline int bnep_tx_frame(struct bnep_session *s, struct sk_buff *skb)
...
@@ -415,25 +413,23 @@ static inline int bnep_tx_frame(struct bnep_session *s, struct sk_buff *skb)
type
=
__bnep_tx_types
[
type
];
type
=
__bnep_tx_types
[
type
];
switch
(
type
)
{
switch
(
type
)
{
case
BNEP_COMPRESSED_SRC_ONLY
:
case
BNEP_COMPRESSED_SRC_ONLY
:
iv
[
il
++
]
=
(
struct
io
vec
)
{
eh
->
h_source
,
ETH_ALEN
};
iv
[
il
++
]
=
(
struct
k
vec
)
{
eh
->
h_source
,
ETH_ALEN
};
len
+=
ETH_ALEN
;
len
+=
ETH_ALEN
;
break
;
break
;
case
BNEP_COMPRESSED_DST_ONLY
:
case
BNEP_COMPRESSED_DST_ONLY
:
iv
[
il
++
]
=
(
struct
io
vec
)
{
eh
->
h_dest
,
ETH_ALEN
};
iv
[
il
++
]
=
(
struct
k
vec
)
{
eh
->
h_dest
,
ETH_ALEN
};
len
+=
ETH_ALEN
;
len
+=
ETH_ALEN
;
break
;
break
;
}
}
send:
send:
iv
[
il
++
]
=
(
struct
io
vec
)
{
skb
->
data
,
skb
->
len
};
iv
[
il
++
]
=
(
struct
k
vec
)
{
skb
->
data
,
skb
->
len
};
len
+=
skb
->
len
;
len
+=
skb
->
len
;
/* FIXME: linearize skb */
/* FIXME: linearize skb */
{
{
s
->
msg
.
msg_iov
=
iv
;
len
=
kernel_sendmsg
(
sock
,
&
s
->
msg
,
iv
,
il
,
len
);
s
->
msg
.
msg_iovlen
=
il
;
len
=
sock_sendmsg
(
sock
,
&
s
->
msg
,
len
);
}
}
kfree_skb
(
skb
);
kfree_skb
(
skb
);
...
@@ -460,8 +456,6 @@ static int bnep_session(void *arg)
...
@@ -460,8 +456,6 @@ static int bnep_session(void *arg)
set_user_nice
(
current
,
-
15
);
set_user_nice
(
current
,
-
15
);
current
->
flags
|=
PF_NOFREEZE
;
current
->
flags
|=
PF_NOFREEZE
;
set_fs
(
KERNEL_DS
);
init_waitqueue_entry
(
&
wait
,
current
);
init_waitqueue_entry
(
&
wait
,
current
);
add_wait_queue
(
sk
->
sk_sleep
,
&
wait
);
add_wait_queue
(
sk
->
sk_sleep
,
&
wait
);
while
(
!
atomic_read
(
&
s
->
killed
))
{
while
(
!
atomic_read
(
&
s
->
killed
))
{
...
...
net/bluetooth/cmtp/core.c
View file @
b5578b5e
...
@@ -201,7 +201,7 @@ static inline int cmtp_recv_frame(struct cmtp_session *session, struct sk_buff *
...
@@ -201,7 +201,7 @@ static inline int cmtp_recv_frame(struct cmtp_session *session, struct sk_buff *
static
int
cmtp_send_frame
(
struct
cmtp_session
*
session
,
unsigned
char
*
data
,
int
len
)
static
int
cmtp_send_frame
(
struct
cmtp_session
*
session
,
unsigned
char
*
data
,
int
len
)
{
{
struct
socket
*
sock
=
session
->
sock
;
struct
socket
*
sock
=
session
->
sock
;
struct
io
vec
iv
=
{
data
,
len
};
struct
k
vec
iv
=
{
data
,
len
};
struct
msghdr
msg
;
struct
msghdr
msg
;
BT_DBG
(
"session %p data %p len %d"
,
session
,
data
,
len
);
BT_DBG
(
"session %p data %p len %d"
,
session
,
data
,
len
);
...
@@ -210,10 +210,8 @@ static int cmtp_send_frame(struct cmtp_session *session, unsigned char *data, in
...
@@ -210,10 +210,8 @@ static int cmtp_send_frame(struct cmtp_session *session, unsigned char *data, in
return
0
;
return
0
;
memset
(
&
msg
,
0
,
sizeof
(
msg
));
memset
(
&
msg
,
0
,
sizeof
(
msg
));
msg
.
msg_iovlen
=
1
;
msg
.
msg_iov
=
&
iv
;
return
sock_sendmsg
(
sock
,
&
msg
,
len
);
return
kernel_sendmsg
(
sock
,
&
msg
,
&
iv
,
1
,
len
);
}
}
static
int
cmtp_process_transmit
(
struct
cmtp_session
*
session
)
static
int
cmtp_process_transmit
(
struct
cmtp_session
*
session
)
...
@@ -295,8 +293,6 @@ static int cmtp_session(void *arg)
...
@@ -295,8 +293,6 @@ static int cmtp_session(void *arg)
set_user_nice
(
current
,
-
15
);
set_user_nice
(
current
,
-
15
);
current
->
flags
|=
PF_NOFREEZE
;
current
->
flags
|=
PF_NOFREEZE
;
set_fs
(
KERNEL_DS
);
init_waitqueue_entry
(
&
wait
,
current
);
init_waitqueue_entry
(
&
wait
,
current
);
add_wait_queue
(
sk
->
sk_sleep
,
&
wait
);
add_wait_queue
(
sk
->
sk_sleep
,
&
wait
);
while
(
!
atomic_read
(
&
session
->
terminate
))
{
while
(
!
atomic_read
(
&
session
->
terminate
))
{
...
...
net/bluetooth/hidp/core.c
View file @
b5578b5e
...
@@ -274,7 +274,7 @@ static inline int hidp_recv_frame(struct hidp_session *session, struct sk_buff *
...
@@ -274,7 +274,7 @@ static inline int hidp_recv_frame(struct hidp_session *session, struct sk_buff *
static
int
hidp_send_frame
(
struct
socket
*
sock
,
unsigned
char
*
data
,
int
len
)
static
int
hidp_send_frame
(
struct
socket
*
sock
,
unsigned
char
*
data
,
int
len
)
{
{
struct
io
vec
iv
=
{
data
,
len
};
struct
k
vec
iv
=
{
data
,
len
};
struct
msghdr
msg
;
struct
msghdr
msg
;
BT_DBG
(
"sock %p data %p len %d"
,
sock
,
data
,
len
);
BT_DBG
(
"sock %p data %p len %d"
,
sock
,
data
,
len
);
...
@@ -283,10 +283,8 @@ static int hidp_send_frame(struct socket *sock, unsigned char *data, int len)
...
@@ -283,10 +283,8 @@ static int hidp_send_frame(struct socket *sock, unsigned char *data, int len)
return
0
;
return
0
;
memset
(
&
msg
,
0
,
sizeof
(
msg
));
memset
(
&
msg
,
0
,
sizeof
(
msg
));
msg
.
msg_iovlen
=
1
;
msg
.
msg_iov
=
&
iv
;
return
sock_sendmsg
(
sock
,
&
msg
,
len
);
return
kernel_sendmsg
(
sock
,
&
msg
,
&
iv
,
1
,
len
);
}
}
static
int
hidp_process_transmit
(
struct
hidp_session
*
session
)
static
int
hidp_process_transmit
(
struct
hidp_session
*
session
)
...
@@ -340,8 +338,6 @@ static int hidp_session(void *arg)
...
@@ -340,8 +338,6 @@ static int hidp_session(void *arg)
set_user_nice
(
current
,
-
15
);
set_user_nice
(
current
,
-
15
);
current
->
flags
|=
PF_NOFREEZE
;
current
->
flags
|=
PF_NOFREEZE
;
set_fs
(
KERNEL_DS
);
init_waitqueue_entry
(
&
ctrl_wait
,
current
);
init_waitqueue_entry
(
&
ctrl_wait
,
current
);
init_waitqueue_entry
(
&
intr_wait
,
current
);
init_waitqueue_entry
(
&
intr_wait
,
current
);
add_wait_queue
(
ctrl_sk
->
sk_sleep
,
&
ctrl_wait
);
add_wait_queue
(
ctrl_sk
->
sk_sleep
,
&
ctrl_wait
);
...
...
net/bluetooth/rfcomm/core.c
View file @
b5578b5e
...
@@ -323,14 +323,11 @@ static int __rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst,
...
@@ -323,14 +323,11 @@ static int __rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst,
int
rfcomm_dlc_open
(
struct
rfcomm_dlc
*
d
,
bdaddr_t
*
src
,
bdaddr_t
*
dst
,
u8
channel
)
int
rfcomm_dlc_open
(
struct
rfcomm_dlc
*
d
,
bdaddr_t
*
src
,
bdaddr_t
*
dst
,
u8
channel
)
{
{
mm_segment_t
fs
;
int
r
;
int
r
;
rfcomm_lock
();
rfcomm_lock
();
fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
r
=
__rfcomm_dlc_open
(
d
,
src
,
dst
,
channel
);
r
=
__rfcomm_dlc_open
(
d
,
src
,
dst
,
channel
);
set_fs
(
fs
);
rfcomm_unlock
();
rfcomm_unlock
();
return
r
;
return
r
;
...
@@ -376,14 +373,11 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, int err)
...
@@ -376,14 +373,11 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, int err)
int
rfcomm_dlc_close
(
struct
rfcomm_dlc
*
d
,
int
err
)
int
rfcomm_dlc_close
(
struct
rfcomm_dlc
*
d
,
int
err
)
{
{
mm_segment_t
fs
;
int
r
;
int
r
;
rfcomm_lock
();
rfcomm_lock
();
fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
r
=
__rfcomm_dlc_close
(
d
,
err
);
r
=
__rfcomm_dlc_close
(
d
,
err
);
set_fs
(
fs
);
rfcomm_unlock
();
rfcomm_unlock
();
return
r
;
return
r
;
...
@@ -552,9 +546,8 @@ struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst, int *
...
@@ -552,9 +546,8 @@ struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst, int *
{
{
struct
rfcomm_session
*
s
=
NULL
;
struct
rfcomm_session
*
s
=
NULL
;
struct
sockaddr_l2
addr
;
struct
sockaddr_l2
addr
;
struct
l2cap_options
opts
;
struct
socket
*
sock
;
struct
socket
*
sock
;
int
size
;
struct
sock
*
sk
;
BT_DBG
(
"%s %s"
,
batostr
(
src
),
batostr
(
dst
));
BT_DBG
(
"%s %s"
,
batostr
(
src
),
batostr
(
dst
));
...
@@ -570,11 +563,10 @@ struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst, int *
...
@@ -570,11 +563,10 @@ struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst, int *
goto
failed
;
goto
failed
;
/* Set L2CAP options */
/* Set L2CAP options */
size
=
sizeof
(
opts
);
sk
=
sock
->
sk
;
sock
->
ops
->
getsockopt
(
sock
,
SOL_L2CAP
,
L2CAP_OPTIONS
,
(
void
*
)
&
opts
,
&
size
);
lock_sock
(
sk
);
l2cap_pi
(
sk
)
->
imtu
=
RFCOMM_MAX_L2CAP_MTU
;
opts
.
imtu
=
RFCOMM_MAX_L2CAP_MTU
;
release_sock
(
sk
);
sock
->
ops
->
setsockopt
(
sock
,
SOL_L2CAP
,
L2CAP_OPTIONS
,
(
void
*
)
&
opts
,
size
);
s
=
rfcomm_session_add
(
sock
,
BT_BOUND
);
s
=
rfcomm_session_add
(
sock
,
BT_BOUND
);
if
(
!
s
)
{
if
(
!
s
)
{
...
@@ -612,16 +604,14 @@ void rfcomm_session_getaddr(struct rfcomm_session *s, bdaddr_t *src, bdaddr_t *d
...
@@ -612,16 +604,14 @@ void rfcomm_session_getaddr(struct rfcomm_session *s, bdaddr_t *src, bdaddr_t *d
static
int
rfcomm_send_frame
(
struct
rfcomm_session
*
s
,
u8
*
data
,
int
len
)
static
int
rfcomm_send_frame
(
struct
rfcomm_session
*
s
,
u8
*
data
,
int
len
)
{
{
struct
socket
*
sock
=
s
->
sock
;
struct
socket
*
sock
=
s
->
sock
;
struct
io
vec
iv
=
{
data
,
len
};
struct
k
vec
iv
=
{
data
,
len
};
struct
msghdr
msg
;
struct
msghdr
msg
;
BT_DBG
(
"session %p len %d"
,
s
,
len
);
BT_DBG
(
"session %p len %d"
,
s
,
len
);
memset
(
&
msg
,
0
,
sizeof
(
msg
));
memset
(
&
msg
,
0
,
sizeof
(
msg
));
msg
.
msg_iovlen
=
1
;
msg
.
msg_iov
=
&
iv
;
return
sock_sendmsg
(
sock
,
&
msg
,
len
);
return
kernel_sendmsg
(
sock
,
&
msg
,
&
iv
,
1
,
len
);
}
}
static
int
rfcomm_send_sabm
(
struct
rfcomm_session
*
s
,
u8
dlci
)
static
int
rfcomm_send_sabm
(
struct
rfcomm_session
*
s
,
u8
dlci
)
...
@@ -905,7 +895,7 @@ static int rfcomm_send_fcon(struct rfcomm_session *s, int cr)
...
@@ -905,7 +895,7 @@ static int rfcomm_send_fcon(struct rfcomm_session *s, int cr)
static
int
rfcomm_send_test
(
struct
rfcomm_session
*
s
,
int
cr
,
u8
*
pattern
,
int
len
)
static
int
rfcomm_send_test
(
struct
rfcomm_session
*
s
,
int
cr
,
u8
*
pattern
,
int
len
)
{
{
struct
socket
*
sock
=
s
->
sock
;
struct
socket
*
sock
=
s
->
sock
;
struct
io
vec
iv
[
3
];
struct
k
vec
iv
[
3
];
struct
msghdr
msg
;
struct
msghdr
msg
;
unsigned
char
hdr
[
5
],
crc
[
1
];
unsigned
char
hdr
[
5
],
crc
[
1
];
...
@@ -930,10 +920,8 @@ static int rfcomm_send_test(struct rfcomm_session *s, int cr, u8 *pattern, int l
...
@@ -930,10 +920,8 @@ static int rfcomm_send_test(struct rfcomm_session *s, int cr, u8 *pattern, int l
iv
[
2
].
iov_len
=
1
;
iv
[
2
].
iov_len
=
1
;
memset
(
&
msg
,
0
,
sizeof
(
msg
));
memset
(
&
msg
,
0
,
sizeof
(
msg
));
msg
.
msg_iovlen
=
3
;
msg
.
msg_iov
=
iv
;
return
sock_sendmsg
(
sock
,
&
msg
,
6
+
len
);
return
kernel_sendmsg
(
sock
,
&
msg
,
iv
,
3
,
6
+
len
);
}
}
static
int
rfcomm_send_credits
(
struct
rfcomm_session
*
s
,
u8
addr
,
u8
credits
)
static
int
rfcomm_send_credits
(
struct
rfcomm_session
*
s
,
u8
addr
,
u8
credits
)
...
@@ -1749,10 +1737,10 @@ static void rfcomm_worker(void)
...
@@ -1749,10 +1737,10 @@ static void rfcomm_worker(void)
static
int
rfcomm_add_listener
(
bdaddr_t
*
ba
)
static
int
rfcomm_add_listener
(
bdaddr_t
*
ba
)
{
{
struct
sockaddr_l2
addr
;
struct
sockaddr_l2
addr
;
struct
l2cap_options
opts
;
struct
socket
*
sock
;
struct
socket
*
sock
;
struct
sock
*
sk
;
struct
rfcomm_session
*
s
;
struct
rfcomm_session
*
s
;
int
size
,
err
=
0
;
int
err
=
0
;
/* Create socket */
/* Create socket */
err
=
rfcomm_l2sock_create
(
&
sock
);
err
=
rfcomm_l2sock_create
(
&
sock
);
...
@@ -1772,11 +1760,10 @@ static int rfcomm_add_listener(bdaddr_t *ba)
...
@@ -1772,11 +1760,10 @@ static int rfcomm_add_listener(bdaddr_t *ba)
}
}
/* Set L2CAP options */
/* Set L2CAP options */
size
=
sizeof
(
opts
);
sk
=
sock
->
sk
;
sock
->
ops
->
getsockopt
(
sock
,
SOL_L2CAP
,
L2CAP_OPTIONS
,
(
void
*
)
&
opts
,
&
size
);
lock_sock
(
sk
);
l2cap_pi
(
sk
)
->
imtu
=
RFCOMM_MAX_L2CAP_MTU
;
opts
.
imtu
=
RFCOMM_MAX_L2CAP_MTU
;
release_sock
(
sk
);
sock
->
ops
->
setsockopt
(
sock
,
SOL_L2CAP
,
L2CAP_OPTIONS
,
(
void
*
)
&
opts
,
size
);
/* Start listening on the socket */
/* Start listening on the socket */
err
=
sock
->
ops
->
listen
(
sock
,
10
);
err
=
sock
->
ops
->
listen
(
sock
,
10
);
...
@@ -1820,8 +1807,6 @@ static int rfcomm_run(void *unused)
...
@@ -1820,8 +1807,6 @@ static int rfcomm_run(void *unused)
set_user_nice
(
current
,
-
10
);
set_user_nice
(
current
,
-
10
);
current
->
flags
|=
PF_NOFREEZE
;
current
->
flags
|=
PF_NOFREEZE
;
set_fs
(
KERNEL_DS
);
BT_DBG
(
""
);
BT_DBG
(
""
);
rfcomm_add_listener
(
BDADDR_ANY
);
rfcomm_add_listener
(
BDADDR_ANY
);
...
...
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