From ced33653faa23a9895516a228d3496737a7cf22d Mon Sep 17 00:00:00 2001 From: Vinayak Chettimada Date: Sun, 25 Dec 2016 17:28:07 +0100 Subject: [PATCH] Bluetooth: Controller: internally handle unknown rsp for LE Ping Peer controllers not supporting LE Ping feature will respond with unknown response PDU, handle it internally in the controller rather than exposing it to HCI layer. Discovered that controller was passing the unknown rsp PDU to HCI layer when LE Ping was send to Nexus 5. Unknown response for slave feature request was forwarded to HCI layer, during that implementation unknown rsp for LE ping too was getting forwarded to HCI layer. Change-id: I4396c482e5546d78239cf41d88728de996e48d7d Signed-off-by: Vinayak Chettimada --- subsys/bluetooth/controller/ll/ctrl.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/controller/ll/ctrl.c b/subsys/bluetooth/controller/ll/ctrl.c index ceda331108e..a87688f7497 100644 --- a/subsys/bluetooth/controller/ll/ctrl.c +++ b/subsys/bluetooth/controller/ll/ctrl.c @@ -1725,8 +1725,22 @@ isr_rx_conn_pkt_ctrl(struct radio_pdu_node_rx *radio_pdu_node_rx, */ *rx_enqueue = 1; } else { - /* enqueue the error and let HCI handle it */ - *rx_enqueue = 1; + struct pdu_data_llctrl *llctrl; + + llctrl = (struct pdu_data_llctrl *) + &pdu_data_rx->payload.llctrl; + switch (llctrl->ctrldata.unknown_rsp.type) { + case PDU_DATA_LLCTRL_TYPE_PING_REQ: + /* unknown rsp to LE Ping Req completes the + * procedure; nothing to do here. + */ + break; + default: + /* enqueue the error and let HCI handle it */ + *rx_enqueue = 1; + break; + } + /* Procedure complete */ _radio.conn_curr->procedure_expire = 0; }