kernels/linux-2.4.0/drivers/net/wan/sdla_chdlc.c
/*=============================================================================
 * Store a UDP management packet for later processing.
 */
Store a UDP management packet for later processing.
Store a UDP management packet for later processing .
static int store_udp_mgmt_pkt(char udp_pkt_src, sdla_t* card,
                                struct sk_buff *skb, struct net_device* dev,
                                chdlc_private_area_t* chdlc_priv_area )
{
	int udp_pkt_stored = 0;
	if(!chdlc_priv_area->udp_pkt_lgth &&
	  (skb->len <= MAX_LGTH_UDP_MGNT_PKT)) {
        	chdlc_priv_area->udp_pkt_lgth = skb->len;
		chdlc_priv_area->udp_pkt_src = udp_pkt_src;
       		memcpy(chdlc_priv_area->udp_pkt_data, skb->data, skb->len);
		chdlc_priv_area->timer_int_enabled = TMR_INT_ENABLED_UDP;
		udp_pkt_stored = 1;
	}
#ifdef LINUX_2_1
	dev_kfree_skb(skb);
#else
	if(udp_pkt_src == UDP_PKT_FRM_STACK)
		dev_kfree_skb(skb, FREE_WRITE);
	else
                dev_kfree_skb(skb, FREE_READ);
#endif
	return(udp_pkt_stored);
}
static int store_udp_mgmt_pkt ( char udp_pkt_src , sdla_t * card , struct sk_buff * skb , struct net_device * dev , chdlc_private_area_t * chdlc_priv_area ) { int udp_pkt_stored = 0 ; if ( ! chdlc_priv_area -> udp_pkt_lgth && ( skb -> len <= MAX_LGTH_UDP_MGNT_PKT ) ) { chdlc_priv_area -> udp_pkt_lgth = skb -> len ; chdlc_priv_area -> udp_pkt_src = udp_pkt_src ; memcpy ( chdlc_priv_area -> udp_pkt_data , skb -> data , skb -> len ) ; chdlc_priv_area -> timer_int_enabled = TMR_INT_ENABLED_UDP ; udp_pkt_stored = 1 ; } #ifdef LINUX_2_1 dev_kfree_skb ( skb ) ; #else if ( udp_pkt_src == UDP_PKT_FRM_STACK ) dev_kfree_skb ( skb , FREE_WRITE ) ; else dev_kfree_skb ( skb , FREE_READ ) ; #endif return ( udp_pkt_stored ) ; }
Store a UDP management packet for later processing.
Store a UDP management packet for later processing .