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

Commit 3a85298b authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dfc: Enable TX when grant is received"

parents 5b7fb8f2 ac338cde
Loading
Loading
Loading
Loading
+18 −7
Original line number Diff line number Diff line
@@ -989,7 +989,8 @@ static u32 dfc_adjust_grant(struct rmnet_bearer_map *bearer,
static int dfc_update_fc_map(struct net_device *dev, struct qos_info *qos,
			     u8 ack_req, u32 ancillary,
			     struct dfc_flow_status_info_type_v01 *fc_info,
			     bool is_query)
			     bool is_query,
			     int index)
{
	struct rmnet_bearer_map *itm = NULL;
	int rc = 0;
@@ -1010,9 +1011,16 @@ static int dfc_update_fc_map(struct net_device *dev, struct qos_info *qos,
			if (itm->rat_switch)
				return 0;

		/* If TX is OFF but we received grant, ignore it */
		if (itm->tx_off  && fc_info->num_bytes > 0)
		/* If TX is OFF but we received grant from the same modem,
		 * ignore it. If the grant is from a different modem,
		 * assume TX had become ON.
		 */
		if (itm->tx_off && fc_info->num_bytes > 0) {
			if (itm->tx_status_index == index)
				return 0;
			itm->tx_off = false;
			itm->tx_status_index = index;
		}

		/* Adjuste grant for query */
		if (dfc_qmap && is_query) {
@@ -1120,7 +1128,7 @@ void dfc_do_burst_flow_control(struct dfc_qmi_data *dfc,
		else
			dfc_update_fc_map(
				dev, qos, ack_req, ancillary, flow_status,
				is_query);
				is_query, dfc->index);

		spin_unlock_bh(&qos->qos_lock);
	}
@@ -1131,7 +1139,8 @@ void dfc_do_burst_flow_control(struct dfc_qmi_data *dfc,

static void dfc_update_tx_link_status(struct net_device *dev,
				      struct qos_info *qos, u8 tx_status,
				      struct dfc_bearer_info_type_v01 *binfo)
				      struct dfc_bearer_info_type_v01 *binfo,
				      int index)
{
	struct rmnet_bearer_map *itm = NULL;

@@ -1139,6 +1148,8 @@ static void dfc_update_tx_link_status(struct net_device *dev,
	if (!itm)
		return;

	itm->tx_status_index = index;

	/* If no change in tx status, ignore */
	if (itm->tx_off == !tx_status)
		return;
@@ -1190,7 +1201,7 @@ void dfc_handle_tx_link_status_ind(struct dfc_qmi_data *dfc,
		spin_lock_bh(&qos->qos_lock);

		dfc_update_tx_link_status(
			dev, qos, ind->tx_status, bearer_info);
			dev, qos, ind->tx_status, bearer_info, dfc->index);

		spin_unlock_bh(&qos->qos_lock);
	}
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ struct rmnet_bearer_map {
	bool tcp_bidir;
	bool rat_switch;
	bool tx_off;
	int tx_status_index;
	u32 ack_txid;
	u32 mq_idx;
	u32 ack_mq_idx;