Go to the documentation of this file.
41 #include <linux/kernel.h>
42 #include <linux/pci.h>
46 #include <linux/list.h>
52 #define DRV_NAME "ib_mthca"
53 #define PFX DRV_NAME ": "
54 #define DRV_VERSION "1.0"
55 #define DRV_RELDATE "April 4, 2008"
363 #ifdef CONFIG_INFINIBAND_MTHCA_DEBUG
364 extern int mthca_debug_level;
366 #define mthca_dbg(mdev, format, arg...) \
368 if (mthca_debug_level) \
369 dev_printk(KERN_DEBUG, &mdev->pdev->dev, format, ## arg); \
374 #define mthca_dbg(mdev, format, arg...) do { (void) mdev; } while (0)
378 #define mthca_err(mdev, format, arg...) \
379 dev_err(&mdev->pdev->dev, format, ## arg)
380 #define mthca_info(mdev, format, arg...) \
381 dev_info(&mdev->pdev->dev, format, ## arg)
382 #define mthca_warn(mdev, format, arg...) \
383 dev_warn(&mdev->pdev->dev, format, ## arg)
388 #define MTHCA_GET(dest, source, offset) \
390 void *__p = (char *) (source) + (offset); \
391 switch (sizeof (dest)) { \
392 case 1: (dest) = *(u8 *) __p; break; \
393 case 2: (dest) = be16_to_cpup(__p); break; \
394 case 4: (dest) = be32_to_cpup(__p); break; \
395 case 8: (dest) = be64_to_cpup(__p); break; \
396 default: __buggy_use_of_MTHCA_GET(); \
400 #define MTHCA_PUT(dest, source, offset) \
402 void *__d = ((char *) (dest) + (offset)); \
403 switch (sizeof(source)) { \
404 case 1: *(u8 *) __d = (source); break; \
405 case 2: *(__be16 *) __d = cpu_to_be16(source); break; \
406 case 4: *(__be32 *) __d = cpu_to_be32(source); break; \
407 case 8: *(__be64 *) __d = cpu_to_be64(source); break; \
408 default: __buggy_use_of_MTHCA_PUT(); \
426 int hca_write,
struct mthca_mr *mr);
428 int is_direct,
struct mthca_mr *mr);
476 u64 *buffer_list,
int buffer_size_shift,
591 static inline int mthca_is_memfree(
struct mthca_dev *
dev)