2 * Copyright (C) ST-Ericsson AB 2010
3 * Author: Sjur Brendeland
4 * License terms: GNU General Public License (GPL) version 2
9 #include <linux/spinlock.h>
10 #include <linux/netdevice.h>
11 #include <net/caif/caif_layer.h>
12 #include <net/caif/cfctrl.h>
17 * enum cfcnfg_phy_preference - Physical preference HW Abstraction
19 * @CFPHYPREF_UNSPECIFIED: Default physical interface
21 * @CFPHYPREF_LOW_LAT: Default physical interface for low-latency
23 * @CFPHYPREF_HIGH_BW: Default physical interface for high-bandwidth
25 * @CFPHYPREF_LOOP: TEST only Loopback interface simulating modem
29 enum cfcnfg_phy_preference
{
30 CFPHYPREF_UNSPECIFIED
,
37 * cfcnfg_create() - Get the CAIF configuration object given network.
38 * @net: Network for the CAIF configuration object.
40 struct cfcnfg
*get_cfcnfg(struct net
*net
);
43 * cfcnfg_create() - Create the CAIF configuration object.
45 struct cfcnfg
*cfcnfg_create(void);
48 * cfcnfg_remove() - Remove the CFCNFG object
51 void cfcnfg_remove(struct cfcnfg
*cfg
);
54 * cfcnfg_add_phy_layer() - Adds a physical layer to the CAIF stack.
55 * @cnfg: Pointer to a CAIF configuration object, created by
57 * @dev: Pointer to link layer device
58 * @phy_layer: Specify the physical layer. The transmit function
59 * MUST be set in the structure.
60 * @pref: The phy (link layer) preference.
61 * @link_support: Protocol implementation for link layer specific protocol.
62 * @fcs: Specify if checksum is used in CAIF Framing Layer.
63 * @head_room: Head space needed by link specific protocol.
66 cfcnfg_add_phy_layer(struct cfcnfg
*cnfg
,
67 struct net_device
*dev
, struct cflayer
*phy_layer
,
68 enum cfcnfg_phy_preference pref
,
69 struct cflayer
*link_support
,
70 bool fcs
, int head_room
);
73 * cfcnfg_del_phy_layer - Deletes an phy layer from the CAIF stack.
75 * @cnfg: Pointer to a CAIF configuration object, created by
77 * @phy_layer: Adaptation layer to be removed.
79 int cfcnfg_del_phy_layer(struct cfcnfg
*cnfg
, struct cflayer
*phy_layer
);
82 * cfcnfg_set_phy_state() - Set the state of the physical interface device.
83 * @cnfg: Configuration object
84 * @phy_layer: Physical Layer representation
85 * @up: State of device
87 int cfcnfg_set_phy_state(struct cfcnfg
*cnfg
, struct cflayer
*phy_layer
,
90 #endif /* CFCNFG_H_ */