/*1* Copyright (C) ST-Ericsson AB 20102* Author: Sjur Brendeland/[email protected]3* License terms: GNU General Public License (GPL) version 24*/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_type - Types of physical layers defined in CAIF Stack17*18* @CFPHYTYPE_FRAG: Fragmented frames physical interface.19* @CFPHYTYPE_CAIF: Generic CAIF physical interface20*/21enum cfcnfg_phy_type {22CFPHYTYPE_FRAG = 1,23CFPHYTYPE_CAIF,24CFPHYTYPE_MAX25};2627/**28* enum cfcnfg_phy_preference - Physical preference HW Abstraction29*30* @CFPHYPREF_UNSPECIFIED: Default physical interface31*32* @CFPHYPREF_LOW_LAT: Default physical interface for low-latency33* traffic34* @CFPHYPREF_HIGH_BW: Default physical interface for high-bandwidth35* traffic36* @CFPHYPREF_LOOP: TEST only Loopback interface simulating modem37* responses.38*39*/40enum cfcnfg_phy_preference {41CFPHYPREF_UNSPECIFIED,42CFPHYPREF_LOW_LAT,43CFPHYPREF_HIGH_BW,44CFPHYPREF_LOOP45};4647/**48* cfcnfg_create() - Get the CAIF configuration object given network.49* @net: Network for the CAIF configuration object.50*/51struct cfcnfg *get_cfcnfg(struct net *net);5253/**54* cfcnfg_create() - Create the CAIF configuration object.55*/56struct cfcnfg *cfcnfg_create(void);5758/**59* cfcnfg_remove() - Remove the CFCNFG object60* @cfg: config object61*/62void cfcnfg_remove(struct cfcnfg *cfg);6364/**65* cfcnfg_add_phy_layer() - Adds a physical layer to the CAIF stack.66* @cnfg: Pointer to a CAIF configuration object, created by67* cfcnfg_create().68* @phy_type: Specifies the type of physical interface, e.g.69* CFPHYTYPE_FRAG.70* @dev: Pointer to link layer device71* @phy_layer: Specify the physical layer. The transmit function72* MUST be set in the structure.73* @pref: The phy (link layer) preference.74* @fcs: Specify if checksum is used in CAIF Framing Layer.75* @stx: Specify if Start Of Frame eXtention is used.76*/7778void79cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type,80struct net_device *dev, struct cflayer *phy_layer,81enum cfcnfg_phy_preference pref,82bool fcs, bool stx);8384/**85* cfcnfg_del_phy_layer - Deletes an phy layer from the CAIF stack.86*87* @cnfg: Pointer to a CAIF configuration object, created by88* cfcnfg_create().89* @phy_layer: Adaptation layer to be removed.90*/91int cfcnfg_del_phy_layer(struct cfcnfg *cnfg, struct cflayer *phy_layer);9293/**94* cfcnfg_set_phy_state() - Set the state of the physical interface device.95* @cnfg: Configuration object96* @phy_layer: Physical Layer representation97* @up: State of device98*/99int cfcnfg_set_phy_state(struct cfcnfg *cnfg, struct cflayer *phy_layer,100bool up);101102#endif /* CFCNFG_H_ */103104105