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
10 #include <net/caif/caif_layer.h>
11 #include <net/caif/cfcnfg.h>
12 #include <linux/caif/caif_socket.h>
16 * struct caif_param - CAIF parameters.
17 * @size: Length of data
18 * @data: Binary Data Blob
26 * struct caif_connect_request - Request data for CAIF channel setup.
27 * @protocol: Type of CAIF protocol to use (at, datagram etc)
28 * @sockaddr: Socket address to connect.
29 * @priority: Priority of the connection.
30 * @link_selector: Link selector (high bandwidth or low latency)
31 * @link_name: Name of the CAIF Link Layer to use.
32 * @param: Connect Request parameters (CAIF_SO_REQ_PARAM).
34 * This struct is used when connecting a CAIF channel.
35 * It contains all CAIF channel configuration options.
37 struct caif_connect_request
{
38 enum caif_protocol_type protocol
;
39 struct sockaddr_caif sockaddr
;
40 enum caif_channel_priority priority
;
41 enum caif_link_selector link_selector
;
43 struct caif_param param
;
47 * caif_connect_client - Connect a client to CAIF Core Stack.
48 * @config: Channel setup parameters, specifying what address
49 * to connect on the Modem.
50 * @client_layer: User implementation of client layer. This layer
51 * MUST have receive and control callback functions
54 * This function connects a CAIF channel. The Client must implement
55 * the struct cflayer. This layer represents the Client layer and holds
56 * receive functions and control callback functions. Control callback
57 * function will receive information about connect/disconnect responses,
58 * flow control etc (see enum caif_control).
59 * E.g. CAIF Socket will call this function for each socket it connects
60 * and have one client_layer instance for each socket.
62 int caif_connect_client(struct caif_connect_request
*config
,
63 struct cflayer
*client_layer
);
66 * caif_disconnect_client - Disconnects a client from the CAIF stack.
68 * @client_layer: Client layer to be removed.
70 int caif_disconnect_client(struct cflayer
*client_layer
);
73 * caif_release_client - Release adaptation layer reference to client.
75 * @client_layer: Client layer.
77 * Releases a client/adaptation layer use of the caif stack.
78 * This function must be used after caif_disconnect_client to
79 * decrease the reference count of the service layer.
81 void caif_release_client(struct cflayer
*client_layer
);
84 * connect_req_to_link_param - Translate configuration parameters
85 * from socket format to internal format.
86 * @cnfg: Pointer to configuration handler
87 * @con_req: Configuration parameters supplied in function
89 * @channel_setup_param: Parameters supplied to the CAIF Core stack for
90 * setting up channels.
93 int connect_req_to_link_param(struct cfcnfg
*cnfg
,
94 struct caif_connect_request
*con_req
,
95 struct cfctrl_link_param
*channel_setup_param
);
98 * get_caif_conf() - Get the configuration handler.
100 struct cfcnfg
*get_caif_conf(void);
103 #endif /* CAIF_DEV_H_ */