nimble/ll: Always send hci_cs for unknown command
Core 5.3, Vol 4, Part E, 4.5 states that sending hci_cc vs. hci_cs is
vendor specific so we always send hci_cs for all commands since we
already do this for LE commands.
@@ -1266,11 +1266,8 @@ ble_ll_hci_le_cmd_proc(const uint8_t *cmdbuf, uint8_t len, uint16_t ocf,
* This code is here because we add 256 to the return code to denote
* that the reply to this command should be command status (as opposed to
* command complete).
- *
- * For unknown HCI command let us return always command status as per
- * specification Bluetooth 5, Vol. 2, Chapter 4.4
*/
- if (ble_ll_hci_le_cmd_send_cmd_status(ocf) || rc == BLE_ERR_UNKNOWN_HCI_CMD) {
+ if (ble_ll_hci_le_cmd_send_cmd_status(ocf)) {
rc += (BLE_ERR_MAX + 1);
}
@@ -1602,6 +1599,13 @@ ble_ll_hci_cmd_proc(struct ble_npl_event *ev)
break;
}
+ /* We always send command status for unknown command
+ * ref: Core 5.3, Vol 4, Part E, 4.5
+ */
+ if (rc == BLE_ERR_UNKNOWN_HCI_CMD) {
+ rc += (BLE_ERR_MAX + 1);
+ }
+
/* If no response is generated, we free the buffers */
BLE_LL_ASSERT(rc >= 0);
if (rc <= BLE_ERR_MAX) {
