diff --git a/config/openwrt/banana-pi/InterfaceMap.json b/config/openwrt/banana-pi/InterfaceMap.json index 4a442cce8e..e5542bd92f 100644 --- a/config/openwrt/banana-pi/InterfaceMap.json +++ b/config/openwrt/banana-pi/InterfaceMap.json @@ -14,6 +14,21 @@ "vlanId": 0, "vapIndex": 16, "vapName": "private_ssid_6g" + }, + { + "InterfaceName": "wifi2.1", + "MldName": "mld1", + "Bridge": "br-lan", + "vlanId": 0, + "vapIndex": 22, + "vapName": "mesh_backhaul_6g" + }, + { + "InterfaceName": "wifi2.2", + "Bridge": "br-lan", + "vlanId": 0, + "vapIndex": 17, + "vapName": "iot_ssid_6g" } ] }, @@ -31,6 +46,7 @@ }, { "InterfaceName": "wifi1.1", + "MldName": "mld1", "Bridge": "br-lan", "vlanId": 0, "vapIndex": 13, @@ -66,6 +82,7 @@ }, { "InterfaceName": "wifi0.1", + "MldName": "mld1", "Bridge": "br-lan", "vlanId": 0, "vapIndex": 12, diff --git a/config/openwrt/banana-pi/wifi_interface_down.sh b/config/openwrt/banana-pi/wifi_interface_down.sh index f4aab10a32..9d12279b43 100755 --- a/config/openwrt/banana-pi/wifi_interface_down.sh +++ b/config/openwrt/banana-pi/wifi_interface_down.sh @@ -9,9 +9,10 @@ ifconfig wifi1.1 down ifconfig wifi1.2 down ifconfig wifi1.3 down ifconfig wifi2 down -#ifconfig wifi2.1 down -#ifconfig wifi2.2 down +ifconfig wifi2.1 down +ifconfig wifi2.2 down ifconfig mld0 down +ifconfig mld1 down #delete the interfaces iw dev wifi0 del @@ -22,6 +23,7 @@ iw dev wifi1.1 del iw dev wifi1.2 del iw dev wifi1.3 del iw dev wifi2 del -#iw dev wifi2.1 del -#iw dev wifi2.2 del +iw dev wifi2.1 del +iw dev wifi2.2 del iw dev mld0 del +iw dev mld1 del diff --git a/config/openwrt/banana-pi/wifi_interface_up.sh b/config/openwrt/banana-pi/wifi_interface_up.sh index cbbf0df49d..1e6315d2b6 100755 --- a/config/openwrt/banana-pi/wifi_interface_up.sh +++ b/config/openwrt/banana-pi/wifi_interface_up.sh @@ -10,9 +10,10 @@ iw phy phy0 interface add wifi1.1 type __ap iw phy phy0 interface add wifi1.2 type __ap iw phy phy0 interface add wifi1.3 type __ap iw phy phy0 interface add wifi2 type __ap -#iw phy phy0 interface add wifi2.1 type __ap -#iw phy phy0 interface add wifi2.2 type __ap +iw phy phy0 interface add wifi2.1 type __ap +iw phy phy0 interface add wifi2.2 type __ap iw phy phy0 interface add mld0 type __ap radios all +iw phy phy0 interface add mld1 type __ap radios all #Derive the initial wifi mac address from eth0 or erouter0 address #as they are unique for each Banana PI @@ -58,11 +59,11 @@ wifi1_3_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') mac_incr=$(($primary_wifi_mac + 32)) wifi2_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') #Increment again by 1 to get wifi2.1 address -#mac_incr=$(($mac_incr + 1)) -#wifi2_1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') +mac_incr=$(($mac_incr + 1)) +wifi2_1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') #Increment again by 1 to get wifi2.2 address -#mac_incr=$(($mac_incr + 1)) -#wifi2_2_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') +mac_incr=$(($mac_incr + 1)) +wifi2_2_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') #print the mac address echo $wifi0_mac echo $wifi0_1_mac @@ -72,8 +73,8 @@ echo $wifi1_1_mac echo $wifi1_2_mac echo $wifi1_3_mac echo $wifi2_mac -#echo $wifi2_1_mac -#echo $wifi2_2_mac +echo $wifi2_1_mac +echo $wifi2_2_mac #Update the mac address using ip link command ifconfig wifi0 down @@ -84,8 +85,8 @@ ifconfig wifi1.1 down ifconfig wifi1.2 down ifconfig wifi1.3 down ifconfig wifi2 down -#ifconfig wifi2.1 down -#ifconfig wifi2.2 down +ifconfig wifi2.1 down +ifconfig wifi2.2 down ip link set dev wifi0 address $wifi0_mac ip link set dev wifi0.1 address $wifi0_1_mac ip link set dev wifi0.2 address $wifi0_2_mac @@ -94,8 +95,8 @@ ip link set dev wifi1.1 address $wifi1_1_mac ip link set dev wifi1.2 address $wifi1_2_mac ip link set dev wifi1.3 address $wifi1_3_mac ip link set dev wifi2 address $wifi2_mac -#ip link set dev wifi2.1 address $wifi2_1_mac -#ip link set dev wifi2.2 address $wifi2_2_mac +ip link set dev wifi2.1 address $wifi2_1_mac +ip link set dev wifi2.2 address $wifi2_2_mac ifconfig wifi0 up ifconfig wifi0.1 up ifconfig wifi0.2 up @@ -104,18 +105,28 @@ ifconfig wifi1.1 up ifconfig wifi1.2 up ifconfig wifi1.3 up ifconfig wifi2 up -#ifconfig wifi2.1 up -#ifconfig wifi2.2 up +ifconfig wifi2.1 up +ifconfig wifi2.2 up -# Set MLD interface address as wifi2 MAC address + 1 -prefix="${wifi2_mac%:*}" -last_byte="${wifi2_mac##*:}" +# Set MLD interface address as wifi2.2 MAC address + 1 +prefix_mld0="${wifi2_2_mac%:*}" +last_byte_mld0="${wifi2_2_mac##*:}" -new_byte=$(printf "%02X" $(( (0x$last_byte + 1) & 0xFF ))) -new_mac="$prefix:$new_byte" +new_byte_mld0=$(printf "%02X" $(( (0x$last_byte_mld0 + 1) & 0xFF ))) +new_mac_mld0="$prefix_mld0:$new_byte_mld0" ip link set dev "mld0" down -ip link set dev "mld0" address "$new_mac" +ip link set dev "mld0" address "$new_mac_mld0" + +# Set MLD interface address as mld0 MAC address + 1 +prefix_mld1="${new_mac_mld0%:*}" +last_byte_mld1="${new_mac_mld0##*:}" + +new_byte_mld1=$(printf "%02X" $(( (0x$last_byte_mld1 + 1) & 0xFF ))) +new_mac_mld1="$prefix_mld1:$new_byte_mld1" + +ip link set dev "mld1" down +ip link set dev "mld1" address "$new_mac_mld1" #Copy configuration file to nvram mkdir -p /nvram diff --git a/source/db/wifi_db.c b/source/db/wifi_db.c index 51a419a35e..3f1940e0e6 100644 --- a/source/db/wifi_db.c +++ b/source/db/wifi_db.c @@ -564,6 +564,10 @@ static int init_vap_config_default(int vap_index, wifi_vap_info_t *config, cfg.u.bss_info.mld_info.common_info.mld_enable = 1; cfg.u.bss_info.mld_info.common_info.mld_id = 0; } + if (isVapMeshBackhaul(vap_index)) { + cfg.u.bss_info.mld_info.common_info.mld_enable = 1; + cfg.u.bss_info.mld_info.common_info.mld_id = 1; + } #else cfg.u.bss_info.mld_info.common_info.mld_enable = 0; cfg.u.bss_info.mld_info.common_info.mld_id = 255; diff --git a/source/db/wifi_db_apis.c b/source/db/wifi_db_apis.c index 572bfce72a..4edf0e76cd 100644 --- a/source/db/wifi_db_apis.c +++ b/source/db/wifi_db_apis.c @@ -8106,6 +8106,10 @@ int wifidb_init_vap_config_default(int vap_index, wifi_vap_info_t *config, cfg->u.bss_info.mld_info.common_info.mld_enable = 1; cfg->u.bss_info.mld_info.common_info.mld_id = 0; } + if (isVapMeshBackhaul(vap_index)) { + cfg->u.bss_info.mld_info.common_info.mld_enable = 1; + cfg->u.bss_info.mld_info.common_info.mld_id = 1; + } #else /* _PLATFORM_BANANAPI_R4_ */ cfg->u.bss_info.mld_info.common_info.mld_enable = 0; cfg->u.bss_info.mld_info.common_info.mld_id = 255; diff --git a/source/webconfig/wifi_easymesh_translator.c b/source/webconfig/wifi_easymesh_translator.c index ff0be35d01..118f7b5e84 100644 --- a/source/webconfig/wifi_easymesh_translator.c +++ b/source/webconfig/wifi_easymesh_translator.c @@ -2199,6 +2199,7 @@ webconfig_error_t fill_ap_mld_info_from_vap(em_ap_mld_info_t *ap_info, wifi_vap_ radio_interface_mapping_t *radio_iface_map) { mac_addr_str_t mld_mac_str, bssid_str; + static const mac_address_t zero_mac = { 0 }; if (ap_info == NULL || vap == NULL) { wifi_util_error_print(WIFI_WEBCONFIG,"%s:%d: input argument is NULL\n", __func__, __LINE__); @@ -2208,7 +2209,9 @@ webconfig_error_t fill_ap_mld_info_from_vap(em_ap_mld_info_t *ap_info, wifi_vap_ memset(ap_info, 0, sizeof(em_ap_mld_info_t)); to_mac_str(vap->u.bss_info.mld_info.common_info.mld_addr, mld_mac_str); - if (WiFi_IsValidMacAddr(mld_mac_str)) { + if (WiFi_IsValidMacAddr(mld_mac_str) && + memcmp(vap->u.bss_info.mld_info.common_info.mld_addr, zero_mac, sizeof(mac_address_t)) != + 0) { ap_info->mac_addr_valid = true; } else { ap_info->mac_addr_valid = false; @@ -2228,7 +2231,8 @@ webconfig_error_t fill_ap_mld_info_from_vap(em_ap_mld_info_t *ap_info, wifi_vap_ memset(aff, 0, sizeof(*aff)); to_mac_str(vap->u.bss_info.bssid, bssid_str); - if (WiFi_IsValidMacAddr(bssid_str)) { + if (WiFi_IsValidMacAddr(bssid_str) && + memcmp(vap->u.bss_info.bssid, zero_mac, sizeof(mac_address_t)) != 0) { aff->mac_addr_valid = true; } else { aff->mac_addr_valid = false; @@ -2302,7 +2306,6 @@ webconfig_error_t translate_vap_object_to_easymesh_for_dml(webconfig_subdoc_data unsigned int i = 0,j = 0, k = 0, num_bss = 0, radio_index = 0; rdk_wifi_radio_t *radio; mac_address_t rmac; - webconfig_error_t ret = webconfig_error_none; decoded_params = &data->u.decoded; if (decoded_params == NULL) { @@ -2414,28 +2417,6 @@ webconfig_error_t translate_vap_object_to_easymesh_for_dml(webconfig_subdoc_data (radio_index < MAX_NUM_RADIOS) ? &wifi_prop->radiocap[radio_index] : NULL, &em_bss_info->eht_ops); } - - if (is_vap_mesh_sta(wifi_prop, vap->vap_index) == TRUE) { - // To Do - Implementation similar to AP MLD once vap structure is updated with wifi7 - // details for STA - // em_bsta_info_t *bsta_info; - // fill_bsta_info_from_vap(&bsta_info, vap, radio_iface_map); - // proto->update_bsta_info(proto->data_model, bsta_info); - } else { - if (vap->u.bss_info.mld_info.common_info.mld_enable == true) { - em_ap_mld_info_t ap_info; - ret = fill_ap_mld_info_from_vap(&ap_info, vap, radio_iface_map); - if (ret == webconfig_error_none) { - proto->update_ap_mld_info(proto->data_model, &ap_info); - wifi_util_dbg_print(WIFI_WEBCONFIG, - "%s:%d: AP MLD info updated successfully for vap %s\n", __func__, - __LINE__, vap->vap_name); - } - } else { - wifi_util_dbg_print(WIFI_WEBCONFIG, "%s:%d: AP MLD is not enabled on vap %s\n", - __func__, __LINE__, vap->vap_name); - } - } } } return webconfig_error_none;