linux/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
<<
>>
Prefs
   1/*
   2 * This file is part of the Chelsio T4 Ethernet driver for Linux.
   3 *
   4 * Copyright (c) 2009-2016 Chelsio Communications, Inc. All rights reserved.
   5 *
   6 * This software is available to you under a choice of one of two
   7 * licenses.  You may choose to be licensed under the terms of the GNU
   8 * General Public License (GPL) Version 2, available from the file
   9 * COPYING in the main directory of this source tree, or the
  10 * OpenIB.org BSD license below:
  11 *
  12 *     Redistribution and use in source and binary forms, with or
  13 *     without modification, are permitted provided that the following
  14 *     conditions are met:
  15 *
  16 *      - Redistributions of source code must retain the above
  17 *        copyright notice, this list of conditions and the following
  18 *        disclaimer.
  19 *
  20 *      - Redistributions in binary form must reproduce the above
  21 *        copyright notice, this list of conditions and the following
  22 *        disclaimer in the documentation and/or other materials
  23 *        provided with the distribution.
  24 *
  25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  32 * SOFTWARE.
  33 */
  34
  35#ifndef _T4FW_INTERFACE_H_
  36#define _T4FW_INTERFACE_H_
  37
  38enum fw_retval {
  39        FW_SUCCESS              = 0,    /* completed sucessfully */
  40        FW_EPERM                = 1,    /* operation not permitted */
  41        FW_ENOENT               = 2,    /* no such file or directory */
  42        FW_EIO                  = 5,    /* input/output error; hw bad */
  43        FW_ENOEXEC              = 8,    /* exec format error; inv microcode */
  44        FW_EAGAIN               = 11,   /* try again */
  45        FW_ENOMEM               = 12,   /* out of memory */
  46        FW_EFAULT               = 14,   /* bad address; fw bad */
  47        FW_EBUSY                = 16,   /* resource busy */
  48        FW_EEXIST               = 17,   /* file exists */
  49        FW_ENODEV               = 19,   /* no such device */
  50        FW_EINVAL               = 22,   /* invalid argument */
  51        FW_ENOSPC               = 28,   /* no space left on device */
  52        FW_ENOSYS               = 38,   /* functionality not implemented */
  53        FW_ENODATA              = 61,   /* no data available */
  54        FW_EPROTO               = 71,   /* protocol error */
  55        FW_EADDRINUSE           = 98,   /* address already in use */
  56        FW_EADDRNOTAVAIL        = 99,   /* cannot assigned requested address */
  57        FW_ENETDOWN             = 100,  /* network is down */
  58        FW_ENETUNREACH          = 101,  /* network is unreachable */
  59        FW_ENOBUFS              = 105,  /* no buffer space available */
  60        FW_ETIMEDOUT            = 110,  /* timeout */
  61        FW_EINPROGRESS          = 115,  /* fw internal */
  62        FW_SCSI_ABORT_REQUESTED = 128,  /* */
  63        FW_SCSI_ABORT_TIMEDOUT  = 129,  /* */
  64        FW_SCSI_ABORTED         = 130,  /* */
  65        FW_SCSI_CLOSE_REQUESTED = 131,  /* */
  66        FW_ERR_LINK_DOWN        = 132,  /* */
  67        FW_RDEV_NOT_READY       = 133,  /* */
  68        FW_ERR_RDEV_LOST        = 134,  /* */
  69        FW_ERR_RDEV_LOGO        = 135,  /* */
  70        FW_FCOE_NO_XCHG         = 136,  /* */
  71        FW_SCSI_RSP_ERR         = 137,  /* */
  72        FW_ERR_RDEV_IMPL_LOGO   = 138,  /* */
  73        FW_SCSI_UNDER_FLOW_ERR  = 139,  /* */
  74        FW_SCSI_OVER_FLOW_ERR   = 140,  /* */
  75        FW_SCSI_DDP_ERR         = 141,  /* DDP error*/
  76        FW_SCSI_TASK_ERR        = 142,  /* No SCSI tasks available */
  77};
  78
  79#define FW_T4VF_SGE_BASE_ADDR      0x0000
  80#define FW_T4VF_MPS_BASE_ADDR      0x0100
  81#define FW_T4VF_PL_BASE_ADDR       0x0200
  82#define FW_T4VF_MBDATA_BASE_ADDR   0x0240
  83#define FW_T4VF_CIM_BASE_ADDR      0x0300
  84
  85enum fw_wr_opcodes {
  86        FW_FILTER_WR                   = 0x02,
  87        FW_ULPTX_WR                    = 0x04,
  88        FW_TP_WR                       = 0x05,
  89        FW_ETH_TX_PKT_WR               = 0x08,
  90        FW_OFLD_CONNECTION_WR          = 0x2f,
  91        FW_FLOWC_WR                    = 0x0a,
  92        FW_OFLD_TX_DATA_WR             = 0x0b,
  93        FW_CMD_WR                      = 0x10,
  94        FW_ETH_TX_PKT_VM_WR            = 0x11,
  95        FW_RI_RES_WR                   = 0x0c,
  96        FW_RI_INIT_WR                  = 0x0d,
  97        FW_RI_RDMA_WRITE_WR            = 0x14,
  98        FW_RI_SEND_WR                  = 0x15,
  99        FW_RI_RDMA_READ_WR             = 0x16,
 100        FW_RI_RECV_WR                  = 0x17,
 101        FW_RI_BIND_MW_WR               = 0x18,
 102        FW_RI_FR_NSMR_WR               = 0x19,
 103        FW_RI_FR_NSMR_TPTE_WR          = 0x20,
 104        FW_RI_INV_LSTAG_WR             = 0x1a,
 105        FW_ISCSI_TX_DATA_WR            = 0x45,
 106        FW_PTP_TX_PKT_WR               = 0x46,
 107        FW_CRYPTO_LOOKASIDE_WR         = 0X6d,
 108        FW_LASTC2E_WR                  = 0x70
 109};
 110
 111struct fw_wr_hdr {
 112        __be32 hi;
 113        __be32 lo;
 114};
 115
 116/* work request opcode (hi) */
 117#define FW_WR_OP_S      24
 118#define FW_WR_OP_M      0xff
 119#define FW_WR_OP_V(x)   ((x) << FW_WR_OP_S)
 120#define FW_WR_OP_G(x)   (((x) >> FW_WR_OP_S) & FW_WR_OP_M)
 121
 122/* atomic flag (hi) - firmware encapsulates CPLs in CPL_BARRIER */
 123#define FW_WR_ATOMIC_S          23
 124#define FW_WR_ATOMIC_V(x)       ((x) << FW_WR_ATOMIC_S)
 125
 126/* flush flag (hi) - firmware flushes flushable work request buffered
 127 * in the flow context.
 128 */
 129#define FW_WR_FLUSH_S     22
 130#define FW_WR_FLUSH_V(x)  ((x) << FW_WR_FLUSH_S)
 131
 132/* completion flag (hi) - firmware generates a cpl_fw6_ack */
 133#define FW_WR_COMPL_S     21
 134#define FW_WR_COMPL_V(x)  ((x) << FW_WR_COMPL_S)
 135#define FW_WR_COMPL_F     FW_WR_COMPL_V(1U)
 136
 137/* work request immediate data length (hi) */
 138#define FW_WR_IMMDLEN_S 0
 139#define FW_WR_IMMDLEN_M 0xff
 140#define FW_WR_IMMDLEN_V(x)      ((x) << FW_WR_IMMDLEN_S)
 141
 142/* egress queue status update to associated ingress queue entry (lo) */
 143#define FW_WR_EQUIQ_S           31
 144#define FW_WR_EQUIQ_V(x)        ((x) << FW_WR_EQUIQ_S)
 145#define FW_WR_EQUIQ_F           FW_WR_EQUIQ_V(1U)
 146
 147/* egress queue status update to egress queue status entry (lo) */
 148#define FW_WR_EQUEQ_S           30
 149#define FW_WR_EQUEQ_V(x)        ((x) << FW_WR_EQUEQ_S)
 150#define FW_WR_EQUEQ_F           FW_WR_EQUEQ_V(1U)
 151
 152/* flow context identifier (lo) */
 153#define FW_WR_FLOWID_S          8
 154#define FW_WR_FLOWID_V(x)       ((x) << FW_WR_FLOWID_S)
 155
 156/* length in units of 16-bytes (lo) */
 157#define FW_WR_LEN16_S           0
 158#define FW_WR_LEN16_V(x)        ((x) << FW_WR_LEN16_S)
 159
 160#define HW_TPL_FR_MT_PR_IV_P_FC         0X32B
 161#define HW_TPL_FR_MT_PR_OV_P_FC         0X327
 162
 163/* filter wr reply code in cookie in CPL_SET_TCB_RPL */
 164enum fw_filter_wr_cookie {
 165        FW_FILTER_WR_SUCCESS,
 166        FW_FILTER_WR_FLT_ADDED,
 167        FW_FILTER_WR_FLT_DELETED,
 168        FW_FILTER_WR_SMT_TBL_FULL,
 169        FW_FILTER_WR_EINVAL,
 170};
 171
 172struct fw_filter_wr {
 173        __be32 op_pkd;
 174        __be32 len16_pkd;
 175        __be64 r3;
 176        __be32 tid_to_iq;
 177        __be32 del_filter_to_l2tix;
 178        __be16 ethtype;
 179        __be16 ethtypem;
 180        __u8   frag_to_ovlan_vldm;
 181        __u8   smac_sel;
 182        __be16 rx_chan_rx_rpl_iq;
 183        __be32 maci_to_matchtypem;
 184        __u8   ptcl;
 185        __u8   ptclm;
 186        __u8   ttyp;
 187        __u8   ttypm;
 188        __be16 ivlan;
 189        __be16 ivlanm;
 190        __be16 ovlan;
 191        __be16 ovlanm;
 192        __u8   lip[16];
 193        __u8   lipm[16];
 194        __u8   fip[16];
 195        __u8   fipm[16];
 196        __be16 lp;
 197        __be16 lpm;
 198        __be16 fp;
 199        __be16 fpm;
 200        __be16 r7;
 201        __u8   sma[6];
 202};
 203
 204#define FW_FILTER_WR_TID_S      12
 205#define FW_FILTER_WR_TID_M      0xfffff
 206#define FW_FILTER_WR_TID_V(x)   ((x) << FW_FILTER_WR_TID_S)
 207#define FW_FILTER_WR_TID_G(x)   \
 208        (((x) >> FW_FILTER_WR_TID_S) & FW_FILTER_WR_TID_M)
 209
 210#define FW_FILTER_WR_RQTYPE_S           11
 211#define FW_FILTER_WR_RQTYPE_M           0x1
 212#define FW_FILTER_WR_RQTYPE_V(x)        ((x) << FW_FILTER_WR_RQTYPE_S)
 213#define FW_FILTER_WR_RQTYPE_G(x)        \
 214        (((x) >> FW_FILTER_WR_RQTYPE_S) & FW_FILTER_WR_RQTYPE_M)
 215#define FW_FILTER_WR_RQTYPE_F   FW_FILTER_WR_RQTYPE_V(1U)
 216
 217#define FW_FILTER_WR_NOREPLY_S          10
 218#define FW_FILTER_WR_NOREPLY_M          0x1
 219#define FW_FILTER_WR_NOREPLY_V(x)       ((x) << FW_FILTER_WR_NOREPLY_S)
 220#define FW_FILTER_WR_NOREPLY_G(x)       \
 221        (((x) >> FW_FILTER_WR_NOREPLY_S) & FW_FILTER_WR_NOREPLY_M)
 222#define FW_FILTER_WR_NOREPLY_F  FW_FILTER_WR_NOREPLY_V(1U)
 223
 224#define FW_FILTER_WR_IQ_S       0
 225#define FW_FILTER_WR_IQ_M       0x3ff
 226#define FW_FILTER_WR_IQ_V(x)    ((x) << FW_FILTER_WR_IQ_S)
 227#define FW_FILTER_WR_IQ_G(x)    \
 228        (((x) >> FW_FILTER_WR_IQ_S) & FW_FILTER_WR_IQ_M)
 229
 230#define FW_FILTER_WR_DEL_FILTER_S       31
 231#define FW_FILTER_WR_DEL_FILTER_M       0x1
 232#define FW_FILTER_WR_DEL_FILTER_V(x)    ((x) << FW_FILTER_WR_DEL_FILTER_S)
 233#define FW_FILTER_WR_DEL_FILTER_G(x)    \
 234        (((x) >> FW_FILTER_WR_DEL_FILTER_S) & FW_FILTER_WR_DEL_FILTER_M)
 235#define FW_FILTER_WR_DEL_FILTER_F       FW_FILTER_WR_DEL_FILTER_V(1U)
 236
 237#define FW_FILTER_WR_RPTTID_S           25
 238#define FW_FILTER_WR_RPTTID_M           0x1
 239#define FW_FILTER_WR_RPTTID_V(x)        ((x) << FW_FILTER_WR_RPTTID_S)
 240#define FW_FILTER_WR_RPTTID_G(x)        \
 241        (((x) >> FW_FILTER_WR_RPTTID_S) & FW_FILTER_WR_RPTTID_M)
 242#define FW_FILTER_WR_RPTTID_F   FW_FILTER_WR_RPTTID_V(1U)
 243
 244#define FW_FILTER_WR_DROP_S     24
 245#define FW_FILTER_WR_DROP_M     0x1
 246#define FW_FILTER_WR_DROP_V(x)  ((x) << FW_FILTER_WR_DROP_S)
 247#define FW_FILTER_WR_DROP_G(x)  \
 248        (((x) >> FW_FILTER_WR_DROP_S) & FW_FILTER_WR_DROP_M)
 249#define FW_FILTER_WR_DROP_F     FW_FILTER_WR_DROP_V(1U)
 250
 251#define FW_FILTER_WR_DIRSTEER_S         23
 252#define FW_FILTER_WR_DIRSTEER_M         0x1
 253#define FW_FILTER_WR_DIRSTEER_V(x)      ((x) << FW_FILTER_WR_DIRSTEER_S)
 254#define FW_FILTER_WR_DIRSTEER_G(x)      \
 255        (((x) >> FW_FILTER_WR_DIRSTEER_S) & FW_FILTER_WR_DIRSTEER_M)
 256#define FW_FILTER_WR_DIRSTEER_F FW_FILTER_WR_DIRSTEER_V(1U)
 257
 258#define FW_FILTER_WR_MASKHASH_S         22
 259#define FW_FILTER_WR_MASKHASH_M         0x1
 260#define FW_FILTER_WR_MASKHASH_V(x)      ((x) << FW_FILTER_WR_MASKHASH_S)
 261#define FW_FILTER_WR_MASKHASH_G(x)      \
 262        (((x) >> FW_FILTER_WR_MASKHASH_S) & FW_FILTER_WR_MASKHASH_M)
 263#define FW_FILTER_WR_MASKHASH_F FW_FILTER_WR_MASKHASH_V(1U)
 264
 265#define FW_FILTER_WR_DIRSTEERHASH_S     21
 266#define FW_FILTER_WR_DIRSTEERHASH_M     0x1
 267#define FW_FILTER_WR_DIRSTEERHASH_V(x)  ((x) << FW_FILTER_WR_DIRSTEERHASH_S)
 268#define FW_FILTER_WR_DIRSTEERHASH_G(x)  \
 269        (((x) >> FW_FILTER_WR_DIRSTEERHASH_S) & FW_FILTER_WR_DIRSTEERHASH_M)
 270#define FW_FILTER_WR_DIRSTEERHASH_F     FW_FILTER_WR_DIRSTEERHASH_V(1U)
 271
 272#define FW_FILTER_WR_LPBK_S     20
 273#define FW_FILTER_WR_LPBK_M     0x1
 274#define FW_FILTER_WR_LPBK_V(x)  ((x) << FW_FILTER_WR_LPBK_S)
 275#define FW_FILTER_WR_LPBK_G(x)  \
 276        (((x) >> FW_FILTER_WR_LPBK_S) & FW_FILTER_WR_LPBK_M)
 277#define FW_FILTER_WR_LPBK_F     FW_FILTER_WR_LPBK_V(1U)
 278
 279#define FW_FILTER_WR_DMAC_S     19
 280#define FW_FILTER_WR_DMAC_M     0x1
 281#define FW_FILTER_WR_DMAC_V(x)  ((x) << FW_FILTER_WR_DMAC_S)
 282#define FW_FILTER_WR_DMAC_G(x)  \
 283        (((x) >> FW_FILTER_WR_DMAC_S) & FW_FILTER_WR_DMAC_M)
 284#define FW_FILTER_WR_DMAC_F     FW_FILTER_WR_DMAC_V(1U)
 285
 286#define FW_FILTER_WR_SMAC_S     18
 287#define FW_FILTER_WR_SMAC_M     0x1
 288#define FW_FILTER_WR_SMAC_V(x)  ((x) << FW_FILTER_WR_SMAC_S)
 289#define FW_FILTER_WR_SMAC_G(x)  \
 290        (((x) >> FW_FILTER_WR_SMAC_S) & FW_FILTER_WR_SMAC_M)
 291#define FW_FILTER_WR_SMAC_F     FW_FILTER_WR_SMAC_V(1U)
 292
 293#define FW_FILTER_WR_INSVLAN_S          17
 294#define FW_FILTER_WR_INSVLAN_M          0x1
 295#define FW_FILTER_WR_INSVLAN_V(x)       ((x) << FW_FILTER_WR_INSVLAN_S)
 296#define FW_FILTER_WR_INSVLAN_G(x)       \
 297        (((x) >> FW_FILTER_WR_INSVLAN_S) & FW_FILTER_WR_INSVLAN_M)
 298#define FW_FILTER_WR_INSVLAN_F  FW_FILTER_WR_INSVLAN_V(1U)
 299
 300#define FW_FILTER_WR_RMVLAN_S           16
 301#define FW_FILTER_WR_RMVLAN_M           0x1
 302#define FW_FILTER_WR_RMVLAN_V(x)        ((x) << FW_FILTER_WR_RMVLAN_S)
 303#define FW_FILTER_WR_RMVLAN_G(x)        \
 304        (((x) >> FW_FILTER_WR_RMVLAN_S) & FW_FILTER_WR_RMVLAN_M)
 305#define FW_FILTER_WR_RMVLAN_F   FW_FILTER_WR_RMVLAN_V(1U)
 306
 307#define FW_FILTER_WR_HITCNTS_S          15
 308#define FW_FILTER_WR_HITCNTS_M          0x1
 309#define FW_FILTER_WR_HITCNTS_V(x)       ((x) << FW_FILTER_WR_HITCNTS_S)
 310#define FW_FILTER_WR_HITCNTS_G(x)       \
 311        (((x) >> FW_FILTER_WR_HITCNTS_S) & FW_FILTER_WR_HITCNTS_M)
 312#define FW_FILTER_WR_HITCNTS_F  FW_FILTER_WR_HITCNTS_V(1U)
 313
 314#define FW_FILTER_WR_TXCHAN_S           13
 315#define FW_FILTER_WR_TXCHAN_M           0x3
 316#define FW_FILTER_WR_TXCHAN_V(x)        ((x) << FW_FILTER_WR_TXCHAN_S)
 317#define FW_FILTER_WR_TXCHAN_G(x)        \
 318        (((x) >> FW_FILTER_WR_TXCHAN_S) & FW_FILTER_WR_TXCHAN_M)
 319
 320#define FW_FILTER_WR_PRIO_S     12
 321#define FW_FILTER_WR_PRIO_M     0x1
 322#define FW_FILTER_WR_PRIO_V(x)  ((x) << FW_FILTER_WR_PRIO_S)
 323#define FW_FILTER_WR_PRIO_G(x)  \
 324        (((x) >> FW_FILTER_WR_PRIO_S) & FW_FILTER_WR_PRIO_M)
 325#define FW_FILTER_WR_PRIO_F     FW_FILTER_WR_PRIO_V(1U)
 326
 327#define FW_FILTER_WR_L2TIX_S    0
 328#define FW_FILTER_WR_L2TIX_M    0xfff
 329#define FW_FILTER_WR_L2TIX_V(x) ((x) << FW_FILTER_WR_L2TIX_S)
 330#define FW_FILTER_WR_L2TIX_G(x) \
 331        (((x) >> FW_FILTER_WR_L2TIX_S) & FW_FILTER_WR_L2TIX_M)
 332
 333#define FW_FILTER_WR_FRAG_S     7
 334#define FW_FILTER_WR_FRAG_M     0x1
 335#define FW_FILTER_WR_FRAG_V(x)  ((x) << FW_FILTER_WR_FRAG_S)
 336#define FW_FILTER_WR_FRAG_G(x)  \
 337        (((x) >> FW_FILTER_WR_FRAG_S) & FW_FILTER_WR_FRAG_M)
 338#define FW_FILTER_WR_FRAG_F     FW_FILTER_WR_FRAG_V(1U)
 339
 340#define FW_FILTER_WR_FRAGM_S    6
 341#define FW_FILTER_WR_FRAGM_M    0x1
 342#define FW_FILTER_WR_FRAGM_V(x) ((x) << FW_FILTER_WR_FRAGM_S)
 343#define FW_FILTER_WR_FRAGM_G(x) \
 344        (((x) >> FW_FILTER_WR_FRAGM_S) & FW_FILTER_WR_FRAGM_M)
 345#define FW_FILTER_WR_FRAGM_F    FW_FILTER_WR_FRAGM_V(1U)
 346
 347#define FW_FILTER_WR_IVLAN_VLD_S        5
 348#define FW_FILTER_WR_IVLAN_VLD_M        0x1
 349#define FW_FILTER_WR_IVLAN_VLD_V(x)     ((x) << FW_FILTER_WR_IVLAN_VLD_S)
 350#define FW_FILTER_WR_IVLAN_VLD_G(x)     \
 351        (((x) >> FW_FILTER_WR_IVLAN_VLD_S) & FW_FILTER_WR_IVLAN_VLD_M)
 352#define FW_FILTER_WR_IVLAN_VLD_F        FW_FILTER_WR_IVLAN_VLD_V(1U)
 353
 354#define FW_FILTER_WR_OVLAN_VLD_S        4
 355#define FW_FILTER_WR_OVLAN_VLD_M        0x1
 356#define FW_FILTER_WR_OVLAN_VLD_V(x)     ((x) << FW_FILTER_WR_OVLAN_VLD_S)
 357#define FW_FILTER_WR_OVLAN_VLD_G(x)     \
 358        (((x) >> FW_FILTER_WR_OVLAN_VLD_S) & FW_FILTER_WR_OVLAN_VLD_M)
 359#define FW_FILTER_WR_OVLAN_VLD_F        FW_FILTER_WR_OVLAN_VLD_V(1U)
 360
 361#define FW_FILTER_WR_IVLAN_VLDM_S       3
 362#define FW_FILTER_WR_IVLAN_VLDM_M       0x1
 363#define FW_FILTER_WR_IVLAN_VLDM_V(x)    ((x) << FW_FILTER_WR_IVLAN_VLDM_S)
 364#define FW_FILTER_WR_IVLAN_VLDM_G(x)    \
 365        (((x) >> FW_FILTER_WR_IVLAN_VLDM_S) & FW_FILTER_WR_IVLAN_VLDM_M)
 366#define FW_FILTER_WR_IVLAN_VLDM_F       FW_FILTER_WR_IVLAN_VLDM_V(1U)
 367
 368#define FW_FILTER_WR_OVLAN_VLDM_S       2
 369#define FW_FILTER_WR_OVLAN_VLDM_M       0x1
 370#define FW_FILTER_WR_OVLAN_VLDM_V(x)    ((x) << FW_FILTER_WR_OVLAN_VLDM_S)
 371#define FW_FILTER_WR_OVLAN_VLDM_G(x)    \
 372        (((x) >> FW_FILTER_WR_OVLAN_VLDM_S) & FW_FILTER_WR_OVLAN_VLDM_M)
 373#define FW_FILTER_WR_OVLAN_VLDM_F       FW_FILTER_WR_OVLAN_VLDM_V(1U)
 374
 375#define FW_FILTER_WR_RX_CHAN_S          15
 376#define FW_FILTER_WR_RX_CHAN_M          0x1
 377#define FW_FILTER_WR_RX_CHAN_V(x)       ((x) << FW_FILTER_WR_RX_CHAN_S)
 378#define FW_FILTER_WR_RX_CHAN_G(x)       \
 379        (((x) >> FW_FILTER_WR_RX_CHAN_S) & FW_FILTER_WR_RX_CHAN_M)
 380#define FW_FILTER_WR_RX_CHAN_F  FW_FILTER_WR_RX_CHAN_V(1U)
 381
 382#define FW_FILTER_WR_RX_RPL_IQ_S        0
 383#define FW_FILTER_WR_RX_RPL_IQ_M        0x3ff
 384#define FW_FILTER_WR_RX_RPL_IQ_V(x)     ((x) << FW_FILTER_WR_RX_RPL_IQ_S)
 385#define FW_FILTER_WR_RX_RPL_IQ_G(x)     \
 386        (((x) >> FW_FILTER_WR_RX_RPL_IQ_S) & FW_FILTER_WR_RX_RPL_IQ_M)
 387
 388#define FW_FILTER_WR_MACI_S     23
 389#define FW_FILTER_WR_MACI_M     0x1ff
 390#define FW_FILTER_WR_MACI_V(x)  ((x) << FW_FILTER_WR_MACI_S)
 391#define FW_FILTER_WR_MACI_G(x)  \
 392        (((x) >> FW_FILTER_WR_MACI_S) & FW_FILTER_WR_MACI_M)
 393
 394#define FW_FILTER_WR_MACIM_S    14
 395#define FW_FILTER_WR_MACIM_M    0x1ff
 396#define FW_FILTER_WR_MACIM_V(x) ((x) << FW_FILTER_WR_MACIM_S)
 397#define FW_FILTER_WR_MACIM_G(x) \
 398        (((x) >> FW_FILTER_WR_MACIM_S) & FW_FILTER_WR_MACIM_M)
 399
 400#define FW_FILTER_WR_FCOE_S     13
 401#define FW_FILTER_WR_FCOE_M     0x1
 402#define FW_FILTER_WR_FCOE_V(x)  ((x) << FW_FILTER_WR_FCOE_S)
 403#define FW_FILTER_WR_FCOE_G(x)  \
 404        (((x) >> FW_FILTER_WR_FCOE_S) & FW_FILTER_WR_FCOE_M)
 405#define FW_FILTER_WR_FCOE_F     FW_FILTER_WR_FCOE_V(1U)
 406
 407#define FW_FILTER_WR_FCOEM_S    12
 408#define FW_FILTER_WR_FCOEM_M    0x1
 409#define FW_FILTER_WR_FCOEM_V(x) ((x) << FW_FILTER_WR_FCOEM_S)
 410#define FW_FILTER_WR_FCOEM_G(x) \
 411        (((x) >> FW_FILTER_WR_FCOEM_S) & FW_FILTER_WR_FCOEM_M)
 412#define FW_FILTER_WR_FCOEM_F    FW_FILTER_WR_FCOEM_V(1U)
 413
 414#define FW_FILTER_WR_PORT_S     9
 415#define FW_FILTER_WR_PORT_M     0x7
 416#define FW_FILTER_WR_PORT_V(x)  ((x) << FW_FILTER_WR_PORT_S)
 417#define FW_FILTER_WR_PORT_G(x)  \
 418        (((x) >> FW_FILTER_WR_PORT_S) & FW_FILTER_WR_PORT_M)
 419
 420#define FW_FILTER_WR_PORTM_S    6
 421#define FW_FILTER_WR_PORTM_M    0x7
 422#define FW_FILTER_WR_PORTM_V(x) ((x) << FW_FILTER_WR_PORTM_S)
 423#define FW_FILTER_WR_PORTM_G(x) \
 424        (((x) >> FW_FILTER_WR_PORTM_S) & FW_FILTER_WR_PORTM_M)
 425
 426#define FW_FILTER_WR_MATCHTYPE_S        3
 427#define FW_FILTER_WR_MATCHTYPE_M        0x7
 428#define FW_FILTER_WR_MATCHTYPE_V(x)     ((x) << FW_FILTER_WR_MATCHTYPE_S)
 429#define FW_FILTER_WR_MATCHTYPE_G(x)     \
 430        (((x) >> FW_FILTER_WR_MATCHTYPE_S) & FW_FILTER_WR_MATCHTYPE_M)
 431
 432#define FW_FILTER_WR_MATCHTYPEM_S       0
 433#define FW_FILTER_WR_MATCHTYPEM_M       0x7
 434#define FW_FILTER_WR_MATCHTYPEM_V(x)    ((x) << FW_FILTER_WR_MATCHTYPEM_S)
 435#define FW_FILTER_WR_MATCHTYPEM_G(x)    \
 436        (((x) >> FW_FILTER_WR_MATCHTYPEM_S) & FW_FILTER_WR_MATCHTYPEM_M)
 437
 438struct fw_ulptx_wr {
 439        __be32 op_to_compl;
 440        __be32 flowid_len16;
 441        u64 cookie;
 442};
 443
 444struct fw_tp_wr {
 445        __be32 op_to_immdlen;
 446        __be32 flowid_len16;
 447        u64 cookie;
 448};
 449
 450struct fw_eth_tx_pkt_wr {
 451        __be32 op_immdlen;
 452        __be32 equiq_to_len16;
 453        __be64 r3;
 454};
 455
 456struct fw_ofld_connection_wr {
 457        __be32 op_compl;
 458        __be32 len16_pkd;
 459        __u64  cookie;
 460        __be64 r2;
 461        __be64 r3;
 462        struct fw_ofld_connection_le {
 463                __be32 version_cpl;
 464                __be32 filter;
 465                __be32 r1;
 466                __be16 lport;
 467                __be16 pport;
 468                union fw_ofld_connection_leip {
 469                        struct fw_ofld_connection_le_ipv4 {
 470                                __be32 pip;
 471                                __be32 lip;
 472                                __be64 r0;
 473                                __be64 r1;
 474                                __be64 r2;
 475                        } ipv4;
 476                        struct fw_ofld_connection_le_ipv6 {
 477                                __be64 pip_hi;
 478                                __be64 pip_lo;
 479                                __be64 lip_hi;
 480                                __be64 lip_lo;
 481                        } ipv6;
 482                } u;
 483        } le;
 484        struct fw_ofld_connection_tcb {
 485                __be32 t_state_to_astid;
 486                __be16 cplrxdataack_cplpassacceptrpl;
 487                __be16 rcv_adv;
 488                __be32 rcv_nxt;
 489                __be32 tx_max;
 490                __be64 opt0;
 491                __be32 opt2;
 492                __be32 r1;
 493                __be64 r2;
 494                __be64 r3;
 495        } tcb;
 496};
 497
 498#define FW_OFLD_CONNECTION_WR_VERSION_S                31
 499#define FW_OFLD_CONNECTION_WR_VERSION_M                0x1
 500#define FW_OFLD_CONNECTION_WR_VERSION_V(x)     \
 501        ((x) << FW_OFLD_CONNECTION_WR_VERSION_S)
 502#define FW_OFLD_CONNECTION_WR_VERSION_G(x)     \
 503        (((x) >> FW_OFLD_CONNECTION_WR_VERSION_S) & \
 504        FW_OFLD_CONNECTION_WR_VERSION_M)
 505#define FW_OFLD_CONNECTION_WR_VERSION_F        \
 506        FW_OFLD_CONNECTION_WR_VERSION_V(1U)
 507
 508#define FW_OFLD_CONNECTION_WR_CPL_S    30
 509#define FW_OFLD_CONNECTION_WR_CPL_M    0x1
 510#define FW_OFLD_CONNECTION_WR_CPL_V(x) ((x) << FW_OFLD_CONNECTION_WR_CPL_S)
 511#define FW_OFLD_CONNECTION_WR_CPL_G(x) \
 512        (((x) >> FW_OFLD_CONNECTION_WR_CPL_S) & FW_OFLD_CONNECTION_WR_CPL_M)
 513#define FW_OFLD_CONNECTION_WR_CPL_F    FW_OFLD_CONNECTION_WR_CPL_V(1U)
 514
 515#define FW_OFLD_CONNECTION_WR_T_STATE_S                28
 516#define FW_OFLD_CONNECTION_WR_T_STATE_M                0xf
 517#define FW_OFLD_CONNECTION_WR_T_STATE_V(x)     \
 518        ((x) << FW_OFLD_CONNECTION_WR_T_STATE_S)
 519#define FW_OFLD_CONNECTION_WR_T_STATE_G(x)     \
 520        (((x) >> FW_OFLD_CONNECTION_WR_T_STATE_S) & \
 521        FW_OFLD_CONNECTION_WR_T_STATE_M)
 522
 523#define FW_OFLD_CONNECTION_WR_RCV_SCALE_S      24
 524#define FW_OFLD_CONNECTION_WR_RCV_SCALE_M      0xf
 525#define FW_OFLD_CONNECTION_WR_RCV_SCALE_V(x)   \
 526        ((x) << FW_OFLD_CONNECTION_WR_RCV_SCALE_S)
 527#define FW_OFLD_CONNECTION_WR_RCV_SCALE_G(x)   \
 528        (((x) >> FW_OFLD_CONNECTION_WR_RCV_SCALE_S) & \
 529        FW_OFLD_CONNECTION_WR_RCV_SCALE_M)
 530
 531#define FW_OFLD_CONNECTION_WR_ASTID_S          0
 532#define FW_OFLD_CONNECTION_WR_ASTID_M          0xffffff
 533#define FW_OFLD_CONNECTION_WR_ASTID_V(x)       \
 534        ((x) << FW_OFLD_CONNECTION_WR_ASTID_S)
 535#define FW_OFLD_CONNECTION_WR_ASTID_G(x)       \
 536        (((x) >> FW_OFLD_CONNECTION_WR_ASTID_S) & FW_OFLD_CONNECTION_WR_ASTID_M)
 537
 538#define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_S   15
 539#define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_M   0x1
 540#define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_V(x)        \
 541        ((x) << FW_OFLD_CONNECTION_WR_CPLRXDATAACK_S)
 542#define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_G(x)        \
 543        (((x) >> FW_OFLD_CONNECTION_WR_CPLRXDATAACK_S) & \
 544        FW_OFLD_CONNECTION_WR_CPLRXDATAACK_M)
 545#define FW_OFLD_CONNECTION_WR_CPLRXDATAACK_F   \
 546        FW_OFLD_CONNECTION_WR_CPLRXDATAACK_V(1U)
 547
 548#define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_S       14
 549#define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_M       0x1
 550#define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_V(x)    \
 551        ((x) << FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_S)
 552#define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_G(x)    \
 553        (((x) >> FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_S) & \
 554        FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_M)
 555#define FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_F       \
 556        FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL_V(1U)
 557
 558enum fw_flowc_mnem {
 559        FW_FLOWC_MNEM_PFNVFN,           /* PFN [15:8] VFN [7:0] */
 560        FW_FLOWC_MNEM_CH,
 561        FW_FLOWC_MNEM_PORT,
 562        FW_FLOWC_MNEM_IQID,
 563        FW_FLOWC_MNEM_SNDNXT,
 564        FW_FLOWC_MNEM_RCVNXT,
 565        FW_FLOWC_MNEM_SNDBUF,
 566        FW_FLOWC_MNEM_MSS,
 567        FW_FLOWC_MNEM_TXDATAPLEN_MAX,
 568        FW_FLOWC_MNEM_TCPSTATE,
 569        FW_FLOWC_MNEM_EOSTATE,
 570        FW_FLOWC_MNEM_SCHEDCLASS,
 571        FW_FLOWC_MNEM_DCBPRIO,
 572        FW_FLOWC_MNEM_SND_SCALE,
 573        FW_FLOWC_MNEM_RCV_SCALE,
 574};
 575
 576struct fw_flowc_mnemval {
 577        u8 mnemonic;
 578        u8 r4[3];
 579        __be32 val;
 580};
 581
 582struct fw_flowc_wr {
 583        __be32 op_to_nparams;
 584        __be32 flowid_len16;
 585        struct fw_flowc_mnemval mnemval[0];
 586};
 587
 588#define FW_FLOWC_WR_NPARAMS_S           0
 589#define FW_FLOWC_WR_NPARAMS_V(x)        ((x) << FW_FLOWC_WR_NPARAMS_S)
 590
 591struct fw_ofld_tx_data_wr {
 592        __be32 op_to_immdlen;
 593        __be32 flowid_len16;
 594        __be32 plen;
 595        __be32 tunnel_to_proxy;
 596};
 597
 598#define FW_OFLD_TX_DATA_WR_TUNNEL_S     19
 599#define FW_OFLD_TX_DATA_WR_TUNNEL_V(x)  ((x) << FW_OFLD_TX_DATA_WR_TUNNEL_S)
 600
 601#define FW_OFLD_TX_DATA_WR_SAVE_S       18
 602#define FW_OFLD_TX_DATA_WR_SAVE_V(x)    ((x) << FW_OFLD_TX_DATA_WR_SAVE_S)
 603
 604#define FW_OFLD_TX_DATA_WR_FLUSH_S      17
 605#define FW_OFLD_TX_DATA_WR_FLUSH_V(x)   ((x) << FW_OFLD_TX_DATA_WR_FLUSH_S)
 606#define FW_OFLD_TX_DATA_WR_FLUSH_F      FW_OFLD_TX_DATA_WR_FLUSH_V(1U)
 607
 608#define FW_OFLD_TX_DATA_WR_URGENT_S     16
 609#define FW_OFLD_TX_DATA_WR_URGENT_V(x)  ((x) << FW_OFLD_TX_DATA_WR_URGENT_S)
 610
 611#define FW_OFLD_TX_DATA_WR_MORE_S       15
 612#define FW_OFLD_TX_DATA_WR_MORE_V(x)    ((x) << FW_OFLD_TX_DATA_WR_MORE_S)
 613
 614#define FW_OFLD_TX_DATA_WR_SHOVE_S      14
 615#define FW_OFLD_TX_DATA_WR_SHOVE_V(x)   ((x) << FW_OFLD_TX_DATA_WR_SHOVE_S)
 616#define FW_OFLD_TX_DATA_WR_SHOVE_F      FW_OFLD_TX_DATA_WR_SHOVE_V(1U)
 617
 618#define FW_OFLD_TX_DATA_WR_ULPMODE_S    10
 619#define FW_OFLD_TX_DATA_WR_ULPMODE_V(x) ((x) << FW_OFLD_TX_DATA_WR_ULPMODE_S)
 620
 621#define FW_OFLD_TX_DATA_WR_ULPSUBMODE_S         6
 622#define FW_OFLD_TX_DATA_WR_ULPSUBMODE_V(x)      \
 623        ((x) << FW_OFLD_TX_DATA_WR_ULPSUBMODE_S)
 624
 625struct fw_cmd_wr {
 626        __be32 op_dma;
 627        __be32 len16_pkd;
 628        __be64 cookie_daddr;
 629};
 630
 631#define FW_CMD_WR_DMA_S         17
 632#define FW_CMD_WR_DMA_V(x)      ((x) << FW_CMD_WR_DMA_S)
 633
 634struct fw_eth_tx_pkt_vm_wr {
 635        __be32 op_immdlen;
 636        __be32 equiq_to_len16;
 637        __be32 r3[2];
 638        u8 ethmacdst[6];
 639        u8 ethmacsrc[6];
 640        __be16 ethtype;
 641        __be16 vlantci;
 642};
 643
 644#define FW_CMD_MAX_TIMEOUT 10000
 645
 646/*
 647 * If a host driver does a HELLO and discovers that there's already a MASTER
 648 * selected, we may have to wait for that MASTER to finish issuing RESET,
 649 * configuration and INITIALIZE commands.  Also, there's a possibility that
 650 * our own HELLO may get lost if it happens right as the MASTER is issuign a
 651 * RESET command, so we need to be willing to make a few retries of our HELLO.
 652 */
 653#define FW_CMD_HELLO_TIMEOUT    (3 * FW_CMD_MAX_TIMEOUT)
 654#define FW_CMD_HELLO_RETRIES    3
 655
 656
 657enum fw_cmd_opcodes {
 658        FW_LDST_CMD                    = 0x01,
 659        FW_RESET_CMD                   = 0x03,
 660        FW_HELLO_CMD                   = 0x04,
 661        FW_BYE_CMD                     = 0x05,
 662        FW_INITIALIZE_CMD              = 0x06,
 663        FW_CAPS_CONFIG_CMD             = 0x07,
 664        FW_PARAMS_CMD                  = 0x08,
 665        FW_PFVF_CMD                    = 0x09,
 666        FW_IQ_CMD                      = 0x10,
 667        FW_EQ_MNGT_CMD                 = 0x11,
 668        FW_EQ_ETH_CMD                  = 0x12,
 669        FW_EQ_CTRL_CMD                 = 0x13,
 670        FW_EQ_OFLD_CMD                 = 0x21,
 671        FW_VI_CMD                      = 0x14,
 672        FW_VI_MAC_CMD                  = 0x15,
 673        FW_VI_RXMODE_CMD               = 0x16,
 674        FW_VI_ENABLE_CMD               = 0x17,
 675        FW_ACL_MAC_CMD                 = 0x18,
 676        FW_ACL_VLAN_CMD                = 0x19,
 677        FW_VI_STATS_CMD                = 0x1a,
 678        FW_PORT_CMD                    = 0x1b,
 679        FW_PORT_STATS_CMD              = 0x1c,
 680        FW_PORT_LB_STATS_CMD           = 0x1d,
 681        FW_PORT_TRACE_CMD              = 0x1e,
 682        FW_PORT_TRACE_MMAP_CMD         = 0x1f,
 683        FW_RSS_IND_TBL_CMD             = 0x20,
 684        FW_RSS_GLB_CONFIG_CMD          = 0x22,
 685        FW_RSS_VI_CONFIG_CMD           = 0x23,
 686        FW_SCHED_CMD                   = 0x24,
 687        FW_DEVLOG_CMD                  = 0x25,
 688        FW_CLIP_CMD                    = 0x28,
 689        FW_PTP_CMD                     = 0x3e,
 690        FW_LASTC2E_CMD                 = 0x40,
 691        FW_ERROR_CMD                   = 0x80,
 692        FW_DEBUG_CMD                   = 0x81,
 693};
 694
 695enum fw_cmd_cap {
 696        FW_CMD_CAP_PF                  = 0x01,
 697        FW_CMD_CAP_DMAQ                = 0x02,
 698        FW_CMD_CAP_PORT                = 0x04,
 699        FW_CMD_CAP_PORTPROMISC         = 0x08,
 700        FW_CMD_CAP_PORTSTATS           = 0x10,
 701        FW_CMD_CAP_VF                  = 0x80,
 702};
 703
 704/*
 705 * Generic command header flit0
 706 */
 707struct fw_cmd_hdr {
 708        __be32 hi;
 709        __be32 lo;
 710};
 711
 712#define FW_CMD_OP_S             24
 713#define FW_CMD_OP_M             0xff
 714#define FW_CMD_OP_V(x)          ((x) << FW_CMD_OP_S)
 715#define FW_CMD_OP_G(x)          (((x) >> FW_CMD_OP_S) & FW_CMD_OP_M)
 716
 717#define FW_CMD_REQUEST_S        23
 718#define FW_CMD_REQUEST_V(x)     ((x) << FW_CMD_REQUEST_S)
 719#define FW_CMD_REQUEST_F        FW_CMD_REQUEST_V(1U)
 720
 721#define FW_CMD_READ_S           22
 722#define FW_CMD_READ_V(x)        ((x) << FW_CMD_READ_S)
 723#define FW_CMD_READ_F           FW_CMD_READ_V(1U)
 724
 725#define FW_CMD_WRITE_S          21
 726#define FW_CMD_WRITE_V(x)       ((x) << FW_CMD_WRITE_S)
 727#define FW_CMD_WRITE_F          FW_CMD_WRITE_V(1U)
 728
 729#define FW_CMD_EXEC_S           20
 730#define FW_CMD_EXEC_V(x)        ((x) << FW_CMD_EXEC_S)
 731#define FW_CMD_EXEC_F           FW_CMD_EXEC_V(1U)
 732
 733#define FW_CMD_RAMASK_S         20
 734#define FW_CMD_RAMASK_V(x)      ((x) << FW_CMD_RAMASK_S)
 735
 736#define FW_CMD_RETVAL_S         8
 737#define FW_CMD_RETVAL_M         0xff
 738#define FW_CMD_RETVAL_V(x)      ((x) << FW_CMD_RETVAL_S)
 739#define FW_CMD_RETVAL_G(x)      (((x) >> FW_CMD_RETVAL_S) & FW_CMD_RETVAL_M)
 740
 741#define FW_CMD_LEN16_S          0
 742#define FW_CMD_LEN16_V(x)       ((x) << FW_CMD_LEN16_S)
 743
 744#define FW_LEN16(fw_struct)     FW_CMD_LEN16_V(sizeof(fw_struct) / 16)
 745
 746enum fw_ldst_addrspc {
 747        FW_LDST_ADDRSPC_FIRMWARE  = 0x0001,
 748        FW_LDST_ADDRSPC_SGE_EGRC  = 0x0008,
 749        FW_LDST_ADDRSPC_SGE_INGC  = 0x0009,
 750        FW_LDST_ADDRSPC_SGE_FLMC  = 0x000a,
 751        FW_LDST_ADDRSPC_SGE_CONMC = 0x000b,
 752        FW_LDST_ADDRSPC_TP_PIO    = 0x0010,
 753        FW_LDST_ADDRSPC_TP_TM_PIO = 0x0011,
 754        FW_LDST_ADDRSPC_TP_MIB    = 0x0012,
 755        FW_LDST_ADDRSPC_MDIO      = 0x0018,
 756        FW_LDST_ADDRSPC_MPS       = 0x0020,
 757        FW_LDST_ADDRSPC_FUNC      = 0x0028,
 758        FW_LDST_ADDRSPC_FUNC_PCIE = 0x0029,
 759};
 760
 761enum fw_ldst_mps_fid {
 762        FW_LDST_MPS_ATRB,
 763        FW_LDST_MPS_RPLC
 764};
 765
 766enum fw_ldst_func_access_ctl {
 767        FW_LDST_FUNC_ACC_CTL_VIID,
 768        FW_LDST_FUNC_ACC_CTL_FID
 769};
 770
 771enum fw_ldst_func_mod_index {
 772        FW_LDST_FUNC_MPS
 773};
 774
 775struct fw_ldst_cmd {
 776        __be32 op_to_addrspace;
 777        __be32 cycles_to_len16;
 778        union fw_ldst {
 779                struct fw_ldst_addrval {
 780                        __be32 addr;
 781                        __be32 val;
 782                } addrval;
 783                struct fw_ldst_idctxt {
 784                        __be32 physid;
 785                        __be32 msg_ctxtflush;
 786                        __be32 ctxt_data7;
 787                        __be32 ctxt_data6;
 788                        __be32 ctxt_data5;
 789                        __be32 ctxt_data4;
 790                        __be32 ctxt_data3;
 791                        __be32 ctxt_data2;
 792                        __be32 ctxt_data1;
 793                        __be32 ctxt_data0;
 794                } idctxt;
 795                struct fw_ldst_mdio {
 796                        __be16 paddr_mmd;
 797                        __be16 raddr;
 798                        __be16 vctl;
 799                        __be16 rval;
 800                } mdio;
 801                struct fw_ldst_cim_rq {
 802                        u8 req_first64[8];
 803                        u8 req_second64[8];
 804                        u8 resp_first64[8];
 805                        u8 resp_second64[8];
 806                        __be32 r3[2];
 807                } cim_rq;
 808                union fw_ldst_mps {
 809                        struct fw_ldst_mps_rplc {
 810                                __be16 fid_idx;
 811                                __be16 rplcpf_pkd;
 812                                __be32 rplc255_224;
 813                                __be32 rplc223_192;
 814                                __be32 rplc191_160;
 815                                __be32 rplc159_128;
 816                                __be32 rplc127_96;
 817                                __be32 rplc95_64;
 818                                __be32 rplc63_32;
 819                                __be32 rplc31_0;
 820                        } rplc;
 821                        struct fw_ldst_mps_atrb {
 822                                __be16 fid_mpsid;
 823                                __be16 r2[3];
 824                                __be32 r3[2];
 825                                __be32 r4;
 826                                __be32 atrb;
 827                                __be16 vlan[16];
 828                        } atrb;
 829                } mps;
 830                struct fw_ldst_func {
 831                        u8 access_ctl;
 832                        u8 mod_index;
 833                        __be16 ctl_id;
 834                        __be32 offset;
 835                        __be64 data0;
 836                        __be64 data1;
 837                } func;
 838                struct fw_ldst_pcie {
 839                        u8 ctrl_to_fn;
 840                        u8 bnum;
 841                        u8 r;
 842                        u8 ext_r;
 843                        u8 select_naccess;
 844                        u8 pcie_fn;
 845                        __be16 nset_pkd;
 846                        __be32 data[12];
 847                } pcie;
 848                struct fw_ldst_i2c_deprecated {
 849                        u8 pid_pkd;
 850                        u8 base;
 851                        u8 boffset;
 852                        u8 data;
 853                        __be32 r9;
 854                } i2c_deprecated;
 855                struct fw_ldst_i2c {
 856                        u8 pid;
 857                        u8 did;
 858                        u8 boffset;
 859                        u8 blen;
 860                        __be32 r9;
 861                        __u8   data[48];
 862                } i2c;
 863                struct fw_ldst_le {
 864                        __be32 index;
 865                        __be32 r9;
 866                        u8 val[33];
 867                        u8 r11[7];
 868                } le;
 869        } u;
 870};
 871
 872#define FW_LDST_CMD_ADDRSPACE_S         0
 873#define FW_LDST_CMD_ADDRSPACE_V(x)      ((x) << FW_LDST_CMD_ADDRSPACE_S)
 874
 875#define FW_LDST_CMD_MSG_S       31
 876#define FW_LDST_CMD_MSG_V(x)    ((x) << FW_LDST_CMD_MSG_S)
 877
 878#define FW_LDST_CMD_CTXTFLUSH_S         30
 879#define FW_LDST_CMD_CTXTFLUSH_V(x)      ((x) << FW_LDST_CMD_CTXTFLUSH_S)
 880#define FW_LDST_CMD_CTXTFLUSH_F         FW_LDST_CMD_CTXTFLUSH_V(1U)
 881
 882#define FW_LDST_CMD_PADDR_S     8
 883#define FW_LDST_CMD_PADDR_V(x)  ((x) << FW_LDST_CMD_PADDR_S)
 884
 885#define FW_LDST_CMD_MMD_S       0
 886#define FW_LDST_CMD_MMD_V(x)    ((x) << FW_LDST_CMD_MMD_S)
 887
 888#define FW_LDST_CMD_FID_S       15
 889#define FW_LDST_CMD_FID_V(x)    ((x) << FW_LDST_CMD_FID_S)
 890
 891#define FW_LDST_CMD_IDX_S       0
 892#define FW_LDST_CMD_IDX_V(x)    ((x) << FW_LDST_CMD_IDX_S)
 893
 894#define FW_LDST_CMD_RPLCPF_S    0
 895#define FW_LDST_CMD_RPLCPF_V(x) ((x) << FW_LDST_CMD_RPLCPF_S)
 896
 897#define FW_LDST_CMD_LC_S        4
 898#define FW_LDST_CMD_LC_V(x)     ((x) << FW_LDST_CMD_LC_S)
 899#define FW_LDST_CMD_LC_F        FW_LDST_CMD_LC_V(1U)
 900
 901#define FW_LDST_CMD_FN_S        0
 902#define FW_LDST_CMD_FN_V(x)     ((x) << FW_LDST_CMD_FN_S)
 903
 904#define FW_LDST_CMD_NACCESS_S           0
 905#define FW_LDST_CMD_NACCESS_V(x)        ((x) << FW_LDST_CMD_NACCESS_S)
 906
 907struct fw_reset_cmd {
 908        __be32 op_to_write;
 909        __be32 retval_len16;
 910        __be32 val;
 911        __be32 halt_pkd;
 912};
 913
 914#define FW_RESET_CMD_HALT_S     31
 915#define FW_RESET_CMD_HALT_M     0x1
 916#define FW_RESET_CMD_HALT_V(x)  ((x) << FW_RESET_CMD_HALT_S)
 917#define FW_RESET_CMD_HALT_G(x)  \
 918        (((x) >> FW_RESET_CMD_HALT_S) & FW_RESET_CMD_HALT_M)
 919#define FW_RESET_CMD_HALT_F     FW_RESET_CMD_HALT_V(1U)
 920
 921enum fw_hellow_cmd {
 922        fw_hello_cmd_stage_os           = 0x0
 923};
 924
 925struct fw_hello_cmd {
 926        __be32 op_to_write;
 927        __be32 retval_len16;
 928        __be32 err_to_clearinit;
 929        __be32 fwrev;
 930};
 931
 932#define FW_HELLO_CMD_ERR_S      31
 933#define FW_HELLO_CMD_ERR_V(x)   ((x) << FW_HELLO_CMD_ERR_S)
 934#define FW_HELLO_CMD_ERR_F      FW_HELLO_CMD_ERR_V(1U)
 935
 936#define FW_HELLO_CMD_INIT_S     30
 937#define FW_HELLO_CMD_INIT_V(x)  ((x) << FW_HELLO_CMD_INIT_S)
 938#define FW_HELLO_CMD_INIT_F     FW_HELLO_CMD_INIT_V(1U)
 939
 940#define FW_HELLO_CMD_MASTERDIS_S        29
 941#define FW_HELLO_CMD_MASTERDIS_V(x)     ((x) << FW_HELLO_CMD_MASTERDIS_S)
 942
 943#define FW_HELLO_CMD_MASTERFORCE_S      28
 944#define FW_HELLO_CMD_MASTERFORCE_V(x)   ((x) << FW_HELLO_CMD_MASTERFORCE_S)
 945
 946#define FW_HELLO_CMD_MBMASTER_S         24
 947#define FW_HELLO_CMD_MBMASTER_M         0xfU
 948#define FW_HELLO_CMD_MBMASTER_V(x)      ((x) << FW_HELLO_CMD_MBMASTER_S)
 949#define FW_HELLO_CMD_MBMASTER_G(x)      \
 950        (((x) >> FW_HELLO_CMD_MBMASTER_S) & FW_HELLO_CMD_MBMASTER_M)
 951
 952#define FW_HELLO_CMD_MBASYNCNOTINT_S    23
 953#define FW_HELLO_CMD_MBASYNCNOTINT_V(x) ((x) << FW_HELLO_CMD_MBASYNCNOTINT_S)
 954
 955#define FW_HELLO_CMD_MBASYNCNOT_S       20
 956#define FW_HELLO_CMD_MBASYNCNOT_V(x)    ((x) << FW_HELLO_CMD_MBASYNCNOT_S)
 957
 958#define FW_HELLO_CMD_STAGE_S            17
 959#define FW_HELLO_CMD_STAGE_V(x)         ((x) << FW_HELLO_CMD_STAGE_S)
 960
 961#define FW_HELLO_CMD_CLEARINIT_S        16
 962#define FW_HELLO_CMD_CLEARINIT_V(x)     ((x) << FW_HELLO_CMD_CLEARINIT_S)
 963#define FW_HELLO_CMD_CLEARINIT_F        FW_HELLO_CMD_CLEARINIT_V(1U)
 964
 965struct fw_bye_cmd {
 966        __be32 op_to_write;
 967        __be32 retval_len16;
 968        __be64 r3;
 969};
 970
 971struct fw_initialize_cmd {
 972        __be32 op_to_write;
 973        __be32 retval_len16;
 974        __be64 r3;
 975};
 976
 977enum fw_caps_config_hm {
 978        FW_CAPS_CONFIG_HM_PCIE          = 0x00000001,
 979        FW_CAPS_CONFIG_HM_PL            = 0x00000002,
 980        FW_CAPS_CONFIG_HM_SGE           = 0x00000004,
 981        FW_CAPS_CONFIG_HM_CIM           = 0x00000008,
 982        FW_CAPS_CONFIG_HM_ULPTX         = 0x00000010,
 983        FW_CAPS_CONFIG_HM_TP            = 0x00000020,
 984        FW_CAPS_CONFIG_HM_ULPRX         = 0x00000040,
 985        FW_CAPS_CONFIG_HM_PMRX          = 0x00000080,
 986        FW_CAPS_CONFIG_HM_PMTX          = 0x00000100,
 987        FW_CAPS_CONFIG_HM_MC            = 0x00000200,
 988        FW_CAPS_CONFIG_HM_LE            = 0x00000400,
 989        FW_CAPS_CONFIG_HM_MPS           = 0x00000800,
 990        FW_CAPS_CONFIG_HM_XGMAC         = 0x00001000,
 991        FW_CAPS_CONFIG_HM_CPLSWITCH     = 0x00002000,
 992        FW_CAPS_CONFIG_HM_T4DBG         = 0x00004000,
 993        FW_CAPS_CONFIG_HM_MI            = 0x00008000,
 994        FW_CAPS_CONFIG_HM_I2CM          = 0x00010000,
 995        FW_CAPS_CONFIG_HM_NCSI          = 0x00020000,
 996        FW_CAPS_CONFIG_HM_SMB           = 0x00040000,
 997        FW_CAPS_CONFIG_HM_MA            = 0x00080000,
 998        FW_CAPS_CONFIG_HM_EDRAM         = 0x00100000,
 999        FW_CAPS_CONFIG_HM_PMU           = 0x00200000,
1000        FW_CAPS_CONFIG_HM_UART          = 0x00400000,
1001        FW_CAPS_CONFIG_HM_SF            = 0x00800000,
1002};
1003
1004enum fw_caps_config_nbm {
1005        FW_CAPS_CONFIG_NBM_IPMI         = 0x00000001,
1006        FW_CAPS_CONFIG_NBM_NCSI         = 0x00000002,
1007};
1008
1009enum fw_caps_config_link {
1010        FW_CAPS_CONFIG_LINK_PPP         = 0x00000001,
1011        FW_CAPS_CONFIG_LINK_QFC         = 0x00000002,
1012        FW_CAPS_CONFIG_LINK_DCBX        = 0x00000004,
1013};
1014
1015enum fw_caps_config_switch {
1016        FW_CAPS_CONFIG_SWITCH_INGRESS   = 0x00000001,
1017        FW_CAPS_CONFIG_SWITCH_EGRESS    = 0x00000002,
1018};
1019
1020enum fw_caps_config_nic {
1021        FW_CAPS_CONFIG_NIC              = 0x00000001,
1022        FW_CAPS_CONFIG_NIC_VM           = 0x00000002,
1023};
1024
1025enum fw_caps_config_ofld {
1026        FW_CAPS_CONFIG_OFLD             = 0x00000001,
1027};
1028
1029enum fw_caps_config_rdma {
1030        FW_CAPS_CONFIG_RDMA_RDDP        = 0x00000001,
1031        FW_CAPS_CONFIG_RDMA_RDMAC       = 0x00000002,
1032};
1033
1034enum fw_caps_config_iscsi {
1035        FW_CAPS_CONFIG_ISCSI_INITIATOR_PDU = 0x00000001,
1036        FW_CAPS_CONFIG_ISCSI_TARGET_PDU = 0x00000002,
1037        FW_CAPS_CONFIG_ISCSI_INITIATOR_CNXOFLD = 0x00000004,
1038        FW_CAPS_CONFIG_ISCSI_TARGET_CNXOFLD = 0x00000008,
1039};
1040
1041enum fw_caps_config_fcoe {
1042        FW_CAPS_CONFIG_FCOE_INITIATOR   = 0x00000001,
1043        FW_CAPS_CONFIG_FCOE_TARGET      = 0x00000002,
1044        FW_CAPS_CONFIG_FCOE_CTRL_OFLD   = 0x00000004,
1045};
1046
1047enum fw_memtype_cf {
1048        FW_MEMTYPE_CF_EDC0              = 0x0,
1049        FW_MEMTYPE_CF_EDC1              = 0x1,
1050        FW_MEMTYPE_CF_EXTMEM            = 0x2,
1051        FW_MEMTYPE_CF_FLASH             = 0x4,
1052        FW_MEMTYPE_CF_INTERNAL          = 0x5,
1053        FW_MEMTYPE_CF_EXTMEM1           = 0x6,
1054};
1055
1056struct fw_caps_config_cmd {
1057        __be32 op_to_write;
1058        __be32 cfvalid_to_len16;
1059        __be32 r2;
1060        __be32 hwmbitmap;
1061        __be16 nbmcaps;
1062        __be16 linkcaps;
1063        __be16 switchcaps;
1064        __be16 r3;
1065        __be16 niccaps;
1066        __be16 ofldcaps;
1067        __be16 rdmacaps;
1068        __be16 cryptocaps;
1069        __be16 iscsicaps;
1070        __be16 fcoecaps;
1071        __be32 cfcsum;
1072        __be32 finiver;
1073        __be32 finicsum;
1074};
1075
1076#define FW_CAPS_CONFIG_CMD_CFVALID_S    27
1077#define FW_CAPS_CONFIG_CMD_CFVALID_V(x) ((x) << FW_CAPS_CONFIG_CMD_CFVALID_S)
1078#define FW_CAPS_CONFIG_CMD_CFVALID_F    FW_CAPS_CONFIG_CMD_CFVALID_V(1U)
1079
1080#define FW_CAPS_CONFIG_CMD_MEMTYPE_CF_S         24
1081#define FW_CAPS_CONFIG_CMD_MEMTYPE_CF_V(x)      \
1082        ((x) << FW_CAPS_CONFIG_CMD_MEMTYPE_CF_S)
1083
1084#define FW_CAPS_CONFIG_CMD_MEMADDR64K_CF_S      16
1085#define FW_CAPS_CONFIG_CMD_MEMADDR64K_CF_V(x)   \
1086        ((x) << FW_CAPS_CONFIG_CMD_MEMADDR64K_CF_S)
1087
1088/*
1089 * params command mnemonics
1090 */
1091enum fw_params_mnem {
1092        FW_PARAMS_MNEM_DEV              = 1,    /* device params */
1093        FW_PARAMS_MNEM_PFVF             = 2,    /* function params */
1094        FW_PARAMS_MNEM_REG              = 3,    /* limited register access */
1095        FW_PARAMS_MNEM_DMAQ             = 4,    /* dma queue params */
1096        FW_PARAMS_MNEM_CHNET            = 5,    /* chnet params */
1097        FW_PARAMS_MNEM_LAST
1098};
1099
1100/*
1101 * device parameters
1102 */
1103enum fw_params_param_dev {
1104        FW_PARAMS_PARAM_DEV_CCLK        = 0x00, /* chip core clock in khz */
1105        FW_PARAMS_PARAM_DEV_PORTVEC     = 0x01, /* the port vector */
1106        FW_PARAMS_PARAM_DEV_NTID        = 0x02, /* reads the number of TIDs
1107                                                 * allocated by the device's
1108                                                 * Lookup Engine
1109                                                 */
1110        FW_PARAMS_PARAM_DEV_FLOWC_BUFFIFO_SZ = 0x03,
1111        FW_PARAMS_PARAM_DEV_INTVER_NIC  = 0x04,
1112        FW_PARAMS_PARAM_DEV_INTVER_VNIC = 0x05,
1113        FW_PARAMS_PARAM_DEV_INTVER_OFLD = 0x06,
1114        FW_PARAMS_PARAM_DEV_INTVER_RI   = 0x07,
1115        FW_PARAMS_PARAM_DEV_INTVER_ISCSIPDU = 0x08,
1116        FW_PARAMS_PARAM_DEV_INTVER_ISCSI = 0x09,
1117        FW_PARAMS_PARAM_DEV_INTVER_FCOE = 0x0A,
1118        FW_PARAMS_PARAM_DEV_FWREV = 0x0B,
1119        FW_PARAMS_PARAM_DEV_TPREV = 0x0C,
1120        FW_PARAMS_PARAM_DEV_CF = 0x0D,
1121        FW_PARAMS_PARAM_DEV_PHYFW = 0x0F,
1122        FW_PARAMS_PARAM_DEV_DIAG = 0x11,
1123        FW_PARAMS_PARAM_DEV_MAXORDIRD_QP = 0x13, /* max supported QP IRD/ORD */
1124        FW_PARAMS_PARAM_DEV_MAXIRD_ADAPTER = 0x14, /* max supported adap IRD */
1125        FW_PARAMS_PARAM_DEV_ULPTX_MEMWRITE_DSGL = 0x17,
1126        FW_PARAMS_PARAM_DEV_FWCACHE = 0x18,
1127        FW_PARAMS_PARAM_DEV_SCFGREV = 0x1A,
1128        FW_PARAMS_PARAM_DEV_VPDREV = 0x1B,
1129        FW_PARAMS_PARAM_DEV_RI_FR_NSMR_TPTE_WR  = 0x1C,
1130        FW_PARAMS_PARAM_DEV_MPSBGMAP    = 0x1E,
1131};
1132
1133/*
1134 * physical and virtual function parameters
1135 */
1136enum fw_params_param_pfvf {
1137        FW_PARAMS_PARAM_PFVF_RWXCAPS    = 0x00,
1138        FW_PARAMS_PARAM_PFVF_ROUTE_START = 0x01,
1139        FW_PARAMS_PARAM_PFVF_ROUTE_END = 0x02,
1140        FW_PARAMS_PARAM_PFVF_CLIP_START = 0x03,
1141        FW_PARAMS_PARAM_PFVF_CLIP_END = 0x04,
1142        FW_PARAMS_PARAM_PFVF_FILTER_START = 0x05,
1143        FW_PARAMS_PARAM_PFVF_FILTER_END = 0x06,
1144        FW_PARAMS_PARAM_PFVF_SERVER_START = 0x07,
1145        FW_PARAMS_PARAM_PFVF_SERVER_END = 0x08,
1146        FW_PARAMS_PARAM_PFVF_TDDP_START = 0x09,
1147        FW_PARAMS_PARAM_PFVF_TDDP_END = 0x0A,
1148        FW_PARAMS_PARAM_PFVF_ISCSI_START = 0x0B,
1149        FW_PARAMS_PARAM_PFVF_ISCSI_END = 0x0C,
1150        FW_PARAMS_PARAM_PFVF_STAG_START = 0x0D,
1151        FW_PARAMS_PARAM_PFVF_STAG_END = 0x0E,
1152        FW_PARAMS_PARAM_PFVF_RQ_START = 0x1F,
1153        FW_PARAMS_PARAM_PFVF_RQ_END     = 0x10,
1154        FW_PARAMS_PARAM_PFVF_PBL_START = 0x11,
1155        FW_PARAMS_PARAM_PFVF_PBL_END    = 0x12,
1156        FW_PARAMS_PARAM_PFVF_L2T_START = 0x13,
1157        FW_PARAMS_PARAM_PFVF_L2T_END = 0x14,
1158        FW_PARAMS_PARAM_PFVF_SQRQ_START = 0x15,
1159        FW_PARAMS_PARAM_PFVF_SQRQ_END   = 0x16,
1160        FW_PARAMS_PARAM_PFVF_CQ_START   = 0x17,
1161        FW_PARAMS_PARAM_PFVF_CQ_END     = 0x18,
1162        FW_PARAMS_PARAM_PFVF_SCHEDCLASS_ETH = 0x20,
1163        FW_PARAMS_PARAM_PFVF_VIID       = 0x24,
1164        FW_PARAMS_PARAM_PFVF_CPMASK     = 0x25,
1165        FW_PARAMS_PARAM_PFVF_OCQ_START  = 0x26,
1166        FW_PARAMS_PARAM_PFVF_OCQ_END    = 0x27,
1167        FW_PARAMS_PARAM_PFVF_CONM_MAP   = 0x28,
1168        FW_PARAMS_PARAM_PFVF_IQFLINT_START = 0x29,
1169        FW_PARAMS_PARAM_PFVF_IQFLINT_END = 0x2A,
1170        FW_PARAMS_PARAM_PFVF_EQ_START   = 0x2B,
1171        FW_PARAMS_PARAM_PFVF_EQ_END     = 0x2C,
1172        FW_PARAMS_PARAM_PFVF_ACTIVE_FILTER_START = 0x2D,
1173        FW_PARAMS_PARAM_PFVF_ACTIVE_FILTER_END = 0x2E,
1174        FW_PARAMS_PARAM_PFVF_ETHOFLD_END = 0x30,
1175        FW_PARAMS_PARAM_PFVF_CPLFW4MSG_ENCAP = 0x31,
1176        FW_PARAMS_PARAM_PFVF_NCRYPTO_LOOKASIDE = 0x32
1177};
1178
1179/*
1180 * dma queue parameters
1181 */
1182enum fw_params_param_dmaq {
1183        FW_PARAMS_PARAM_DMAQ_IQ_DCAEN_DCACPU = 0x00,
1184        FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH = 0x01,
1185        FW_PARAMS_PARAM_DMAQ_EQ_CMPLIQID_MNGT = 0x10,
1186        FW_PARAMS_PARAM_DMAQ_EQ_CMPLIQID_CTRL = 0x11,
1187        FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH = 0x12,
1188        FW_PARAMS_PARAM_DMAQ_EQ_DCBPRIO_ETH = 0x13,
1189        FW_PARAMS_PARAM_DMAQ_CONM_CTXT = 0x20,
1190};
1191
1192enum fw_params_param_dev_phyfw {
1193        FW_PARAMS_PARAM_DEV_PHYFW_DOWNLOAD = 0x00,
1194        FW_PARAMS_PARAM_DEV_PHYFW_VERSION = 0x01,
1195};
1196
1197enum fw_params_param_dev_diag {
1198        FW_PARAM_DEV_DIAG_TMP           = 0x00,
1199        FW_PARAM_DEV_DIAG_VDD           = 0x01,
1200};
1201
1202enum fw_params_param_dev_fwcache {
1203        FW_PARAM_DEV_FWCACHE_FLUSH      = 0x00,
1204        FW_PARAM_DEV_FWCACHE_FLUSHINV   = 0x01,
1205};
1206
1207#define FW_PARAMS_MNEM_S        24
1208#define FW_PARAMS_MNEM_V(x)     ((x) << FW_PARAMS_MNEM_S)
1209
1210#define FW_PARAMS_PARAM_X_S     16
1211#define FW_PARAMS_PARAM_X_V(x)  ((x) << FW_PARAMS_PARAM_X_S)
1212
1213#define FW_PARAMS_PARAM_Y_S     8
1214#define FW_PARAMS_PARAM_Y_M     0xffU
1215#define FW_PARAMS_PARAM_Y_V(x)  ((x) << FW_PARAMS_PARAM_Y_S)
1216#define FW_PARAMS_PARAM_Y_G(x)  (((x) >> FW_PARAMS_PARAM_Y_S) &\
1217                FW_PARAMS_PARAM_Y_M)
1218
1219#define FW_PARAMS_PARAM_Z_S     0
1220#define FW_PARAMS_PARAM_Z_M     0xffu
1221#define FW_PARAMS_PARAM_Z_V(x)  ((x) << FW_PARAMS_PARAM_Z_S)
1222#define FW_PARAMS_PARAM_Z_G(x)  (((x) >> FW_PARAMS_PARAM_Z_S) &\
1223                FW_PARAMS_PARAM_Z_M)
1224
1225#define FW_PARAMS_PARAM_XYZ_S           0
1226#define FW_PARAMS_PARAM_XYZ_V(x)        ((x) << FW_PARAMS_PARAM_XYZ_S)
1227
1228#define FW_PARAMS_PARAM_YZ_S            0
1229#define FW_PARAMS_PARAM_YZ_V(x)         ((x) << FW_PARAMS_PARAM_YZ_S)
1230
1231struct fw_params_cmd {
1232        __be32 op_to_vfn;
1233        __be32 retval_len16;
1234        struct fw_params_param {
1235                __be32 mnem;
1236                __be32 val;
1237        } param[7];
1238};
1239
1240#define FW_PARAMS_CMD_PFN_S     8
1241#define FW_PARAMS_CMD_PFN_V(x)  ((x) << FW_PARAMS_CMD_PFN_S)
1242
1243#define FW_PARAMS_CMD_VFN_S     0
1244#define FW_PARAMS_CMD_VFN_V(x)  ((x) << FW_PARAMS_CMD_VFN_S)
1245
1246struct fw_pfvf_cmd {
1247        __be32 op_to_vfn;
1248        __be32 retval_len16;
1249        __be32 niqflint_niq;
1250        __be32 type_to_neq;
1251        __be32 tc_to_nexactf;
1252        __be32 r_caps_to_nethctrl;
1253        __be16 nricq;
1254        __be16 nriqp;
1255        __be32 r4;
1256};
1257
1258#define FW_PFVF_CMD_PFN_S       8
1259#define FW_PFVF_CMD_PFN_V(x)    ((x) << FW_PFVF_CMD_PFN_S)
1260
1261#define FW_PFVF_CMD_VFN_S       0
1262#define FW_PFVF_CMD_VFN_V(x)    ((x) << FW_PFVF_CMD_VFN_S)
1263
1264#define FW_PFVF_CMD_NIQFLINT_S          20
1265#define FW_PFVF_CMD_NIQFLINT_M          0xfff
1266#define FW_PFVF_CMD_NIQFLINT_V(x)       ((x) << FW_PFVF_CMD_NIQFLINT_S)
1267#define FW_PFVF_CMD_NIQFLINT_G(x)       \
1268        (((x) >> FW_PFVF_CMD_NIQFLINT_S) & FW_PFVF_CMD_NIQFLINT_M)
1269
1270#define FW_PFVF_CMD_NIQ_S       0
1271#define FW_PFVF_CMD_NIQ_M       0xfffff
1272#define FW_PFVF_CMD_NIQ_V(x)    ((x) << FW_PFVF_CMD_NIQ_S)
1273#define FW_PFVF_CMD_NIQ_G(x)    \
1274        (((x) >> FW_PFVF_CMD_NIQ_S) & FW_PFVF_CMD_NIQ_M)
1275
1276#define FW_PFVF_CMD_TYPE_S      31
1277#define FW_PFVF_CMD_TYPE_M      0x1
1278#define FW_PFVF_CMD_TYPE_V(x)   ((x) << FW_PFVF_CMD_TYPE_S)
1279#define FW_PFVF_CMD_TYPE_G(x)   \
1280        (((x) >> FW_PFVF_CMD_TYPE_S) & FW_PFVF_CMD_TYPE_M)
1281#define FW_PFVF_CMD_TYPE_F      FW_PFVF_CMD_TYPE_V(1U)
1282
1283#define FW_PFVF_CMD_CMASK_S     24
1284#define FW_PFVF_CMD_CMASK_M     0xf
1285#define FW_PFVF_CMD_CMASK_V(x)  ((x) << FW_PFVF_CMD_CMASK_S)
1286#define FW_PFVF_CMD_CMASK_G(x)  \
1287        (((x) >> FW_PFVF_CMD_CMASK_S) & FW_PFVF_CMD_CMASK_M)
1288
1289#define FW_PFVF_CMD_PMASK_S     20
1290#define FW_PFVF_CMD_PMASK_M     0xf
1291#define FW_PFVF_CMD_PMASK_V(x)  ((x) << FW_PFVF_CMD_PMASK_S)
1292#define FW_PFVF_CMD_PMASK_G(x) \
1293        (((x) >> FW_PFVF_CMD_PMASK_S) & FW_PFVF_CMD_PMASK_M)
1294
1295#define FW_PFVF_CMD_NEQ_S       0
1296#define FW_PFVF_CMD_NEQ_M       0xfffff
1297#define FW_PFVF_CMD_NEQ_V(x)    ((x) << FW_PFVF_CMD_NEQ_S)
1298#define FW_PFVF_CMD_NEQ_G(x)    \
1299        (((x) >> FW_PFVF_CMD_NEQ_S) & FW_PFVF_CMD_NEQ_M)
1300
1301#define FW_PFVF_CMD_TC_S        24
1302#define FW_PFVF_CMD_TC_M        0xff
1303#define FW_PFVF_CMD_TC_V(x)     ((x) << FW_PFVF_CMD_TC_S)
1304#define FW_PFVF_CMD_TC_G(x)     (((x) >> FW_PFVF_CMD_TC_S) & FW_PFVF_CMD_TC_M)
1305
1306#define FW_PFVF_CMD_NVI_S       16
1307#define FW_PFVF_CMD_NVI_M       0xff
1308#define FW_PFVF_CMD_NVI_V(x)    ((x) << FW_PFVF_CMD_NVI_S)
1309#define FW_PFVF_CMD_NVI_G(x)    (((x) >> FW_PFVF_CMD_NVI_S) & FW_PFVF_CMD_NVI_M)
1310
1311#define FW_PFVF_CMD_NEXACTF_S           0
1312#define FW_PFVF_CMD_NEXACTF_M           0xffff
1313#define FW_PFVF_CMD_NEXACTF_V(x)        ((x) << FW_PFVF_CMD_NEXACTF_S)
1314#define FW_PFVF_CMD_NEXACTF_G(x)        \
1315        (((x) >> FW_PFVF_CMD_NEXACTF_S) & FW_PFVF_CMD_NEXACTF_M)
1316
1317#define FW_PFVF_CMD_R_CAPS_S    24
1318#define FW_PFVF_CMD_R_CAPS_M    0xff
1319#define FW_PFVF_CMD_R_CAPS_V(x) ((x) << FW_PFVF_CMD_R_CAPS_S)
1320#define FW_PFVF_CMD_R_CAPS_G(x) \
1321        (((x) >> FW_PFVF_CMD_R_CAPS_S) & FW_PFVF_CMD_R_CAPS_M)
1322
1323#define FW_PFVF_CMD_WX_CAPS_S           16
1324#define FW_PFVF_CMD_WX_CAPS_M           0xff
1325#define FW_PFVF_CMD_WX_CAPS_V(x)        ((x) << FW_PFVF_CMD_WX_CAPS_S)
1326#define FW_PFVF_CMD_WX_CAPS_G(x)        \
1327        (((x) >> FW_PFVF_CMD_WX_CAPS_S) & FW_PFVF_CMD_WX_CAPS_M)
1328
1329#define FW_PFVF_CMD_NETHCTRL_S          0
1330#define FW_PFVF_CMD_NETHCTRL_M          0xffff
1331#define FW_PFVF_CMD_NETHCTRL_V(x)       ((x) << FW_PFVF_CMD_NETHCTRL_S)
1332#define FW_PFVF_CMD_NETHCTRL_G(x)       \
1333        (((x) >> FW_PFVF_CMD_NETHCTRL_S) & FW_PFVF_CMD_NETHCTRL_M)
1334
1335enum fw_iq_type {
1336        FW_IQ_TYPE_FL_INT_CAP,
1337        FW_IQ_TYPE_NO_FL_INT_CAP
1338};
1339
1340struct fw_iq_cmd {
1341        __be32 op_to_vfn;
1342        __be32 alloc_to_len16;
1343        __be16 physiqid;
1344        __be16 iqid;
1345        __be16 fl0id;
1346        __be16 fl1id;
1347        __be32 type_to_iqandstindex;
1348        __be16 iqdroprss_to_iqesize;
1349        __be16 iqsize;
1350        __be64 iqaddr;
1351        __be32 iqns_to_fl0congen;
1352        __be16 fl0dcaen_to_fl0cidxfthresh;
1353        __be16 fl0size;
1354        __be64 fl0addr;
1355        __be32 fl1cngchmap_to_fl1congen;
1356        __be16 fl1dcaen_to_fl1cidxfthresh;
1357        __be16 fl1size;
1358        __be64 fl1addr;
1359};
1360
1361#define FW_IQ_CMD_PFN_S         8
1362#define FW_IQ_CMD_PFN_V(x)      ((x) << FW_IQ_CMD_PFN_S)
1363
1364#define FW_IQ_CMD_VFN_S         0
1365#define FW_IQ_CMD_VFN_V(x)      ((x) << FW_IQ_CMD_VFN_S)
1366
1367#define FW_IQ_CMD_ALLOC_S       31
1368#define FW_IQ_CMD_ALLOC_V(x)    ((x) << FW_IQ_CMD_ALLOC_S)
1369#define FW_IQ_CMD_ALLOC_F       FW_IQ_CMD_ALLOC_V(1U)
1370
1371#define FW_IQ_CMD_FREE_S        30
1372#define FW_IQ_CMD_FREE_V(x)     ((x) << FW_IQ_CMD_FREE_S)
1373#define FW_IQ_CMD_FREE_F        FW_IQ_CMD_FREE_V(1U)
1374
1375#define FW_IQ_CMD_MODIFY_S      29
1376#define FW_IQ_CMD_MODIFY_V(x)   ((x) << FW_IQ_CMD_MODIFY_S)
1377#define FW_IQ_CMD_MODIFY_F      FW_IQ_CMD_MODIFY_V(1U)
1378
1379#define FW_IQ_CMD_IQSTART_S     28
1380#define FW_IQ_CMD_IQSTART_V(x)  ((x) << FW_IQ_CMD_IQSTART_S)
1381#define FW_IQ_CMD_IQSTART_F     FW_IQ_CMD_IQSTART_V(1U)
1382
1383#define FW_IQ_CMD_IQSTOP_S      27
1384#define FW_IQ_CMD_IQSTOP_V(x)   ((x) << FW_IQ_CMD_IQSTOP_S)
1385#define FW_IQ_CMD_IQSTOP_F      FW_IQ_CMD_IQSTOP_V(1U)
1386
1387#define FW_IQ_CMD_TYPE_S        29
1388#define FW_IQ_CMD_TYPE_V(x)     ((x) << FW_IQ_CMD_TYPE_S)
1389
1390#define FW_IQ_CMD_IQASYNCH_S    28
1391#define FW_IQ_CMD_IQASYNCH_V(x) ((x) << FW_IQ_CMD_IQASYNCH_S)
1392
1393#define FW_IQ_CMD_VIID_S        16
1394#define FW_IQ_CMD_VIID_V(x)     ((x) << FW_IQ_CMD_VIID_S)
1395
1396#define FW_IQ_CMD_IQANDST_S     15
1397#define FW_IQ_CMD_IQANDST_V(x)  ((x) << FW_IQ_CMD_IQANDST_S)
1398
1399#define FW_IQ_CMD_IQANUS_S      14
1400#define FW_IQ_CMD_IQANUS_V(x)   ((x) << FW_IQ_CMD_IQANUS_S)
1401
1402#define FW_IQ_CMD_IQANUD_S      12
1403#define FW_IQ_CMD_IQANUD_V(x)   ((x) << FW_IQ_CMD_IQANUD_S)
1404
1405#define FW_IQ_CMD_IQANDSTINDEX_S        0
1406#define FW_IQ_CMD_IQANDSTINDEX_V(x)     ((x) << FW_IQ_CMD_IQANDSTINDEX_S)
1407
1408#define FW_IQ_CMD_IQDROPRSS_S           15
1409#define FW_IQ_CMD_IQDROPRSS_V(x)        ((x) << FW_IQ_CMD_IQDROPRSS_S)
1410#define FW_IQ_CMD_IQDROPRSS_F   FW_IQ_CMD_IQDROPRSS_V(1U)
1411
1412#define FW_IQ_CMD_IQGTSMODE_S           14
1413#define FW_IQ_CMD_IQGTSMODE_V(x)        ((x) << FW_IQ_CMD_IQGTSMODE_S)
1414#define FW_IQ_CMD_IQGTSMODE_F           FW_IQ_CMD_IQGTSMODE_V(1U)
1415
1416#define FW_IQ_CMD_IQPCIECH_S    12
1417#define FW_IQ_CMD_IQPCIECH_V(x) ((x) << FW_IQ_CMD_IQPCIECH_S)
1418
1419#define FW_IQ_CMD_IQDCAEN_S     11
1420#define FW_IQ_CMD_IQDCAEN_V(x)  ((x) << FW_IQ_CMD_IQDCAEN_S)
1421
1422#define FW_IQ_CMD_IQDCACPU_S    6
1423#define FW_IQ_CMD_IQDCACPU_V(x) ((x) << FW_IQ_CMD_IQDCACPU_S)
1424
1425#define FW_IQ_CMD_IQINTCNTTHRESH_S      4
1426#define FW_IQ_CMD_IQINTCNTTHRESH_V(x)   ((x) << FW_IQ_CMD_IQINTCNTTHRESH_S)
1427
1428#define FW_IQ_CMD_IQO_S         3
1429#define FW_IQ_CMD_IQO_V(x)      ((x) << FW_IQ_CMD_IQO_S)
1430#define FW_IQ_CMD_IQO_F         FW_IQ_CMD_IQO_V(1U)
1431
1432#define FW_IQ_CMD_IQCPRIO_S     2
1433#define FW_IQ_CMD_IQCPRIO_V(x)  ((x) << FW_IQ_CMD_IQCPRIO_S)
1434
1435#define FW_IQ_CMD_IQESIZE_S     0
1436#define FW_IQ_CMD_IQESIZE_V(x)  ((x) << FW_IQ_CMD_IQESIZE_S)
1437
1438#define FW_IQ_CMD_IQNS_S        31
1439#define FW_IQ_CMD_IQNS_V(x)     ((x) << FW_IQ_CMD_IQNS_S)
1440
1441#define FW_IQ_CMD_IQRO_S        30
1442#define FW_IQ_CMD_IQRO_V(x)     ((x) << FW_IQ_CMD_IQRO_S)
1443
1444#define FW_IQ_CMD_IQFLINTIQHSEN_S       28
1445#define FW_IQ_CMD_IQFLINTIQHSEN_V(x)    ((x) << FW_IQ_CMD_IQFLINTIQHSEN_S)
1446
1447#define FW_IQ_CMD_IQFLINTCONGEN_S       27
1448#define FW_IQ_CMD_IQFLINTCONGEN_V(x)    ((x) << FW_IQ_CMD_IQFLINTCONGEN_S)
1449#define FW_IQ_CMD_IQFLINTCONGEN_F       FW_IQ_CMD_IQFLINTCONGEN_V(1U)
1450
1451#define FW_IQ_CMD_IQFLINTISCSIC_S       26
1452#define FW_IQ_CMD_IQFLINTISCSIC_V(x)    ((x) << FW_IQ_CMD_IQFLINTISCSIC_S)
1453
1454#define FW_IQ_CMD_FL0CNGCHMAP_S         20
1455#define FW_IQ_CMD_FL0CNGCHMAP_V(x)      ((x) << FW_IQ_CMD_FL0CNGCHMAP_S)
1456
1457#define FW_IQ_CMD_FL0CACHELOCK_S        15
1458#define FW_IQ_CMD_FL0CACHELOCK_V(x)     ((x) << FW_IQ_CMD_FL0CACHELOCK_S)
1459
1460#define FW_IQ_CMD_FL0DBP_S      14
1461#define FW_IQ_CMD_FL0DBP_V(x)   ((x) << FW_IQ_CMD_FL0DBP_S)
1462
1463#define FW_IQ_CMD_FL0DATANS_S           13
1464#define FW_IQ_CMD_FL0DATANS_V(x)        ((x) << FW_IQ_CMD_FL0DATANS_S)
1465
1466#define FW_IQ_CMD_FL0DATARO_S           12
1467#define FW_IQ_CMD_FL0DATARO_V(x)        ((x) << FW_IQ_CMD_FL0DATARO_S)
1468#define FW_IQ_CMD_FL0DATARO_F           FW_IQ_CMD_FL0DATARO_V(1U)
1469
1470#define FW_IQ_CMD_FL0CONGCIF_S          11
1471#define FW_IQ_CMD_FL0CONGCIF_V(x)       ((x) << FW_IQ_CMD_FL0CONGCIF_S)
1472#define FW_IQ_CMD_FL0CONGCIF_F          FW_IQ_CMD_FL0CONGCIF_V(1U)
1473
1474#define FW_IQ_CMD_FL0ONCHIP_S           10
1475#define FW_IQ_CMD_FL0ONCHIP_V(x)        ((x) << FW_IQ_CMD_FL0ONCHIP_S)
1476
1477#define FW_IQ_CMD_FL0STATUSPGNS_S       9
1478#define FW_IQ_CMD_FL0STATUSPGNS_V(x)    ((x) << FW_IQ_CMD_FL0STATUSPGNS_S)
1479
1480#define FW_IQ_CMD_FL0STATUSPGRO_S       8
1481#define FW_IQ_CMD_FL0STATUSPGRO_V(x)    ((x) << FW_IQ_CMD_FL0STATUSPGRO_S)
1482
1483#define FW_IQ_CMD_FL0FETCHNS_S          7
1484#define FW_IQ_CMD_FL0FETCHNS_V(x)       ((x) << FW_IQ_CMD_FL0FETCHNS_S)
1485
1486#define FW_IQ_CMD_FL0FETCHRO_S          6
1487#define FW_IQ_CMD_FL0FETCHRO_V(x)       ((x) << FW_IQ_CMD_FL0FETCHRO_S)
1488#define FW_IQ_CMD_FL0FETCHRO_F          FW_IQ_CMD_FL0FETCHRO_V(1U)
1489
1490#define FW_IQ_CMD_FL0HOSTFCMODE_S       4
1491#define FW_IQ_CMD_FL0HOSTFCMODE_V(x)    ((x) << FW_IQ_CMD_FL0HOSTFCMODE_S)
1492
1493#define FW_IQ_CMD_FL0CPRIO_S    3
1494#define FW_IQ_CMD_FL0CPRIO_V(x) ((x) << FW_IQ_CMD_FL0CPRIO_S)
1495
1496#define FW_IQ_CMD_FL0PADEN_S    2
1497#define FW_IQ_CMD_FL0PADEN_V(x) ((x) << FW_IQ_CMD_FL0PADEN_S)
1498#define FW_IQ_CMD_FL0PADEN_F    FW_IQ_CMD_FL0PADEN_V(1U)
1499
1500#define FW_IQ_CMD_FL0PACKEN_S           1
1501#define FW_IQ_CMD_FL0PACKEN_V(x)        ((x) << FW_IQ_CMD_FL0PACKEN_S)
1502#define FW_IQ_CMD_FL0PACKEN_F           FW_IQ_CMD_FL0PACKEN_V(1U)
1503
1504#define FW_IQ_CMD_FL0CONGEN_S           0
1505#define FW_IQ_CMD_FL0CONGEN_V(x)        ((x) << FW_IQ_CMD_FL0CONGEN_S)
1506#define FW_IQ_CMD_FL0CONGEN_F           FW_IQ_CMD_FL0CONGEN_V(1U)
1507
1508#define FW_IQ_CMD_FL0DCAEN_S    15
1509#define FW_IQ_CMD_FL0DCAEN_V(x) ((x) << FW_IQ_CMD_FL0DCAEN_S)
1510
1511#define FW_IQ_CMD_FL0DCACPU_S           10
1512#define FW_IQ_CMD_FL0DCACPU_V(x)        ((x) << FW_IQ_CMD_FL0DCACPU_S)
1513
1514#define FW_IQ_CMD_FL0FBMIN_S    7
1515#define FW_IQ_CMD_FL0FBMIN_V(x) ((x) << FW_IQ_CMD_FL0FBMIN_S)
1516
1517#define FW_IQ_CMD_FL0FBMAX_S    4
1518#define FW_IQ_CMD_FL0FBMAX_V(x) ((x) << FW_IQ_CMD_FL0FBMAX_S)
1519
1520#define FW_IQ_CMD_FL0CIDXFTHRESHO_S     3
1521#define FW_IQ_CMD_FL0CIDXFTHRESHO_V(x)  ((x) << FW_IQ_CMD_FL0CIDXFTHRESHO_S)
1522#define FW_IQ_CMD_FL0CIDXFTHRESHO_F     FW_IQ_CMD_FL0CIDXFTHRESHO_V(1U)
1523
1524#define FW_IQ_CMD_FL0CIDXFTHRESH_S      0
1525#define FW_IQ_CMD_FL0CIDXFTHRESH_V(x)   ((x) << FW_IQ_CMD_FL0CIDXFTHRESH_S)
1526
1527#define FW_IQ_CMD_FL1CNGCHMAP_S         20
1528#define FW_IQ_CMD_FL1CNGCHMAP_V(x)      ((x) << FW_IQ_CMD_FL1CNGCHMAP_S)
1529
1530#define FW_IQ_CMD_FL1CACHELOCK_S        15
1531#define FW_IQ_CMD_FL1CACHELOCK_V(x)     ((x) << FW_IQ_CMD_FL1CACHELOCK_S)
1532
1533#define FW_IQ_CMD_FL1DBP_S      14
1534#define FW_IQ_CMD_FL1DBP_V(x)   ((x) << FW_IQ_CMD_FL1DBP_S)
1535
1536#define FW_IQ_CMD_FL1DATANS_S           13
1537#define FW_IQ_CMD_FL1DATANS_V(x)        ((x) << FW_IQ_CMD_FL1DATANS_S)
1538
1539#define FW_IQ_CMD_FL1DATARO_S           12
1540#define FW_IQ_CMD_FL1DATARO_V(x)        ((x) << FW_IQ_CMD_FL1DATARO_S)
1541
1542#define FW_IQ_CMD_FL1CONGCIF_S          11
1543#define FW_IQ_CMD_FL1CONGCIF_V(x)       ((x) << FW_IQ_CMD_FL1CONGCIF_S)
1544
1545#define FW_IQ_CMD_FL1ONCHIP_S           10
1546#define FW_IQ_CMD_FL1ONCHIP_V(x)        ((x) << FW_IQ_CMD_FL1ONCHIP_S)
1547
1548#define FW_IQ_CMD_FL1STATUSPGNS_S       9
1549#define FW_IQ_CMD_FL1STATUSPGNS_V(x)    ((x) << FW_IQ_CMD_FL1STATUSPGNS_S)
1550
1551#define FW_IQ_CMD_FL1STATUSPGRO_S       8
1552#define FW_IQ_CMD_FL1STATUSPGRO_V(x)    ((x) << FW_IQ_CMD_FL1STATUSPGRO_S)
1553
1554#define FW_IQ_CMD_FL1FETCHNS_S          7
1555#define FW_IQ_CMD_FL1FETCHNS_V(x)       ((x) << FW_IQ_CMD_FL1FETCHNS_S)
1556
1557#define FW_IQ_CMD_FL1FETCHRO_S          6
1558#define FW_IQ_CMD_FL1FETCHRO_V(x)       ((x) << FW_IQ_CMD_FL1FETCHRO_S)
1559
1560#define FW_IQ_CMD_FL1HOSTFCMODE_S       4
1561#define FW_IQ_CMD_FL1HOSTFCMODE_V(x)    ((x) << FW_IQ_CMD_FL1HOSTFCMODE_S)
1562
1563#define FW_IQ_CMD_FL1CPRIO_S    3
1564#define FW_IQ_CMD_FL1CPRIO_V(x) ((x) << FW_IQ_CMD_FL1CPRIO_S)
1565
1566#define FW_IQ_CMD_FL1PADEN_S    2
1567#define FW_IQ_CMD_FL1PADEN_V(x) ((x) << FW_IQ_CMD_FL1PADEN_S)
1568#define FW_IQ_CMD_FL1PADEN_F    FW_IQ_CMD_FL1PADEN_V(1U)
1569
1570#define FW_IQ_CMD_FL1PACKEN_S           1
1571#define FW_IQ_CMD_FL1PACKEN_V(x)        ((x) << FW_IQ_CMD_FL1PACKEN_S)
1572#define FW_IQ_CMD_FL1PACKEN_F   FW_IQ_CMD_FL1PACKEN_V(1U)
1573
1574#define FW_IQ_CMD_FL1CONGEN_S           0
1575#define FW_IQ_CMD_FL1CONGEN_V(x)        ((x) << FW_IQ_CMD_FL1CONGEN_S)
1576#define FW_IQ_CMD_FL1CONGEN_F   FW_IQ_CMD_FL1CONGEN_V(1U)
1577
1578#define FW_IQ_CMD_FL1DCAEN_S    15
1579#define FW_IQ_CMD_FL1DCAEN_V(x) ((x) << FW_IQ_CMD_FL1DCAEN_S)
1580
1581#define FW_IQ_CMD_FL1DCACPU_S           10
1582#define FW_IQ_CMD_FL1DCACPU_V(x)        ((x) << FW_IQ_CMD_FL1DCACPU_S)
1583
1584#define FW_IQ_CMD_FL1FBMIN_S    7
1585#define FW_IQ_CMD_FL1FBMIN_V(x) ((x) << FW_IQ_CMD_FL1FBMIN_S)
1586
1587#define FW_IQ_CMD_FL1FBMAX_S    4
1588#define FW_IQ_CMD_FL1FBMAX_V(x) ((x) << FW_IQ_CMD_FL1FBMAX_S)
1589
1590#define FW_IQ_CMD_FL1CIDXFTHRESHO_S     3
1591#define FW_IQ_CMD_FL1CIDXFTHRESHO_V(x)  ((x) << FW_IQ_CMD_FL1CIDXFTHRESHO_S)
1592#define FW_IQ_CMD_FL1CIDXFTHRESHO_F     FW_IQ_CMD_FL1CIDXFTHRESHO_V(1U)
1593
1594#define FW_IQ_CMD_FL1CIDXFTHRESH_S      0
1595#define FW_IQ_CMD_FL1CIDXFTHRESH_V(x)   ((x) << FW_IQ_CMD_FL1CIDXFTHRESH_S)
1596
1597struct fw_eq_eth_cmd {
1598        __be32 op_to_vfn;
1599        __be32 alloc_to_len16;
1600        __be32 eqid_pkd;
1601        __be32 physeqid_pkd;
1602        __be32 fetchszm_to_iqid;
1603        __be32 dcaen_to_eqsize;
1604        __be64 eqaddr;
1605        __be32 viid_pkd;
1606        __be32 r8_lo;
1607        __be64 r9;
1608};
1609
1610#define FW_EQ_ETH_CMD_PFN_S     8
1611#define FW_EQ_ETH_CMD_PFN_V(x)  ((x) << FW_EQ_ETH_CMD_PFN_S)
1612
1613#define FW_EQ_ETH_CMD_VFN_S     0
1614#define FW_EQ_ETH_CMD_VFN_V(x)  ((x) << FW_EQ_ETH_CMD_VFN_S)
1615
1616#define FW_EQ_ETH_CMD_ALLOC_S           31
1617#define FW_EQ_ETH_CMD_ALLOC_V(x)        ((x) << FW_EQ_ETH_CMD_ALLOC_S)
1618#define FW_EQ_ETH_CMD_ALLOC_F   FW_EQ_ETH_CMD_ALLOC_V(1U)
1619
1620#define FW_EQ_ETH_CMD_FREE_S    30
1621#define FW_EQ_ETH_CMD_FREE_V(x) ((x) << FW_EQ_ETH_CMD_FREE_S)
1622#define FW_EQ_ETH_CMD_FREE_F    FW_EQ_ETH_CMD_FREE_V(1U)
1623
1624#define FW_EQ_ETH_CMD_MODIFY_S          29
1625#define FW_EQ_ETH_CMD_MODIFY_V(x)       ((x) << FW_EQ_ETH_CMD_MODIFY_S)
1626#define FW_EQ_ETH_CMD_MODIFY_F  FW_EQ_ETH_CMD_MODIFY_V(1U)
1627
1628#define FW_EQ_ETH_CMD_EQSTART_S         28
1629#define FW_EQ_ETH_CMD_EQSTART_V(x)      ((x) << FW_EQ_ETH_CMD_EQSTART_S)
1630#define FW_EQ_ETH_CMD_EQSTART_F FW_EQ_ETH_CMD_EQSTART_V(1U)
1631
1632#define FW_EQ_ETH_CMD_EQSTOP_S          27
1633#define FW_EQ_ETH_CMD_EQSTOP_V(x)       ((x) << FW_EQ_ETH_CMD_EQSTOP_S)
1634#define FW_EQ_ETH_CMD_EQSTOP_F  FW_EQ_ETH_CMD_EQSTOP_V(1U)
1635
1636#define FW_EQ_ETH_CMD_EQID_S    0
1637#define FW_EQ_ETH_CMD_EQID_M    0xfffff
1638#define FW_EQ_ETH_CMD_EQID_V(x) ((x) << FW_EQ_ETH_CMD_EQID_S)
1639#define FW_EQ_ETH_CMD_EQID_G(x) \
1640        (((x) >> FW_EQ_ETH_CMD_EQID_S) & FW_EQ_ETH_CMD_EQID_M)
1641
1642#define FW_EQ_ETH_CMD_PHYSEQID_S        0
1643#define FW_EQ_ETH_CMD_PHYSEQID_M        0xfffff
1644#define FW_EQ_ETH_CMD_PHYSEQID_V(x)     ((x) << FW_EQ_ETH_CMD_PHYSEQID_S)
1645#define FW_EQ_ETH_CMD_PHYSEQID_G(x)     \
1646        (((x) >> FW_EQ_ETH_CMD_PHYSEQID_S) & FW_EQ_ETH_CMD_PHYSEQID_M)
1647
1648#define FW_EQ_ETH_CMD_FETCHSZM_S        26
1649#define FW_EQ_ETH_CMD_FETCHSZM_V(x)     ((x) << FW_EQ_ETH_CMD_FETCHSZM_S)
1650#define FW_EQ_ETH_CMD_FETCHSZM_F        FW_EQ_ETH_CMD_FETCHSZM_V(1U)
1651
1652#define FW_EQ_ETH_CMD_STATUSPGNS_S      25
1653#define FW_EQ_ETH_CMD_STATUSPGNS_V(x)   ((x) << FW_EQ_ETH_CMD_STATUSPGNS_S)
1654
1655#define FW_EQ_ETH_CMD_STATUSPGRO_S      24
1656#define FW_EQ_ETH_CMD_STATUSPGRO_V(x)   ((x) << FW_EQ_ETH_CMD_STATUSPGRO_S)
1657
1658#define FW_EQ_ETH_CMD_FETCHNS_S         23
1659#define FW_EQ_ETH_CMD_FETCHNS_V(x)      ((x) << FW_EQ_ETH_CMD_FETCHNS_S)
1660
1661#define FW_EQ_ETH_CMD_FETCHRO_S         22
1662#define FW_EQ_ETH_CMD_FETCHRO_V(x)      ((x) << FW_EQ_ETH_CMD_FETCHRO_S)
1663#define FW_EQ_ETH_CMD_FETCHRO_F         FW_EQ_ETH_CMD_FETCHRO_V(1U)
1664
1665#define FW_EQ_ETH_CMD_HOSTFCMODE_S      20
1666#define FW_EQ_ETH_CMD_HOSTFCMODE_V(x)   ((x) << FW_EQ_ETH_CMD_HOSTFCMODE_S)
1667
1668#define FW_EQ_ETH_CMD_CPRIO_S           19
1669#define FW_EQ_ETH_CMD_CPRIO_V(x)        ((x) << FW_EQ_ETH_CMD_CPRIO_S)
1670
1671#define FW_EQ_ETH_CMD_ONCHIP_S          18
1672#define FW_EQ_ETH_CMD_ONCHIP_V(x)       ((x) << FW_EQ_ETH_CMD_ONCHIP_S)
1673
1674#define FW_EQ_ETH_CMD_PCIECHN_S         16
1675#define FW_EQ_ETH_CMD_PCIECHN_V(x)      ((x) << FW_EQ_ETH_CMD_PCIECHN_S)
1676
1677#define FW_EQ_ETH_CMD_IQID_S    0
1678#define FW_EQ_ETH_CMD_IQID_V(x) ((x) << FW_EQ_ETH_CMD_IQID_S)
1679
1680#define FW_EQ_ETH_CMD_DCAEN_S           31
1681#define FW_EQ_ETH_CMD_DCAEN_V(x)        ((x) << FW_EQ_ETH_CMD_DCAEN_S)
1682
1683#define FW_EQ_ETH_CMD_DCACPU_S          26
1684#define FW_EQ_ETH_CMD_DCACPU_V(x)       ((x) << FW_EQ_ETH_CMD_DCACPU_S)
1685
1686#define FW_EQ_ETH_CMD_FBMIN_S           23
1687#define FW_EQ_ETH_CMD_FBMIN_V(x)        ((x) << FW_EQ_ETH_CMD_FBMIN_S)
1688
1689#define FW_EQ_ETH_CMD_FBMAX_S           20
1690#define FW_EQ_ETH_CMD_FBMAX_V(x)        ((x) << FW_EQ_ETH_CMD_FBMAX_S)
1691
1692#define FW_EQ_ETH_CMD_CIDXFTHRESHO_S    19
1693#define FW_EQ_ETH_CMD_CIDXFTHRESHO_V(x) ((x) << FW_EQ_ETH_CMD_CIDXFTHRESHO_S)
1694
1695#define FW_EQ_ETH_CMD_CIDXFTHRESH_S     16
1696#define FW_EQ_ETH_CMD_CIDXFTHRESH_V(x)  ((x) << FW_EQ_ETH_CMD_CIDXFTHRESH_S)
1697
1698#define FW_EQ_ETH_CMD_EQSIZE_S          0
1699#define FW_EQ_ETH_CMD_EQSIZE_V(x)       ((x) << FW_EQ_ETH_CMD_EQSIZE_S)
1700
1701#define FW_EQ_ETH_CMD_AUTOEQUEQE_S      30
1702#define FW_EQ_ETH_CMD_AUTOEQUEQE_V(x)   ((x) << FW_EQ_ETH_CMD_AUTOEQUEQE_S)
1703#define FW_EQ_ETH_CMD_AUTOEQUEQE_F      FW_EQ_ETH_CMD_AUTOEQUEQE_V(1U)
1704
1705#define FW_EQ_ETH_CMD_VIID_S    16
1706#define FW_EQ_ETH_CMD_VIID_V(x) ((x) << FW_EQ_ETH_CMD_VIID_S)
1707
1708struct fw_eq_ctrl_cmd {
1709        __be32 op_to_vfn;
1710        __be32 alloc_to_len16;
1711        __be32 cmpliqid_eqid;
1712        __be32 physeqid_pkd;
1713        __be32 fetchszm_to_iqid;
1714        __be32 dcaen_to_eqsize;
1715        __be64 eqaddr;
1716};
1717
1718#define FW_EQ_CTRL_CMD_PFN_S    8
1719#define FW_EQ_CTRL_CMD_PFN_V(x) ((x) << FW_EQ_CTRL_CMD_PFN_S)
1720
1721#define FW_EQ_CTRL_CMD_VFN_S    0
1722#define FW_EQ_CTRL_CMD_VFN_V(x) ((x) << FW_EQ_CTRL_CMD_VFN_S)
1723
1724#define FW_EQ_CTRL_CMD_ALLOC_S          31
1725#define FW_EQ_CTRL_CMD_ALLOC_V(x)       ((x) << FW_EQ_CTRL_CMD_ALLOC_S)
1726#define FW_EQ_CTRL_CMD_ALLOC_F          FW_EQ_CTRL_CMD_ALLOC_V(1U)
1727
1728#define FW_EQ_CTRL_CMD_FREE_S           30
1729#define FW_EQ_CTRL_CMD_FREE_V(x)        ((x) << FW_EQ_CTRL_CMD_FREE_S)
1730#define FW_EQ_CTRL_CMD_FREE_F           FW_EQ_CTRL_CMD_FREE_V(1U)
1731
1732#define FW_EQ_CTRL_CMD_MODIFY_S         29
1733#define FW_EQ_CTRL_CMD_MODIFY_V(x)      ((x) << FW_EQ_CTRL_CMD_MODIFY_S)
1734#define FW_EQ_CTRL_CMD_MODIFY_F         FW_EQ_CTRL_CMD_MODIFY_V(1U)
1735
1736#define FW_EQ_CTRL_CMD_EQSTART_S        28
1737#define FW_EQ_CTRL_CMD_EQSTART_V(x)     ((x) << FW_EQ_CTRL_CMD_EQSTART_S)
1738#define FW_EQ_CTRL_CMD_EQSTART_F        FW_EQ_CTRL_CMD_EQSTART_V(1U)
1739
1740#define FW_EQ_CTRL_CMD_EQSTOP_S         27
1741#define FW_EQ_CTRL_CMD_EQSTOP_V(x)      ((x) << FW_EQ_CTRL_CMD_EQSTOP_S)
1742#define FW_EQ_CTRL_CMD_EQSTOP_F         FW_EQ_CTRL_CMD_EQSTOP_V(1U)
1743
1744#define FW_EQ_CTRL_CMD_CMPLIQID_S       20
1745#define FW_EQ_CTRL_CMD_CMPLIQID_V(x)    ((x) << FW_EQ_CTRL_CMD_CMPLIQID_S)
1746
1747#define FW_EQ_CTRL_CMD_EQID_S           0
1748#define FW_EQ_CTRL_CMD_EQID_M           0xfffff
1749#define FW_EQ_CTRL_CMD_EQID_V(x)        ((x) << FW_EQ_CTRL_CMD_EQID_S)
1750#define FW_EQ_CTRL_CMD_EQID_G(x)        \
1751        (((x) >> FW_EQ_CTRL_CMD_EQID_S) & FW_EQ_CTRL_CMD_EQID_M)
1752
1753#define FW_EQ_CTRL_CMD_PHYSEQID_S       0
1754#define FW_EQ_CTRL_CMD_PHYSEQID_M       0xfffff
1755#define FW_EQ_CTRL_CMD_PHYSEQID_G(x)    \
1756        (((x) >> FW_EQ_CTRL_CMD_PHYSEQID_S) & FW_EQ_CTRL_CMD_PHYSEQID_M)
1757
1758#define FW_EQ_CTRL_CMD_FETCHSZM_S       26
1759#define FW_EQ_CTRL_CMD_FETCHSZM_V(x)    ((x) << FW_EQ_CTRL_CMD_FETCHSZM_S)
1760#define FW_EQ_CTRL_CMD_FETCHSZM_F       FW_EQ_CTRL_CMD_FETCHSZM_V(1U)
1761
1762#define FW_EQ_CTRL_CMD_STATUSPGNS_S     25
1763#define FW_EQ_CTRL_CMD_STATUSPGNS_V(x)  ((x) << FW_EQ_CTRL_CMD_STATUSPGNS_S)
1764#define FW_EQ_CTRL_CMD_STATUSPGNS_F     FW_EQ_CTRL_CMD_STATUSPGNS_V(1U)
1765
1766#define FW_EQ_CTRL_CMD_STATUSPGRO_S     24
1767#define FW_EQ_CTRL_CMD_STATUSPGRO_V(x)  ((x) << FW_EQ_CTRL_CMD_STATUSPGRO_S)
1768#define FW_EQ_CTRL_CMD_STATUSPGRO_F     FW_EQ_CTRL_CMD_STATUSPGRO_V(1U)
1769
1770#define FW_EQ_CTRL_CMD_FETCHNS_S        23
1771#define FW_EQ_CTRL_CMD_FETCHNS_V(x)     ((x) << FW_EQ_CTRL_CMD_FETCHNS_S)
1772#define FW_EQ_CTRL_CMD_FETCHNS_F        FW_EQ_CTRL_CMD_FETCHNS_V(1U)
1773
1774#define FW_EQ_CTRL_CMD_FETCHRO_S        22
1775#define FW_EQ_CTRL_CMD_FETCHRO_V(x)     ((x) << FW_EQ_CTRL_CMD_FETCHRO_S)
1776#define FW_EQ_CTRL_CMD_FETCHRO_F        FW_EQ_CTRL_CMD_FETCHRO_V(1U)
1777
1778#define FW_EQ_CTRL_CMD_HOSTFCMODE_S     20
1779#define FW_EQ_CTRL_CMD_HOSTFCMODE_V(x)  ((x) << FW_EQ_CTRL_CMD_HOSTFCMODE_S)
1780
1781#define FW_EQ_CTRL_CMD_CPRIO_S          19
1782#define FW_EQ_CTRL_CMD_CPRIO_V(x)       ((x) << FW_EQ_CTRL_CMD_CPRIO_S)
1783
1784#define FW_EQ_CTRL_CMD_ONCHIP_S         18
1785#define FW_EQ_CTRL_CMD_ONCHIP_V(x)      ((x) << FW_EQ_CTRL_CMD_ONCHIP_S)
1786
1787#define FW_EQ_CTRL_CMD_PCIECHN_S        16
1788#define FW_EQ_CTRL_CMD_PCIECHN_V(x)     ((x) << FW_EQ_CTRL_CMD_PCIECHN_S)
1789
1790#define FW_EQ_CTRL_CMD_IQID_S           0
1791#define FW_EQ_CTRL_CMD_IQID_V(x)        ((x) << FW_EQ_CTRL_CMD_IQID_S)
1792
1793#define FW_EQ_CTRL_CMD_DCAEN_S          31
1794#define FW_EQ_CTRL_CMD_DCAEN_V(x)       ((x) << FW_EQ_CTRL_CMD_DCAEN_S)
1795
1796#define FW_EQ_CTRL_CMD_DCACPU_S         26
1797#define FW_EQ_CTRL_CMD_DCACPU_V(x)      ((x) << FW_EQ_CTRL_CMD_DCACPU_S)
1798
1799#define FW_EQ_CTRL_CMD_FBMIN_S          23
1800#define FW_EQ_CTRL_CMD_FBMIN_V(x)       ((x) << FW_EQ_CTRL_CMD_FBMIN_S)
1801
1802#define FW_EQ_CTRL_CMD_FBMAX_S          20
1803#define FW_EQ_CTRL_CMD_FBMAX_V(x)       ((x) << FW_EQ_CTRL_CMD_FBMAX_S)
1804
1805#define FW_EQ_CTRL_CMD_CIDXFTHRESHO_S           19
1806#define FW_EQ_CTRL_CMD_CIDXFTHRESHO_V(x)        \
1807        ((x) << FW_EQ_CTRL_CMD_CIDXFTHRESHO_S)
1808
1809#define FW_EQ_CTRL_CMD_CIDXFTHRESH_S    16
1810#define FW_EQ_CTRL_CMD_CIDXFTHRESH_V(x) ((x) << FW_EQ_CTRL_CMD_CIDXFTHRESH_S)
1811
1812#define FW_EQ_CTRL_CMD_EQSIZE_S         0
1813#define FW_EQ_CTRL_CMD_EQSIZE_V(x)      ((x) << FW_EQ_CTRL_CMD_EQSIZE_S)
1814
1815struct fw_eq_ofld_cmd {
1816        __be32 op_to_vfn;
1817        __be32 alloc_to_len16;
1818        __be32 eqid_pkd;
1819        __be32 physeqid_pkd;
1820        __be32 fetchszm_to_iqid;
1821        __be32 dcaen_to_eqsize;
1822        __be64 eqaddr;
1823};
1824
1825#define FW_EQ_OFLD_CMD_PFN_S    8
1826#define FW_EQ_OFLD_CMD_PFN_V(x) ((x) << FW_EQ_OFLD_CMD_PFN_S)
1827
1828#define FW_EQ_OFLD_CMD_VFN_S    0
1829#define FW_EQ_OFLD_CMD_VFN_V(x) ((x) << FW_EQ_OFLD_CMD_VFN_S)
1830
1831#define FW_EQ_OFLD_CMD_ALLOC_S          31
1832#define FW_EQ_OFLD_CMD_ALLOC_V(x)       ((x) << FW_EQ_OFLD_CMD_ALLOC_S)
1833#define FW_EQ_OFLD_CMD_ALLOC_F          FW_EQ_OFLD_CMD_ALLOC_V(1U)
1834
1835#define FW_EQ_OFLD_CMD_FREE_S           30
1836#define FW_EQ_OFLD_CMD_FREE_V(x)        ((x) << FW_EQ_OFLD_CMD_FREE_S)
1837#define FW_EQ_OFLD_CMD_FREE_F           FW_EQ_OFLD_CMD_FREE_V(1U)
1838
1839#define FW_EQ_OFLD_CMD_MODIFY_S         29
1840#define FW_EQ_OFLD_CMD_MODIFY_V(x)      ((x) << FW_EQ_OFLD_CMD_MODIFY_S)
1841#define FW_EQ_OFLD_CMD_MODIFY_F         FW_EQ_OFLD_CMD_MODIFY_V(1U)
1842
1843#define FW_EQ_OFLD_CMD_EQSTART_S        28
1844#define FW_EQ_OFLD_CMD_EQSTART_V(x)     ((x) << FW_EQ_OFLD_CMD_EQSTART_S)
1845#define FW_EQ_OFLD_CMD_EQSTART_F        FW_EQ_OFLD_CMD_EQSTART_V(1U)
1846
1847#define FW_EQ_OFLD_CMD_EQSTOP_S         27
1848#define FW_EQ_OFLD_CMD_EQSTOP_V(x)      ((x) << FW_EQ_OFLD_CMD_EQSTOP_S)
1849#define FW_EQ_OFLD_CMD_EQSTOP_F         FW_EQ_OFLD_CMD_EQSTOP_V(1U)
1850
1851#define FW_EQ_OFLD_CMD_EQID_S           0
1852#define FW_EQ_OFLD_CMD_EQID_M           0xfffff
1853#define FW_EQ_OFLD_CMD_EQID_V(x)        ((x) << FW_EQ_OFLD_CMD_EQID_S)
1854#define FW_EQ_OFLD_CMD_EQID_G(x)        \
1855        (((x) >> FW_EQ_OFLD_CMD_EQID_S) & FW_EQ_OFLD_CMD_EQID_M)
1856
1857#define FW_EQ_OFLD_CMD_PHYSEQID_S       0
1858#define FW_EQ_OFLD_CMD_PHYSEQID_M       0xfffff
1859#define FW_EQ_OFLD_CMD_PHYSEQID_G(x)    \
1860        (((x) >> FW_EQ_OFLD_CMD_PHYSEQID_S) & FW_EQ_OFLD_CMD_PHYSEQID_M)
1861
1862#define FW_EQ_OFLD_CMD_FETCHSZM_S       26
1863#define FW_EQ_OFLD_CMD_FETCHSZM_V(x)    ((x) << FW_EQ_OFLD_CMD_FETCHSZM_S)
1864
1865#define FW_EQ_OFLD_CMD_STATUSPGNS_S     25
1866#define FW_EQ_OFLD_CMD_STATUSPGNS_V(x)  ((x) << FW_EQ_OFLD_CMD_STATUSPGNS_S)
1867
1868#define FW_EQ_OFLD_CMD_STATUSPGRO_S     24
1869#define FW_EQ_OFLD_CMD_STATUSPGRO_V(x)  ((x) << FW_EQ_OFLD_CMD_STATUSPGRO_S)
1870
1871#define FW_EQ_OFLD_CMD_FETCHNS_S        23
1872#define FW_EQ_OFLD_CMD_FETCHNS_V(x)     ((x) << FW_EQ_OFLD_CMD_FETCHNS_S)
1873
1874#define FW_EQ_OFLD_CMD_FETCHRO_S        22
1875#define FW_EQ_OFLD_CMD_FETCHRO_V(x)     ((x) << FW_EQ_OFLD_CMD_FETCHRO_S)
1876#define FW_EQ_OFLD_CMD_FETCHRO_F        FW_EQ_OFLD_CMD_FETCHRO_V(1U)
1877
1878#define FW_EQ_OFLD_CMD_HOSTFCMODE_S     20
1879#define FW_EQ_OFLD_CMD_HOSTFCMODE_V(x)  ((x) << FW_EQ_OFLD_CMD_HOSTFCMODE_S)
1880
1881#define FW_EQ_OFLD_CMD_CPRIO_S          19
1882#define FW_EQ_OFLD_CMD_CPRIO_V(x)       ((x) << FW_EQ_OFLD_CMD_CPRIO_S)
1883
1884#define FW_EQ_OFLD_CMD_ONCHIP_S         18
1885#define FW_EQ_OFLD_CMD_ONCHIP_V(x)      ((x) << FW_EQ_OFLD_CMD_ONCHIP_S)
1886
1887#define FW_EQ_OFLD_CMD_PCIECHN_S        16
1888#define FW_EQ_OFLD_CMD_PCIECHN_V(x)     ((x) << FW_EQ_OFLD_CMD_PCIECHN_S)
1889
1890#define FW_EQ_OFLD_CMD_IQID_S           0
1891#define FW_EQ_OFLD_CMD_IQID_V(x)        ((x) << FW_EQ_OFLD_CMD_IQID_S)
1892
1893#define FW_EQ_OFLD_CMD_DCAEN_S          31
1894#define FW_EQ_OFLD_CMD_DCAEN_V(x)       ((x) << FW_EQ_OFLD_CMD_DCAEN_S)
1895
1896#define FW_EQ_OFLD_CMD_DCACPU_S         26
1897#define FW_EQ_OFLD_CMD_DCACPU_V(x)      ((x) << FW_EQ_OFLD_CMD_DCACPU_S)
1898
1899#define FW_EQ_OFLD_CMD_FBMIN_S          23
1900#define FW_EQ_OFLD_CMD_FBMIN_V(x)       ((x) << FW_EQ_OFLD_CMD_FBMIN_S)
1901
1902#define FW_EQ_OFLD_CMD_FBMAX_S          20
1903#define FW_EQ_OFLD_CMD_FBMAX_V(x)       ((x) << FW_EQ_OFLD_CMD_FBMAX_S)
1904
1905#define FW_EQ_OFLD_CMD_CIDXFTHRESHO_S           19
1906#define FW_EQ_OFLD_CMD_CIDXFTHRESHO_V(x)        \
1907        ((x) << FW_EQ_OFLD_CMD_CIDXFTHRESHO_S)
1908
1909#define FW_EQ_OFLD_CMD_CIDXFTHRESH_S    16
1910#define FW_EQ_OFLD_CMD_CIDXFTHRESH_V(x) ((x) << FW_EQ_OFLD_CMD_CIDXFTHRESH_S)
1911
1912#define FW_EQ_OFLD_CMD_EQSIZE_S         0
1913#define FW_EQ_OFLD_CMD_EQSIZE_V(x)      ((x) << FW_EQ_OFLD_CMD_EQSIZE_S)
1914
1915/*
1916 * Macros for VIID parsing:
1917 * VIID - [10:8] PFN, [7] VI Valid, [6:0] VI number
1918 */
1919
1920#define FW_VIID_PFN_S           8
1921#define FW_VIID_PFN_M           0x7
1922#define FW_VIID_PFN_G(x)        (((x) >> FW_VIID_PFN_S) & FW_VIID_PFN_M)
1923
1924#define FW_VIID_VIVLD_S         7
1925#define FW_VIID_VIVLD_M         0x1
1926#define FW_VIID_VIVLD_G(x)      (((x) >> FW_VIID_VIVLD_S) & FW_VIID_VIVLD_M)
1927
1928#define FW_VIID_VIN_S           0
1929#define FW_VIID_VIN_M           0x7F
1930#define FW_VIID_VIN_G(x)        (((x) >> FW_VIID_VIN_S) & FW_VIID_VIN_M)
1931
1932struct fw_vi_cmd {
1933        __be32 op_to_vfn;
1934        __be32 alloc_to_len16;
1935        __be16 type_viid;
1936        u8 mac[6];
1937        u8 portid_pkd;
1938        u8 nmac;
1939        u8 nmac0[6];
1940        __be16 rsssize_pkd;
1941        u8 nmac1[6];
1942        __be16 idsiiq_pkd;
1943        u8 nmac2[6];
1944        __be16 idseiq_pkd;
1945        u8 nmac3[6];
1946        __be64 r9;
1947        __be64 r10;
1948};
1949
1950#define FW_VI_CMD_PFN_S         8
1951#define FW_VI_CMD_PFN_V(x)      ((x) << FW_VI_CMD_PFN_S)
1952
1953#define FW_VI_CMD_VFN_S         0
1954#define FW_VI_CMD_VFN_V(x)      ((x) << FW_VI_CMD_VFN_S)
1955
1956#define FW_VI_CMD_ALLOC_S       31
1957#define FW_VI_CMD_ALLOC_V(x)    ((x) << FW_VI_CMD_ALLOC_S)
1958#define FW_VI_CMD_ALLOC_F       FW_VI_CMD_ALLOC_V(1U)
1959
1960#define FW_VI_CMD_FREE_S        30
1961#define FW_VI_CMD_FREE_V(x)     ((x) << FW_VI_CMD_FREE_S)
1962#define FW_VI_CMD_FREE_F        FW_VI_CMD_FREE_V(1U)
1963
1964#define FW_VI_CMD_VIID_S        0
1965#define FW_VI_CMD_VIID_M        0xfff
1966#define FW_VI_CMD_VIID_V(x)     ((x) << FW_VI_CMD_VIID_S)
1967#define FW_VI_CMD_VIID_G(x)     (((x) >> FW_VI_CMD_VIID_S) & FW_VI_CMD_VIID_M)
1968
1969#define FW_VI_CMD_PORTID_S      4
1970#define FW_VI_CMD_PORTID_M      0xf
1971#define FW_VI_CMD_PORTID_V(x)   ((x) << FW_VI_CMD_PORTID_S)
1972#define FW_VI_CMD_PORTID_G(x)   \
1973        (((x) >> FW_VI_CMD_PORTID_S) & FW_VI_CMD_PORTID_M)
1974
1975#define FW_VI_CMD_RSSSIZE_S     0
1976#define FW_VI_CMD_RSSSIZE_M     0x7ff
1977#define FW_VI_CMD_RSSSIZE_G(x)  \
1978        (((x) >> FW_VI_CMD_RSSSIZE_S) & FW_VI_CMD_RSSSIZE_M)
1979
1980/* Special VI_MAC command index ids */
1981#define FW_VI_MAC_ADD_MAC               0x3FF
1982#define FW_VI_MAC_ADD_PERSIST_MAC       0x3FE
1983#define FW_VI_MAC_MAC_BASED_FREE        0x3FD
1984#define FW_CLS_TCAM_NUM_ENTRIES         336
1985
1986enum fw_vi_mac_smac {
1987        FW_VI_MAC_MPS_TCAM_ENTRY,
1988        FW_VI_MAC_MPS_TCAM_ONLY,
1989        FW_VI_MAC_SMT_ONLY,
1990        FW_VI_MAC_SMT_AND_MPSTCAM
1991};
1992
1993enum fw_vi_mac_result {
1994        FW_VI_MAC_R_SUCCESS,
1995        FW_VI_MAC_R_F_NONEXISTENT_NOMEM,
1996        FW_VI_MAC_R_SMAC_FAIL,
1997        FW_VI_MAC_R_F_ACL_CHECK
1998};
1999
2000struct fw_vi_mac_cmd {
2001        __be32 op_to_viid;
2002        __be32 freemacs_to_len16;
2003        union fw_vi_mac {
2004                struct fw_vi_mac_exact {
2005                        __be16 valid_to_idx;
2006                        u8 macaddr[6];
2007                } exact[7];
2008                struct fw_vi_mac_hash {
2009                        __be64 hashvec;
2010                } hash;
2011        } u;
2012};
2013
2014#define FW_VI_MAC_CMD_VIID_S    0
2015#define FW_VI_MAC_CMD_VIID_V(x) ((x) << FW_VI_MAC_CMD_VIID_S)
2016
2017#define FW_VI_MAC_CMD_FREEMACS_S        31
2018#define FW_VI_MAC_CMD_FREEMACS_V(x)     ((x) << FW_VI_MAC_CMD_FREEMACS_S)
2019
2020#define FW_VI_MAC_CMD_HASHVECEN_S       23
2021#define FW_VI_MAC_CMD_HASHVECEN_V(x)    ((x) << FW_VI_MAC_CMD_HASHVECEN_S)
2022#define FW_VI_MAC_CMD_HASHVECEN_F       FW_VI_MAC_CMD_HASHVECEN_V(1U)
2023
2024#define FW_VI_MAC_CMD_HASHUNIEN_S       22
2025#define FW_VI_MAC_CMD_HASHUNIEN_V(x)    ((x) << FW_VI_MAC_CMD_HASHUNIEN_S)
2026
2027#define FW_VI_MAC_CMD_VALID_S           15
2028#define FW_VI_MAC_CMD_VALID_V(x)        ((x) << FW_VI_MAC_CMD_VALID_S)
2029#define FW_VI_MAC_CMD_VALID_F   FW_VI_MAC_CMD_VALID_V(1U)
2030
2031#define FW_VI_MAC_CMD_PRIO_S    12
2032#define FW_VI_MAC_CMD_PRIO_V(x) ((x) << FW_VI_MAC_CMD_PRIO_S)
2033
2034#define FW_VI_MAC_CMD_SMAC_RESULT_S     10
2035#define FW_VI_MAC_CMD_SMAC_RESULT_M     0x3
2036#define FW_VI_MAC_CMD_SMAC_RESULT_V(x)  ((x) << FW_VI_MAC_CMD_SMAC_RESULT_S)
2037#define FW_VI_MAC_CMD_SMAC_RESULT_G(x)  \
2038        (((x) >> FW_VI_MAC_CMD_SMAC_RESULT_S) & FW_VI_MAC_CMD_SMAC_RESULT_M)
2039
2040#define FW_VI_MAC_CMD_IDX_S     0
2041#define FW_VI_MAC_CMD_IDX_M     0x3ff
2042#define FW_VI_MAC_CMD_IDX_V(x)  ((x) << FW_VI_MAC_CMD_IDX_S)
2043#define FW_VI_MAC_CMD_IDX_G(x)  \
2044        (((x) >> FW_VI_MAC_CMD_IDX_S) & FW_VI_MAC_CMD_IDX_M)
2045
2046#define FW_RXMODE_MTU_NO_CHG    65535
2047
2048struct fw_vi_rxmode_cmd {
2049        __be32 op_to_viid;
2050        __be32 retval_len16;
2051        __be32 mtu_to_vlanexen;
2052        __be32 r4_lo;
2053};
2054
2055#define FW_VI_RXMODE_CMD_VIID_S         0
2056#define FW_VI_RXMODE_CMD_VIID_V(x)      ((x) << FW_VI_RXMODE_CMD_VIID_S)
2057
2058#define FW_VI_RXMODE_CMD_MTU_S          16
2059#define FW_VI_RXMODE_CMD_MTU_M          0xffff
2060#define FW_VI_RXMODE_CMD_MTU_V(x)       ((x) << FW_VI_RXMODE_CMD_MTU_S)
2061
2062#define FW_VI_RXMODE_CMD_PROMISCEN_S    14
2063#define FW_VI_RXMODE_CMD_PROMISCEN_M    0x3
2064#define FW_VI_RXMODE_CMD_PROMISCEN_V(x) ((x) << FW_VI_RXMODE_CMD_PROMISCEN_S)
2065
2066#define FW_VI_RXMODE_CMD_ALLMULTIEN_S           12
2067#define FW_VI_RXMODE_CMD_ALLMULTIEN_M           0x3
2068#define FW_VI_RXMODE_CMD_ALLMULTIEN_V(x)        \
2069        ((x) << FW_VI_RXMODE_CMD_ALLMULTIEN_S)
2070
2071#define FW_VI_RXMODE_CMD_BROADCASTEN_S          10
2072#define FW_VI_RXMODE_CMD_BROADCASTEN_M          0x3
2073#define FW_VI_RXMODE_CMD_BROADCASTEN_V(x)       \
2074        ((x) << FW_VI_RXMODE_CMD_BROADCASTEN_S)
2075
2076#define FW_VI_RXMODE_CMD_VLANEXEN_S     8
2077#define FW_VI_RXMODE_CMD_VLANEXEN_M     0x3
2078#define FW_VI_RXMODE_CMD_VLANEXEN_V(x)  ((x) << FW_VI_RXMODE_CMD_VLANEXEN_S)
2079
2080struct fw_vi_enable_cmd {
2081        __be32 op_to_viid;
2082        __be32 ien_to_len16;
2083        __be16 blinkdur;
2084        __be16 r3;
2085        __be32 r4;
2086};
2087
2088#define FW_VI_ENABLE_CMD_VIID_S         0
2089#define FW_VI_ENABLE_CMD_VIID_V(x)      ((x) << FW_VI_ENABLE_CMD_VIID_S)
2090
2091#define FW_VI_ENABLE_CMD_IEN_S          31
2092#define FW_VI_ENABLE_CMD_IEN_V(x)       ((x) << FW_VI_ENABLE_CMD_IEN_S)
2093
2094#define FW_VI_ENABLE_CMD_EEN_S          30
2095#define FW_VI_ENABLE_CMD_EEN_V(x)       ((x) << FW_VI_ENABLE_CMD_EEN_S)
2096
2097#define FW_VI_ENABLE_CMD_LED_S          29
2098#define FW_VI_ENABLE_CMD_LED_V(x)       ((x) << FW_VI_ENABLE_CMD_LED_S)
2099#define FW_VI_ENABLE_CMD_LED_F  FW_VI_ENABLE_CMD_LED_V(1U)
2100
2101#define FW_VI_ENABLE_CMD_DCB_INFO_S     28
2102#define FW_VI_ENABLE_CMD_DCB_INFO_V(x)  ((x) << FW_VI_ENABLE_CMD_DCB_INFO_S)
2103
2104/* VI VF stats offset definitions */
2105#define VI_VF_NUM_STATS 16
2106enum fw_vi_stats_vf_index {
2107        FW_VI_VF_STAT_TX_BCAST_BYTES_IX,
2108        FW_VI_VF_STAT_TX_BCAST_FRAMES_IX,
2109        FW_VI_VF_STAT_TX_MCAST_BYTES_IX,
2110        FW_VI_VF_STAT_TX_MCAST_FRAMES_IX,
2111        FW_VI_VF_STAT_TX_UCAST_BYTES_IX,
2112        FW_VI_VF_STAT_TX_UCAST_FRAMES_IX,
2113        FW_VI_VF_STAT_TX_DROP_FRAMES_IX,
2114        FW_VI_VF_STAT_TX_OFLD_BYTES_IX,
2115        FW_VI_VF_STAT_TX_OFLD_FRAMES_IX,
2116        FW_VI_VF_STAT_RX_BCAST_BYTES_IX,
2117        FW_VI_VF_STAT_RX_BCAST_FRAMES_IX,
2118        FW_VI_VF_STAT_RX_MCAST_BYTES_IX,
2119        FW_VI_VF_STAT_RX_MCAST_FRAMES_IX,
2120        FW_VI_VF_STAT_RX_UCAST_BYTES_IX,
2121        FW_VI_VF_STAT_RX_UCAST_FRAMES_IX,
2122        FW_VI_VF_STAT_RX_ERR_FRAMES_IX
2123};
2124
2125/* VI PF stats offset definitions */
2126#define VI_PF_NUM_STATS 17
2127enum fw_vi_stats_pf_index {
2128        FW_VI_PF_STAT_TX_BCAST_BYTES_IX,
2129        FW_VI_PF_STAT_TX_BCAST_FRAMES_IX,
2130        FW_VI_PF_STAT_TX_MCAST_BYTES_IX,
2131        FW_VI_PF_STAT_TX_MCAST_FRAMES_IX,
2132        FW_VI_PF_STAT_TX_UCAST_BYTES_IX,
2133        FW_VI_PF_STAT_TX_UCAST_FRAMES_IX,
2134        FW_VI_PF_STAT_TX_OFLD_BYTES_IX,
2135        FW_VI_PF_STAT_TX_OFLD_FRAMES_IX,
2136        FW_VI_PF_STAT_RX_BYTES_IX,
2137        FW_VI_PF_STAT_RX_FRAMES_IX,
2138        FW_VI_PF_STAT_RX_BCAST_BYTES_IX,
2139        FW_VI_PF_STAT_RX_BCAST_FRAMES_IX,
2140        FW_VI_PF_STAT_RX_MCAST_BYTES_IX,
2141        FW_VI_PF_STAT_RX_MCAST_FRAMES_IX,
2142        FW_VI_PF_STAT_RX_UCAST_BYTES_IX,
2143        FW_VI_PF_STAT_RX_UCAST_FRAMES_IX,
2144        FW_VI_PF_STAT_RX_ERR_FRAMES_IX
2145};
2146
2147struct fw_vi_stats_cmd {
2148        __be32 op_to_viid;
2149        __be32 retval_len16;
2150        union fw_vi_stats {
2151                struct fw_vi_stats_ctl {
2152                        __be16 nstats_ix;
2153                        __be16 r6;
2154                        __be32 r7;
2155                        __be64 stat0;
2156                        __be64 stat1;
2157                        __be64 stat2;
2158                        __be64 stat3;
2159                        __be64 stat4;
2160                        __be64 stat5;
2161                } ctl;
2162                struct fw_vi_stats_pf {
2163                        __be64 tx_bcast_bytes;
2164                        __be64 tx_bcast_frames;
2165                        __be64 tx_mcast_bytes;
2166                        __be64 tx_mcast_frames;
2167                        __be64 tx_ucast_bytes;
2168                        __be64 tx_ucast_frames;
2169                        __be64 tx_offload_bytes;
2170                        __be64 tx_offload_frames;
2171                        __be64 rx_pf_bytes;
2172                        __be64 rx_pf_frames;
2173                        __be64 rx_bcast_bytes;
2174                        __be64 rx_bcast_frames;
2175                        __be64 rx_mcast_bytes;
2176                        __be64 rx_mcast_frames;
2177                        __be64 rx_ucast_bytes;
2178                        __be64 rx_ucast_frames;
2179                        __be64 rx_err_frames;
2180                } pf;
2181                struct fw_vi_stats_vf {
2182                        __be64 tx_bcast_bytes;
2183                        __be64 tx_bcast_frames;
2184                        __be64 tx_mcast_bytes;
2185                        __be64 tx_mcast_frames;
2186                        __be64 tx_ucast_bytes;
2187                        __be64 tx_ucast_frames;
2188                        __be64 tx_drop_frames;
2189                        __be64 tx_offload_bytes;
2190                        __be64 tx_offload_frames;
2191                        __be64 rx_bcast_bytes;
2192                        __be64 rx_bcast_frames;
2193                        __be64 rx_mcast_bytes;
2194                        __be64 rx_mcast_frames;
2195                        __be64 rx_ucast_bytes;
2196                        __be64 rx_ucast_frames;
2197                        __be64 rx_err_frames;
2198                } vf;
2199        } u;
2200};
2201
2202#define FW_VI_STATS_CMD_VIID_S          0
2203#define FW_VI_STATS_CMD_VIID_V(x)       ((x) << FW_VI_STATS_CMD_VIID_S)
2204
2205#define FW_VI_STATS_CMD_NSTATS_S        12
2206#define FW_VI_STATS_CMD_NSTATS_V(x)     ((x) << FW_VI_STATS_CMD_NSTATS_S)
2207
2208#define FW_VI_STATS_CMD_IX_S    0
2209#define FW_VI_STATS_CMD_IX_V(x) ((x) << FW_VI_STATS_CMD_IX_S)
2210
2211struct fw_acl_mac_cmd {
2212        __be32 op_to_vfn;
2213        __be32 en_to_len16;
2214        u8 nmac;
2215        u8 r3[7];
2216        __be16 r4;
2217        u8 macaddr0[6];
2218        __be16 r5;
2219        u8 macaddr1[6];
2220        __be16 r6;
2221        u8 macaddr2[6];
2222        __be16 r7;
2223        u8 macaddr3[6];
2224};
2225
2226#define FW_ACL_MAC_CMD_PFN_S    8
2227#define FW_ACL_MAC_CMD_PFN_V(x) ((x) << FW_ACL_MAC_CMD_PFN_S)
2228
2229#define FW_ACL_MAC_CMD_VFN_S    0
2230#define FW_ACL_MAC_CMD_VFN_V(x) ((x) << FW_ACL_MAC_CMD_VFN_S)
2231
2232#define FW_ACL_MAC_CMD_EN_S     31
2233#define FW_ACL_MAC_CMD_EN_V(x)  ((x) << FW_ACL_MAC_CMD_EN_S)
2234
2235struct fw_acl_vlan_cmd {
2236        __be32 op_to_vfn;
2237        __be32 en_to_len16;
2238        u8 nvlan;
2239        u8 dropnovlan_fm;
2240        u8 r3_lo[6];
2241        __be16 vlanid[16];
2242};
2243
2244#define FW_ACL_VLAN_CMD_PFN_S           8
2245#define FW_ACL_VLAN_CMD_PFN_V(x)        ((x) << FW_ACL_VLAN_CMD_PFN_S)
2246
2247#define FW_ACL_VLAN_CMD_VFN_S           0
2248#define FW_ACL_VLAN_CMD_VFN_V(x)        ((x) << FW_ACL_VLAN_CMD_VFN_S)
2249
2250#define FW_ACL_VLAN_CMD_EN_S    31
2251#define FW_ACL_VLAN_CMD_EN_V(x) ((x) << FW_ACL_VLAN_CMD_EN_S)
2252
2253#define FW_ACL_VLAN_CMD_DROPNOVLAN_S    7
2254#define FW_ACL_VLAN_CMD_DROPNOVLAN_V(x) ((x) << FW_ACL_VLAN_CMD_DROPNOVLAN_S)
2255
2256#define FW_ACL_VLAN_CMD_FM_S    6
2257#define FW_ACL_VLAN_CMD_FM_V(x) ((x) << FW_ACL_VLAN_CMD_FM_S)
2258
2259enum fw_port_cap {
2260        FW_PORT_CAP_SPEED_100M          = 0x0001,
2261        FW_PORT_CAP_SPEED_1G            = 0x0002,
2262        FW_PORT_CAP_SPEED_25G           = 0x0004,
2263        FW_PORT_CAP_SPEED_10G           = 0x0008,
2264        FW_PORT_CAP_SPEED_40G           = 0x0010,
2265        FW_PORT_CAP_SPEED_100G          = 0x0020,
2266        FW_PORT_CAP_FC_RX               = 0x0040,
2267        FW_PORT_CAP_FC_TX               = 0x0080,
2268        FW_PORT_CAP_ANEG                = 0x0100,
2269        FW_PORT_CAP_MDIX                = 0x0200,
2270        FW_PORT_CAP_MDIAUTO             = 0x0400,
2271        FW_PORT_CAP_FEC_RS              = 0x0800,
2272        FW_PORT_CAP_FEC_BASER_RS        = 0x1000,
2273        FW_PORT_CAP_FEC_RESERVED        = 0x2000,
2274        FW_PORT_CAP_802_3_PAUSE         = 0x4000,
2275        FW_PORT_CAP_802_3_ASM_DIR       = 0x8000,
2276};
2277
2278#define FW_PORT_CAP_SPEED_S     0
2279#define FW_PORT_CAP_SPEED_M     0x3f
2280#define FW_PORT_CAP_SPEED_V(x)  ((x) << FW_PORT_CAP_SPEED_S)
2281#define FW_PORT_CAP_SPEED_G(x) \
2282        (((x) >> FW_PORT_CAP_SPEED_S) & FW_PORT_CAP_SPEED_M)
2283
2284enum fw_port_mdi {
2285        FW_PORT_CAP_MDI_UNCHANGED,
2286        FW_PORT_CAP_MDI_AUTO,
2287        FW_PORT_CAP_MDI_F_STRAIGHT,
2288        FW_PORT_CAP_MDI_F_CROSSOVER
2289};
2290
2291#define FW_PORT_CAP_MDI_S 9
2292#define FW_PORT_CAP_MDI_V(x) ((x) << FW_PORT_CAP_MDI_S)
2293
2294enum fw_port_action {
2295        FW_PORT_ACTION_L1_CFG           = 0x0001,
2296        FW_PORT_ACTION_L2_CFG           = 0x0002,
2297        FW_PORT_ACTION_GET_PORT_INFO    = 0x0003,
2298        FW_PORT_ACTION_L2_PPP_CFG       = 0x0004,
2299        FW_PORT_ACTION_L2_DCB_CFG       = 0x0005,
2300        FW_PORT_ACTION_DCB_READ_TRANS   = 0x0006,
2301        FW_PORT_ACTION_DCB_READ_RECV    = 0x0007,
2302        FW_PORT_ACTION_DCB_READ_DET     = 0x0008,
2303        FW_PORT_ACTION_LOW_PWR_TO_NORMAL = 0x0010,
2304        FW_PORT_ACTION_L1_LOW_PWR_EN    = 0x0011,
2305        FW_PORT_ACTION_L2_WOL_MODE_EN   = 0x0012,
2306        FW_PORT_ACTION_LPBK_TO_NORMAL   = 0x0020,
2307        FW_PORT_ACTION_L1_LPBK          = 0x0021,
2308        FW_PORT_ACTION_L1_PMA_LPBK      = 0x0022,
2309        FW_PORT_ACTION_L1_PCS_LPBK      = 0x0023,
2310        FW_PORT_ACTION_L1_PHYXS_CSIDE_LPBK = 0x0024,
2311        FW_PORT_ACTION_L1_PHYXS_ESIDE_LPBK = 0x0025,
2312        FW_PORT_ACTION_PHY_RESET        = 0x0040,
2313        FW_PORT_ACTION_PMA_RESET        = 0x0041,
2314        FW_PORT_ACTION_PCS_RESET        = 0x0042,
2315        FW_PORT_ACTION_PHYXS_RESET      = 0x0043,
2316        FW_PORT_ACTION_DTEXS_REEST      = 0x0044,
2317        FW_PORT_ACTION_AN_RESET         = 0x0045
2318};
2319
2320enum fw_port_l2cfg_ctlbf {
2321        FW_PORT_L2_CTLBF_OVLAN0 = 0x01,
2322        FW_PORT_L2_CTLBF_OVLAN1 = 0x02,
2323        FW_PORT_L2_CTLBF_OVLAN2 = 0x04,
2324        FW_PORT_L2_CTLBF_OVLAN3 = 0x08,
2325        FW_PORT_L2_CTLBF_IVLAN  = 0x10,
2326        FW_PORT_L2_CTLBF_TXIPG  = 0x20
2327};
2328
2329enum fw_port_dcb_versions {
2330        FW_PORT_DCB_VER_UNKNOWN,
2331        FW_PORT_DCB_VER_CEE1D0,
2332        FW_PORT_DCB_VER_CEE1D01,
2333        FW_PORT_DCB_VER_IEEE,
2334        FW_PORT_DCB_VER_AUTO = 7
2335};
2336
2337enum fw_port_dcb_cfg {
2338        FW_PORT_DCB_CFG_PG      = 0x01,
2339        FW_PORT_DCB_CFG_PFC     = 0x02,
2340        FW_PORT_DCB_CFG_APPL    = 0x04
2341};
2342
2343enum fw_port_dcb_cfg_rc {
2344        FW_PORT_DCB_CFG_SUCCESS = 0x0,
2345        FW_PORT_DCB_CFG_ERROR   = 0x1
2346};
2347
2348enum fw_port_dcb_type {
2349        FW_PORT_DCB_TYPE_PGID           = 0x00,
2350        FW_PORT_DCB_TYPE_PGRATE         = 0x01,
2351        FW_PORT_DCB_TYPE_PRIORATE       = 0x02,
2352        FW_PORT_DCB_TYPE_PFC            = 0x03,
2353        FW_PORT_DCB_TYPE_APP_ID         = 0x04,
2354        FW_PORT_DCB_TYPE_CONTROL        = 0x05,
2355};
2356
2357enum fw_port_dcb_feature_state {
2358        FW_PORT_DCB_FEATURE_STATE_PENDING = 0x0,
2359        FW_PORT_DCB_FEATURE_STATE_SUCCESS = 0x1,
2360        FW_PORT_DCB_FEATURE_STATE_ERROR = 0x2,
2361        FW_PORT_DCB_FEATURE_STATE_TIMEOUT = 0x3,
2362};
2363
2364struct fw_port_cmd {
2365        __be32 op_to_portid;
2366        __be32 action_to_len16;
2367        union fw_port {
2368                struct fw_port_l1cfg {
2369                        __be32 rcap;
2370                        __be32 r;
2371                } l1cfg;
2372                struct fw_port_l2cfg {
2373                        __u8   ctlbf;
2374                        __u8   ovlan3_to_ivlan0;
2375                        __be16 ivlantype;
2376                        __be16 txipg_force_pinfo;
2377                        __be16 mtu;
2378                        __be16 ovlan0mask;
2379                        __be16 ovlan0type;
2380                        __be16 ovlan1mask;
2381                        __be16 ovlan1type;
2382                        __be16 ovlan2mask;
2383                        __be16 ovlan2type;
2384                        __be16 ovlan3mask;
2385                        __be16 ovlan3type;
2386                } l2cfg;
2387                struct fw_port_info {
2388                        __be32 lstatus_to_modtype;
2389                        __be16 pcap;
2390                        __be16 acap;
2391                        __be16 mtu;
2392                        __u8   cbllen;
2393                        __u8   auxlinfo;
2394                        __u8   dcbxdis_pkd;
2395                        __u8   r8_lo;
2396                        __be16 lpacap;
2397                        __be64 r9;
2398                } info;
2399                struct fw_port_diags {
2400                        __u8   diagop;
2401                        __u8   r[3];
2402                        __be32 diagval;
2403                } diags;
2404                union fw_port_dcb {
2405                        struct fw_port_dcb_pgid {
2406                                __u8   type;
2407                                __u8   apply_pkd;
2408                                __u8   r10_lo[2];
2409                                __be32 pgid;
2410                                __be64 r11;
2411                        } pgid;
2412                        struct fw_port_dcb_pgrate {
2413                                __u8   type;
2414                                __u8   apply_pkd;
2415                                __u8   r10_lo[5];
2416                                __u8   num_tcs_supported;
2417                                __u8   pgrate[8];
2418                                __u8   tsa[8];
2419                        } pgrate;
2420                        struct fw_port_dcb_priorate {
2421                                __u8   type;
2422                                __u8   apply_pkd;
2423                                __u8   r10_lo[6];
2424                                __u8   strict_priorate[8];
2425                        } priorate;
2426                        struct fw_port_dcb_pfc {
2427                                __u8   type;
2428                                __u8   pfcen;
2429                                __u8   r10[5];
2430                                __u8   max_pfc_tcs;
2431                                __be64 r11;
2432                        } pfc;
2433                        struct fw_port_app_priority {
2434                                __u8   type;
2435                                __u8   r10[2];
2436                                __u8   idx;
2437                                __u8   user_prio_map;
2438                                __u8   sel_field;
2439                                __be16 protocolid;
2440                                __be64 r12;
2441                        } app_priority;
2442                        struct fw_port_dcb_control {
2443                                __u8   type;
2444                                __u8   all_syncd_pkd;
2445                                __be16 dcb_version_to_app_state;
2446                                __be32 r11;
2447                                __be64 r12;
2448                        } control;
2449                } dcb;
2450        } u;
2451};
2452
2453#define FW_PORT_CMD_READ_S      22
2454#define FW_PORT_CMD_READ_V(x)   ((x) << FW_PORT_CMD_READ_S)
2455#define FW_PORT_CMD_READ_F      FW_PORT_CMD_READ_V(1U)
2456
2457#define FW_PORT_CMD_PORTID_S    0
2458#define FW_PORT_CMD_PORTID_M    0xf
2459#define FW_PORT_CMD_PORTID_V(x) ((x) << FW_PORT_CMD_PORTID_S)
2460#define FW_PORT_CMD_PORTID_G(x) \
2461        (((x) >> FW_PORT_CMD_PORTID_S) & FW_PORT_CMD_PORTID_M)
2462
2463#define FW_PORT_CMD_ACTION_S    16
2464#define FW_PORT_CMD_ACTION_M    0xffff
2465#define FW_PORT_CMD_ACTION_V(x) ((x) << FW_PORT_CMD_ACTION_S)
2466#define FW_PORT_CMD_ACTION_G(x) \
2467        (((x) >> FW_PORT_CMD_ACTION_S) & FW_PORT_CMD_ACTION_M)
2468
2469#define FW_PORT_CMD_OVLAN3_S    7
2470#define FW_PORT_CMD_OVLAN3_V(x) ((x) << FW_PORT_CMD_OVLAN3_S)
2471
2472#define FW_PORT_CMD_OVLAN2_S    6
2473#define FW_PORT_CMD_OVLAN2_V(x) ((x) << FW_PORT_CMD_OVLAN2_S)
2474
2475#define FW_PORT_CMD_OVLAN1_S    5
2476#define FW_PORT_CMD_OVLAN1_V(x) ((x) << FW_PORT_CMD_OVLAN1_S)
2477
2478#define FW_PORT_CMD_OVLAN0_S    4
2479#define FW_PORT_CMD_OVLAN0_V(x) ((x) << FW_PORT_CMD_OVLAN0_S)
2480
2481#define FW_PORT_CMD_IVLAN0_S    3
2482#define FW_PORT_CMD_IVLAN0_V(x) ((x) << FW_PORT_CMD_IVLAN0_S)
2483
2484#define FW_PORT_CMD_TXIPG_S     3
2485#define FW_PORT_CMD_TXIPG_V(x)  ((x) << FW_PORT_CMD_TXIPG_S)
2486
2487#define FW_PORT_CMD_LSTATUS_S           31
2488#define FW_PORT_CMD_LSTATUS_M           0x1
2489#define FW_PORT_CMD_LSTATUS_V(x)        ((x) << FW_PORT_CMD_LSTATUS_S)
2490#define FW_PORT_CMD_LSTATUS_G(x)        \
2491        (((x) >> FW_PORT_CMD_LSTATUS_S) & FW_PORT_CMD_LSTATUS_M)
2492#define FW_PORT_CMD_LSTATUS_F   FW_PORT_CMD_LSTATUS_V(1U)
2493
2494#define FW_PORT_CMD_LSPEED_S    24
2495#define FW_PORT_CMD_LSPEED_M    0x3f
2496#define FW_PORT_CMD_LSPEED_V(x) ((x) << FW_PORT_CMD_LSPEED_S)
2497#define FW_PORT_CMD_LSPEED_G(x) \
2498        (((x) >> FW_PORT_CMD_LSPEED_S) & FW_PORT_CMD_LSPEED_M)
2499
2500#define FW_PORT_CMD_TXPAUSE_S           23
2501#define FW_PORT_CMD_TXPAUSE_V(x)        ((x) << FW_PORT_CMD_TXPAUSE_S)
2502#define FW_PORT_CMD_TXPAUSE_F   FW_PORT_CMD_TXPAUSE_V(1U)
2503
2504#define FW_PORT_CMD_RXPAUSE_S           22
2505#define FW_PORT_CMD_RXPAUSE_V(x)        ((x) << FW_PORT_CMD_RXPAUSE_S)
2506#define FW_PORT_CMD_RXPAUSE_F   FW_PORT_CMD_RXPAUSE_V(1U)
2507
2508#define FW_PORT_CMD_MDIOCAP_S           21
2509#define FW_PORT_CMD_MDIOCAP_V(x)        ((x) << FW_PORT_CMD_MDIOCAP_S)
2510#define FW_PORT_CMD_MDIOCAP_F   FW_PORT_CMD_MDIOCAP_V(1U)
2511
2512#define FW_PORT_CMD_MDIOADDR_S          16
2513#define FW_PORT_CMD_MDIOADDR_M          0x1f
2514#define FW_PORT_CMD_MDIOADDR_G(x)       \
2515        (((x) >> FW_PORT_CMD_MDIOADDR_S) & FW_PORT_CMD_MDIOADDR_M)
2516
2517#define FW_PORT_CMD_LPTXPAUSE_S         15
2518#define FW_PORT_CMD_LPTXPAUSE_V(x)      ((x) << FW_PORT_CMD_LPTXPAUSE_S)
2519#define FW_PORT_CMD_LPTXPAUSE_F FW_PORT_CMD_LPTXPAUSE_V(1U)
2520
2521#define FW_PORT_CMD_LPRXPAUSE_S         14
2522#define FW_PORT_CMD_LPRXPAUSE_V(x)      ((x) << FW_PORT_CMD_LPRXPAUSE_S)
2523#define FW_PORT_CMD_LPRXPAUSE_F FW_PORT_CMD_LPRXPAUSE_V(1U)
2524
2525#define FW_PORT_CMD_PTYPE_S     8
2526#define FW_PORT_CMD_PTYPE_M     0x1f
2527#define FW_PORT_CMD_PTYPE_G(x)  \
2528        (((x) >> FW_PORT_CMD_PTYPE_S) & FW_PORT_CMD_PTYPE_M)
2529
2530#define FW_PORT_CMD_LINKDNRC_S          5
2531#define FW_PORT_CMD_LINKDNRC_M          0x7
2532#define FW_PORT_CMD_LINKDNRC_G(x)       \
2533        (((x) >> FW_PORT_CMD_LINKDNRC_S) & FW_PORT_CMD_LINKDNRC_M)
2534
2535#define FW_PORT_CMD_MODTYPE_S           0
2536#define FW_PORT_CMD_MODTYPE_M           0x1f
2537#define FW_PORT_CMD_MODTYPE_V(x)        ((x) << FW_PORT_CMD_MODTYPE_S)
2538#define FW_PORT_CMD_MODTYPE_G(x)        \
2539        (((x) >> FW_PORT_CMD_MODTYPE_S) & FW_PORT_CMD_MODTYPE_M)
2540
2541#define FW_PORT_CMD_DCBXDIS_S           7
2542#define FW_PORT_CMD_DCBXDIS_V(x)        ((x) << FW_PORT_CMD_DCBXDIS_S)
2543#define FW_PORT_CMD_DCBXDIS_F   FW_PORT_CMD_DCBXDIS_V(1U)
2544
2545#define FW_PORT_CMD_APPLY_S     7
2546#define FW_PORT_CMD_APPLY_V(x)  ((x) << FW_PORT_CMD_APPLY_S)
2547#define FW_PORT_CMD_APPLY_F     FW_PORT_CMD_APPLY_V(1U)
2548
2549#define FW_PORT_CMD_ALL_SYNCD_S         7
2550#define FW_PORT_CMD_ALL_SYNCD_V(x)      ((x) << FW_PORT_CMD_ALL_SYNCD_S)
2551#define FW_PORT_CMD_ALL_SYNCD_F FW_PORT_CMD_ALL_SYNCD_V(1U)
2552
2553#define FW_PORT_CMD_DCB_VERSION_S       12
2554#define FW_PORT_CMD_DCB_VERSION_M       0x7
2555#define FW_PORT_CMD_DCB_VERSION_G(x)    \
2556        (((x) >> FW_PORT_CMD_DCB_VERSION_S) & FW_PORT_CMD_DCB_VERSION_M)
2557
2558enum fw_port_type {
2559        FW_PORT_TYPE_FIBER_XFI,
2560        FW_PORT_TYPE_FIBER_XAUI,
2561        FW_PORT_TYPE_BT_SGMII,
2562        FW_PORT_TYPE_BT_XFI,
2563        FW_PORT_TYPE_BT_XAUI,
2564        FW_PORT_TYPE_KX4,
2565        FW_PORT_TYPE_CX4,
2566        FW_PORT_TYPE_KX,
2567        FW_PORT_TYPE_KR,
2568        FW_PORT_TYPE_SFP,
2569        FW_PORT_TYPE_BP_AP,
2570        FW_PORT_TYPE_BP4_AP,
2571        FW_PORT_TYPE_QSFP_10G,
2572        FW_PORT_TYPE_QSA,
2573        FW_PORT_TYPE_QSFP,
2574        FW_PORT_TYPE_BP40_BA,
2575        FW_PORT_TYPE_KR4_100G,
2576        FW_PORT_TYPE_CR4_QSFP,
2577        FW_PORT_TYPE_CR_QSFP,
2578        FW_PORT_TYPE_CR2_QSFP,
2579        FW_PORT_TYPE_SFP28,
2580        FW_PORT_TYPE_KR_SFP28,
2581
2582        FW_PORT_TYPE_NONE = FW_PORT_CMD_PTYPE_M
2583};
2584
2585enum fw_port_module_type {
2586        FW_PORT_MOD_TYPE_NA,
2587        FW_PORT_MOD_TYPE_LR,
2588        FW_PORT_MOD_TYPE_SR,
2589        FW_PORT_MOD_TYPE_ER,
2590        FW_PORT_MOD_TYPE_TWINAX_PASSIVE,
2591        FW_PORT_MOD_TYPE_TWINAX_ACTIVE,
2592        FW_PORT_MOD_TYPE_LRM,
2593        FW_PORT_MOD_TYPE_ERROR          = FW_PORT_CMD_MODTYPE_M - 3,
2594        FW_PORT_MOD_TYPE_UNKNOWN        = FW_PORT_CMD_MODTYPE_M - 2,
2595        FW_PORT_MOD_TYPE_NOTSUPPORTED   = FW_PORT_CMD_MODTYPE_M - 1,
2596
2597        FW_PORT_MOD_TYPE_NONE = FW_PORT_CMD_MODTYPE_M
2598};
2599
2600enum fw_port_mod_sub_type {
2601        FW_PORT_MOD_SUB_TYPE_NA,
2602        FW_PORT_MOD_SUB_TYPE_MV88E114X = 0x1,
2603        FW_PORT_MOD_SUB_TYPE_TN8022 = 0x2,
2604        FW_PORT_MOD_SUB_TYPE_AQ1202 = 0x3,
2605        FW_PORT_MOD_SUB_TYPE_88x3120 = 0x4,
2606        FW_PORT_MOD_SUB_TYPE_BCM84834 = 0x5,
2607        FW_PORT_MOD_SUB_TYPE_BT_VSC8634 = 0x8,
2608
2609        /* The following will never been in the VPD.  They are TWINAX cable
2610         * lengths decoded from SFP+ module i2c PROMs.  These should
2611         * almost certainly go somewhere else ...
2612         */
2613        FW_PORT_MOD_SUB_TYPE_TWINAX_1 = 0x9,
2614        FW_PORT_MOD_SUB_TYPE_TWINAX_3 = 0xA,
2615        FW_PORT_MOD_SUB_TYPE_TWINAX_5 = 0xB,
2616        FW_PORT_MOD_SUB_TYPE_TWINAX_7 = 0xC,
2617};
2618
2619enum fw_port_stats_tx_index {
2620        FW_STAT_TX_PORT_BYTES_IX = 0,
2621        FW_STAT_TX_PORT_FRAMES_IX,
2622        FW_STAT_TX_PORT_BCAST_IX,
2623        FW_STAT_TX_PORT_MCAST_IX,
2624        FW_STAT_TX_PORT_UCAST_IX,
2625        FW_STAT_TX_PORT_ERROR_IX,
2626        FW_STAT_TX_PORT_64B_IX,
2627        FW_STAT_TX_PORT_65B_127B_IX,
2628        FW_STAT_TX_PORT_128B_255B_IX,
2629        FW_STAT_TX_PORT_256B_511B_IX,
2630        FW_STAT_TX_PORT_512B_1023B_IX,
2631        FW_STAT_TX_PORT_1024B_1518B_IX,
2632        FW_STAT_TX_PORT_1519B_MAX_IX,
2633        FW_STAT_TX_PORT_DROP_IX,
2634        FW_STAT_TX_PORT_PAUSE_IX,
2635        FW_STAT_TX_PORT_PPP0_IX,
2636        FW_STAT_TX_PORT_PPP1_IX,
2637        FW_STAT_TX_PORT_PPP2_IX,
2638        FW_STAT_TX_PORT_PPP3_IX,
2639        FW_STAT_TX_PORT_PPP4_IX,
2640        FW_STAT_TX_PORT_PPP5_IX,
2641        FW_STAT_TX_PORT_PPP6_IX,
2642        FW_STAT_TX_PORT_PPP7_IX,
2643        FW_NUM_PORT_TX_STATS
2644};
2645
2646enum fw_port_stat_rx_index {
2647        FW_STAT_RX_PORT_BYTES_IX = 0,
2648        FW_STAT_RX_PORT_FRAMES_IX,
2649        FW_STAT_RX_PORT_BCAST_IX,
2650        FW_STAT_RX_PORT_MCAST_IX,
2651        FW_STAT_RX_PORT_UCAST_IX,
2652        FW_STAT_RX_PORT_MTU_ERROR_IX,
2653        FW_STAT_RX_PORT_MTU_CRC_ERROR_IX,
2654        FW_STAT_RX_PORT_CRC_ERROR_IX,
2655        FW_STAT_RX_PORT_LEN_ERROR_IX,
2656        FW_STAT_RX_PORT_SYM_ERROR_IX,
2657        FW_STAT_RX_PORT_64B_IX,
2658        FW_STAT_RX_PORT_65B_127B_IX,
2659        FW_STAT_RX_PORT_128B_255B_IX,
2660        FW_STAT_RX_PORT_256B_511B_IX,
2661        FW_STAT_RX_PORT_512B_1023B_IX,
2662        FW_STAT_RX_PORT_1024B_1518B_IX,
2663        FW_STAT_RX_PORT_1519B_MAX_IX,
2664        FW_STAT_RX_PORT_PAUSE_IX,
2665        FW_STAT_RX_PORT_PPP0_IX,
2666        FW_STAT_RX_PORT_PPP1_IX,
2667        FW_STAT_RX_PORT_PPP2_IX,
2668        FW_STAT_RX_PORT_PPP3_IX,
2669        FW_STAT_RX_PORT_PPP4_IX,
2670        FW_STAT_RX_PORT_PPP5_IX,
2671        FW_STAT_RX_PORT_PPP6_IX,
2672        FW_STAT_RX_PORT_PPP7_IX,
2673        FW_STAT_RX_PORT_LESS_64B_IX,
2674        FW_STAT_RX_PORT_MAC_ERROR_IX,
2675        FW_NUM_PORT_RX_STATS
2676};
2677
2678/* port stats */
2679#define FW_NUM_PORT_STATS (FW_NUM_PORT_TX_STATS + FW_NUM_PORT_RX_STATS)
2680
2681struct fw_port_stats_cmd {
2682        __be32 op_to_portid;
2683        __be32 retval_len16;
2684        union fw_port_stats {
2685                struct fw_port_stats_ctl {
2686                        u8 nstats_bg_bm;
2687                        u8 tx_ix;
2688                        __be16 r6;
2689                        __be32 r7;
2690                        __be64 stat0;
2691                        __be64 stat1;
2692                        __be64 stat2;
2693                        __be64 stat3;
2694                        __be64 stat4;
2695                        __be64 stat5;
2696                } ctl;
2697                struct fw_port_stats_all {
2698                        __be64 tx_bytes;
2699                        __be64 tx_frames;
2700                        __be64 tx_bcast;
2701                        __be64 tx_mcast;
2702                        __be64 tx_ucast;
2703                        __be64 tx_error;
2704                        __be64 tx_64b;
2705                        __be64 tx_65b_127b;
2706                        __be64 tx_128b_255b;
2707                        __be64 tx_256b_511b;
2708                        __be64 tx_512b_1023b;
2709                        __be64 tx_1024b_1518b;
2710                        __be64 tx_1519b_max;
2711                        __be64 tx_drop;
2712                        __be64 tx_pause;
2713                        __be64 tx_ppp0;
2714                        __be64 tx_ppp1;
2715                        __be64 tx_ppp2;
2716                        __be64 tx_ppp3;
2717                        __be64 tx_ppp4;
2718                        __be64 tx_ppp5;
2719                        __be64 tx_ppp6;
2720                        __be64 tx_ppp7;
2721                        __be64 rx_bytes;
2722                        __be64 rx_frames;
2723                        __be64 rx_bcast;
2724                        __be64 rx_mcast;
2725                        __be64 rx_ucast;
2726                        __be64 rx_mtu_error;
2727                        __be64 rx_mtu_crc_error;
2728                        __be64 rx_crc_error;
2729                        __be64 rx_len_error;
2730                        __be64 rx_sym_error;
2731                        __be64 rx_64b;
2732                        __be64 rx_65b_127b;
2733                        __be64 rx_128b_255b;
2734                        __be64 rx_256b_511b;
2735                        __be64 rx_512b_1023b;
2736                        __be64 rx_1024b_1518b;
2737                        __be64 rx_1519b_max;
2738                        __be64 rx_pause;
2739                        __be64 rx_ppp0;
2740                        __be64 rx_ppp1;
2741                        __be64 rx_ppp2;
2742                        __be64 rx_ppp3;
2743                        __be64 rx_ppp4;
2744                        __be64 rx_ppp5;
2745                        __be64 rx_ppp6;
2746                        __be64 rx_ppp7;
2747                        __be64 rx_less_64b;
2748                        __be64 rx_bg_drop;
2749                        __be64 rx_bg_trunc;
2750                } all;
2751        } u;
2752};
2753
2754/* port loopback stats */
2755#define FW_NUM_LB_STATS 16
2756enum fw_port_lb_stats_index {
2757        FW_STAT_LB_PORT_BYTES_IX,
2758        FW_STAT_LB_PORT_FRAMES_IX,
2759        FW_STAT_LB_PORT_BCAST_IX,
2760        FW_STAT_LB_PORT_MCAST_IX,
2761        FW_STAT_LB_PORT_UCAST_IX,
2762        FW_STAT_LB_PORT_ERROR_IX,
2763        FW_STAT_LB_PORT_64B_IX,
2764        FW_STAT_LB_PORT_65B_127B_IX,
2765        FW_STAT_LB_PORT_128B_255B_IX,
2766        FW_STAT_LB_PORT_256B_511B_IX,
2767        FW_STAT_LB_PORT_512B_1023B_IX,
2768        FW_STAT_LB_PORT_1024B_1518B_IX,
2769        FW_STAT_LB_PORT_1519B_MAX_IX,
2770        FW_STAT_LB_PORT_DROP_FRAMES_IX
2771};
2772
2773struct fw_port_lb_stats_cmd {
2774        __be32 op_to_lbport;
2775        __be32 retval_len16;
2776        union fw_port_lb_stats {
2777                struct fw_port_lb_stats_ctl {
2778                        u8 nstats_bg_bm;
2779                        u8 ix_pkd;
2780                        __be16 r6;
2781                        __be32 r7;
2782                        __be64 stat0;
2783                        __be64 stat1;
2784                        __be64 stat2;
2785                        __be64 stat3;
2786                        __be64 stat4;
2787                        __be64 stat5;
2788                } ctl;
2789                struct fw_port_lb_stats_all {
2790                        __be64 tx_bytes;
2791                        __be64 tx_frames;
2792                        __be64 tx_bcast;
2793                        __be64 tx_mcast;
2794                        __be64 tx_ucast;
2795                        __be64 tx_error;
2796                        __be64 tx_64b;
2797                        __be64 tx_65b_127b;
2798                        __be64 tx_128b_255b;
2799                        __be64 tx_256b_511b;
2800                        __be64 tx_512b_1023b;
2801                        __be64 tx_1024b_1518b;
2802                        __be64 tx_1519b_max;
2803                        __be64 rx_lb_drop;
2804                        __be64 rx_lb_trunc;
2805                } all;
2806        } u;
2807};
2808
2809enum fw_ptp_subop {
2810        /* none */
2811        FW_PTP_SC_INIT_TIMER            = 0x00,
2812        FW_PTP_SC_TX_TYPE               = 0x01,
2813        /* init */
2814        FW_PTP_SC_RXTIME_STAMP          = 0x08,
2815        FW_PTP_SC_RDRX_TYPE             = 0x09,
2816        /* ts */
2817        FW_PTP_SC_ADJ_FREQ              = 0x10,
2818        FW_PTP_SC_ADJ_TIME              = 0x11,
2819        FW_PTP_SC_ADJ_FTIME             = 0x12,
2820        FW_PTP_SC_WALL_CLOCK            = 0x13,
2821        FW_PTP_SC_GET_TIME              = 0x14,
2822        FW_PTP_SC_SET_TIME              = 0x15,
2823};
2824
2825struct fw_ptp_cmd {
2826        __be32 op_to_portid;
2827        __be32 retval_len16;
2828        union fw_ptp {
2829                struct fw_ptp_sc {
2830                        __u8   sc;
2831                        __u8   r3[7];
2832                } scmd;
2833                struct fw_ptp_init {
2834                        __u8   sc;
2835                        __u8   txchan;
2836                        __be16 absid;
2837                        __be16 mode;
2838                        __be16 r3;
2839                } init;
2840                struct fw_ptp_ts {
2841                        __u8   sc;
2842                        __u8   sign;
2843                        __be16 r3;
2844                        __be32 ppb;
2845                        __be64 tm;
2846                } ts;
2847        } u;
2848        __be64 r3;
2849};
2850
2851#define FW_PTP_CMD_PORTID_S             0
2852#define FW_PTP_CMD_PORTID_M             0xf
2853#define FW_PTP_CMD_PORTID_V(x)          ((x) << FW_PTP_CMD_PORTID_S)
2854#define FW_PTP_CMD_PORTID_G(x)          \
2855        (((x) >> FW_PTP_CMD_PORTID_S) & FW_PTP_CMD_PORTID_M)
2856
2857struct fw_rss_ind_tbl_cmd {
2858        __be32 op_to_viid;
2859        __be32 retval_len16;
2860        __be16 niqid;
2861        __be16 startidx;
2862        __be32 r3;
2863        __be32 iq0_to_iq2;
2864        __be32 iq3_to_iq5;
2865        __be32 iq6_to_iq8;
2866        __be32 iq9_to_iq11;
2867        __be32 iq12_to_iq14;
2868        __be32 iq15_to_iq17;
2869        __be32 iq18_to_iq20;
2870        __be32 iq21_to_iq23;
2871        __be32 iq24_to_iq26;
2872        __be32 iq27_to_iq29;
2873        __be32 iq30_iq31;
2874        __be32 r15_lo;
2875};
2876
2877#define FW_RSS_IND_TBL_CMD_VIID_S       0
2878#define FW_RSS_IND_TBL_CMD_VIID_V(x)    ((x) << FW_RSS_IND_TBL_CMD_VIID_S)
2879
2880#define FW_RSS_IND_TBL_CMD_IQ0_S        20
2881#define FW_RSS_IND_TBL_CMD_IQ0_V(x)     ((x) << FW_RSS_IND_TBL_CMD_IQ0_S)
2882
2883#define FW_RSS_IND_TBL_CMD_IQ1_S        10
2884#define FW_RSS_IND_TBL_CMD_IQ1_V(x)     ((x) << FW_RSS_IND_TBL_CMD_IQ1_S)
2885
2886#define FW_RSS_IND_TBL_CMD_IQ2_S        0
2887#define FW_RSS_IND_TBL_CMD_IQ2_V(x)     ((x) << FW_RSS_IND_TBL_CMD_IQ2_S)
2888
2889struct fw_rss_glb_config_cmd {
2890        __be32 op_to_write;
2891        __be32 retval_len16;
2892        union fw_rss_glb_config {
2893                struct fw_rss_glb_config_manual {
2894                        __be32 mode_pkd;
2895                        __be32 r3;
2896                        __be64 r4;
2897                        __be64 r5;
2898                } manual;
2899                struct fw_rss_glb_config_basicvirtual {
2900                        __be32 mode_pkd;
2901                        __be32 synmapen_to_hashtoeplitz;
2902                        __be64 r8;
2903                        __be64 r9;
2904                } basicvirtual;
2905        } u;
2906};
2907
2908#define FW_RSS_GLB_CONFIG_CMD_MODE_S    28
2909#define FW_RSS_GLB_CONFIG_CMD_MODE_M    0xf
2910#define FW_RSS_GLB_CONFIG_CMD_MODE_V(x) ((x) << FW_RSS_GLB_CONFIG_CMD_MODE_S)
2911#define FW_RSS_GLB_CONFIG_CMD_MODE_G(x) \
2912        (((x) >> FW_RSS_GLB_CONFIG_CMD_MODE_S) & FW_RSS_GLB_CONFIG_CMD_MODE_M)
2913
2914#define FW_RSS_GLB_CONFIG_CMD_MODE_MANUAL       0
2915#define FW_RSS_GLB_CONFIG_CMD_MODE_BASICVIRTUAL 1
2916
2917#define FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_S        8
2918#define FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_V(x)     \
2919        ((x) << FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_S)
2920#define FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_F        \
2921        FW_RSS_GLB_CONFIG_CMD_SYNMAPEN_V(1U)
2922
2923#define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_S           7
2924#define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_V(x)        \
2925        ((x) << FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_S)
2926#define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_F   \
2927        FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6_V(1U)
2928
2929#define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_S           6
2930#define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_V(x)        \
2931        ((x) << FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_S)
2932#define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_F   \
2933        FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6_V(1U)
2934
2935#define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_S           5
2936#define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_V(x)        \
2937        ((x) << FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_S)
2938#define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_F   \
2939        FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4_V(1U)
2940
2941#define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_S           4
2942#define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_V(x)        \
2943        ((x) << FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_S)
2944#define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_F   \
2945        FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4_V(1U)
2946
2947#define FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_S        3
2948#define FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_V(x)     \
2949        ((x) << FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_S)
2950#define FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_F        \
2951        FW_RSS_GLB_CONFIG_CMD_OFDMAPEN_V(1U)
2952
2953#define FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_S        2
2954#define FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_V(x)     \
2955        ((x) << FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_S)
2956#define FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_F        \
2957        FW_RSS_GLB_CONFIG_CMD_TNLMAPEN_V(1U)
2958
2959#define FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_S       1
2960#define FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_V(x)    \
2961        ((x) << FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_S)
2962#define FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_F       \
2963        FW_RSS_GLB_CONFIG_CMD_TNLALLLKP_V(1U)
2964
2965#define FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_S    0
2966#define FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_V(x) \
2967        ((x) << FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_S)
2968#define FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_F    \
2969        FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ_V(1U)
2970
2971struct fw_rss_vi_config_cmd {
2972        __be32 op_to_viid;
2973#define FW_RSS_VI_CONFIG_CMD_VIID(x) ((x) << 0)
2974        __be32 retval_len16;
2975        union fw_rss_vi_config {
2976                struct fw_rss_vi_config_manual {
2977                        __be64 r3;
2978                        __be64 r4;
2979                        __be64 r5;
2980                } manual;
2981                struct fw_rss_vi_config_basicvirtual {
2982                        __be32 r6;
2983                        __be32 defaultq_to_udpen;
2984                        __be64 r9;
2985                        __be64 r10;
2986                } basicvirtual;
2987        } u;
2988};
2989
2990#define FW_RSS_VI_CONFIG_CMD_VIID_S     0
2991#define FW_RSS_VI_CONFIG_CMD_VIID_V(x)  ((x) << FW_RSS_VI_CONFIG_CMD_VIID_S)
2992
2993#define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_S         16
2994#define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_M         0x3ff
2995#define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_V(x)      \
2996        ((x) << FW_RSS_VI_CONFIG_CMD_DEFAULTQ_S)
2997#define FW_RSS_VI_CONFIG_CMD_DEFAULTQ_G(x)      \
2998        (((x) >> FW_RSS_VI_CONFIG_CMD_DEFAULTQ_S) & \
2999         FW_RSS_VI_CONFIG_CMD_DEFAULTQ_M)
3000
3001#define FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_S     4
3002#define FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_V(x)  \
3003        ((x) << FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_S)
3004#define FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_F     \
3005        FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN_V(1U)
3006
3007#define FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_S      3
3008#define FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_V(x)   \
3009        ((x) << FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_S)
3010#define FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_F      \
3011        FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN_V(1U)
3012
3013#define FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_S     2
3014#define FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_V(x)  \
3015        ((x) << FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_S)
3016#define FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_F     \
3017        FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN_V(1U)
3018
3019#define FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_S      1
3020#define FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_V(x)   \
3021        ((x) << FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_S)
3022#define FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_F      \
3023        FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN_V(1U)
3024
3025#define FW_RSS_VI_CONFIG_CMD_UDPEN_S    0
3026#define FW_RSS_VI_CONFIG_CMD_UDPEN_V(x) ((x) << FW_RSS_VI_CONFIG_CMD_UDPEN_S)
3027#define FW_RSS_VI_CONFIG_CMD_UDPEN_F    FW_RSS_VI_CONFIG_CMD_UDPEN_V(1U)
3028
3029enum fw_sched_sc {
3030        FW_SCHED_SC_PARAMS              = 1,
3031};
3032
3033struct fw_sched_cmd {
3034        __be32 op_to_write;
3035        __be32 retval_len16;
3036        union fw_sched {
3037                struct fw_sched_config {
3038                        __u8   sc;
3039                        __u8   type;
3040                        __u8   minmaxen;
3041                        __u8   r3[5];
3042                        __u8   nclasses[4];
3043                        __be32 r4;
3044                } config;
3045                struct fw_sched_params {
3046                        __u8   sc;
3047                        __u8   type;
3048                        __u8   level;
3049                        __u8   mode;
3050                        __u8   unit;
3051                        __u8   rate;
3052                        __u8   ch;
3053                        __u8   cl;
3054                        __be32 min;
3055                        __be32 max;
3056                        __be16 weight;
3057                        __be16 pktsize;
3058                        __be16 burstsize;
3059                        __be16 r4;
3060                } params;
3061        } u;
3062};
3063
3064struct fw_clip_cmd {
3065        __be32 op_to_write;
3066        __be32 alloc_to_len16;
3067        __be64 ip_hi;
3068        __be64 ip_lo;
3069        __be32 r4[2];
3070};
3071
3072#define FW_CLIP_CMD_ALLOC_S     31
3073#define FW_CLIP_CMD_ALLOC_V(x)  ((x) << FW_CLIP_CMD_ALLOC_S)
3074#define FW_CLIP_CMD_ALLOC_F     FW_CLIP_CMD_ALLOC_V(1U)
3075
3076#define FW_CLIP_CMD_FREE_S      30
3077#define FW_CLIP_CMD_FREE_V(x)   ((x) << FW_CLIP_CMD_FREE_S)
3078#define FW_CLIP_CMD_FREE_F      FW_CLIP_CMD_FREE_V(1U)
3079
3080enum fw_error_type {
3081        FW_ERROR_TYPE_EXCEPTION         = 0x0,
3082        FW_ERROR_TYPE_HWMODULE          = 0x1,
3083        FW_ERROR_TYPE_WR                = 0x2,
3084        FW_ERROR_TYPE_ACL               = 0x3,
3085};
3086
3087struct fw_error_cmd {
3088        __be32 op_to_type;
3089        __be32 len16_pkd;
3090        union fw_error {
3091                struct fw_error_exception {
3092                        __be32 info[6];
3093                } exception;
3094                struct fw_error_hwmodule {
3095                        __be32 regaddr;
3096                        __be32 regval;
3097                } hwmodule;
3098                struct fw_error_wr {
3099                        __be16 cidx;
3100                        __be16 pfn_vfn;
3101                        __be32 eqid;
3102                        u8 wrhdr[16];
3103                } wr;
3104                struct fw_error_acl {
3105                        __be16 cidx;
3106                        __be16 pfn_vfn;
3107                        __be32 eqid;
3108                        __be16 mv_pkd;
3109                        u8 val[6];
3110                        __be64 r4;
3111                } acl;
3112        } u;
3113};
3114
3115struct fw_debug_cmd {
3116        __be32 op_type;
3117        __be32 len16_pkd;
3118        union fw_debug {
3119                struct fw_debug_assert {
3120                        __be32 fcid;
3121                        __be32 line;
3122                        __be32 x;
3123                        __be32 y;
3124                        u8 filename_0_7[8];
3125                        u8 filename_8_15[8];
3126                        __be64 r3;
3127                } assert;
3128                struct fw_debug_prt {
3129                        __be16 dprtstridx;
3130                        __be16 r3[3];
3131                        __be32 dprtstrparam0;
3132                        __be32 dprtstrparam1;
3133                        __be32 dprtstrparam2;
3134                        __be32 dprtstrparam3;
3135                } prt;
3136        } u;
3137};
3138
3139#define FW_DEBUG_CMD_TYPE_S     0
3140#define FW_DEBUG_CMD_TYPE_M     0xff
3141#define FW_DEBUG_CMD_TYPE_G(x)  \
3142        (((x) >> FW_DEBUG_CMD_TYPE_S) & FW_DEBUG_CMD_TYPE_M)
3143
3144enum pcie_fw_eval {
3145        PCIE_FW_EVAL_CRASH = 0,
3146};
3147
3148#define PCIE_FW_ERR_S           31
3149#define PCIE_FW_ERR_V(x)        ((x) << PCIE_FW_ERR_S)
3150#define PCIE_FW_ERR_F           PCIE_FW_ERR_V(1U)
3151
3152#define PCIE_FW_INIT_S          30
3153#define PCIE_FW_INIT_V(x)       ((x) << PCIE_FW_INIT_S)
3154#define PCIE_FW_INIT_F          PCIE_FW_INIT_V(1U)
3155
3156#define PCIE_FW_HALT_S          29
3157#define PCIE_FW_HALT_V(x)       ((x) << PCIE_FW_HALT_S)
3158#define PCIE_FW_HALT_F          PCIE_FW_HALT_V(1U)
3159
3160#define PCIE_FW_EVAL_S          24
3161#define PCIE_FW_EVAL_M          0x7
3162#define PCIE_FW_EVAL_G(x)       (((x) >> PCIE_FW_EVAL_S) & PCIE_FW_EVAL_M)
3163
3164#define PCIE_FW_MASTER_VLD_S    15
3165#define PCIE_FW_MASTER_VLD_V(x) ((x) << PCIE_FW_MASTER_VLD_S)
3166#define PCIE_FW_MASTER_VLD_F    PCIE_FW_MASTER_VLD_V(1U)
3167
3168#define PCIE_FW_MASTER_S        12
3169#define PCIE_FW_MASTER_M        0x7
3170#define PCIE_FW_MASTER_V(x)     ((x) << PCIE_FW_MASTER_S)
3171#define PCIE_FW_MASTER_G(x)     (((x) >> PCIE_FW_MASTER_S) & PCIE_FW_MASTER_M)
3172
3173struct fw_hdr {
3174        u8 ver;
3175        u8 chip;                        /* terminator chip type */
3176        __be16  len512;                 /* bin length in units of 512-bytes */
3177        __be32  fw_ver;                 /* firmware version */
3178        __be32  tp_microcode_ver;
3179        u8 intfver_nic;
3180        u8 intfver_vnic;
3181        u8 intfver_ofld;
3182        u8 intfver_ri;
3183        u8 intfver_iscsipdu;
3184        u8 intfver_iscsi;
3185        u8 intfver_fcoepdu;
3186        u8 intfver_fcoe;
3187        __u32   reserved2;
3188        __u32   reserved3;
3189        __u32   reserved4;
3190        __be32  flags;
3191        __be32  reserved6[23];
3192};
3193
3194enum fw_hdr_chip {
3195        FW_HDR_CHIP_T4,
3196        FW_HDR_CHIP_T5,
3197        FW_HDR_CHIP_T6
3198};
3199
3200#define FW_HDR_FW_VER_MAJOR_S   24
3201#define FW_HDR_FW_VER_MAJOR_M   0xff
3202#define FW_HDR_FW_VER_MAJOR_V(x) \
3203        ((x) << FW_HDR_FW_VER_MAJOR_S)
3204#define FW_HDR_FW_VER_MAJOR_G(x) \
3205        (((x) >> FW_HDR_FW_VER_MAJOR_S) & FW_HDR_FW_VER_MAJOR_M)
3206
3207#define FW_HDR_FW_VER_MINOR_S   16
3208#define FW_HDR_FW_VER_MINOR_M   0xff
3209#define FW_HDR_FW_VER_MINOR_V(x) \
3210        ((x) << FW_HDR_FW_VER_MINOR_S)
3211#define FW_HDR_FW_VER_MINOR_G(x) \
3212        (((x) >> FW_HDR_FW_VER_MINOR_S) & FW_HDR_FW_VER_MINOR_M)
3213
3214#define FW_HDR_FW_VER_MICRO_S   8
3215#define FW_HDR_FW_VER_MICRO_M   0xff
3216#define FW_HDR_FW_VER_MICRO_V(x) \
3217        ((x) << FW_HDR_FW_VER_MICRO_S)
3218#define FW_HDR_FW_VER_MICRO_G(x) \
3219        (((x) >> FW_HDR_FW_VER_MICRO_S) & FW_HDR_FW_VER_MICRO_M)
3220
3221#define FW_HDR_FW_VER_BUILD_S   0
3222#define FW_HDR_FW_VER_BUILD_M   0xff
3223#define FW_HDR_FW_VER_BUILD_V(x) \
3224        ((x) << FW_HDR_FW_VER_BUILD_S)
3225#define FW_HDR_FW_VER_BUILD_G(x) \
3226        (((x) >> FW_HDR_FW_VER_BUILD_S) & FW_HDR_FW_VER_BUILD_M)
3227
3228enum fw_hdr_intfver {
3229        FW_HDR_INTFVER_NIC      = 0x00,
3230        FW_HDR_INTFVER_VNIC     = 0x00,
3231        FW_HDR_INTFVER_OFLD     = 0x00,
3232        FW_HDR_INTFVER_RI       = 0x00,
3233        FW_HDR_INTFVER_ISCSIPDU = 0x00,
3234        FW_HDR_INTFVER_ISCSI    = 0x00,
3235        FW_HDR_INTFVER_FCOEPDU  = 0x00,
3236        FW_HDR_INTFVER_FCOE     = 0x00,
3237};
3238
3239enum fw_hdr_flags {
3240        FW_HDR_FLAGS_RESET_HALT = 0x00000001,
3241};
3242
3243/* length of the formatting string  */
3244#define FW_DEVLOG_FMT_LEN       192
3245
3246/* maximum number of the formatting string parameters */
3247#define FW_DEVLOG_FMT_PARAMS_NUM 8
3248
3249/* priority levels */
3250enum fw_devlog_level {
3251        FW_DEVLOG_LEVEL_EMERG   = 0x0,
3252        FW_DEVLOG_LEVEL_CRIT    = 0x1,
3253        FW_DEVLOG_LEVEL_ERR     = 0x2,
3254        FW_DEVLOG_LEVEL_NOTICE  = 0x3,
3255        FW_DEVLOG_LEVEL_INFO    = 0x4,
3256        FW_DEVLOG_LEVEL_DEBUG   = 0x5,
3257        FW_DEVLOG_LEVEL_MAX     = 0x5,
3258};
3259
3260/* facilities that may send a log message */
3261enum fw_devlog_facility {
3262        FW_DEVLOG_FACILITY_CORE         = 0x00,
3263        FW_DEVLOG_FACILITY_CF           = 0x01,
3264        FW_DEVLOG_FACILITY_SCHED        = 0x02,
3265        FW_DEVLOG_FACILITY_TIMER        = 0x04,
3266        FW_DEVLOG_FACILITY_RES          = 0x06,
3267        FW_DEVLOG_FACILITY_HW           = 0x08,
3268        FW_DEVLOG_FACILITY_FLR          = 0x10,
3269        FW_DEVLOG_FACILITY_DMAQ         = 0x12,
3270        FW_DEVLOG_FACILITY_PHY          = 0x14,
3271        FW_DEVLOG_FACILITY_MAC          = 0x16,
3272        FW_DEVLOG_FACILITY_PORT         = 0x18,
3273        FW_DEVLOG_FACILITY_VI           = 0x1A,
3274        FW_DEVLOG_FACILITY_FILTER       = 0x1C,
3275        FW_DEVLOG_FACILITY_ACL          = 0x1E,
3276        FW_DEVLOG_FACILITY_TM           = 0x20,
3277        FW_DEVLOG_FACILITY_QFC          = 0x22,
3278        FW_DEVLOG_FACILITY_DCB          = 0x24,
3279        FW_DEVLOG_FACILITY_ETH          = 0x26,
3280        FW_DEVLOG_FACILITY_OFLD         = 0x28,
3281        FW_DEVLOG_FACILITY_RI           = 0x2A,
3282        FW_DEVLOG_FACILITY_ISCSI        = 0x2C,
3283        FW_DEVLOG_FACILITY_FCOE         = 0x2E,
3284        FW_DEVLOG_FACILITY_FOISCSI      = 0x30,
3285        FW_DEVLOG_FACILITY_FOFCOE       = 0x32,
3286        FW_DEVLOG_FACILITY_CHNET        = 0x34,
3287        FW_DEVLOG_FACILITY_MAX          = 0x34,
3288};
3289
3290/* log message format */
3291struct fw_devlog_e {
3292        __be64  timestamp;
3293        __be32  seqno;
3294        __be16  reserved1;
3295        __u8    level;
3296        __u8    facility;
3297        __u8    fmt[FW_DEVLOG_FMT_LEN];
3298        __be32  params[FW_DEVLOG_FMT_PARAMS_NUM];
3299        __be32  reserved3[4];
3300};
3301
3302struct fw_devlog_cmd {
3303        __be32 op_to_write;
3304        __be32 retval_len16;
3305        __u8   level;
3306        __u8   r2[7];
3307        __be32 memtype_devlog_memaddr16_devlog;
3308        __be32 memsize_devlog;
3309        __be32 r3[2];
3310};
3311
3312#define FW_DEVLOG_CMD_MEMTYPE_DEVLOG_S          28
3313#define FW_DEVLOG_CMD_MEMTYPE_DEVLOG_M          0xf
3314#define FW_DEVLOG_CMD_MEMTYPE_DEVLOG_G(x)       \
3315        (((x) >> FW_DEVLOG_CMD_MEMTYPE_DEVLOG_S) & \
3316         FW_DEVLOG_CMD_MEMTYPE_DEVLOG_M)
3317
3318#define FW_DEVLOG_CMD_MEMADDR16_DEVLOG_S        0
3319#define FW_DEVLOG_CMD_MEMADDR16_DEVLOG_M        0xfffffff
3320#define FW_DEVLOG_CMD_MEMADDR16_DEVLOG_G(x)     \
3321        (((x) >> FW_DEVLOG_CMD_MEMADDR16_DEVLOG_S) & \
3322         FW_DEVLOG_CMD_MEMADDR16_DEVLOG_M)
3323
3324/* P C I E   F W   P F 7   R E G I S T E R */
3325
3326/* PF7 stores the Firmware Device Log parameters which allows Host Drivers to
3327 * access the "devlog" which needing to contact firmware.  The encoding is
3328 * mostly the same as that returned by the DEVLOG command except for the size
3329 * which is encoded as the number of entries in multiples-1 of 128 here rather
3330 * than the memory size as is done in the DEVLOG command.  Thus, 0 means 128
3331 * and 15 means 2048.  This of course in turn constrains the allowed values
3332 * for the devlog size ...
3333 */
3334#define PCIE_FW_PF_DEVLOG               7
3335
3336#define PCIE_FW_PF_DEVLOG_NENTRIES128_S 28
3337#define PCIE_FW_PF_DEVLOG_NENTRIES128_M 0xf
3338#define PCIE_FW_PF_DEVLOG_NENTRIES128_V(x) \
3339        ((x) << PCIE_FW_PF_DEVLOG_NENTRIES128_S)
3340#define PCIE_FW_PF_DEVLOG_NENTRIES128_G(x) \
3341        (((x) >> PCIE_FW_PF_DEVLOG_NENTRIES128_S) & \
3342         PCIE_FW_PF_DEVLOG_NENTRIES128_M)
3343
3344#define PCIE_FW_PF_DEVLOG_ADDR16_S      4
3345#define PCIE_FW_PF_DEVLOG_ADDR16_M      0xffffff
3346#define PCIE_FW_PF_DEVLOG_ADDR16_V(x)   ((x) << PCIE_FW_PF_DEVLOG_ADDR16_S)
3347#define PCIE_FW_PF_DEVLOG_ADDR16_G(x) \
3348        (((x) >> PCIE_FW_PF_DEVLOG_ADDR16_S) & PCIE_FW_PF_DEVLOG_ADDR16_M)
3349
3350#define PCIE_FW_PF_DEVLOG_MEMTYPE_S     0
3351#define PCIE_FW_PF_DEVLOG_MEMTYPE_M     0xf
3352#define PCIE_FW_PF_DEVLOG_MEMTYPE_V(x)  ((x) << PCIE_FW_PF_DEVLOG_MEMTYPE_S)
3353#define PCIE_FW_PF_DEVLOG_MEMTYPE_G(x) \
3354        (((x) >> PCIE_FW_PF_DEVLOG_MEMTYPE_S) & PCIE_FW_PF_DEVLOG_MEMTYPE_M)
3355
3356#define MAX_IMM_OFLD_TX_DATA_WR_LEN (0xff + sizeof(struct fw_ofld_tx_data_wr))
3357
3358struct fw_crypto_lookaside_wr {
3359        __be32 op_to_cctx_size;
3360        __be32 len16_pkd;
3361        __be32 session_id;
3362        __be32 rx_chid_to_rx_q_id;
3363        __be32 key_addr;
3364        __be32 pld_size_hash_size;
3365        __be64 cookie;
3366};
3367
3368#define FW_CRYPTO_LOOKASIDE_WR_OPCODE_S 24
3369#define FW_CRYPTO_LOOKASIDE_WR_OPCODE_M 0xff
3370#define FW_CRYPTO_LOOKASIDE_WR_OPCODE_V(x) \
3371        ((x) << FW_CRYPTO_LOOKASIDE_WR_OPCODE_S)
3372#define FW_CRYPTO_LOOKASIDE_WR_OPCODE_G(x) \
3373        (((x) >> FW_CRYPTO_LOOKASIDE_WR_OPCODE_S) & \
3374         FW_CRYPTO_LOOKASIDE_WR_OPCODE_M)
3375
3376#define FW_CRYPTO_LOOKASIDE_WR_COMPL_S 23
3377#define FW_CRYPTO_LOOKASIDE_WR_COMPL_M 0x1
3378#define FW_CRYPTO_LOOKASIDE_WR_COMPL_V(x) \
3379        ((x) << FW_CRYPTO_LOOKASIDE_WR_COMPL_S)
3380#define FW_CRYPTO_LOOKASIDE_WR_COMPL_G(x) \
3381        (((x) >> FW_CRYPTO_LOOKASIDE_WR_COMPL_S) & \
3382         FW_CRYPTO_LOOKASIDE_WR_COMPL_M)
3383#define FW_CRYPTO_LOOKASIDE_WR_COMPL_F FW_CRYPTO_LOOKASIDE_WR_COMPL_V(1U)
3384
3385#define FW_CRYPTO_LOOKASIDE_WR_IMM_LEN_S 15
3386#define FW_CRYPTO_LOOKASIDE_WR_IMM_LEN_M 0xff
3387#define FW_CRYPTO_LOOKASIDE_WR_IMM_LEN_V(x) \
3388        ((x) << FW_CRYPTO_LOOKASIDE_WR_IMM_LEN_S)
3389#define FW_CRYPTO_LOOKASIDE_WR_IMM_LEN_G(x) \
3390        (((x) >> FW_CRYPTO_LOOKASIDE_WR_IMM_LEN_S) & \
3391         FW_CRYPTO_LOOKASIDE_WR_IMM_LEN_M)
3392
3393#define FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC_S 5
3394#define FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC_M 0x3
3395#define FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC_V(x) \
3396        ((x) << FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC_S)
3397#define FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC_G(x) \
3398        (((x) >> FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC_S) & \
3399         FW_CRYPTO_LOOKASIDE_WR_CCTX_LOC_M)
3400
3401#define FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE_S 0
3402#define FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE_M 0x1f
3403#define FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE_V(x) \
3404        ((x) << FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE_S)
3405#define FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE_G(x) \
3406        (((x) >> FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE_S) & \
3407         FW_CRYPTO_LOOKASIDE_WR_CCTX_SIZE_M)
3408
3409#define FW_CRYPTO_LOOKASIDE_WR_LEN16_S 0
3410#define FW_CRYPTO_LOOKASIDE_WR_LEN16_M 0xff
3411#define FW_CRYPTO_LOOKASIDE_WR_LEN16_V(x) \
3412        ((x) << FW_CRYPTO_LOOKASIDE_WR_LEN16_S)
3413#define FW_CRYPTO_LOOKASIDE_WR_LEN16_G(x) \
3414        (((x) >> FW_CRYPTO_LOOKASIDE_WR_LEN16_S) & \
3415         FW_CRYPTO_LOOKASIDE_WR_LEN16_M)
3416
3417#define FW_CRYPTO_LOOKASIDE_WR_RX_CHID_S 29
3418#define FW_CRYPTO_LOOKASIDE_WR_RX_CHID_M 0x3
3419#define FW_CRYPTO_LOOKASIDE_WR_RX_CHID_V(x) \
3420        ((x) << FW_CRYPTO_LOOKASIDE_WR_RX_CHID_S)
3421#define FW_CRYPTO_LOOKASIDE_WR_RX_CHID_G(x) \
3422        (((x) >> FW_CRYPTO_LOOKASIDE_WR_RX_CHID_S) & \
3423         FW_CRYPTO_LOOKASIDE_WR_RX_CHID_M)
3424
3425#define FW_CRYPTO_LOOKASIDE_WR_LCB_S  27
3426#define FW_CRYPTO_LOOKASIDE_WR_LCB_M  0x3
3427#define FW_CRYPTO_LOOKASIDE_WR_LCB_V(x) \
3428        ((x) << FW_CRYPTO_LOOKASIDE_WR_LCB_S)
3429#define FW_CRYPTO_LOOKASIDE_WR_LCB_G(x) \
3430        (((x) >> FW_CRYPTO_LOOKASIDE_WR_LCB_S) & FW_CRYPTO_LOOKASIDE_WR_LCB_M)
3431
3432#define FW_CRYPTO_LOOKASIDE_WR_PHASH_S 25
3433#define FW_CRYPTO_LOOKASIDE_WR_PHASH_M 0x3
3434#define FW_CRYPTO_LOOKASIDE_WR_PHASH_V(x) \
3435        ((x) << FW_CRYPTO_LOOKASIDE_WR_PHASH_S)
3436#define FW_CRYPTO_LOOKASIDE_WR_PHASH_G(x) \
3437        (((x) >> FW_CRYPTO_LOOKASIDE_WR_PHASH_S) & \
3438         FW_CRYPTO_LOOKASIDE_WR_PHASH_M)
3439
3440#define FW_CRYPTO_LOOKASIDE_WR_IV_S   23
3441#define FW_CRYPTO_LOOKASIDE_WR_IV_M   0x3
3442#define FW_CRYPTO_LOOKASIDE_WR_IV_V(x) \
3443        ((x) << FW_CRYPTO_LOOKASIDE_WR_IV_S)
3444#define FW_CRYPTO_LOOKASIDE_WR_IV_G(x) \
3445        (((x) >> FW_CRYPTO_LOOKASIDE_WR_IV_S) & FW_CRYPTO_LOOKASIDE_WR_IV_M)
3446
3447#define FW_CRYPTO_LOOKASIDE_WR_FQIDX_S   15
3448#define FW_CRYPTO_LOOKASIDE_WR_FQIDX_M   0xff
3449#define FW_CRYPTO_LOOKASIDE_WR_FQIDX_V(x) \
3450        ((x) << FW_CRYPTO_LOOKASIDE_WR_FQIDX_S)
3451#define FW_CRYPTO_LOOKASIDE_WR_FQIDX_G(x) \
3452        (((x) >> FW_CRYPTO_LOOKASIDE_WR_FQIDX_S) & \
3453         FW_CRYPTO_LOOKASIDE_WR_FQIDX_M)
3454
3455#define FW_CRYPTO_LOOKASIDE_WR_TX_CH_S 10
3456#define FW_CRYPTO_LOOKASIDE_WR_TX_CH_M 0x3
3457#define FW_CRYPTO_LOOKASIDE_WR_TX_CH_V(x) \
3458        ((x) << FW_CRYPTO_LOOKASIDE_WR_TX_CH_S)
3459#define FW_CRYPTO_LOOKASIDE_WR_TX_CH_G(x) \
3460        (((x) >> FW_CRYPTO_LOOKASIDE_WR_TX_CH_S) & \
3461         FW_CRYPTO_LOOKASIDE_WR_TX_CH_M)
3462
3463#define FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID_S 0
3464#define FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID_M 0x3ff
3465#define FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID_V(x) \
3466        ((x) << FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID_S)
3467#define FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID_G(x) \
3468        (((x) >> FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID_S) & \
3469         FW_CRYPTO_LOOKASIDE_WR_RX_Q_ID_M)
3470
3471#define FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE_S 24
3472#define FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE_M 0xff
3473#define FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE_V(x) \
3474        ((x) << FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE_S)
3475#define FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE_G(x) \
3476        (((x) >> FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE_S) & \
3477         FW_CRYPTO_LOOKASIDE_WR_PLD_SIZE_M)
3478
3479#define FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE_S 17
3480#define FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE_M 0x7f
3481#define FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE_V(x) \
3482        ((x) << FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE_S)
3483#define FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE_G(x) \
3484        (((x) >> FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE_S) & \
3485         FW_CRYPTO_LOOKASIDE_WR_HASH_SIZE_M)
3486
3487#endif /* _T4FW_INTERFACE_H_ */
3488