1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-only */ 2*4882a593Smuzhiyun /* 3*4882a593Smuzhiyun * Copyright (C) ST-Ericsson AB 2010 4*4882a593Smuzhiyun * Author: Sjur Brendeland 5*4882a593Smuzhiyun */ 6*4882a593Smuzhiyun 7*4882a593Smuzhiyun #ifndef CAIF_DEVICE_H_ 8*4882a593Smuzhiyun #define CAIF_DEVICE_H_ 9*4882a593Smuzhiyun #include <linux/kernel.h> 10*4882a593Smuzhiyun #include <linux/net.h> 11*4882a593Smuzhiyun #include <linux/netdevice.h> 12*4882a593Smuzhiyun #include <linux/caif/caif_socket.h> 13*4882a593Smuzhiyun #include <net/caif/caif_device.h> 14*4882a593Smuzhiyun 15*4882a593Smuzhiyun /** 16*4882a593Smuzhiyun * struct caif_dev_common - data shared between CAIF drivers and stack. 17*4882a593Smuzhiyun * @flowctrl: Flow Control callback function. This function is 18*4882a593Smuzhiyun * supplied by CAIF Core Stack and is used by CAIF 19*4882a593Smuzhiyun * Link Layer to send flow-stop to CAIF Core. 20*4882a593Smuzhiyun * The flow information will be distributed to all 21*4882a593Smuzhiyun * clients of CAIF. 22*4882a593Smuzhiyun * 23*4882a593Smuzhiyun * @link_select: Profile of device, either high-bandwidth or 24*4882a593Smuzhiyun * low-latency. This member is set by CAIF Link 25*4882a593Smuzhiyun * Layer Device in order to indicate if this device 26*4882a593Smuzhiyun * is a high bandwidth or low latency device. 27*4882a593Smuzhiyun * 28*4882a593Smuzhiyun * @use_frag: CAIF Frames may be fragmented. 29*4882a593Smuzhiyun * Is set by CAIF Link Layer in order to indicate if the 30*4882a593Smuzhiyun * interface receives fragmented frames that must be 31*4882a593Smuzhiyun * assembled by CAIF Core Layer. 32*4882a593Smuzhiyun * 33*4882a593Smuzhiyun * @use_fcs: Indicate if Frame CheckSum (fcs) is used. 34*4882a593Smuzhiyun * Is set if the physical interface is 35*4882a593Smuzhiyun * using Frame Checksum on the CAIF Frames. 36*4882a593Smuzhiyun * 37*4882a593Smuzhiyun * @use_stx: Indicate STart of frame eXtension (stx) in use. 38*4882a593Smuzhiyun * Is set if the CAIF Link Layer expects 39*4882a593Smuzhiyun * CAIF Frames to start with the STX byte. 40*4882a593Smuzhiyun * 41*4882a593Smuzhiyun * This structure is shared between the CAIF drivers and the CAIF stack. 42*4882a593Smuzhiyun * It is used by the device to register its behavior. 43*4882a593Smuzhiyun * CAIF Core layer must set the member flowctrl in order to supply 44*4882a593Smuzhiyun * CAIF Link Layer with the flow control function. 45*4882a593Smuzhiyun * 46*4882a593Smuzhiyun */ 47*4882a593Smuzhiyun struct caif_dev_common { 48*4882a593Smuzhiyun void (*flowctrl)(struct net_device *net, int on); 49*4882a593Smuzhiyun enum caif_link_selector link_select; 50*4882a593Smuzhiyun int use_frag; 51*4882a593Smuzhiyun int use_fcs; 52*4882a593Smuzhiyun int use_stx; 53*4882a593Smuzhiyun }; 54*4882a593Smuzhiyun 55*4882a593Smuzhiyun #endif /* CAIF_DEVICE_H_ */ 56