2 * Copyright (C) ST-Ericsson AB 2010
3 * Author: Sjur Brendeland/sjur.brandeland@stericsson.com
4 * License terms: GNU General Public License (GPL) version 2
9 #include <linux/spinlock.h>
10 #include <net/caif/caif_layer.h>
11 #include <net/caif/cfctrl.h>
16 * enum cfcnfg_phy_type - Types of physical layers defined in CAIF Stack
18 * @CFPHYTYPE_FRAG: Fragmented frames physical interface.
19 * @CFPHYTYPE_CAIF: Generic CAIF physical interface
21 enum cfcnfg_phy_type {
28 * enum cfcnfg_phy_preference - Physical preference HW Abstraction
30 * @CFPHYPREF_UNSPECIFIED: Default physical interface
32 * @CFPHYPREF_LOW_LAT: Default physical interface for low-latency
34 * @CFPHYPREF_HIGH_BW: Default physical interface for high-bandwidth
36 * @CFPHYPREF_LOOP: TEST only Loopback interface simulating modem
40 enum cfcnfg_phy_preference {
41 CFPHYPREF_UNSPECIFIED,
48 * cfcnfg_create() - Create the CAIF configuration object.
50 struct cfcnfg *cfcnfg_create(void);
53 * cfcnfg_remove() - Remove the CFCNFG object
56 void cfcnfg_remove(struct cfcnfg *cfg);
59 * cfcnfg_add_phy_layer() - Adds a physical layer to the CAIF stack.
60 * @cnfg: Pointer to a CAIF configuration object, created by
62 * @phy_type: Specifies the type of physical interface, e.g.
64 * @dev: Pointer to link layer device
65 * @phy_layer: Specify the physical layer. The transmit function
66 * MUST be set in the structure.
67 * @phyid: The assigned physical ID for this layer, used in
68 * cfcnfg_add_adapt_layer to specify PHY for the link.
69 * @pref: The phy (link layer) preference.
70 * @fcs: Specify if checksum is used in CAIF Framing Layer.
71 * @stx: Specify if Start Of Frame eXtention is used.
75 cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type,
76 void *dev, struct cflayer *phy_layer, u16 *phyid,
77 enum cfcnfg_phy_preference pref,
81 * cfcnfg_del_phy_layer - Deletes an phy layer from the CAIF stack.
83 * @cnfg: Pointer to a CAIF configuration object, created by
85 * @phy_layer: Adaptation layer to be removed.
87 int cfcnfg_del_phy_layer(struct cfcnfg *cnfg, struct cflayer *phy_layer);
90 * cfcnfg_del_adapt_layer - Deletes an adaptation layer from the CAIF stack.
92 * @cnfg: Pointer to a CAIF configuration object, created by
94 * @adap_layer: Adaptation layer to be removed.
96 int cfcnfg_del_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer);
99 * cfcnfg_add_adaptation_layer - Add an adaptation layer to the CAIF stack.
101 * The adaptation Layer is where the interface to application or higher-level
102 * driver functionality is implemented.
104 * @cnfg: Pointer to a CAIF configuration object, created by
106 * @param: Link setup parameters.
107 * @adap_layer: Specify the adaptation layer; the receive and
108 * flow-control functions MUST be set in the structure.
112 cfcnfg_add_adaptation_layer(struct cfcnfg *cnfg,
113 struct cfctrl_link_param *param,
114 struct cflayer *adap_layer);
117 * cfcnfg_get_phyid() - Get physical ID, given type.
118 * Returns one of the physical interfaces matching the given type.
119 * Zero if no match is found.
120 * @cnfg: Configuration object
121 * @phy_pref: Caif Link Layer preference
123 struct dev_info *cfcnfg_get_phyid(struct cfcnfg *cnfg,
124 enum cfcnfg_phy_preference phy_pref);
127 * cfcnfg_get_named() - Get the Physical Identifier of CAIF Link Layer
128 * @cnfg: Configuration object
129 * @name: Name of the Physical Layer (Caif Link Layer)
131 int cfcnfg_get_named(struct cfcnfg *cnfg, char *name);
133 #endif /* CFCNFG_H_ */