Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b199d92 authored by Rakshith Suresh Patkar's avatar Rakshith Suresh Patkar Committed by Gerrit - the friendly Code Review server
Browse files

qcacmn: Add support to handle new htt format

If FW supports new htt format include only payload length in
the header length.

Change-Id: Ia5ec9a474bc5fe68de28273e6f9615d36de94a7c
CRs-Fixed: 2359253
parent 53f8143c
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -284,6 +284,7 @@ HTC_HANDLE htc_create(void *ol_sc, struct htc_init_info *pInfo,
		qdf_spinlock_create(&pEndpoint->lookup_queue_lock);
		qdf_spinlock_create(&pEndpoint->lookup_queue_lock);
	}
	}
	target->is_nodrop_pkt = false;
	target->is_nodrop_pkt = false;
	target->htc_hdr_length_check = false;
	target->wmi_ep_count = 1;
	target->wmi_ep_count = 1;


	do {
	do {
+12 −1
Original line number Original line Diff line number Diff line
@@ -634,11 +634,22 @@ bool htc_is_endpoint_active(HTC_HANDLE HTCHandle,
 * @isNodropPkt - indicates whether it is nodrop pkt
 * @isNodropPkt - indicates whether it is nodrop pkt
 *
 *
 * Return: None
 * Return: None
 * Return:
 *
 *
 */
 */
void htc_set_nodrop_pkt(HTC_HANDLE HTCHandle, A_BOOL isNodropPkt);
void htc_set_nodrop_pkt(HTC_HANDLE HTCHandle, A_BOOL isNodropPkt);


/**
 * htc_enable_hdr_length_check - Set up htc_hdr_length_check flag
 * @HTCHandle - HTC handle
 * @htc_hdr_length_check - flag to indicate whether htc header length check is
 *                         required
 *
 * Return: None
 *
 */
void
htc_enable_hdr_length_check(HTC_HANDLE htc_handle, bool htc_hdr_length_check);

/**
/**
 * htc_get_num_recv_buffers - Get the number of recv buffers currently queued
 * htc_get_num_recv_buffers - Get the number of recv buffers currently queued
 *                            into an HTC endpoint
 *                            into an HTC endpoint
+2 −0
Original line number Original line Diff line number Diff line
@@ -241,6 +241,8 @@ typedef struct _HTC_TARGET {
	 * reflect the actual count.
	 * reflect the actual count.
	 */
	 */
	uint8_t wmi_ep_count;
	uint8_t wmi_ep_count;
	/* Flag to indicate whether htc header length check is required */
	bool htc_hdr_length_check;
} HTC_TARGET;
} HTC_TARGET;




+22 −11
Original line number Original line Diff line number Diff line
@@ -1502,17 +1502,18 @@ qdf_export_symbol(htc_send_pkt);
 *
 *
 * Return: QDF_STATUS_SUCCESS for success or an appropriate QDF_STATUS error
 * Return: QDF_STATUS_SUCCESS for success or an appropriate QDF_STATUS error
 */
 */
QDF_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, qdf_nbuf_t netbuf, int Epid,
QDF_STATUS htc_send_data_pkt(HTC_HANDLE htc_hdl, qdf_nbuf_t netbuf, int ep_id,
			   int ActualLength)
			     int actual_length)
{
{
	HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
	HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_hdl);
	HTC_ENDPOINT *pEndpoint;
	HTC_ENDPOINT *pEndpoint;
	HTC_FRAME_HDR *pHtcHdr;
	HTC_FRAME_HDR *p_htc_hdr;
	QDF_STATUS status = QDF_STATUS_SUCCESS;
	QDF_STATUS status = QDF_STATUS_SUCCESS;
	int tx_resources;
	int tx_resources;
	uint32_t data_attr = 0;
	uint32_t data_attr = 0;
	int htc_payload_len = actual_length;


	pEndpoint = &target->endpoint[Epid];
	pEndpoint = &target->endpoint[ep_id];


	tx_resources = hif_get_free_queue_number(target->hif_dev,
	tx_resources = hif_get_free_queue_number(target->hif_dev,
						 pEndpoint->UL_PipeID);
						 pEndpoint->UL_PipeID);
@@ -1532,13 +1533,16 @@ QDF_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, qdf_nbuf_t netbuf, int Epid,
	if (hif_pm_runtime_get(target->hif_dev))
	if (hif_pm_runtime_get(target->hif_dev))
		return QDF_STATUS_E_FAILURE;
		return QDF_STATUS_E_FAILURE;


	pHtcHdr = (HTC_FRAME_HDR *) qdf_nbuf_get_frag_vaddr(netbuf, 0);
	p_htc_hdr = (HTC_FRAME_HDR *)qdf_nbuf_get_frag_vaddr(netbuf, 0);
	AR_DEBUG_ASSERT(pHtcHdr);
	AR_DEBUG_ASSERT(p_htc_hdr);


	data_attr = qdf_nbuf_data_attr_get(netbuf);
	data_attr = qdf_nbuf_data_attr_get(netbuf);


	HTC_WRITE32(pHtcHdr, SM(ActualLength, HTC_FRAME_HDR_PAYLOADLEN) |
	if (target->htc_hdr_length_check)
		    SM(Epid, HTC_FRAME_HDR_ENDPOINTID));
		htc_payload_len = actual_length - HTC_HEADER_LEN;

	HTC_WRITE32(p_htc_hdr, SM(htc_payload_len, HTC_FRAME_HDR_PAYLOADLEN)
		    | SM(ep_id, HTC_FRAME_HDR_ENDPOINTID));
	/*
	/*
	 * If the HIF pipe for the data endpoint is polled rather than
	 * If the HIF pipe for the data endpoint is polled rather than
	 * interrupt-driven, this is a good point to check whether any
	 * interrupt-driven, this is a good point to check whether any
@@ -1556,7 +1560,7 @@ QDF_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, qdf_nbuf_t netbuf, int Epid,


	LOCK_HTC_TX(target);
	LOCK_HTC_TX(target);


	HTC_WRITE32(((uint32_t *) pHtcHdr) + 1,
	HTC_WRITE32(((uint32_t *)p_htc_hdr) + 1,
		    SM(pEndpoint->SeqNo, HTC_FRAME_HDR_CONTROLBYTES1));
		    SM(pEndpoint->SeqNo, HTC_FRAME_HDR_CONTROLBYTES1));


	pEndpoint->SeqNo++;
	pEndpoint->SeqNo++;
@@ -1567,7 +1571,7 @@ QDF_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, qdf_nbuf_t netbuf, int Epid,
		sizeof(qdf_nbuf_data(netbuf)), QDF_TX));
		sizeof(qdf_nbuf_data(netbuf)), QDF_TX));
	status = hif_send_head(target->hif_dev,
	status = hif_send_head(target->hif_dev,
			       pEndpoint->UL_PipeID,
			       pEndpoint->UL_PipeID,
			       pEndpoint->Id, ActualLength, netbuf, data_attr);
			       pEndpoint->Id, actual_length, netbuf, data_attr);


	UNLOCK_HTC_TX(target);
	UNLOCK_HTC_TX(target);
	return status;
	return status;
@@ -2131,6 +2135,13 @@ void htc_set_nodrop_pkt(HTC_HANDLE HTCHandle, A_BOOL isNodropPkt)
	target->is_nodrop_pkt = isNodropPkt;
	target->is_nodrop_pkt = isNodropPkt;
}
}


void htc_enable_hdr_length_check(HTC_HANDLE htc_hdl, bool htc_hdr_length_check)
{
	HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_hdl);

	target->htc_hdr_length_check = htc_hdr_length_check;
}

/**
/**
 * htc_process_credit_rpt() - process credit report, call distribution function
 * htc_process_credit_rpt() - process credit report, call distribution function
 * @target: pointer to HTC_TARGET
 * @target: pointer to HTC_TARGET