kernels/linux-2.4.0/drivers/net/wan/sdla_chdlc.c
/*============================================================================
 * Configure IP from SLARP negotiation
 * This adds dynamic routes when SLARP has provided valid addresses
 */
Configure IP from SLARP negotiation
This adds dynamic routes when SLARP has provided valid addresses
Configure IP from SLARP negotiation This adds dynamic routes when SLARP has provided valid addresses
static int configure_ip (sdla_t* card)
{
	struct net_device *dev = card->wandev.dev;
        chdlc_private_area_t *chdlc_priv_area = dev->priv;
        char err;
        if(card->u.c.slarp_timer != 0x00) {
		CHDLC_MAILBOX_STRUCT* mb = card->mbox;
		CHDLC_CONFIGURATION_STRUCT *cfg;
     		mb->buffer_length = 0;
		mb->command = READ_CHDLC_CONFIGURATION;
		err = sdla_exec(mb) ? mb->return_code : CMD_TIMEOUT;
		if(err != COMMAND_OK) {
			chdlc_error(card,err,mb);
			return -1;
		}
		cfg = (CHDLC_CONFIGURATION_STRUCT *)mb->data;
                chdlc_priv_area->IP_address = cfg->IP_address;
                chdlc_priv_area->IP_netmask = cfg->IP_netmask;
        }
	chdlc_priv_area->route_status = ADD_ROUTE;
	card->poll = process_route;
	return 0;
}
static int configure_ip ( sdla_t * card ) { struct net_device * dev = card -> wandev . dev ; chdlc_private_area_t * chdlc_priv_area = dev -> priv ; char err ; if ( card -> u . c . slarp_timer != 0x00 ) { CHDLC_MAILBOX_STRUCT * mb = card -> mbox ; CHDLC_CONFIGURATION_STRUCT * cfg ; mb -> buffer_length = 0 ; mb -> command = READ_CHDLC_CONFIGURATION ; err = sdla_exec ( mb ) ? mb -> return_code : CMD_TIMEOUT ; if ( err != COMMAND_OK ) { chdlc_error ( card , err , mb ) ; return -1 ; } cfg = ( CHDLC_CONFIGURATION_STRUCT * ) mb -> data ; chdlc_priv_area -> IP_address = cfg -> IP_address ; chdlc_priv_area -> IP_netmask = cfg -> IP_netmask ; } chdlc_priv_area -> route_status = ADD_ROUTE ; card -> poll = process_route ; return 0 ; }
Configure IP from SLARP negotiation
 This adds dynamic routes when SLARP has provided valid addresses
Configure IP from SLARP negotiation This adds dynamic routes when SLARP has provided valid addresses
/* set to discover */ /* Set flag to add route */ /* The idea here is to add the route in the poll routine.
	   This way, we aren't in interrupt context when adding routes */