Part of the split. Please, take a look at the cover letter for more details Reviewed-by: Viktor Barna <viktor.barna.rj@xxxxxxxxxxxxxx> Reviewed-by: Gal Gur <gal.gur.jx@xxxxxxxxxxx> Signed-off-by: Alexander Savchenko <oleksandr.savchenko.dn@xxxxxxxxxxxxxx> --- drivers/net/wireless/renesas/ra6w/if.h | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 drivers/net/wireless/renesas/ra6w/if.h diff --git a/drivers/net/wireless/renesas/ra6w/if.h b/drivers/net/wireless/renesas/ra6w/if.h new file mode 100644 index 000000000000..35fc7d2865d4 --- /dev/null +++ b/drivers/net/wireless/renesas/ra6w/if.h @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (C) [2022-2025] Renesas Electronics Corporation and/or its affiliates. + */ + +#ifndef RA6W_IF_H +#define RA6W_IF_H + +struct ra6w_if_ops { + int (*read)(struct sdio_func *func, void *data, int len); + int (*write)(struct sdio_func *func, void *data, int len); +}; + +struct ra6w_if_dev { + struct sdio_func *func; + bool dev_on_resume; +}; + +struct ra6w_if { + struct ra6w_core core; + struct ra6w_if_dev dev; + const struct ra6w_if_ops *ops; +}; + +static inline int ra6w_if_read(struct ra6w_if *ifp, void *buf, int len) +{ + if (ifp->core.recovery.in_recovery) + return -EINPROGRESS; + + return ifp->ops->read(ifp->dev.func, buf, len); +} + +static inline int ra6w_if_write(struct ra6w_if *ifp, void *buf, int len) +{ + if (ifp->core.recovery.in_recovery) + return -EINPROGRESS; + + return ifp->ops->write(ifp->dev.func, buf, len); +} + +#endif /* RA6W_IF_H */ -- 2.17.1