void enet_initpara_config(enet_option_enum option, uint32_t para)
{
switch(option){
case FORWARD_OPTION:
/* choose to configure forward_frame, and save the configuration parameters */
enet_initpara.option_enable |= (uint32_t)FORWARD_OPTION;
enet_initpara.forward_frame = para;
break;
case DMABUS_OPTION:
/* choose to configure dmabus_mode, and save the configuration parameters */
enet_initpara.option_enable |= (uint32_t)DMABUS_OPTION;
enet_initpara.dmabus_mode = para;
break;
case DMA_MAXBURST_OPTION:
/* choose to configure dma_maxburst, and save the configuration parameters */
enet_initpara.option_enable |= (uint32_t)DMA_MAXBURST_OPTION;
enet_initpara.dma_maxburst = para;
break;
case DMA_ARBITRATION_OPTION:
/* choose to configure dma_arbitration, and save the configuration parameters */
enet_initpara.option_enable |= (uint32_t)DMA_ARBITRATION_OPTION;
enet_initpara.dma_arbitration = para;
break;
case STORE_OPTION:
/* choose to configure store_forward_mode, and save the configuration parameters */
enet_initpara.option_enable |= (uint32_t)STORE_OPTION;
enet_initpara.store_forward_mode = para;
break;
case DMA_OPTION:
/* choose to configure dma_function, and save the configuration parameters */
enet_initpara.option_enable |= (uint32_t)DMA_OPTION;
enet_initpara.dma_function = para;
break;
case VLAN_OPTION:
/* choose to configure vlan_config, and save the configuration parameters */
enet_initpara.option_enable |= (uint32_t)VLAN_OPTION;
enet_initpara.vlan_config = para;
break;
case FLOWCTL_OPTION:
/* choose to configure flow_control, and save the configuration parameters */
enet_initpara.option_enable |= (uint32_t)FLOWCTL_OPTION;
enet_initpara.flow_control = para;
break;
case HASHH_OPTION:
/* choose to configure hashtable_high, and save the configuration parameters */
enet_initpara.option_enable |= (uint32_t)HASHH_OPTION;
enet_initpara.hashtable_high = para;
break;
case HASHL_OPTION:
/* choose to configure hashtable_low, and save the configuration parameters */
enet_initpara.option_enable |= (uint32_t)HASHL_OPTION;
enet_initpara.hashtable_low = para;
break;
case FILTER_OPTION:
/* choose to configure framesfilter_mode, and save the configuration parameters */
enet_initpara.option_enable |= (uint32_t)FILTER_OPTION;
enet_initpara.framesfilter_mode = para;
break;
case HALFDUPLEX_OPTION:
/* choose to configure halfduplex_param, and save the configuration parameters */
enet_initpara.option_enable |= (uint32_t)HALFDUPLEX_OPTION;
enet_initpara.halfduplex_param = para;
break;
case TIMER_OPTION:
/* choose to configure timer_config, and save the configuration parameters */
enet_initpara.option_enable |= (uint32_t)TIMER_OPTION;
enet_initpara.timer_config = para;
break;
case INTERFRAMEGAP_OPTION:
/* choose to configure interframegap, and save the configuration parameters */
enet_initpara.option_enable |= (uint32_t)INTERFRAMEGAP_OPTION;
enet_initpara.interframegap = para;
break;
default:
break;
}
}
|