Bluetooth: Make l2cap_le_sig_cmd logic consistent
This patch makes the error handling and return logic of l2cap_le_sig_cmd consistent with its BR/EDR counterpart. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
Родитель
3defe01a48
Коммит
b5ecba6422
|
@ -5537,34 +5537,42 @@ static inline int l2cap_le_sig_cmd(struct l2cap_conn *conn,
|
||||||
struct l2cap_cmd_hdr *cmd, u16 cmd_len,
|
struct l2cap_cmd_hdr *cmd, u16 cmd_len,
|
||||||
u8 *data)
|
u8 *data)
|
||||||
{
|
{
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
switch (cmd->code) {
|
switch (cmd->code) {
|
||||||
case L2CAP_COMMAND_REJ:
|
case L2CAP_COMMAND_REJ:
|
||||||
return 0;
|
break;
|
||||||
|
|
||||||
case L2CAP_CONN_PARAM_UPDATE_REQ:
|
case L2CAP_CONN_PARAM_UPDATE_REQ:
|
||||||
return l2cap_conn_param_update_req(conn, cmd, cmd_len, data);
|
err = l2cap_conn_param_update_req(conn, cmd, cmd_len, data);
|
||||||
|
break;
|
||||||
|
|
||||||
case L2CAP_CONN_PARAM_UPDATE_RSP:
|
case L2CAP_CONN_PARAM_UPDATE_RSP:
|
||||||
return 0;
|
break;
|
||||||
|
|
||||||
case L2CAP_LE_CONN_RSP:
|
case L2CAP_LE_CONN_RSP:
|
||||||
l2cap_le_connect_rsp(conn, cmd, cmd_len, data);
|
l2cap_le_connect_rsp(conn, cmd, cmd_len, data);
|
||||||
return 0;
|
break;
|
||||||
|
|
||||||
case L2CAP_LE_CONN_REQ:
|
case L2CAP_LE_CONN_REQ:
|
||||||
return l2cap_le_connect_req(conn, cmd, cmd_len, data);
|
err = l2cap_le_connect_req(conn, cmd, cmd_len, data);
|
||||||
|
break;
|
||||||
|
|
||||||
case L2CAP_DISCONN_REQ:
|
case L2CAP_DISCONN_REQ:
|
||||||
return l2cap_disconnect_req(conn, cmd, cmd_len, data);
|
err = l2cap_disconnect_req(conn, cmd, cmd_len, data);
|
||||||
|
break;
|
||||||
|
|
||||||
case L2CAP_DISCONN_RSP:
|
case L2CAP_DISCONN_RSP:
|
||||||
l2cap_disconnect_rsp(conn, cmd, cmd_len, data);
|
l2cap_disconnect_rsp(conn, cmd, cmd_len, data);
|
||||||
return 0;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BT_ERR("Unknown LE signaling command 0x%2.2x", cmd->code);
|
BT_ERR("Unknown LE signaling command 0x%2.2x", cmd->code);
|
||||||
return -EINVAL;
|
err = -EINVAL;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void l2cap_le_sig_channel(struct l2cap_conn *conn,
|
static inline void l2cap_le_sig_channel(struct l2cap_conn *conn,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче