diff options
author | Andrew Evans <andrewevans@google.com> | 2023-03-22 04:27:09 +0000 |
---|---|---|
committer | Andrew Evans <andrewevans@google.com> | 2023-06-05 22:23:39 +0000 |
commit | e117f3d6496cc3841b441a3864010e5286d45c79 (patch) | |
tree | 33d562ba93a54dd4638aa0b5ba1433f32c62d972 | |
parent | 3d51e80d6941cd8f1f3ac55e1daa5ef264457a8d (diff) | |
download | wlan-platform-android-msm-eos-5.15-tm-wear-kr3-pixel-watch.tar.gz |
Revert "WLAN: Add a driver to read WLAN MAC Addresses"android-wear-13.0.0_r0.8android-wear-13.0.0_r0.6android-wear-13.0.0_r0.4android-wear-13.0.0_r0.3android-wear-13.0.0_r0.14android-wear-13.0.0_r0.12android-wear-13.0.0_r0.10android-msm-eos-android13-wear-kr3-pixel-watchandroid-msm-eos-5.15-tm-wear-kr3-pixel-watchandroid-msm-eos-5.15-tm-wear-kr3-dr-eos
This reverts commit 936cfa422a9fca61dcc03dad3f9819d70bbd6ada.
Reason for revert: This is our module, so we want to keep it with
Google-authored modules. Also, we don't modify Qualcomm sources unless
absolutely necessary.
Bug: 237754339
Bug: 268749749
Change-Id: Ib8649723a8cb75804350ccbfd49bbca9e26fa64d
Signed-off-by: Andrew Evans <andrewevans@google.com>
-rw-r--r-- | Kbuild | 5 | ||||
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | wlan_mac/Kconfig | 8 | ||||
-rw-r--r-- | wlan_mac/Makefile | 4 | ||||
-rw-r--r-- | wlan_mac/google_wlan_mac.c | 112 |
5 files changed, 0 insertions, 132 deletions
@@ -61,8 +61,3 @@ obj-$(CONFIG_ICNSS2) += icnss2/ obj-$(CONFIG_CNSS_GENL) += cnss_genl/ obj-$(CONFIG_WCNSS_MEM_PRE_ALLOC) += cnss_prealloc/ obj-y += cnss_utils/ - -# WLAN_MAC -obj-$(CONFIG_GOOGLE_WLAN_MAC) += wlan_mac/ - -KBUILD_CPPFLAGS += -I$(WLAN_PLATFORM_ROOT)/inc @@ -29,9 +29,6 @@ KBUILD_OPTIONS += CONFIG_CNSS2_SSR_DRIVER_DUMP=y endif endif -# WLAN_MAC -KBUILD_OPTIONS += CONFIG_GOOGLE_WLAN_MAC=m - all: modules %: diff --git a/wlan_mac/Kconfig b/wlan_mac/Kconfig deleted file mode 100644 index d2c4978..0000000 --- a/wlan_mac/Kconfig +++ /dev/null @@ -1,8 +0,0 @@ -# -# google set wlan mac -# -config GOOGLE_WLAN_MAC - bool "Read MAC from device tree" - default n - help - Say Y here if you want the GOOGLE WLAN MAC features diff --git a/wlan_mac/Makefile b/wlan_mac/Makefile deleted file mode 100644 index fdee76f..0000000 --- a/wlan_mac/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -# -# google set wlan mac -# -obj-$(CONFIG_GOOGLE_WLAN_MAC) += google_wlan_mac.o diff --git a/wlan_mac/google_wlan_mac.c b/wlan_mac/google_wlan_mac.c deleted file mode 100644 index fe29f0e..0000000 --- a/wlan_mac/google_wlan_mac.c +++ /dev/null @@ -1,112 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (c) 2023, The Linux Foundation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 and - * only version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include <asm/setup.h> -#include <linux/kernel.h> -#include <linux/module.h> -#include <linux/platform_device.h> -#include <linux/string.h> -#include <linux/export.h> -#include <linux/of.h> -#include <linux/random.h> -#include <linux/slab.h> -#include <linux/uaccess.h> -#include <linux/if.h> -#include "cnss_utils.h" - -#define CDB_PATH "/chosen/config" -#define WIFI_MAC "wlan_mac1" - -static void set_wifi_mac(void) -{ - u8 mac[IFHWADDRLEN] = {0}; - unsigned int size; - unsigned char *mac_addr = NULL; - struct device_node *node; - unsigned int mac_found = 0; - - node = of_find_node_by_path(CDB_PATH); - if (!node) { - pr_err("[WLAN] CDB Node not created under %s", CDB_PATH); - } else { - mac_addr = (unsigned char *) - of_get_property(node, WIFI_MAC, &size); - } - - /* In case Missing Provisioned MAC Address, exit with error */ - if (!mac_addr) { - pr_err("[WLAN] Missing Provisioned MAC address\n"); - return; - } - - /* Start decoding MAC Address - * Note that 2 formats are supported for now - * AA:BB:CC:DD:EE:FF (with separating colons) and - * AABBCCDDEEFF (without separating colons) */ - if (sscanf(mac_addr, - "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", - &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], - &mac[5]) == 6) { - mac_found = 1; - } else if (sscanf(mac_addr, - "%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx", - &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], - &mac[5]) == 6) { - mac_found = 1; - } - - /* Make sure Address decoding succeeds */ - if (!mac_found) { - pr_err("[WLAN] Invalid format for Provisioned MAC Address\n"); - return; - } - - /* Make sure Provisioned MAC Address is globally Administered */ - if (mac[0] & 2) { - pr_err("[WLAN] Invalid Provisioned MAC Address\n"); - return; - } - - /* Send provisioned MAC Address to the platform driver */ - if (cnss_utils_set_wlan_mac_address(mac, sizeof(mac)) != 0) { - pr_err("[WLAN] set wlan mac address failed\n"); - return; - } - - /* Now derive the derived mac address - * by setting the locally administred bit */ - mac[0] = mac[0] | 2; - - if (cnss_utils_set_wlan_derived_mac_address(mac, sizeof(mac)) != 0) { - pr_err("[WLAN] set wlan derived mac address failed\n"); - return; - } - - pr_info("[WLAN] %s successful\n", __func__); - return; -} - -static int __init wifi_mac_init(void) -{ - set_wifi_mac(); - - return 0; -} - -late_initcall(wifi_mac_init); - -MODULE_AUTHOR("Google"); -MODULE_DESCRIPTION("Set Qualcomm CNSS WLAN MAC from device-tree"); -MODULE_LICENSE("GPL v2"); -MODULE_SOFTDEP("pre: cnss2"); |