mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-30 01:52:51 +00:00
WIFI-1355 Configure MIMO mode
This patch will add fix for MIMO mode configuration issue Signed-off-by: Nagendrababu <nagendrababu.bonkuri@connectus.ai>
This commit is contained in:
committed by
Rick Sommerville
parent
f65c9cd537
commit
fb04fbbd00
60
feeds/wlan-ap/opensync/patches/26-radio-table-rx-chainmask
Normal file
60
feeds/wlan-ap/opensync/patches/26-radio-table-rx-chainmask
Normal file
@@ -0,0 +1,60 @@
|
||||
--- a/interfaces/opensync.ovsschema
|
||||
+++ b/interfaces/opensync.ovsschema
|
||||
@@ -1419,6 +1419,15 @@
|
||||
"max":1
|
||||
}
|
||||
},
|
||||
+ "rx_chainmask": {
|
||||
+ "type": {
|
||||
+ "key": {
|
||||
+ "type": "integer"
|
||||
+ },
|
||||
+ "min":0,
|
||||
+ "max":1
|
||||
+ }
|
||||
+ },
|
||||
"thermal_tx_chainmask": {
|
||||
"type": {
|
||||
"key": {
|
||||
@@ -1740,6 +1749,15 @@
|
||||
"max":1
|
||||
}
|
||||
},
|
||||
+ "rx_chainmask": {
|
||||
+ "type": {
|
||||
+ "key": {
|
||||
+ "type": "integer"
|
||||
+ },
|
||||
+ "min":0,
|
||||
+ "max":1
|
||||
+ }
|
||||
+ },
|
||||
"thermal_tx_chainmask": {
|
||||
"type": {
|
||||
"key": {
|
||||
--- a/src/wm2/src/wm2_radio.c
|
||||
+++ b/src/wm2/src/wm2_radio.c
|
||||
@@ -581,6 +581,7 @@ wm2_rconf_changed(const struct schema_Wi
|
||||
CMP(CHANGED_INT, thermal_downgrade_temp);
|
||||
CMP(CHANGED_INT, thermal_upgrade_temp);
|
||||
CMP(CHANGED_INT, tx_chainmask);
|
||||
+ CMP(CHANGED_INT, rx_chainmask);
|
||||
CMP(CHANGED_INT, tx_power);
|
||||
CMP(CHANGED_INT, bcn_int);
|
||||
CMP(CHANGED_INT, dfs_demo);
|
||||
--- a/src/wm2/src/wm2_radio1.c
|
||||
+++ b/src/wm2/src/wm2_radio1.c
|
||||
@@ -470,6 +470,13 @@ wm2_radio_equal(
|
||||
rconf_set->tx_chainmask_exists = true;
|
||||
}
|
||||
}
|
||||
+ if (ovsdb_update_changed(mon, SCHEMA_COLUMN(Wifi_Radio_Config, rx_chainmask))) {
|
||||
+ RADIO_EQUAL(SCHEMA_FIELD_CMP_INT(rconf, &rstate, rx_chainmask));
|
||||
+ if (!is_equal) {
|
||||
+ rconf_set->rx_chainmask = rconf->rx_chainmask;
|
||||
+ rconf_set->rx_chainmask_exists = true;
|
||||
+ }
|
||||
+ }
|
||||
if (ovsdb_update_changed(mon, SCHEMA_COLUMN(Wifi_Radio_Config, temperature_control))){
|
||||
if (rconf->temperature_control_len == rstate.temperature_control_len) {
|
||||
for (index = 0; index < rconf->temperature_control_len; index++) {
|
||||
@@ -7,6 +7,9 @@ extern int phy_from_path(char *path, char *phy);
|
||||
extern int phy_get_mac(char *phy, char *mac);
|
||||
extern int phy_find_hwmon(char *path, char *hwmon);
|
||||
extern int phy_get_tx_chainmask(const char *name);
|
||||
extern int phy_get_rx_chainmask(const char *name);
|
||||
extern int phy_get_tx_available_antenna(const char *name);
|
||||
extern int phy_get_rx_available_antenna(const char *name);
|
||||
extern int phy_get_channels(const char *name, int *channel);
|
||||
extern int phy_get_channels_state(const char *name,
|
||||
struct schema_Wifi_Radio_State *rstate);
|
||||
|
||||
@@ -49,6 +49,7 @@ enum {
|
||||
WDEV_ATTR_COUNTRY,
|
||||
WDEV_ATTR_CHANBW,
|
||||
WDEV_ATTR_TX_ANTENNA,
|
||||
WDEV_ATTR_RX_ANTENNA,
|
||||
WDEV_ATTR_FREQ_BAND,
|
||||
WDEV_ATTR_DISABLE_B_RATES,
|
||||
__WDEV_ATTR_MAX,
|
||||
@@ -64,7 +65,8 @@ static const struct blobmsg_policy wifi_device_policy[__WDEV_ATTR_MAX] = {
|
||||
[WDEV_ATTR_HWMODE] = { .name = "hwmode", .type = BLOBMSG_TYPE_STRING },
|
||||
[WDEV_ATTR_COUNTRY] = { .name = "country", .type = BLOBMSG_TYPE_STRING },
|
||||
[WDEV_ATTR_CHANBW] = { .name = "chanbw", .type = BLOBMSG_TYPE_INT32 },
|
||||
[WDEV_ATTR_TX_ANTENNA] = { .name = "tx_antenna", .type = BLOBMSG_TYPE_INT32 },
|
||||
[WDEV_ATTR_TX_ANTENNA] = { .name = "txantenna", .type = BLOBMSG_TYPE_INT32 },
|
||||
[WDEV_ATTR_RX_ANTENNA] = { .name = "rxantenna", .type = BLOBMSG_TYPE_INT32 },
|
||||
[WDEV_ATTR_FREQ_BAND] = { .name = "freq_band", .type = BLOBMSG_TYPE_STRING },
|
||||
[WDEV_ATTR_DISABLE_B_RATES] = { .name = "legacy_rates", .type = BLOBMSG_TYPE_BOOL },
|
||||
};
|
||||
@@ -199,6 +201,11 @@ static bool radio_state_update(struct uci_section *s, struct schema_Wifi_Radio_C
|
||||
else
|
||||
SCHEMA_SET_INT(rstate.tx_chainmask, phy_get_tx_chainmask(phy));
|
||||
|
||||
if (tb[WDEV_ATTR_RX_ANTENNA])
|
||||
SCHEMA_SET_INT(rstate.rx_chainmask, blobmsg_get_u32(tb[WDEV_ATTR_RX_ANTENNA]));
|
||||
else
|
||||
SCHEMA_SET_INT(rstate.rx_chainmask, phy_get_rx_chainmask(phy));
|
||||
|
||||
if (rstate.hw_mode_exists && rstate.ht_mode_exists) {
|
||||
struct mode_map *m = mode_map_get_cloud(rstate.ht_mode, rstate.hw_mode);
|
||||
|
||||
@@ -263,6 +270,12 @@ bool target_radio_config_set2(const struct schema_Wifi_Radio_Config *rconf,
|
||||
blob_buf_init(&b, 0);
|
||||
blob_buf_init(&del, 0);
|
||||
|
||||
char phy[6];
|
||||
char ifname[8];
|
||||
|
||||
strncpy(ifname, rconf->if_name, sizeof(ifname));
|
||||
strncpy(phy, target_map_ifname(ifname), sizeof(phy));
|
||||
|
||||
if (changed->channel && rconf->channel)
|
||||
blobmsg_add_u32(&b, "channel", rconf->channel);
|
||||
|
||||
@@ -272,8 +285,29 @@ bool target_radio_config_set2(const struct schema_Wifi_Radio_Config *rconf,
|
||||
if (changed->tx_power)
|
||||
blobmsg_add_u32(&b, "txpower", rconf->tx_power);
|
||||
|
||||
if (changed->tx_chainmask)
|
||||
blobmsg_add_u32(&b, "tx_antenna", rconf->tx_chainmask);
|
||||
if (changed->tx_chainmask) {
|
||||
int tx_ant_avail;
|
||||
tx_ant_avail=phy_get_tx_available_antenna(phy);
|
||||
|
||||
if ((rconf->tx_chainmask & tx_ant_avail) != rconf->tx_chainmask) {
|
||||
blobmsg_add_u32(&b, "txantenna", tx_ant_avail);
|
||||
LOGN("maximum number of tx antennae available to use:%d",tx_ant_avail);
|
||||
}
|
||||
else
|
||||
blobmsg_add_u32(&b, "txantenna", rconf->tx_chainmask);
|
||||
}
|
||||
|
||||
if (changed->rx_chainmask) {
|
||||
int rx_ant_avail;
|
||||
rx_ant_avail=phy_get_rx_available_antenna(phy);
|
||||
|
||||
if ((rconf->rx_chainmask & rx_ant_avail) != rconf->rx_chainmask) {
|
||||
blobmsg_add_u32(&b, "rxantenna", rx_ant_avail);
|
||||
LOGN("maximum number of rx antennae available to use:%d",rx_ant_avail);
|
||||
}
|
||||
else
|
||||
blobmsg_add_u32(&b, "rxantenna", rconf->rx_chainmask);
|
||||
}
|
||||
|
||||
if (changed->country)
|
||||
blobmsg_add_string(&b, "country", rconf->country);
|
||||
|
||||
@@ -208,6 +208,33 @@ int phy_get_tx_chainmask(const char *name)
|
||||
return phy->tx_ant;
|
||||
}
|
||||
|
||||
int phy_get_rx_chainmask(const char *name)
|
||||
{
|
||||
struct wifi_phy *phy = phy_find(name);
|
||||
|
||||
if (!phy)
|
||||
return 0;
|
||||
return phy->rx_ant;
|
||||
}
|
||||
|
||||
int phy_get_tx_available_antenna(const char *name)
|
||||
{
|
||||
struct wifi_phy *phy = phy_find(name);
|
||||
|
||||
if (!phy)
|
||||
return 0;
|
||||
return phy->tx_ant_avail;
|
||||
}
|
||||
|
||||
int phy_get_rx_available_antenna(const char *name)
|
||||
{
|
||||
struct wifi_phy *phy = phy_find(name);
|
||||
|
||||
if (!phy)
|
||||
return 0;
|
||||
return phy->rx_ant_avail;
|
||||
}
|
||||
|
||||
int phy_get_channels(const char *name, int *channel)
|
||||
{
|
||||
struct wifi_phy *phy = phy_find(name);
|
||||
|
||||
Reference in New Issue
Block a user