diff options
Diffstat (limited to 'net/caif/cfsrvl.c')
-rw-r--r-- | net/caif/cfsrvl.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/net/caif/cfsrvl.c b/net/caif/cfsrvl.c index 6e5b7079a684..7aa1f03a0151 100644 --- a/net/caif/cfsrvl.c +++ b/net/caif/cfsrvl.c | |||
@@ -24,8 +24,10 @@ static void cfservl_ctrlcmd(struct cflayer *layr, enum caif_ctrlcmd ctrl, | |||
24 | int phyid) | 24 | int phyid) |
25 | { | 25 | { |
26 | struct cfsrvl *service = container_obj(layr); | 26 | struct cfsrvl *service = container_obj(layr); |
27 | |||
27 | caif_assert(layr->up != NULL); | 28 | caif_assert(layr->up != NULL); |
28 | caif_assert(layr->up->ctrlcmd != NULL); | 29 | caif_assert(layr->up->ctrlcmd != NULL); |
30 | |||
29 | switch (ctrl) { | 31 | switch (ctrl) { |
30 | case CAIF_CTRLCMD_INIT_RSP: | 32 | case CAIF_CTRLCMD_INIT_RSP: |
31 | service->open = true; | 33 | service->open = true; |
@@ -89,9 +91,14 @@ static void cfservl_ctrlcmd(struct cflayer *layr, enum caif_ctrlcmd ctrl, | |||
89 | static int cfservl_modemcmd(struct cflayer *layr, enum caif_modemcmd ctrl) | 91 | static int cfservl_modemcmd(struct cflayer *layr, enum caif_modemcmd ctrl) |
90 | { | 92 | { |
91 | struct cfsrvl *service = container_obj(layr); | 93 | struct cfsrvl *service = container_obj(layr); |
94 | |||
92 | caif_assert(layr != NULL); | 95 | caif_assert(layr != NULL); |
93 | caif_assert(layr->dn != NULL); | 96 | caif_assert(layr->dn != NULL); |
94 | caif_assert(layr->dn->transmit != NULL); | 97 | caif_assert(layr->dn->transmit != NULL); |
98 | |||
99 | if (!service->supports_flowctrl) | ||
100 | return 0; | ||
101 | |||
95 | switch (ctrl) { | 102 | switch (ctrl) { |
96 | case CAIF_MODEMCMD_FLOW_ON_REQ: | 103 | case CAIF_MODEMCMD_FLOW_ON_REQ: |
97 | { | 104 | { |
@@ -153,8 +160,10 @@ void cfservl_destroy(struct cflayer *layer) | |||
153 | } | 160 | } |
154 | 161 | ||
155 | void cfsrvl_init(struct cfsrvl *service, | 162 | void cfsrvl_init(struct cfsrvl *service, |
156 | u8 channel_id, | 163 | u8 channel_id, |
157 | struct dev_info *dev_info) | 164 | struct dev_info *dev_info, |
165 | bool supports_flowctrl | ||
166 | ) | ||
158 | { | 167 | { |
159 | caif_assert(offsetof(struct cfsrvl, layer) == 0); | 168 | caif_assert(offsetof(struct cfsrvl, layer) == 0); |
160 | service->open = false; | 169 | service->open = false; |
@@ -164,6 +173,7 @@ void cfsrvl_init(struct cfsrvl *service, | |||
164 | service->layer.ctrlcmd = cfservl_ctrlcmd; | 173 | service->layer.ctrlcmd = cfservl_ctrlcmd; |
165 | service->layer.modemcmd = cfservl_modemcmd; | 174 | service->layer.modemcmd = cfservl_modemcmd; |
166 | service->dev_info = *dev_info; | 175 | service->dev_info = *dev_info; |
176 | service->supports_flowctrl = supports_flowctrl; | ||
167 | kref_init(&service->ref); | 177 | kref_init(&service->ref); |
168 | } | 178 | } |
169 | 179 | ||