[openib-general] [PATCH] amso1100 cleanups

Roland Dreier rdreier at cisco.com
Mon Mar 6 13:16:51 PST 2006


Hi Tom, here's a big patch that cleans up various things in amso1100.
I didn't think it was worth splitting it up into smaller pieces.  It's
compile tested only because I have no hardware.

Thanks,
  Roland

---

Clean up amso1100 driver:
 - Add dependency to INET in Kconfig -- the driver won't compile
   without CONFIG_INET enabled.
 - Kill c2_readXX/c2_writeXX wrappers in favor of normal kernel
   readX/writeX functions.
 - Some typedef-ectomy -- still lots more to get rid of.
 - Delete the unused cc_wr.h file.
 - Get rid of casts from kmalloc() return -- no casts needed from void*
 - Convert kmalloc() + memset(0) to kzalloc()
 - Get rid of PACKED macro and other unused macros in c2_wr.h

Signed-off-by: Roland Dreier <rolandd at cisco.com>

Index: Kconfig
===================================================================
--- Kconfig	(revision 5627)
+++ Kconfig	(working copy)
@@ -1,6 +1,6 @@
 config INFINIBAND_AMSO1100
 	tristate "Ammasso 1100 HCA support"
-	depends on PCI && INFINIBAND
+	depends on PCI && INET && INFINIBAND
 	---help---
 	  This is a low-level driver for the Ammasso 1100 host
 	  channel adapter (HCA).
Index: c2_intr.c
===================================================================
--- c2_intr.c	(revision 5627)
+++ c2_intr.c	(working copy)
@@ -44,7 +44,7 @@
 	unsigned int mq_index;
 
 	while (c2dev->hints_read != be16_to_cpu(c2dev->hint_count)) {
-		mq_index = c2_read32(c2dev->regs + PCI_BAR0_HOST_HINT);
+		mq_index = readl(c2dev->regs + PCI_BAR0_HOST_HINT);
 		if (mq_index & 0x80000000) {
 			break;
 		}
@@ -100,8 +100,8 @@
 static void handle_vq(struct c2_dev *c2dev, u32 mq_index)
 {
 	void *adapter_msg, *reply_msg;
-	ccwr_hdr_t *host_msg;
-	ccwr_hdr_t tmp;
+	struct ccwr_hdr *host_msg;
+	struct ccwr_hdr tmp;
 	struct c2_mq *reply_vq;
 	struct c2_vq_req *req;
 
Index: c2_mq.c
===================================================================
--- c2_mq.c	(revision 5627)
+++ c2_mq.c	(working copy)
@@ -46,8 +46,8 @@
 		return NULL;
 	} else {
 #ifdef C2_DEBUG
-		ccwr_hdr_t *m =
-		    (ccwr_hdr_t *) (q->msg_pool + q->priv * q->msg_size);
+		struct ccwr_hdr *m =
+		    (struct ccwr_hdr *) (q->msg_pool + q->priv * q->msg_size);
 #ifdef CCMSGMAGIC
 		assert(m->magic == be32_to_cpu(~CCWR_MAGIC));
 		m->magic = cpu_to_be32(CCWR_MAGIC);
@@ -83,7 +83,7 @@
 		return NULL;
 	} else {
 #ifdef C2_DEBUG
-		ccwr_hdr_t *m = (ccwr_hdr_t *)
+		struct ccwr_hdr *m = (struct ccwr_hdr *)
 		    (q->msg_pool + q->priv * q->msg_size);
 #ifdef CCMSGMAGIC
 		assert(m->magic == be32_to_cpu(CCWR_MAGIC));
@@ -105,7 +105,7 @@
 
 #ifdef CCMSGMAGIC
 		{
-			ccwr_hdr_t *m = (ccwr_hdr_t *)
+			struct ccwr_hdr *m = (struct ccwr_hdr *)
 			    (q->msg_pool + q->priv * q->msg_size);
 			m->magic = cpu_to_be32(~CCWR_MAGIC);
 		}
Index: cc_wr.h
===================================================================
--- cc_wr.h	(revision 5627)
+++ cc_wr.h	(working copy)
@@ -1,1329 +0,0 @@
-/*
- * Copyright (c) 2005 Ammasso, Inc. All rights reserved.
- * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
- *
- * This software is available to you under a choice of one of two
- * licenses.  You may choose to be licensed under the terms of the GNU
- * General Public License (GPL) Version 2, available from the file
- * COPYING in the main directory of this source tree, or the
- * OpenIB.org BSD license below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-#ifndef _CC_WR_H_
-#define _CC_WR_H_
-#include "cc_types.h"
-/*
- * WARNING: If you change this file, also bump CC_IVN_BASE
- * in common/include/clustercore/cc_ivn.h.
- */
-
-#ifdef CCDEBUG
-#define CCWR_MAGIC		0xb07700b0
-#endif
-
-#define WR_BUILD_STR_LEN 64
-
-#ifdef _MSC_VER
-#define PACKED
-#pragma pack(push)
-#pragma pack(1)
-#define __inline__ __inline
-#else
-#define PACKED __attribute__ ((packed))
-#endif
-
-/*
- * WARNING:  All of these structs need to align any 64bit types on   
- * 64 bit boundaries!  64bit types include u64 and u64.
- */
-
-/*
- * Clustercore Work Request Header.  Be sensitive to field layout
- * and alignment.
- */
-typedef struct {
-	/* wqe_count is part of the cqe.  It is put here so the
-	 * adapter can write to it while the wr is pending without
-	 * clobbering part of the wr.  This word need not be dma'd
-	 * from the host to adapter by libccil, but we copy it anyway
-	 * to make the memcpy to the adapter better aligned.
-	 */
-	u32 wqe_count;
-
-	/* Put these fields next so that later 32- and 64-bit
-	 * quantities are naturally aligned.
-	 */
-	u8 id;
-	u8 result;		/* adapter -> host */
-	u8 sge_count;		/* host -> adapter */
-	u8 flags;		/* host -> adapter */
-
-	u64 context;
-#ifdef CCMSGMAGIC
-	u32 magic;
-	u32 pad;
-#endif
-} PACKED ccwr_hdr_t;
-
-/*
- *------------------------ RNIC ------------------------
- */
-
-/*
- * WR_RNIC_OPEN
- */
-
-/*
- * Flags for the RNIC WRs
- */
-typedef enum {
-	RNIC_IRD_STATIC = 0x0001,
-	RNIC_ORD_STATIC = 0x0002,
-	RNIC_QP_STATIC = 0x0004,
-	RNIC_SRQ_SUPPORTED = 0x0008,
-	RNIC_PBL_BLOCK_MODE = 0x0010,
-	RNIC_SRQ_MODEL_ARRIVAL = 0x0020,
-	RNIC_CQ_OVF_DETECTED = 0x0040,
-	RNIC_PRIV_MODE = 0x0080
-} PACKED cc_rnic_flags_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u64 user_context;
-	u16 flags;		/* See cc_rnic_flags_t */
-	u16 port_num;
-} PACKED ccwr_rnic_open_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-} PACKED ccwr_rnic_open_rep_t;
-
-typedef union {
-	ccwr_rnic_open_req_t req;
-	ccwr_rnic_open_rep_t rep;
-} PACKED ccwr_rnic_open_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-} PACKED ccwr_rnic_query_req_t;
-
-/*
- * WR_RNIC_QUERY
- */
-typedef struct {
-	ccwr_hdr_t hdr;
-	u64 user_context;
-	u32 vendor_id;
-	u32 part_number;
-	u32 hw_version;
-	u32 fw_ver_major;
-	u32 fw_ver_minor;
-	u32 fw_ver_patch;
-	char fw_ver_build_str[WR_BUILD_STR_LEN];
-	u32 max_qps;
-	u32 max_qp_depth;
-	u32 max_srq_depth;
-	u32 max_send_sgl_depth;
-	u32 max_rdma_sgl_depth;
-	u32 max_cqs;
-	u32 max_cq_depth;
-	u32 max_cq_event_handlers;
-	u32 max_mrs;
-	u32 max_pbl_depth;
-	u32 max_pds;
-	u32 max_global_ird;
-	u32 max_global_ord;
-	u32 max_qp_ird;
-	u32 max_qp_ord;
-	u32 flags;		/* See cc_rnic_flags_t */
-	u32 max_mws;
-	u32 pbe_range_low;
-	u32 pbe_range_high;
-	u32 max_srqs;
-	u32 page_size;
-} PACKED ccwr_rnic_query_rep_t;
-
-typedef union {
-	ccwr_rnic_query_req_t req;
-	ccwr_rnic_query_rep_t rep;
-} PACKED ccwr_rnic_query_t;
-
-/*
- * WR_RNIC_GETCONFIG
- */
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 option;		/* see cc_getconfig_cmd_t */
-	u64 reply_buf;
-	u32 reply_buf_len;
-} PACKED ccwr_rnic_getconfig_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 option;	/* see cc_getconfig_cmd_t */
-	u32 count_len;	/* length of the number of addresses configured */
-} PACKED ccwr_rnic_getconfig_rep_t;
-
-typedef union {
-	ccwr_rnic_getconfig_req_t req;
-	ccwr_rnic_getconfig_rep_t rep;
-} PACKED ccwr_rnic_getconfig_t;
-
-/*
- * WR_RNIC_SETCONFIG
- */
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 option;		/* See cc_setconfig_cmd_t */
-	/* variable data and pad. See cc_netaddr_t and cc_route_t */
-	u8 data[0];
-} PACKED ccwr_rnic_setconfig_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_rnic_setconfig_rep_t;
-
-typedef union {
-	ccwr_rnic_setconfig_req_t req;
-	ccwr_rnic_setconfig_rep_t rep;
-} PACKED ccwr_rnic_setconfig_t;
-
-/*
- * WR_RNIC_CLOSE
- */
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-} PACKED ccwr_rnic_close_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_rnic_close_rep_t;
-
-typedef union {
-	ccwr_rnic_close_req_t req;
-	ccwr_rnic_close_rep_t rep;
-} PACKED ccwr_rnic_close_t;
-
-/*
- *------------------------ CQ ------------------------
- */
-typedef struct {
-	ccwr_hdr_t hdr;
-	u64 shared_ht;
-	u64 user_context;
-	u64 msg_pool;
-	u32 rnic_handle;
-	u32 msg_size;
-	u32 depth;
-} PACKED ccwr_cq_create_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 mq_index;
-	u32 adapter_shared;
-	u32 cq_handle;
-} PACKED ccwr_cq_create_rep_t;
-
-typedef union {
-	ccwr_cq_create_req_t req;
-	ccwr_cq_create_rep_t rep;
-} PACKED ccwr_cq_create_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 cq_handle;
-	u32 new_depth;
-	u64 new_msg_pool;
-} PACKED ccwr_cq_modify_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_cq_modify_rep_t;
-
-typedef union {
-	ccwr_cq_modify_req_t req;
-	ccwr_cq_modify_rep_t rep;
-} PACKED ccwr_cq_modify_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 cq_handle;
-} PACKED ccwr_cq_destroy_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_cq_destroy_rep_t;
-
-typedef union {
-	ccwr_cq_destroy_req_t req;
-	ccwr_cq_destroy_rep_t rep;
-} PACKED ccwr_cq_destroy_t;
-
-/*
- *------------------------ PD ------------------------
- */
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 pd_id;
-} PACKED ccwr_pd_alloc_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_pd_alloc_rep_t;
-
-typedef union {
-	ccwr_pd_alloc_req_t req;
-	ccwr_pd_alloc_rep_t rep;
-} PACKED ccwr_pd_alloc_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 pd_id;
-} PACKED ccwr_pd_dealloc_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_pd_dealloc_rep_t;
-
-typedef union {
-	ccwr_pd_dealloc_req_t req;
-	ccwr_pd_dealloc_rep_t rep;
-} PACKED ccwr_pd_dealloc_t;
-
-/*
- *------------------------ SRQ ------------------------
- */
-typedef struct {
-	ccwr_hdr_t hdr;
-	u64 shared_ht;
-	u64 user_context;
-	u32 rnic_handle;
-	u32 srq_depth;
-	u32 srq_limit;
-	u32 sgl_depth;
-	u32 pd_id;
-} PACKED ccwr_srq_create_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 srq_depth;
-	u32 sgl_depth;
-	u32 msg_size;
-	u32 mq_index;
-	u32 mq_start;
-	u32 srq_handle;
-} PACKED ccwr_srq_create_rep_t;
-
-typedef union {
-	ccwr_srq_create_req_t req;
-	ccwr_srq_create_rep_t rep;
-} PACKED ccwr_srq_create_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 srq_handle;
-} PACKED ccwr_srq_destroy_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_srq_destroy_rep_t;
-
-typedef union {
-	ccwr_srq_destroy_req_t req;
-	ccwr_srq_destroy_rep_t rep;
-} PACKED ccwr_srq_destroy_t;
-
-/*
- *------------------------ QP ------------------------
- */
-typedef enum {
-	QP_RDMA_READ = 0x00000001,	/* RDMA read enabled? */
-	QP_RDMA_WRITE = 0x00000002,	/* RDMA write enabled? */
-	QP_MW_BIND = 0x00000004,	/* MWs enabled */
-	QP_ZERO_STAG = 0x00000008,	/* enabled? */
-	QP_REMOTE_TERMINATION = 0x00000010,	/* remote end terminated */
-	QP_RDMA_READ_RESPONSE = 0x00000020	/* Remote RDMA read  */
-	    /* enabled? */
-} PACKED ccwr_qp_flags_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u64 shared_sq_ht;
-	u64 shared_rq_ht;
-	u64 user_context;
-	u32 rnic_handle;
-	u32 sq_cq_handle;
-	u32 rq_cq_handle;
-	u32 sq_depth;
-	u32 rq_depth;
-	u32 srq_handle;
-	u32 srq_limit;
-	u32 flags;		/* see ccwr_qp_flags_t */
-	u32 send_sgl_depth;
-	u32 recv_sgl_depth;
-	u32 rdma_write_sgl_depth;
-	u32 ord;
-	u32 ird;
-	u32 pd_id;
-} PACKED ccwr_qp_create_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 sq_depth;
-	u32 rq_depth;
-	u32 send_sgl_depth;
-	u32 recv_sgl_depth;
-	u32 rdma_write_sgl_depth;
-	u32 ord;
-	u32 ird;
-	u32 sq_msg_size;
-	u32 sq_mq_index;
-	u32 sq_mq_start;
-	u32 rq_msg_size;
-	u32 rq_mq_index;
-	u32 rq_mq_start;
-	u32 qp_handle;
-} PACKED ccwr_qp_create_rep_t;
-
-typedef union {
-	ccwr_qp_create_req_t req;
-	ccwr_qp_create_rep_t rep;
-} PACKED ccwr_qp_create_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 qp_handle;
-} PACKED ccwr_qp_query_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u64 user_context;
-	u32 rnic_handle;
-	u32 sq_depth;
-	u32 rq_depth;
-	u32 send_sgl_depth;
-	u32 rdma_write_sgl_depth;
-	u32 recv_sgl_depth;
-	u32 ord;
-	u32 ird;
-	u16 qp_state;
-	u16 flags;		/* see ccwr_qp_flags_t */
-	u32 qp_id;
-	u32 local_addr;
-	u32 remote_addr;
-	u16 local_port;
-	u16 remote_port;
-	u32 terminate_msg_length;	/* 0 if not present */
-	u8 data[0];
-	/* Terminate Message in-line here. */
-} PACKED ccwr_qp_query_rep_t;
-
-typedef union {
-	ccwr_qp_query_req_t req;
-	ccwr_qp_query_rep_t rep;
-} PACKED ccwr_qp_query_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u64 stream_msg;
-	u32 stream_msg_length;
-	u32 rnic_handle;
-	u32 qp_handle;
-	u32 next_qp_state;
-	u32 ord;
-	u32 ird;
-	u32 sq_depth;
-	u32 rq_depth;
-	u32 llp_ep_handle;
-} PACKED ccwr_qp_modify_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 ord;
-	u32 ird;
-	u32 sq_depth;
-	u32 rq_depth;
-	u32 sq_msg_size;
-	u32 sq_mq_index;
-	u32 sq_mq_start;
-	u32 rq_msg_size;
-	u32 rq_mq_index;
-	u32 rq_mq_start;
-} PACKED ccwr_qp_modify_rep_t;
-
-typedef union {
-	ccwr_qp_modify_req_t req;
-	ccwr_qp_modify_rep_t rep;
-} PACKED ccwr_qp_modify_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 qp_handle;
-} PACKED ccwr_qp_destroy_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_qp_destroy_rep_t;
-
-typedef union {
-	ccwr_qp_destroy_req_t req;
-	ccwr_qp_destroy_rep_t rep;
-} PACKED ccwr_qp_destroy_t;
-
-/*
- * The CCWR_QP_CONNECT msg is posted on the verbs request queue.  It can
- * only be posted when a QP is in IDLE state.  After the connect request is
- * submitted to the LLP, the adapter moves the QP to CONNECT_PENDING state.
- * No synchronous reply from adapter to this WR.  The results of
- * connection are passed back in an async event CCAE_ACTIVE_CONNECT_RESULTS
- * See ccwr_ae_active_connect_results_t
- */
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 qp_handle;
-	u32 remote_addr;
-	u16 remote_port;
-	u16 pad;
-	u32 private_data_length;
-	u8 private_data[0];	/* Private data in-line. */
-} PACKED ccwr_qp_connect_req_t;
-
-typedef struct {
-	ccwr_qp_connect_req_t req;
-	/* no synchronous reply.         */
-} PACKED ccwr_qp_connect_t;
-
-
-/*
- *------------------------ MM ------------------------
- */
-
-typedef cc_mm_flags_t ccwr_mr_flags_t;	/* cc_types.h */
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 pbl_depth;
-	u32 pd_id;
-	u32 flags;		/* See ccwr_mr_flags_t */
-} PACKED ccwr_nsmr_stag_alloc_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 pbl_depth;
-	u32 stag_index;
-} PACKED ccwr_nsmr_stag_alloc_rep_t;
-
-typedef union {
-	ccwr_nsmr_stag_alloc_req_t req;
-	ccwr_nsmr_stag_alloc_rep_t rep;
-} PACKED ccwr_nsmr_stag_alloc_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u64 va;
-	u32 rnic_handle;
-	u16 flags;		/* See ccwr_mr_flags_t */
-	u8 stag_key;
-	u8 pad;
-	u32 pd_id;
-	u32 pbl_depth;
-	u32 pbe_size;
-	u32 fbo;
-	u32 length;
-	u32 addrs_length;
-	/* array of paddrs (must be aligned on a 64bit boundary) */
-	u64 paddrs[0];
-} PACKED ccwr_nsmr_register_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 pbl_depth;
-	u32 stag_index;
-} PACKED ccwr_nsmr_register_rep_t;
-
-typedef union {
-	ccwr_nsmr_register_req_t req;
-	ccwr_nsmr_register_rep_t rep;
-} PACKED ccwr_nsmr_register_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 flags;		/* See ccwr_mr_flags_t */
-	u32 stag_index;
-	u32 addrs_length;
-	/* array of paddrs (must be aligned on a 64bit boundary) */
-	u64 paddrs[0];
-} PACKED ccwr_nsmr_pbl_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_nsmr_pbl_rep_t;
-
-typedef union {
-	ccwr_nsmr_pbl_req_t req;
-	ccwr_nsmr_pbl_rep_t rep;
-} PACKED ccwr_nsmr_pbl_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 stag_index;
-} PACKED ccwr_mr_query_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u8 stag_key;
-	u8 pad[3];
-	u32 pd_id;
-	u32 flags;		/* See ccwr_mr_flags_t */
-	u32 pbl_depth;
-} PACKED ccwr_mr_query_rep_t;
-
-typedef union {
-	ccwr_mr_query_req_t req;
-	ccwr_mr_query_rep_t rep;
-} PACKED ccwr_mr_query_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 stag_index;
-} PACKED ccwr_mw_query_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u8 stag_key;
-	u8 pad[3];
-	u32 pd_id;
-	u32 flags;		/* See ccwr_mr_flags_t */
-} PACKED ccwr_mw_query_rep_t;
-
-typedef union {
-	ccwr_mw_query_req_t req;
-	ccwr_mw_query_rep_t rep;
-} PACKED ccwr_mw_query_t;
-
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 stag_index;
-} PACKED ccwr_stag_dealloc_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_stag_dealloc_rep_t;
-
-typedef union {
-	ccwr_stag_dealloc_req_t req;
-	ccwr_stag_dealloc_rep_t rep;
-} PACKED ccwr_stag_dealloc_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u64 va;
-	u32 rnic_handle;
-	u16 flags;		/* See ccwr_mr_flags_t */
-	u8 stag_key;
-	u8 pad;
-	u32 stag_index;
-	u32 pd_id;
-	u32 pbl_depth;
-	u32 pbe_size;
-	u32 fbo;
-	u32 length;
-	u32 addrs_length;
-	u32 pad1;
-	/* array of paddrs (must be aligned on a 64bit boundary) */
-	u64 paddrs[0];
-} PACKED ccwr_nsmr_reregister_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 pbl_depth;
-	u32 stag_index;
-} PACKED ccwr_nsmr_reregister_rep_t;
-
-typedef union {
-	ccwr_nsmr_reregister_req_t req;
-	ccwr_nsmr_reregister_rep_t rep;
-} PACKED ccwr_nsmr_reregister_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u64 va;
-	u32 rnic_handle;
-	u16 flags;		/* See ccwr_mr_flags_t */
-	u8 stag_key;
-	u8 pad;
-	u32 stag_index;
-	u32 pd_id;
-} PACKED ccwr_smr_register_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 stag_index;
-} PACKED ccwr_smr_register_rep_t;
-
-typedef union {
-	ccwr_smr_register_req_t req;
-	ccwr_smr_register_rep_t rep;
-} PACKED ccwr_smr_register_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 pd_id;
-} PACKED ccwr_mw_alloc_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 stag_index;
-} PACKED ccwr_mw_alloc_rep_t;
-
-typedef union {
-	ccwr_mw_alloc_req_t req;
-	ccwr_mw_alloc_rep_t rep;
-} PACKED ccwr_mw_alloc_t;
-
-/*
- *------------------------ WRs -----------------------
- */
-
-typedef struct {
-	ccwr_hdr_t hdr;		/* Has status and WR Type */
-} PACKED ccwr_user_hdr_t;
-
-/* Completion queue entry. */
-typedef struct {
-	ccwr_hdr_t hdr;		/* Has status and WR Type */
-	u64 qp_user_context;	/* cc_user_qp_t * */
-	u32 qp_state;		/* Current QP State */
-	u32 handle;		/* QPID or EP Handle */
-	u32 bytes_rcvd;		/* valid for RECV WCs */
-	u32 stag;
-} PACKED ccwr_ce_t;
-
-
-/*
- * Flags used for all post-sq WRs.  These must fit in the flags
- * field of the ccwr_hdr_t (eight bits).
- */
-typedef enum {
-	SQ_SIGNALED = 0x01,
-	SQ_READ_FENCE = 0x02,
-	SQ_FENCE = 0x04,
-} PACKED cc_sq_flags_t;
-
-/*
- * Common fields for all post-sq WRs.  Namely the standard header and a 
- * secondary header with fields common to all post-sq WRs.
- */
-typedef struct {
-	ccwr_user_hdr_t user_hdr;
-} PACKED cc_sq_hdr_t;
-
-/*
- * Same as above but for post-rq WRs.
- */
-typedef struct {
-	ccwr_user_hdr_t user_hdr;
-} PACKED cc_rq_hdr_t;
-
-/*
- * use the same struct for all sends.
- */
-typedef struct {
-	cc_sq_hdr_t sq_hdr;
-	u32 sge_len;
-	u32 remote_stag;
-	u8 data[0];		/* SGE array */
-} PACKED ccwr_send_req_t, ccwr_send_se_req_t, ccwr_send_inv_req_t,
-    ccwr_send_se_inv_req_t;
-
-typedef ccwr_ce_t ccwr_send_rep_t;
-
-typedef union {
-	ccwr_send_req_t req;
-	ccwr_send_rep_t rep;
-} PACKED ccwr_send_t, ccwr_send_se_t, ccwr_send_inv_t, ccwr_send_se_inv_t;
-
-typedef struct {
-	cc_sq_hdr_t sq_hdr;
-	u64 remote_to;
-	u32 remote_stag;
-	u32 sge_len;
-	u8 data[0];		/* SGE array */
-} PACKED ccwr_rdma_write_req_t;
-
-typedef ccwr_ce_t ccwr_rdma_write_rep_t;
-
-typedef union {
-	ccwr_rdma_write_req_t req;
-	ccwr_rdma_write_rep_t rep;
-} PACKED ccwr_rdma_write_t;
-
-typedef struct {
-	cc_sq_hdr_t sq_hdr;
-	u64 local_to;
-	u64 remote_to;
-	u32 local_stag;
-	u32 remote_stag;
-	u32 length;
-} PACKED ccwr_rdma_read_req_t, ccwr_rdma_read_inv_req_t;
-
-typedef ccwr_ce_t ccwr_rdma_read_rep_t;
-
-typedef union {
-	ccwr_rdma_read_req_t req;
-	ccwr_rdma_read_rep_t rep;
-} PACKED ccwr_rdma_read_t, ccwr_rdma_read_inv_t;
-
-typedef struct {
-	cc_sq_hdr_t sq_hdr;
-	u64 va;
-	u8 stag_key;
-	u8 pad[3];
-	u32 mw_stag_index;
-	u32 mr_stag_index;
-	u32 length;
-	u32 flags;		/* see ccwr_mr_flags_t; */
-} PACKED ccwr_mw_bind_req_t;
-
-typedef ccwr_ce_t ccwr_mw_bind_rep_t;
-
-typedef union {
-	ccwr_mw_bind_req_t req;
-	ccwr_mw_bind_rep_t rep;
-} PACKED ccwr_mw_bind_t;
-
-typedef struct {
-	cc_sq_hdr_t sq_hdr;
-	u64 va;
-	u8 stag_key;
-	u8 pad[3];
-	u32 stag_index;
-	u32 pbe_size;
-	u32 fbo;
-	u32 length;
-	u32 addrs_length;
-	/* array of paddrs (must be aligned on a 64bit boundary) */
-	u64 paddrs[0];
-} PACKED ccwr_nsmr_fastreg_req_t;
-
-typedef ccwr_ce_t ccwr_nsmr_fastreg_rep_t;
-
-typedef union {
-	ccwr_nsmr_fastreg_req_t req;
-	ccwr_nsmr_fastreg_rep_t rep;
-} PACKED ccwr_nsmr_fastreg_t;
-
-typedef struct {
-	cc_sq_hdr_t sq_hdr;
-	u8 stag_key;
-	u8 pad[3];
-	u32 stag_index;
-} PACKED ccwr_stag_invalidate_req_t;
-
-typedef ccwr_ce_t ccwr_stag_invalidate_rep_t;
-
-typedef union {
-	ccwr_stag_invalidate_req_t req;
-	ccwr_stag_invalidate_rep_t rep;
-} PACKED ccwr_stag_invalidate_t;
-
-typedef union {
-	cc_sq_hdr_t sq_hdr;
-	ccwr_send_req_t send;
-	ccwr_send_se_req_t send_se;
-	ccwr_send_inv_req_t send_inv;
-	ccwr_send_se_inv_req_t send_se_inv;
-	ccwr_rdma_write_req_t rdma_write;
-	ccwr_rdma_read_req_t rdma_read;
-	ccwr_mw_bind_req_t mw_bind;
-	ccwr_nsmr_fastreg_req_t nsmr_fastreg;
-	ccwr_stag_invalidate_req_t stag_inv;
-} PACKED ccwr_sqwr_t;
-
-
-/*
- * RQ WRs
- */
-typedef struct {
-	cc_rq_hdr_t rq_hdr;
-	u8 data[0];		/* array of SGEs */
-} PACKED ccwr_rqwr_t, ccwr_recv_req_t;
-
-typedef ccwr_ce_t ccwr_recv_rep_t;
-
-typedef union {
-	ccwr_recv_req_t req;
-	ccwr_recv_rep_t rep;
-} PACKED ccwr_recv_t;
-
-/*
- * All AEs start with this header.  Most AEs only need to convey the
- * information in the header.  Some, like LLP connection events, need
- * more info.  The union typdef ccwr_ae_t has all the possible AEs.
- *
- * hdr.context is the user_context from the rnic_open WR.  NULL If this 
- * is not affiliated with an rnic
- *
- * hdr.id is the AE identifier (eg;  CCAE_REMOTE_SHUTDOWN, 
- * CCAE_LLP_CLOSE_COMPLETE)
- *
- * resource_type is one of:  CC_RES_IND_QP, CC_RES_IND_CQ, CC_RES_IND_SRQ
- *
- * user_context is the context passed down when the host created the resource.
- */
-typedef struct {
-	ccwr_hdr_t hdr;
-	u64 user_context;	/* user context for this res. */
-	u32 resource_type;	/* see cc_resource_indicator_t */
-	u32 resource;		/* handle for resource */
-	u32 qp_state;		/* current QP State */
-} PACKED PACKED ccwr_ae_hdr_t;
-
-/*
- * After submitting the CCAE_ACTIVE_CONNECT_RESULTS message on the AEQ, 
- * the adapter moves the QP into RTS state
- */
-typedef struct {
-	ccwr_ae_hdr_t ae_hdr;
-	u32 laddr;
-	u32 raddr;
-	u16 lport;
-	u16 rport;
-	u32 private_data_length;
-	u8 private_data[0];	/* data is in-line in the msg. */
-} PACKED ccwr_ae_active_connect_results_t;
-
-/*
- * When connections are established by the stack (and the private data
- * MPA frame is received), the adapter will generate an event to the host.
- * The details of the connection, any private data, and the new connection
- * request handle is passed up via the CCAE_CONNECTION_REQUEST msg on the
- * AE queue:
- */
-typedef struct {
-	ccwr_ae_hdr_t ae_hdr;
-	u32 cr_handle;		/* connreq handle (sock ptr) */
-	u32 laddr;
-	u32 raddr;
-	u16 lport;
-	u16 rport;
-	u32 private_data_length;
-	u8 private_data[0];	/* data is in-line in the msg. */
-} PACKED ccwr_ae_connection_request_t;
-
-typedef union {
-	ccwr_ae_hdr_t ae_generic;
-	ccwr_ae_active_connect_results_t ae_active_connect_results;
-	ccwr_ae_connection_request_t ae_connection_request;
-} PACKED ccwr_ae_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u64 hint_count;
-	u64 q0_host_shared;
-	u64 q1_host_shared;
-	u64 q1_host_msg_pool;
-	u64 q2_host_shared;
-	u64 q2_host_msg_pool;
-} PACKED ccwr_init_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_init_rep_t;
-
-typedef union {
-	ccwr_init_req_t req;
-	ccwr_init_rep_t rep;
-} PACKED ccwr_init_t;
-
-/*
- * For upgrading flash.
- */
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-} PACKED ccwr_flash_init_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 adapter_flash_buf_offset;
-	u32 adapter_flash_len;
-} PACKED ccwr_flash_init_rep_t;
-
-typedef union {
-	ccwr_flash_init_req_t req;
-	ccwr_flash_init_rep_t rep;
-} PACKED ccwr_flash_init_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 len;
-} PACKED ccwr_flash_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 status;
-} PACKED ccwr_flash_rep_t;
-
-typedef union {
-	ccwr_flash_req_t req;
-	ccwr_flash_rep_t rep;
-} PACKED ccwr_flash_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 size;
-} PACKED ccwr_buf_alloc_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 offset;		/* 0 if mem not available */
-	u32 size;		/* 0 if mem not available */
-} PACKED ccwr_buf_alloc_rep_t;
-
-typedef union {
-	ccwr_buf_alloc_req_t req;
-	ccwr_buf_alloc_rep_t rep;
-} PACKED ccwr_buf_alloc_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 offset;		/* Must match value from alloc */
-	u32 size;		/* Must match value from alloc */
-} PACKED ccwr_buf_free_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_buf_free_rep_t;
-
-typedef union {
-	ccwr_buf_free_req_t req;
-	ccwr_buf_free_rep_t rep;
-} PACKED ccwr_buf_free_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 offset;
-	u32 size;
-	u32 type;
-	u32 flags;
-} PACKED ccwr_flash_write_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 status;
-} PACKED ccwr_flash_write_rep_t;
-
-typedef union {
-	ccwr_flash_write_req_t req;
-	ccwr_flash_write_rep_t rep;
-} PACKED ccwr_flash_write_t;
-
-/*
- * Messages for LLP connection setup. 
- */
-
-/*
- * Listen Request.  This allocates a listening endpoint to allow passive
- * connection setup.  Newly established LLP connections are passed up
- * via an AE.  See ccwr_ae_connection_request_t
- */
-typedef struct {
-	ccwr_hdr_t hdr;
-	u64 user_context;	/* returned in AEs. */
-	u32 rnic_handle;
-	u32 local_addr;		/* local addr, or 0  */
-	u16 local_port;		/* 0 means "pick one" */
-	u16 pad;
-	u32 backlog;		/* tradional tcp listen bl */
-} PACKED ccwr_ep_listen_create_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 ep_handle;		/* handle to new listening ep */
-	u16 local_port;		/* resulting port... */
-	u16 pad;
-} PACKED ccwr_ep_listen_create_rep_t;
-
-typedef union {
-	ccwr_ep_listen_create_req_t req;
-	ccwr_ep_listen_create_rep_t rep;
-} PACKED ccwr_ep_listen_create_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 ep_handle;
-} PACKED ccwr_ep_listen_destroy_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_ep_listen_destroy_rep_t;
-
-typedef union {
-	ccwr_ep_listen_destroy_req_t req;
-	ccwr_ep_listen_destroy_rep_t rep;
-} PACKED ccwr_ep_listen_destroy_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 ep_handle;
-} PACKED ccwr_ep_query_req_t;
-
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 local_addr;
-	u32 remote_addr;
-	u16 local_port;
-	u16 remote_port;
-} PACKED ccwr_ep_query_rep_t;
-
-typedef union {
-	ccwr_ep_query_req_t req;
-	ccwr_ep_query_rep_t rep;
-} PACKED ccwr_ep_query_t;
-
-
-/*
- * The host passes this down to indicate acceptance of a pending iWARP
- * connection.  The cr_handle was obtained from the CONNECTION_REQUEST
- * AE passed up by the adapter.  See ccwr_ae_connection_request_t.
- */
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 qp_handle;		/* QP to bind to this LLP conn */
-	u32 ep_handle;		/* LLP  handle to accept */
-	u32 private_data_length;
-	u8 private_data[0];	/* data in-line in msg. */
-} PACKED ccwr_cr_accept_req_t;
-
-/*
- * adapter sends reply when private data is successfully submitted to 
- * the LLP.
- */
-typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_cr_accept_rep_t;
-
-typedef union {
-	ccwr_cr_accept_req_t req;
-	ccwr_cr_accept_rep_t rep;
-} PACKED ccwr_cr_accept_t;
-
-/*
- * The host sends this down if a given iWARP connection request was 
- * rejected by the consumer.  The cr_handle was obtained from a 
- * previous ccwr_ae_connection_request_t AE sent by the adapter.
- */
-typedef struct {
-	ccwr_hdr_t hdr;
-	u32 rnic_handle;
-	u32 ep_handle;		/* LLP handle to reject */
-} PACKED ccwr_cr_reject_req_t;
-
-/*
- * Dunno if this is needed, but we'll add it for now.  The adapter will
- * send the reject_reply after the LLP endpoint has been destroyed.
- */
-typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_cr_reject_rep_t;
-
-typedef union {
-	ccwr_cr_reject_req_t req;
-	ccwr_cr_reject_rep_t rep;
-} PACKED ccwr_cr_reject_t;
-
-/*
- * console command.  Used to implement a debug console over the verbs
- * request and reply queues.  
- */
-
-/*
- * Console request message.  It contains:
- *	- message hdr with id = CCWR_CONSOLE
- *	- the physaddr/len of host memory to be used for the reply. 
- *	- the command string.  eg:  "netstat -s" or "zoneinfo"
- */
-typedef struct {
-	ccwr_hdr_t hdr;		/* id = CCWR_CONSOLE */
-	u64 reply_buf;		/* pinned host buf for reply */
-	u32 reply_buf_len;	/* length of reply buffer */
-	u8 command[0];		/* NUL terminated ascii string */
-	/* containing the command req */
-} PACKED ccwr_console_req_t;
-
-/*
- * flags used in the console reply.
- */
-typedef enum {
-	CONS_REPLY_TRUNCATED = 0x00000001	/* reply was truncated */
-} PACKED cc_console_flags_t;
-
-/*
- * Console reply message.  
- * hdr.result contains the cc_status_t error if the reply was _not_ generated, 
- * or CC_OK if the reply was generated.
- */
-typedef struct {
-	ccwr_hdr_t hdr;		/* id = CCWR_CONSOLE */
-	u32 flags;		/* see cc_console_flags_t */
-} PACKED ccwr_console_rep_t;
-
-typedef union {
-	ccwr_console_req_t req;
-	ccwr_console_rep_t rep;
-} PACKED ccwr_console_t;
-
-
-/*
- * Giant union with all WRs.  Makes life easier...
- */
-typedef union {
-	ccwr_hdr_t hdr;
-	ccwr_user_hdr_t user_hdr;
-	ccwr_rnic_open_t rnic_open;
-	ccwr_rnic_query_t rnic_query;
-	ccwr_rnic_getconfig_t rnic_getconfig;
-	ccwr_rnic_setconfig_t rnic_setconfig;
-	ccwr_rnic_close_t rnic_close;
-	ccwr_cq_create_t cq_create;
-	ccwr_cq_modify_t cq_modify;
-	ccwr_cq_destroy_t cq_destroy;
-	ccwr_pd_alloc_t pd_alloc;
-	ccwr_pd_dealloc_t pd_dealloc;
-	ccwr_srq_create_t srq_create;
-	ccwr_srq_destroy_t srq_destroy;
-	ccwr_qp_create_t qp_create;
-	ccwr_qp_query_t qp_query;
-	ccwr_qp_modify_t qp_modify;
-	ccwr_qp_destroy_t qp_destroy;
-	ccwr_qp_connect_t qp_connect;
-	ccwr_nsmr_stag_alloc_t nsmr_stag_alloc;
-	ccwr_nsmr_register_t nsmr_register;
-	ccwr_nsmr_pbl_t nsmr_pbl;
-	ccwr_mr_query_t mr_query;
-	ccwr_mw_query_t mw_query;
-	ccwr_stag_dealloc_t stag_dealloc;
-	ccwr_sqwr_t sqwr;
-	ccwr_rqwr_t rqwr;
-	ccwr_ce_t ce;
-	ccwr_ae_t ae;
-	ccwr_init_t init;
-	ccwr_ep_listen_create_t ep_listen_create;
-	ccwr_ep_listen_destroy_t ep_listen_destroy;
-	ccwr_cr_accept_t cr_accept;
-	ccwr_cr_reject_t cr_reject;
-	ccwr_console_t console;
-	ccwr_flash_init_t flash_init;
-	ccwr_flash_t flash;
-	ccwr_buf_alloc_t buf_alloc;
-	ccwr_buf_free_t buf_free;
-	ccwr_flash_write_t flash_write;
-} PACKED ccwr_t;
-
-
-/*
- * Accessors for the wr fields that are packed together tightly to
- * reduce the wr message size.  The wr arguments are void* so that
- * either a ccwr_t*, a ccwr_hdr_t*, or a pointer to any of the types
- * in the ccwr_t union can be passed in.
- */
-static __inline__ u8 cc_wr_get_id(void *wr)
-{
-	return ((ccwr_hdr_t *) wr)->id;
-}
-static __inline__ void c2_wr_set_id(void *wr, u8 id)
-{
-	((ccwr_hdr_t *) wr)->id = id;
-}
-static __inline__ u8 cc_wr_get_result(void *wr)
-{
-	return ((ccwr_hdr_t *) wr)->result;
-}
-static __inline__ void cc_wr_set_result(void *wr, u8 result)
-{
-	((ccwr_hdr_t *) wr)->result = result;
-}
-static __inline__ u8 cc_wr_get_flags(void *wr)
-{
-	return ((ccwr_hdr_t *) wr)->flags;
-}
-static __inline__ void cc_wr_set_flags(void *wr, u8 flags)
-{
-	((ccwr_hdr_t *) wr)->flags = flags;
-}
-static __inline__ u8 cc_wr_get_sge_count(void *wr)
-{
-	return ((ccwr_hdr_t *) wr)->sge_count;
-}
-static __inline__ void cc_wr_set_sge_count(void *wr, u8 sge_count)
-{
-	((ccwr_hdr_t *) wr)->sge_count = sge_count;
-}
-static __inline__ u32 cc_wr_get_wqe_count(void *wr)
-{
-	return ((ccwr_hdr_t *) wr)->wqe_count;
-}
-static __inline__ void cc_wr_set_wqe_count(void *wr, u32 wqe_count)
-{
-	((ccwr_hdr_t *) wr)->wqe_count = wqe_count;
-}
-
-#undef PACKED
-
-#ifdef _MSC_VER
-#pragma pack(pop)
-#endif
-
-#endif /* _CC_WR_H_ */
Index: c2_qp.c
===================================================================
--- c2_qp.c	(revision 5627)
+++ c2_qp.c	(working copy)
@@ -556,13 +556,13 @@
 	 * cannot get on the bus and the card and system hang in a
 	 * deadlock -- thus the need for this code. [TOT]
 	 */
-	while (c2_read32(c2dev->regs + PCI_BAR0_ADAPTER_HINT) & 0x80000000) {
+	while (readl(c2dev->regs + PCI_BAR0_ADAPTER_HINT) & 0x80000000) {
 		set_current_state(TASK_UNINTERRUPTIBLE);
 		schedule_timeout(0);
 	}
 
-	c2_write32(c2dev->regs + PCI_BAR0_ADAPTER_HINT,
-		   CC_HINT_MAKE(mq_index, shared));
+	writel(CC_HINT_MAKE(mq_index, shared),
+	       c2dev->regs + PCI_BAR0_ADAPTER_HINT);
 }
 
 /*
Index: c2.c
===================================================================
--- c2.c	(revision 5627)
+++ c2.c	(working copy)
@@ -137,11 +137,11 @@
 		tx_desc->status = 0;
 
 		/* Set TXP_HTXD_UNINIT */
-		c2_write64((void *) txp_desc + C2_TXP_ADDR,
-			   cpu_to_be64(0x1122334455667788ULL));
-		c2_write16((void *) txp_desc + C2_TXP_LEN, cpu_to_be16(0));
-		c2_write16((void *) txp_desc + C2_TXP_FLAGS,
-			   cpu_to_be16(TXP_HTXD_UNINIT));
+		writeq(cpu_to_be64(0x1122334455667788ULL),
+		       (void __iomem *) txp_desc + C2_TXP_ADDR);
+		writew(cpu_to_be16(0), (void *) txp_desc + C2_TXP_LEN);
+		writew(cpu_to_be16(TXP_HTXD_UNINIT),
+		       (void __iomem *) txp_desc + C2_TXP_FLAGS);
 
 		elem->skb = NULL;
 		elem->ht_desc = tx_desc;
@@ -186,14 +186,14 @@
 		rx_desc->status = 0;
 
 		/* Set RXP_HRXD_UNINIT */
-		c2_write16((void *) rxp_desc + C2_RXP_STATUS,
-			   cpu_to_be16(RXP_HRXD_OK));
-		c2_write16((void *) rxp_desc + C2_RXP_COUNT, cpu_to_be16(0));
-		c2_write16((void *) rxp_desc + C2_RXP_LEN, cpu_to_be16(0));
-		c2_write64((void *) rxp_desc + C2_RXP_ADDR,
-			   cpu_to_be64(0x99aabbccddeeffULL));
-		c2_write16((void *) rxp_desc + C2_RXP_FLAGS,
-			   cpu_to_be16(RXP_HRXD_UNINIT));
+		writew(cpu_to_be16(RXP_HRXD_OK),
+		       (void *) rxp_desc + C2_RXP_STATUS);
+		writew(cpu_to_be16(0), (void *) rxp_desc + C2_RXP_COUNT);
+		writew(cpu_to_be16(0), (void *) rxp_desc + C2_RXP_LEN);
+		writeq(cpu_to_be64(0x99aabbccddeeffULL),
+		       (void *) rxp_desc + C2_RXP_ADDR);
+		writew(cpu_to_be16(RXP_HRXD_UNINIT),
+		       (void *) rxp_desc + C2_RXP_FLAGS);
 
 		elem->skb = NULL;
 		elem->ht_desc = rx_desc;
@@ -245,12 +245,12 @@
 	rxp_hdr = (struct c2_rxp_hdr *) skb->data;
 	rxp_hdr->flags = RXP_HRXD_READY;
 
-	/* c2_write16(elem->hw_desc + C2_RXP_COUNT,  cpu_to_be16(0)); */
-	c2_write16(elem->hw_desc + C2_RXP_STATUS, cpu_to_be16(0));
-	c2_write16(elem->hw_desc + C2_RXP_LEN,
-		   cpu_to_be16((u16) maplen - sizeof(*rxp_hdr)));
-	c2_write64(elem->hw_desc + C2_RXP_ADDR, cpu_to_be64(mapaddr));
-	c2_write16(elem->hw_desc + C2_RXP_FLAGS, cpu_to_be16(RXP_HRXD_READY));
+	/* writew(cpu_to_be16(0), elem->hw_desc + C2_RXP_COUNT); */
+	writew(cpu_to_be16(0), elem->hw_desc + C2_RXP_STATUS);
+	writew(cpu_to_be16((u16) maplen - sizeof(*rxp_hdr)),
+	       elem->hw_desc + C2_RXP_LEN);
+	writeq(cpu_to_be64(mapaddr), elem->hw_desc + C2_RXP_ADDR);
+	writew(cpu_to_be16(RXP_HRXD_READY), elem->hw_desc + C2_RXP_FLAGS);
 
 	elem->skb = skb;
 	elem->mapaddr = mapaddr;
@@ -295,13 +295,13 @@
 		rx_desc = elem->ht_desc;
 		rx_desc->len = 0;
 
-		c2_write16(elem->hw_desc + C2_RXP_STATUS, cpu_to_be16(0));
-		c2_write16(elem->hw_desc + C2_RXP_COUNT, cpu_to_be16(0));
-		c2_write16(elem->hw_desc + C2_RXP_LEN, cpu_to_be16(0));
-		c2_write64(elem->hw_desc + C2_RXP_ADDR,
-			   cpu_to_be64(0x99aabbccddeeffULL));
-		c2_write16(elem->hw_desc + C2_RXP_FLAGS,
-			   cpu_to_be16(RXP_HRXD_UNINIT));
+		writew(cpu_to_be16(0), elem->hw_desc + C2_RXP_STATUS);
+		writew(cpu_to_be16(0), elem->hw_desc + C2_RXP_COUNT);
+		writew(cpu_to_be16(0), elem->hw_desc + C2_RXP_LEN);
+		writeq(cpu_to_be64(0x99aabbccddeeffULL),
+		       elem->hw_desc + C2_RXP_ADDR);
+		writew(cpu_to_be16(RXP_HRXD_UNINIT),
+		       elem->hw_desc + C2_RXP_FLAGS);
 
 		if (elem->skb) {
 			pci_unmap_single(c2dev->pcidev, elem->mapaddr,
@@ -346,25 +346,25 @@
 		retry = 0;
 		do {
 			txp_htxd.flags =
-			    c2_read16(elem->hw_desc + C2_TXP_FLAGS);
+			    readw(elem->hw_desc + C2_TXP_FLAGS);
 
 			if (txp_htxd.flags == TXP_HTXD_READY) {
 				retry = 1;
-				c2_write16(elem->hw_desc + C2_TXP_LEN,
-					   cpu_to_be16(0));
-				c2_write64(elem->hw_desc + C2_TXP_ADDR,
-					   cpu_to_be64(0));
-				c2_write16(elem->hw_desc + C2_TXP_FLAGS,
-					   cpu_to_be16(TXP_HTXD_DONE));
+				writew(cpu_to_be16(0),
+				       elem->hw_desc + C2_TXP_LEN);
+				writeq(cpu_to_be64(0),
+				       elem->hw_desc + C2_TXP_ADDR);
+				writew(cpu_to_be16(TXP_HTXD_DONE),
+				       elem->hw_desc + C2_TXP_FLAGS);
 				c2_port->netstats.tx_dropped++;
 				break;
 			} else {
-				c2_write16(elem->hw_desc + C2_TXP_LEN,
-					   cpu_to_be16(0));
-				c2_write64(elem->hw_desc + C2_TXP_ADDR,
-					   cpu_to_be64(0x1122334455667788ULL));
-				c2_write16(elem->hw_desc + C2_TXP_FLAGS,
-					   cpu_to_be16(TXP_HTXD_UNINIT));
+				writew(cpu_to_be16(0),
+				       elem->hw_desc + C2_TXP_LEN);
+				writeq(cpu_to_be64(0x1122334455667788ULL),
+				       elem->hw_desc + C2_TXP_ADDR);
+				writew(cpu_to_be16(TXP_HTXD_UNINIT),
+				       elem->hw_desc + C2_TXP_FLAGS);
 			}
 
 			c2_tx_free(c2_port->c2dev, elem);
@@ -398,7 +398,7 @@
 	for (elem = tx_ring->to_clean; elem != tx_ring->to_use;
 	     elem = elem->next) {
 		txp_htxd.flags =
-		    be16_to_cpu(c2_read16(elem->hw_desc + C2_TXP_FLAGS));
+		    be16_to_cpu(readw(elem->hw_desc + C2_TXP_FLAGS));
 
 		if (txp_htxd.flags != TXP_HTXD_DONE)
 			break;
@@ -406,7 +406,7 @@
 		if (netif_msg_tx_done(c2_port)) {
 			/* PCI reads are expensive in fast path */
 			txp_htxd.len =
-			    be16_to_cpu(c2_read16(elem->hw_desc + C2_TXP_LEN));
+			    be16_to_cpu(readw(elem->hw_desc + C2_TXP_LEN));
 			dprintk(KERN_INFO PFX
 				"%s: tx done slot %3Zu status 0x%x len "
 				"%5u bytes\n",
@@ -454,12 +454,12 @@
 	memset(elem->skb->data, 0, sizeof(*rxp_hdr));
 
 	/* Write the descriptor to the adapter's rx ring */
-	c2_write16(elem->hw_desc + C2_RXP_STATUS, cpu_to_be16(0));
-	c2_write16(elem->hw_desc + C2_RXP_COUNT, cpu_to_be16(0));
-	c2_write16(elem->hw_desc + C2_RXP_LEN,
-		   cpu_to_be16((u16) elem->maplen - sizeof(*rxp_hdr)));
-	c2_write64(elem->hw_desc + C2_RXP_ADDR, cpu_to_be64(elem->mapaddr));
-	c2_write16(elem->hw_desc + C2_RXP_FLAGS, cpu_to_be16(RXP_HRXD_READY));
+	writew(cpu_to_be16(0), elem->hw_desc + C2_RXP_STATUS);
+	writew(cpu_to_be16(0), elem->hw_desc + C2_RXP_COUNT);
+	writew(cpu_to_be16((u16) elem->maplen - sizeof(*rxp_hdr)),
+	       elem->hw_desc + C2_RXP_LEN);
+	writeq(cpu_to_be64(elem->mapaddr), elem->hw_desc + C2_RXP_ADDR);
+	writew(cpu_to_be16(RXP_HRXD_READY), elem->hw_desc + C2_RXP_FLAGS);
 
 	dprintk(KERN_INFO PFX "packet dropped\n");
 	c2_port->netstats.rx_dropped++;
@@ -586,7 +586,7 @@
 	assert(c2dev != NULL);
 
 	/* Process CCILNET interrupts */
-	netisr0 = c2_read32(c2dev->regs + C2_NISR0);
+	netisr0 = readl(c2dev->regs + C2_NISR0);
 	if (netisr0) {
 
 		/*
@@ -598,14 +598,14 @@
 		c2_tx_interrupt(c2dev->netdev);
 
 		/* Clear the interrupt */
-		c2_write32(c2dev->regs + C2_NISR0, netisr0);
+		writel(netisr0, c2dev->regs + C2_NISR0);
 		handled++;
 	}
 
 	/* Process RNIC interrupts */
-	dmaisr = c2_read32(c2dev->regs + C2_DISR);
+	dmaisr = readl(c2dev->regs + C2_DISR);
 	if (dmaisr) {
-		c2_write32(c2dev->regs + C2_DISR, dmaisr);
+		writel(dmaisr, c2dev->regs + C2_DISR);
 		c2_rnic_interrupt(c2dev);
 		handled++;
 	}
@@ -689,18 +689,18 @@
 	     i++, elem++) {
 		rxp_hdr = (struct c2_rxp_hdr *) elem->skb->data;
 		rxp_hdr->flags = 0;
-		c2_write16(elem->hw_desc + C2_RXP_FLAGS,
-			   cpu_to_be16(RXP_HRXD_READY));
+		writew(cpu_to_be16(RXP_HRXD_READY),
+		       elem->hw_desc + C2_RXP_FLAGS);
 	}
 
 	/* Enable network packets */
 	netif_start_queue(netdev);
 
 	/* Enable IRQ */
-	c2_write32(c2dev->regs + C2_IDIS, 0);
-	netimr0 = c2_read32(c2dev->regs + C2_NIMR0);
+	writel(0, c2dev->regs + C2_IDIS);
+	netimr0 = readl(c2dev->regs + C2_NIMR0);
 	netimr0 &= ~(C2_PCI_HTX_INT | C2_PCI_HRX_INT);
-	c2_write32(c2dev->regs + C2_NIMR0, netimr0);
+	writel(netimr0, c2dev->regs + C2_NIMR0);
 
 	return 0;
 
@@ -731,8 +731,8 @@
 	netif_stop_queue(netdev);
 
 	/* Disable IRQs by clearing the interrupt mask */
-	c2_write32(c2dev->regs + C2_IDIS, 1);
-	c2_write32(c2dev->regs + C2_NIMR0, 0);
+	writel(1, c2dev->regs + C2_IDIS);
+	writel(0, c2dev->regs + C2_NIMR0);
 
 	/* missing: Stop transmitter */
 
@@ -815,9 +815,9 @@
 	elem->maplen = maplen;
 
 	/* Tell HW to xmit */
-	c2_write64(elem->hw_desc + C2_TXP_ADDR, cpu_to_be64(mapaddr));
-	c2_write16(elem->hw_desc + C2_TXP_LEN, cpu_to_be16(maplen));
-	c2_write16(elem->hw_desc + C2_TXP_FLAGS, cpu_to_be16(TXP_HTXD_READY));
+	writeq(cpu_to_be64(mapaddr), elem->hw_desc + C2_TXP_ADDR);
+	writew(cpu_to_be16(maplen), elem->hw_desc + C2_TXP_LEN);
+	writew(cpu_to_be16(TXP_HTXD_READY), elem->hw_desc + C2_TXP_FLAGS);
 
 	c2_port->netstats.tx_packets++;
 	c2_port->netstats.tx_bytes += maplen;
@@ -838,12 +838,12 @@
 			elem->maplen = maplen;
 
 			/* Tell HW to xmit */
-			c2_write64(elem->hw_desc + C2_TXP_ADDR,
-				   cpu_to_be64(mapaddr));
-			c2_write16(elem->hw_desc + C2_TXP_LEN,
-				   cpu_to_be16(maplen));
-			c2_write16(elem->hw_desc + C2_TXP_FLAGS,
-				   cpu_to_be16(TXP_HTXD_READY));
+			writeq(cpu_to_be64(mapaddr),
+			       elem->hw_desc + C2_TXP_ADDR);
+			writew(cpu_to_be16(maplen),
+			       elem->hw_desc + C2_TXP_LEN);
+			writew(cpu_to_be16(TXP_HTXD_READY),
+			       elem->hw_desc + C2_TXP_FLAGS);
 
 			c2_port->netstats.tx_packets++;
 			c2_port->netstats.tx_bytes += maplen;
@@ -1058,11 +1058,11 @@
 
 	/* Validate PCI regs magic */
 	for (i = 0; i < sizeof(c2_magic); i++) {
-		if (c2_magic[i] != c2_read8(mmio_regs + C2_REGS_MAGIC + i)) {
+		if (c2_magic[i] != readb(mmio_regs + C2_REGS_MAGIC + i)) {
 			printk(KERN_ERR PFX "Invalid PCI regs magic "
 				"[%d/%Zd: got 0x%x, exp 0x%x]\n",
 				i + 1, sizeof(c2_magic),
-				c2_read8(mmio_regs + C2_REGS_MAGIC + i),
+				readb(mmio_regs + C2_REGS_MAGIC + i),
 				c2_magic[i]);
 			printk(KERN_ERR PFX "Adapter not claimed\n");
 			iounmap(mmio_regs);
@@ -1072,10 +1072,10 @@
 	}
 
 	/* Validate the adapter version */
-	if (be32_to_cpu(c2_read32(mmio_regs + C2_REGS_VERS)) != C2_VERSION) {
+	if (be32_to_cpu(readl(mmio_regs + C2_REGS_VERS)) != C2_VERSION) {
 		printk(KERN_ERR PFX "Version mismatch "
 			"[fw=%u, c2=%u], Adapter not claimed\n",
-			be32_to_cpu(c2_read32(mmio_regs + C2_REGS_VERS)),
+			be32_to_cpu(readl(mmio_regs + C2_REGS_VERS)),
 			C2_VERSION);
 		ret = -EINVAL;
 		iounmap(mmio_regs);
@@ -1083,10 +1083,10 @@
 	}
 
 	/* Validate the adapter IVN */
-	if (be32_to_cpu(c2_read32(mmio_regs + C2_REGS_IVN)) != C2_IVN) {
+	if (be32_to_cpu(readl(mmio_regs + C2_REGS_IVN)) != C2_IVN) {
 		printk(KERN_ERR PFX "IVN mismatch "
 			"[fw=0x%x, c2=0x%x], Adapter not claimed\n",
-			be32_to_cpu(c2_read32(mmio_regs + C2_REGS_IVN)),
+			be32_to_cpu(readl(mmio_regs + C2_REGS_IVN)),
 			C2_IVN);
 		ret = -EINVAL;
 		iounmap(mmio_regs);
@@ -1110,7 +1110,7 @@
 
 	/* Get the last RX index */
 	c2dev->cur_rx =
-	    (be32_to_cpu(c2_read32(mmio_regs + C2_REGS_HRX_CUR)) -
+	    (be32_to_cpu(readl(mmio_regs + C2_REGS_HRX_CUR)) -
 	     0xffffc000) / sizeof(struct c2_rxp_desc);
 
 	/* Request an interrupt line for the driver */
@@ -1132,7 +1132,7 @@
 	}
 
 	/* Save off the actual size prior to unmapping mmio_regs */
-	kva_map_size = be32_to_cpu(c2_read32(mmio_regs + C2_REGS_PCI_WINSIZE));
+	kva_map_size = be32_to_cpu(readl(mmio_regs + C2_REGS_PCI_WINSIZE));
 
 	/* Unmap the adapter PCI registers in BAR4 */
 	iounmap(mmio_regs);
Index: c2.h
===================================================================
--- c2.h	(revision 5627)
+++ c2.h	(working copy)
@@ -454,53 +454,11 @@
 }
 #endif
 
-/* Read from memory-mapped device */
-static inline u64 c2_read64(const void __iomem * addr)
-{
-	return readq(addr);
-}
-
-static inline u32 c2_read32(const void __iomem * addr)
-{
-	return readl(addr);
-}
-
-static inline u16 c2_read16(const void __iomem * addr)
-{
-	return readw(addr);
-}
-
-static inline u8 c2_read8(const void __iomem * addr)
-{
-	return readb(addr);
-}
-
-/* Write to memory-mapped device */
-static inline void c2_write64(void __iomem * addr, u64 val)
-{
-	writeq(val, addr);
-}
-
-static inline void c2_write32(void __iomem * addr, u32 val)
-{
-	writel(val, addr);
-}
-
-static inline void c2_write16(void __iomem * addr, u16 val)
-{
-	writew(val, addr);
-}
-
-static inline void c2_write8(void __iomem * addr, u8 val)
-{
-	writeb(val, addr);
-}
-
 #define C2_SET_CUR_RX(c2dev, cur_rx) \
-	c2_write32(c2dev->mmio_txp_ring + 4092, cpu_to_be32(cur_rx))
+	writel(cpu_to_be32(cur_rx), c2dev->mmio_txp_ring + 4092)
 
 #define C2_GET_CUR_RX(c2dev) \
-	be32_to_cpu(c2_read32(c2dev->mmio_txp_ring + 4092))
+	be32_to_cpu(readl(c2dev->mmio_txp_ring + 4092))
 
 static inline struct c2_dev *to_c2dev(struct ib_device *ibdev)
 {
Index: c2_vq.c
===================================================================
--- c2_vq.c	(revision 5627)
+++ c2_vq.c	(working copy)
@@ -103,7 +103,7 @@
 {
 	struct c2_vq_req *r;
 
-	r = (struct c2_vq_req *) kmalloc(sizeof(struct c2_vq_req), GFP_KERNEL);
+	r = kmalloc(sizeof(struct c2_vq_req), GFP_KERNEL);
 	if (r) {
 		init_waitqueue_head(&r->wait_object);
 		r->reply_msg = (u64) NULL;
Index: c2_provider.c
===================================================================
--- c2_provider.c	(revision 5627)
+++ c2_provider.c	(working copy)
@@ -251,12 +251,11 @@
 
 	switch (init_attr->qp_type) {
 	case IB_QPT_RC:
-		qp = kmalloc(sizeof(*qp), GFP_KERNEL);
+		qp = kzalloc(sizeof(*qp), GFP_KERNEL);
 		if (!qp) {
 			dprintk("%s: Unable to allocate QP\n", __FUNCTION__);
 			return ERR_PTR(-ENOMEM);
 		}
-		memset(qp, 0, sizeof(*qp));
 
 		if (pd->uobject) {
 			/* XXX userspace specific */
Index: c2_rnic.c
===================================================================
--- c2_rnic.c	(revision 5627)
+++ c2_rnic.c	(working copy)
@@ -249,7 +249,7 @@
 {
 	struct c2_vq_req *vq_req;
 	ccwr_t wr;
-	ccwr_rnic_open_rep_t *reply;
+	struct ccwr_rnic_open_rep *reply;
 	int err;
 
 	vq_req = vq_req_alloc(c2dev);
@@ -277,7 +277,7 @@
 		goto bail0;
 	}
 
-	reply = (ccwr_rnic_open_rep_t *) (unsigned long) (vq_req->reply_msg);
+	reply = (struct ccwr_rnic_open_rep *) (unsigned long) (vq_req->reply_msg);
 	if (!reply) {
 		err = -ENOMEM;
 		goto bail0;
@@ -496,17 +496,17 @@
 	mmio_regs = c2dev->kva;
 	/* Initialize the Verbs Request Queue */
 	c2_mq_init(&c2dev->req_vq, 0,
-		   be32_to_cpu(c2_read32(mmio_regs + C2_REGS_Q0_QSIZE)),
-		   be32_to_cpu(c2_read32(mmio_regs + C2_REGS_Q0_MSGSIZE)),
+		   be32_to_cpu(readl(mmio_regs + C2_REGS_Q0_QSIZE)),
+		   be32_to_cpu(readl(mmio_regs + C2_REGS_Q0_MSGSIZE)),
 		   mmio_regs +
-		   be32_to_cpu(c2_read32(mmio_regs + C2_REGS_Q0_POOLSTART)),
+		   be32_to_cpu(readl(mmio_regs + C2_REGS_Q0_POOLSTART)),
 		   mmio_regs +
-		   be32_to_cpu(c2_read32(mmio_regs + C2_REGS_Q0_SHARED)),
+		   be32_to_cpu(readl(mmio_regs + C2_REGS_Q0_SHARED)),
 		   C2_MQ_ADAPTER_TARGET);
 
 	/* Initialize the Verbs Reply Queue */
-	qsize = be32_to_cpu(c2_read32(mmio_regs + C2_REGS_Q1_QSIZE));
-	msgsize = be32_to_cpu(c2_read32(mmio_regs + C2_REGS_Q1_MSGSIZE));
+	qsize = be32_to_cpu(readl(mmio_regs + C2_REGS_Q1_QSIZE));
+	msgsize = be32_to_cpu(readl(mmio_regs + C2_REGS_Q1_MSGSIZE));
 	q1_pages = kmalloc(qsize * msgsize, GFP_KERNEL);
 	if (!q1_pages) {
 		err = -ENOMEM;
@@ -518,12 +518,12 @@
 		   msgsize,
 		   q1_pages,
 		   mmio_regs +
-		   be32_to_cpu(c2_read32(mmio_regs + C2_REGS_Q1_SHARED)),
+		   be32_to_cpu(readl(mmio_regs + C2_REGS_Q1_SHARED)),
 		   C2_MQ_HOST_TARGET);
 
 	/* Initialize the Asynchronus Event Queue */
-	qsize = be32_to_cpu(c2_read32(mmio_regs + C2_REGS_Q2_QSIZE));
-	msgsize = be32_to_cpu(c2_read32(mmio_regs + C2_REGS_Q2_MSGSIZE));
+	qsize = be32_to_cpu(readl(mmio_regs + C2_REGS_Q2_QSIZE));
+	msgsize = be32_to_cpu(readl(mmio_regs + C2_REGS_Q2_MSGSIZE));
 	q2_pages = kmalloc(qsize * msgsize, GFP_KERNEL);
 	if (!q2_pages) {
 		err = -ENOMEM;
@@ -535,7 +535,7 @@
 		   msgsize,
 		   q2_pages,
 		   mmio_regs +
-		   be32_to_cpu(c2_read32(mmio_regs + C2_REGS_Q2_SHARED)),
+		   be32_to_cpu(readl(mmio_regs + C2_REGS_Q2_SHARED)),
 		   C2_MQ_HOST_TARGET);
 
 	/* Initialize the verbs request allocator */
@@ -545,7 +545,7 @@
 	}
 
 	/* Enable interrupts on the adapter */
-	c2_write32(c2dev->regs + C2_IDIS, 0);
+	writel(0, c2dev->regs + C2_IDIS);
 
 	/* create the WR init message */
 	err = c2_adapter_init(c2dev);
@@ -609,7 +609,7 @@
 	c2_adapter_term(c2dev);
 
 	/* Disable interrupts on the adapter */
-	c2_write32(c2dev->regs + C2_IDIS, 1);
+	writel(1, c2dev->regs + C2_IDIS);
 
 	/* Free the QP pool */
 	c2_cleanup_qp_table(c2dev);
Index: c2_wr.h
===================================================================
--- c2_wr.h	(revision 5627)
+++ c2_wr.h	(working copy)
@@ -47,15 +47,6 @@
  */
 #define WR_BUILD_STR_LEN 64
 
-#ifdef _MSC_VER
-#define PACKED
-#pragma pack(push)
-#pragma pack(1)
-#define __inline__ __inline
-#else
-#define PACKED __attribute__ ((packed))
-#endif
-
 /*
  * WARNING:  All of these structs need to align any 64bit types on   
  * 64 bit boundaries!  64bit types include u64 and u64.
@@ -65,7 +56,7 @@
  * Clustercore Work Request Header.  Be sensitive to field layout
  * and alignment.
  */
-typedef struct {
+struct ccwr_hdr {
 	/* wqe_count is part of the cqe.  It is put here so the
 	 * adapter can write to it while the wr is pending without
 	 * clobbering part of the wr.  This word need not be dma'd
@@ -87,7 +78,7 @@
 	u32 magic;
 	u32 pad;
 #endif
-} PACKED ccwr_hdr_t;
+} __attribute__((packed));
 
 /*
  *------------------------ RNIC ------------------------
@@ -100,7 +91,7 @@
 /*
  * Flags for the RNIC WRs
  */
-typedef enum {
+enum cc_rnic_flags {
 	RNIC_IRD_STATIC = 0x0001,
 	RNIC_ORD_STATIC = 0x0002,
 	RNIC_QP_STATIC = 0x0004,
@@ -109,35 +100,35 @@
 	RNIC_SRQ_MODEL_ARRIVAL = 0x0020,
 	RNIC_CQ_OVF_DETECTED = 0x0040,
 	RNIC_PRIV_MODE = 0x0080
-} PACKED cc_rnic_flags_t;
+};
 
-typedef struct {
-	ccwr_hdr_t hdr;
+struct ccwr_rnic_open_req {
+	struct ccwr_hdr hdr;
 	u64 user_context;
-	u16 flags;		/* See cc_rnic_flags_t */
+	u16 flags;		/* See enum cc_rnic_flags */
 	u16 port_num;
-} PACKED ccwr_rnic_open_req_t;
+} __attribute__((packed));
 
-typedef struct {
-	ccwr_hdr_t hdr;
+struct ccwr_rnic_open_rep {
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
-} PACKED ccwr_rnic_open_rep_t;
+} __attribute__((packed));
 
-typedef union {
-	ccwr_rnic_open_req_t req;
-	ccwr_rnic_open_rep_t rep;
-} PACKED ccwr_rnic_open_t;
+union ccwr_rnic_open {
+	struct ccwr_rnic_open_req req;
+	struct ccwr_rnic_open_rep rep;
+} __attribute__((packed));
 
-typedef struct {
-	ccwr_hdr_t hdr;
+struct ccwr_rnic_query_req {
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
-} PACKED ccwr_rnic_query_req_t;
+} __attribute__((packed));
 
 /*
  * WR_RNIC_QUERY
  */
-typedef struct {
-	ccwr_hdr_t hdr;
+struct ccwr_rnic_query_rep {
+	struct ccwr_hdr hdr;
 	u64 user_context;
 	u32 vendor_id;
 	u32 part_number;
@@ -167,168 +158,168 @@
 	u32 pbe_range_high;
 	u32 max_srqs;
 	u32 page_size;
-} PACKED ccwr_rnic_query_rep_t;
+} __attribute__((packed));
 
-typedef union {
-	ccwr_rnic_query_req_t req;
-	ccwr_rnic_query_rep_t rep;
-} PACKED ccwr_rnic_query_t;
+union ccwr_rnic_query {
+	struct ccwr_rnic_query_req req;
+	struct ccwr_rnic_query_rep rep;
+} __attribute__((packed));
 
 /*
  * WR_RNIC_GETCONFIG
  */
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 option;		/* see cc_getconfig_cmd_t */
 	u64 reply_buf;
 	u32 reply_buf_len;
-} PACKED ccwr_rnic_getconfig_req_t;
+} __attribute__((packed)) ccwr_rnic_getconfig_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 option;		/* see cc_getconfig_cmd_t */
 	u32 count_len;		/* length of the number of addresses configured */
-} PACKED ccwr_rnic_getconfig_rep_t;
+} __attribute__((packed)) ccwr_rnic_getconfig_rep_t;
 
 typedef union {
 	ccwr_rnic_getconfig_req_t req;
 	ccwr_rnic_getconfig_rep_t rep;
-} PACKED ccwr_rnic_getconfig_t;
+} __attribute__((packed)) ccwr_rnic_getconfig_t;
 
 /*
  * WR_RNIC_SETCONFIG
  */
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 option;		/* See cc_setconfig_cmd_t */
 	/* variable data and pad. See cc_netaddr_t and cc_route_t */
 	u8 data[0];
-} PACKED ccwr_rnic_setconfig_req_t;
+} __attribute__((packed)) ccwr_rnic_setconfig_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_rnic_setconfig_rep_t;
+	struct ccwr_hdr hdr;
+} __attribute__((packed)) ccwr_rnic_setconfig_rep_t;
 
 typedef union {
 	ccwr_rnic_setconfig_req_t req;
 	ccwr_rnic_setconfig_rep_t rep;
-} PACKED ccwr_rnic_setconfig_t;
+} __attribute__((packed)) ccwr_rnic_setconfig_t;
 
 /*
  * WR_RNIC_CLOSE
  */
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
-} PACKED ccwr_rnic_close_req_t;
+} __attribute__((packed)) ccwr_rnic_close_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_rnic_close_rep_t;
+	struct ccwr_hdr hdr;
+} __attribute__((packed)) ccwr_rnic_close_rep_t;
 
 typedef union {
 	ccwr_rnic_close_req_t req;
 	ccwr_rnic_close_rep_t rep;
-} PACKED ccwr_rnic_close_t;
+} __attribute__((packed)) ccwr_rnic_close_t;
 
 /*
  *------------------------ CQ ------------------------
  */
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u64 shared_ht;
 	u64 user_context;
 	u64 msg_pool;
 	u32 rnic_handle;
 	u32 msg_size;
 	u32 depth;
-} PACKED ccwr_cq_create_req_t;
+} __attribute__((packed)) ccwr_cq_create_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 mq_index;
 	u32 adapter_shared;
 	u32 cq_handle;
-} PACKED ccwr_cq_create_rep_t;
+} __attribute__((packed)) ccwr_cq_create_rep_t;
 
 typedef union {
 	ccwr_cq_create_req_t req;
 	ccwr_cq_create_rep_t rep;
-} PACKED ccwr_cq_create_t;
+} __attribute__((packed)) ccwr_cq_create_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 cq_handle;
 	u32 new_depth;
 	u64 new_msg_pool;
-} PACKED ccwr_cq_modify_req_t;
+} __attribute__((packed)) ccwr_cq_modify_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_cq_modify_rep_t;
+	struct ccwr_hdr hdr;
+} __attribute__((packed)) ccwr_cq_modify_rep_t;
 
 typedef union {
 	ccwr_cq_modify_req_t req;
 	ccwr_cq_modify_rep_t rep;
-} PACKED ccwr_cq_modify_t;
+} __attribute__((packed)) ccwr_cq_modify_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 cq_handle;
-} PACKED ccwr_cq_destroy_req_t;
+} __attribute__((packed)) ccwr_cq_destroy_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_cq_destroy_rep_t;
+	struct ccwr_hdr hdr;
+} __attribute__((packed)) ccwr_cq_destroy_rep_t;
 
 typedef union {
 	ccwr_cq_destroy_req_t req;
 	ccwr_cq_destroy_rep_t rep;
-} PACKED ccwr_cq_destroy_t;
+} __attribute__((packed)) ccwr_cq_destroy_t;
 
 /*
  *------------------------ PD ------------------------
  */
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 pd_id;
-} PACKED ccwr_pd_alloc_req_t;
+} __attribute__((packed)) ccwr_pd_alloc_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_pd_alloc_rep_t;
+	struct ccwr_hdr hdr;
+} __attribute__((packed)) ccwr_pd_alloc_rep_t;
 
 typedef union {
 	ccwr_pd_alloc_req_t req;
 	ccwr_pd_alloc_rep_t rep;
-} PACKED ccwr_pd_alloc_t;
+} __attribute__((packed)) ccwr_pd_alloc_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 pd_id;
-} PACKED ccwr_pd_dealloc_req_t;
+} __attribute__((packed)) ccwr_pd_dealloc_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_pd_dealloc_rep_t;
+	struct ccwr_hdr hdr;
+} __attribute__((packed)) ccwr_pd_dealloc_rep_t;
 
 typedef union {
 	ccwr_pd_dealloc_req_t req;
 	ccwr_pd_dealloc_rep_t rep;
-} PACKED ccwr_pd_dealloc_t;
+} __attribute__((packed)) ccwr_pd_dealloc_t;
 
 /*
  *------------------------ SRQ ------------------------
  */
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u64 shared_ht;
 	u64 user_context;
 	u32 rnic_handle;
@@ -336,42 +327,42 @@
 	u32 srq_limit;
 	u32 sgl_depth;
 	u32 pd_id;
-} PACKED ccwr_srq_create_req_t;
+} __attribute__((packed)) ccwr_srq_create_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 srq_depth;
 	u32 sgl_depth;
 	u32 msg_size;
 	u32 mq_index;
 	u32 mq_start;
 	u32 srq_handle;
-} PACKED ccwr_srq_create_rep_t;
+} __attribute__((packed)) ccwr_srq_create_rep_t;
 
 typedef union {
 	ccwr_srq_create_req_t req;
 	ccwr_srq_create_rep_t rep;
-} PACKED ccwr_srq_create_t;
+} __attribute__((packed)) ccwr_srq_create_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 srq_handle;
-} PACKED ccwr_srq_destroy_req_t;
+} __attribute__((packed)) ccwr_srq_destroy_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_srq_destroy_rep_t;
+	struct ccwr_hdr hdr;
+} __attribute__((packed)) ccwr_srq_destroy_rep_t;
 
 typedef union {
 	ccwr_srq_destroy_req_t req;
 	ccwr_srq_destroy_rep_t rep;
-} PACKED ccwr_srq_destroy_t;
+} __attribute__((packed)) ccwr_srq_destroy_t;
 
 /*
  *------------------------ QP ------------------------
  */
-typedef enum {
+enum ccwr_qp_flags {
 	QP_RDMA_READ = 0x00000001,	/* RDMA read enabled? */
 	QP_RDMA_WRITE = 0x00000002,	/* RDMA write enabled? */
 	QP_MW_BIND = 0x00000004,	/* MWs enabled */
@@ -379,10 +370,10 @@
 	QP_REMOTE_TERMINATION = 0x00000010,	/* remote end terminated */
 	QP_RDMA_READ_RESPONSE = 0x00000020	/* Remote RDMA read  */
 	    /* enabled? */
-} PACKED ccwr_qp_flags_t;
+};
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u64 shared_sq_ht;
 	u64 shared_rq_ht;
 	u64 user_context;
@@ -393,17 +384,17 @@
 	u32 rq_depth;
 	u32 srq_handle;
 	u32 srq_limit;
-	u32 flags;		/* see ccwr_qp_flags_t */
+	u32 flags;		/* see enum ccwr_qp_flags */
 	u32 send_sgl_depth;
 	u32 recv_sgl_depth;
 	u32 rdma_write_sgl_depth;
 	u32 ord;
 	u32 ird;
 	u32 pd_id;
-} PACKED ccwr_qp_create_req_t;
+} __attribute__((packed)) ccwr_qp_create_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 sq_depth;
 	u32 rq_depth;
 	u32 send_sgl_depth;
@@ -418,21 +409,21 @@
 	u32 rq_mq_index;
 	u32 rq_mq_start;
 	u32 qp_handle;
-} PACKED ccwr_qp_create_rep_t;
+} __attribute__((packed)) ccwr_qp_create_rep_t;
 
 typedef union {
 	ccwr_qp_create_req_t req;
 	ccwr_qp_create_rep_t rep;
-} PACKED ccwr_qp_create_t;
+} __attribute__((packed)) ccwr_qp_create_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 qp_handle;
-} PACKED ccwr_qp_query_req_t;
+} __attribute__((packed)) ccwr_qp_query_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u64 user_context;
 	u32 rnic_handle;
 	u32 sq_depth;
@@ -452,15 +443,15 @@
 	u32 terminate_msg_length;	/* 0 if not present */
 	u8 data[0];
 	/* Terminate Message in-line here. */
-} PACKED ccwr_qp_query_rep_t;
+} __attribute__((packed)) ccwr_qp_query_rep_t;
 
 typedef union {
 	ccwr_qp_query_req_t req;
 	ccwr_qp_query_rep_t rep;
-} PACKED ccwr_qp_query_t;
+} __attribute__((packed)) ccwr_qp_query_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u64 stream_msg;
 	u32 stream_msg_length;
 	u32 rnic_handle;
@@ -471,10 +462,10 @@
 	u32 sq_depth;
 	u32 rq_depth;
 	u32 llp_ep_handle;
-} PACKED ccwr_qp_modify_req_t;
+} __attribute__((packed)) ccwr_qp_modify_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 ord;
 	u32 ird;
 	u32 sq_depth;
@@ -485,27 +476,27 @@
 	u32 rq_msg_size;
 	u32 rq_mq_index;
 	u32 rq_mq_start;
-} PACKED ccwr_qp_modify_rep_t;
+} __attribute__((packed)) ccwr_qp_modify_rep_t;
 
 typedef union {
 	ccwr_qp_modify_req_t req;
 	ccwr_qp_modify_rep_t rep;
-} PACKED ccwr_qp_modify_t;
+} __attribute__((packed)) ccwr_qp_modify_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 qp_handle;
-} PACKED ccwr_qp_destroy_req_t;
+} __attribute__((packed)) ccwr_qp_destroy_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_qp_destroy_rep_t;
+	struct ccwr_hdr hdr;
+} __attribute__((packed)) ccwr_qp_destroy_rep_t;
 
 typedef union {
 	ccwr_qp_destroy_req_t req;
 	ccwr_qp_destroy_rep_t rep;
-} PACKED ccwr_qp_destroy_t;
+} __attribute__((packed)) ccwr_qp_destroy_t;
 
 /*
  * The CCWR_QP_CONNECT msg is posted on the verbs request queue.  It can
@@ -516,7 +507,7 @@
  * See ccwr_ae_active_connect_results_t
  */
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 qp_handle;
 	u32 remote_addr;
@@ -524,12 +515,12 @@
 	u16 pad;
 	u32 private_data_length;
 	u8 private_data[0];	/* Private data in-line. */
-} PACKED ccwr_qp_connect_req_t;
+} __attribute__((packed)) ccwr_qp_connect_req_t;
 
 typedef struct {
 	ccwr_qp_connect_req_t req;
 	/* no synchronous reply.         */
-} PACKED ccwr_qp_connect_t;
+} __attribute__((packed)) ccwr_qp_connect_t;
 
 
 /*
@@ -539,26 +530,26 @@
 typedef cc_mm_flags_t ccwr_mr_flags_t;	/* cc_types.h */
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 pbl_depth;
 	u32 pd_id;
 	u32 flags;		/* See ccwr_mr_flags_t */
-} PACKED ccwr_nsmr_stag_alloc_req_t;
+} __attribute__((packed)) ccwr_nsmr_stag_alloc_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 pbl_depth;
 	u32 stag_index;
-} PACKED ccwr_nsmr_stag_alloc_rep_t;
+} __attribute__((packed)) ccwr_nsmr_stag_alloc_rep_t;
 
 typedef union {
 	ccwr_nsmr_stag_alloc_req_t req;
 	ccwr_nsmr_stag_alloc_rep_t rep;
-} PACKED ccwr_nsmr_stag_alloc_t;
+} __attribute__((packed)) ccwr_nsmr_stag_alloc_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u64 va;
 	u32 rnic_handle;
 	u16 flags;		/* See ccwr_mr_flags_t */
@@ -572,95 +563,95 @@
 	u32 addrs_length;
 	/* array of paddrs (must be aligned on a 64bit boundary) */
 	u64 paddrs[0];
-} PACKED ccwr_nsmr_register_req_t;
+} __attribute__((packed)) ccwr_nsmr_register_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 pbl_depth;
 	u32 stag_index;
-} PACKED ccwr_nsmr_register_rep_t;
+} __attribute__((packed)) ccwr_nsmr_register_rep_t;
 
 typedef union {
 	ccwr_nsmr_register_req_t req;
 	ccwr_nsmr_register_rep_t rep;
-} PACKED ccwr_nsmr_register_t;
+} __attribute__((packed)) ccwr_nsmr_register_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 flags;		/* See ccwr_mr_flags_t */
 	u32 stag_index;
 	u32 addrs_length;
 	/* array of paddrs (must be aligned on a 64bit boundary) */
 	u64 paddrs[0];
-} PACKED ccwr_nsmr_pbl_req_t;
+} __attribute__((packed)) ccwr_nsmr_pbl_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_nsmr_pbl_rep_t;
+	struct ccwr_hdr hdr;
+} __attribute__((packed)) ccwr_nsmr_pbl_rep_t;
 
 typedef union {
 	ccwr_nsmr_pbl_req_t req;
 	ccwr_nsmr_pbl_rep_t rep;
-} PACKED ccwr_nsmr_pbl_t;
+} __attribute__((packed)) ccwr_nsmr_pbl_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 stag_index;
-} PACKED ccwr_mr_query_req_t;
+} __attribute__((packed)) ccwr_mr_query_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u8 stag_key;
 	u8 pad[3];
 	u32 pd_id;
 	u32 flags;		/* See ccwr_mr_flags_t */
 	u32 pbl_depth;
-} PACKED ccwr_mr_query_rep_t;
+} __attribute__((packed)) ccwr_mr_query_rep_t;
 
 typedef union {
 	ccwr_mr_query_req_t req;
 	ccwr_mr_query_rep_t rep;
-} PACKED ccwr_mr_query_t;
+} __attribute__((packed)) ccwr_mr_query_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 stag_index;
-} PACKED ccwr_mw_query_req_t;
+} __attribute__((packed)) ccwr_mw_query_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u8 stag_key;
 	u8 pad[3];
 	u32 pd_id;
 	u32 flags;		/* See ccwr_mr_flags_t */
-} PACKED ccwr_mw_query_rep_t;
+} __attribute__((packed)) ccwr_mw_query_rep_t;
 
 typedef union {
 	ccwr_mw_query_req_t req;
 	ccwr_mw_query_rep_t rep;
-} PACKED ccwr_mw_query_t;
+} __attribute__((packed)) ccwr_mw_query_t;
 
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 stag_index;
-} PACKED ccwr_stag_dealloc_req_t;
+} __attribute__((packed)) ccwr_stag_dealloc_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_stag_dealloc_rep_t;
+	struct ccwr_hdr hdr;
+} __attribute__((packed)) ccwr_stag_dealloc_rep_t;
 
 typedef union {
 	ccwr_stag_dealloc_req_t req;
 	ccwr_stag_dealloc_rep_t rep;
-} PACKED ccwr_stag_dealloc_t;
+} __attribute__((packed)) ccwr_stag_dealloc_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u64 va;
 	u32 rnic_handle;
 	u16 flags;		/* See ccwr_mr_flags_t */
@@ -676,21 +667,21 @@
 	u32 pad1;
 	/* array of paddrs (must be aligned on a 64bit boundary) */
 	u64 paddrs[0];
-} PACKED ccwr_nsmr_reregister_req_t;
+} __attribute__((packed)) ccwr_nsmr_reregister_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 pbl_depth;
 	u32 stag_index;
-} PACKED ccwr_nsmr_reregister_rep_t;
+} __attribute__((packed)) ccwr_nsmr_reregister_rep_t;
 
 typedef union {
 	ccwr_nsmr_reregister_req_t req;
 	ccwr_nsmr_reregister_rep_t rep;
-} PACKED ccwr_nsmr_reregister_t;
+} __attribute__((packed)) ccwr_nsmr_reregister_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u64 va;
 	u32 rnic_handle;
 	u16 flags;		/* See ccwr_mr_flags_t */
@@ -698,62 +689,62 @@
 	u8 pad;
 	u32 stag_index;
 	u32 pd_id;
-} PACKED ccwr_smr_register_req_t;
+} __attribute__((packed)) ccwr_smr_register_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 stag_index;
-} PACKED ccwr_smr_register_rep_t;
+} __attribute__((packed)) ccwr_smr_register_rep_t;
 
 typedef union {
 	ccwr_smr_register_req_t req;
 	ccwr_smr_register_rep_t rep;
-} PACKED ccwr_smr_register_t;
+} __attribute__((packed)) ccwr_smr_register_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 pd_id;
-} PACKED ccwr_mw_alloc_req_t;
+} __attribute__((packed)) ccwr_mw_alloc_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 stag_index;
-} PACKED ccwr_mw_alloc_rep_t;
+} __attribute__((packed)) ccwr_mw_alloc_rep_t;
 
 typedef union {
 	ccwr_mw_alloc_req_t req;
 	ccwr_mw_alloc_rep_t rep;
-} PACKED ccwr_mw_alloc_t;
+} __attribute__((packed)) ccwr_mw_alloc_t;
 
 /*
  *------------------------ WRs -----------------------
  */
 
 typedef struct {
-	ccwr_hdr_t hdr;		/* Has status and WR Type */
-} PACKED ccwr_user_hdr_t;
+	struct ccwr_hdr hdr;		/* Has status and WR Type */
+} __attribute__((packed)) ccwr_user_hdr_t;
 
 /* Completion queue entry. */
 typedef struct {
-	ccwr_hdr_t hdr;		/* Has status and WR Type */
+	struct ccwr_hdr hdr;		/* Has status and WR Type */
 	u64 qp_user_context;	/* cc_user_qp_t * */
 	u32 qp_state;		/* Current QP State */
 	u32 handle;		/* QPID or EP Handle */
 	u32 bytes_rcvd;		/* valid for RECV WCs */
 	u32 stag;
-} PACKED ccwr_ce_t;
+} __attribute__((packed)) ccwr_ce_t;
 
 
 /*
  * Flags used for all post-sq WRs.  These must fit in the flags
- * field of the ccwr_hdr_t (eight bits).
+ * field of the struct ccwr_hdr (eight bits).
  */
-typedef enum {
+enum {
 	SQ_SIGNALED = 0x01,
 	SQ_READ_FENCE = 0x02,
 	SQ_FENCE = 0x04,
-} PACKED cc_sq_flags_t;
+};
 
 /*
  * Common fields for all post-sq WRs.  Namely the standard header and a 
@@ -761,14 +752,14 @@
  */
 typedef struct {
 	ccwr_user_hdr_t user_hdr;
-} PACKED cc_sq_hdr_t;
+} __attribute__((packed)) cc_sq_hdr_t;
 
 /*
  * Same as above but for post-rq WRs.
  */
 typedef struct {
 	ccwr_user_hdr_t user_hdr;
-} PACKED cc_rq_hdr_t;
+} __attribute__((packed)) cc_rq_hdr_t;
 
 /*
  * use the same struct for all sends.
@@ -778,7 +769,7 @@
 	u32 sge_len;
 	u32 remote_stag;
 	u8 data[0];		/* SGE array */
-} PACKED ccwr_send_req_t, ccwr_send_se_req_t, ccwr_send_inv_req_t,
+} __attribute__((packed)) ccwr_send_req_t, ccwr_send_se_req_t, ccwr_send_inv_req_t,
     ccwr_send_se_inv_req_t;
 
 typedef ccwr_ce_t ccwr_send_rep_t;
@@ -786,7 +777,7 @@
 typedef union {
 	ccwr_send_req_t req;
 	ccwr_send_rep_t rep;
-} PACKED ccwr_send_t, ccwr_send_se_t, ccwr_send_inv_t, ccwr_send_se_inv_t;
+} __attribute__((packed)) ccwr_send_t, ccwr_send_se_t, ccwr_send_inv_t, ccwr_send_se_inv_t;
 
 typedef struct {
 	cc_sq_hdr_t sq_hdr;
@@ -794,14 +785,14 @@
 	u32 remote_stag;
 	u32 sge_len;
 	u8 data[0];		/* SGE array */
-} PACKED ccwr_rdma_write_req_t;
+} __attribute__((packed)) ccwr_rdma_write_req_t;
 
 typedef ccwr_ce_t ccwr_rdma_write_rep_t;
 
 typedef union {
 	ccwr_rdma_write_req_t req;
 	ccwr_rdma_write_rep_t rep;
-} PACKED ccwr_rdma_write_t;
+} __attribute__((packed)) ccwr_rdma_write_t;
 
 typedef struct {
 	cc_sq_hdr_t sq_hdr;
@@ -810,14 +801,14 @@
 	u32 local_stag;
 	u32 remote_stag;
 	u32 length;
-} PACKED ccwr_rdma_read_req_t, ccwr_rdma_read_inv_req_t;
+} __attribute__((packed)) ccwr_rdma_read_req_t, ccwr_rdma_read_inv_req_t;
 
 typedef ccwr_ce_t ccwr_rdma_read_rep_t;
 
 typedef union {
 	ccwr_rdma_read_req_t req;
 	ccwr_rdma_read_rep_t rep;
-} PACKED ccwr_rdma_read_t, ccwr_rdma_read_inv_t;
+} __attribute__((packed)) ccwr_rdma_read_t, ccwr_rdma_read_inv_t;
 
 typedef struct {
 	cc_sq_hdr_t sq_hdr;
@@ -828,14 +819,14 @@
 	u32 mr_stag_index;
 	u32 length;
 	u32 flags;		/* see ccwr_mr_flags_t; */
-} PACKED ccwr_mw_bind_req_t;
+} __attribute__((packed)) ccwr_mw_bind_req_t;
 
 typedef ccwr_ce_t ccwr_mw_bind_rep_t;
 
 typedef union {
 	ccwr_mw_bind_req_t req;
 	ccwr_mw_bind_rep_t rep;
-} PACKED ccwr_mw_bind_t;
+} __attribute__((packed)) ccwr_mw_bind_t;
 
 typedef struct {
 	cc_sq_hdr_t sq_hdr;
@@ -849,28 +840,28 @@
 	u32 addrs_length;
 	/* array of paddrs (must be aligned on a 64bit boundary) */
 	u64 paddrs[0];
-} PACKED ccwr_nsmr_fastreg_req_t;
+} __attribute__((packed)) ccwr_nsmr_fastreg_req_t;
 
 typedef ccwr_ce_t ccwr_nsmr_fastreg_rep_t;
 
 typedef union {
 	ccwr_nsmr_fastreg_req_t req;
 	ccwr_nsmr_fastreg_rep_t rep;
-} PACKED ccwr_nsmr_fastreg_t;
+} __attribute__((packed)) ccwr_nsmr_fastreg_t;
 
 typedef struct {
 	cc_sq_hdr_t sq_hdr;
 	u8 stag_key;
 	u8 pad[3];
 	u32 stag_index;
-} PACKED ccwr_stag_invalidate_req_t;
+} __attribute__((packed)) ccwr_stag_invalidate_req_t;
 
 typedef ccwr_ce_t ccwr_stag_invalidate_rep_t;
 
 typedef union {
 	ccwr_stag_invalidate_req_t req;
 	ccwr_stag_invalidate_rep_t rep;
-} PACKED ccwr_stag_invalidate_t;
+} __attribute__((packed)) ccwr_stag_invalidate_t;
 
 typedef union {
 	cc_sq_hdr_t sq_hdr;
@@ -883,7 +874,7 @@
 	ccwr_mw_bind_req_t mw_bind;
 	ccwr_nsmr_fastreg_req_t nsmr_fastreg;
 	ccwr_stag_invalidate_req_t stag_inv;
-} PACKED ccwr_sqwr_t;
+} __attribute__((packed)) ccwr_sqwr_t;
 
 
 /*
@@ -892,14 +883,14 @@
 typedef struct {
 	cc_rq_hdr_t rq_hdr;
 	u8 data[0];		/* array of SGEs */
-} PACKED ccwr_rqwr_t, ccwr_recv_req_t;
+} __attribute__((packed)) ccwr_rqwr_t, ccwr_recv_req_t;
 
 typedef ccwr_ce_t ccwr_recv_rep_t;
 
 typedef union {
 	ccwr_recv_req_t req;
 	ccwr_recv_rep_t rep;
-} PACKED ccwr_recv_t;
+} __attribute__((packed)) ccwr_recv_t;
 
 /*
  * All AEs start with this header.  Most AEs only need to convey the
@@ -917,12 +908,12 @@
  * user_context is the context passed down when the host created the resource.
  */
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u64 user_context;	/* user context for this res. */
 	u32 resource_type;	/* see cc_resource_indicator_t */
 	u32 resource;		/* handle for resource */
 	u32 qp_state;		/* current QP State */
-} PACKED PACKED ccwr_ae_hdr_t;
+} __attribute__((packed)) __attribute__((packed)) ccwr_ae_hdr_t;
 
 /*
  * After submitting the CCAE_ACTIVE_CONNECT_RESULTS message on the AEQ, 
@@ -936,7 +927,7 @@
 	u16 rport;
 	u32 private_data_length;
 	u8 private_data[0];	/* data is in-line in the msg. */
-} PACKED ccwr_ae_active_connect_results_t;
+} __attribute__((packed)) ccwr_ae_active_connect_results_t;
 
 /*
  * When connections are established by the stack (and the private data
@@ -954,120 +945,120 @@
 	u16 rport;
 	u32 private_data_length;
 	u8 private_data[0];	/* data is in-line in the msg. */
-} PACKED ccwr_ae_connection_request_t;
+} __attribute__((packed)) ccwr_ae_connection_request_t;
 
 typedef union {
 	ccwr_ae_hdr_t ae_generic;
 	ccwr_ae_active_connect_results_t ae_active_connect_results;
 	ccwr_ae_connection_request_t ae_connection_request;
-} PACKED ccwr_ae_t;
+} __attribute__((packed)) ccwr_ae_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u64 hint_count;
 	u64 q0_host_shared;
 	u64 q1_host_shared;
 	u64 q1_host_msg_pool;
 	u64 q2_host_shared;
 	u64 q2_host_msg_pool;
-} PACKED ccwr_init_req_t;
+} __attribute__((packed)) ccwr_init_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_init_rep_t;
+	struct ccwr_hdr hdr;
+} __attribute__((packed)) ccwr_init_rep_t;
 
 typedef union {
 	ccwr_init_req_t req;
 	ccwr_init_rep_t rep;
-} PACKED ccwr_init_t;
+} __attribute__((packed)) ccwr_init_t;
 
 /*
  * For upgrading flash.
  */
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
-} PACKED ccwr_flash_init_req_t;
+} __attribute__((packed)) ccwr_flash_init_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 adapter_flash_buf_offset;
 	u32 adapter_flash_len;
-} PACKED ccwr_flash_init_rep_t;
+} __attribute__((packed)) ccwr_flash_init_rep_t;
 
 typedef union {
 	ccwr_flash_init_req_t req;
 	ccwr_flash_init_rep_t rep;
-} PACKED ccwr_flash_init_t;
+} __attribute__((packed)) ccwr_flash_init_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 len;
-} PACKED ccwr_flash_req_t;
+} __attribute__((packed)) ccwr_flash_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 status;
-} PACKED ccwr_flash_rep_t;
+} __attribute__((packed)) ccwr_flash_rep_t;
 
 typedef union {
 	ccwr_flash_req_t req;
 	ccwr_flash_rep_t rep;
-} PACKED ccwr_flash_t;
+} __attribute__((packed)) ccwr_flash_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 size;
-} PACKED ccwr_buf_alloc_req_t;
+} __attribute__((packed)) ccwr_buf_alloc_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 offset;		/* 0 if mem not available */
 	u32 size;		/* 0 if mem not available */
-} PACKED ccwr_buf_alloc_rep_t;
+} __attribute__((packed)) ccwr_buf_alloc_rep_t;
 
 typedef union {
 	ccwr_buf_alloc_req_t req;
 	ccwr_buf_alloc_rep_t rep;
-} PACKED ccwr_buf_alloc_t;
+} __attribute__((packed)) ccwr_buf_alloc_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 offset;		/* Must match value from alloc */
 	u32 size;		/* Must match value from alloc */
-} PACKED ccwr_buf_free_req_t;
+} __attribute__((packed)) ccwr_buf_free_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_buf_free_rep_t;
+	struct ccwr_hdr hdr;
+} __attribute__((packed)) ccwr_buf_free_rep_t;
 
 typedef union {
 	ccwr_buf_free_req_t req;
 	ccwr_buf_free_rep_t rep;
-} PACKED ccwr_buf_free_t;
+} __attribute__((packed)) ccwr_buf_free_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 offset;
 	u32 size;
 	u32 type;
 	u32 flags;
-} PACKED ccwr_flash_write_req_t;
+} __attribute__((packed)) ccwr_flash_write_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 status;
-} PACKED ccwr_flash_write_rep_t;
+} __attribute__((packed)) ccwr_flash_write_rep_t;
 
 typedef union {
 	ccwr_flash_write_req_t req;
 	ccwr_flash_write_rep_t rep;
-} PACKED ccwr_flash_write_t;
+} __attribute__((packed)) ccwr_flash_write_t;
 
 /*
  * Messages for LLP connection setup. 
@@ -1079,61 +1070,61 @@
  * via an AE.  See ccwr_ae_connection_request_t
  */
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u64 user_context;	/* returned in AEs. */
 	u32 rnic_handle;
 	u32 local_addr;		/* local addr, or 0  */
 	u16 local_port;		/* 0 means "pick one" */
 	u16 pad;
 	u32 backlog;		/* tradional tcp listen bl */
-} PACKED ccwr_ep_listen_create_req_t;
+} __attribute__((packed)) ccwr_ep_listen_create_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 ep_handle;		/* handle to new listening ep */
 	u16 local_port;		/* resulting port... */
 	u16 pad;
-} PACKED ccwr_ep_listen_create_rep_t;
+} __attribute__((packed)) ccwr_ep_listen_create_rep_t;
 
 typedef union {
 	ccwr_ep_listen_create_req_t req;
 	ccwr_ep_listen_create_rep_t rep;
-} PACKED ccwr_ep_listen_create_t;
+} __attribute__((packed)) ccwr_ep_listen_create_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 ep_handle;
-} PACKED ccwr_ep_listen_destroy_req_t;
+} __attribute__((packed)) ccwr_ep_listen_destroy_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_ep_listen_destroy_rep_t;
+	struct ccwr_hdr hdr;
+} __attribute__((packed)) ccwr_ep_listen_destroy_rep_t;
 
 typedef union {
 	ccwr_ep_listen_destroy_req_t req;
 	ccwr_ep_listen_destroy_rep_t rep;
-} PACKED ccwr_ep_listen_destroy_t;
+} __attribute__((packed)) ccwr_ep_listen_destroy_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 ep_handle;
-} PACKED ccwr_ep_query_req_t;
+} __attribute__((packed)) ccwr_ep_query_req_t;
 
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 local_addr;
 	u32 remote_addr;
 	u16 local_port;
 	u16 remote_port;
-} PACKED ccwr_ep_query_rep_t;
+} __attribute__((packed)) ccwr_ep_query_rep_t;
 
 typedef union {
 	ccwr_ep_query_req_t req;
 	ccwr_ep_query_rep_t rep;
-} PACKED ccwr_ep_query_t;
+} __attribute__((packed)) ccwr_ep_query_t;
 
 
 /*
@@ -1142,26 +1133,26 @@
  * AE passed up by the adapter.  See ccwr_ae_connection_request_t.
  */
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 qp_handle;		/* QP to bind to this LLP conn */
 	u32 ep_handle;		/* LLP  handle to accept */
 	u32 private_data_length;
 	u8 private_data[0];	/* data in-line in msg. */
-} PACKED ccwr_cr_accept_req_t;
+} __attribute__((packed)) ccwr_cr_accept_req_t;
 
 /*
  * adapter sends reply when private data is successfully submitted to 
  * the LLP.
  */
 typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_cr_accept_rep_t;
+	struct ccwr_hdr hdr;
+} __attribute__((packed)) ccwr_cr_accept_rep_t;
 
 typedef union {
 	ccwr_cr_accept_req_t req;
 	ccwr_cr_accept_rep_t rep;
-} PACKED ccwr_cr_accept_t;
+} __attribute__((packed)) ccwr_cr_accept_t;
 
 /*
  * The host sends this down if a given iWARP connection request was 
@@ -1169,23 +1160,23 @@
  * previous ccwr_ae_connection_request_t AE sent by the adapter.
  */
 typedef struct {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	u32 rnic_handle;
 	u32 ep_handle;		/* LLP handle to reject */
-} PACKED ccwr_cr_reject_req_t;
+} __attribute__((packed)) ccwr_cr_reject_req_t;
 
 /*
  * Dunno if this is needed, but we'll add it for now.  The adapter will
  * send the reject_reply after the LLP endpoint has been destroyed.
  */
 typedef struct {
-	ccwr_hdr_t hdr;
-} PACKED ccwr_cr_reject_rep_t;
+	struct ccwr_hdr hdr;
+} __attribute__((packed)) ccwr_cr_reject_rep_t;
 
 typedef union {
 	ccwr_cr_reject_req_t req;
 	ccwr_cr_reject_rep_t rep;
-} PACKED ccwr_cr_reject_t;
+} __attribute__((packed)) ccwr_cr_reject_t;
 
 /*
  * console command.  Used to implement a debug console over the verbs
@@ -1199,19 +1190,19 @@
  *	- the command string.  eg:  "netstat -s" or "zoneinfo"
  */
 typedef struct {
-	ccwr_hdr_t hdr;		/* id = CCWR_CONSOLE */
+	struct ccwr_hdr hdr;		/* id = CCWR_CONSOLE */
 	u64 reply_buf;		/* pinned host buf for reply */
 	u32 reply_buf_len;	/* length of reply buffer */
 	u8 command[0];		/* NUL terminated ascii string */
 	/* containing the command req */
-} PACKED ccwr_console_req_t;
+} __attribute__((packed)) ccwr_console_req_t;
 
 /*
  * flags used in the console reply.
  */
 typedef enum {
 	CONS_REPLY_TRUNCATED = 0x00000001	/* reply was truncated */
-} PACKED cc_console_flags_t;
+} __attribute__((packed)) cc_console_flags_t;
 
 /*
  * Console reply message.  
@@ -1219,24 +1210,24 @@
  * or CC_OK if the reply was generated.
  */
 typedef struct {
-	ccwr_hdr_t hdr;		/* id = CCWR_CONSOLE */
+	struct ccwr_hdr hdr;		/* id = CCWR_CONSOLE */
 	u32 flags;		/* see cc_console_flags_t */
-} PACKED ccwr_console_rep_t;
+} __attribute__((packed)) ccwr_console_rep_t;
 
 typedef union {
 	ccwr_console_req_t req;
 	ccwr_console_rep_t rep;
-} PACKED ccwr_console_t;
+} __attribute__((packed)) ccwr_console_t;
 
 
 /*
  * Giant union with all WRs.  Makes life easier...
  */
 typedef union {
-	ccwr_hdr_t hdr;
+	struct ccwr_hdr hdr;
 	ccwr_user_hdr_t user_hdr;
-	ccwr_rnic_open_t rnic_open;
-	ccwr_rnic_query_t rnic_query;
+	union ccwr_rnic_open rnic_open;
+	union ccwr_rnic_query rnic_query;
 	ccwr_rnic_getconfig_t rnic_getconfig;
 	ccwr_rnic_setconfig_t rnic_setconfig;
 	ccwr_rnic_close_t rnic_close;
@@ -1273,60 +1264,54 @@
 	ccwr_buf_alloc_t buf_alloc;
 	ccwr_buf_free_t buf_free;
 	ccwr_flash_write_t flash_write;
-} PACKED ccwr_t;
+} __attribute__((packed)) ccwr_t;
 
 
 /*
  * Accessors for the wr fields that are packed together tightly to
  * reduce the wr message size.  The wr arguments are void* so that
- * either a ccwr_t*, a ccwr_hdr_t*, or a pointer to any of the types
+ * either a ccwr_t*, a struct ccwr_hdr*, or a pointer to any of the types
  * in the ccwr_t union can be passed in.
  */
 static __inline__ u8 c2_wr_get_id(void *wr)
 {
-	return ((ccwr_hdr_t *) wr)->id;
+	return ((struct ccwr_hdr *) wr)->id;
 }
 static __inline__ void c2_wr_set_id(void *wr, u8 id)
 {
-	((ccwr_hdr_t *) wr)->id = id;
+	((struct ccwr_hdr *) wr)->id = id;
 }
 static __inline__ u8 c2_wr_get_result(void *wr)
 {
-	return ((ccwr_hdr_t *) wr)->result;
+	return ((struct ccwr_hdr *) wr)->result;
 }
 static __inline__ void c2_wr_set_result(void *wr, u8 result)
 {
-	((ccwr_hdr_t *) wr)->result = result;
+	((struct ccwr_hdr *) wr)->result = result;
 }
 static __inline__ u8 c2_wr_get_flags(void *wr)
 {
-	return ((ccwr_hdr_t *) wr)->flags;
+	return ((struct ccwr_hdr *) wr)->flags;
 }
 static __inline__ void c2_wr_set_flags(void *wr, u8 flags)
 {
-	((ccwr_hdr_t *) wr)->flags = flags;
+	((struct ccwr_hdr *) wr)->flags = flags;
 }
 static __inline__ u8 c2_wr_get_sge_count(void *wr)
 {
-	return ((ccwr_hdr_t *) wr)->sge_count;
+	return ((struct ccwr_hdr *) wr)->sge_count;
 }
 static __inline__ void c2_wr_set_sge_count(void *wr, u8 sge_count)
 {
-	((ccwr_hdr_t *) wr)->sge_count = sge_count;
+	((struct ccwr_hdr *) wr)->sge_count = sge_count;
 }
 static __inline__ u32 c2_wr_get_wqe_count(void *wr)
 {
-	return ((ccwr_hdr_t *) wr)->wqe_count;
+	return ((struct ccwr_hdr *) wr)->wqe_count;
 }
 static __inline__ void c2_wr_set_wqe_count(void *wr, u32 wqe_count)
 {
-	((ccwr_hdr_t *) wr)->wqe_count = wqe_count;
+	((struct ccwr_hdr *) wr)->wqe_count = wqe_count;
 }
 
-#undef PACKED
-
-#ifdef _MSC_VER
-#pragma pack(pop)
-#endif
-
 #endif				/* _CC_WR_H_ */
Index: c2_mm.c
===================================================================
--- c2_mm.c	(revision 5627)
+++ c2_mm.c	(working copy)
@@ -69,8 +69,7 @@
 
 	pbe_count = (c2dev->req_vq.msg_size -
 		     sizeof(ccwr_nsmr_pbl_req_t)) / sizeof(u64);
-	wr = (ccwr_nsmr_pbl_req_t *) kmalloc(c2dev->req_vq.msg_size,
-					     GFP_KERNEL);
+	wr = kmalloc(c2dev->req_vq.msg_size, GFP_KERNEL);
 	if (!wr) {
 		return -ENOMEM;
 	}



More information about the general mailing list