Print this page
NEX-1890 update oce from source provided by Emulex

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/fibre-channel/fca/oce/oce_hw.h
          +++ new/usr/src/uts/common/sys/fibre-channel/fca/oce/oce_hw.h
↓ open down ↓ 11 lines elided ↑ open up ↑
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22      -/* Copyright © 2003-2011 Emulex. All rights reserved.  */
       22 +/*
       23 + * Copyright (c) 2009-2012 Emulex. All rights reserved.
       24 + * Use is subject to license terms.
       25 + */
  23   26  
       27 +
       28 +
  24   29  /*
  25   30   * Header file containing the command structures for Hardware
  26   31   */
  27   32  
  28   33  #ifndef _OCE_HW_H_
  29   34  #define _OCE_HW_H_
  30   35  
  31   36  #ifdef __cplusplus
  32   37  extern "C" {
  33   38  #endif
  34   39  
  35   40  #include <sys/types.h>
       41 +#include "oce_sli4.h"
  36   42  
  37   43  #pragma pack(1)
  38   44  
  39   45  #define OC_CNA_GEN2                     0x2
  40   46  #define OC_CNA_GEN3                     0x3
       47 +enum {
       48 +        ASIC_REV_A0 = 0x0,
       49 +        ASIC_REV_A1 = 0x1,
       50 +        ASIC_REV_A2 = 0x2
       51 +};
       52 +#define BE3_ASIC_REV_A0 ((OC_CNA_GEN3<<8)| ASIC_REV_A0)
       53 +#define BE3_ASIC_REV_A1 ((OC_CNA_GEN3<<8)| ASIC_REV_A1)
       54 +#define BE3_ASIC_REV_A2 ((OC_CNA_GEN3<<8)| ASIC_REV_A2)
       55 +
       56 +#define BE3_A1(dev)     (dev->asic_revision == BE3_ASIC_REV_A0 ||\
       57 +    dev->asic_revision == BE3_ASIC_REV_A1)
       58 +
  41   59  #define DEVID_TIGERSHARK                0x700
  42   60  #define DEVID_TOMCAT                    0x710
       61 +#define DEVID_LANCER                    0xe220
  43   62  
       63 +#define LANCER_CHIP(device)             (device->device_id == DEVID_LANCER)
       64 +
       65 +
  44   66  /* PCI CSR offsets */
  45      -#define PCICFG_F1_CSR                   0x0 /* F1 for NIC */
  46      -#define PCICFG_SEMAPHORE                0xbc
  47      -#define PCICFG_SOFT_RESET               0x5c
  48      -#define PCICFG_UE_STATUS_HI_MASK        0xac
  49      -#define PCICFG_UE_STATUS_LO_MASK        0xa8
  50      -#define PCICFG_ONLINE0                  0xb0
  51      -#define PCICFG_ONLINE1                  0xb4
       67 +#define PCICFG_F1_CSR           0x0 /* F1 for NIC */
       68 +#define PCICFG_SEMAPHORE        0xbc
       69 +#define PCICFG_SOFT_RESET       0x5c
       70 +#define PCICFG_UE_STATUS_LO     0xA0    /* UE status low offset  */
       71 +#define PCICFG_UE_STATUS_HI     0xA4    /* UE status high offset */
       72 +#define PCICFG_UE_STATUS_LO_MASK        0xa8 /* Error mask - low */
       73 +#define PCICFG_UE_STATUS_HI_MASK        0xac /* Error mask - high */
       74 +#define PCICFG_ONLINE0          0xb0
       75 +#define PCICFG_ONLINE1          0xb4
  52   76  #define INTR_EN                         0x20000000
  53   77  #define IMAGE_TRANSFER_SIZE             (32 * 1024) /* 32K at a time */
  54   78  
  55   79  /* CSR register offsets */
  56   80  #define MPU_EP_CONTROL                  0
  57   81  #define MPU_EP_SEMAPHORE                0xac
  58   82  #define PCICFG_INTR_CTRL                0xfc
  59   83  #define HOSTINTR_MASK                   (1 << 29)
  60   84  #define HOSTINTR_PFUNC_SHIFT            26
  61   85  #define HOSTINTR_PFUNC_MASK             7
  62   86  
       87 +/*  Link Status CSR */
       88 +#define PCICFG_PCIE_LINK_STATUS_OFFSET                  0xd0
       89 +#define PCIE_LINK_STATUS_SPEED_MASK                             0xFF
       90 +#define PCIE_LINK_STATUS_SPEED_SHIFT                    16
       91 +#define PCIE_LINK_STATUS_NEG_WIDTH_MASK                 0x3F
       92 +#define PCIE_LINK_STATUS_NEG_WIDTH_SHIFT                20
       93 +
       94 +/*  Link Capability CSR */
       95 +#define PCICFG_PCIE_LINK_CAP_OFFSET                             0xcc
       96 +#define PCIE_LINK_CAP_MAX_SPEED_MASK                    0xFF
       97 +#define PCIE_LINK_CAP_MAX_SPEED_SHIFT                   0
       98 +#define PCIE_LINK_CAP_MAX_WIDTH_MASK                    0x3F
       99 +#define PCIE_LINK_CAP_MAX_WIDTH_SHIFT                   4
      100 +
  63  101  /* POST status reg struct */
  64  102  #define POST_STAGE_POWER_ON_RESET       0x00
  65  103  #define POST_STAGE_AWAITING_HOST_RDY    0x01
  66  104  #define POST_STAGE_HOST_RDY             0x02
  67  105  #define POST_STAGE_CHIP_RESET           0x03
  68  106  #define POST_STAGE_ARMFW_READY          0xc000
  69  107  #define POST_STAGE_ARMFW_UE             0xf000
  70  108  
  71  109  /* DOORBELL registers */
  72  110  #define PD_RXULP_DB                     0x0100
↓ open down ↓ 45 lines elided ↑ open up ↑
 118  156  #define MBX_RX_IFACE_FLAGS_RSS          0x4
 119  157  #define MBX_RX_IFACE_FLAGS_PROMISCUOUS  0x8
 120  158  #define MBX_RX_IFACE_FLAGS_BROADCAST    0x10
 121  159  #define MBX_RX_IFACE_FLAGS_UNTAGGED     0x20
 122  160  #define MBX_RX_IFACE_FLAGS_ULP          0x40
 123  161  #define MBX_RX_IFACE_FLAGS_VLAN_PROMISCUOUS     0x80
 124  162  #define MBX_RX_IFACE_FLAGS_VLAN                 0x100
 125  163  #define MBX_RX_IFACE_FLAGS_MCAST_PROMISCUOUS    0x200
 126  164  #define MBX_RX_IFACE_FLAGS_PASS_L2      0x400
 127  165  #define MBX_RX_IFACE_FLAGS_PASS_L3L4    0x800
      166 +#define MBX_RX_IFACE_FLAGS_MCAST        0x1000
 128  167  
 129  168  #define MQ_RING_CONTEXT_SIZE_16         0x5 /* (16 entries) */
 130  169  #define MQ_RING_CONTEXT_SIZE_32         0x6 /* (32 entries) */
 131  170  #define MQ_RING_CONTEXT_SIZE_64         0x7 /* (64 entries) */
 132  171  #define MQ_RING_CONTEXT_SIZE_128        0x8 /* (128 entries) */
 133  172  
 134  173  
 135  174  #define MBX_DB_READY_BIT                0x1
 136  175  #define MBX_DB_HI_BIT                   0x2
 137      -#define ASYNC_EVENT_CODE_LINK_STATE     0x1
 138      -#define ASYNC_EVENT_LINK_UP             0x1
 139      -#define ASYNC_EVENT_LINK_DOWN           0x0
      176 +/* Event bit map registered with mq */
      177 +enum {
      178 +        ASYNC_EVENT_CODE_LINK_STATE = 0x1,
      179 +        ASYNC_EVENT_CODE_FCOE_FIP = 0x2,
      180 +        ASYNC_EVENT_CODE_DCBX = 0x3,
      181 +        ASYNC_EVENT_CODE_ISCSI = 0x4,
      182 +        ASYNC_EVENT_CODE_GRP_5 = 0x5,
      183 +        ASYNC_EVENT_CODE_DEBUG = 0x6
      184 +};
 140  185  
 141      -/* port link_status */
 142      -#define ASYNC_EVENT_LOGICAL             0x02
      186 +/* Link events */
      187 +enum {
      188 +        ASYNC_EVENT_LINK_DOWN   = 0x0,
      189 +        ASYNC_EVENT_LINK_UP     = 0x1,
      190 +        ASYNC_EVENT_LOGICAL     = 0x02
      191 +};
 143  192  
      193 +/* GRP5 Events */
      194 +enum {
      195 +        ASYNC_EVENT_QOS_SPEED   =       0x1,
      196 +        ASYNC_EVENT_COS_PRIORITY =      0x2,
      197 +        ASYNC_EVENT_PVID_STATE   =      0x3
      198 +};
      199 +
      200 +/* Event Mask */
      201 +#define ASYNC_TRAILER_EVENT_CODE_SHIFT  8
      202 +#define ASYNC_TRAILER_EVENT_TYPE_SHIFT  16
      203 +#define ASYNC_TRAILER_EVENT_CODE_MASK   0xFF
      204 +#define ASYNC_TRAILER_EVENT_TYPE_MASK   0xFF
      205 +
 144  206  /* Logical Link Status */
 145  207  #define NTWK_LOGICAL_LINK_DOWN          0
 146  208  #define NTWK_LOGICAL_LINK_UP            1
 147  209  
 148  210  /* Rx filter bits */
 149  211  #define NTWK_RX_FILTER_IP_CKSUM         0x1
 150  212  #define NTWK_RX_FILTER_TCP_CKSUM        0x2
 151  213  #define NTWK_RX_FILTER_UDP_CKSUM        0x4
 152  214  #define NTWK_RX_FILTER_STRIP_CRC        0x8
 153  215  
      216 +/* driver_function_capabilities */
      217 +#define DRVFN_CAPAB_SW_TIMESTAMPS       0x2
      218 +#define DRVFN_CAPAB_BE3_NATIVE          0x4
      219 +
      220 +/* Function Capabilities */
      221 +#define BE_FUNCTION_CAPS_UNCLASSIFIED_STATS     0x1
      222 +#define BE_FUNCTION_CAPS_RSS                    0x2
      223 +#define BE_FUNCTION_CAPS_PROMISCUOUS            0x4
      224 +#define BE_FUNCTION_CAPS_LEGACY_MODE            0x8
      225 +
 154  226  /* max SGE per mbx */
 155  227  #define MAX_MBX_SGE                     19
 156  228  
      229 +/* max RSS rings */
      230 +#define MAX_RING_PER_GROUP_LEGACY       5
      231 +#define MAX_RING_PER_GROUP_NATIVE       16
      232 +
      233 +/* MCCQ LEN */
      234 +#define MCC_Q_LEN 128
      235 +#define MCC_CQ_LEN 256
      236 +
      237 +/* RSS PARAMETERS */
      238 +#define MAX_TBL_SIZE            64
      239 +#define MAX_HKEY_SIZE           40
      240 +
      241 +/* ULP */
      242 +#define BE_ULP1_NUM                     1
      243 +
 157  244  /* physical address structure to be used in MBX */
 158  245  struct phys_addr {
 159  246          /* dw0 */
 160  247          uint32_t lo;
 161  248          /* dw1 */
 162  249          uint32_t hi;
 163  250  };
 164  251  
 165  252  typedef union pcicfg_intr_ctl_u {
 166  253          uint32_t dw0;
↓ open down ↓ 188 lines elided ↑ open up ↑
 355  442  }pd_txulp_db_t;
 356  443  
 357  444  /* CQ doorbell */
 358  445  typedef union cq_db_u {
 359  446          uint32_t dw0;
 360  447          struct {
 361  448  #ifdef _BIG_ENDIAN
 362  449                  uint32_t rsvd1:2;
 363  450                  uint32_t rearm:1;
 364  451                  uint32_t num_popped:13;
 365      -                uint32_t rsvd0:5;
      452 +                uint32_t eq_cq_extid:5;
 366  453                  uint32_t event:1;
 367  454                  uint32_t qid:10;
 368  455  #else
 369  456                  uint32_t qid:10;
 370  457                  uint32_t event:1;
 371      -                uint32_t rsvd0:5;
      458 +                uint32_t eq_cq_extid:5;
 372  459                  uint32_t num_popped:13;
 373  460                  uint32_t rearm:1;
 374  461                  uint32_t rsvd1:2;
 375  462  #endif
 376  463          }bits;
 377  464  }cq_db_t;
 378  465  
 379  466  /* EQ doorbell */
 380  467  typedef union eq_db_u {
 381  468          uint32_t dw0;
 382  469          struct {
 383  470  #ifdef _BIG_ENDIAN
 384  471                  uint32_t rsvd1:2;
 385  472                  uint32_t rearm:1;
 386  473                  uint32_t num_popped:13;
 387      -                uint32_t rsvd0:5;
      474 +                uint32_t eq_cq_extid:5;
 388  475                  uint32_t event:1;
 389  476                  uint32_t clrint:1;
 390  477                  uint32_t qid:9;
 391  478  #else
 392  479                  uint32_t qid:9;
 393  480                  uint32_t clrint:1;
 394  481                  uint32_t event:1;
 395      -                uint32_t rsvd0:5;
      482 +                uint32_t eq_cq_extid:5;
 396  483                  uint32_t num_popped:13;
 397  484                  uint32_t rearm:1;
 398  485                  uint32_t rsvd1:2;
 399  486  #endif
 400  487          }bits;
 401  488  }eq_db_t;
 402  489  
 403  490  /* bootstrap mbox doorbell */
 404  491  typedef union pd_mpu_mbox_db_u {
 405  492          uint32_t dw0;
↓ open down ↓ 93 lines elided ↑ open up ↑
 499  586                  }s;
 500  587                  uint32_t dw0;
 501  588          }u0;
 502  589  
 503  590          uint32_t payload_length;
 504  591          uint32_t tag[2];
 505  592          uint32_t rsvd2[1];
 506  593          struct oce_mbx_payload payload;
 507  594  };
 508  595  
      596 +#define MQ_CQE_VALID_MASK       (1 << 31)
      597 +#define MQ_CQE_ASYNC_MASK       (1 << 30)
      598 +#define MQ_CQE_COMPLETED_MASK   (1 << 28)
      599 +#define MQ_CQE_CONSUMED_MASK    (1 << 27)
      600 +#define MQ_CQE_VALID(_cqe)      (_cqe->u0.dw[3])
      601 +#define MQ_CQE_INVALIDATE(_cqe) (_cqe->u0.dw[3] = 0)
      602 +
      603 +/* Macros for handling extra bytes in EQ-CQ IDs */
      604 +#define DB_CQ_RING_ID_EXT_MASK          0x7C00  /* bits 10-14 */
      605 +#define DB_CQ_RING_ID_EXT_MASK_SHIFT    (1)
      606 +                                                /*
      607 +                                                 * qid bits 10-14
      608 +                                                 * placing at 11-15
      609 +                                                 */
      610 +#define DB_EQ_RING_ID_EXT_MASK          0x3e00  /* bits 9-13 */
      611 +#define DB_EQ_RING_ID_EXT_MASK_SHIFT    (2) /* qid bits 9-13 placing at 11-15 */
      612 +
 509  613  /* completion queue entry for MQ */
 510  614  struct oce_mq_cqe {
 511  615          union {
 512  616                  struct {
 513  617  #ifdef _BIG_ENDIAN
 514  618                          /* dw0 */
 515  619                          uint32_t extended_status:16;
 516  620                          uint32_t completion_status:16;
 517  621                          /* dw1 dw2 */
 518  622                          uint32_t mq_tag[2];
 519  623                          /* dw3 */
 520  624                          uint32_t valid:1;
 521  625                          uint32_t async_event:1;
 522      -                        uint32_t hpi_buffer_cmpl:1;
      626 +                        uint32_t rsvd:1;
 523  627                          uint32_t completed:1;
 524  628                          uint32_t consumed:1;
 525  629                          uint32_t rsvd0:27;
 526  630  #else
 527  631                          /* dw0 */
 528  632                          uint32_t completion_status:16;
 529  633                          uint32_t extended_status:16;
 530  634                          /* dw1 dw2 */
 531  635                          uint32_t mq_tag[2];
 532  636                          /* dw3 */
 533  637                          uint32_t rsvd0:27;
 534  638                          uint32_t consumed:1;
 535  639                          uint32_t completed:1;
 536      -                        uint32_t hpi_buffer_cmpl:1;
      640 +                        uint32_t rsvd:1;
 537  641                          uint32_t async_event:1;
 538  642                          uint32_t valid:1;
 539  643  #endif
 540  644                  }s;
 541  645                  uint32_t dw[4];
 542  646          }u0;
 543  647  };
 544  648  
 545      -struct oce_async_cqe_link_state {
      649 +struct oce_async_event_trailer {
 546  650          union {
 547  651                  struct {
 548  652  #ifdef _BIG_ENDIAN
 549      -                        /* dw0 */
 550      -                        uint8_t speed;
 551      -                        uint8_t duplex;
 552      -                        uint8_t link_status;
 553      -                        uint8_t phy_port;
 554      -                        /* dw1 */
 555      -                        uint8_t rsvd0[3];
 556      -                        uint8_t fault;
 557      -                        /* dw2 */
 558      -                        uint32_t event_tag;
 559      -                        /* dw3 */
 560  653                          uint32_t valid:1;
 561  654                          uint32_t async_event:1;
 562  655                          uint32_t rsvd2:6;
 563  656                          uint32_t event_type:8;
 564  657                          uint32_t event_code:8;
 565  658                          uint32_t rsvd1:8;
 566  659  #else
 567      -                        /* dw0 */
 568      -                        uint8_t phy_port;
 569      -                        uint8_t link_status;
 570      -                        uint8_t duplex;
 571      -                        uint8_t speed;
 572      -                        /* dw1 */
 573      -                        uint8_t fault;
 574      -                        uint8_t rsvd0[3];
 575      -                        /* dw2 */
 576      -                        uint32_t event_tag;
 577      -                        /* dw3 */
 578  660                          uint32_t rsvd1:8;
 579  661                          uint32_t event_code:8;
 580  662                          uint32_t event_type:8;
 581  663                          uint32_t rsvd2:6;
 582  664                          uint32_t async_event:1;
 583  665                          uint32_t valid:1;
 584  666  #endif
 585      -                }s;
 586      -                uint32_t dw[4];
 587      -        }u0;
      667 +                } bits;
      668 +                uint32_t code;
      669 +        } u0;
 588  670  };
 589  671  
      672 +
      673 +/* Async Debug Event Types */
      674 +#define ASYNC_DEBUG_EVENT_TYPE_QNQ      1
      675 +
      676 +struct async_event_qnq {
      677 +        uint8_t enabled;
      678 +        uint8_t rsvd0;
      679 +        uint16_t vlan_tag;
      680 +        uint32_t event_tag;
      681 +        uint32_t rsvd1[1];
      682 +        struct oce_async_event_trailer trailer;
      683 +};
      684 +
      685 +
      686 +struct oce_async_cqe_link_state {
      687 +        uint8_t phy_port;
      688 +        uint8_t link_status;
      689 +        uint8_t duplex;
      690 +        uint8_t speed;
      691 +        uint8_t fault;
      692 +        uint8_t reason;
      693 +        uint16_t qos_link_speed;
      694 +        uint32_t event_tag;
      695 +        struct oce_async_event_trailer trailer;
      696 +};
      697 +
      698 +struct oce_async_event_grp5_qos_link_speed {
      699 +        uint8_t physical_port;
      700 +        uint8_t rsvd[5];
      701 +        uint16_t qos_link_speed;
      702 +        uint32_t event_tag;
      703 +        struct oce_async_event_trailer trailer;
      704 +};
      705 +
      706 +
      707 +struct oce_async_event_grp5_cos_priority {
      708 +        uint8_t physical_port;
      709 +        uint8_t available_priority_bmap;
      710 +        uint8_t reco_default_priority;
      711 +        uint8_t valid;
      712 +        uint8_t rsvd0;
      713 +        uint32_t event_tag;
      714 +        struct oce_async_event_trailer trailer;
      715 +};
      716 +
      717 +struct oce_async_event_grp5_pvid_state {
      718 +        uint8_t enabled;
      719 +        uint8_t rsvd0;
      720 +        uint16_t tag;
      721 +        uint32_t event_tag;
      722 +        uint32_t rsvd1;
      723 +        struct oce_async_event_trailer trailer;
      724 +};
      725 +
      726 +struct oce_event_grp_5_priority_class_queue_map {
      727 +        uint8_t priority0_classq;
      728 +        uint8_t priority1_classq;
      729 +        uint8_t priority2_classq;
      730 +        uint8_t priority3_classq;
      731 +        uint8_t priority4_classq;
      732 +        uint8_t priority5_classq;
      733 +        uint8_t priority6_classq;
      734 +        uint8_t priority7_classq;
      735 +        uint32_t        event_tag;
      736 +        struct oce_async_event_trailer trailer;
      737 +};
      738 +
      739 +
 590  740  /* MQ mailbox structure */
 591  741  struct oce_bmbx {
 592  742          struct oce_mbx mbx;
 593  743          struct oce_mq_cqe cqe;
 594  744  };
 595  745  
 596  746  /* ---[ MBXs start here ]---------------------------------------------- */
 597  747  /* MBXs sub system codes */
 598  748  enum {
 599  749          MBX_SUBSYSTEM_RSVD = 0,
↓ open down ↓ 12 lines elided ↑ open up ↑
 612  762          IOCBMBX_SUBSYSTEM_DCBX = 15,
 613  763          IOCBMBX_SUBSYSTEM_DIAG = 16,
 614  764          IOCBMBX_SUBSYSTEM_VENDOR = 17
 615  765  };
 616  766  
 617  767  /* common ioctl opcodes */
 618  768  enum {
 619  769          OPCODE_QUERY_COMMON_IFACE_MAC = 1,
 620  770          OPCODE_SET_COMMON_IFACE_MAC = 2,
 621  771          OPCODE_SET_COMMON_IFACE_MULTICAST = 3,
 622      -        OPCODE_CONFIG_COMMON_IFACE_VLAN = 4,
      772 +        OPCODE_COMMON_NTWK_VLAN_CONFIG  = 4,
 623  773          OPCODE_QUERY_COMMON_LINK_STATUS = 5,
 624  774          OPCODE_READ_COMMON_FLASHROM = 6,
 625  775          OPCODE_WRITE_COMMON_FLASHROM = 7,
 626  776          OPCODE_QUERY_COMMON_MAX_MBX_BUFFER_SIZE = 8,
 627  777          OPCODE_ADD_COMMON_PAGE_TABLES = 9,
 628  778          OPCODE_REMOVE_COMMON_PAGE_TABLES = 10,
 629  779          OPCODE_CREATE_COMMON_CQ = 12,
 630  780          OPCODE_CREATE_COMMON_EQ = 13,
 631  781          OPCODE_CREATE_COMMON_MQ = 21,
 632  782          OPCODE_COMMON_JELL_CONFIG = 22,
↓ open down ↓ 26 lines elided ↑ open up ↑
 659  809          OPCODE_COMMON_CEV_MODIFY_MSI_MESSAGES = 52,
 660  810          OPCODE_DESTROY_COMMON_MQ = 53,
 661  811          OPCODE_DESTROY_COMMON_CQ = 54,
 662  812          OPCODE_DESTROY_COMMON_EQ = 55,
 663  813          OPCODE_COMMON_TCP_UPL_OAD = 56,
 664  814          OPCODE_SET_COMMON_LINK_SPEED = 57,
 665  815          OPCODE_QUERY_COMMON_FIRMWARE_CONFIG = 58,
 666  816          OPCODE_ADD_COMMON_IFACE_MAC = 59,
 667  817          OPCODE_DEL_COMMON_IFACE_MAC = 60,
 668  818          OPCODE_COMMON_FUNCTION_RESET = 61,
 669      -        OPCODE_COMMON_FUNCTION_LINK_CONFIG = 80
      819 +        OPCODE_COMMON_FUNCTION_LINK_CONFIG = 80,
      820 +        OPCODE_CREATE_COMMON_MQ_EXT = 90,
      821 +        OPCODE_COMMON_SET_DRIVER_FUNCTION_CAPABILITIES = 103
 670  822  };
 671  823  
      824 +/* Management status error code in Response header */
      825 +enum {
      826 +        MGMT_STATUS_SUCCESS     = 0, /* The IOCTL completed without errors. */
      827 +        MGMT_STATUS_FAILED      = 1,    /*      Generic error status */
      828 +        MGMT_STATUS_ILLEGAL_REQUEST     = 2, /* Invalid IOCTL opcode. */
      829 +        MGMT_STATUS_ILLEGAL_FIELD       = 3, /* Invalid param in IOCTL pyld */
      830 +        MGMT_STATUS_INSUFFICIENT_BUFFER = 4, /* Insufficient buf for response */
      831 +        MGMT_STATUS_UNAUTHORIZED_REQUEST = 5 /* Domain invalid access rights */
      832 +};
      833 +
      834 +/* Additional status error codes */
      835 +enum {
      836 +        MGMT_ADDI_STATUS_NO_STATUS = 0, /* IOCTL completed successfully */
      837 +    MGMT_ADDI_STATUS_INVALID_SUBSYSTEM = 29, /* Invalid subsystem id */
      838 +    MGMT_ADDI_STATUS_INVALID_OPCODE = 30, /* Opcode Invalid */
      839 +    MGMT_ADDI_STATUS_INVALID_DOMAIN = 35, /* Invalid domain id */
      840 +    MGMT_ADDI_STATUS_INVALID_EXTENDED_TIMEOUT = 64 /* Invalid timeout */
      841 +};
      842 +
 672  843  /* common ioctl header */
 673  844  struct mbx_hdr {
 674  845          union {
 675  846                  struct {
 676  847  #ifdef _BIG_ENDIAN
 677  848                          uint8_t domain;
 678  849                          uint8_t port_number;
 679  850                          uint8_t subsystem;
 680  851                          uint8_t opcode;
      852 +                        uint32_t timeout;
      853 +                        uint32_t request_length;
      854 +                        uint8_t rsvd0[3];
      855 +                        uint8_t version;
 681  856  #else
 682  857                          uint8_t opcode;
 683  858                          uint8_t subsystem;
 684  859                          uint8_t port_number;
 685  860                          uint8_t domain;
 686      -#endif
 687  861                          uint32_t timeout;
 688  862                          uint32_t request_length;
 689      -                        uint32_t rsvd0;
      863 +                        uint8_t  version;
      864 +                        uint8_t  rsvd0[3];
      865 +#endif
 690  866                  }req;
 691  867  
 692  868                  struct {
 693  869                          /* dw 0 */
 694  870                          uint8_t opcode;
 695  871                          uint8_t subsystem;
 696  872                          uint8_t rsvd0;
 697  873                          uint8_t domain;
 698  874                          /* dw 1 */
 699  875                          uint8_t status;
↓ open down ↓ 1 lines elided ↑ open up ↑
 701  877                          uint16_t rsvd1;
 702  878  
 703  879                          uint32_t rsp_length;
 704  880                          uint32_t actual_rsp_length;
 705  881                  }rsp;
 706  882                  uint32_t dw[4];
 707  883          }u0;
 708  884  };
 709  885  #define OCE_BMBX_RHDR_SZ 20
 710  886  #define OCE_MBX_RRHDR_SZ sizeof (struct mbx_hdr)
 711      -#define OCE_MBX_ADDL_STATUS(_MHDR) ((_MHDR)->u0.rsp.additional_status)
 712      -#define OCE_MBX_STATUS(_MHDR) ((_MHDR)->u0.rsp.status)
      887 +#define OCE_MBX_ADDL_STATUS(_MHDR) \
      888 +                (((struct mbx_hdr *)_MHDR)->u0.rsp.additional_status)
      889 +#define OCE_MBX_STATUS(_MHDR) (((struct mbx_hdr *)_MHDR)->u0.rsp.status)
 713  890  
 714  891  /* [05] OPCODE_QUERY_COMMON_LINK_STATUS */
 715  892  struct mbx_query_common_link_status {
 716  893          struct mbx_hdr hdr;
 717  894          union {
 718  895                  struct {
 719  896                          uint32_t rsvd0;
 720  897                  }req;
 721  898  
 722  899                  struct {
↓ open down ↓ 169 lines elided ↑ open up ↑
 892 1069                  }req;
 893 1070  
 894 1071                  struct {
 895 1072                          uint32_t rsvd0;
 896 1073                  }rsp;
 897 1074  
 898 1075                  uint32_t dw;
 899 1076          }params;
 900 1077  };
 901 1078  
     1079 +struct mbx_set_common_iface_rx_filter {
     1080 +        struct mbx_hdr hdr;
     1081 +        union {
     1082 +                struct {
     1083 +                        uint32_t gflags_mask;
     1084 +                        uint32_t gflags;
     1085 +                        uint32_t if_flags_mask;
     1086 +                        uint32_t if_flags;
     1087 +                        uint32_t if_id;
     1088 +                        uint32_t multicast_num;
     1089 +                        struct ether_addr mac[32];
     1090 +                }req;
     1091 +                struct {
     1092 +                        uint32_t gflags_mask;
     1093 +                        uint32_t gflags;
     1094 +                        uint32_t if_flags_mask;
     1095 +                        uint32_t if_flags;
     1096 +                        uint32_t if_id;
     1097 +                        uint32_t multicast_num;
     1098 +                        struct ether_addr mac[32];
     1099 +                }rsp;
     1100 +        }params;
     1101 +};
     1102 +
 902 1103  /* event queue context structure */
 903 1104  struct   oce_eq_ctx {
 904 1105  #ifdef _BIG_ENDIAN
 905 1106          /* dw0 */
 906 1107          uint32_t size:1;
 907 1108          uint32_t rsvd1:1;
 908 1109          uint32_t valid:1;
 909 1110          uint32_t epidx:13;
 910 1111          uint32_t rsvd0:3;
 911 1112          uint32_t cidx:13;
↓ open down ↓ 46 lines elided ↑ open up ↑
 958 1159          uint32_t phase:2;
 959 1160          uint32_t nodelay:1;
 960 1161          uint32_t rsvd6:4;
 961 1162  
 962 1163          /* dw3 */
 963 1164          uint32_t rsvd7;
 964 1165  #endif
 965 1166  };
 966 1167  
 967 1168  /* [13] OPCODE_CREATE_COMMON_EQ */
 968      -        struct mbx_create_common_eq {
     1169 +struct mbx_create_common_eq {
 969 1170          struct mbx_hdr hdr;
 970 1171          union {
 971 1172                  struct {
 972 1173  #ifdef _BIG_ENDIAN
 973 1174                          uint16_t rsvd0;
 974 1175                          uint16_t num_pages;
 975 1176  #else
 976 1177                          uint16_t num_pages;
 977 1178                          uint16_t rsvd0;
 978 1179  #endif
↓ open down ↓ 21 lines elided ↑ open up ↑
1000 1201                          uint16_t rsvd0;
1001 1202  #endif
1002 1203                  }req;
1003 1204  
1004 1205                  struct {
1005 1206                          uint32_t rsvd0;
1006 1207                  }rsp;
1007 1208          }params;
1008 1209  };
1009 1210  
1010      -struct oce_cq_ctx {
     1211 +struct oce_cq_ctx_v0 {
1011 1212  #ifdef _BIG_ENDIAN
1012 1213          /* dw0 */
1013 1214          uint32_t eventable:1;
1014 1215          uint32_t sol_event:1;
1015 1216          uint32_t valid:1;
1016 1217          uint32_t count:2;
1017 1218          uint32_t rsvd1:1;
1018 1219          uint32_t epidx:11;
1019 1220          uint32_t nodelay:1;
1020 1221          uint32_t coalesce_wm:2;
↓ open down ↓ 34 lines elided ↑ open up ↑
1055 1256          uint32_t armed:1;
1056 1257  
1057 1258          /* dw2 */
1058 1259          uint32_t rsvd3:4;
1059 1260          uint32_t function:8;
1060 1261          uint32_t rsvd4:20;
1061 1262  #endif
1062 1263          uint32_t rsvd5;
1063 1264  };
1064 1265  
1065      -/* [12] OPCODE_CREATE_COMMON_CQ */
1066      -struct mbx_create_common_cq {
     1266 +/* [12] OPCODE_CREATE_COMMON_CQ V0 */
     1267 +struct mbx_create_common_cq_v0 {
1067 1268          struct mbx_hdr hdr;
1068 1269          union {
1069 1270                  struct {
1070 1271  #ifdef _BIG_ENDIAN
1071 1272                          uint16_t rsvd0;
1072 1273                          uint16_t num_pages;
1073 1274  #else
1074 1275                          uint16_t num_pages;
1075 1276                          uint16_t rsvd0;
1076 1277  #endif
1077      -                        struct oce_cq_ctx cq_ctx;
     1278 +                        struct oce_cq_ctx_v0 cq_ctx;
1078 1279                          struct phys_addr pages[4];
1079 1280                  }req;
1080 1281  
1081 1282                  struct {
1082 1283                          uint16_t cq_id;
1083 1284                          uint16_t rsvd0;
1084 1285                  }rsp;
1085 1286          }params;
1086 1287  };
1087 1288  
     1289 +struct oce_cq_ctx_v2 {
     1290 +#ifdef _BIG_ENDIAN
     1291 +        /* dw0 */
     1292 +        uint32_t eventable:1;
     1293 +        uint32_t rsvd2:1;
     1294 +        uint32_t valid:1;
     1295 +        uint32_t count:2;
     1296 +        uint32_t rsvd1:11;
     1297 +        uint32_t auto_valid:1;
     1298 +        uint32_t nodelay:1;
     1299 +        uint32_t coalesce_wm:2;
     1300 +        uint32_t rsvd0:12;
     1301 +
     1302 +        /* dw1 */
     1303 +        uint32_t armed:1;
     1304 +        uint32_t rsvd3:15;
     1305 +        uint32_t eq_id:16;
     1306 +
     1307 +        /* dw2 */
     1308 +        uint32_t rsvd4:16;
     1309 +        uint32_t cqe_count:16;
     1310 +#else
     1311 +        /* dw0 */
     1312 +        uint32_t rsvd0:12;
     1313 +        uint32_t coalesce_wm:2;
     1314 +        uint32_t nodelay:1;
     1315 +        uint32_t auto_valid:1;
     1316 +        uint32_t rsvd1:11;
     1317 +        uint32_t count:2;
     1318 +        uint32_t valid:1;
     1319 +        uint32_t rsvd2:1;
     1320 +        uint32_t eventable:1;
     1321 +
     1322 +        /* dw1 */
     1323 +        uint32_t eq_id:16;
     1324 +        uint32_t rsvd3:15;
     1325 +        uint32_t armed:1;
     1326 +
     1327 +        /* dw2 */
     1328 +        uint32_t cqe_count:16;
     1329 +        uint32_t rsvd4:16;
     1330 +#endif
     1331 +        uint32_t rsvd5;
     1332 +};
     1333 +
     1334 +/* [12] OPCODE_CREATE_COMMON_CQ V2 */
     1335 +struct mbx_create_common_cq_v2 {
     1336 +        struct mbx_hdr hdr;
     1337 +        union {
     1338 +                struct {
     1339 +#ifdef _BIG_ENDIAN
     1340 +                        uint8_t rsvd0;
     1341 +                        uint8_t page_size;
     1342 +                        uint16_t num_pages;
     1343 +#else
     1344 +                        uint16_t num_pages;
     1345 +                        uint8_t page_size;
     1346 +                        uint8_t rsvd0;
     1347 +#endif
     1348 +                        struct oce_cq_ctx_v2 cq_ctx;
     1349 +                        struct phys_addr pages[8];
     1350 +                }req;
     1351 +
     1352 +                struct {
     1353 +                        uint16_t cq_id;
     1354 +                        uint16_t rsvd0;
     1355 +                }rsp;
     1356 +        }params;
     1357 +};
     1358 +
1088 1359  /* [54] OPCODE_DESTROY_COMMON_CQ */
1089 1360  struct mbx_destroy_common_cq {
1090 1361          struct mbx_hdr hdr;
1091 1362          union {
1092 1363                  struct {
1093 1364  #ifdef _BIG_ENDIAN
1094 1365                          uint16_t rsvd0;
1095 1366                          uint16_t id;
1096 1367  #else
1097 1368                          uint16_t id;
1098 1369                          uint16_t rsvd0;
1099 1370  #endif
1100 1371                  }req;
1101 1372  
1102 1373                  struct {
1103 1374                          uint32_t rsvd0;
1104 1375                  }rsp;
1105 1376          }params;
1106 1377  };
1107 1378  
1108      -struct mq_ring_ctx {
     1379 +struct mq_ring_ctx_v0 {
1109 1380          union {
1110 1381                  struct {
1111 1382  #ifdef _BIG_ENDIAN
1112 1383                          /* dw 0 */
1113 1384                          uint32_t cq_id:10;
1114 1385                          uint32_t fetch_r2t:1;
1115 1386                          uint32_t fetch_wrb:1;
1116 1387                          uint32_t ring_size:4;
1117 1388                          uint32_t rsvd0:2;
1118 1389                          uint32_t con_index:14;
↓ open down ↓ 28 lines elided ↑ open up ↑
1147 1418                          uint32_t async_cq_id:10;
1148 1419                          uint32_t rsvd1:21;
1149 1420  #endif
1150 1421                          /* dw3 */
1151 1422                          uint32_t rsvd3;
1152 1423                  }s;
1153 1424                  uint32_t dw[4];
1154 1425          }u0;
1155 1426  };
1156 1427  
1157      -/* [21] OPCODE_CREATE_COMMON_MQ */
     1428 +/* [21] OPCODE_CREATE_COMMON_MQ V0 */
1158 1429  struct mbx_create_common_mq {
1159 1430          struct mbx_hdr hdr;
1160 1431          union {
1161 1432                  struct {
1162 1433  #ifdef _BIG_ENDIAN
1163 1434                          uint16_t rsvd0;
1164 1435                          uint16_t num_pages;
1165 1436  #else
1166 1437                          uint16_t num_pages;
1167 1438                          uint16_t rsvd0;
1168 1439  #endif
1169      -                        struct mq_ring_ctx context;
     1440 +                        struct mq_ring_ctx_v0 context;
1170 1441                          struct phys_addr pages[8];
1171 1442                  }req;
1172 1443  
1173 1444                  struct {
1174 1445                          uint32_t mq_id:16;
1175 1446                          uint32_t rsvd0:16;
1176 1447                  }rsp;
1177 1448          }params;
1178 1449  };
1179 1450  
     1451 +/* [90] OPCODE_COMMON_MCC_CREATE_EXT V0 */
     1452 +struct mbx_create_common_mq_ext_v0 {
     1453 +        struct mbx_hdr hdr;
     1454 +        union {
     1455 +                struct {
     1456 +#ifdef _BIG_ENDIAN
     1457 +                        uint16_t rsvd0;
     1458 +                        uint16_t num_pages;
     1459 +#else
     1460 +                        uint16_t num_pages;
     1461 +                        uint16_t rsvd0;
     1462 +#endif
     1463 +                        uint32_t async_event_bitmap[1];
     1464 +                        struct mq_ring_ctx_v0 context;
     1465 +                        struct phys_addr pages[8];
     1466 +                }req;
     1467 +
     1468 +                struct {
     1469 +                        uint32_t mq_id:16;
     1470 +                        uint32_t rsvd0:16;
     1471 +                }rsp;
     1472 +        }params;
     1473 +};
     1474 +
     1475 +struct mq_ring_ctx_v1 {
     1476 +        union {
     1477 +                struct {
     1478 +#ifdef _BIG_ENDIAN
     1479 +                        /* dw 0 */
     1480 +                        uint32_t rsrvd0:12;
     1481 +                        uint32_t ring_size:4;
     1482 +                        uint32_t async_cq_id:16;
     1483 +
     1484 +                        /* dw1 */
     1485 +                        uint32_t valid:1;
     1486 +                        uint32_t rsrvd1:31;
     1487 +
     1488 +                        /* dw 2 */
     1489 +                        uint32_t rsvd2:31;
     1490 +                        uint32_t async_cq_valid:1;
     1491 +#else
     1492 +                        /* dw 0 */
     1493 +                        uint32_t async_cq_id:16;
     1494 +                        uint32_t ring_size:4;
     1495 +                        uint32_t rsrvd0:12;
     1496 +
     1497 +                        /* dw1 */
     1498 +                        uint32_t rsrvd1:31;
     1499 +                        uint32_t valid:1;
     1500 +
     1501 +                        /* dw 2 */
     1502 +                        uint32_t async_cq_valid:1;
     1503 +                        uint32_t rsvd2:31;
     1504 +#endif
     1505 +                        /* dw3 */
     1506 +                        uint32_t rsvd3;
     1507 +                }s;
     1508 +                uint32_t dw[4];
     1509 +        }u0;
     1510 +};
     1511 +
     1512 +/* [90] OPCODE_COMMON_MCC_CREATE_EXT V1 */
     1513 +struct mbx_create_common_mq_ext_v1 {
     1514 +        struct mbx_hdr hdr;
     1515 +        union {
     1516 +                struct {
     1517 +#ifdef _BIG_ENDIAN
     1518 +                        uint16_t cq_id;
     1519 +                        uint16_t num_pages;
     1520 +#else
     1521 +                        uint16_t num_pages;
     1522 +                        uint16_t cq_id;
     1523 +#endif
     1524 +                        uint32_t async_event_bitmap[1];
     1525 +                        struct mq_ring_ctx_v1 context;
     1526 +                        struct phys_addr pages[8];
     1527 +                }req;
     1528 +
     1529 +                struct {
     1530 +                        uint32_t mq_id:16;
     1531 +                        uint32_t rsvd0:16;
     1532 +                }rsp;
     1533 +        }params;
     1534 +};
     1535 +
1180 1536  /* [53] OPCODE_DESTROY_COMMON_MQ */
1181 1537  struct mbx_destroy_common_mq {
1182 1538          struct mbx_hdr hdr;
1183 1539          union {
1184 1540                  struct {
1185 1541  #ifdef _BIG_ENDIAN
1186 1542                          uint16_t rsvd0;
1187 1543                          uint16_t id;
1188 1544  #else
1189 1545                          uint16_t id;
↓ open down ↓ 234 lines elided ↑ open up ↑
1424 1780          struct mbx_hdr hdr;
1425 1781          union {
1426 1782                  struct {
1427 1783                          uint32_t enable;
1428 1784                  }req;
1429 1785                  struct {
1430 1786                          uint32_t rsvd0;
1431 1787                  }rsp;
1432 1788          } params;
1433 1789  };
     1790 +
     1791 +/* [103] OPCODE_COMMON_SET_DRIVER_FUNCTION_CAPABILITIES */
     1792 +struct mbx_common_set_drvfn_capab {
     1793 +        struct mbx_hdr hdr;
     1794 +        union {
     1795 +                struct {
     1796 +                        uint32_t valid_capability_flags;
     1797 +                        uint32_t capability_flags;
     1798 +                        uint8_t sbz[212];
     1799 +                } request;
     1800 +                struct {
     1801 +                        uint32_t valid_capability_flags;
     1802 +                        uint32_t capability_flags;
     1803 +                        uint8_t sbz[212];
     1804 +                } response;
     1805 +        } params;
     1806 +};
1434 1807  
1435 1808  #pragma pack()
1436 1809  
1437 1810  #ifdef __cplusplus
1438 1811  }
1439 1812  #endif
1440 1813  
1441 1814  #endif /* _OCE_HW_H_ */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX