Merge HEAD from ../scsi-iscsi-2.6
[powerpc.git] / include / net / inet_connection_sock.h
index bec19d5..651f824 100644 (file)
@@ -27,6 +27,7 @@
 
 struct inet_bind_bucket;
 struct inet_hashinfo;
+struct tcp_congestion_ops;
 
 /** inet_connection_sock - INET connection oriented sock
  *
@@ -35,10 +36,13 @@ struct inet_hashinfo;
  * @icsk_timeout:         Timeout
  * @icsk_retransmit_timer: Resend (no ack)
  * @icsk_rto:             Retransmit timeout
+ * @icsk_ca_ops                   Pluggable congestion control hook
+ * @icsk_ca_state:        Congestion control state
  * @icsk_retransmits:     Number of unrecovered [RTO] timeouts
  * @icsk_pending:         Scheduled timer event
  * @icsk_backoff:         Backoff
  * @icsk_syn_retries:      Number of allowed SYN (or equivalent) retries
+ * @icsk_probes_out:      unanswered 0 window probes
  * @icsk_ack:             Delayed ACK control data
  */
 struct inet_connection_sock {
@@ -50,10 +54,14 @@ struct inet_connection_sock {
        struct timer_list         icsk_retransmit_timer;
        struct timer_list         icsk_delack_timer;
        __u32                     icsk_rto;
+       struct tcp_congestion_ops *icsk_ca_ops;
+       __u8                      icsk_ca_state;
        __u8                      icsk_retransmits;
        __u8                      icsk_pending;
        __u8                      icsk_backoff;
        __u8                      icsk_syn_retries;
+       __u8                      icsk_probes_out;
+       /* 2 BYTES HOLE, TRY TO PACK! */
        struct {
                __u8              pending;       /* ACK is pending                         */
                __u8              quick;         /* Scheduled number of quick acks         */
@@ -65,6 +73,8 @@ struct inet_connection_sock {
                __u16             last_seg_size; /* Size of last incoming segment          */
                __u16             rcv_mss;       /* MSS used for delayed ACK decisions     */ 
        } icsk_ack;
+       u32                       icsk_ca_priv[16];
+#define ICSK_CA_PRIV_SIZE      (16 * sizeof(u32))
 };
 
 #define ICSK_TIME_RETRANS      1       /* Retransmit timer */
@@ -77,6 +87,11 @@ static inline struct inet_connection_sock *inet_csk(const struct sock *sk)
        return (struct inet_connection_sock *)sk;
 }
 
+static inline void *inet_csk_ca(const struct sock *sk)
+{
+       return (void *)inet_csk(sk)->icsk_ca_priv;
+}
+
 extern struct sock *inet_csk_clone(struct sock *sk,
                                   const struct request_sock *req,
                                   const unsigned int __nocast priority);
@@ -132,7 +147,7 @@ static inline void inet_csk_clear_xmit_timer(struct sock *sk, const int what)
        }
 #ifdef INET_CSK_DEBUG
        else {
-               pr_debug(inet_csk_timer_bug_msg);
+               pr_debug("%s", inet_csk_timer_bug_msg);
        }
 #endif
 }
@@ -165,7 +180,7 @@ static inline void inet_csk_reset_xmit_timer(struct sock *sk, const int what,
        }
 #ifdef INET_CSK_DEBUG
        else {
-               pr_debug(inet_csk_timer_bug_msg);
+               pr_debug("%s", inet_csk_timer_bug_msg);
        }
 #endif
 }
@@ -245,6 +260,16 @@ extern void inet_csk_reqsk_queue_prune(struct sock *parent,
                                       const unsigned long max_rto);
 
 extern void inet_csk_destroy_sock(struct sock *sk);
+
+/*
+ * LISTEN is a special case for poll..
+ */
+static inline unsigned int inet_csk_listen_poll(const struct sock *sk)
+{
+       return !reqsk_queue_empty(&inet_csk(sk)->icsk_accept_queue) ?
+                       (POLLIN | POLLRDNORM) : 0;
+}
+
 extern int  inet_csk_listen_start(struct sock *sk, const int nr_table_entries);
 extern void inet_csk_listen_stop(struct sock *sk);