#ifndef _SONY_FPGA_NETIF_H_
#define _SONY_FPGA_NETIF_H_

#include <linux/interrupt.h>

enum SONY_FPGA_NETIF_FPGA_ID {
    SONY_FPGA_NETIF_FPGA_ID_NET1_NEM = 0,
    SONY_FPGA_NETIF_FPGA_ID_NET1_BIMA,
    SONY_FPGA_NETIF_FPGA_ID_NET1_BIMB,
    SONY_FPGA_NETIF_FPGA_ID_NET2_NEM,
    SONY_FPGA_NETIF_FPGA_ID_NET2_BIMA,
    SONY_FPGA_NETIF_FPGA_ID_NET2_BIMB,
    SONY_FPGA_NETIF_FPGA_ID_MAX
};

extern bool sony_fpga_netif_is_ioready(enum SONY_FPGA_NETIF_FPGA_ID fpga_id);
extern void sony_fpga_netif_iowrite32(u32 data, enum SONY_FPGA_NETIF_FPGA_ID fpga_id, u32 bar_index, u32 offset);
extern u32 sony_fpga_netif_ioread32(enum SONY_FPGA_NETIF_FPGA_ID fpga_id, u32 bar_index, u32 offset);

extern int sony_fpga_netif_request_irq(enum SONY_FPGA_NETIF_FPGA_ID fpga_id, irq_handler_t handler, void* dev);
extern void sony_fpga_netif_free_irq(enum SONY_FPGA_NETIF_FPGA_ID fpga_id, void* dev);

// internal use
struct sony_fpga_ctrl;
extern void sony_fpga_netif_notify_probe_success(const struct sony_fpga_ctrl* ctrl_data);

extern void* sony_fpga_netif_get_dmac_buffer(enum SONY_FPGA_NETIF_FPGA_ID fpga_id);
extern long sony_fpga_netif_wait_dma_ready(void);

#endif /* _SONY_FPGA_NETIF_H_ */
