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>
This commit is contained in:

committed by
Kalle Valo

parent
d7bfb7aa54
commit
7c6aa25db4
@@ -1094,68 +1094,57 @@ static void ath10k_pci_kill_tasklet(struct ath10k *ar)
|
|||||||
del_timer_sync(&ar_pci->rx_post_retry);
|
del_timer_sync(&ar_pci->rx_post_retry);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO - temporary mapping while we have too few CE's */
|
|
||||||
static int ath10k_pci_hif_map_service_to_pipe(struct ath10k *ar,
|
static int ath10k_pci_hif_map_service_to_pipe(struct ath10k *ar,
|
||||||
u16 service_id, u8 *ul_pipe,
|
u16 service_id, u8 *ul_pipe,
|
||||||
u8 *dl_pipe, int *ul_is_polled,
|
u8 *dl_pipe, int *ul_is_polled,
|
||||||
int *dl_is_polled)
|
int *dl_is_polled)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
const struct service_to_pipe *entry;
|
||||||
|
bool ul_set = false, dl_set = false;
|
||||||
|
int i;
|
||||||
|
|
||||||
ath10k_dbg(ar, ATH10K_DBG_PCI, "pci hif map service\n");
|
ath10k_dbg(ar, ATH10K_DBG_PCI, "pci hif map service\n");
|
||||||
|
|
||||||
/* polling for received messages not supported */
|
/* polling for received messages not supported */
|
||||||
*dl_is_polled = 0;
|
*dl_is_polled = 0;
|
||||||
|
|
||||||
switch (service_id) {
|
for (i = 0; i < ARRAY_SIZE(target_service_to_ce_map_wlan); i++) {
|
||||||
case ATH10K_HTC_SVC_ID_HTT_DATA_MSG:
|
entry = &target_service_to_ce_map_wlan[i];
|
||||||
/*
|
|
||||||
* Host->target HTT gets its own pipe, so it can be polled
|
if (entry->service_id != service_id)
|
||||||
* while other pipes are interrupt driven.
|
continue;
|
||||||
*/
|
|
||||||
*ul_pipe = 4;
|
switch (entry->pipedir) {
|
||||||
/*
|
case PIPEDIR_NONE:
|
||||||
* Use the same target->host pipe for HTC ctrl, HTC raw
|
|
||||||
* streams, and HTT.
|
|
||||||
*/
|
|
||||||
*dl_pipe = 1;
|
|
||||||
break;
|
break;
|
||||||
|
case PIPEDIR_IN:
|
||||||
case ATH10K_HTC_SVC_ID_RSVD_CTRL:
|
WARN_ON(dl_set);
|
||||||
case ATH10K_HTC_SVC_ID_TEST_RAW_STREAMS:
|
*dl_pipe = entry->pipenum;
|
||||||
/*
|
dl_set = true;
|
||||||
* Note: HTC_RAW_STREAMS_SVC is currently unused, and
|
|
||||||
* HTC_CTRL_RSVD_SVC could share the same pipe as the
|
|
||||||
* WMI services. So, if another CE is needed, change
|
|
||||||
* this to *ul_pipe = 3, which frees up CE 0.
|
|
||||||
*/
|
|
||||||
/* *ul_pipe = 3; */
|
|
||||||
*ul_pipe = 0;
|
|
||||||
*dl_pipe = 1;
|
|
||||||
break;
|
break;
|
||||||
|
case PIPEDIR_OUT:
|
||||||
case ATH10K_HTC_SVC_ID_WMI_DATA_BK:
|
WARN_ON(ul_set);
|
||||||
case ATH10K_HTC_SVC_ID_WMI_DATA_BE:
|
*ul_pipe = entry->pipenum;
|
||||||
case ATH10K_HTC_SVC_ID_WMI_DATA_VI:
|
ul_set = true;
|
||||||
case ATH10K_HTC_SVC_ID_WMI_DATA_VO:
|
|
||||||
|
|
||||||
case ATH10K_HTC_SVC_ID_WMI_CONTROL:
|
|
||||||
*ul_pipe = 3;
|
|
||||||
*dl_pipe = 2;
|
|
||||||
break;
|
break;
|
||||||
|
case PIPEDIR_INOUT:
|
||||||
/* pipe 5 unused */
|
WARN_ON(dl_set);
|
||||||
/* pipe 6 reserved */
|
WARN_ON(ul_set);
|
||||||
/* pipe 7 reserved */
|
*dl_pipe = entry->pipenum;
|
||||||
|
*ul_pipe = entry->pipenum;
|
||||||
default:
|
dl_set = true;
|
||||||
ret = -1;
|
ul_set = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (WARN_ON(!ul_set || !dl_set))
|
||||||
|
return -ENOENT;
|
||||||
|
|
||||||
*ul_is_polled =
|
*ul_is_polled =
|
||||||
(host_ce_config_wlan[*ul_pipe].flags & CE_ATTR_DIS_INTR) != 0;
|
(host_ce_config_wlan[*ul_pipe].flags & CE_ATTR_DIS_INTR) != 0;
|
||||||
|
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ath10k_pci_hif_get_default_pipe(struct ath10k *ar,
|
static void ath10k_pci_hif_get_default_pipe(struct ath10k *ar,
|
||||||
|
Reference in New Issue
Block a user