diff --git a/cmake/LedService.cmake b/cmake/LedService.cmake index 972a737e67986..1ce5b54c5cc8a 100644 --- a/cmake/LedService.cmake +++ b/cmake/LedService.cmake @@ -76,6 +76,7 @@ add_library(led_manager_lib fboss/led_service/Wedge800BACTLedManager.cpp fboss/led_service/Wedge800CACTLedManager.cpp fboss/led_service/Ladakh800bclsLedManager.cpp + fboss/led_service/Blackwolf800banwLedManager.cpp ) target_link_libraries(led_manager_lib @@ -98,6 +99,7 @@ target_link_libraries(led_manager_lib morgan800cc_bsp tahansb800bc_bsp ladakh800bcls_bsp + blackwolf800banw_bsp darwin_platform_mapping elbert_platform_mapping fuji_platform_mapping @@ -115,6 +117,7 @@ target_link_libraries(led_manager_lib tahan800bc_platform_mapping tahansb800bc_platform_mapping ladakh800bcls_platform_mapping + blackwolf800banw_platform_mapping wedge400_fpga wedge400_platform_mapping wedge800bact_platform_mapping diff --git a/fboss/led_service/BUCK b/fboss/led_service/BUCK index 30f4a25c5078a..4a25ac05cd827 100644 --- a/fboss/led_service/BUCK +++ b/fboss/led_service/BUCK @@ -44,6 +44,7 @@ cpp_library( name = "led_manager", srcs = [ "BspLedManager.cpp", + "Blackwolf800banwLedManager.cpp", "FsdbSwitchStateSubscriber.cpp", "Icecube800banwLedManager.cpp", "Icecube800bcLedManager.cpp", @@ -74,6 +75,7 @@ cpp_library( "facebook/YampLedManager.cpp", ], headers = [ + "Blackwolf800banwLedManager.h", "BspLedManager.h", "DarwinLedManager.h", "ElbertLedManager.h", @@ -114,6 +116,7 @@ cpp_library( "//fboss/agent/platforms/common/darwin:darwin_platform_mapping", "//fboss/agent/platforms/common/elbert:elbert_platform_mapping", "//fboss/agent/platforms/common/fuji:fuji_platform_mapping", + "//fboss/agent/platforms/common/blackwolf800banw:blackwolf800banw_platform_mapping", "//fboss/agent/platforms/common/icecube800banw:icecube800banw_platform_mapping", "//fboss/agent/platforms/common/icecube800bc:icecube800bc_platform_mapping", "//fboss/agent/platforms/common/icetea800bc:icetea800bc_platform_mapping", @@ -140,6 +143,7 @@ cpp_library( "//fboss/lib:common_file_utils", "//fboss/lib:common_port_utils", "//fboss/lib/bsp:bsp_core", + "//fboss/lib/bsp/blackwolf800banw:blackwolf800banw_bsp", "//fboss/lib/bsp/icecube800banw:icecube800banw_bsp", "//fboss/lib/bsp/icecube800bc:icecube800bc_bsp", "//fboss/lib/bsp/icetea800bc:icetea800bc_bsp", diff --git a/fboss/led_service/Blackwolf800banwLedManager.cpp b/fboss/led_service/Blackwolf800banwLedManager.cpp new file mode 100644 index 0000000000000..7258118ad670e --- /dev/null +++ b/fboss/led_service/Blackwolf800banwLedManager.cpp @@ -0,0 +1,21 @@ +// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. + +#include "fboss/led_service/Blackwolf800banwLedManager.h" +#include "fboss/agent/platforms/common/blackwolf800banw/Blackwolf800banwPlatformMapping.h" +#include "fboss/lib/bsp/BspGenericSystemContainer.h" +#include "fboss/lib/bsp/blackwolf800banw/Blackwolf800banwBspPlatformMapping.h" + +namespace facebook::fboss { + +/* + * Blackwolf800banwLedManager ctor() + * + * Blackwolf800banwLedManager constructor will create the LedManager object for + * blackwolf800banw platform + */ +Blackwolf800banwLedManager::Blackwolf800banwLedManager() : BspLedManager() { + init(); + XLOG(INFO) << "Created Blackwolf800banw BSP LED Manager"; +} + +} // namespace facebook::fboss diff --git a/fboss/led_service/Blackwolf800banwLedManager.h b/fboss/led_service/Blackwolf800banwLedManager.h new file mode 100644 index 0000000000000..34e777394871b --- /dev/null +++ b/fboss/led_service/Blackwolf800banwLedManager.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ +#pragma once + +#include "fboss/led_service/BspLedManager.h" +#include "fboss/lib/bsp/BspSystemContainer.h" + +namespace facebook::fboss { + +/* + * Blackwolf800banwLedManager class definition: + * + * The BspLedManager class managing all LED in the system. The object is spawned + * by LED Service. This will subscribe to Fsdb to get Switch state update and + * then update the LED in hardware + */ +class Blackwolf800banwLedManager : public BspLedManager { + public: + Blackwolf800banwLedManager(); + virtual ~Blackwolf800banwLedManager() override {} + + // Forbidden copy constructor and assignment operator + Blackwolf800banwLedManager(Blackwolf800banwLedManager const&) = delete; + Blackwolf800banwLedManager& operator=(Blackwolf800banwLedManager const&) = + delete; +}; + +} // namespace facebook::fboss diff --git a/fboss/led_service/LedManagerInit.cpp b/fboss/led_service/LedManagerInit.cpp index 4c88ebedda0a4..8ad972ec8635d 100644 --- a/fboss/led_service/LedManagerInit.cpp +++ b/fboss/led_service/LedManagerInit.cpp @@ -1,6 +1,7 @@ // (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. #include "fboss/led_service/LedManagerInit.h" +#include "fboss/led_service/Blackwolf800banwLedManager.h" #include "fboss/led_service/DarwinLedManager.h" #include "fboss/led_service/ElbertLedManager.h" #include "fboss/led_service/FujiLedManager.h" @@ -86,6 +87,8 @@ std::unique_ptr createLedManager() { return std::make_unique(); } else if (mode == PlatformType::PLATFORM_LADAKH800BCLS) { return std::make_unique(); + } else if (mode == PlatformType::PLATFORM_BLACKWOLF800BANW) { + return std::make_unique(); } return nullptr; } diff --git a/fboss/platform/config_lib/ConfigLibTest.cpp b/fboss/platform/config_lib/ConfigLibTest.cpp index 7cd5d51fc6ae0..1af5dacd29798 100644 --- a/fboss/platform/config_lib/ConfigLibTest.cpp +++ b/fboss/platform/config_lib/ConfigLibTest.cpp @@ -72,6 +72,7 @@ TEST(ConfigLibTest, Basic) { // LedManager Configs EXPECT_NO_THROW(ConfigLib().getLedManagerConfig(kDarwin)); EXPECT_NO_THROW(ConfigLib().getLedManagerConfig(kMorgan800cc)); + EXPECT_NO_THROW(ConfigLib().getLedManagerConfig(kBlackwolf800banw)); EXPECT_THROW( ConfigLib().getLedManagerConfig(kNonExistentPlatform), std::runtime_error);