git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5494 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -5,14 +5,8 @@
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
|
||||
#ifdef EXMIMO
|
||||
#ifdef DRIVER2013
|
||||
#include "openair0_lib.h"
|
||||
extern int card;
|
||||
#else
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void
|
||||
@@ -20,11 +14,7 @@ phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id) {
|
||||
|
||||
uint16_t rx_power_fil_dB;
|
||||
#ifdef EXMIMO
|
||||
#ifdef DRIVER2013
|
||||
exmimo_config_t *p_exmimo_config = openair0_exmimo_pci[card].exmimo_config_ptr;
|
||||
#endif
|
||||
#endif
|
||||
#if defined(EXMIMO) || defined(CBMIMO1)
|
||||
uint16_t i;
|
||||
#endif
|
||||
|
||||
@@ -61,61 +51,39 @@ phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id) {
|
||||
}
|
||||
|
||||
|
||||
#ifdef CBMIMO1
|
||||
for (i=0;i<number_of_cards;i++) {
|
||||
//openair_set_rx_rf_mode(i,openair_daq_vars.rx_rf_mode);
|
||||
openair_set_rx_gain_cal_openair(i,phy_vars_ue->rx_total_gain_dB);
|
||||
}
|
||||
#else
|
||||
#ifdef EXMIMO
|
||||
|
||||
//switch (phy_vars_ue->rx_gain_mode[0]) {
|
||||
//case max_gain:
|
||||
if (phy_vars_ue->rx_total_gain_dB>phy_vars_ue->rx_gain_max[0]) {
|
||||
phy_vars_ue->rx_total_gain_dB = phy_vars_ue->rx_gain_max[0];
|
||||
#ifdef DRIVER2013
|
||||
for (i=0;i<phy_vars_ue->lte_frame_parms.nb_antennas_rx;i++) {
|
||||
p_exmimo_config->rf.rx_gain[i][0] = 30;
|
||||
}
|
||||
#else
|
||||
exmimo_pci_interface->rf.rx_gain00 = 30;
|
||||
exmimo_pci_interface->rf.rx_gain10 = 30;
|
||||
#endif
|
||||
if (phy_vars_ue->rx_total_gain_dB>phy_vars_ue->rx_gain_max[0]) {
|
||||
phy_vars_ue->rx_total_gain_dB = phy_vars_ue->rx_gain_max[0];
|
||||
for (i=0;i<phy_vars_ue->lte_frame_parms.nb_antennas_rx;i++) {
|
||||
p_exmimo_config->rf.rx_gain[i][0] = 30;
|
||||
}
|
||||
|
||||
}
|
||||
else if (phy_vars_ue->rx_total_gain_dB<(phy_vars_ue->rx_gain_max[0]-30)) {
|
||||
// for the moment we stay in max gain mode
|
||||
phy_vars_ue->rx_total_gain_dB = phy_vars_ue->rx_gain_max[0] - 30;
|
||||
for (i=0;i<phy_vars_ue->lte_frame_parms.nb_antennas_rx;i++) {
|
||||
p_exmimo_config->rf.rx_gain[i][0] = 0;
|
||||
}
|
||||
/*
|
||||
phy_vars_ue->rx_gain_mode[0] = byp;
|
||||
phy_vars_ue->rx_gain_mode[1] = byp;
|
||||
exmimo_pci_interface->rf.rf_mode0 = 22991; //bypass
|
||||
exmimo_pci_interface->rf.rf_mode1 = 22991; //bypass
|
||||
|
||||
if (phy_vars_ue->rx_total_gain_dB<(phy_vars_ue->rx_gain_byp[0]-50)) {
|
||||
exmimo_pci_interface->rf.rx_gain00 = 0;
|
||||
exmimo_pci_interface->rf.rx_gain10 = 0;
|
||||
}
|
||||
*/
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
else if (phy_vars_ue->rx_total_gain_dB<(phy_vars_ue->rx_gain_max[0]-30)) {
|
||||
// for the moment we stay in max gain mode
|
||||
phy_vars_ue->rx_total_gain_dB = phy_vars_ue->rx_gain_max[0] - 30;
|
||||
#ifdef DRIVER2013
|
||||
for (i=0;i<phy_vars_ue->lte_frame_parms.nb_antennas_rx;i++) {
|
||||
p_exmimo_config->rf.rx_gain[i][0] = 0;
|
||||
}
|
||||
#else
|
||||
exmimo_pci_interface->rf.rx_gain00 = 0;
|
||||
exmimo_pci_interface->rf.rx_gain10 = 0;
|
||||
#endif
|
||||
/*
|
||||
phy_vars_ue->rx_gain_mode[0] = byp;
|
||||
phy_vars_ue->rx_gain_mode[1] = byp;
|
||||
exmimo_pci_interface->rf.rf_mode0 = 22991; //bypass
|
||||
exmimo_pci_interface->rf.rf_mode1 = 22991; //bypass
|
||||
|
||||
if (phy_vars_ue->rx_total_gain_dB<(phy_vars_ue->rx_gain_byp[0]-50)) {
|
||||
exmimo_pci_interface->rf.rx_gain00 = 0;
|
||||
exmimo_pci_interface->rf.rx_gain10 = 0;
|
||||
}
|
||||
*/
|
||||
}
|
||||
else {
|
||||
#ifdef DRIVER2013
|
||||
for (i=0;i<phy_vars_ue->lte_frame_parms.nb_antennas_rx;i++) {
|
||||
p_exmimo_config->rf.rx_gain[i][0] = 30 - phy_vars_ue->rx_gain_max[0] + phy_vars_ue->rx_total_gain_dB;
|
||||
}
|
||||
#else
|
||||
exmimo_pci_interface->rf.rx_gain00 = 30 - phy_vars_ue->rx_gain_max[0] + phy_vars_ue->rx_total_gain_dB;
|
||||
exmimo_pci_interface->rf.rx_gain10 = 30 - phy_vars_ue->rx_gain_max[1] + phy_vars_ue->rx_total_gain_dB;
|
||||
#endif
|
||||
}
|
||||
for (i=0;i<phy_vars_ue->lte_frame_parms.nb_antennas_rx;i++) {
|
||||
p_exmimo_config->rf.rx_gain[i][0] = 30 - phy_vars_ue->rx_gain_max[0] + phy_vars_ue->rx_total_gain_dB;
|
||||
}
|
||||
}
|
||||
/*
|
||||
break;
|
||||
case med_gain:
|
||||
@@ -151,7 +119,6 @@ phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id) {
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
/* if ((phy_vars_ue->frame%100==0) || (phy_vars_ue->frame < 10))
|
||||
|
||||
Reference in New Issue
Block a user