usb:v0627p0001d0000dc00dsc00dp00ic03isc01ip01in00
 B    /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
/* Do not edit directly, auto-generated from: */
/*	Documentation/netlink/specs/fou.yaml */
/* YNL-GEN uapi header */

#ifndef _UAPI_LINUX_FOU_H
#define _UAPI_LINUX_FOU_H

#define FOU_GENL_NAME		"fou"
#define FOU_GENL_VERSION	1

enum {
	FOU_ENCAP_UNSPEC,
	FOU_ENCAP_DIRECT,
	FOU_ENCAP_GUE,
};

enum {
	FOU_ATTR_UNSPEC,
	FOU_ATTR_PORT,
	FOU_ATTR_AF,
	FOU_ATTR_IPPROTO,
	FOU_ATTR_TYPE,
	FOU_ATTR_REMCSUM_NOPARTIAL,
	FOU_ATTR_LOCAL_V4,
	FOU_ATTR_LOCAL_V6,
	FOU_ATTR_PEER_V4,
	FOU_ATTR_PEER_V6,
	FOU_ATTR_PEER_PORT,
	FOU_ATTR_IFINDEX,

	__FOU_ATTR_MAX
};
#define FOU_ATTR_MAX (__FOU_ATTR_MAX - 1)

enum {
	FOU_CMD_UNSPEC,
	FOU_CMD_ADD,
	FOU_CMD_DEL,
	FOU_CMD_GET,

	__FOU_CMD_MAX
};
#define FOU_CMD_MAX (__FOU_CMD_MAX - 1)

#endif /* _UAPI_LINUX_FOU_H */
      auto
 		    	/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (C) 2015 Pengutronix, Uwe Kleine-KÃ¶nig <kernel@pengutronix.de>
 */

#include <linux/device.h>

#define to_siox_device(_dev)	container_of((_dev), struct siox_device, dev)
struct siox_device {
	struct list_head node; /* node in smaster->devices */
	struct siox_master *smaster;
	struct device dev;

	const char *type;
	size_t inbytes;
	size_t outbytes;
	u8 statustype;

	u8 status_read_clean;
	u8 status_written;
	u8 status_written_lastcycle;
	bool connected;

	/* statistics */
	unsigned int watchdog_errors;
	unsigned int status_errors;

	struct kernfs_node *status_errors_kn;
	struct kernfs_node *watchdog_kn;
	struct kernfs_node *watchdog_errors_kn;
	struct kernfs_node *connected_kn;
};

bool siox_device_synced(struct siox_device *sdevice);
bool siox_device_connected(struct siox_device *sdevice);

struct siox_driver {
	int (*probe)(struct siox_device *sdevice);
	void (*remove)(struct siox_device *sdevice);
	void (*shutdown)(struct siox_device *sdevice);

	/*
	 * buf is big enough to hold sdev->inbytes - 1 bytes, the status byte
	 * is in the scope of the framework.
	 */
	int (*set_data)(struct siox_device *sdevice, u8 status, u8 buf[]);
	/*
	 * buf is big enough to hold sdev->outbytes - 1 bytes, the status byte
	 * is in the scope of the framework
	 */
	int (*get_data)(struct siox_device *sdevice, const u8 buf[]);

	struct device_driver driver;
};

static inline struct siox_driver *to_siox_driver(struct device_driver *driver)
{
	if (driver)
		return container_of(driver, struct siox_driver, driver);
	else
		return NULL;
}

int __siox_driver_register(struct siox_driver *sdriver, struct module *owner);

static inline int siox_driver_register(struct siox_driver *sdriver)
{
	return __siox_driver_register(sdriver, THIS_MODULE);
}

static inline void siox_driver_unregister(struct siox_driver *sdriver)
{
	return driver_unregister(&sdriver->driver);
}

/*
 * module_siox_driver() - Helper macro for drivers that don't do
 * anything special in module init/exit.  This eliminates a lot of
 * boilerplate.  Each module may only use this macro once, and
 * calling it replaces module_init() and module_exit()
 */
#define module_siox_driver(__siox_driver) \
	module_driver(__siox_driver, siox_driver_register, \
			siox_driver_unregister)
     ˆ¿Ãƒ‚¾ÂÁ     ˆ¿Ãƒ[o¾ÂÁ  0   ˆl–ßi~”êh¥8 Eq—î41hßÄƒq—ž_ŒuÐb&=Ly[Ï¿ÄÃ ô    ý7zXZ  i"Þ6 !   t/å£àÂŸ·] è€ÂP;ÛâÐ6é“ˆ–lí R±©Ò�±5œ$øÛR‹™Ÿ‰î´£di2á(‚Ä>î»?åxç	QTÞ`•”Õ�»”|Òá‰/±©ú~KYI¯.±”;Î°Ûm8'Êjok�%ªRhÖÌl,•ß¨ î÷cØž;ê»KÁ[©·ÕÊêœ¡yÒñ\DîmctÎ¼ÓÝ$ÌÖ$6Ã³GÖÉžŒ*Ûî7,<„¥÷´&ÖcG³)®[“ÊÅp–Í!ÞâŒÐ¸óOrGªëßƒQ�ª]z«K´³¤9@Þ²�–6d¿Paà%ÕÔoŒâ‡—âñ³î�æyÓ)yj~/Ýï«æÞùq¿X¸`!M¾l*/¿Ì]Ep`ê–Ý	;÷Ç¬Ÿ¶¤Vš:ò¬jd¸Qf+®Ú—¤{ú÷ªRÅ6qL´ûƒÂùPåœ~y…ø¨ðZÁF¤ûFç¶ú…eoSe˜;HoÈã:)¤¿Ÿëg/‰È÷‚Óçº‰¯óÿ�]ÓŽÞùúüÝË^K~¾„·Ü¹'˜EÒÛ/ÝWµc‘Bñ!©ÑóŠ”[¿áßbÝgÌ8wº þ(ã 2ÅW«îí<�üûQçÞ3ÝF­_–±®»	�ð…·9±%ˆ îwÈ.}V±u°ïõP¦tï>÷�õF6¦Ìë•,‘k*a„&ãSÆ�ôVrk‘<ŒwÇ¼¢5Ÿ-&0û‡<MˆpTlú›W©)Ï�X“8SæNÐ0(ÀñP¡�yœWå“Ï�ÅLL	 ÑPQœ ‰…/|–&È‡ŒÚûDÒç4À¹¤òùº_Àã³ÜE�L€A\¿}¹WgÂa°
ãqb0  â¡�¯¥LBŽ¨�Ò"mš‹ÝW)µ2,JÓs)D“ãÖ�Î&ª=HCh&áSqð/eè¥ý�Zb4¦•„¬4Ä&'ÂÕ‹$‡#Ï±5OØßF§3ˆ‘OP£çÎoI€ûªCóò$NV‹kìÑÜÐ