Browse Source

qcacmn: Add athdiag support for QCA6290

Add support for athdiag read / write using PLD APIs.

Change-Id: I5ce8a10bb44342427c97c02d1b6d05db026ef78a
CRs-fixed: 2046045
Manikandan Mohan 8 years ago
parent
commit
64c3d8438f
1 changed files with 12 additions and 2 deletions
  1. 12 2
      hif/src/ath_procfs.c

+ 12 - 2
hif/src/ath_procfs.c

@@ -71,6 +71,7 @@ static ssize_t ath_procfs_diag_read(struct file *file, char __user *buf,
 	uint8_t *read_buffer = NULL;
 	struct hif_softc *scn;
 	uint32_t offset = 0, memtype = 0;
+	struct hif_target_info *tgt_info;
 
 	read_buffer = qdf_mem_malloc(count);
 	if (NULL == read_buffer) {
@@ -83,7 +84,11 @@ static ssize_t ath_procfs_diag_read(struct file *file, char __user *buf,
 		 read_buffer, count, (int)*pos, buf);
 
 	scn = HIF_GET_SOFTC(hif_hdl);
-	if (scn->bus_type == QDF_BUS_TYPE_SNOC) {
+	tgt_info = hif_get_target_info_handle(GET_HIF_OPAQUE_HDL(hif_hdl));
+	if (scn->bus_type == QDF_BUS_TYPE_SNOC ||
+			(scn->bus_type ==  QDF_BUS_TYPE_PCI &&
+			 (tgt_info->target_type == TARGET_TYPE_QCA6290 ||
+			  tgt_info->target_type == TARGET_TYPE_QCA8074))) {
 		memtype = ((uint32_t)(*pos) & 0xff000000) >> 24;
 		offset = (uint32_t)(*pos) & 0xffffff;
 		HIF_TRACE("%s: offset 0x%x memtype 0x%x, datalen %zu\n",
@@ -126,6 +131,7 @@ static ssize_t ath_procfs_diag_write(struct file *file,
 	uint8_t *write_buffer = NULL;
 	struct hif_softc *scn;
 	uint32_t offset = 0, memtype = 0;
+	struct hif_target_info *tgt_info;
 
 	write_buffer = qdf_mem_malloc(count);
 	if (NULL == write_buffer) {
@@ -145,7 +151,11 @@ static ssize_t ath_procfs_diag_write(struct file *file,
 		 (int)*pos, *((uint32_t *) write_buffer));
 
 	scn = HIF_GET_SOFTC(hif_hdl);
-	if (scn->bus_type == QDF_BUS_TYPE_SNOC) {
+	tgt_info = hif_get_target_info_handle(GET_HIF_OPAQUE_HDL(hif_hdl));
+	if (scn->bus_type == QDF_BUS_TYPE_SNOC ||
+			(scn->bus_type ==  QDF_BUS_TYPE_PCI &&
+			 (tgt_info->target_type == TARGET_TYPE_QCA6290 ||
+			  tgt_info->target_type == TARGET_TYPE_QCA8074))) {
 		memtype = ((uint32_t)(*pos) & 0xff000000) >> 24;
 		offset = (uint32_t)(*pos) & 0xffffff;
 		HIF_TRACE("%s: offset 0x%x memtype 0x%x, datalen %zu\n",