Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e423c856 authored by Ivan Vecera's avatar Ivan Vecera Committed by David S. Miller
Browse files

bna: replace pragma(pack) with attribute __packed

parent d6b30598
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -187,8 +187,6 @@ enum {
#define BFA_MFG_SUPPLIER_SERIALNUM_SIZE		20
#define BFA_MFG_SUPPLIER_REVISION_SIZE		4

#pragma pack(1)

/* BFA adapter manufacturing block definition.
 *
 * All numerical fields are in big-endian format.
@@ -227,9 +225,7 @@ struct bfa_mfg_block {
	char	initial_mode[8]; /* initial mode: hba/cna/nic */
	u8	rsv4[84];
	u8	md5_chksum[BFA_MFG_CHKSUM_SIZE]; /* md5 checksum */
};

#pragma pack()
} __packed;

/* ---------------------- pci definitions ------------ */

+5 −9
Original line number Diff line number Diff line
@@ -109,8 +109,6 @@ union bfa_port_stats_u {
	struct bfa_port_eth_stats eth;
};

#pragma pack(1)

#define BFA_CEE_LLDP_MAX_STRING_LEN (128)
#define BFA_CEE_DCBX_MAX_PRIORITY	(8)
#define BFA_CEE_DCBX_MAX_PGID		(8)
@@ -133,7 +131,7 @@ struct bfa_cee_lldp_str {
	u8 len;
	u8 rsvd[2];
	u8 value[BFA_CEE_LLDP_MAX_STRING_LEN];
};
} __packed;

/* LLDP parameters */
struct bfa_cee_lldp_cfg {
@@ -145,7 +143,7 @@ struct bfa_cee_lldp_cfg {
	struct bfa_cee_lldp_str mgmt_addr;
	u16 time_to_live;
	u16 enabled_system_cap;
};
} __packed;

enum bfa_cee_dcbx_version {
	DCBX_PROTOCOL_PRECEE	= 1,
@@ -171,7 +169,7 @@ struct bfa_cee_dcbx_cfg {
	u8 lls_fcoe; /* FCoE Logical Link Status */
	u8 lls_lan; /* LAN Logical Link Status */
	u8 rsvd[2];
};
} __packed;

/* CEE status */
/* Making this to tri-state for the benefit of port list command */
@@ -192,7 +190,7 @@ struct bfa_cee_attr {
	u8 link_speed;
	u8 nw_priority;
	u8 filler[2];
};
} __packed;

/* LLDP/DCBX/CEE Statistics */
struct bfa_cee_stats {
@@ -214,8 +212,6 @@ struct bfa_cee_stats {
	u32	cee_status_up;		/*!< CEE status up */
	u32	cee_hw_cfg_changed;	/*!< CEE hw cfg changed */
	u32	cee_rx_invalid_cfg;	/*!< CEE invalid cfg */
};

#pragma pack()
} __packed;

#endif	/* __BFA_DEFS_CNA_H__ */
+1 −5
Original line number Diff line number Diff line
@@ -59,8 +59,6 @@ enum {
	BFA_MFG_TYPE_INVALID = 0,	 /*!< Invalid card type		*/
};

#pragma pack(1)

/* Check if Mezz card */
#define bfa_mfg_is_mezz(type) (( \
	(type) == BFA_MFG_TYPE_JAYHAWK || \
@@ -148,8 +146,6 @@ struct bfa_mfg_vpd {
	u8	len;		/*!< vpd data length excluding header */
	u8	rsv;
	u8		data[BFA_MFG_VPD_LEN];	/*!< vpd data */
};

#pragma pack()
} __packed;

#endif /* __BFA_DEFS_MFG_H__ */
+33 −37
Original line number Diff line number Diff line
@@ -21,8 +21,6 @@

#include "bfa_defs.h"

#pragma pack(1)

/* BFI FW image type */
#define	BFI_FLASH_CHUNK_SZ			256	/*!< Flash chunk size */
#define	BFI_FLASH_CHUNK_SZ_WORDS	(BFI_FLASH_CHUNK_SZ/sizeof(u32))
@@ -36,10 +34,10 @@ struct bfi_mhdr {
		struct {
			u8	qid;
			u8	fn_lpu;	/*!< msg destination		    */
		} h2i;
		} __packed h2i;
		u16	i2htok;	/*!< token in msgs to host	    */
	} mtag;
};
	} __packed mtag;
} __packed;

#define bfi_fn_lpu(__fn, __lpu)	((__fn) << 1 | (__lpu))
#define bfi_mhdr_2_fn(_mh)	((_mh)->mtag.h2i.fn_lpu >> 1)
@@ -75,14 +73,14 @@ union bfi_addr_u {
	struct {
		u32	addr_lo;
		u32	addr_hi;
	} a32;
};
	} __packed a32;
} __packed;

/* Generic DMA addr-len pair. */
struct bfi_alen {
	union bfi_addr_u	al_addr;	/* DMA addr of buffer	*/
	u32			al_len;		/* length of buffer */
};
} __packed;

/*
 * Large Message structure - 128 Bytes size Msgs
@@ -96,7 +94,7 @@ struct bfi_alen {
struct bfi_mbmsg {
	struct bfi_mhdr mh;
	u32		pl[BFI_MBMSG_SZ];
};
} __packed;

/* Supported PCI function class codes (personality) */
enum bfi_pcifn_class {
@@ -184,7 +182,7 @@ enum bfi_ioc_i2h_msgs {
struct bfi_ioc_getattr_req {
	struct bfi_mhdr mh;
	union bfi_addr_u	attr_addr;
};
} __packed;

struct bfi_ioc_attr {
	u64		mfg_pwwn;	/*!< Mfg port wwn	   */
@@ -211,14 +209,14 @@ struct bfi_ioc_attr {
	char		optrom_version[BFA_VERSION_LEN];
	struct bfa_mfg_vpd vpd;
	u32	card_type;	/*!< card type			*/
};
} __packed;

/* BFI_IOC_I2H_GETATTR_REPLY message */
struct bfi_ioc_getattr_reply {
	struct bfi_mhdr mh;	/*!< Common msg header		*/
	u8			status;	/*!< cfg reply status		*/
	u8			rsvd[3];
};
} __packed;

/* Firmware memory page offsets */
#define BFI_IOC_SMEM_PG0_CB	(0x40)
@@ -256,7 +254,7 @@ struct bfi_ioc_fwver {
	u8 build;
	u8 rsvd[2];
#endif
};
} __packed;

struct bfi_ioc_image_hdr {
	u32	signature;	/*!< constant signature */
@@ -269,7 +267,7 @@ struct bfi_ioc_image_hdr {
	u32	rsvd_b[2];
	struct bfi_ioc_fwver fwver;
	u32	md5sum[BFI_IOC_MD5SUM_SZ];
};
} __packed;

enum bfi_ioc_img_ver_cmp {
	BFI_IOC_IMG_VER_INCOMP,
@@ -301,7 +299,7 @@ enum bfi_port_mode {
struct bfi_ioc_hbeat {
	struct bfi_mhdr mh;		/*!< common msg header		*/
	u32	   hb_count;	/*!< current heart beat count	*/
};
} __packed;

/* IOC hardware/firmware state */
enum bfi_ioc_state {
@@ -353,7 +351,7 @@ struct bfi_ioc_ctrl_req {
	u16			clscode;
	u16			rsvd;
	u32		tv_sec;
};
} __packed;

/* BFI_IOC_I2H_ENABLE_REPLY & BFI_IOC_I2H_DISABLE_REPLY messages */
struct bfi_ioc_ctrl_reply {
@@ -362,7 +360,7 @@ struct bfi_ioc_ctrl_reply {
	u8			port_mode;	/*!< enum bfa_mode */
	u8			cap_bm;		/*!< capability bit mask */
	u8			rsvd;
};
} __packed;

#define BFI_IOC_MSGSZ   8
/* H2I Messages */
@@ -372,14 +370,14 @@ union bfi_ioc_h2i_msg_u {
	struct bfi_ioc_ctrl_req disable_req;
	struct bfi_ioc_getattr_req getattr_req;
	u32			mboxmsg[BFI_IOC_MSGSZ];
};
} __packed;

/* I2H Messages */
union bfi_ioc_i2h_msg_u {
	struct bfi_mhdr mh;
	struct bfi_ioc_ctrl_reply fw_event;
	u32			mboxmsg[BFI_IOC_MSGSZ];
};
} __packed;

/*----------------------------------------------------------------------
 *				MSGQ
@@ -408,7 +406,7 @@ struct bfi_msgq_mhdr {
	u16	num_entries;
	u8	enet_id;
	u8	rsvd[1];
};
} __packed;

#define bfi_msgq_mhdr_set(_mh, _mc, _mid, _tok, _enet_id) do {	\
	(_mh).msg_class	 = (_mc);	\
@@ -430,21 +428,21 @@ struct bfi_msgq {
	union bfi_addr_u addr;
	u16 q_depth;     /* Total num of entries in the queue */
	u8 rsvd[2];
};
} __packed;

/* BFI_ENET_MSGQ_CFG_REQ TBD init or cfg? */
struct bfi_msgq_cfg_req {
	struct bfi_mhdr mh;
	struct bfi_msgq cmdq;
	struct bfi_msgq rspq;
};
} __packed;

/* BFI_ENET_MSGQ_CFG_RSP */
struct bfi_msgq_cfg_rsp {
	struct bfi_mhdr mh;
	u8 cmd_status;
	u8 rsvd[3];
};
} __packed;

/* BFI_MSGQ_H2I_DOORBELL */
struct bfi_msgq_h2i_db {
@@ -452,8 +450,8 @@ struct bfi_msgq_h2i_db {
	union {
		u16 cmdq_pi;
		u16 rspq_ci;
	} idx;
};
	} __packed idx;
} __packed;

/* BFI_MSGQ_I2H_DOORBELL */
struct bfi_msgq_i2h_db {
@@ -461,8 +459,8 @@ struct bfi_msgq_i2h_db {
	union {
		u16 rspq_pi;
		u16 cmdq_ci;
	} idx;
};
	} __packed idx;
} __packed;

#define BFI_CMD_COPY_SZ 28

@@ -470,14 +468,14 @@ struct bfi_msgq_i2h_db {
struct bfi_msgq_h2i_cmdq_copy_rsp {
	struct bfi_mhdr mh;
	u8	      data[BFI_CMD_COPY_SZ];
};
} __packed;

/* BFI_MSGQ_I2H_CMD_COPY_REQ */
struct bfi_msgq_i2h_cmdq_copy_req {
	struct bfi_mhdr mh;
	u16     offset;
	u16     len;
};
} __packed;

/*
 *      FLASH module specific
@@ -505,7 +503,7 @@ enum bfi_flash_i2h_msgs {
struct bfi_flash_query_req {
	struct bfi_mhdr mh;   /* Common msg header */
	struct bfi_alen alen;
};
} __packed;

/*
 * Flash write request
@@ -519,7 +517,7 @@ struct bfi_flash_write_req {
	u8	rsv[2];
	u32	offset;
	u32	length;
};
} __packed;

/*
 * Flash read request
@@ -532,7 +530,7 @@ struct bfi_flash_read_req {
	u32	offset;
	u32	length;
	struct bfi_alen alen;
};
} __packed;

/*
 * Flash query response
@@ -540,7 +538,7 @@ struct bfi_flash_read_req {
struct bfi_flash_query_rsp {
	struct bfi_mhdr mh;	/* Common msg header */
	u32	status;
};
} __packed;

/*
 * Flash read response
@@ -552,7 +550,7 @@ struct bfi_flash_read_rsp {
	u8	rsv[3];
	u32	status;
	u32	length;
};
} __packed;

/*
 * Flash write response
@@ -564,8 +562,6 @@ struct bfi_flash_write_rsp {
	u8	rsv[3];
	u32	status;
	u32	length;
};

#pragma pack()
} __packed;

#endif /* __BFI_H__ */
+13 −17
Original line number Diff line number Diff line
@@ -22,8 +22,6 @@
#include "bfi.h"
#include "bfa_defs_cna.h"

#pragma pack(1)

enum bfi_port_h2i {
	BFI_PORT_H2I_ENABLE_REQ		= (1),
	BFI_PORT_H2I_DISABLE_REQ	= (2),
@@ -43,7 +41,7 @@ struct bfi_port_generic_req {
	struct bfi_mhdr mh;		/*!< msg header			    */
	u32	msgtag;		/*!< msgtag for reply		    */
	u32	rsvd;
};
} __packed;

/* Generic RSP type */
struct bfi_port_generic_rsp {
@@ -51,13 +49,13 @@ struct bfi_port_generic_rsp {
	u8		status;		/*!< port enable status		    */
	u8		rsvd[3];
	u32	msgtag;		/*!< msgtag for reply		    */
};
} __packed;

/* BFI_PORT_H2I_GET_STATS_REQ */
struct bfi_port_get_stats_req {
	struct bfi_mhdr mh;		/*!< common msg header		    */
	union bfi_addr_u   dma_addr;
};
} __packed;

union bfi_port_h2i_msg_u {
	struct bfi_mhdr mh;
@@ -65,7 +63,7 @@ union bfi_port_h2i_msg_u {
	struct bfi_port_generic_req disable_req;
	struct bfi_port_get_stats_req getstats_req;
	struct bfi_port_generic_req clearstats_req;
};
} __packed;

union bfi_port_i2h_msg_u {
	struct bfi_mhdr mh;
@@ -73,7 +71,7 @@ union bfi_port_i2h_msg_u {
	struct bfi_port_generic_rsp disable_rsp;
	struct bfi_port_generic_rsp getstats_rsp;
	struct bfi_port_generic_rsp clearstats_rsp;
};
} __packed;

/* @brief Mailbox commands from host to (DCBX/LLDP) firmware */
enum bfi_cee_h2i_msgs {
@@ -97,7 +95,7 @@ enum bfi_cee_i2h_msgs {
 */
struct bfi_lldp_reset_stats {
	struct bfi_mhdr mh;
};
} __packed;

/*
 * @brief H2I command structure for resetting the stats.
@@ -105,7 +103,7 @@ struct bfi_lldp_reset_stats {
 */
struct bfi_cee_reset_stats {
	struct bfi_mhdr mh;
};
} __packed;

/*
 * @brief  get configuration  command from host
@@ -114,7 +112,7 @@ struct bfi_cee_reset_stats {
struct bfi_cee_get_req {
	struct bfi_mhdr mh;
	union bfi_addr_u   dma_addr;
};
} __packed;

/*
 * @brief reply message from firmware
@@ -124,7 +122,7 @@ struct bfi_cee_get_rsp {
	struct bfi_mhdr mh;
	u8			cmd_status;
	u8			rsvd[3];
};
} __packed;

/*
 * @brief  get configuration  command from host
@@ -133,7 +131,7 @@ struct bfi_cee_get_rsp {
struct bfi_cee_stats_req {
	struct bfi_mhdr mh;
	union bfi_addr_u   dma_addr;
};
} __packed;

/*
 * @brief reply message from firmware
@@ -143,22 +141,20 @@ struct bfi_cee_stats_rsp {
	struct bfi_mhdr mh;
	u8			cmd_status;
	u8			rsvd[3];
};
} __packed;

/* @brief mailbox command structures from host to firmware */
union bfi_cee_h2i_msg_u {
	struct bfi_mhdr mh;
	struct bfi_cee_get_req get_req;
	struct bfi_cee_stats_req stats_req;
};
} __packed;

/* @brief mailbox message structures from firmware to host	*/
union bfi_cee_i2h_msg_u {
	struct bfi_mhdr mh;
	struct bfi_cee_get_rsp get_rsp;
	struct bfi_cee_stats_rsp stats_rsp;
};

#pragma pack()
} __packed;

#endif /* __BFI_CNA_H__ */
Loading