aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath10k/pci.c
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2014-08-26 12:14:03 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2014-08-27 08:03:23 -0400
commit7c6aa25db481f0c6e83ddf358001894a62ca294c (patch)
tree64cab5f42cb71b94ce28e19d37d6e421c7aa9c95 /drivers/net/wireless/ath/ath10k/pci.c
parentd7bfb7aa54031905a87e0f1d049d160259d71808 (diff)
ath10k: dont duplicate service-pipe mapping
The mapping is already defined in a structure. It makes little sense to duplicate information stored in it within a function. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/pci.c')
-rw-r--r--drivers/net/wireless/ath/ath10k/pci.c77
1 files changed, 33 insertions, 44 deletions
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 71ac01868d69..fa0e2450a9a8 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -1094,68 +1094,57 @@ static void ath10k_pci_kill_tasklet(struct ath10k *ar)
1094 del_timer_sync(&ar_pci->rx_post_retry); 1094 del_timer_sync(&ar_pci->rx_post_retry);
1095} 1095}
1096 1096
1097/* TODO - temporary mapping while we have too few CE's */
1098static int ath10k_pci_hif_map_service_to_pipe(struct ath10k *ar, 1097static int ath10k_pci_hif_map_service_to_pipe(struct ath10k *ar,
1099 u16 service_id, u8 *ul_pipe, 1098 u16 service_id, u8 *ul_pipe,
1100 u8 *dl_pipe, int *ul_is_polled, 1099 u8 *dl_pipe, int *ul_is_polled,
1101 int *dl_is_polled) 1100 int *dl_is_polled)
1102{ 1101{
1103 int ret = 0; 1102 const struct service_to_pipe *entry;
1103 bool ul_set = false, dl_set = false;
1104 int i;
1104 1105
1105 ath10k_dbg(ar, ATH10K_DBG_PCI, "pci hif map service\n"); 1106 ath10k_dbg(ar, ATH10K_DBG_PCI, "pci hif map service\n");
1106 1107
1107 /* polling for received messages not supported */ 1108 /* polling for received messages not supported */
1108 *dl_is_polled = 0; 1109 *dl_is_polled = 0;
1109 1110
1110 switch (service_id) { 1111 for (i = 0; i < ARRAY_SIZE(target_service_to_ce_map_wlan); i++) {
1111 case ATH10K_HTC_SVC_ID_HTT_DATA_MSG: 1112 entry = &target_service_to_ce_map_wlan[i];
1112 /*
1113 * Host->target HTT gets its own pipe, so it can be polled
1114 * while other pipes are interrupt driven.
1115 */
1116 *ul_pipe = 4;
1117 /*
1118 * Use the same target->host pipe for HTC ctrl, HTC raw
1119 * streams, and HTT.
1120 */
1121 *dl_pipe = 1;
1122 break;
1123
1124 case ATH10K_HTC_SVC_ID_RSVD_CTRL:
1125 case ATH10K_HTC_SVC_ID_TEST_RAW_STREAMS:
1126 /*
1127 * Note: HTC_RAW_STREAMS_SVC is currently unused, and
1128 * HTC_CTRL_RSVD_SVC could share the same pipe as the
1129 * WMI services. So, if another CE is needed, change
1130 * this to *ul_pipe = 3, which frees up CE 0.
1131 */
1132 /* *ul_pipe = 3; */
1133 *ul_pipe = 0;
1134 *dl_pipe = 1;
1135 break;
1136 1113
1137 case ATH10K_HTC_SVC_ID_WMI_DATA_BK: 1114 if (entry->service_id != service_id)
1138 case ATH10K_HTC_SVC_ID_WMI_DATA_BE: 1115 continue;
1139 case ATH10K_HTC_SVC_ID_WMI_DATA_VI:
1140 case ATH10K_HTC_SVC_ID_WMI_DATA_VO:
1141 1116
1142 case ATH10K_HTC_SVC_ID_WMI_CONTROL: 1117 switch (entry->pipedir) {
1143 *ul_pipe = 3; 1118 case PIPEDIR_NONE:
1144 *dl_pipe = 2; 1119 break;
1145 break; 1120 case PIPEDIR_IN:
1121 WARN_ON(dl_set);
1122 *dl_pipe = entry->pipenum;
1123 dl_set = true;
1124 break;
1125 case PIPEDIR_OUT:
1126 WARN_ON(ul_set);
1127 *ul_pipe = entry->pipenum;
1128 ul_set = true;
1129 break;
1130 case PIPEDIR_INOUT:
1131 WARN_ON(dl_set);
1132 WARN_ON(ul_set);
1133 *dl_pipe = entry->pipenum;
1134 *ul_pipe = entry->pipenum;
1135 dl_set = true;
1136 ul_set = true;
1137 break;
1138 }
1139 }
1146 1140
1147 /* pipe 5 unused */ 1141 if (WARN_ON(!ul_set || !dl_set))
1148 /* pipe 6 reserved */ 1142 return -ENOENT;
1149 /* pipe 7 reserved */
1150 1143
1151 default:
1152 ret = -1;
1153 break;
1154 }
1155 *ul_is_polled = 1144 *ul_is_polled =
1156 (host_ce_config_wlan[*ul_pipe].flags & CE_ATTR_DIS_INTR) != 0; 1145 (host_ce_config_wlan[*ul_pipe].flags & CE_ATTR_DIS_INTR) != 0;
1157 1146
1158 return ret; 1147 return 0;
1159} 1148}
1160 1149
1161static void ath10k_pci_hif_get_default_pipe(struct ath10k *ar, 1150static void ath10k_pci_hif_get_default_pipe(struct ath10k *ar,