aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2012-11-29 10:46:06 -0500
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-12-03 13:00:00 -0500
commit60918918a9f3455859a4be0d4e381003cbdb843f (patch)
treed3ad13bb999fbd27225b0eafba33b2dfbf7a4e29 /net/bluetooth
parent5d05416e0907b0dd30b62b002bed3b85e6efbd61 (diff)
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>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/l2cap_core.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index d8cffdbf0d37..d22d183ddd45 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -3106,18 +3106,17 @@ done:
3106 if (test_bit(FLAG_EFS_ENABLE, &chan->flags)) 3106 if (test_bit(FLAG_EFS_ENABLE, &chan->flags))
3107 l2cap_add_opt_efs(&ptr, chan); 3107 l2cap_add_opt_efs(&ptr, chan);
3108 3108
3109 if (!(chan->conn->feat_mask & L2CAP_FEAT_FCS))
3110 break;
3111
3112 if (chan->fcs == L2CAP_FCS_NONE ||
3113 test_bit(CONF_NO_FCS_RECV, &chan->conf_state)) {
3114 chan->fcs = L2CAP_FCS_NONE;
3115 l2cap_add_conf_opt(&ptr, L2CAP_CONF_FCS, 1, chan->fcs);
3116 }
3117
3118 if (test_bit(FLAG_EXT_CTRL, &chan->flags)) 3109 if (test_bit(FLAG_EXT_CTRL, &chan->flags))
3119 l2cap_add_conf_opt(&ptr, L2CAP_CONF_EWS, 2, 3110 l2cap_add_conf_opt(&ptr, L2CAP_CONF_EWS, 2,
3120 chan->tx_win); 3111 chan->tx_win);
3112
3113 if (chan->conn->feat_mask & L2CAP_FEAT_FCS)
3114 if (chan->fcs == L2CAP_FCS_NONE ||
3115 test_bit(CONF_NO_FCS_RECV, &chan->conf_state)) {
3116 chan->fcs = L2CAP_FCS_NONE;
3117 l2cap_add_conf_opt(&ptr, L2CAP_CONF_FCS, 1,
3118 chan->fcs);
3119 }
3121 break; 3120 break;
3122 3121
3123 case L2CAP_MODE_STREAMING: 3122 case L2CAP_MODE_STREAMING:
@@ -3139,14 +3138,13 @@ done:
3139 if (test_bit(FLAG_EFS_ENABLE, &chan->flags)) 3138 if (test_bit(FLAG_EFS_ENABLE, &chan->flags))
3140 l2cap_add_opt_efs(&ptr, chan); 3139 l2cap_add_opt_efs(&ptr, chan);
3141 3140
3142 if (!(chan->conn->feat_mask & L2CAP_FEAT_FCS)) 3141 if (chan->conn->feat_mask & L2CAP_FEAT_FCS)
3143 break; 3142 if (chan->fcs == L2CAP_FCS_NONE ||
3144 3143 test_bit(CONF_NO_FCS_RECV, &chan->conf_state)) {
3145 if (chan->fcs == L2CAP_FCS_NONE || 3144 chan->fcs = L2CAP_FCS_NONE;
3146 test_bit(CONF_NO_FCS_RECV, &chan->conf_state)) { 3145 l2cap_add_conf_opt(&ptr, L2CAP_CONF_FCS, 1,
3147 chan->fcs = L2CAP_FCS_NONE; 3146 chan->fcs);
3148 l2cap_add_conf_opt(&ptr, L2CAP_CONF_FCS, 1, chan->fcs); 3147 }
3149 }
3150 break; 3148 break;
3151 } 3149 }
3152 3150