[PATCH v2 05/19] net/xsc: add ioctl command interface
Stephen Hemminger
stephen at networkplumber.org
Wed Sep 11 05:50:58 CEST 2024
On Wed, 11 Sep 2024 10:07:26 +0800
"WanRenyong" <wanry at yunsilicon.com> wrote:
> +#define XSC_IOCTL_CHECK_FIELD 0x01234567
> +
> +#define XSC_IOCTL_MAGIC 0x1b
> +#define XSC_IOCTL_CMDQ \
> + _IOWR(XSC_IOCTL_MAGIC, 1, struct xsc_ioctl_hdr)
> +#define XSC_IOCTL_DRV_GET \
> + _IOR(XSC_IOCTL_MAGIC, 2, struct xsc_ioctl_hdr)
> +#define XSC_IOCTL_CMDQ_RAW \
> + _IOWR(XSC_IOCTL_MAGIC, 5, struct xsc_ioctl_hdr)
> +
> +enum xsc_ioctl_opcode {
> + XSC_IOCTL_GET_HW_INFO = 0x100,
> +};
> +
> +enum xsc_ioctl_opmod {
> + XSC_IOCTL_OP_GET_LOCAL,
> +};
> +
> +struct xsc_ioctl_attr {
> + uint16_t opcode; /* ioctl cmd */
> + uint16_t length; /* data length */
> + uint32_t error; /* ioctl error info */
> + uint8_t data[0]; /* specific table info */
Do not use zero length array (ZLA). Instead use variable length array (VLA)
> +};
> +
Does this device driver depend on some upstr
More information about the dev
mailing list