From 76a75454516831534f740bccf7b18f98753c67e2 Mon Sep 17 00:00:00 2001 From: Siwei Zhang Date: Tue, 13 Oct 2026 11:36:38 -0400 Subject: [PATCH] Bluetooth: L2CAP: Remove dead configuration state code CONF_EWS_RECV has not been set since commit e7b02296fb40 ("Bluetooth: Remove BT_HS"), which made configuration requests with an EWS option be refused. Remove the flag and the branch in l2cap_parse_conf_req() that tests it. A pending connection response no longer needs to set CONF_CONNECT_PEND, as connection responses are only accepted while it is already set. No functional change. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Siwei Zhang Signed-off-by: Luiz Augusto von Dentz --- include/net/bluetooth/l2cap.h | 1 - net/bluetooth/l2cap_core.c | 8 ++------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index efb9b7f422d1..54eddcdd341f 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h @@ -725,7 +725,6 @@ enum { CONF_CONNECT_PEND, CONF_RECV_NO_FCS, CONF_STATE2_DEVICE, - CONF_EWS_RECV, CONF_LOC_CONF_PEND, CONF_REM_CONF_PEND, CONF_NOT_COMPLETE, diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 210d1507af7e..4dd56e0074fd 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -3769,11 +3769,7 @@ static int l2cap_parse_conf_req(struct l2cap_chan *chan, void *data, size_t data rfc.txwin_size = L2CAP_DEFAULT_TX_WINDOW; remote_efs = 0; } else { - if (!test_bit(CONF_EWS_RECV, &chan->conf_state)) - chan->remote_tx_win = rfc.txwin_size; - else - rfc.txwin_size = L2CAP_DEFAULT_TX_WINDOW; - + chan->remote_tx_win = rfc.txwin_size; chan->remote_max_tx = rfc.max_transmit; chan->remote_mps = size; } @@ -4512,7 +4508,7 @@ static int l2cap_connect_create_rsp(struct l2cap_conn *conn, break; case L2CAP_CR_PEND: - set_bit(CONF_CONNECT_PEND, &chan->conf_state); + /* Our request is still outstanding */ break; default: