enic: add devcmd2 resources
authorGovindarajulu Varadarajan <_govind@gmx.com>
Sat, 15 Aug 2015 20:14:53 +0000 (01:44 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Aug 2015 22:25:29 +0000 (15:25 -0700)
Add devcmd resources to vnic_res_type. Add data types used by devcmd.

Signed-off-by: N V V Satyanarayana Reddy <nalreddy@cisco.com>
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cisco/enic/vnic_dev.h
drivers/net/ethernet/cisco/enic/vnic_devcmd.h
drivers/net/ethernet/cisco/enic/vnic_resource.h
drivers/net/ethernet/cisco/enic/vnic_wq.h

index 90bca09a15531d0c05af47ad4571f5c4ce08c9f8..51aae0579b252c72386e9551853a3aaa015f54b4 100644 (file)
@@ -107,6 +107,7 @@ struct vnic_dev {
        u32 proxy_index;
        u64 args[VNIC_DEVCMD_NARGS];
        struct vnic_intr_coal_timer_info intr_coal_timer_info;
+       struct devcmd2_controller *devcmd2;
 };
 
 struct vnic_stats;
index 435d0cd96c224c5c8b6a5c8db6498d41458b8cf6..09e803922b75afdd014ddead7ded4b5b9cea5eff 100644 (file)
@@ -365,6 +365,12 @@ enum vnic_devcmd_cmd {
         */
        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.
         * in: (u64) a0= filter address
         *     (u32) a1= size of filter
@@ -629,4 +635,21 @@ struct vnic_devcmd {
        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_ */
index e0a73f1ca6f43e3b66558edb933cb9a9105aa5bb..4e45f88ac1d4e322ec80dcac4c33399fbf31189c 100644 (file)
@@ -48,6 +48,13 @@ enum vnic_res_type {
        RES_TYPE_RSVD7,
        RES_TYPE_DEVCMD,                /* Device command region */
        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 */
 };
index 296154351823e2ebc30a205f72d2437bf86d0c30..d5ea706c49752650928e545a222fe4294d235349 100644 (file)
@@ -88,6 +88,17 @@ struct vnic_wq {
        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)
 {
        /* how many does SW own? */