diff options
author | sjur.brandeland@stericsson.com <sjur.brandeland@stericsson.com> | 2011-11-30 04:22:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-30 23:30:48 -0500 |
commit | 7c18d2205ea76eef9674e59e1ecae4f332a53e9e (patch) | |
tree | 2d6ed4be50e52408b8806ca67f0bd6fb15362efa /include/net/caif | |
parent | 200c5a3b387c415e49639ee0f6de37804522b745 (diff) |
caif: Restructure how link caif link layer enroll
Enrolling CAIF link layers are refactored.
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/caif')
-rw-r--r-- | include/net/caif/caif_dev.h | 21 | ||||
-rw-r--r-- | include/net/caif/cfcnfg.h | 9 |
2 files changed, 26 insertions, 4 deletions
diff --git a/include/net/caif/caif_dev.h b/include/net/caif/caif_dev.h index c011281d92c0..ef2dd9438bb1 100644 --- a/include/net/caif/caif_dev.h +++ b/include/net/caif/caif_dev.h | |||
@@ -9,6 +9,7 @@ | |||
9 | 9 | ||
10 | #include <net/caif/caif_layer.h> | 10 | #include <net/caif/caif_layer.h> |
11 | #include <net/caif/cfcnfg.h> | 11 | #include <net/caif/cfcnfg.h> |
12 | #include <net/caif/caif_device.h> | ||
12 | #include <linux/caif/caif_socket.h> | 13 | #include <linux/caif/caif_socket.h> |
13 | #include <linux/if.h> | 14 | #include <linux/if.h> |
14 | #include <linux/net.h> | 15 | #include <linux/net.h> |
@@ -104,4 +105,24 @@ void caif_client_register_refcnt(struct cflayer *adapt_layer, | |||
104 | */ | 105 | */ |
105 | void caif_free_client(struct cflayer *adap_layer); | 106 | void caif_free_client(struct cflayer *adap_layer); |
106 | 107 | ||
108 | /** | ||
109 | * struct caif_enroll_dev - Enroll a net-device as a CAIF Link layer | ||
110 | * @dev: Network device to enroll. | ||
111 | * @caifdev: Configuration information from CAIF Link Layer | ||
112 | * @link_support: Link layer support layer | ||
113 | * @head_room: Head room needed by link support layer | ||
114 | * @layer: Lowest layer in CAIF stack | ||
115 | * @rcv_fun: Receive function for CAIF stack. | ||
116 | * | ||
117 | * This function enroll a CAIF link layer into CAIF Stack and | ||
118 | * expects the interface to be able to handle CAIF payload. | ||
119 | * The link_support layer is used to add any Link Layer specific | ||
120 | * framing. | ||
121 | */ | ||
122 | void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev, | ||
123 | struct cflayer *link_support, int head_room, | ||
124 | struct cflayer **layer, int (**rcv_func)( | ||
125 | struct sk_buff *, struct net_device *, | ||
126 | struct packet_type *, struct net_device *)); | ||
127 | |||
107 | #endif /* CAIF_DEV_H_ */ | 128 | #endif /* CAIF_DEV_H_ */ |
diff --git a/include/net/caif/cfcnfg.h b/include/net/caif/cfcnfg.h index 3e93a4a4b677..a421723e986f 100644 --- a/include/net/caif/cfcnfg.h +++ b/include/net/caif/cfcnfg.h | |||
@@ -72,15 +72,16 @@ void cfcnfg_remove(struct cfcnfg *cfg); | |||
72 | * @phy_layer: Specify the physical layer. The transmit function | 72 | * @phy_layer: Specify the physical layer. The transmit function |
73 | * MUST be set in the structure. | 73 | * MUST be set in the structure. |
74 | * @pref: The phy (link layer) preference. | 74 | * @pref: The phy (link layer) preference. |
75 | * @link_support: Protocol implementation for link layer specific protocol. | ||
75 | * @fcs: Specify if checksum is used in CAIF Framing Layer. | 76 | * @fcs: Specify if checksum is used in CAIF Framing Layer. |
76 | * @stx: Specify if Start Of Frame eXtention is used. | 77 | * @head_room: Head space needed by link specific protocol. |
77 | */ | 78 | */ |
78 | |||
79 | void | 79 | void |
80 | cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type, | 80 | cfcnfg_add_phy_layer(struct cfcnfg *cnfg, |
81 | struct net_device *dev, struct cflayer *phy_layer, | 81 | struct net_device *dev, struct cflayer *phy_layer, |
82 | enum cfcnfg_phy_preference pref, | 82 | enum cfcnfg_phy_preference pref, |
83 | bool fcs, bool stx); | 83 | struct cflayer *link_support, |
84 | bool fcs, int head_room); | ||
84 | 85 | ||
85 | /** | 86 | /** |
86 | * cfcnfg_del_phy_layer - Deletes an phy layer from the CAIF stack. | 87 | * cfcnfg_del_phy_layer - Deletes an phy layer from the CAIF stack. |