]>
Commit | Line | Data |
---|---|---|
09009f30 SB |
1 | /* |
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 | |
5 | */ | |
6 | ||
7 | #ifndef CFSRVL_H_ | |
8 | #define CFSRVL_H_ | |
9 | #include <linux/list.h> | |
10 | #include <linux/stddef.h> | |
11 | #include <linux/types.h> | |
5b208656 SB |
12 | #include <linux/kref.h> |
13 | ||
09009f30 SB |
14 | struct cfsrvl { |
15 | struct cflayer layer; | |
16 | bool open; | |
17 | bool phy_flow_on; | |
18 | bool modem_flow_on; | |
b1c74247 | 19 | bool supports_flowctrl; |
09009f30 | 20 | struct dev_info dev_info; |
5b208656 | 21 | struct kref ref; |
09009f30 SB |
22 | }; |
23 | ||
5b208656 | 24 | void cfsrvl_release(struct kref *kref); |
09009f30 SB |
25 | struct cflayer *cfvei_create(u8 linkid, struct dev_info *dev_info); |
26 | struct cflayer *cfdgml_create(u8 linkid, struct dev_info *dev_info); | |
27 | struct cflayer *cfutill_create(u8 linkid, struct dev_info *dev_info); | |
28 | struct cflayer *cfvidl_create(u8 linkid, struct dev_info *dev_info); | |
29 | struct cflayer *cfrfml_create(u8 linkid, struct dev_info *dev_info); | |
30 | struct cflayer *cfdbgl_create(u8 linkid, struct dev_info *dev_info); | |
31 | bool cfsrvl_phyid_match(struct cflayer *layer, int phyid); | |
32 | void cfservl_destroy(struct cflayer *layer); | |
33 | void cfsrvl_init(struct cfsrvl *service, | |
b1c74247 SB |
34 | u8 channel_id, |
35 | struct dev_info *dev_info, | |
36 | bool supports_flowctrl); | |
09009f30 SB |
37 | bool cfsrvl_ready(struct cfsrvl *service, int *err); |
38 | u8 cfsrvl_getphyid(struct cflayer *layer); | |
39 | ||
5b208656 SB |
40 | static inline void cfsrvl_get(struct cflayer *layr) |
41 | { | |
42 | struct cfsrvl *s; | |
43 | if (layr == NULL) | |
44 | return; | |
45 | s = container_of(layr, struct cfsrvl, layer); | |
46 | kref_get(&s->ref); | |
47 | } | |
48 | ||
49 | static inline void cfsrvl_put(struct cflayer *layr) | |
50 | { | |
51 | struct cfsrvl *s; | |
52 | if (layr == NULL) | |
53 | return; | |
54 | s = container_of(layr, struct cfsrvl, layer); | |
55 | kref_put(&s->ref, cfsrvl_release); | |
56 | } | |
57 | ||
09009f30 | 58 | #endif /* CFSRVL_H_ */ |