diff options
author | Sjur Braendeland <sjur.brandeland@stericsson.com> | 2010-06-17 06:55:38 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-20 19:46:05 -0700 |
commit | b1c74247b9e29ae3bfdf133862328c309bc9cf14 (patch) | |
tree | a20cd55d47036a22e3857d382ed505436a366efe /net/caif/cfsrvl.c | |
parent | c14c643b3d91cc741425c058968672228c310927 (diff) | |
download | linux-3.10-b1c74247b9e29ae3bfdf133862328c309bc9cf14.tar.gz linux-3.10-b1c74247b9e29ae3bfdf133862328c309bc9cf14.tar.bz2 linux-3.10-b1c74247b9e29ae3bfdf133862328c309bc9cf14.zip |
caif: Bugfix not all services uses flow-ctrl.
Flow control is not used by all CAIF services.
The usage of flow control is now part of the gerneal
initialization function for CAIF Services.
Signed-off-by: Sjur Braendeland@stericsson.com
Signed-off-by: David S. Miller <davem@davemloft.net>
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 6e5b7079a68..7aa1f03a015 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, int phyid) { struct cfsrvl *service = container_obj(layr); + caif_assert(layr->up != NULL); caif_assert(layr->up->ctrlcmd != NULL); + switch (ctrl) { case CAIF_CTRLCMD_INIT_RSP: service->open = true; @@ -89,9 +91,14 @@ static void cfservl_ctrlcmd(struct cflayer *layr, enum caif_ctrlcmd ctrl, static int cfservl_modemcmd(struct cflayer *layr, enum caif_modemcmd ctrl) { struct cfsrvl *service = container_obj(layr); + caif_assert(layr != NULL); caif_assert(layr->dn != NULL); caif_assert(layr->dn->transmit != NULL); + + if (!service->supports_flowctrl) + return 0; + switch (ctrl) { case CAIF_MODEMCMD_FLOW_ON_REQ: { @@ -153,8 +160,10 @@ void cfservl_destroy(struct cflayer *layer) } void cfsrvl_init(struct cfsrvl *service, - u8 channel_id, - struct dev_info *dev_info) + u8 channel_id, + struct dev_info *dev_info, + bool supports_flowctrl + ) { caif_assert(offsetof(struct cfsrvl, layer) == 0); service->open = false; @@ -164,6 +173,7 @@ void cfsrvl_init(struct cfsrvl *service, service->layer.ctrlcmd = cfservl_ctrlcmd; service->layer.modemcmd = cfservl_modemcmd; service->dev_info = *dev_info; + service->supports_flowctrl = supports_flowctrl; kref_init(&service->ref); } |