Commit 6ae41237 authored by Sandeep Kumar's avatar Sandeep Kumar

some fixes for host type/dev type

parent 81ce2134
...@@ -298,7 +298,7 @@ void enb_config_display(void) ...@@ -298,7 +298,7 @@ void enb_config_display(void)
printf( "\ttx_scheduling_advance :\t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].tx_scheduling_advance); printf( "\ttx_scheduling_advance :\t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].tx_scheduling_advance);
printf( "\ttx_sample_advance : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].tx_sample_advance); printf( "\ttx_sample_advance : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].tx_sample_advance);
printf( "\tiq_txshift : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].iq_txshift); printf( "\tiq_txshift : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].iq_txshift);
printf( "\ttransport : \t%s Ethernet:\n",(enb_properties.properties[i]->rrh_gw_config[j].raw == 1)? "RAW" : "UDP"); printf( "\ttransport : \t%s Ethernet:\n",(enb_properties.properties[i]->rrh_gw_config[j].raw == 1)? "RAW" : (enb_properties.properties[i]->rrh_gw_config[j].rawif4 == 1)? "RAW_IF4" : (enb_properties.properties[i]->rrh_gw_config[j].udpif4 == 1)? "UDP_IF4" : "UDP");
if (enb_properties.properties[i]->rrh_gw_config[j].exmimo == 1) { if (enb_properties.properties[i]->rrh_gw_config[j].exmimo == 1) {
printf( "\tRF target : \tEXMIMO:\n\n"); printf( "\tRF target : \tEXMIMO:\n\n");
} else if (enb_properties.properties[i]->rrh_gw_config[j].usrp_b200 == 1) { } else if (enb_properties.properties[i]->rrh_gw_config[j].usrp_b200 == 1) {
...@@ -2242,9 +2242,9 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -2242,9 +2242,9 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1; enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1;
} else if (strcmp(tr_preference, "raw") == 0) { } else if (strcmp(tr_preference, "raw") == 0) {
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 1; enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 1;
} else if (strcmp(tr_preference, "udpif4") == 0) { } else if (strcmp(tr_preference, "udp_if4") == 0) {
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udpif4 = 1; enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udpif4 = 1;
} else if (strcmp(tr_preference, "rawif4") == 0) { } else if (strcmp(tr_preference, "raw_if4") == 0) {
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].rawif4 = 1; enb_properties.properties[enb_properties_index]->rrh_gw_config[j].rawif4 = 1;
} else {//if (strcmp(preference, "no") == 0) } else {//if (strcmp(preference, "no") == 0)
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1; enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1;
......
...@@ -390,6 +390,37 @@ int eth_set_dev_conf_raw(openair0_device *device) { ...@@ -390,6 +390,37 @@ int eth_set_dev_conf_raw(openair0_device *device) {
} }
int eth_set_dev_conf_raw_IF4(openair0_device *device) {
int Mod_id = device->Mod_id;
eth_state_t *eth = (eth_state_t*)device->priv;
void *msg;
ssize_t msg_len;
/* a BBU client sends to RRH a set of configuration parameters (openair0_config_t)
so that RF front end is configured appropriately and
frame/packet size etc. can be set */
msg = malloc(MAC_HEADER_SIZE_BYTES + sizeof(openair0_config_t));
msg_len = MAC_HEADER_SIZE_BYTES + sizeof(openair0_config_t);
memcpy(msg,(void*)&eth->eh,MAC_HEADER_SIZE_BYTES);
memcpy((msg+MAC_HEADER_SIZE_BYTES),(void*)device->openair0_cfg,sizeof(openair0_config_t));
if (send(eth->sockfd[Mod_id],
msg,
msg_len,
0)==-1) {
perror("ETHERNET: ");
exit(0);
}
return 0;
}
int eth_get_dev_conf_raw(openair0_device *device) { int eth_get_dev_conf_raw(openair0_device *device) {
eth_state_t *eth = (eth_state_t*)device->priv; eth_state_t *eth = (eth_state_t*)device->priv;
...@@ -418,3 +449,33 @@ int eth_get_dev_conf_raw(openair0_device *device) { ...@@ -418,3 +449,33 @@ int eth_get_dev_conf_raw(openair0_device *device) {
return 0; return 0;
} }
int eth_get_dev_conf_raw_IF4(openair0_device *device) {
eth_state_t *eth = (eth_state_t*)device->priv;
int Mod_id = device->Mod_id;
char str[INET_ADDRSTRLEN];
void *msg;
ssize_t msg_len;
msg = malloc(MAC_HEADER_SIZE_BYTES + sizeof(openair0_config_t));
msg_len = MAC_HEADER_SIZE_BYTES + sizeof(openair0_config_t);
/* RRH receives from BBU openair0_config_t */
if (recv(eth->sockfd[Mod_id],
msg,
msg_len,
0)==-1) {
perror("ETHERNET: ");
exit(0);
}
/* RRH stores the remote MAC address */
memcpy(eth->eh.ether_dhost,(msg+ETH_ALEN),ETH_ALEN);
//memcpy((void*)&device->openair0_cfg,(msg + MAC_HEADER_SIZE_BYTES), sizeof(openair0_config_t));
//device->openair0_cfg=(openair0_config_t *)(msg + MAC_HEADER_SIZE_BYTES);
printf("[%s] binding mod_%d to hardware address %x:%x:%x:%x:%x:%x hardware address %x:%x:%x:%x:%x:%x\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"),Mod_id,eth->eh.ether_shost[0],eth->eh.ether_shost[1],eth->eh.ether_shost[2],eth->eh.ether_shost[3],eth->eh.ether_shost[4],eth->eh.ether_shost[5],eth->eh.ether_dhost[0],eth->eh.ether_dhost[1],eth->eh.ether_dhost[2],eth->eh.ether_dhost[3],eth->eh.ether_dhost[4],eth->eh.ether_dhost[5]);
return 0;
}
...@@ -63,7 +63,7 @@ int trx_eth_start(openair0_device *device) { ...@@ -63,7 +63,7 @@ int trx_eth_start(openair0_device *device) {
eth_state_t *eth = (eth_state_t*)device->priv; eth_state_t *eth = (eth_state_t*)device->priv;
/* initialize socket */ /* initialize socket */
if ((eth->flags & ETH_RAW_MODE) != 0 ) { if (eth->flags == ETH_RAW_MODE) {
if (eth_socket_init_raw(device)!=0) return -1; if (eth_socket_init_raw(device)!=0) return -1;
/* RRH gets openair0 device configuration - BBU sets openair0 device configuration*/ /* RRH gets openair0 device configuration - BBU sets openair0 device configuration*/
if (device->host_type == BBU_HOST) { if (device->host_type == BBU_HOST) {
...@@ -73,6 +73,21 @@ int trx_eth_start(openair0_device *device) { ...@@ -73,6 +73,21 @@ int trx_eth_start(openair0_device *device) {
} }
/* adjust MTU wrt number of samples per packet */ /* adjust MTU wrt number of samples per packet */
if(ethernet_tune (device,MTU_SIZE,RAW_PACKET_SIZE_BYTES(device->openair0_cfg->samples_per_packet))!=0) return -1; if(ethernet_tune (device,MTU_SIZE,RAW_PACKET_SIZE_BYTES(device->openair0_cfg->samples_per_packet))!=0) return -1;
} else if (eth->flags == ETH_RAW_IF4_MODE) {
if (eth_socket_init_raw(device)!=0) return -1;
/* RRH gets openair0 device configuration - BBU sets openair0 device configuration*/
if (device->host_type == BBU_HOST) {
if(eth_set_dev_conf_raw_IF4(device)!=0) return -1;
} else {
if(eth_get_dev_conf_raw_IF4(device)!=0) return -1;
}
/* adjust MTU wrt number of samples per packet */
if(ethernet_tune (device,MTU_SIZE,RAW_PACKET_SIZE_BYTES(device->openair0_cfg->samples_per_packet))!=0) return -1;
} else if (eth->flags == ETH_UDP_IF4_MODE) {
} else { } else {
if (eth_socket_init_udp(device)!=0) return -1; if (eth_socket_init_udp(device)!=0) return -1;
/* RRH gets openair0 device configuration - BBU sets openair0 device configuration*/ /* RRH gets openair0 device configuration - BBU sets openair0 device configuration*/
......
...@@ -226,6 +226,7 @@ int trx_eth_write_raw_IF4(openair0_device *device, openair0_timestamp timestamp, ...@@ -226,6 +226,7 @@ int trx_eth_write_raw_IF4(openair0_device *device, openair0_timestamp timestamp,
int trx_eth_read_raw_IF4(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc); int trx_eth_read_raw_IF4(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc);
int eth_get_dev_conf_raw(openair0_device *device); int eth_get_dev_conf_raw(openair0_device *device);
int eth_set_dev_conf_raw(openair0_device *device); int eth_set_dev_conf_raw(openair0_device *device);
int eth_get_dev_conf_raw_IF4(openair0_device *device);
int eth_set_dev_conf_raw_IF4(openair0_device *device);
#endif #endif
...@@ -1541,13 +1541,6 @@ int main( int argc, char **argv ) ...@@ -1541,13 +1541,6 @@ int main( int argc, char **argv )
openair0_cfg[card].my_port = eth_params->my_port; openair0_cfg[card].my_port = eth_params->my_port;
} }
//if (node_function == NGFI_RCC_IF4 || node_function == NGFI_RRU_IF4) {
//openair0_cfg[card].remote_addr = eth_params->remote_addr;
//openair0_cfg[card].remote_port = eth_params->remote_port;
//openair0_cfg[card].my_addr = eth_params->my_addr;
//openair0_cfg[card].my_port = eth_params->my_port;
//}
printf("HW: Configuring card %d, nb_antennas_tx/rx %d/%d\n",card, printf("HW: Configuring card %d, nb_antennas_tx/rx %d/%d\n",card,
((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_tx), ((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_tx),
((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_rx : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx)); ((UE_flag==0) ? PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_rx : PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx));
...@@ -1648,11 +1641,17 @@ int main( int argc, char **argv ) ...@@ -1648,11 +1641,17 @@ int main( int argc, char **argv )
openair0_cfg[0].log_level = glog_level; openair0_cfg[0].log_level = glog_level;
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
PHY_vars_eNB_g[0][CC_id]->rfdevice.host_type = BBU_HOST; if (node_function == NGFI_RRU_IF4) {
PHY_vars_eNB_g[0][CC_id]->rfdevice.host_type = RRH_HOST;
PHY_vars_eNB_g[0][CC_id]->ifdevice.host_type = RRH_HOST;
} else {
PHY_vars_eNB_g[0][CC_id]->rfdevice.host_type = BBU_HOST;
PHY_vars_eNB_g[0][CC_id]->ifdevice.host_type = BBU_HOST;
}
PHY_vars_eNB_g[0][CC_id]->rfdevice.type = NONE_DEV; PHY_vars_eNB_g[0][CC_id]->rfdevice.type = NONE_DEV;
PHY_vars_eNB_g[0][CC_id]->rfdevice.transp_type = NONE_TP; PHY_vars_eNB_g[0][CC_id]->rfdevice.transp_type = NONE_TP;
PHY_vars_eNB_g[0][CC_id]->ifdevice.host_type = BBU_HOST;
PHY_vars_eNB_g[0][CC_id]->ifdevice.type = NONE_DEV; PHY_vars_eNB_g[0][CC_id]->ifdevice.type = NONE_DEV;
PHY_vars_eNB_g[0][CC_id]->ifdevice.transp_type = NONE_TP; PHY_vars_eNB_g[0][CC_id]->ifdevice.transp_type = NONE_TP;
} }
...@@ -1663,7 +1662,6 @@ int main( int argc, char **argv ) ...@@ -1663,7 +1662,6 @@ int main( int argc, char **argv )
openair0.type = NONE_DEV; openair0.type = NONE_DEV;
/* transport type is initialized NONE_TP (no transport protocol) when the transport protocol will be initiated transport protocol type will be set */ /* transport type is initialized NONE_TP (no transport protocol) when the transport protocol will be initiated transport protocol type will be set */
openair0.transp_type = NONE_TP; openair0.transp_type = NONE_TP;
//openair0_cfg[0].log_level = glog_level;
// Legacy BBU - RRH init // Legacy BBU - RRH init
//int returns=-1; //int returns=-1;
...@@ -1691,9 +1689,7 @@ int main( int argc, char **argv ) ...@@ -1691,9 +1689,7 @@ int main( int argc, char **argv )
//else if (mode==loop_through_memory) { //else if (mode==loop_through_memory) {
//} //}
//} //}
//printf("Done\n");
int returns=-1; int returns=-1;
// Handle spatially distributed MIMO antenna ports // Handle spatially distributed MIMO antenna ports
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment