diff options
author | Gustavo Padovan <gustavo@padovan.org> | 2012-05-16 11:17:10 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-05-16 15:14:17 -0400 |
commit | c5daa683f2d3315cd766f550ef7d88bfca1671f4 (patch) | |
tree | 91a974326357fd923a52818107b8ba99cad1e111 /net/bluetooth/rfcomm/sock.c | |
parent | c6585a4da0c709a7a9f59aab68869298b52ca1e1 (diff) |
Bluetooth: Create flags for bt_sk()
defer_setup and suspended are now flags into bt_sk().
Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/rfcomm/sock.c')
-rw-r--r-- | net/bluetooth/rfcomm/sock.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index a55a43e9f70e..e8707debb864 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c | |||
@@ -260,7 +260,8 @@ static void rfcomm_sock_init(struct sock *sk, struct sock *parent) | |||
260 | 260 | ||
261 | if (parent) { | 261 | if (parent) { |
262 | sk->sk_type = parent->sk_type; | 262 | sk->sk_type = parent->sk_type; |
263 | pi->dlc->defer_setup = bt_sk(parent)->defer_setup; | 263 | pi->dlc->defer_setup = test_bit(BT_SK_DEFER_SETUP, |
264 | &bt_sk(parent)->flags); | ||
264 | 265 | ||
265 | pi->sec_level = rfcomm_pi(parent)->sec_level; | 266 | pi->sec_level = rfcomm_pi(parent)->sec_level; |
266 | pi->role_switch = rfcomm_pi(parent)->role_switch; | 267 | pi->role_switch = rfcomm_pi(parent)->role_switch; |
@@ -731,7 +732,11 @@ static int rfcomm_sock_setsockopt(struct socket *sock, int level, int optname, c | |||
731 | break; | 732 | break; |
732 | } | 733 | } |
733 | 734 | ||
734 | bt_sk(sk)->defer_setup = opt; | 735 | if (opt) |
736 | set_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags); | ||
737 | else | ||
738 | clear_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags); | ||
739 | |||
735 | break; | 740 | break; |
736 | 741 | ||
737 | default: | 742 | default: |
@@ -849,7 +854,8 @@ static int rfcomm_sock_getsockopt(struct socket *sock, int level, int optname, c | |||
849 | break; | 854 | break; |
850 | } | 855 | } |
851 | 856 | ||
852 | if (put_user(bt_sk(sk)->defer_setup, (u32 __user *) optval)) | 857 | if (put_user(test_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags), |
858 | (u32 __user *) optval)) | ||
853 | err = -EFAULT; | 859 | err = -EFAULT; |
854 | 860 | ||
855 | break; | 861 | break; |
@@ -972,7 +978,7 @@ int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc * | |||
972 | done: | 978 | done: |
973 | bh_unlock_sock(parent); | 979 | bh_unlock_sock(parent); |
974 | 980 | ||
975 | if (bt_sk(parent)->defer_setup) | 981 | if (test_bit(BT_SK_DEFER_SETUP, &bt_sk(parent)->flags)) |
976 | parent->sk_state_change(parent); | 982 | parent->sk_state_change(parent); |
977 | 983 | ||
978 | return result; | 984 | return result; |