/* This routine is called when a Clear Request is needed outside of the context of a connected socket.  */
void x25_transmit_clear_request(struct x25_neigh *nb, unsigned int lci, unsigned char cause)
/* This routine is called when a Clear Request is needed outside of the context of a connected socket.  */
void x25_transmit_clear_request(struct x25_neigh *nb, unsigned int lci, unsigned char cause)
{
	unsigned char *dptr;
	int len = X25_MAX_L2_LEN + X25_STD_MIN_LEN + 2;
	struct sk_buff *skb = alloc_skb(len, GFP_ATOMIC);
	if (!skb)
		return;
	skb_reserve(skb, X25_MAX_L2_LEN);
	dptr = skb_put(skb, X25_STD_MIN_LEN + 2);
	*dptr++ = ((lci >> 8) & 0x0F) | (nb->extended ?
					 X25_GFI_EXTSEQ :
					 X25_GFI_STDSEQ);
	*dptr++ = (lci >> 0) & 0xFF;
	*dptr++ = X25_CLEAR_REQUEST;
	*dptr++ = cause;
	*dptr++ = 0x00;
	skb->sk = NULL;
	x25_send_frame(skb, nb);
}