qcacmn: Support per mac CE for WMI commands

Firmware requires WMI commands to be sent on different copy engine for
each MAC. Change CE assignement to support this.

Change-Id: I91a2422a944741dc25c3bf45b18cde30e7409632
CRs-Fixed: 2005214
This commit is contained in:
Kiran Venkatappa
2017-02-10 16:31:49 +05:30
committed by qcabuildsw
parent e77f653463
commit e17e3b63e0
7 changed files with 295 additions and 111 deletions

View File

@@ -399,6 +399,7 @@ bool ce_get_rx_pending(struct hif_softc *scn);
#define CE_ATTR_SWIZZLE_DESCRIPTORS 0x04 /* Swizzle descriptors? */ #define CE_ATTR_SWIZZLE_DESCRIPTORS 0x04 /* Swizzle descriptors? */
#define CE_ATTR_DISABLE_INTR 0x08 /* no interrupt on copy completion */ #define CE_ATTR_DISABLE_INTR 0x08 /* no interrupt on copy completion */
#define CE_ATTR_ENABLE_POLL 0x10 /* poll for residue descriptors */ #define CE_ATTR_ENABLE_POLL 0x10 /* poll for residue descriptors */
#define CE_ATTR_DIAG 0x20 /* Diag CE */
/* Attributes of an instance of a Copy Engine */ /* Attributes of an instance of a Copy Engine */
struct CE_attr { struct CE_attr {

View File

@@ -76,7 +76,6 @@ static void hif_target_dump_access_log(void);
#define CE_HTT_H2T_MSG_SRC_NENTRIES 2048 #define CE_HTT_H2T_MSG_SRC_NENTRIES 2048
#define CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B 4096 #define CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B 4096
#define DIAG_CE_ID 7
#define EPPING_CE_FLAGS_POLL \ #define EPPING_CE_FLAGS_POLL \
(CE_ATTR_DISABLE_INTR|CE_ATTR_ENABLE_POLL|CE_ATTR_FLAGS) (CE_ATTR_DISABLE_INTR|CE_ATTR_ENABLE_POLL|CE_ATTR_FLAGS)
@@ -84,6 +83,9 @@ static void hif_target_dump_access_log(void);
#define PIPEDIR_INOUT_H2H 4 #define PIPEDIR_INOUT_H2H 4
#endif #endif
#define CE_ATTR_DIAG_FLAGS \
(CE_ATTR_FLAGS | CE_ATTR_DIAG)
#ifdef QCA_WIFI_3_0 #ifdef QCA_WIFI_3_0
static struct CE_attr host_ce_config_wlan[] = { static struct CE_attr host_ce_config_wlan[] = {
/* host->target HTC control and raw streams */ /* host->target HTC control and raw streams */
@@ -103,7 +105,7 @@ static struct CE_attr host_ce_config_wlan[] = {
/* Target autonomous HIF_memcpy */ /* Target autonomous HIF_memcpy */
{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,}, { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
/* ce_diag, the Diagnostic Window */ /* ce_diag, the Diagnostic Window */
{ /* CE7 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0, { /* CE7 */ (CE_ATTR_DIAG_FLAGS | CE_ATTR_DISABLE_INTR) , 0,
2, DIAG_TRANSFER_LIMIT, 2, NULL,}, 2, DIAG_TRANSFER_LIMIT, 2, NULL,},
/* Target to uMC */ /* Target to uMC */
{ /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,}, { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
@@ -162,7 +164,7 @@ static struct CE_attr host_ce_config_wlan_epping_poll[] = {
/* unused */ /* unused */
{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,}, { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
/* ce_diag, the Diagnostic Window */ /* ce_diag, the Diagnostic Window */
{ /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL,}, { /* CE7 */ CE_ATTR_DIAG_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL,},
}; };
static struct CE_attr host_ce_config_wlan_epping_irq[] = { static struct CE_attr host_ce_config_wlan_epping_irq[] = {
@@ -181,7 +183,7 @@ static struct CE_attr host_ce_config_wlan_epping_irq[] = {
/* unused */ /* unused */
{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,}, { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
/* ce_diag, the Diagnostic Window */ /* ce_diag, the Diagnostic Window */
{ /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL,}, { /* CE7 */ CE_ATTR_DIAG_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL,},
}; };
/* /*
* EP-ping firmware's CE configuration * EP-ping firmware's CE configuration
@@ -225,7 +227,7 @@ static struct CE_attr host_ce_config_wlan[] = {
/* Target autonomous HIF_memcpy */ /* Target autonomous HIF_memcpy */
{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,}, { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
/* ce_diag, the Diagnostic Window */ /* ce_diag, the Diagnostic Window */
{ /* CE7 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, { /* CE7 */ (CE_ATTR_DIAG_FLAGS | CE_ATTR_DISABLE_INTR),
0, 2, DIAG_TRANSFER_LIMIT, 2, NULL,}, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL,},
}; };
@@ -267,7 +269,7 @@ static struct CE_attr host_ce_config_wlan_epping_poll[] = {
/* unused */ /* unused */
{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,}, { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
/* ce_diag, the Diagnostic Window */ /* ce_diag, the Diagnostic Window */
{ /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL,}, { /* CE7 */ CE_ATTR_DIAG_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL,},
{ /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,}, { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
/* The following CEs are not being used yet */ /* The following CEs are not being used yet */
{ /* CE9 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,}, { /* CE9 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
@@ -290,7 +292,7 @@ static struct CE_attr host_ce_config_wlan_epping_irq[] = {
/* unused */ /* unused */
{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,}, { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
/* ce_diag, the Diagnostic Window */ /* ce_diag, the Diagnostic Window */
{ /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL,}, { /* CE7 */ CE_ATTR_DIAG_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL,},
{ /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,}, { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
/* The following CEs are not being used yet */ /* The following CEs are not being used yet */
{ /* CE9 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,}, { /* CE9 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
@@ -326,151 +328,232 @@ static struct CE_pipe_config target_ce_config_wlan_epping[] = {
#endif #endif
static struct CE_attr host_ce_config_wlan_ar9888[] = { static struct CE_attr host_ce_config_wlan_ar9888[] = {
{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL, }, /* host->target HTC control and raw streams */ /* host->target HTC control and raw streams */
{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL, },
/* target->host BMI + HTC control */
/* could be moved to share CE3 */ /* could be moved to share CE3 */
{ /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },/* target->host BMI + HTC control */ { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },
{ /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },/* target->host WMI */ /* target->host WMI */
{ /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL, },/* host->target WMI */ { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },
/* host->target WMI */
{ /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL, },
/* host->target HTT */
{ /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0, { /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0,
CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B, 256, 0, NULL, }, /* host->target HTT */ CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B, 256, 0, NULL, },
#if WLAN_FEATURE_FASTPATH #if WLAN_FEATURE_FASTPATH
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, }, /* target->host HTT messages */ /* target->host HTT messages */
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },
#else /* WLAN_FEATURE_FASTPATH */ #else /* WLAN_FEATURE_FASTPATH */
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* unused */ /* unused */
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
#endif /* WLAN_FEATURE_FASTPATH */ #endif /* WLAN_FEATURE_FASTPATH */
{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ /* Target autonomous HIF_memcpy */
{ /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL, }, /* ce_diag, the Diagnostic Window */ { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
{ /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ /* ce_diag, the Diagnostic Window */
{ /* CE7 */ CE_ATTR_DIAG_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL, },
/* Target autonomous HIF_memcpy */
{ /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
}; };
static struct CE_attr host_ce_config_wlan_ar900b[] = { static struct CE_attr host_ce_config_wlan_ar900b[] = {
{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL, }, /* host->target HTC control and raw streams */ /* host->target HTC control and raw streams */
{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL, },
/* target->host BMI + HTC control */
/* could be moved to share CE3 */ /* could be moved to share CE3 */
{ /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },/* target->host BMI + HTC control */ { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },
{ /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },/* target->host WMI */ /* target->host WMI */
{ /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL, },/* host->target WMI */ { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },
/* host->target WMI */
{ /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL, },
/* host->target HTT */
{ /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0, { /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0,
CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B, 256, 0, NULL, }, /* host->target HTT */ CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B, 256, 0, NULL, },
#if WLAN_FEATURE_FASTPATH #if WLAN_FEATURE_FASTPATH
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, }, /* target->host HTT messages */ /* target->host HTT messages */
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },
#else /* WLAN_FEATURE_FASTPATH */ #else /* WLAN_FEATURE_FASTPATH */
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* unused */ /* unused */
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
#endif /* WLAN_FEATURE_FASTPATH */ #endif /* WLAN_FEATURE_FASTPATH */
{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ /* Target autonomous HIF_memcpy */
{ /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL, }, /* ce_diag, the Diagnostic Window */ { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
{ /* CE8 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },/* target->host pktlog */ /* ce_diag, the Diagnostic Window */
{ /* CE9 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ { /* CE7 */ CE_ATTR_DIAG_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL, },
{ /* CE10 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ /* target->host pktlog */
{ /* CE11 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },
/* Target autonomous HIF_memcpy */
{ /* CE9 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
/* Target autonomous HIF_memcpy */
{ /* CE10 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
/* Target autonomous HIF_memcpy */
{ /* CE11 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
}; };
static struct CE_attr host_lowdesc_ce_cfg_wlan_ar9888[] = { static struct CE_attr host_lowdesc_ce_cfg_wlan_ar9888[] = {
{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL, }, /* host->target HTC control and raw streams */ /* host->target HTC control and raw streams */
{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL, },
/* could be moved to share CE3 */ /* could be moved to share CE3 */
#if WLAN_FEATURE_FASTPATH #if WLAN_FEATURE_FASTPATH
{ /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 64, NULL, },/* target->host BMI + HTC control */ /* target->host BMI + HTC control */
{ /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 64, NULL, },
#else #else
{ /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },/* target->host BMI + HTC control */ /* target->host BMI + HTC control */
{ /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },
#endif #endif
{ /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },/* target->host WMI */ /* target->host WMI */
{ /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL, },/* host->target WMI */ { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },
/* host->target WMI */
{ /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL, },
/* host->target HTT */
{ /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0, { /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0,
CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B, 256, 0, NULL, }, /* host->target HTT */ CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B, 256, 0, NULL, },
#if WLAN_FEATURE_FASTPATH #if WLAN_FEATURE_FASTPATH
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, }, /* target->host HTT messages */ /* target->host HTT messages */
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },
#else /* WLAN_FEATURE_FASTPATH */ #else /* WLAN_FEATURE_FASTPATH */
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* unused */ /* unused */
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
#endif /* WLAN_FEATURE_FASTPATH */ #endif /* WLAN_FEATURE_FASTPATH */
{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ /* Target autonomous HIF_memcpy */
{ /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL, }, /* ce_diag, the Diagnostic Window */ { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
{ /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ /* ce_diag, the Diagnostic Window */
{ /* CE7 */ CE_ATTR_DIAG_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL, },
/* Target autonomous HIF_memcpy */
{ /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
}; };
static struct CE_attr host_lowdesc_ce_cfg_wlan_ar900b[] = { static struct CE_attr host_lowdesc_ce_cfg_wlan_ar900b[] = {
{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL, }, /* host->target HTC control and raw streams */ /* host->target HTC control and raw streams */
{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL, },
/* could be moved to share CE3 */ /* could be moved to share CE3 */
#if WLAN_FEATURE_FASTPATH #if WLAN_FEATURE_FASTPATH
{ /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 64, NULL, },/* target->host BMI + HTC control */ /* target->host BMI + HTC control */
{ /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 64, NULL, },
#else #else
{ /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },/* target->host BMI + HTC control */ /* target->host BMI + HTC control */
{ /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },
#endif #endif
{ /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },/* target->host WMI */ /* target->host WMI */
{ /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL, },/* host->target WMI */ { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },
/* host->target WMI */
{ /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL, },
/* host->target HTT */
{ /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0, { /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0,
CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B, 256, 0, NULL, }, /* host->target HTT */ CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B, 256, 0, NULL, },
#if WLAN_FEATURE_FASTPATH #if WLAN_FEATURE_FASTPATH
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, }, /* target->host HTT messages */ /* target->host HTT messages */
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },
#else /* WLAN_FEATURE_FASTPATH */ #else /* WLAN_FEATURE_FASTPATH */
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* unused */ /* unused */
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
#endif /* WLAN_FEATURE_FASTPATH */ #endif /* WLAN_FEATURE_FASTPATH */
{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ /* Target autonomous HIF_memcpy */
{ /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL, }, /* ce_diag, the Diagnostic Window */ { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
{ /* CE8 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },/* target->host pktlog */ /* ce_diag, the Diagnostic Window */
{ /* CE9 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ { /* CE7 */ CE_ATTR_DIAG_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL, },
{ /* CE10 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ /* target->host pktlog */
{ /* CE11 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },
/* Target autonomous HIF_memcpy */
{ /* CE9 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
/* Target autonomous HIF_memcpy */
{ /* CE10 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
/* Target autonomous HIF_memcpy */
{ /* CE11 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
}; };
static struct CE_attr host_lowdesc_ce_cfg_wlan_ar900b_nopktlog[] = { static struct CE_attr host_lowdesc_ce_cfg_wlan_ar900b_nopktlog[] = {
{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL, }, /* host->target HTC control and raw streams */ /* host->target HTC control and raw streams */
{ /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL, },
/* could be moved to share CE3 */ /* could be moved to share CE3 */
#if WLAN_FEATURE_FASTPATH #if WLAN_FEATURE_FASTPATH
{ /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 64, NULL, },/* target->host BMI + HTC control */ /* target->host BMI + HTC control */
{ /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 64, NULL, },
#else #else
{ /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },/* target->host BMI + HTC control */ /* target->host BMI + HTC control */
{ /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },
#endif #endif
{ /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },/* target->host WMI */ /* target->host WMI */
{ /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL, },/* host->target WMI */ { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },
/* host->target WMI */
{ /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL, },
/* host->target HTT */
{ /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0, { /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0,
CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B, 256, 0, NULL, }, /* host->target HTT */ CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B, 256, 0, NULL, },
#if WLAN_FEATURE_FASTPATH #if WLAN_FEATURE_FASTPATH
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, }, /* target->host HTT messages */ /* target->host HTT messages */
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },
#else /* WLAN_FEATURE_FASTPATH */ #else /* WLAN_FEATURE_FASTPATH */
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* unused */ /* unused */
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
#endif /* WLAN_FEATURE_FASTPATH */ #endif /* WLAN_FEATURE_FASTPATH */
{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ /* Target autonomous HIF_memcpy */
{ /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL, }, /* ce_diag, the Diagnostic Window */ { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
{ /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },/* target->host pktlog */ /* ce_diag, the Diagnostic Window */
{ /* CE9 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ { /* CE7 */ CE_ATTR_DIAG_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL, },
{ /* CE10 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ /* target->host pktlog */
{ /* CE11 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
/* Target autonomous HIF_memcpy */
{ /* CE9 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
/* Target autonomous HIF_memcpy */
{ /* CE10 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
/* Target autonomous HIF_memcpy */
{ /* CE11 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },
}; };
static struct CE_pipe_config target_ce_config_wlan_ar9888[] = { static struct CE_pipe_config target_ce_config_wlan_ar9888[] = {
{ /* CE0 */ 0, PIPEDIR_OUT, 32, 256, CE_ATTR_FLAGS, 0, }, /* host->target HTC control and raw streams */ /* host->target HTC control and raw streams */
{ /* CE1 */ 1, PIPEDIR_IN, 32, 512, CE_ATTR_FLAGS, 0, }, /* target->host HTC control */ { /* CE0 */ 0, PIPEDIR_OUT, 32, 256, CE_ATTR_FLAGS, 0, },
{ /* CE2 */ 2, PIPEDIR_IN, 64, 2048, CE_ATTR_FLAGS, 0, }, /* target->host WMI */ /* target->host HTC control */
{ /* CE3 */ 3, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0, }, /* host->target WMI */ { /* CE1 */ 1, PIPEDIR_IN, 32, 512, CE_ATTR_FLAGS, 0, },
{ /* CE4 */ 4, PIPEDIR_OUT, 256, 256, CE_ATTR_FLAGS, 0, }, /* host->target HTT */ /* target->host WMI */
{ /* CE2 */ 2, PIPEDIR_IN, 64, 2048, CE_ATTR_FLAGS, 0, },
/* host->target WMI */
{ /* CE3 */ 3, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0, },
/* host->target HTT */
{ /* CE4 */ 4, PIPEDIR_OUT, 256, 256, CE_ATTR_FLAGS, 0, },
/* NB: 50% of src nentries, since tx has 2 frags */ /* NB: 50% of src nentries, since tx has 2 frags */
#if WLAN_FEATURE_FASTPATH #if WLAN_FEATURE_FASTPATH
{ /* CE5 */ 5, PIPEDIR_IN, 32, 512, CE_ATTR_FLAGS, 0, }, /* target->host HTT */ /* target->host HTT */
{ /* CE5 */ 5, PIPEDIR_IN, 32, 512, CE_ATTR_FLAGS, 0, },
#else #else
{ /* CE5 */ 5, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0, }, /* unused */ /* unused */
{ /* CE5 */ 5, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0, },
#endif #endif
{ /* CE6 */ 6, PIPEDIR_INOUT, 32, 4096, CE_ATTR_FLAGS, 0, },/* Reserved for target autonomous HIF_memcpy */ /* Reserved for target autonomous HIF_memcpy */
{ /* CE6 */ 6, PIPEDIR_INOUT, 32, 4096, CE_ATTR_FLAGS, 0, },
/* CE7 used only by Host */ /* CE7 used only by Host */
}; };
static struct CE_pipe_config target_ce_config_wlan_ar900b[] = { static struct CE_pipe_config target_ce_config_wlan_ar900b[] = {
{ /* CE0 */ 0, PIPEDIR_OUT, 32, 256, CE_ATTR_FLAGS, 0, }, /* host->target HTC control and raw streams */ /* host->target HTC control and raw streams */
{ /* CE1 */ 1, PIPEDIR_IN, 32, 512, CE_ATTR_FLAGS, 0, }, /* target->host HTC control */ { /* CE0 */ 0, PIPEDIR_OUT, 32, 256, CE_ATTR_FLAGS, 0, },
{ /* CE2 */ 2, PIPEDIR_IN, 64, 2048, CE_ATTR_FLAGS, 0, }, /* target->host WMI */ /* target->host HTC control */
{ /* CE3 */ 3, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0, }, /* host->target WMI */ { /* CE1 */ 1, PIPEDIR_IN, 32, 512, CE_ATTR_FLAGS, 0, },
{ /* CE4 */ 4, PIPEDIR_OUT, 256, 256, CE_ATTR_FLAGS, 0, }, /* host->target HTT */ /* target->host WMI */
{ /* CE2 */ 2, PIPEDIR_IN, 64, 2048, CE_ATTR_FLAGS, 0, },
/* host->target WMI */
{ /* CE3 */ 3, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0, },
/* host->target HTT */
{ /* CE4 */ 4, PIPEDIR_OUT, 256, 256, CE_ATTR_FLAGS, 0, },
/* NB: 50% of src nentries, since tx has 2 frags */ /* NB: 50% of src nentries, since tx has 2 frags */
#if WLAN_FEATURE_FASTPATH #if WLAN_FEATURE_FASTPATH
{ /* CE5 */ 5, PIPEDIR_IN, 32, 512, CE_ATTR_FLAGS, 0, }, /* target->host HTT */ /* target->host HTT */
{ /* CE5 */ 5, PIPEDIR_IN, 32, 512, CE_ATTR_FLAGS, 0, },
#else #else
{ /* CE5 */ 5, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0, }, /* unused */ /* unused */
{ /* CE5 */ 5, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0, },
#endif #endif
{ /* CE6 */ 6, PIPEDIR_INOUT, 32, 4096, CE_ATTR_FLAGS, 0, },/* Reserved for target autonomous HIF_memcpy */ /* Reserved for target autonomous HIF_memcpy */
{ /* CE7 */ 7, PIPEDIR_INOUT, 0, 0, 0, 0, }, /* CE7 used only by Host */ { /* CE6 */ 6, PIPEDIR_INOUT, 32, 4096, CE_ATTR_FLAGS, 0, },
/* CE7 used only by Host */
{ /* CE7 */ 7, PIPEDIR_INOUT, 0, 0, 0, 0, },
{ /* CE8 */ 8, PIPEDIR_IN, 64, 2048, CE_ATTR_FLAGS { /* CE8 */ 8, PIPEDIR_IN, 64, 2048, CE_ATTR_FLAGS
| CE_ATTR_DISABLE_INTR, 0, }, /* target->host packtlog */ /* target->host packtlog */
| CE_ATTR_DISABLE_INTR, 0, },
#if PEER_CACHEING_HOST_ENABLE #if PEER_CACHEING_HOST_ENABLE
/* target autonomous qcache memcpy */
{ /* CE9 */ 9, PIPEDIR_INOUT, 32, 2048, CE_ATTR_FLAGS | { /* CE9 */ 9, PIPEDIR_INOUT, 32, 2048, CE_ATTR_FLAGS |
CE_ATTR_DISABLE_INTR, 0, }, /* target autonomous qcache memcpy */ CE_ATTR_DISABLE_INTR, 0, },
#endif #endif
}; };
@@ -481,7 +564,7 @@ static struct CE_attr host_ce_config_wlan_qca8074[] = {
{ /* CE1 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,}, { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
/* target->host WMI */ /* target->host WMI */
{ /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 32, NULL,}, { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 32, NULL,},
/* host->target WMI */ /* host->target WMI (mac0) */
{ /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL,}, { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL,},
/* host->target HTT */ /* host->target HTT */
{ /* CE4 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0, { /* CE4 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,
@@ -491,13 +574,12 @@ static struct CE_attr host_ce_config_wlan_qca8074[] = {
1024, 512, 0, NULL,}, 1024, 512, 0, NULL,},
/* Target autonomous HIF_memcpy */ /* Target autonomous HIF_memcpy */
{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,}, { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
/* ce_diag, the Diagnostic Window */ /* host->target WMI (mac1) */
{ /* CE7 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0, { /* CE7 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL,},
8, DIAG_TRANSFER_LIMIT, 8, NULL,},
/* Target to uMC */ /* Target to uMC */
{ /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,}, { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
/* target->host HTT */ /* host->target WMI (mac2) */
{ /* CE9 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,}, { /* CE9 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL,},
/* target->host HTT */ /* target->host HTT */
{ /* CE10 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,}, { /* CE10 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
/* target -> host PKTLOG */ /* target -> host PKTLOG */
@@ -542,7 +624,7 @@ static struct CE_attr host_ce_config_wlan_qca8074_pci[] = {
{ /* CE1 */ EPPING_CE_FLAGS_POLL, 0, 0, 2048, 512, NULL,}, { /* CE1 */ EPPING_CE_FLAGS_POLL, 0, 0, 2048, 512, NULL,},
/* target->host WMI */ /* target->host WMI */
{ /* CE2 */ EPPING_CE_FLAGS_POLL, 0, 0, 2048, 32, NULL,}, { /* CE2 */ EPPING_CE_FLAGS_POLL, 0, 0, 2048, 32, NULL,},
/* host->target WMI */ /* host->target WMI (mac0) */
{ /* CE3 */ EPPING_CE_FLAGS_POLL, 0, 32, 2048, 0, NULL,}, { /* CE3 */ EPPING_CE_FLAGS_POLL, 0, 32, 2048, 0, NULL,},
/* host->target HTT */ /* host->target HTT */
{ /* CE4 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0, { /* CE4 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,
@@ -552,13 +634,12 @@ static struct CE_attr host_ce_config_wlan_qca8074_pci[] = {
1024, 512, 0, NULL,}, 1024, 512, 0, NULL,},
/* Target autonomous HIF_memcpy */ /* Target autonomous HIF_memcpy */
{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,}, { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
/* ce_diag, the Diagnostic Window */ /* host->target WMI (mac1) */
{ /* CE7 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0, { /* CE7 */ EPPING_CE_FLAGS_POLL, 0, 32, 2048, 0, NULL,},
2, DIAG_TRANSFER_LIMIT, 2, NULL,},
/* Target to uMC */ /* Target to uMC */
{ /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,}, { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
/* target->host HTT */ /* host->target WMI (mac2) */
{ /* CE9 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,}, { /* CE9 */ EPPING_CE_FLAGS_POLL, 0, 32, 2048, 0, NULL,},
/* target->host HTT */ /* target->host HTT */
{ /* CE10 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,}, { /* CE10 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
/* target -> host PKTLOG */ /* target -> host PKTLOG */
@@ -613,7 +694,7 @@ static struct CE_attr host_ce_config_wlan_qca6290[] = {
/* Target autonomous HIF_memcpy */ /* Target autonomous HIF_memcpy */
{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,}, { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
/* ce_diag, the Diagnostic Window */ /* ce_diag, the Diagnostic Window */
{ /* CE7 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0, { /* CE7 */ (CE_ATTR_DIAG_FLAGS | CE_ATTR_DISABLE_INTR), 0,
2, DIAG_TRANSFER_LIMIT, 2, NULL,}, 2, DIAG_TRANSFER_LIMIT, 2, NULL,},
/* Reserved for target */ /* Reserved for target */
{ /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,}, { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015-2016 The Linux Foundation. All rights reserved. * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved.
* *
* Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
* *
@@ -168,6 +168,12 @@ QDF_STATUS hif_diag_read_mem(struct hif_opaque_softc *hif_ctx,
unsigned int target_type = 0; unsigned int target_type = 0;
unsigned int boundary_addr = 0; unsigned int boundary_addr = 0;
ce_diag = hif_state->ce_diag;
if (ce_diag == NULL) {
HIF_ERROR("%s: DIAG CE not present", __func__);
return QDF_STATUS_E_INVAL;
}
transaction_id = (mux_id & MUX_ID_MASK) | transaction_id = (mux_id & MUX_ID_MASK) |
(transaction_id & TRANSACTION_ID_MASK); (transaction_id & TRANSACTION_ID_MASK);
#ifdef QCA_WIFI_3_0 #ifdef QCA_WIFI_3_0
@@ -206,7 +212,6 @@ QDF_STATUS hif_diag_read_mem(struct hif_opaque_softc *hif_ctx,
return status; return status;
} }
ce_diag = hif_state->ce_diag;
A_TARGET_ACCESS_LIKELY(scn); A_TARGET_ACCESS_LIKELY(scn);
@@ -361,7 +366,13 @@ QDF_STATUS hif_diag_write_mem(struct hif_opaque_softc *hif_ctx,
unsigned int toeplitz_hash_result; unsigned int toeplitz_hash_result;
unsigned int user_flags = 0; unsigned int user_flags = 0;
unsigned int target_type = 0; unsigned int target_type = 0;
ce_diag = hif_state->ce_diag; ce_diag = hif_state->ce_diag;
if (ce_diag == NULL) {
HIF_ERROR("%s: DIAG CE not present", __func__);
return QDF_STATUS_E_INVAL;
}
transaction_id = (mux_id & MUX_ID_MASK) | transaction_id = (mux_id & MUX_ID_MASK) |
(transaction_id & TRANSACTION_ID_MASK); (transaction_id & TRANSACTION_ID_MASK);
#ifdef QCA_WIFI_3_0 #ifdef QCA_WIFI_3_0

View File

@@ -320,6 +320,26 @@ static struct service_to_pipe target_service_to_ce_map_wlan[] = {
PIPEDIR_IN, /* in = DL = target -> host */ PIPEDIR_IN, /* in = DL = target -> host */
2, 2,
}, },
{
WMI_CONTROL_SVC_WMAC1,
PIPEDIR_OUT, /* out = UL = host -> target */
7,
},
{
WMI_CONTROL_SVC_WMAC1,
PIPEDIR_IN, /* in = DL = target -> host */
2,
},
{
WMI_CONTROL_SVC_WMAC2,
PIPEDIR_OUT, /* out = UL = host -> target */
9,
},
{
WMI_CONTROL_SVC_WMAC2,
PIPEDIR_IN, /* in = DL = target -> host */
2,
},
{ {
HTC_CTRL_RSVD_SVC, HTC_CTRL_RSVD_SVC,
PIPEDIR_OUT, /* out = UL = host -> target */ PIPEDIR_OUT, /* out = UL = host -> target */
@@ -2334,7 +2354,7 @@ int hif_config_ce(struct hif_softc *scn)
goto err; goto err;
} }
if (pipe_num == DIAG_CE_ID) { if (attr->flags & CE_ATTR_DIAG) {
/* Reserve the ultimate CE for /* Reserve the ultimate CE for
* Diagnostic Window support */ * Diagnostic Window support */
hif_state->ce_diag = pipe_info->ce_hdl; hif_state->ce_diag = pipe_info->ce_hdl;

View File

@@ -266,6 +266,7 @@ HTC_HANDLE htc_create(void *ol_sc, HTC_INIT_INFO *pInfo, qdf_device_t osdev,
qdf_spinlock_create(&target->HTCTxLock); qdf_spinlock_create(&target->HTCTxLock);
qdf_spinlock_create(&target->HTCCreditLock); qdf_spinlock_create(&target->HTCCreditLock);
target->is_nodrop_pkt = false; target->is_nodrop_pkt = false;
target->wmi_ep_count = 1;
do { do {
qdf_mem_copy(&target->HTCInitInfo, pInfo, qdf_mem_copy(&target->HTCInitInfo, pInfo,
@@ -410,17 +411,16 @@ A_STATUS htc_setup_target_buffer_assignments(HTC_TARGET *target)
credits = target->TotalTransmitCredits; credits = target->TotalTransmitCredits;
pEntry = &target->ServiceTxAllocTable[0]; pEntry = &target->ServiceTxAllocTable[0];
status = A_OK;
/* /*
* Allocate all credists/HTC buffers to WMI. * Allocate all credists/HTC buffers to WMI.
* no buffers are used/required for data. data always * no buffers are used/required for data. data always
* remains on host. * remains on host.
*/ */
status = A_OK; if (HTC_IS_EPPING_ENABLED(target->con_mode)) {
pEntry++; pEntry++;
pEntry->service_id = WMI_CONTROL_SVC; pEntry->service_id = WMI_CONTROL_SVC;
pEntry->CreditAllocation = credits; pEntry->CreditAllocation = credits;
if (HTC_IS_EPPING_ENABLED(target->con_mode)) {
/* endpoint ping is a testing tool directly on top of HTC in /* endpoint ping is a testing tool directly on top of HTC in
* both target and host sides. * both target and host sides.
* In target side, the endppint ping fw has no wlan stack and the * In target side, the endppint ping fw has no wlan stack and the
@@ -447,6 +447,26 @@ A_STATUS htc_setup_target_buffer_assignments(HTC_TARGET *target)
htc_setup_epping_credit_allocation(target->hif_dev, htc_setup_epping_credit_allocation(target->hif_dev,
pEntry, credits); pEntry, credits);
} else {
int i;
uint32_t svc_id[] = {WMI_CONTROL_SVC, WMI_CONTROL_SVC_WMAC1,
WMI_CONTROL_SVC_WMAC2};
uint32_t max_wmi_svc = (sizeof(svc_id) / sizeof(uint32_t));
if ((target->wmi_ep_count == 0) ||
(target->wmi_ep_count > max_wmi_svc))
return A_ERROR;
/*
* Divide credit among number of endpoints for WMI
*/
credits = credits / target->wmi_ep_count;
for (i = 0; i < target->wmi_ep_count; i++) {
status = A_OK;
pEntry++;
pEntry->service_id = svc_id[i];
pEntry->CreditAllocation = credits;
}
} }
if (A_SUCCESS(status)) { if (A_SUCCESS(status)) {
@@ -1030,3 +1050,30 @@ int htc_pm_runtime_put(HTC_HANDLE htc_handle)
return hif_pm_runtime_put(target->hif_dev); return hif_pm_runtime_put(target->hif_dev);
} }
#endif #endif
/**
* htc_set_wmi_endpoint_count: Set number of WMI endpoint
* @htc_handle: HTC handle
* @wmi_ep_count: WMI enpoint count
*
* return: None
*/
void htc_set_wmi_endpoint_count(HTC_HANDLE htc_handle, uint8_t wmi_ep_count)
{
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_handle);
target->wmi_ep_count = wmi_ep_count;
}
/**
* htc_get_wmi_endpoint_count: Get number of WMI endpoint
* @htc_handle: HTC handle
*
* return: WMI enpoint count
*/
uint8_t htc_get_wmi_endpoint_count(HTC_HANDLE htc_handle)
{
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_handle);
return target->wmi_ep_count;
}

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2014, 2016 The Linux Foundation. All rights reserved. * Copyright (c) 2013-2014, 2016-2017 The Linux Foundation. All rights reserved.
* *
* Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
* *
@@ -784,4 +784,21 @@ static inline int htc_pm_runtime_put(HTC_HANDLE htc_handle) { return 0; }
void htc_set_async_ep(HTC_HANDLE HTCHandle, void htc_set_async_ep(HTC_HANDLE HTCHandle,
HTC_ENDPOINT_ID htc_ep_id, bool value); HTC_ENDPOINT_ID htc_ep_id, bool value);
/**
* htc_set_wmi_endpoint_count: Set number of WMI endpoint
* @htc_handle: HTC handle
* @wmi_ep_count: WMI enpoint count
*
* return: None
*/
void htc_set_wmi_endpoint_count(HTC_HANDLE htc_handle, uint8_t wmi_ep_count);
/**
* htc_get_wmi_endpoint_count: Get number of WMI endpoint
* @htc_handle: HTC handle
*
* return: WMI enpoint count
*/
uint8_t htc_get_wmi_endpoint_count(HTC_HANDLE htc_handle);
#endif /* _HTC_API_H_ */ #endif /* _HTC_API_H_ */

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
* *
* Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
* *
@@ -208,6 +208,13 @@ typedef struct _HTC_TARGET {
* drop it. Besides, nodrop pkts have higher priority than normal pkts. * drop it. Besides, nodrop pkts have higher priority than normal pkts.
*/ */
A_BOOL is_nodrop_pkt; A_BOOL is_nodrop_pkt;
/*
* Number of WMI endpoints used.
* Default value is 1. But it should be overidden after htc_create to
* reflect the actual count.
*/
uint8_t wmi_ep_count;
} HTC_TARGET; } HTC_TARGET;
#if defined ENABLE_BUNDLE_TX #if defined ENABLE_BUNDLE_TX