myri10ge: add multiqueue TX
[safe/jmp/linux-2.6] / drivers / net / ehea / ehea.h
index 88fb53e..5524271 100644 (file)
 #include <asm/io.h>
 
 #define DRV_NAME       "ehea"
-#define DRV_VERSION    "EHEA_0083"
+#define DRV_VERSION    "EHEA_0093"
 
 /* eHEA capability flags */
 #define DLPAR_PORT_ADD_REM 1
 #define DLPAR_MEM_ADD      2
 #define DLPAR_MEM_REM      4
-#define EHEA_CAPABILITIES  (DLPAR_PORT_ADD_REM | DLPAR_MEM_ADD)
+#define EHEA_CAPABILITIES  (DLPAR_PORT_ADD_REM | DLPAR_MEM_ADD | DLPAR_MEM_REM)
 
 #define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
        | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
 #define EHEA_MR_ACC_CTRL       0x00800000
 
 #define EHEA_BUSMAP_START      0x8000000000000000ULL
+#define EHEA_INVAL_ADDR        0xFFFFFFFFFFFFFFFFULL
+#define EHEA_DIR_INDEX_SHIFT 13                   /* 8k Entries in 64k block */
+#define EHEA_TOP_INDEX_SHIFT (EHEA_DIR_INDEX_SHIFT * 2)
+#define EHEA_MAP_ENTRIES (1 << EHEA_DIR_INDEX_SHIFT)
+#define EHEA_MAP_SIZE (0x10000)                   /* currently fixed map size */
+#define EHEA_INDEX_MASK (EHEA_MAP_ENTRIES - 1)
+
 
 #define EHEA_WATCH_DOG_TIMEOUT 10*HZ
 
@@ -192,10 +199,20 @@ struct h_epas {
                                   set to 0 if unused */
 };
 
-struct ehea_busmap {
-       unsigned int entries;           /* total number of entries */
-       unsigned int valid_sections;    /* number of valid sections */
-       u64 *vaddr;
+/*
+ * Memory map data structures
+ */
+struct ehea_dir_bmap
+{
+       u64 ent[EHEA_MAP_ENTRIES];
+};
+struct ehea_top_bmap
+{
+       struct ehea_dir_bmap *dir[EHEA_MAP_ENTRIES];
+};
+struct ehea_bmap
+{
+       struct ehea_top_bmap *top[EHEA_MAP_ENTRIES];
 };
 
 struct ehea_qp;
@@ -371,6 +388,7 @@ struct ehea_port_res {
        struct ehea_q_skb_arr rq2_skba;
        struct ehea_q_skb_arr rq3_skba;
        struct ehea_q_skb_arr sq_skba;
+       int sq_skba_size;
        spinlock_t netif_queue;
        int queue_stopped;
        int swqe_refill_th;
@@ -386,6 +404,13 @@ struct ehea_port_res {
 
 
 #define EHEA_MAX_PORTS 16
+
+#define EHEA_NUM_PORTRES_FW_HANDLES    6  /* QP handle, SendCQ handle,
+                                            RecvCQ handle, EQ handle,
+                                            SendMR handle, RecvMR handle */
+#define EHEA_NUM_PORT_FW_HANDLES       1  /* EQ handle */
+#define EHEA_NUM_ADAPTER_FW_HANDLES    2  /* MR handle, NEQ handle */
+
 struct ehea_adapter {
        u64 handle;
        struct of_device *ofdev;
@@ -405,6 +430,31 @@ struct ehea_mc_list {
        u64 macaddr;
 };
 
+/* kdump support */
+struct ehea_fw_handle_entry {
+       u64 adh;               /* Adapter Handle */
+       u64 fwh;               /* Firmware Handle */
+};
+
+struct ehea_fw_handle_array {
+       struct ehea_fw_handle_entry *arr;
+       int num_entries;
+       struct mutex lock;
+};
+
+struct ehea_bcmc_reg_entry {
+       u64 adh;               /* Adapter Handle */
+       u32 port_id;           /* Logical Port Id */
+       u8 reg_type;           /* Registration Type */
+       u64 macaddr;
+};
+
+struct ehea_bcmc_reg_array {
+       struct ehea_bcmc_reg_entry *arr;
+       int num_entries;
+       spinlock_t lock;
+};
+
 #define EHEA_PORT_UP 1
 #define EHEA_PORT_DOWN 0
 #define EHEA_PHY_LINK_UP 1
@@ -420,7 +470,7 @@ struct ehea_port {
        struct vlan_group *vgrp;
        struct ehea_eq *qp_eq;
        struct work_struct reset_task;
-       struct semaphore port_lock;
+       struct mutex port_lock;
        char int_aff_name[EHEA_IRQ_NAME_SIZE];
        int allmulti;                    /* Indicates IFF_ALLMULTI state */
        int promisc;                     /* Indicates IFF_PROMISC state */
@@ -428,6 +478,7 @@ struct ehea_port {
        int num_add_tx_qps;
        int num_mcs;
        int resets;
+       u64 flags;
        u64 mac_addr;
        u32 logical_port_id;
        u32 port_speed;
@@ -451,7 +502,8 @@ struct port_res_cfg {
 };
 
 enum ehea_flag_bits {
-       __EHEA_STOP_XFER
+       __EHEA_STOP_XFER,
+       __EHEA_DISABLE_PORT_RESET
 };
 
 void ehea_set_ethtool_ops(struct net_device *netdev);