blob: 10aa8417e025573fd51d019e15ed3f5fa8e3695b [file] [log] [blame]
Wei-Yu Chenad55cb82022-02-15 20:07:01 +08001# SPDX-FileCopyrightText: 2020 The Magma Authors.
2# SPDX-FileCopyrightText: 2022 Open Networking Foundation <support@opennetworking.org>
3#
4# SPDX-License-Identifier: BSD-3-Clause
Wei-Yu Chen49950b92021-11-08 19:19:18 +08005
6from typing import Type
7
8from devices.baicells import BaicellsHandler
9from devices.baicells_old import BaicellsOldHandler
10from devices.baicells_qafa import BaicellsQAFAHandler
11from devices.baicells_qafb import BaicellsQAFBHandler
12from devices.baicells_rts import BaicellsRTSHandler
13from devices.device_utils import EnodebDeviceName
14from devices.experimental.cavium import CaviumHandler
15from devices.freedomfi_one import FreedomFiOneHandler
16from state_machines.enb_acs import EnodebAcsStateMachine
17
18# This exists only to break a circular dependency. Otherwise there's no
19# point of having these names for the devices
20
21
22DEVICE_HANDLER_BY_NAME = {
23 EnodebDeviceName.BAICELLS: BaicellsHandler,
24 EnodebDeviceName.BAICELLS_OLD: BaicellsOldHandler,
25 EnodebDeviceName.BAICELLS_QAFA: BaicellsQAFAHandler,
26 EnodebDeviceName.BAICELLS_QAFB: BaicellsQAFBHandler,
27 EnodebDeviceName.BAICELLS_RTS: BaicellsRTSHandler,
28 EnodebDeviceName.CAVIUM: CaviumHandler,
29 EnodebDeviceName.FREEDOMFI_ONE: FreedomFiOneHandler,
30}
31
32
33def get_device_handler_from_name(
34 name: EnodebDeviceName,
35) -> Type[EnodebAcsStateMachine]:
36 return DEVICE_HANDLER_BY_NAME[name]