--- zzzz-none-000/linux-3.10.107/drivers/net/ethernet/brocade/bna/bfi_enet.h 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/net/ethernet/brocade/bna/bfi_enet.h 2021-02-04 17:41:59.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Linux network driver for Brocade Converged Network Adapter. + * Linux network driver for QLogic BR-series Converged Network Adapter. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License (GPL) Version 2 as @@ -11,9 +11,10 @@ * General Public License for more details. */ /* - * Copyright (c) 2005-2011 Brocade Communications Systems, Inc. + * Copyright (c) 2005-2014 Brocade Communications Systems, Inc. + * Copyright (c) 2014-2015 QLogic Corporation * All rights reserved - * www.brocade.com + * www.qlogic.com */ /* BNA Hardware and Firmware Interface */ @@ -35,8 +36,6 @@ #include "bfa_defs.h" #include "bfi.h" -#pragma pack(1) - #define BFI_ENET_CFG_MAX 32 /* Max resources per PF */ #define BFI_ENET_TXQ_PRIO_MAX 8 @@ -58,8 +57,8 @@ struct { u32 addr_hi; /* Most Significant 32-bits */ u32 addr_lo; /* Least Significant 32-Bits */ - } a32; -}; + } __packed a32; +} __packed; /* T X Q U E U E D E F I N E S */ /* TxQ Vector (a.k.a. Tx-Buffer Descriptor) */ @@ -69,13 +68,13 @@ #define BFI_ENET_TXQ_WI_EXTENSION (0x104) /* Extension WI */ /* TxQ Entry Control Flags */ -#define BFI_ENET_TXQ_WI_CF_FCOE_CRC (1 << 8) -#define BFI_ENET_TXQ_WI_CF_IPID_MODE (1 << 5) -#define BFI_ENET_TXQ_WI_CF_INS_PRIO (1 << 4) -#define BFI_ENET_TXQ_WI_CF_INS_VLAN (1 << 3) -#define BFI_ENET_TXQ_WI_CF_UDP_CKSUM (1 << 2) -#define BFI_ENET_TXQ_WI_CF_TCP_CKSUM (1 << 1) -#define BFI_ENET_TXQ_WI_CF_IP_CKSUM (1 << 0) +#define BFI_ENET_TXQ_WI_CF_FCOE_CRC BIT(8) +#define BFI_ENET_TXQ_WI_CF_IPID_MODE BIT(5) +#define BFI_ENET_TXQ_WI_CF_INS_PRIO BIT(4) +#define BFI_ENET_TXQ_WI_CF_INS_VLAN BIT(3) +#define BFI_ENET_TXQ_WI_CF_UDP_CKSUM BIT(2) +#define BFI_ENET_TXQ_WI_CF_TCP_CKSUM BIT(1) +#define BFI_ENET_TXQ_WI_CF_IP_CKSUM BIT(0) struct bfi_enet_txq_wi_base { u8 reserved; @@ -87,28 +86,28 @@ u16 vlan_tag; u16 lso_mss; /* Only 14 LSB are valid */ u32 frame_length; /* Only 24 LSB are valid */ -}; +} __packed; struct bfi_enet_txq_wi_ext { u16 reserved; u16 opcode; /* BFI_ENET_TXQ_WI_EXTENSION */ u32 reserved2[3]; -}; +} __packed; struct bfi_enet_txq_wi_vector { /* Tx Buffer Descriptor */ u16 reserved; u16 length; /* Only 14 LSB are valid */ union bfi_addr_be_u addr; -}; +} __packed; /* TxQ Entry Structure */ struct bfi_enet_txq_entry { union { struct bfi_enet_txq_wi_base base; struct bfi_enet_txq_wi_ext ext; - } wi; + } __packed wi; struct bfi_enet_txq_wi_vector vector[BFI_ENET_TXQ_WI_VECT_MAX]; -}; +} __packed; #define wi_hdr wi.base #define wi_ext_hdr wi.ext @@ -119,36 +118,36 @@ /* R X Q U E U E D E F I N E S */ struct bfi_enet_rxq_entry { union bfi_addr_be_u rx_buffer; -}; +} __packed; /* R X C O M P L E T I O N Q U E U E D E F I N E S */ /* CQ Entry Flags */ -#define BFI_ENET_CQ_EF_MAC_ERROR (1 << 0) -#define BFI_ENET_CQ_EF_FCS_ERROR (1 << 1) -#define BFI_ENET_CQ_EF_TOO_LONG (1 << 2) -#define BFI_ENET_CQ_EF_FC_CRC_OK (1 << 3) - -#define BFI_ENET_CQ_EF_RSVD1 (1 << 4) -#define BFI_ENET_CQ_EF_L4_CKSUM_OK (1 << 5) -#define BFI_ENET_CQ_EF_L3_CKSUM_OK (1 << 6) -#define BFI_ENET_CQ_EF_HDS_HEADER (1 << 7) - -#define BFI_ENET_CQ_EF_UDP (1 << 8) -#define BFI_ENET_CQ_EF_TCP (1 << 9) -#define BFI_ENET_CQ_EF_IP_OPTIONS (1 << 10) -#define BFI_ENET_CQ_EF_IPV6 (1 << 11) - -#define BFI_ENET_CQ_EF_IPV4 (1 << 12) -#define BFI_ENET_CQ_EF_VLAN (1 << 13) -#define BFI_ENET_CQ_EF_RSS (1 << 14) -#define BFI_ENET_CQ_EF_RSVD2 (1 << 15) - -#define BFI_ENET_CQ_EF_MCAST_MATCH (1 << 16) -#define BFI_ENET_CQ_EF_MCAST (1 << 17) -#define BFI_ENET_CQ_EF_BCAST (1 << 18) -#define BFI_ENET_CQ_EF_REMOTE (1 << 19) +#define BFI_ENET_CQ_EF_MAC_ERROR BIT(0) +#define BFI_ENET_CQ_EF_FCS_ERROR BIT(1) +#define BFI_ENET_CQ_EF_TOO_LONG BIT(2) +#define BFI_ENET_CQ_EF_FC_CRC_OK BIT(3) + +#define BFI_ENET_CQ_EF_RSVD1 BIT(4) +#define BFI_ENET_CQ_EF_L4_CKSUM_OK BIT(5) +#define BFI_ENET_CQ_EF_L3_CKSUM_OK BIT(6) +#define BFI_ENET_CQ_EF_HDS_HEADER BIT(7) + +#define BFI_ENET_CQ_EF_UDP BIT(8) +#define BFI_ENET_CQ_EF_TCP BIT(9) +#define BFI_ENET_CQ_EF_IP_OPTIONS BIT(10) +#define BFI_ENET_CQ_EF_IPV6 BIT(11) + +#define BFI_ENET_CQ_EF_IPV4 BIT(12) +#define BFI_ENET_CQ_EF_VLAN BIT(13) +#define BFI_ENET_CQ_EF_RSS BIT(14) +#define BFI_ENET_CQ_EF_RSVD2 BIT(15) + +#define BFI_ENET_CQ_EF_MCAST_MATCH BIT(16) +#define BFI_ENET_CQ_EF_MCAST BIT(17) +#define BFI_ENET_CQ_EF_BCAST BIT(18) +#define BFI_ENET_CQ_EF_REMOTE BIT(19) -#define BFI_ENET_CQ_EF_LOCAL (1 << 20) +#define BFI_ENET_CQ_EF_LOCAL BIT(20) /* CQ Entry Structure */ struct bfi_enet_cq_entry { @@ -160,7 +159,7 @@ u8 reserved1; u8 reserved2; u8 rxq_id; -}; +} __packed; /* E N E T C O N T R O L P A T H C O M M A N D S */ struct bfi_enet_q { @@ -168,23 +167,23 @@ union bfi_addr_u first_entry; u16 pages; /* # of pages */ u16 page_sz; -}; +} __packed; struct bfi_enet_txq { struct bfi_enet_q q; u8 priority; u8 rsvd[3]; -}; +} __packed; struct bfi_enet_rxq { struct bfi_enet_q q; u16 rx_buffer_size; u16 rsvd; -}; +} __packed; struct bfi_enet_cq { struct bfi_enet_q q; -}; +} __packed; struct bfi_enet_ib_cfg { u8 int_pkt_dma; @@ -197,16 +196,16 @@ u32 inter_pkt_timeout; u8 inter_pkt_count; u8 rsvd1[3]; -}; +} __packed; struct bfi_enet_ib { union bfi_addr_u index_addr; union { u16 msix_index; u16 intx_bitmask; - } intr; + } __packed intr; u16 rsvd; -}; +} __packed; /* ENET command messages */ enum bfi_enet_h2i_msgs { @@ -354,7 +353,7 @@ */ struct bfi_enet_req { struct bfi_msgq_mhdr mh; -}; +} __packed; /* Enable/Disable Request * @@ -369,7 +368,7 @@ struct bfi_msgq_mhdr mh; u8 enable; /* 1 = enable; 0 = disable */ u8 rsvd[3]; -}; +} __packed; /* Generic Response */ struct bfi_enet_rsp { @@ -377,7 +376,7 @@ u8 error; /*!< if error see cmd_offset */ u8 rsvd; u16 cmd_offset; /*!< offset to invalid parameter */ -}; +} __packed; /* GLOBAL CONFIGURATION */ @@ -386,7 +385,7 @@ */ struct bfi_enet_attr_req { struct bfi_msgq_mhdr mh; -}; +} __packed; /* bfi_enet_attr_rsp is used by: * BFI_ENET_I2H_GET_ATTR_RSP @@ -399,7 +398,7 @@ u32 max_cfg; u32 max_ucmac; u32 rit_size; -}; +} __packed; /* Tx Configuration * @@ -420,7 +419,7 @@ u8 apply_vlan_filter; u8 add_to_vswitch; u8 rsvd1[1]; -}; +} __packed; struct bfi_enet_tx_cfg_req { struct bfi_msgq_mhdr mh; @@ -430,7 +429,7 @@ struct { struct bfi_enet_txq q; struct bfi_enet_ib ib; - } q_cfg[BFI_ENET_TXQ_PRIO_MAX]; + } __packed q_cfg[BFI_ENET_TXQ_PRIO_MAX]; struct bfi_enet_ib_cfg ib_cfg; @@ -447,7 +446,7 @@ u32 i_dbell; /* PCI base address offset */ u8 hw_qid; /* For debugging */ u8 rsvd[3]; - } q_handles[BFI_ENET_TXQ_PRIO_MAX]; + } __packed q_handles[BFI_ENET_TXQ_PRIO_MAX]; }; /* Rx Configuration @@ -472,20 +471,21 @@ struct bfi_enet_rx_cfg { u8 rxq_type; - u8 rsvd[3]; + u8 rsvd[1]; + u16 frame_size; struct { u8 max_header_size; u8 force_offset; u8 type; u8 rsvd1; - } hds; + } __packed hds; u8 multi_buffer; u8 strip_vlan; u8 drop_untagged; u8 rsvd2; -}; +} __packed; /* * Multicast frames are received on the ql of q-set index zero. @@ -502,12 +502,12 @@ struct bfi_enet_rxq qs; /* small/header buffers */ struct bfi_enet_cq cq; struct bfi_enet_ib ib; - } q_cfg[BFI_ENET_RX_QSET_MAX]; + } __packed q_cfg[BFI_ENET_RX_QSET_MAX]; struct bfi_enet_ib_cfg ib_cfg; struct bfi_enet_rx_cfg rx_cfg; -}; +} __packed; struct bfi_enet_rx_cfg_rsp { struct bfi_msgq_mhdr mh; @@ -522,8 +522,8 @@ u8 hw_sqid; /* For debugging */ u8 hw_cqid; /* For debugging */ u8 rsvd; - } q_handles[BFI_ENET_RX_QSET_MAX]; -}; + } __packed q_handles[BFI_ENET_RX_QSET_MAX]; +} __packed; /* RIT * @@ -535,7 +535,7 @@ u16 size; /* number of table-entries used */ u8 rsvd[2]; u8 table[BFI_ENET_RSS_RIT_MAX]; -}; +} __packed; /* RSS * @@ -554,12 +554,12 @@ u8 mask; u8 rsvd[2]; u32 key[BFI_ENET_RSS_KEY_LEN]; -}; +} __packed; struct bfi_enet_rss_cfg_req { struct bfi_msgq_mhdr mh; struct bfi_enet_rss_cfg cfg; -}; +} __packed; /* MAC Unicast * @@ -571,16 +571,16 @@ */ struct bfi_enet_ucast_req { struct bfi_msgq_mhdr mh; - mac_t mac_addr; + u8 mac_addr[ETH_ALEN]; u8 rsvd[2]; -}; +} __packed; /* MAC Unicast + VLAN */ struct bfi_enet_mac_n_vlan_req { struct bfi_msgq_mhdr mh; u16 vlan_id; - mac_t mac_addr; -}; + u8 mac_addr[ETH_ALEN]; +} __packed; /* MAC Multicast * @@ -589,9 +589,9 @@ */ struct bfi_enet_mcast_add_req { struct bfi_msgq_mhdr mh; - mac_t mac_addr; + u8 mac_addr[ETH_ALEN]; u8 rsvd[2]; -}; +} __packed; /* bfi_enet_mac_mfilter_add_rsp is used by: * BFI_ENET_I2H_MAC_MCAST_ADD_RSP @@ -603,7 +603,7 @@ u16 cmd_offset; u16 handle; u8 rsvd1[2]; -}; +} __packed; /* bfi_enet_mac_mfilter_del_req is used by: * BFI_ENET_H2I_MAC_MCAST_DEL_REQ @@ -612,7 +612,7 @@ struct bfi_msgq_mhdr mh; u16 handle; u8 rsvd[2]; -}; +} __packed; /* VLAN * @@ -624,7 +624,7 @@ u8 block_idx; u8 rsvd[3]; u32 bit_mask[BFI_ENET_VLAN_WORDS_MAX]; -}; +} __packed; /* PAUSE * @@ -636,7 +636,7 @@ u8 rsvd[2]; u8 tx_pause; /* 1 = enable; 0 = disable */ u8 rx_pause; /* 1 = enable; 0 = disable */ -}; +} __packed; /* DIAGNOSTICS * @@ -648,7 +648,7 @@ u8 rsvd[2]; u8 mode; /* cable or Serdes */ u8 enable; /* 1 = enable; 0 = disable */ -}; +} __packed; /* enum for Loopback opmodes */ enum { @@ -669,14 +669,14 @@ u32 rx_enet_mask; u32 tx_enet_mask; union bfi_addr_u host_buffer; -}; +} __packed; /* defines for "stats_mask" above. */ -#define BFI_ENET_STATS_MAC (1 << 0) /* !< MAC Statistics */ -#define BFI_ENET_STATS_BPC (1 << 1) /* !< Pause Stats from BPC */ -#define BFI_ENET_STATS_RAD (1 << 2) /* !< Rx Admission Statistics */ -#define BFI_ENET_STATS_RX_FC (1 << 3) /* !< Rx FC Stats from RxA */ -#define BFI_ENET_STATS_TX_FC (1 << 4) /* !< Tx FC Stats from TxA */ +#define BFI_ENET_STATS_MAC BIT(0) /* !< MAC Statistics */ +#define BFI_ENET_STATS_BPC BIT(1) /* !< Pause Stats from BPC */ +#define BFI_ENET_STATS_RAD BIT(2) /* !< Rx Admission Statistics */ +#define BFI_ENET_STATS_RX_FC BIT(3) /* !< Rx FC Stats from RxA */ +#define BFI_ENET_STATS_TX_FC BIT(4) /* !< Tx FC Stats from TxA */ #define BFI_ENET_STATS_ALL 0x1f @@ -697,7 +697,7 @@ u64 errors; u64 filter_vlan; /* frames filtered due to VLAN */ u64 filter_mac_sa; /* frames filtered due to SA check */ -}; +} __packed; /* RxF Frame Statistics */ struct bfi_enet_stats_rxf { @@ -713,7 +713,7 @@ u64 bcast; u64 bcast_vlan; u64 frame_drops; -}; +} __packed; /* FC Tx Frame Statistics */ struct bfi_enet_stats_fc_tx { @@ -732,7 +732,7 @@ u64 txf_parity_errors; u64 txf_timeout; u64 txf_fid_parity_errors; -}; +} __packed; /* FC Rx Frame Statistics */ struct bfi_enet_stats_fc_rx { @@ -747,7 +747,7 @@ u64 rxf_bcast_octets; u64 rxf_bcast; u64 rxf_bcast_vlan; -}; +} __packed; /* RAD Frame Statistics */ struct bfi_enet_stats_rad { @@ -768,7 +768,7 @@ u64 rx_bcast_vlan; u64 rx_drops; -}; +} __packed; /* BPC Tx Registers */ struct bfi_enet_stats_bpc { @@ -783,7 +783,7 @@ u64 rx_zero_pause[8]; /*!< Pause cancellation */ /*!