summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorstalel <tatias@codeaurora.org>2014-03-20 17:10:12 +0200
committerstalel <tatias@codeaurora.org>2014-03-20 17:10:12 +0200
commit6d653272845f7456aca17d91090020d6363a11b0 (patch)
tree85d669d9c3b244b0b70f14994e897e0fc49df1cd /drivers/net
parentcac2a5e07d098e8301e0d861cb41fada79e76485 (diff)
msm: rndis_ipa: change network stack notification sequence
This commit changes the order of network stack queue operations. The network start notification is changed to occur only after the driver internal state is updated. Without this change the network stack will start transmitting data before the internal state is changed which will cause these packets to be dropped on transmit path due to incorrect internal state. Change-Id: I336a1c40cf8913f7f31ab26b54fb05263b544b74 Signed-off-by: Talel Shenhar <tatias@codeaurora.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/msm/rndis_ipa.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/net/ethernet/msm/rndis_ipa.c b/drivers/net/ethernet/msm/rndis_ipa.c
index 33d7ae744a75..2a58bf3ad7a1 100644
--- a/drivers/net/ethernet/msm/rndis_ipa.c
+++ b/drivers/net/ethernet/msm/rndis_ipa.c
@@ -720,25 +720,28 @@ int rndis_ipa_pipe_connect_notify(u32 usb_to_ipa_hdl,
}
RNDIS_IPA_DEBUG("end-points configured\n");
+ netif_stop_queue(rndis_ipa_ctx->net);
+ RNDIS_IPA_DEBUG("netif_stop_queue() was called");
+
netif_carrier_on(rndis_ipa_ctx->net);
if (!netif_carrier_ok(rndis_ipa_ctx->net)) {
RNDIS_IPA_ERROR("netif_carrier_ok error\n");
result = -EBUSY;
goto fail;
}
- RNDIS_IPA_DEBUG("carrier_on notified\n");
+ RNDIS_IPA_DEBUG("netif_carrier_on() was called\n");
+
+ rndis_ipa_ctx->state = next_state;
+ RNDIS_IPA_STATE_DEBUG(rndis_ipa_ctx);
if (next_state == RNDIS_IPA_CONNECTED_AND_UP) {
netif_start_queue(rndis_ipa_ctx->net);
- RNDIS_IPA_DEBUG("queue started, NETDEV is operational\n");
+ RNDIS_IPA_DEBUG("netif_start_queue() was called\n");
} else {
RNDIS_IPA_DEBUG("queue shall be started after open()\n");
}
pr_info("RNDIS_IPA NetDev pipes were connected");
- rndis_ipa_ctx->state = next_state;
- RNDIS_IPA_STATE_DEBUG(rndis_ipa_ctx);
-
RNDIS_IPA_LOG_EXIT();
fail:
@@ -773,6 +776,9 @@ static int rndis_ipa_open(struct net_device *net)
return -EPERM;
}
+ rndis_ipa_ctx->state = next_state;
+ RNDIS_IPA_STATE_DEBUG(rndis_ipa_ctx);
+
if (next_state == RNDIS_IPA_CONNECTED_AND_UP) {
netif_start_queue(net);
RNDIS_IPA_DEBUG("queue started\n");
@@ -780,9 +786,6 @@ static int rndis_ipa_open(struct net_device *net)
RNDIS_IPA_DEBUG("queue shall be started after connect()\n");
}
- rndis_ipa_ctx->state = next_state;
- RNDIS_IPA_STATE_DEBUG(rndis_ipa_ctx);
-
pr_info("RNDIS_IPA NetDev was opened");
RNDIS_IPA_LOG_EXIT();