qcacld-3.0: Derive MLD mac address
As part of new implementation for 802.11BE MLD(multi link device) address also need to be generated, derive the address during the driver probe for max supported MLD's. Change-Id: I092aac0607a6b7e9e420b1c82a61869cc0b8a2d4 CRs-Fixed: 2993460
This commit is contained in:
parent
608145a17f
commit
01dce308f4
9
Kbuild
9
Kbuild
@ -477,6 +477,10 @@ ifeq ($(CONFIG_FEATURE_WLAN_CH_AVOID_EXT),y)
|
||||
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_avoid_freq_ext.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_WLAN_FEATURE_11BE_MLO), y)
|
||||
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_mlo.o
|
||||
endif
|
||||
|
||||
$(call add-wlan-objs,hdd,$(HDD_OBJS))
|
||||
|
||||
###### OSIF_SYNC ########
|
||||
@ -3866,6 +3870,11 @@ ccflags-y += -DWLAN_MAX_PDEVS=$(CONFIG_WLAN_MAX_PDEVS)
|
||||
CONFIG_WLAN_MAX_VDEVS ?= 6
|
||||
ccflags-y += -DWLAN_MAX_VDEVS=$(CONFIG_WLAN_MAX_VDEVS)
|
||||
|
||||
ifdef CONFIG_WLAN_FEATURE_11BE_MLO
|
||||
CONFIG_WLAN_MAX_MLD ?= 2
|
||||
ccflags-y += -DWLAN_MAX_MLD=$(CONFIG_WLAN_MAX_MLD)
|
||||
endif
|
||||
|
||||
#Maximum pending commands for a vdev is calculated in vdev create handler
|
||||
#by WLAN_SER_MAX_PENDING_CMDS/WLAN_SER_MAX_VDEVS. For SAP case, we will need
|
||||
#to accommodate 32 Pending commands to handle multiple STA sending
|
||||
|
@ -119,6 +119,7 @@
|
||||
#include "wlan_hdd_sta_info.h"
|
||||
#include "wlan_hdd_bus_bandwidth.h"
|
||||
#include <wlan_hdd_cm_api.h>
|
||||
#include "wlan_hdd_mlo.h"
|
||||
|
||||
/*
|
||||
* Preprocessor definitions and constants
|
||||
@ -443,6 +444,8 @@ enum hdd_nb_cmd_id {
|
||||
|
||||
#define HDD_NOISE_FLOOR_DBM (-96)
|
||||
|
||||
#define INTF_MACADDR_MASK 0x7
|
||||
|
||||
/**
|
||||
* enum hdd_auth_key_mgmt - auth key mgmt protocols
|
||||
* @HDD_AUTH_KEY_MGMT_802_1X: 802.1x
|
||||
@ -2224,6 +2227,9 @@ struct hdd_context {
|
||||
bool dump_in_progress;
|
||||
qdf_time_t bw_vote_time;
|
||||
struct hdd_dual_sta_policy dual_sta_policy;
|
||||
#ifdef WLAN_FEATURE_11BE_MLO
|
||||
struct hdd_mld_mac_info mld_mac_info;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
|
70
core/hdd/inc/wlan_hdd_mlo.h
Normal file
70
core/hdd/inc/wlan_hdd_mlo.h
Normal file
@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright (c) 2021, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC : wlan_hdd_mlo.h
|
||||
*
|
||||
* WLAN Host Device Driver file for 802.11be (Extremely High Throughput)
|
||||
* support.
|
||||
*
|
||||
*/
|
||||
|
||||
#if !defined(WLAN_HDD_MLO_H)
|
||||
#define WLAN_HDD_MLO_H
|
||||
#include "wlan_hdd_main.h"
|
||||
|
||||
#ifdef WLAN_FEATURE_11BE_MLO
|
||||
/**
|
||||
* struct hdd_mld_mac - hdd structure to hold mld address
|
||||
* @mld_mac: mld addr
|
||||
* @device_mode: Device mode for mld address
|
||||
*/
|
||||
struct hdd_mld_mac {
|
||||
struct qdf_mac_addr mld_addr;
|
||||
uint8_t device_mode;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct hdd_mld_mac_info - HDD structure to hold mld mac address information
|
||||
* @num_mld_addr: Number of mld address supported
|
||||
* @mld_intf_addr_mask: mask to dervice the multiple mld address
|
||||
* @mld_mac_list: Mac address assigned for device mode
|
||||
*/
|
||||
struct hdd_mld_mac_info {
|
||||
uint8_t num_mld_addr;
|
||||
unsigned long mld_intf_addr_mask;
|
||||
struct hdd_mld_mac mld_mac_list[WLAN_MAX_MLD];
|
||||
};
|
||||
|
||||
/**
|
||||
* hdd_update_mld_mac_addr() - Derive mld mac address
|
||||
* @hdd_context: Global hdd context
|
||||
* @hw_macaddr: Hardware mac address
|
||||
*
|
||||
* This function dervies mld mac address based on the input hardware mac address
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void hdd_update_mld_mac_addr(struct hdd_context *hdd_ctx,
|
||||
struct qdf_mac_addr hw_macaddr);
|
||||
#else
|
||||
static inline
|
||||
void hdd_update_mld_mac_addr(struct hdd_context *hdd_ctx,
|
||||
struct qdf_mac_addr hw_macaddr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#endif
|
@ -204,6 +204,7 @@
|
||||
#include "wlan_hdd_medium_assess.h"
|
||||
#include "wlan_hdd_eht.h"
|
||||
#include <linux/bitfield.h>
|
||||
#include "wlan_hdd_mlo.h"
|
||||
|
||||
#ifdef MODULE
|
||||
#define WLAN_MODULE_NAME module_name(THIS_MODULE)
|
||||
@ -1614,6 +1615,7 @@ void hdd_update_macaddr(struct hdd_context *hdd_ctx,
|
||||
QDF_MAC_ADDR_REF(hdd_ctx->derived_mac_addr[i].bytes));
|
||||
hdd_ctx->num_derived_addr++;
|
||||
}
|
||||
hdd_update_mld_mac_addr(hdd_ctx, hw_macaddr);
|
||||
}
|
||||
|
||||
#ifdef FEATURE_WLAN_TDLS
|
||||
|
62
core/hdd/src/wlan_hdd_mlo.c
Normal file
62
core/hdd/src/wlan_hdd_mlo.c
Normal file
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (c) 2021, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC : wlan_hdd_mlo.c
|
||||
*
|
||||
* WLAN Host Device Driver file for 802.11be (Extremely High Throughput)
|
||||
* support.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "wlan_hdd_main.h"
|
||||
#include "wlan_hdd_mlo.h"
|
||||
|
||||
void hdd_update_mld_mac_addr(struct hdd_context *hdd_ctx,
|
||||
struct qdf_mac_addr hw_macaddr)
|
||||
{
|
||||
uint8_t i;
|
||||
uint8_t mldaddr_b2, tmp_br2;
|
||||
struct hdd_mld_mac_info *mac_info;
|
||||
|
||||
mac_info = &hdd_ctx->mld_mac_info;
|
||||
for (i = 0; i < WLAN_MAX_MLD; i++) {
|
||||
qdf_mem_copy(mac_info->mld_mac_list[i].mld_addr.bytes,
|
||||
hw_macaddr.bytes, QDF_MAC_ADDR_SIZE);
|
||||
mldaddr_b2 = mac_info->mld_mac_list[i].mld_addr.bytes[2];
|
||||
tmp_br2 = ((mldaddr_b2 >> 4 & INTF_MACADDR_MASK) + i) &
|
||||
INTF_MACADDR_MASK;
|
||||
mldaddr_b2 += tmp_br2;
|
||||
|
||||
/* XOR-ing bit-24 of the mac address. This will give enough
|
||||
* mac address range before collision
|
||||
*/
|
||||
mldaddr_b2 ^= (1 << 7);
|
||||
|
||||
/* Set locally administered bit */
|
||||
mac_info->mld_mac_list[i].mld_addr.bytes[0] |= 0x02;
|
||||
mac_info->mld_mac_list[i].mld_addr.bytes[2] = mldaddr_b2;
|
||||
hdd_debug("mld addr[%d]: "
|
||||
QDF_MAC_ADDR_FMT, i,
|
||||
QDF_MAC_ADDR_REF(mac_info->mld_mac_list[i].mld_addr.bytes));
|
||||
|
||||
mac_info->mld_mac_list[i].device_mode = QDF_MAX_NO_OF_MODE;
|
||||
mac_info->num_mld_addr++;
|
||||
|
||||
hdd_debug("num_mld_addr: %d", mac_info->num_mld_addr);
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user