X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fraw%2Fifpga_rawdev%2Fbase%2Fifpga_hw.h;h=ff91c46c7c7d963e69c8ee84de0bc21a91d09c3c;hb=8e80eb4e6222c961f7d79c26dfae8123c4284b8f;hp=a20520c96020cebd56937297494276d65dc6dfee;hpb=56bb54ea1bdf186f81ece23aa59b1e07e43eaa6e;p=dpdk.git diff --git a/drivers/raw/ifpga_rawdev/base/ifpga_hw.h b/drivers/raw/ifpga_rawdev/base/ifpga_hw.h index a20520c960..ff91c46c7c 100644 --- a/drivers/raw/ifpga_rawdev/base/ifpga_hw.h +++ b/drivers/raw/ifpga_rawdev/base/ifpga_hw.h @@ -7,19 +7,30 @@ #include "ifpga_defines.h" #include "opae_ifpga_hw_api.h" +#include "opae_eth_group.h" + +/** List of private feateues */ +TAILQ_HEAD(ifpga_feature_list, ifpga_feature); enum ifpga_feature_state { IFPGA_FEATURE_UNUSED = 0, IFPGA_FEATURE_ATTACHED, }; +enum feature_type { + FEATURE_FME_TYPE = 0, + FEATURE_PORT_TYPE, +}; + struct feature_irq_ctx { int eventfd; int idx; }; -struct feature { +struct ifpga_feature { + TAILQ_ENTRY(ifpga_feature)next; enum ifpga_feature_state state; + enum feature_type type; const char *name; u64 id; u8 *addr; @@ -33,15 +44,19 @@ struct feature { void *parent; /* to parent hw data structure */ - struct feature_ops *ops;/* callback to this private feature */ + struct ifpga_feature_ops *ops;/* callback to this private feature */ + unsigned int vec_start; + unsigned int vec_cnt; }; -struct feature_ops { - int (*init)(struct feature *feature); - void (*uinit)(struct feature *feature); - int (*get_prop)(struct feature *feature, struct feature_prop *prop); - int (*set_prop)(struct feature *feature, struct feature_prop *prop); - int (*set_irq)(struct feature *feature, void *irq_set); +struct ifpga_feature_ops { + int (*init)(struct ifpga_feature *feature); + void (*uinit)(struct ifpga_feature *feature); + int (*get_prop)(struct ifpga_feature *feature, + struct feature_prop *prop); + int (*set_prop)(struct ifpga_feature *feature, + struct feature_prop *prop); + int (*set_irq)(struct ifpga_feature *feature, void *irq_set); }; enum ifpga_fme_state { @@ -52,7 +67,7 @@ enum ifpga_fme_state { struct ifpga_fme_hw { enum ifpga_fme_state state; - struct feature sub_feature[FME_FEATURE_ID_MAX]; + struct ifpga_feature_list feature_list; spinlock_t lock; /* protect hardware access */ void *parent; /* pointer to ifpga_hw */ @@ -67,6 +82,15 @@ struct ifpga_fme_hw { u32 cache_size; u32 capability; + + void *max10_dev; /* MAX10 device */ + void *i2c_master; /* I2C Master device */ + void *eth_dev[MAX_ETH_GROUP_DEVICES]; + struct opae_reg_region + eth_group_region[MAX_ETH_GROUP_DEVICES]; + struct ifpga_fme_board_info board_info; + int nums_eth_dev; + unsigned int nums_acc_region; }; enum ifpga_port_state { @@ -78,7 +102,7 @@ enum ifpga_port_state { struct ifpga_port_hw { enum ifpga_port_state state; - struct feature sub_feature[PORT_FEATURE_ID_MAX]; + struct ifpga_feature_list feature_list; spinlock_t lock; /* protect access to hw */ void *parent; /* pointer to ifpga_hw */