Skip to content

Commit

Permalink
caif: Bugfix - RFM must support segmentation.
Browse files Browse the repository at this point in the history
CAIF Remote File Manager may send or receive more than 4050 bytes.
Due to this The CAIF RFM service have to support segmentation.

Signed-off-by: Sjur [email protected]
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Sjur Braendeland authored and davem330 committed Jun 21, 2010
1 parent b1c7424 commit a7da1f5
Show file tree
Hide file tree
Showing 6 changed files with 278 additions and 67 deletions.
9 changes: 7 additions & 2 deletions include/net/caif/cfsrvl.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct cfsrvl {
bool phy_flow_on;
bool modem_flow_on;
bool supports_flowctrl;
void (*release)(struct kref *);
struct dev_info dev_info;
struct kref ref;
};
Expand All @@ -26,7 +27,8 @@ struct cflayer *cfvei_create(u8 linkid, struct dev_info *dev_info);
struct cflayer *cfdgml_create(u8 linkid, struct dev_info *dev_info);
struct cflayer *cfutill_create(u8 linkid, struct dev_info *dev_info);
struct cflayer *cfvidl_create(u8 linkid, struct dev_info *dev_info);
struct cflayer *cfrfml_create(u8 linkid, struct dev_info *dev_info);
struct cflayer *cfrfml_create(u8 linkid, struct dev_info *dev_info,
int mtu_size);
struct cflayer *cfdbgl_create(u8 linkid, struct dev_info *dev_info);
bool cfsrvl_phyid_match(struct cflayer *layer, int phyid);
void cfservl_destroy(struct cflayer *layer);
Expand All @@ -52,7 +54,10 @@ static inline void cfsrvl_put(struct cflayer *layr)
if (layr == NULL)
return;
s = container_of(layr, struct cfsrvl, layer);
kref_put(&s->ref, cfsrvl_release);

WARN_ON(!s->release);
if (s->release)
kref_put(&s->ref, s->release);
}

#endif /* CFSRVL_H_ */
4 changes: 0 additions & 4 deletions net/caif/caif_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,6 @@ static int caif_seqpkt_sendmsg(struct kiocb *kiocb, struct socket *sock,

buffer_size = len + CAIF_NEEDED_HEADROOM + CAIF_NEEDED_TAILROOM;

ret = -EMSGSIZE;
if (buffer_size > CAIF_MAX_PAYLOAD_SIZE)
goto err;

timeo = sock_sndtimeo(sk, noblock);
timeo = caif_wait_for_flow_on(container_of(sk, struct caifsock, sk),
1, timeo, &ret);
Expand Down
4 changes: 3 additions & 1 deletion net/caif/cfcnfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define PHY_NAME_LEN 20

#define container_obj(layr) container_of(layr, struct cfcnfg, layer)
#define RFM_FRAGMENT_SIZE 4030

/* Information about CAIF physical interfaces held by Config Module in order
* to manage physical interfaces
Expand Down Expand Up @@ -328,7 +329,8 @@ cfcnfg_linkup_rsp(struct cflayer *layer, u8 channel_id, enum cfctrl_srv serv,
servicel = cfdgml_create(channel_id, &phyinfo->dev_info);
break;
case CFCTRL_SRV_RFM:
servicel = cfrfml_create(channel_id, &phyinfo->dev_info);
servicel = cfrfml_create(channel_id, &phyinfo->dev_info,
RFM_FRAGMENT_SIZE);
break;
case CFCTRL_SRV_UTIL:
servicel = cfutill_create(channel_id, &phyinfo->dev_info);
Expand Down
1 change: 0 additions & 1 deletion net/caif/cfpkt_skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ struct cfpkt *cfpkt_append(struct cfpkt *dstpkt,
u16 dstlen;
u16 createlen;
if (unlikely(is_erronous(dstpkt) || is_erronous(addpkt))) {
cfpkt_destroy(addpkt);
return dstpkt;
}
if (expectlen > addlen)
Expand Down
Loading

0 comments on commit a7da1f5

Please sign in to comment.