From 2aa40aef9debc77d55cc87a50d335b6fe97fbeb0 Mon Sep 17 00:00:00 2001 From: Sjur Braendeland Date: Thu, 17 Jun 2010 06:55:40 +0000 Subject: 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 --- include/net/caif/caif_dev.h | 8 ++++++-- include/net/caif/caif_layer.h | 6 ------ include/net/caif/cfcnfg.h | 16 ++++++++++++---- 3 files changed, 18 insertions(+), 12 deletions(-) (limited to 'include/net/caif') diff --git a/include/net/caif/caif_dev.h b/include/net/caif/caif_dev.h index 318ab9478a44..6da573c75d54 100644 --- a/include/net/caif/caif_dev.h +++ b/include/net/caif/caif_dev.h @@ -50,6 +50,9 @@ struct caif_connect_request { * @client_layer: User implementation of client layer. This layer * MUST have receive and control callback functions * implemented. + * @ifindex: Link layer interface index used for this connection. + * @headroom: Head room needed by CAIF protocol. + * @tailroom: Tail room needed by CAIF protocol. * * This function connects a CAIF channel. The Client must implement * the struct cflayer. This layer represents the Client layer and holds @@ -59,8 +62,9 @@ struct caif_connect_request { * E.g. CAIF Socket will call this function for each socket it connects * and have one client_layer instance for each socket. */ -int caif_connect_client(struct caif_connect_request *config, - struct cflayer *client_layer); +int caif_connect_client(struct caif_connect_request *conn_req, + struct cflayer *client_layer, int *ifindex, + int *headroom, int *tailroom); /** * caif_disconnect_client - Disconnects a client from the CAIF stack. diff --git a/include/net/caif/caif_layer.h b/include/net/caif/caif_layer.h index 25c472f0e5b8..c8b07a904e78 100644 --- a/include/net/caif/caif_layer.h +++ b/include/net/caif/caif_layer.h @@ -15,14 +15,8 @@ struct cfpktq; struct caif_payload_info; struct caif_packet_funcs; -#define CAIF_MAX_FRAMESIZE 4096 -#define CAIF_MAX_PAYLOAD_SIZE (4096 - 64) -#define CAIF_NEEDED_HEADROOM (10) -#define CAIF_NEEDED_TAILROOM (2) #define CAIF_LAYER_NAME_SZ 16 -#define CAIF_SUCCESS 1 -#define CAIF_FAILURE 0 /** * caif_assert() - Assert function for CAIF. diff --git a/include/net/caif/cfcnfg.h b/include/net/caif/cfcnfg.h index 9fc2fc20b884..bd646faffa47 100644 --- a/include/net/caif/cfcnfg.h +++ b/include/net/caif/cfcnfg.h @@ -7,6 +7,7 @@ #ifndef CFCNFG_H_ #define CFCNFG_H_ #include +#include #include #include @@ -73,8 +74,8 @@ void cfcnfg_remove(struct cfcnfg *cfg); void cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type, - void *dev, struct cflayer *phy_layer, u16 *phyid, - enum cfcnfg_phy_preference pref, + struct net_device *dev, struct cflayer *phy_layer, + u16 *phyid, enum cfcnfg_phy_preference pref, bool fcs, bool stx); /** @@ -114,11 +115,18 @@ void cfcnfg_release_adap_layer(struct cflayer *adap_layer); * @param: Link setup parameters. * @adap_layer: Specify the adaptation layer; the receive and * flow-control functions MUST be set in the structure. - * + * @ifindex: Link layer interface index used for this connection. + * @proto_head: Protocol head-space needed by CAIF protocol, + * excluding link layer. + * @proto_tail: Protocol tail-space needed by CAIF protocol, + * excluding link layer. */ int cfcnfg_add_adaptation_layer(struct cfcnfg *cnfg, struct cfctrl_link_param *param, - struct cflayer *adap_layer); + struct cflayer *adap_layer, + int *ifindex, + int *proto_head, + int *proto_tail); /** * cfcnfg_get_phyid() - Get physical ID, given type. -- cgit v1.2.3