Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michael Black
OpenXG UE
Commits
9b1c68dd
Commit
9b1c68dd
authored
Nov 20, 2015
by
aikaterini.trilyraki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initialization for remote/local_mac
parent
c30d58f9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
44 deletions
+40
-44
targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
+4
-4
targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
+36
-40
No files found.
targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
View file @
9b1c68dd
...
@@ -71,11 +71,11 @@ int eth_socket_init_raw(openair0_device *device) {
...
@@ -71,11 +71,11 @@ int eth_socket_init_raw(openair0_device *device) {
int
sock_type
=
0
;
int
sock_type
=
0
;
int
sock_proto
=
0
;
int
sock_proto
=
0
;
if
(
device
->
host_type
==
RRH_HOST
)
{
if
(
device
->
host_type
==
RRH_HOST
)
{
/* RRH doesn't know remote MAC(will be retrieved from first packet send from BBU) and remote port(don't care) */
local_mac
=
device
->
openair0_cfg
.
my_addr
;
local_mac
=
device
->
openair0_cfg
.
my_addr
;
local_port
=
device
->
openair0_cfg
.
my_port
;
local_port
=
device
->
openair0_cfg
.
my_port
;
remote_mac
=
"0:0:0:0:0:0"
;
remote_mac
=
malloc
(
ETH_ALEN
)
;
remote_port
=
device
->
openair0_cfg
.
my_port
;
remote_port
=
0
;
printf
(
"[%s] local MAC addr %s remote MAC addr %s
\n
"
,
"RRH"
,
local_mac
,
remote_mac
);
printf
(
"[%s] local MAC addr %s remote MAC addr %s
\n
"
,
"RRH"
,
local_mac
,
remote_mac
);
}
else
{
}
else
{
local_mac
=
device
->
openair0_cfg
.
my_addr
;
local_mac
=
device
->
openair0_cfg
.
my_addr
;
...
...
targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
View file @
9b1c68dd
...
@@ -174,39 +174,38 @@ int ethernet_tune(openair0_device *device, unsigned int option, int value) {
...
@@ -174,39 +174,38 @@ int ethernet_tune(openair0_device *device, unsigned int option, int value) {
int
ret
=
0
;
int
ret
=
0
;
int
i
=
0
;
int
i
=
0
;
if
(
1
==
0
)
{
/***************** get working interface name ***************************/
/***************** get working interface name ***************************/
/* /\* convert ascii ip address from config file to network binary format *\/ */
/* convert ascii ip address from config file to network binary format */
/* inet_aton(device->openair0_cfg.my_addr, &ia); */
inet_aton
(
device
->
openair0_cfg
.
my_addr
,
&
ia
);
*/
/* /\* look for the interface used, we have its ip address *\/ */
/* look for the interface used, we have its ip address get info on all our network interfaces*/
/* /\* get info on all our network interfaces *\/ */
ids
=
if_nameindex
();
/* ids = if_nameindex(); */
/* loop on these network interfaces */
/* /\* loop on these network interfaces *\/ */
for
(
i
=
0
;
ids
[
i
].
if_index
!=
0
;
i
++
)
{
/* for (i=0; ids[i].if_index != 0 ; i++) { */
/* skip unamed interfaces */
/* /\* skip unamed interfaces *\/ */
if
(
ids
[
i
].
if_name
==
NULL
)
/* if (ids[i].if_name == NULL) */
continue
;
/* continue; */
/* get ip address of current network interface */
/* /\* get ip address of current network interface *\/ */
strcpy
(
ifr
.
ifr_name
,
ids
[
i
].
if_name
);
/* strcpy(ifr.ifr_name,ids[i].if_name); */
if
(
-
1
==
ioctl
(
eth
->
sockfd
[
Mod_id
],
SIOCGIFADDR
,
&
ifr
))
{
/* if (-1 == ioctl(eth->sockfd[Mod_id], SIOCGIFADDR, &ifr)) { */
printf
(
" Interface %i: %s isn't configured (no ip addr), skipped
\n
"
,
ids
[
i
].
if_index
,
ifr
.
ifr_name
);
/* printf( " Interface %i: %s isn't configured (no ip addr), skipped\n",ids[i].if_index, ifr.ifr_name) ; */
continue
;
/* continue; */
}
/* } */
/* test if this is the interface to be used */
/* /\* test if this is the interface to be used *\/ */
if
(
((
struct
sockaddr_in
*
)
&
ifr
.
ifr_addr
)
->
sin_addr
.
s_addr
!=
ia
.
s_addr
)
/* if ( ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr != ia.s_addr) */
continue
;
/* continue; */
/* store interface name */
/* /\* store interface name *\/ */
if_name
=
ids
[
i
].
if_name
;
/* if_name = ids[i].if_name; */
break
;
/* break; */
/* } */
/* if_freenameindex(ids); */
/* if( if_name == NULL) { */
/* printf("Unable to find interface name for %s\n",device->openair0_cfg.my_addr); */
/* return -1; */
/* } */
/* eth->if_name[Mod_id]=if_name; */
}
if_freenameindex
(
ids
);
if
(
if_name
==
NULL
)
{
printf
(
"Unable to find interface name for %s
\n
"
,
device
->
openair0_cfg
.
my_addr
);
return
-
1
;
}
eth
->
if_name
[
Mod_id
]
=
if_name
;
}
/****************** socket level options ************************/
/****************** socket level options ************************/
switch
(
option
)
{
switch
(
option
)
{
case
SND_BUF_SIZE
:
/* transmit socket buffer size */
case
SND_BUF_SIZE
:
/* transmit socket buffer size */
...
@@ -342,9 +341,9 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, cha
...
@@ -342,9 +341,9 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, cha
memset
(
eth
,
0
,
sizeof
(
eth_state_t
));
memset
(
eth
,
0
,
sizeof
(
eth_state_t
));
int
card
=
0
;
int
card
=
0
;
/*h
oe
dcoded!!!!*/
/*h
ar
dcoded!!!!*/
eth
->
flags
=
ETH_RAW_MODE
;
eth
->
flags
=
ETH_RAW_MODE
;
eth
->
buffer_size
=
(
unsigned
int
)
openair0_cfg
[
card
].
samples_per_packet
*
sizeof
(
int32_t
);
// buffer size = 4096 for sample_len of 1024
eth
->
buffer_size
=
(
unsigned
int
)
openair0_cfg
[
card
].
samples_per_packet
*
sizeof
(
int32_t
);
printf
(
"[ETHERNET]: Initializing openair0_device for %s ...
\n
"
,
((
device
->
host_type
==
BBU_HOST
)
?
"BBU"
:
"RRH"
));
printf
(
"[ETHERNET]: Initializing openair0_device for %s ...
\n
"
,
((
device
->
host_type
==
BBU_HOST
)
?
"BBU"
:
"RRH"
));
device
->
Mod_id
=
num_devices_eth
++
;
device
->
Mod_id
=
num_devices_eth
++
;
...
@@ -366,16 +365,13 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, cha
...
@@ -366,16 +365,13 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, cha
device
->
trx_write_func
=
trx_eth_write_udp
;
device
->
trx_write_func
=
trx_eth_write_udp
;
device
->
trx_read_func
=
trx_eth_read_udp
;
device
->
trx_read_func
=
trx_eth_read_udp
;
}
}
/*h
oe
dcoded!!!!*/
/*h
ar
dcoded!!!!*/
eth
->
if_name
[
device
->
Mod_id
]
=
"eth0"
;
eth
->
if_name
[
device
->
Mod_id
]
=
"eth0"
;
device
->
priv
=
eth
;
device
->
priv
=
eth
;
openair0_cfg
->
iq_txshift
=
5
;
openair0_cfg
->
iq_txshift
=
5
;
openair0_cfg
->
iq_rxrescale
=
15
;
openair0_cfg
->
iq_rxrescale
=
15
;
memcpy
((
void
*
)
&
device
->
openair0_cfg
,(
void
*
)
openair0_cfg
,
sizeof
(
openair0_config_t
));
memcpy
((
void
*
)
&
device
->
openair0_cfg
,(
void
*
)
openair0_cfg
,
sizeof
(
openair0_config_t
));
/*iqoffset*/
/*keep conf*/
/*usrsignal */
return
0
;
return
0
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment