]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/wireless/ath/wcn36xx/smd.c
wcn36xx: Implement print_reg indication
[karo-tx-linux.git] / drivers / net / wireless / ath / wcn36xx / smd.c
index 87a62eb6228cab3352e79f166e5824e5f478426e..28d6ca0ca8199290f6b96482cc3427198624fd50 100644 (file)
@@ -2109,6 +2109,30 @@ static int wcn36xx_smd_delete_sta_context_ind(struct wcn36xx *wcn,
        return -ENOENT;
 }
 
+static int wcn36xx_smd_print_reg_info_ind(struct wcn36xx *wcn,
+                                         void *buf,
+                                         size_t len)
+{
+       struct wcn36xx_hal_print_reg_info_ind *rsp = buf;
+       int i;
+
+       if (len < sizeof(*rsp)) {
+               wcn36xx_warn("Corrupted print reg info indication\n");
+               return -EIO;
+       }
+
+       wcn36xx_dbg(WCN36XX_DBG_HAL,
+                   "reginfo indication, scenario: 0x%x reason: 0x%x\n",
+                   rsp->scenario, rsp->reason);
+
+       for (i = 0; i < rsp->count; i++) {
+               wcn36xx_dbg(WCN36XX_DBG_HAL, "\t0x%x: 0x%x\n",
+                           rsp->regs[i].addr, rsp->regs[i].value);
+       }
+
+       return 0;
+}
+
 int wcn36xx_smd_update_cfg(struct wcn36xx *wcn, u32 cfg_id, u32 value)
 {
        struct wcn36xx_hal_update_cfg_req_msg msg_body, *body;
@@ -2238,6 +2262,7 @@ int wcn36xx_smd_rsp_process(struct qcom_smd_channel *channel,
        case WCN36XX_HAL_OTA_TX_COMPL_IND:
        case WCN36XX_HAL_MISSED_BEACON_IND:
        case WCN36XX_HAL_DELETE_STA_CONTEXT_IND:
+       case WCN36XX_HAL_PRINT_REG_INFO_IND:
                msg_ind = kmalloc(sizeof(*msg_ind) + len, GFP_ATOMIC);
                if (!msg_ind) {
                        /*
@@ -2300,6 +2325,11 @@ static void wcn36xx_ind_smd_work(struct work_struct *work)
                                                   hal_ind_msg->msg,
                                                   hal_ind_msg->msg_len);
                break;
+       case WCN36XX_HAL_PRINT_REG_INFO_IND:
+               wcn36xx_smd_print_reg_info_ind(wcn,
+                                              hal_ind_msg->msg,
+                                              hal_ind_msg->msg_len);
+               break;
        default:
                wcn36xx_err("SMD_EVENT (%d) not supported\n",
                              msg_header->msg_type);