/* * Copyright (c) 2006, 2007 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2007, 2008 Mellanox Technologies. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * OpenIB.org BSD license below: * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * 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.
*/
staticbool is_eth_supported(struct mlx4_dev *dev)
{ for (int port = 1; port <= dev->caps.num_ports; port++) if (dev->caps.port_type[port] == MLX4_PORT_TYPE_ETH) returntrue;
returnfalse;
}
staticbool is_ib_supported(struct mlx4_dev *dev)
{ for (int port = 1; port <= dev->caps.num_ports; port++) if (dev->caps.port_type[port] == MLX4_PORT_TYPE_IB) returntrue;
if (dev->caps.flags & MLX4_DEV_CAP_FLAG_IBOE) returntrue;
staticint add_drivers(struct mlx4_dev *dev)
{ struct mlx4_priv *priv = mlx4_priv(dev); int i, ret = 0;
for (i = 0; i < ARRAY_SIZE(mlx4_adev_devices); i++) { bool is_supported = false;
if (priv->adev[i]) continue;
if (mlx4_adev_devices[i].is_supported)
is_supported = mlx4_adev_devices[i].is_supported(dev);
if (!is_supported) continue;
priv->adev[i] = add_adev(dev, i); if (IS_ERR(priv->adev[i])) {
mlx4_warn(dev, "Device[%d] (%s) failed to load\n", i,
mlx4_adev_devices[i].suffix); /* We continue to rescan drivers and leave to the caller * to make decision if to release everything or
* continue. */
ret = PTR_ERR(priv->adev[i]);
priv->adev[i] = NULL;
}
} return ret;
}
if (ret) {
mlx4_unregister_device(dev); return ret;
}
mlx4_start_catas_poll(dev);
return ret;
}
void mlx4_unregister_device(struct mlx4_dev *dev)
{ if (!(dev->persist->interface_state & MLX4_INTERFACE_STATE_UP)) return;
mlx4_stop_catas_poll(dev); if (dev->persist->interface_state & MLX4_INTERFACE_STATE_DELETION &&
mlx4_is_slave(dev)) { /* In mlx4_remove_one on a VF */
u32 slave_read =
swab32(readl(&mlx4_priv(dev)->mfunc.comm->slave_read));
if (mlx4_comm_internal_err(slave_read)) {
mlx4_dbg(dev, "%s: comm channel is down, entering error state.\n",
__func__);
mlx4_enter_error_state(dev->persist);
}
}
mutex_lock(&intf_mutex);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.