Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
[safe/jmp/linux-2.6] / drivers / net / cxgb3 / cxgb3_ctl_defs.h
index 0fdc365..369fe71 100644 (file)
@@ -1,37 +1,65 @@
 /*
- * Copyright (C) 2003-2006 Chelsio Communications.  All rights reserved.
+ * Copyright (c) 2003-2008 Chelsio, Inc. All rights reserved.
  *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the LICENSE file included in this
- * release for licensing terms and conditions.
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
  */
-
 #ifndef _CXGB3_OFFLOAD_CTL_DEFS_H
 #define _CXGB3_OFFLOAD_CTL_DEFS_H
 
 enum {
-       GET_MAX_OUTSTANDING_WR,
-       GET_TX_MAX_CHUNK,
-       GET_TID_RANGE,
-       GET_STID_RANGE,
-       GET_RTBL_RANGE,
-       GET_L2T_CAPACITY,
-       GET_MTUS,
-       GET_WR_LEN,
-       GET_IFF_FROM_MAC,
-       GET_DDP_PARAMS,
-       GET_PORTS,
-
-       ULP_ISCSI_GET_PARAMS,
-       ULP_ISCSI_SET_PARAMS,
-
-       RDMA_GET_PARAMS,
-       RDMA_CQ_OP,
-       RDMA_CQ_SETUP,
-       RDMA_CQ_DISABLE,
-       RDMA_CTRL_QP_SETUP,
-       RDMA_GET_MEM,
+       GET_MAX_OUTSTANDING_WR  = 0,
+       GET_TX_MAX_CHUNK        = 1,
+       GET_TID_RANGE           = 2,
+       GET_STID_RANGE          = 3,
+       GET_RTBL_RANGE          = 4,
+       GET_L2T_CAPACITY        = 5,
+       GET_MTUS                = 6,
+       GET_WR_LEN              = 7,
+       GET_IFF_FROM_MAC        = 8,
+       GET_DDP_PARAMS          = 9,
+       GET_PORTS               = 10,
+
+       ULP_ISCSI_GET_PARAMS    = 11,
+       ULP_ISCSI_SET_PARAMS    = 12,
+
+       RDMA_GET_PARAMS         = 13,
+       RDMA_CQ_OP              = 14,
+       RDMA_CQ_SETUP           = 15,
+       RDMA_CQ_DISABLE         = 16,
+       RDMA_CTRL_QP_SETUP      = 17,
+       RDMA_GET_MEM            = 18,
+       RDMA_GET_MIB            = 19,
+
+       GET_RX_PAGE_INFO        = 50,
+       GET_ISCSI_IPV4ADDR      = 51,
+
+       GET_EMBEDDED_INFO       = 70,
 };
 
 /*
@@ -61,6 +89,12 @@ struct iff_mac {
        u16 vlan_tag;
 };
 
+/* Structure used to request a port's iSCSI IPv4 address */
+struct iscsi_ipv4addr {
+       struct net_device *dev; /* the net_device */
+       __be32 ipv4addr;        /* the return iSCSI IPv4 address */
+};
+
 struct pci_dev;
 
 /*
@@ -86,10 +120,7 @@ struct ulp_iscsi_info {
        unsigned int llimit;
        unsigned int ulimit;
        unsigned int tagmask;
-       unsigned int pgsz3;
-       unsigned int pgsz2;
-       unsigned int pgsz1;
-       unsigned int pgsz0;
+       u8 pgsz_factor[4];
        unsigned int max_rxsz;
        unsigned int max_txsz;
        struct pci_dev *pdev;
@@ -139,4 +170,20 @@ struct rdma_ctrlqp_setup {
        unsigned long long base_addr;
        unsigned int size;
 };
+
+/*
+ * Offload TX/RX page information.
+ */
+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 */