caif: Use link layer MTU instead of fixed MTU
Previously CAIF supported maximum transfer size of ~4050. The transfer size is now calculated dynamically based on the link layers mtu size. Signed-off-by: Sjur Braendeland@stericsson.com Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
a7da1f55a8
commit
2aa40aef9d
@@ -14,7 +14,8 @@
|
||||
#define container_obj(layr) ((struct cfserl *) layr)
|
||||
|
||||
#define CFSERL_STX 0x02
|
||||
#define CAIF_MINIUM_PACKET_SIZE 4
|
||||
#define SERIAL_MINIUM_PACKET_SIZE 4
|
||||
#define SERIAL_MAX_FRAMESIZE 4096
|
||||
struct cfserl {
|
||||
struct cflayer layer;
|
||||
struct cfpkt *incomplete_frm;
|
||||
@@ -119,8 +120,8 @@ static int cfserl_receive(struct cflayer *l, struct cfpkt *newpkt)
|
||||
/*
|
||||
* Frame error handling
|
||||
*/
|
||||
if (expectlen < CAIF_MINIUM_PACKET_SIZE
|
||||
|| expectlen > CAIF_MAX_FRAMESIZE) {
|
||||
if (expectlen < SERIAL_MINIUM_PACKET_SIZE
|
||||
|| expectlen > SERIAL_MAX_FRAMESIZE) {
|
||||
if (!layr->usestx) {
|
||||
if (pkt != NULL)
|
||||
cfpkt_destroy(pkt);
|
||||
|
Reference in New Issue
Block a user