]> bbs.cooldavid.org Git - net-next-2.6.git/blame - include/net/caif/cfsrvl.h
caif: Bugfix not all services uses flow-ctrl.
[net-next-2.6.git] / include / net / caif / cfsrvl.h
CommitLineData
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
14struct 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 24void cfsrvl_release(struct kref *kref);
09009f30
SB
25struct cflayer *cfvei_create(u8 linkid, struct dev_info *dev_info);
26struct cflayer *cfdgml_create(u8 linkid, struct dev_info *dev_info);
27struct cflayer *cfutill_create(u8 linkid, struct dev_info *dev_info);
28struct cflayer *cfvidl_create(u8 linkid, struct dev_info *dev_info);
29struct cflayer *cfrfml_create(u8 linkid, struct dev_info *dev_info);
30struct cflayer *cfdbgl_create(u8 linkid, struct dev_info *dev_info);
31bool cfsrvl_phyid_match(struct cflayer *layer, int phyid);
32void cfservl_destroy(struct cflayer *layer);
33void cfsrvl_init(struct cfsrvl *service,
b1c74247
SB
34 u8 channel_id,
35 struct dev_info *dev_info,
36 bool supports_flowctrl);
09009f30
SB
37bool cfsrvl_ready(struct cfsrvl *service, int *err);
38u8 cfsrvl_getphyid(struct cflayer *layer);
39
5b208656
SB
40static 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
49static 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_ */