diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-01-03 15:16:34 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-03 15:16:34 -0500 |
commit | 57adc1fcbae2c13104ce291b40f23e40a414fa87 (patch) | |
tree | a22d95cd3a96cbd515cd24fb0833739576c5e92f /net/bluetooth/sco.c | |
parent | faa85aa24286a9e14ae7cc797352350c3ac39986 (diff) | |
parent | dc0d633e35643662f27a0b1c531da3cd6b204b9c (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Conflicts:
drivers/net/wireless/b43/dma.c
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
Diffstat (limited to 'net/bluetooth/sco.c')
-rw-r--r-- | net/bluetooth/sco.c | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index a0d11b873831..5dc2f2126fac 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
@@ -189,7 +189,7 @@ static int sco_connect(struct sock *sk) | |||
189 | if (!hdev) | 189 | if (!hdev) |
190 | return -EHOSTUNREACH; | 190 | return -EHOSTUNREACH; |
191 | 191 | ||
192 | hci_dev_lock_bh(hdev); | 192 | hci_dev_lock(hdev); |
193 | 193 | ||
194 | if (lmp_esco_capable(hdev) && !disable_esco) | 194 | if (lmp_esco_capable(hdev) && !disable_esco) |
195 | type = ESCO_LINK; | 195 | type = ESCO_LINK; |
@@ -225,7 +225,7 @@ static int sco_connect(struct sock *sk) | |||
225 | } | 225 | } |
226 | 226 | ||
227 | done: | 227 | done: |
228 | hci_dev_unlock_bh(hdev); | 228 | hci_dev_unlock(hdev); |
229 | hci_dev_put(hdev); | 229 | hci_dev_put(hdev); |
230 | return err; | 230 | return err; |
231 | } | 231 | } |
@@ -893,15 +893,12 @@ done: | |||
893 | } | 893 | } |
894 | 894 | ||
895 | /* ----- SCO interface with lower layer (HCI) ----- */ | 895 | /* ----- SCO interface with lower layer (HCI) ----- */ |
896 | static int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type) | 896 | int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr) |
897 | { | 897 | { |
898 | register struct sock *sk; | 898 | register struct sock *sk; |
899 | struct hlist_node *node; | 899 | struct hlist_node *node; |
900 | int lm = 0; | 900 | int lm = 0; |
901 | 901 | ||
902 | if (type != SCO_LINK && type != ESCO_LINK) | ||
903 | return -EINVAL; | ||
904 | |||
905 | BT_DBG("hdev %s, bdaddr %s", hdev->name, batostr(bdaddr)); | 902 | BT_DBG("hdev %s, bdaddr %s", hdev->name, batostr(bdaddr)); |
906 | 903 | ||
907 | /* Find listening sockets */ | 904 | /* Find listening sockets */ |
@@ -921,13 +918,9 @@ static int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type) | |||
921 | return lm; | 918 | return lm; |
922 | } | 919 | } |
923 | 920 | ||
924 | static int sco_connect_cfm(struct hci_conn *hcon, __u8 status) | 921 | int sco_connect_cfm(struct hci_conn *hcon, __u8 status) |
925 | { | 922 | { |
926 | BT_DBG("hcon %p bdaddr %s status %d", hcon, batostr(&hcon->dst), status); | 923 | BT_DBG("hcon %p bdaddr %s status %d", hcon, batostr(&hcon->dst), status); |
927 | |||
928 | if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) | ||
929 | return -EINVAL; | ||
930 | |||
931 | if (!status) { | 924 | if (!status) { |
932 | struct sco_conn *conn; | 925 | struct sco_conn *conn; |
933 | 926 | ||
@@ -940,19 +933,15 @@ static int sco_connect_cfm(struct hci_conn *hcon, __u8 status) | |||
940 | return 0; | 933 | return 0; |
941 | } | 934 | } |
942 | 935 | ||
943 | static int sco_disconn_cfm(struct hci_conn *hcon, __u8 reason) | 936 | int sco_disconn_cfm(struct hci_conn *hcon, __u8 reason) |
944 | { | 937 | { |
945 | BT_DBG("hcon %p reason %d", hcon, reason); | 938 | BT_DBG("hcon %p reason %d", hcon, reason); |
946 | 939 | ||
947 | if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) | ||
948 | return -EINVAL; | ||
949 | |||
950 | sco_conn_del(hcon, bt_to_errno(reason)); | 940 | sco_conn_del(hcon, bt_to_errno(reason)); |
951 | |||
952 | return 0; | 941 | return 0; |
953 | } | 942 | } |
954 | 943 | ||
955 | static int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb) | 944 | int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb) |
956 | { | 945 | { |
957 | struct sco_conn *conn = hcon->sco_data; | 946 | struct sco_conn *conn = hcon->sco_data; |
958 | 947 | ||
@@ -1028,15 +1017,6 @@ static const struct net_proto_family sco_sock_family_ops = { | |||
1028 | .create = sco_sock_create, | 1017 | .create = sco_sock_create, |
1029 | }; | 1018 | }; |
1030 | 1019 | ||
1031 | static struct hci_proto sco_hci_proto = { | ||
1032 | .name = "SCO", | ||
1033 | .id = HCI_PROTO_SCO, | ||
1034 | .connect_ind = sco_connect_ind, | ||
1035 | .connect_cfm = sco_connect_cfm, | ||
1036 | .disconn_cfm = sco_disconn_cfm, | ||
1037 | .recv_scodata = sco_recv_scodata | ||
1038 | }; | ||
1039 | |||
1040 | int __init sco_init(void) | 1020 | int __init sco_init(void) |
1041 | { | 1021 | { |
1042 | int err; | 1022 | int err; |
@@ -1051,13 +1031,6 @@ int __init sco_init(void) | |||
1051 | goto error; | 1031 | goto error; |
1052 | } | 1032 | } |
1053 | 1033 | ||
1054 | err = hci_register_proto(&sco_hci_proto); | ||
1055 | if (err < 0) { | ||
1056 | BT_ERR("SCO protocol registration failed"); | ||
1057 | bt_sock_unregister(BTPROTO_SCO); | ||
1058 | goto error; | ||
1059 | } | ||
1060 | |||
1061 | if (bt_debugfs) { | 1034 | if (bt_debugfs) { |
1062 | sco_debugfs = debugfs_create_file("sco", 0444, | 1035 | sco_debugfs = debugfs_create_file("sco", 0444, |
1063 | bt_debugfs, NULL, &sco_debugfs_fops); | 1036 | bt_debugfs, NULL, &sco_debugfs_fops); |
@@ -1081,9 +1054,6 @@ void __exit sco_exit(void) | |||
1081 | if (bt_sock_unregister(BTPROTO_SCO) < 0) | 1054 | if (bt_sock_unregister(BTPROTO_SCO) < 0) |
1082 | BT_ERR("SCO socket unregistration failed"); | 1055 | BT_ERR("SCO socket unregistration failed"); |
1083 | 1056 | ||
1084 | if (hci_unregister_proto(&sco_hci_proto) < 0) | ||
1085 | BT_ERR("SCO protocol unregistration failed"); | ||
1086 | |||
1087 | proto_unregister(&sco_proto); | 1057 | proto_unregister(&sco_proto); |
1088 | } | 1058 | } |
1089 | 1059 | ||