/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Copyright (C) ST-Ericsson AB 20103* Author: Sjur Brendeland4*/56#ifndef CFCNFG_H_7#define CFCNFG_H_8#include <linux/spinlock.h>9#include <linux/netdevice.h>10#include <net/caif/caif_layer.h>11#include <net/caif/cfctrl.h>1213struct cfcnfg;1415/**16* enum cfcnfg_phy_preference - Physical preference HW Abstraction17*18* @CFPHYPREF_UNSPECIFIED: Default physical interface19*20* @CFPHYPREF_LOW_LAT: Default physical interface for low-latency21* traffic22* @CFPHYPREF_HIGH_BW: Default physical interface for high-bandwidth23* traffic24* @CFPHYPREF_LOOP: TEST only Loopback interface simulating modem25* responses.26*27*/28enum cfcnfg_phy_preference {29CFPHYPREF_UNSPECIFIED,30CFPHYPREF_LOW_LAT,31CFPHYPREF_HIGH_BW,32CFPHYPREF_LOOP33};3435/**36* cfcnfg_create() - Get the CAIF configuration object given network.37* @net: Network for the CAIF configuration object.38*/39struct cfcnfg *get_cfcnfg(struct net *net);4041/**42* cfcnfg_create() - Create the CAIF configuration object.43*/44struct cfcnfg *cfcnfg_create(void);4546/**47* cfcnfg_remove() - Remove the CFCNFG object48* @cfg: config object49*/50void cfcnfg_remove(struct cfcnfg *cfg);5152/**53* cfcnfg_add_phy_layer() - Adds a physical layer to the CAIF stack.54* @cnfg: Pointer to a CAIF configuration object, created by55* cfcnfg_create().56* @dev: Pointer to link layer device57* @phy_layer: Specify the physical layer. The transmit function58* MUST be set in the structure.59* @pref: The phy (link layer) preference.60* @link_support: Protocol implementation for link layer specific protocol.61* @fcs: Specify if checksum is used in CAIF Framing Layer.62* @head_room: Head space needed by link specific protocol.63*/64int65cfcnfg_add_phy_layer(struct cfcnfg *cnfg,66struct net_device *dev, struct cflayer *phy_layer,67enum cfcnfg_phy_preference pref,68struct cflayer *link_support,69bool fcs, int head_room);7071/**72* cfcnfg_del_phy_layer - Deletes an phy layer from the CAIF stack.73*74* @cnfg: Pointer to a CAIF configuration object, created by75* cfcnfg_create().76* @phy_layer: Adaptation layer to be removed.77*/78int cfcnfg_del_phy_layer(struct cfcnfg *cnfg, struct cflayer *phy_layer);7980/**81* cfcnfg_set_phy_state() - Set the state of the physical interface device.82* @cnfg: Configuration object83* @phy_layer: Physical Layer representation84* @up: State of device85*/86int cfcnfg_set_phy_state(struct cfcnfg *cnfg, struct cflayer *phy_layer,87bool up);8889#endif /* CFCNFG_H_ */909192