diff options
Diffstat (limited to 'drivers/infiniband/hw/nes/nes.h')
-rw-r--r-- | drivers/infiniband/hw/nes/nes.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/nes/nes.h b/drivers/infiniband/hw/nes/nes.h index c438e4691b3c..0da62b904d00 100644 --- a/drivers/infiniband/hw/nes/nes.h +++ b/drivers/infiniband/hw/nes/nes.h | |||
@@ -399,11 +399,20 @@ static inline void nes_write8(void __iomem *addr, u8 val) | |||
399 | writeb(val, addr); | 399 | writeb(val, addr); |
400 | } | 400 | } |
401 | 401 | ||
402 | 402 | enum nes_resource { | |
403 | NES_RESOURCE_MW = 1, | ||
404 | NES_RESOURCE_FAST_MR, | ||
405 | NES_RESOURCE_PHYS_MR, | ||
406 | NES_RESOURCE_USER_MR, | ||
407 | NES_RESOURCE_PD, | ||
408 | NES_RESOURCE_QP, | ||
409 | NES_RESOURCE_CQ, | ||
410 | NES_RESOURCE_ARP | ||
411 | }; | ||
403 | 412 | ||
404 | static inline int nes_alloc_resource(struct nes_adapter *nesadapter, | 413 | static inline int nes_alloc_resource(struct nes_adapter *nesadapter, |
405 | unsigned long *resource_array, u32 max_resources, | 414 | unsigned long *resource_array, u32 max_resources, |
406 | u32 *req_resource_num, u32 *next) | 415 | u32 *req_resource_num, u32 *next, enum nes_resource resource_type) |
407 | { | 416 | { |
408 | unsigned long flags; | 417 | unsigned long flags; |
409 | u32 resource_num; | 418 | u32 resource_num; |
@@ -414,7 +423,7 @@ static inline int nes_alloc_resource(struct nes_adapter *nesadapter, | |||
414 | if (resource_num >= max_resources) { | 423 | if (resource_num >= max_resources) { |
415 | resource_num = find_first_zero_bit(resource_array, max_resources); | 424 | resource_num = find_first_zero_bit(resource_array, max_resources); |
416 | if (resource_num >= max_resources) { | 425 | if (resource_num >= max_resources) { |
417 | printk(KERN_ERR PFX "%s: No available resourcess.\n", __func__); | 426 | printk(KERN_ERR PFX "%s: No available resources [type=%u].\n", __func__, resource_type); |
418 | spin_unlock_irqrestore(&nesadapter->resource_lock, flags); | 427 | spin_unlock_irqrestore(&nesadapter->resource_lock, flags); |
419 | return -EMFILE; | 428 | return -EMFILE; |
420 | } | 429 | } |