blob: d061c4a438268037643ad7800c536b09009afd17 [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
Wei-Yu Chenb91af852022-03-15 22:24:49 +080015from devices.sercomm import SercommHandler
Wei-Yu Chen49950b92021-11-08 19:19:18 +080016from 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,
Wei-Yu Chenb91af852022-03-15 22:24:49 +080029 EnodebDeviceName.SERCOMM: SercommHandler,
Wei-Yu Chen49950b92021-11-08 19:19:18 +080030}
31
32
33def get_device_handler_from_name(
34 name: EnodebDeviceName,
35) -> Type[EnodebAcsStateMachine]:
36 return DEVICE_HANDLER_BY_NAME[name]