Commit fda3f52b authored by Govindarajulu Varadarajan's avatar Govindarajulu Varadarajan Committed by David S. Miller

enic: add devcmd2 resources

Add devcmd resources to vnic_res_type. Add data types used by devcmd.
Signed-off-by: default avatarN V V Satyanarayana Reddy <nalreddy@cisco.com>
Signed-off-by: default avatarGovindarajulu Varadarajan <_govind@gmx.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6a3c2f83
...@@ -107,6 +107,7 @@ struct vnic_dev { ...@@ -107,6 +107,7 @@ struct vnic_dev {
u32 proxy_index; u32 proxy_index;
u64 args[VNIC_DEVCMD_NARGS]; u64 args[VNIC_DEVCMD_NARGS];
struct vnic_intr_coal_timer_info intr_coal_timer_info; struct vnic_intr_coal_timer_info intr_coal_timer_info;
struct devcmd2_controller *devcmd2;
}; };
struct vnic_stats; struct vnic_stats;
......
...@@ -365,6 +365,12 @@ enum vnic_devcmd_cmd { ...@@ -365,6 +365,12 @@ enum vnic_devcmd_cmd {
*/ */
CMD_PROV_INFO_UPDATE = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 56), CMD_PROV_INFO_UPDATE = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 56),
/* Initialization for the devcmd2 interface.
* in: (u64) a0 = host result buffer physical address
* in: (u16) a1 = number of entries in result buffer
*/
CMD_INITIALIZE_DEVCMD2 = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ALL, 57),
/* Add a filter. /* Add a filter.
* in: (u64) a0= filter address * in: (u64) a0= filter address
* (u32) a1= size of filter * (u32) a1= size of filter
...@@ -629,4 +635,21 @@ struct vnic_devcmd { ...@@ -629,4 +635,21 @@ struct vnic_devcmd {
u64 args[VNIC_DEVCMD_NARGS]; /* RW cmd args (little-endian) */ u64 args[VNIC_DEVCMD_NARGS]; /* RW cmd args (little-endian) */
}; };
#define VNIC_DEVCMD2_NARGS VNIC_DEVCMD_NARGS
struct vnic_devcmd2 {
u16 pad;
u16 flags;
u32 cmd;
u64 args[VNIC_DEVCMD2_NARGS];
};
#define VNIC_DEVCMD2_NRESULTS VNIC_DEVCMD_NARGS
struct devcmd2_result {
u64 results[VNIC_DEVCMD2_NRESULTS];
u32 pad;
u16 completed_index;
u8 error;
u8 color;
};
#endif /* _VNIC_DEVCMD_H_ */ #endif /* _VNIC_DEVCMD_H_ */
...@@ -48,6 +48,13 @@ enum vnic_res_type { ...@@ -48,6 +48,13 @@ enum vnic_res_type {
RES_TYPE_RSVD7, RES_TYPE_RSVD7,
RES_TYPE_DEVCMD, /* Device command region */ RES_TYPE_DEVCMD, /* Device command region */
RES_TYPE_PASS_THRU_PAGE, /* Pass-thru page */ RES_TYPE_PASS_THRU_PAGE, /* Pass-thru page */
RES_TYPE_SUBVNIC, /* subvnic resource type */
RES_TYPE_MQ_WQ, /* MQ Work queues */
RES_TYPE_MQ_RQ, /* MQ Receive queues */
RES_TYPE_MQ_CQ, /* MQ Completion queues */
RES_TYPE_DEPRECATED1, /* Old version of devcmd 2 */
RES_TYPE_DEPRECATED2, /* Old version of devcmd 2 */
RES_TYPE_DEVCMD2, /* Device control region */
RES_TYPE_MAX, /* Count of resource types */ RES_TYPE_MAX, /* Count of resource types */
}; };
......
...@@ -88,6 +88,17 @@ struct vnic_wq { ...@@ -88,6 +88,17 @@ struct vnic_wq {
unsigned int pkts_outstanding; unsigned int pkts_outstanding;
}; };
struct devcmd2_controller {
struct vnic_wq_ctrl __iomem *wq_ctrl;
struct vnic_devcmd2 *cmd_ring;
struct devcmd2_result *result;
u16 next_result;
u16 result_size;
int color;
struct vnic_dev_ring results_ring;
struct vnic_wq wq;
};
static inline unsigned int vnic_wq_desc_avail(struct vnic_wq *wq) static inline unsigned int vnic_wq_desc_avail(struct vnic_wq *wq)
{ {
/* how many does SW own? */ /* how many does SW own? */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment