Merge remote-tracking branch 'origin/develop' into NR_RRCConfiguration
This commit is contained in:
@@ -58,7 +58,7 @@ struct iovec nas_iov_rx = {nl_rx_buf, sizeof(nl_rx_buf)};
|
||||
|
||||
int nas_sock_fd[MAX_MOBILES_PER_ENB];
|
||||
|
||||
int nas_sock_mbms_fd[8];
|
||||
int nas_sock_mbms_fd;
|
||||
|
||||
struct msghdr nas_msg_tx;
|
||||
struct msghdr nas_msg_rx;
|
||||
@@ -95,21 +95,20 @@ static int tun_alloc(char *dev) {
|
||||
}
|
||||
|
||||
|
||||
int netlink_init_mbms_tun(char *ifprefix, int num_if) {
|
||||
int netlink_init_mbms_tun(char *ifprefix) {
|
||||
int ret;
|
||||
char ifname[64];
|
||||
|
||||
int i= num_if-1;
|
||||
sprintf(ifname, "oaitun_%.3s%d",ifprefix,i+1);
|
||||
nas_sock_mbms_fd[i] = tun_alloc(ifname);
|
||||
sprintf(ifname, "oaitun_%.3s1",ifprefix); // added "1": for historical reasons
|
||||
nas_sock_mbms_fd = tun_alloc(ifname);
|
||||
|
||||
if (nas_sock_mbms_fd[i] == -1) {
|
||||
if (nas_sock_mbms_fd == -1) {
|
||||
printf("[NETLINK] Error opening socket %s (%d:%s)\n",ifname,errno, strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("[NETLINK]Opened socket %s with fd %d\n",ifname,nas_sock_mbms_fd[i]);
|
||||
ret = fcntl(nas_sock_mbms_fd[i],F_SETFL,O_NONBLOCK);
|
||||
printf("[NETLINK]Opened socket %s with fd %d\n",ifname,nas_sock_mbms_fd);
|
||||
ret = fcntl(nas_sock_mbms_fd,F_SETFL,O_NONBLOCK);
|
||||
|
||||
if (ret == -1) {
|
||||
printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
|
||||
@@ -123,7 +122,7 @@ int netlink_init_mbms_tun(char *ifprefix, int num_if) {
|
||||
nas_src_addr.nl_family = AF_NETLINK;
|
||||
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
|
||||
nas_src_addr.nl_groups = 0; /* not in mcast groups */
|
||||
ret = bind(nas_sock_mbms_fd[i], (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
|
||||
ret = bind(nas_sock_mbms_fd, (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
|
||||
memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
|
||||
nas_dest_addr.nl_family = AF_NETLINK;
|
||||
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
|
||||
@@ -165,7 +164,8 @@ int netlink_init_tun(char *ifprefix, int num_if) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("[NETLINK]Opened socket %s with fd %d\n",ifname,nas_sock_fd[i]);
|
||||
printf("[NETLINK]Opened socket %s with fd nas_sock_fd[%d]=%d\n",
|
||||
ifname, i, nas_sock_fd[i]);
|
||||
ret = fcntl(nas_sock_fd[i],F_SETFL,O_NONBLOCK);
|
||||
|
||||
if (ret == -1) {
|
||||
|
||||
@@ -63,6 +63,6 @@ void clear_eNB_transport_info(uint8_t);
|
||||
void clear_UE_transport_info(uint8_t);
|
||||
int netlink_init(void);
|
||||
int netlink_init_tun(char *ifsuffix, int num_if);
|
||||
int netlink_init_mbms_tun(char *ifsuffix, int num_if);
|
||||
int netlink_init_mbms_tun(char *ifsuffix);
|
||||
|
||||
#endif /* EMU_PROTO_H_ */
|
||||
|
||||
@@ -498,7 +498,7 @@ int main(int argc, char **argv)
|
||||
uint16_t number_dmrs_symbols = 0;
|
||||
unsigned int available_bits;
|
||||
uint8_t nb_re_dmrs;
|
||||
uint8_t length_dmrs = UE->dmrs_UplinkConfig.pusch_maxLength;
|
||||
uint8_t length_dmrs = UE->pusch_config.dmrs_UplinkConfig.pusch_maxLength;
|
||||
unsigned char mod_order;
|
||||
uint16_t code_rate;
|
||||
|
||||
@@ -510,12 +510,12 @@ int main(int argc, char **argv)
|
||||
0,
|
||||
0,
|
||||
nb_symb_sch,
|
||||
&UE->dmrs_UplinkConfig,
|
||||
&UE->pusch_config.dmrs_UplinkConfig,
|
||||
UE->pusch_config.pusch_TimeDomainResourceAllocation[0]->mappingType,
|
||||
frame_parms->ofdm_symbol_size);
|
||||
|
||||
mod_order = nr_get_Qm_ul(Imcs, 0);
|
||||
nb_re_dmrs = ((UE->dmrs_UplinkConfig.pusch_dmrs_type == pusch_dmrs_type1) ? 6 : 4) * number_dmrs_symbols;
|
||||
nb_re_dmrs = ((UE->pusch_config.dmrs_UplinkConfig.pusch_dmrs_type == pusch_dmrs_type1) ? 6 : 4) * number_dmrs_symbols;
|
||||
code_rate = nr_get_code_rate_ul(Imcs, 0);
|
||||
available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, 1);
|
||||
TBS = nr_compute_tbs(mod_order, code_rate, nb_rb, nb_symb_sch, nb_re_dmrs*length_dmrs, 0, precod_nbr_layers);
|
||||
|
||||
Reference in New Issue
Block a user