Pull asus into release branch
[pandora-kernel.git] / net / sctp / transport.c
index a596f53..4d8c2ab 100644 (file)
@@ -526,3 +526,35 @@ unsigned long sctp_transport_timeout(struct sctp_transport *t)
        timeout += jiffies;
        return timeout;
 }
+
+/* Reset transport variables to their initial values */
+void sctp_transport_reset(struct sctp_transport *t)
+{
+       struct sctp_association *asoc = t->asoc;
+
+       /* RFC 2960 (bis), Section 5.2.4
+        * All the congestion control parameters (e.g., cwnd, ssthresh)
+        * related to this peer MUST be reset to their initial values
+        * (see Section 6.2.1)
+        */
+       t->cwnd = min(4*asoc->pathmtu, max_t(__u32, 2*asoc->pathmtu, 4380));
+       t->ssthresh = asoc->peer.i.a_rwnd;
+       t->rto = asoc->rto_initial;
+       t->rtt = 0;
+       t->srtt = 0;
+       t->rttvar = 0;
+
+       /* Reset these additional varibles so that we have a clean
+        * slate.
+        */
+       t->partial_bytes_acked = 0;
+       t->flight_size = 0;
+       t->error_count = 0;
+       t->rto_pending = 0;
+
+       /* Initialize the state information for SFR-CACC */
+       t->cacc.changeover_active = 0;
+       t->cacc.cycling_changeover = 0;
+       t->cacc.next_tsn_at_change = 0;
+       t->cacc.cacc_saw_newack = 0;
+}