cxgb3: add control to access embedded images
authorDivy Le Ray <divy@chelsio.com>
Fri, 26 Dec 2008 09:16:39 +0000 (01:16 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 Dec 2008 09:16:39 +0000 (01:16 -0800)
Update contol path between cxgb3 and ULP modules (iWARP, iSCSI)
to provide access to firware and protocol engine info.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/cxgb3/cxgb3_ctl_defs.h
drivers/net/cxgb3/cxgb3_offload.c

index 55099eb3c70ec8c5b6e216cdea84567d392eb87c..369fe711fd7f0dc8e974c99acbd912add1bdb773 100644 (file)
@@ -58,6 +58,8 @@ enum {
 
        GET_RX_PAGE_INFO        = 50,
        GET_ISCSI_IPV4ADDR      = 51,
+
+       GET_EMBEDDED_INFO       = 70,
 };
 
 /*
@@ -176,4 +178,12 @@ struct ofld_page_info {
        unsigned int page_size;  /* Page size, should be a power of 2 */
        unsigned int num;        /* Number of pages */
 };
+
+/*
+ * Structure used to get firmware and protocol engine versions.
+ */
+struct ch_embedded_info {
+       u32 fw_vers;
+       u32 tp_vers;
+};
 #endif                         /* _CXGB3_OFFLOAD_CTL_DEFS_H */
index 1ce69b7428041af9ebc6232ffc5a6ac7103ad1a3..2d7f69aff1d949a47e952997932800593444338e 100644 (file)
@@ -438,6 +438,15 @@ static int cxgb_offload_ctl(struct t3cdev *tdev, unsigned int req, void *data)
                p->ipv4addr = pi->iscsi_ipv4addr;
                break;
        }
+       case GET_EMBEDDED_INFO: {
+               struct ch_embedded_info *e = data;
+
+               spin_lock(&adapter->stats_lock);
+               t3_get_fw_version(adapter, &e->fw_vers);
+               t3_get_tp_version(adapter, &e->tp_vers);
+               spin_unlock(&adapter->stats_lock);
+               break;
+       }
        default:
                return -EOPNOTSUPP;
        }