btfmcodec: Enable Dynamic logging

This change will enable dynamic logging based on below
flags
Below bit has to be set to enable respective logging.
 * Bit 0: Error message.
 * Bit 1: Warning message.
 * Bit 2: Debug message.
 * Bit 3: Info message.
 * 0x08 is similar to 0x0F.
 * 0x04 is similar to 0x07.
 * 0x02 is similar to 0x03.
 * 0x03 is default log level for BTFM Codec.

Change-Id: Ia986a49f73d6144f2631936b8d02985d3ccf98d0
Signed-off-by: Balakrishna Godavarthi <quic_bgodavar@quicinc.com>
This commit is contained in:
Balakrishna Godavarthi
2023-06-20 20:46:07 +05:30
committed by Gerrit - the friendly Code Review server
parent c49fc215ed
commit 8998587891
3 changed files with 37 additions and 10 deletions

View File

@@ -23,6 +23,7 @@ static dev_t dev_major;
struct btfmcodec_data *btfmcodec;
struct device_driver driver = {.name = "btfmcodec-driver", .owner = THIS_MODULE};
struct btfmcodec_char_device *btfmcodec_dev;
#define cdev_to_btfmchardev(_cdev) container_of(_cdev, struct btfmcodec_char_device, cdev)
#define MIN_PKT_LEN 0x9
@@ -214,6 +215,16 @@ static void btfmcodec_dev_rxwork(struct work_struct *work)
status);
wake_up_interruptible(&btfmcodec_dev->rsp_wait_q[idx]);
break;
case BTM_BTFMCODEC_CTRL_LOG_LVL_IND:
if (len == BTM_LOG_LVL_IND_LEN) {
log_lvl = skb->data[0];
} else {
BTFMCODEC_ERR("wrong packet format with len:%d", len);
}
BTFMCODEC_INFO("Rx BTM_BTFMCODEC_CTRL_LOG_LVL_IND status:%d",
log_lvl);
wake_up_interruptible(&btfmcodec_dev->rsp_wait_q[idx]);
break;
default:
BTFMCODEC_ERR("wrong opcode:%08x", opcode);
}