typedef struct kib_tx                         /* transmit message */
  {
 -      struct list_head       tx_list;       /* queue on idle_txs ibc_tx_queue
 -                                             * etc. */
 -      kib_tx_pool_t          *tx_pool;      /* pool I'm from */
 -      struct kib_conn        *tx_conn;      /* owning conn */
 -      short                  tx_sending;    /* # tx callbacks outstanding */
 -      short                  tx_queued;     /* queued for sending */
 -      short                  tx_waiting;    /* waiting for peer */
 -      int                    tx_status;     /* LNET completion status */
 -      unsigned long          tx_deadline;   /* completion deadline */
 -      __u64                  tx_cookie;     /* completion cookie */
 -      lnet_msg_t             *tx_lntmsg[2]; /* lnet msgs to finalize on
 -                                             * completion */
 -      kib_msg_t              *tx_msg;       /* message buffer (host vaddr) */
 -      __u64                  tx_msgaddr;    /* message buffer (I/O addr) */
 +      struct list_head      tx_list; /* queue on idle_txs ibc_tx_queue etc. */
 +      kib_tx_pool_t         *tx_pool;       /* pool I'm from */
 +      struct kib_conn       *tx_conn;       /* owning conn */
 +      short                 tx_sending;     /* # tx callbacks outstanding */
 +      short                 tx_queued;      /* queued for sending */
 +      short                 tx_waiting;     /* waiting for peer */
 +      int                   tx_status;      /* LNET completion status */
 +      unsigned long         tx_deadline;    /* completion deadline */
 +      __u64                 tx_cookie;      /* completion cookie */
 +      lnet_msg_t *tx_lntmsg[2]; /* lnet msgs to finalize on completion */
 +      kib_msg_t             *tx_msg;        /* message buffer (host vaddr) */
 +      __u64                 tx_msgaddr;     /* message buffer (I/O addr) */
        DECLARE_PCI_UNMAP_ADDR(tx_msgunmap);  /* for dma_unmap_single() */
 -      int                    tx_nwrq;       /* # send work items */
 -      struct ib_rdma_wr      *tx_wrq;       /* send work items... */
 -      struct ib_sge          *tx_sge;       /* ...and their memory */
 -      kib_rdma_desc_t        *tx_rd;        /* rdma descriptor */
 -      int                    tx_nfrags;     /* # entries in... */
 -      struct scatterlist     *tx_frags;     /* dma_map_sg descriptor */
 -      __u64                  *tx_pages;     /* rdma phys page addrs */
 -      kib_fmr_t               fmr;          /* FMR */
 -      int                    tx_dmadir;     /* dma direction */
 +      int                   tx_nwrq;        /* # send work items */
-       struct ib_send_wr     *tx_wrq;        /* send work items... */
++      struct ib_rdma_wr     *tx_wrq;        /* send work items... */
 +      struct ib_sge         *tx_sge;        /* ...and their memory */
 +      kib_rdma_desc_t       *tx_rd;         /* rdma descriptor */
 +      int                   tx_nfrags;      /* # entries in... */
 +      struct scatterlist    *tx_frags;      /* dma_map_sg descriptor */
 +      __u64                 *tx_pages;      /* rdma phys page addrs */
 +      kib_fmr_t             fmr;            /* FMR */
 +      int                   tx_dmadir;      /* dma direction */
  } kib_tx_t;
  
  typedef struct kib_connvars {
 
        int                     max_pages;
  };
  
 -static int rds_iw_flush_mr_pool(struct rds_iw_mr_pool *pool, int free_all);
 +static void rds_iw_flush_mr_pool(struct rds_iw_mr_pool *pool, int free_all);
  static void rds_iw_mr_pool_flush_worker(struct work_struct *work);
- static int rds_iw_init_fastreg(struct rds_iw_mr_pool *pool, struct rds_iw_mr *ibmr);
- static int rds_iw_map_fastreg(struct rds_iw_mr_pool *pool,
+ static int rds_iw_init_reg(struct rds_iw_mr_pool *pool, struct rds_iw_mr *ibmr);
+ static int rds_iw_map_reg(struct rds_iw_mr_pool *pool,
                          struct rds_iw_mr *ibmr,
                          struct scatterlist *sg, unsigned int nents);
  static void rds_iw_free_fastreg(struct rds_iw_mr_pool *pool, struct rds_iw_mr *ibmr);
 
  
        ctxt->direction = DMA_FROM_DEVICE;
        ctxt->frmr = frmr;
-       pages_needed = min_t(int, pages_needed, xprt->sc_frmr_pg_list_len);
-       read = min_t(int, (pages_needed << PAGE_SHIFT) - *page_offset,
-                    rs_length);
+       nents = min_t(unsigned int, nents, xprt->sc_frmr_pg_list_len);
 -      read = min_t(int, nents << PAGE_SHIFT, rs_length);
++      read = min_t(int, (nents << PAGE_SHIFT) - *page_offset, rs_length);
  
-       frmr->kva = page_address(rqstp->rq_arg.pages[pg_no]);
        frmr->direction = DMA_FROM_DEVICE;
        frmr->access_flags = (IB_ACCESS_LOCAL_WRITE|IB_ACCESS_REMOTE_WRITE);
-       frmr->map_len = pages_needed << PAGE_SHIFT;
-       frmr->page_list_len = pages_needed;
+       frmr->sg_nents = nents;
  
-       for (pno = 0; pno < pages_needed; pno++) {
+       for (pno = 0; pno < nents; pno++) {
                int len = min_t(int, rs_length, PAGE_SIZE - pg_off);
  
                head->arg.pages[pg_no] = rqstp->rq_arg.pages[pg_no];