RDMA: Remove subversion $Id tags
[safe/jmp/linux-2.6] / drivers / infiniband / hw / mthca / mthca_eq.c
index cbdc348..4e36aa7 100644 (file)
  * 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.
- *
- * $Id: mthca_eq.c 1382 2004-12-24 02:21:02Z roland $
  */
 
-#include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
@@ -174,11 +171,6 @@ static inline u64 async_mask(struct mthca_dev *dev)
 
 static inline void tavor_set_eq_ci(struct mthca_dev *dev, struct mthca_eq *eq, u32 ci)
 {
-       __be32 doorbell[2];
-
-       doorbell[0] = cpu_to_be32(MTHCA_EQ_DB_SET_CI | eq->eqn);
-       doorbell[1] = cpu_to_be32(ci & (eq->nent - 1));
-
        /*
         * This barrier makes sure that all updates to ownership bits
         * done by set_eqe_hw() hit memory before the consumer index
@@ -188,7 +180,7 @@ static inline void tavor_set_eq_ci(struct mthca_dev *dev, struct mthca_eq *eq, u
         * having set_eqe_hw() overwrite the owner field.
         */
        wmb();
-       mthca_write64(doorbell,
+       mthca_write64(MTHCA_EQ_DB_SET_CI | eq->eqn, ci & (eq->nent - 1),
                      dev->kar + MTHCA_EQ_DOORBELL,
                      MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock));
 }
@@ -213,12 +205,7 @@ static inline void set_eq_ci(struct mthca_dev *dev, struct mthca_eq *eq, u32 ci)
 
 static inline void tavor_eq_req_not(struct mthca_dev *dev, int eqn)
 {
-       __be32 doorbell[2];
-
-       doorbell[0] = cpu_to_be32(MTHCA_EQ_DB_REQ_NOT | eqn);
-       doorbell[1] = 0;
-
-       mthca_write64(doorbell,
+       mthca_write64(MTHCA_EQ_DB_REQ_NOT | eqn, 0,
                      dev->kar + MTHCA_EQ_DOORBELL,
                      MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock));
 }
@@ -231,12 +218,7 @@ static inline void arbel_eq_req_not(struct mthca_dev *dev, u32 eqn_mask)
 static inline void disarm_cq(struct mthca_dev *dev, int eqn, int cqn)
 {
        if (!mthca_is_memfree(dev)) {
-               __be32 doorbell[2];
-
-               doorbell[0] = cpu_to_be32(MTHCA_EQ_DB_DISARM_CQ | eqn);
-               doorbell[1] = cpu_to_be32(cqn);
-
-               mthca_write64(doorbell,
+               mthca_write64(MTHCA_EQ_DB_DISARM_CQ | eqn, cqn,
                              dev->kar + MTHCA_EQ_DOORBELL,
                              MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock));
        }
@@ -248,9 +230,9 @@ static inline struct mthca_eqe *get_eqe(struct mthca_eq *eq, u32 entry)
        return eq->page_list[off / PAGE_SIZE].buf + off % PAGE_SIZE;
 }
 
-static inline struct mthca_eqenext_eqe_sw(struct mthca_eq *eq)
+static inline struct mthca_eqe *next_eqe_sw(struct mthca_eq *eq)
 {
-       struct mthca_eqeeqe;
+       struct mthca_eqe *eqe;
        eqe = get_eqe(eq, eq->cons_index);
        return (MTHCA_EQ_ENTRY_OWNER_HW & eqe->owner) ? NULL : eqe;
 }
@@ -405,7 +387,7 @@ static int mthca_eq_int(struct mthca_dev *dev, struct mthca_eq *eq)
        return eqes_found;
 }
 
-static irqreturn_t mthca_tavor_interrupt(int irq, void *dev_ptr, struct pt_regs *regs)
+static irqreturn_t mthca_tavor_interrupt(int irq, void *dev_ptr)
 {
        struct mthca_dev *dev = dev_ptr;
        u32 ecr;
@@ -432,8 +414,7 @@ static irqreturn_t mthca_tavor_interrupt(int irq, void *dev_ptr, struct pt_regs
        return IRQ_HANDLED;
 }
 
-static irqreturn_t mthca_tavor_msi_x_interrupt(int irq, void *eq_ptr,
-                                        struct pt_regs *regs)
+static irqreturn_t mthca_tavor_msi_x_interrupt(int irq, void *eq_ptr)
 {
        struct mthca_eq  *eq  = eq_ptr;
        struct mthca_dev *dev = eq->dev;
@@ -446,7 +427,7 @@ static irqreturn_t mthca_tavor_msi_x_interrupt(int irq, void *eq_ptr,
        return IRQ_HANDLED;
 }
 
-static irqreturn_t mthca_arbel_interrupt(int irq, void *dev_ptr, struct pt_regs *regs)
+static irqreturn_t mthca_arbel_interrupt(int irq, void *dev_ptr)
 {
        struct mthca_dev *dev = dev_ptr;
        int work = 0;
@@ -467,8 +448,7 @@ static irqreturn_t mthca_arbel_interrupt(int irq, void *dev_ptr, struct pt_regs
        return IRQ_RETVAL(work);
 }
 
-static irqreturn_t mthca_arbel_msi_x_interrupt(int irq, void *eq_ptr,
-                                              struct pt_regs *regs)
+static irqreturn_t mthca_arbel_msi_x_interrupt(int irq, void *eq_ptr)
 {
        struct mthca_eq  *eq  = eq_ptr;
        struct mthca_dev *dev = eq->dev;
@@ -481,10 +461,10 @@ static irqreturn_t mthca_arbel_msi_x_interrupt(int irq, void *eq_ptr,
        return IRQ_HANDLED;
 }
 
-static int __devinit mthca_create_eq(struct mthca_dev *dev,
-                                    int nent,
-                                    u8 intr,
-                                    struct mthca_eq *eq)
+static int mthca_create_eq(struct mthca_dev *dev,
+                          int nent,
+                          u8 intr,
+                          struct mthca_eq *eq)
 {
        int npages;
        u64 *dma_list = NULL;
@@ -525,7 +505,7 @@ static int __devinit mthca_create_eq(struct mthca_dev *dev,
                dma_list[i] = t;
                pci_unmap_addr_set(&eq->page_list[i], mapping, t);
 
-               memset(eq->page_list[i].buf, 0, PAGE_SIZE);
+               clear_page(eq->page_list[i].buf);
        }
 
        for (i = 0; i < eq->nent; ++i)
@@ -666,9 +646,9 @@ static void mthca_free_irqs(struct mthca_dev *dev)
                                 dev->eq_table.eq + i);
 }
 
-static int __devinit mthca_map_reg(struct mthca_dev *dev,
-                                  unsigned long offset, unsigned long size,
-                                  void __iomem **map)
+static int mthca_map_reg(struct mthca_dev *dev,
+                        unsigned long offset, unsigned long size,
+                        void __iomem **map)
 {
        unsigned long base = pci_resource_start(dev->pdev, 0);
 
@@ -693,12 +673,8 @@ static void mthca_unmap_reg(struct mthca_dev *dev, unsigned long offset,
        iounmap(map);
 }
 
-static int __devinit mthca_map_eq_regs(struct mthca_dev *dev)
+static int mthca_map_eq_regs(struct mthca_dev *dev)
 {
-       unsigned long mthca_base;
-
-       mthca_base = pci_resource_start(dev->pdev, 0);
-
        if (mthca_is_memfree(dev)) {
                /*
                 * We assume that the EQ arm and EQ set CI registers
@@ -765,7 +741,7 @@ static int __devinit mthca_map_eq_regs(struct mthca_dev *dev)
 
 }
 
-static void __devexit mthca_unmap_eq_regs(struct mthca_dev *dev)
+static void mthca_unmap_eq_regs(struct mthca_dev *dev)
 {
        if (mthca_is_memfree(dev)) {
                mthca_unmap_reg(dev, (pci_resource_len(dev->pdev, 0) - 1) &
@@ -787,7 +763,7 @@ static void __devexit mthca_unmap_eq_regs(struct mthca_dev *dev)
        }
 }
 
-int __devinit mthca_map_eq_icm(struct mthca_dev *dev, u64 icm_virt)
+int mthca_map_eq_icm(struct mthca_dev *dev, u64 icm_virt)
 {
        int ret;
        u8 status;
@@ -821,7 +797,7 @@ int __devinit mthca_map_eq_icm(struct mthca_dev *dev, u64 icm_virt)
        return ret;
 }
 
-void __devexit mthca_unmap_eq_icm(struct mthca_dev *dev)
+void mthca_unmap_eq_icm(struct mthca_dev *dev)
 {
        u8 status;
 
@@ -831,7 +807,7 @@ void __devexit mthca_unmap_eq_icm(struct mthca_dev *dev)
        __free_page(dev->eq_table.icm_page);
 }
 
-int __devinit mthca_init_eq_table(struct mthca_dev *dev)
+int mthca_init_eq_table(struct mthca_dev *dev)
 {
        int err;
        u8 status;
@@ -849,8 +825,7 @@ int __devinit mthca_init_eq_table(struct mthca_dev *dev)
        if (err)
                goto err_out_free;
 
-       if (dev->mthca_flags & MTHCA_FLAG_MSI ||
-           dev->mthca_flags & MTHCA_FLAG_MSI_X) {
+       if (dev->mthca_flags & MTHCA_FLAG_MSI_X) {
                dev->eq_table.clr_mask = 0;
        } else {
                dev->eq_table.clr_mask =
@@ -861,8 +836,7 @@ int __devinit mthca_init_eq_table(struct mthca_dev *dev)
 
        dev->eq_table.arm_mask = 0;
 
-       intr = (dev->mthca_flags & MTHCA_FLAG_MSI) ?
-               128 : dev->eq_table.inta_pin;
+       intr = dev->eq_table.inta_pin;
 
        err = mthca_create_eq(dev, dev->limits.num_cqs + MTHCA_NUM_SPARE_EQE,
                              (dev->mthca_flags & MTHCA_FLAG_MSI_X) ? 128 : intr,
@@ -904,7 +878,7 @@ int __devinit mthca_init_eq_table(struct mthca_dev *dev)
                                  mthca_is_memfree(dev) ?
                                  mthca_arbel_interrupt :
                                  mthca_tavor_interrupt,
-                                 SA_SHIRQ, DRV_NAME, dev);
+                                 IRQF_SHARED, DRV_NAME, dev);
                if (err)
                        goto err_out_cmd;
                dev->eq_table.have_irq = 1;
@@ -954,7 +928,7 @@ err_out_free:
        return err;
 }
 
-void __devexit mthca_cleanup_eq_table(struct mthca_dev *dev)
+void mthca_cleanup_eq_table(struct mthca_dev *dev)
 {
        u8 status;
        int i;