caif_device.h 1.8 KB

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