~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/net/mlx4/intf.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 * SOFTWARE.
32
32
 */
33
33
 
 
34
#include <linux/slab.h>
 
35
 
34
36
#include "mlx4.h"
35
37
 
36
38
struct mlx4_device_context {
159
161
 
160
162
        mutex_unlock(&intf_mutex);
161
163
}
 
164
 
 
165
void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port)
 
166
{
 
167
        struct mlx4_priv *priv = mlx4_priv(dev);
 
168
        struct mlx4_device_context *dev_ctx;
 
169
        unsigned long flags;
 
170
        void *result = NULL;
 
171
 
 
172
        spin_lock_irqsave(&priv->ctx_lock, flags);
 
173
 
 
174
        list_for_each_entry(dev_ctx, &priv->ctx_list, list)
 
175
                if (dev_ctx->intf->protocol == proto && dev_ctx->intf->get_dev) {
 
176
                        result = dev_ctx->intf->get_dev(dev, dev_ctx->context, port);
 
177
                        break;
 
178
                }
 
179
 
 
180
        spin_unlock_irqrestore(&priv->ctx_lock, flags);
 
181
 
 
182
        return result;
 
183
}
 
184
EXPORT_SYMBOL_GPL(mlx4_get_protocol_dev);