2 * Copyright (C) ST-Ericsson AB 2010
3 * Author: Sjur Brendeland
4 * License terms: GNU General Public License (GPL) version 2
9 #include <net/caif/caif_layer.h>
10 #include <net/caif/cfsrvl.h>
12 /* CAIF Control packet commands */
14 CFCTRL_CMD_LINK_SETUP
= 0,
15 CFCTRL_CMD_LINK_DESTROY
= 1,
16 CFCTRL_CMD_LINK_ERR
= 2,
20 CFCTRL_CMD_LINK_RECONF
= 6,
21 CFCTRL_CMD_START_REASON
= 7,
22 CFCTRL_CMD_RADIO_SET
= 8,
23 CFCTRL_CMD_MODEM_SET
= 9,
33 CFCTRL_SRV_DATAGRAM
= 4,
39 #define CFCTRL_RSP_BIT 0x20
40 #define CFCTRL_ERR_BIT 0x10
43 void (*linksetup_rsp
)(struct cflayer
*layer
, u8 linkid
,
44 enum cfctrl_srv serv
, u8 phyid
,
45 struct cflayer
*adapt_layer
);
46 void (*linkdestroy_rsp
)(struct cflayer
*layer
, u8 linkid
);
47 void (*linkerror_ind
)(void);
48 void (*enum_rsp
)(void);
49 void (*sleep_rsp
)(void);
50 void (*wake_rsp
)(void);
51 void (*restart_rsp
)(void);
52 void (*radioset_rsp
)(void);
53 void (*reject_rsp
)(struct cflayer
*layer
, u8 linkid
,
54 struct cflayer
*client_layer
);
57 /* Link Setup Parameters for CAIF-Links. */
58 struct cfctrl_link_param
{
59 enum cfctrl_srv linktype
;/* (T3,T0) Type of Channel */
60 u8 priority
; /* (P4,P0) Priority of the channel */
61 u8 phyid
; /* (U2-U0) Physical interface to connect */
62 u8 endpoint
; /* (E1,E0) Endpoint for data channels */
63 u8 chtype
; /* (H1,H0) Channel-Type, applies to
67 u8 connid
; /* (D7,D0) Video LinkId */
71 u32 connid
; /* (N31,Ngit0) Connection ID used
76 u32 connid
; /* Connection ID used for RFM */
77 char volume
[20]; /* Volume to mount for RFM */
78 } rfm
; /* Configuration for RFM */
81 u16 fifosize_kb
; /* Psock FIFO size in KB */
82 u16 fifosize_bufs
; /* Psock # signal buffers */
83 char name
[16]; /* Name of the PSOCK service */
84 u8 params
[255]; /* Link setup Parameters> */
85 u16 paramlen
; /* Length of Link Setup
87 } utility
; /* Configuration for Utility Links (Psock) */
91 /* This structure is used internally in CFCTRL */
92 struct cfctrl_request_info
{
96 struct cfctrl_link_param param
;
97 struct cflayer
*client_layer
;
98 struct list_head list
;
103 struct cfctrl_rsp res
;
106 struct list_head list
;
107 /* Protects from simultaneous access to first_req list */
108 spinlock_t info_list_lock
;
111 int loop_linkused
[256];
112 /* Protects simultaneous access to loop_linkid and loop_linkused */
113 spinlock_t loop_linkid_lock
;
118 void cfctrl_enum_req(struct cflayer
*cfctrl
, u8 physlinkid
);
119 int cfctrl_linkup_request(struct cflayer
*cfctrl
,
120 struct cfctrl_link_param
*param
,
121 struct cflayer
*user_layer
);
122 int cfctrl_linkdown_req(struct cflayer
*cfctrl
, u8 linkid
,
123 struct cflayer
*client
);
125 struct cflayer
*cfctrl_create(void);
126 struct cfctrl_rsp
*cfctrl_get_respfuncs(struct cflayer
*layer
);
127 int cfctrl_cancel_req(struct cflayer
*layr
, struct cflayer
*adap_layer
);
128 void cfctrl_remove(struct cflayer
*layr
);
130 #endif /* CFCTRL_H_ */