diff options
author | Ulisses Furquim <ulisses@profusion.mobi> | 2011-12-21 07:11:33 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-22 11:07:29 -0500 |
commit | 686ebf283ba19f82abd8aaec023cd124749be9ec (patch) | |
tree | 9d10d8bc79779756dd8833a2c6ef8d5ad019ac81 /net/bluetooth/sco.c | |
parent | 68a8aea45973c8d0bc05f58389ce9e82e04bb5f6 (diff) |
Bluetooth: Make HCI call directly into SCO and L2CAP event functions
The struct hci_proto and all related register/unregister and dispatching
code was removed. HCI core code now call directly the SCO and L2CAP
event functions.
Signed-off-by: Ulisses Furquim <ulisses@profusion.mobi>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/sco.c')
-rw-r--r-- | net/bluetooth/sco.c | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 725e10d487f2..0d59e61d7822 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
@@ -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 | ||