Browse Source

dfc: Re-send DFC_CONFIG command

Re-send QMAP DFC_CONFIG command if no ack is received upon
first QMAP indication.

Change-Id: I33ec5cbbf3550d1df03ca1dd990bf8ad58ad9582
Acked-by: Weiyi Chen <[email protected]>
Signed-off-by: Subash Abhinov Kasiviswanathan <[email protected]>
Subash Abhinov Kasiviswanathan 5 years ago
parent
commit
45a8e8f2c1
1 changed files with 12 additions and 0 deletions
  1. 12 0
      core/dfc_qmap.c

+ 12 - 0
core/dfc_qmap.c

@@ -127,9 +127,11 @@ static struct dfc_tx_link_status_ind_msg_v01 qmap_tx_ind;
 static struct dfc_qmi_data __rcu *qmap_dfc_data;
 static struct dfc_qmi_data __rcu *qmap_dfc_data;
 static atomic_t qmap_txid;
 static atomic_t qmap_txid;
 static void *rmnet_ctl_handle;
 static void *rmnet_ctl_handle;
+static bool dfc_config_acked;
 
 
 static struct rmnet_ctl_client_if *rmnet_ctl;
 static struct rmnet_ctl_client_if *rmnet_ctl;
 
 
+static void dfc_qmap_send_config(struct dfc_qmi_data *data);
 static void dfc_qmap_send_end_marker_cnf(struct qos_info *qos,
 static void dfc_qmap_send_end_marker_cnf(struct qos_info *qos,
 					 u8 bearer_id, u16 seq, u32 tx_id);
 					 u8 bearer_id, u16 seq, u32 tx_id);
 
 
@@ -319,6 +321,9 @@ static void dfc_qmap_cmd_handler(struct sk_buff *skb)
 		if (cmd->cmd_type != QMAP_CMD_ACK)
 		if (cmd->cmd_type != QMAP_CMD_ACK)
 			goto free_skb;
 			goto free_skb;
 	} else if (cmd->cmd_type != QMAP_CMD_REQUEST) {
 	} else if (cmd->cmd_type != QMAP_CMD_REQUEST) {
+		if (cmd->cmd_type == QMAP_CMD_ACK &&
+		    cmd->cmd_name == QMAP_DFC_CONFIG)
+			dfc_config_acked = true;
 		goto free_skb;
 		goto free_skb;
 	}
 	}
 
 
@@ -330,6 +335,12 @@ static void dfc_qmap_cmd_handler(struct sk_buff *skb)
 		goto free_skb;
 		goto free_skb;
 	}
 	}
 
 
+	/* Re-send DFC config once if needed */
+	if (unlikely(!dfc_config_acked)) {
+		dfc_qmap_send_config(dfc);
+		dfc_config_acked = true;
+	}
+
 	switch (cmd->cmd_name) {
 	switch (cmd->cmd_name) {
 	case QMAP_DFC_IND:
 	case QMAP_DFC_IND:
 		rc = dfc_qmap_handle_ind(dfc, skb);
 		rc = dfc_qmap_handle_ind(dfc, skb);
@@ -520,6 +531,7 @@ int dfc_qmap_client_init(void *port, int index, struct svc_info *psvc,
 
 
 	pr_info("DFC QMAP init\n");
 	pr_info("DFC QMAP init\n");
 
 
+	dfc_config_acked = false;
 	dfc_qmap_send_config(data);
 	dfc_qmap_send_config(data);
 
 
 out:
 out: