/* Attach new congestion control algorithm to the list of available options.  */
int tcp_register_congestion_control(struct tcp_congestion_ops *ca)
/* Attach new congestion control algorithm to the list of available options.  */
int tcp_register_congestion_control(struct tcp_congestion_ops *ca)
{
	int ret = 0;
	if (!ca->ssthresh || !ca->cong_avoid) {
		printk(KERN_ERR "TCP %s does not implement required ops\n",
		       ca->name);
		return -EINVAL;
	}
	spin_lock(&tcp_cong_list_lock);
	if (tcp_ca_find(ca->name)) {
		printk(KERN_NOTICE "TCP %s already registered\n", ca->name);
		ret = -EEXIST;
	} else {
		list_add_tail_rcu(&ca->list, &tcp_cong_list);
		printk(KERN_INFO "TCP %s registered\n", ca->name);
	}
	spin_unlock(&tcp_cong_list_lock);
	return ret;
}