mirror of https://gitee.com/openkylin/linux.git
Bluetooth: Fix missing L2CAP EWS Conf parameter
If L2CAP_FEAT_FCS is not supported we sould miss EWS option configuration because of break. Make code more readable by combining FCS configuration in the single block. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
This commit is contained in:
parent
5d05416e09
commit
60918918a9
|
@ -3106,18 +3106,17 @@ static int l2cap_build_conf_req(struct l2cap_chan *chan, void *data)
|
||||||
if (test_bit(FLAG_EFS_ENABLE, &chan->flags))
|
if (test_bit(FLAG_EFS_ENABLE, &chan->flags))
|
||||||
l2cap_add_opt_efs(&ptr, chan);
|
l2cap_add_opt_efs(&ptr, chan);
|
||||||
|
|
||||||
if (!(chan->conn->feat_mask & L2CAP_FEAT_FCS))
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (chan->fcs == L2CAP_FCS_NONE ||
|
|
||||||
test_bit(CONF_NO_FCS_RECV, &chan->conf_state)) {
|
|
||||||
chan->fcs = L2CAP_FCS_NONE;
|
|
||||||
l2cap_add_conf_opt(&ptr, L2CAP_CONF_FCS, 1, chan->fcs);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (test_bit(FLAG_EXT_CTRL, &chan->flags))
|
if (test_bit(FLAG_EXT_CTRL, &chan->flags))
|
||||||
l2cap_add_conf_opt(&ptr, L2CAP_CONF_EWS, 2,
|
l2cap_add_conf_opt(&ptr, L2CAP_CONF_EWS, 2,
|
||||||
chan->tx_win);
|
chan->tx_win);
|
||||||
|
|
||||||
|
if (chan->conn->feat_mask & L2CAP_FEAT_FCS)
|
||||||
|
if (chan->fcs == L2CAP_FCS_NONE ||
|
||||||
|
test_bit(CONF_NO_FCS_RECV, &chan->conf_state)) {
|
||||||
|
chan->fcs = L2CAP_FCS_NONE;
|
||||||
|
l2cap_add_conf_opt(&ptr, L2CAP_CONF_FCS, 1,
|
||||||
|
chan->fcs);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case L2CAP_MODE_STREAMING:
|
case L2CAP_MODE_STREAMING:
|
||||||
|
@ -3139,14 +3138,13 @@ static int l2cap_build_conf_req(struct l2cap_chan *chan, void *data)
|
||||||
if (test_bit(FLAG_EFS_ENABLE, &chan->flags))
|
if (test_bit(FLAG_EFS_ENABLE, &chan->flags))
|
||||||
l2cap_add_opt_efs(&ptr, chan);
|
l2cap_add_opt_efs(&ptr, chan);
|
||||||
|
|
||||||
if (!(chan->conn->feat_mask & L2CAP_FEAT_FCS))
|
if (chan->conn->feat_mask & L2CAP_FEAT_FCS)
|
||||||
break;
|
if (chan->fcs == L2CAP_FCS_NONE ||
|
||||||
|
test_bit(CONF_NO_FCS_RECV, &chan->conf_state)) {
|
||||||
if (chan->fcs == L2CAP_FCS_NONE ||
|
chan->fcs = L2CAP_FCS_NONE;
|
||||||
test_bit(CONF_NO_FCS_RECV, &chan->conf_state)) {
|
l2cap_add_conf_opt(&ptr, L2CAP_CONF_FCS, 1,
|
||||||
chan->fcs = L2CAP_FCS_NONE;
|
chan->fcs);
|
||||||
l2cap_add_conf_opt(&ptr, L2CAP_CONF_FCS, 1, chan->fcs);
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue