Commit 5205185d authored by David Herrmann's avatar David Herrmann Committed by Gustavo Padovan

Bluetooth: hidp: remove old session-management

We have the full new session-management now available so lets switch over
and remove all the old code. Few semantics changed, so we need to adjust
the sock.c callers a bit. But this mostly simplifies the logic.
Signed-off-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
parent b4f34d8d
This diff is collapsed.
...@@ -123,8 +123,6 @@ struct hidp_connlist_req { ...@@ -123,8 +123,6 @@ struct hidp_connlist_req {
int hidp_connection_add(struct hidp_connadd_req *req, struct socket *ctrl_sock, struct socket *intr_sock); int hidp_connection_add(struct hidp_connadd_req *req, struct socket *ctrl_sock, struct socket *intr_sock);
int hidp_connection_del(struct hidp_conndel_req *req); int hidp_connection_del(struct hidp_conndel_req *req);
int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock, struct socket *intr_sock);
int hidp_del_connection(struct hidp_conndel_req *req);
int hidp_get_connlist(struct hidp_connlist_req *req); int hidp_get_connlist(struct hidp_connlist_req *req);
int hidp_get_conninfo(struct hidp_conninfo *ci); int hidp_get_conninfo(struct hidp_conninfo *ci);
...@@ -147,7 +145,6 @@ struct hidp_session { ...@@ -147,7 +145,6 @@ struct hidp_session {
/* connection management */ /* connection management */
bdaddr_t bdaddr; bdaddr_t bdaddr;
struct hci_conn *hconn;
struct l2cap_conn *conn; struct l2cap_conn *conn;
struct l2cap_user user; struct l2cap_user user;
struct socket *ctrl_sock; struct socket *ctrl_sock;
...@@ -180,9 +177,6 @@ struct hidp_session { ...@@ -180,9 +177,6 @@ struct hidp_session {
/* Used in hidp_output_raw_report() */ /* Used in hidp_output_raw_report() */
int output_report_success; /* boolean */ int output_report_success; /* boolean */
wait_queue_head_t startup_queue;
int waiting_for_startup;
}; };
/* HIDP init defines */ /* HIDP init defines */
......
...@@ -77,21 +77,12 @@ static int hidp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long ...@@ -77,21 +77,12 @@ static int hidp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
return err; return err;
} }
if (csock->sk->sk_state != BT_CONNECTED || err = hidp_connection_add(&ca, csock, isock);
isock->sk->sk_state != BT_CONNECTED) { if (!err && copy_to_user(argp, &ca, sizeof(ca)))
sockfd_put(csock); err = -EFAULT;
sockfd_put(isock);
return -EBADFD;
}
err = hidp_add_connection(&ca, csock, isock); sockfd_put(csock);
if (!err) { sockfd_put(isock);
if (copy_to_user(argp, &ca, sizeof(ca)))
err = -EFAULT;
} else {
sockfd_put(csock);
sockfd_put(isock);
}
return err; return err;
...@@ -102,7 +93,7 @@ static int hidp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long ...@@ -102,7 +93,7 @@ static int hidp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long
if (copy_from_user(&cd, argp, sizeof(cd))) if (copy_from_user(&cd, argp, sizeof(cd)))
return -EFAULT; return -EFAULT;
return hidp_del_connection(&cd); return hidp_connection_del(&cd);
case HIDPGETCONNLIST: case HIDPGETCONNLIST:
if (copy_from_user(&cl, argp, sizeof(cl))) if (copy_from_user(&cl, argp, sizeof(cl)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment