/* Try and send the packet on the end of the data and other data queues. Other data gets priority over data, and if we retransmit a packet we reduce the window by dividing it in two.  */
void dn_nsp_output(struct sock *sk)
/* Try and send the packet on the end of the data and other data queues. Other data gets priority over data, and if we retransmit a packet we reduce the window by dividing it in two.  */
void dn_nsp_output(struct sock *sk)
{
	struct dn_scp *scp = DN_SK(sk);
	struct sk_buff *skb;
	unsigned reduce_win = 0;
	if ((skb = skb_peek(&scp->other_xmit_queue)) != NULL)
		reduce_win = dn_nsp_clone_and_send(skb, GFP_ATOMIC);
	if (reduce_win || (scp->flowrem_sw != DN_SEND))
		goto recalc_window;
	if ((skb = skb_peek(&scp->data_xmit_queue)) != NULL)
		reduce_win = dn_nsp_clone_and_send(skb, GFP_ATOMIC);
recalc_window:
	if (reduce_win) {
		scp->snd_window >>= 1;
		if (scp->snd_window < NSP_MIN_WINDOW)
			scp->snd_window = NSP_MIN_WINDOW;
	}
}