Skip to content

Commit

Permalink
net: wan: Add framer framework support
Browse files Browse the repository at this point in the history
A framer is a component in charge of an E1/T1 line interface.
Connected usually to a TDM bus, it converts TDM frames to/from E1/T1
frames. It also provides information related to the E1/T1 line.

The framer framework provides a set of APIs for the framer drivers
(framer provider) to create/destroy a framer and APIs for the framer
users (framer consumer) to obtain a reference to the framer, and
use the framer.

This basic implementation provides a framer abstraction for:
 - power on/off the framer
 - get the framer status (line state)
 - be notified on framer status changes
 - get/set the framer configuration

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20231128132534.258459-2-herve.codina@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Herve Codina authored and Linus Walleij committed Dec 12, 2023
1 parent b85ea95 commit 82c944d
Show file tree
Hide file tree
Showing 7 changed files with 1,316 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/wan/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ config HDLC_X25
comment "X.25/LAPB support is disabled"
depends on HDLC && (LAPB!=m || HDLC!=m) && LAPB!=y

source "drivers/net/wan/framer/Kconfig"

config PCI200SYN
tristate "Goramo PCI200SYN support"
depends on HDLC && PCI
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wan/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ obj-$(CONFIG_HDLC_FR) += hdlc_fr.o
obj-$(CONFIG_HDLC_PPP) += hdlc_ppp.o
obj-$(CONFIG_HDLC_X25) += hdlc_x25.o

obj-y += framer/

obj-$(CONFIG_FARSYNC) += farsync.o

obj-$(CONFIG_LAPBETHER) += lapbether.o
Expand Down
25 changes: 25 additions & 0 deletions drivers/net/wan/framer/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SPDX-License-Identifier: GPL-2.0-only
#
# FRAMER
#

menuconfig FRAMER
tristate "Framer Subsystem"
help
A framer is a component in charge of an E1/T1 line interface.
Connected usually to a TDM bus, it converts TDM frames to/from E1/T1
frames. It also provides information related to the E1/T1 line.
Used with HDLC, the network can be reached through the E1/T1 line.

This framework is designed to provide a generic interface for framer
devices present in the kernel. This layer will have the generic
API by which framer drivers can create framer using the framer
framework and framer users can obtain reference to the framer.
All the users of this framework should select this config.

if FRAMER

config GENERIC_FRAMER
bool

endif # FRAMER
6 changes: 6 additions & 0 deletions drivers/net/wan/framer/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
#
# Makefile for the framer drivers.
#

obj-$(CONFIG_GENERIC_FRAMER) += framer-core.o
Loading

0 comments on commit 82c944d

Please sign in to comment.