driver.h revision 219820
1219820Sjeff/* 2219820Sjeff * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. 3219820Sjeff * 4219820Sjeff * This software is available to you under a choice of one of two 5219820Sjeff * licenses. You may choose to be licensed under the terms of the GNU 6219820Sjeff * General Public License (GPL) Version 2, available from the file 7219820Sjeff * COPYING in the main directory of this source tree, or the 8219820Sjeff * OpenIB.org BSD license below: 9219820Sjeff * 10219820Sjeff * Redistribution and use in source and binary forms, with or 11219820Sjeff * without modification, are permitted provided that the following 12219820Sjeff * conditions are met: 13219820Sjeff * 14219820Sjeff * - Redistributions of source code must retain the above 15219820Sjeff * copyright notice, this list of conditions and the following 16219820Sjeff * disclaimer. 17219820Sjeff * 18219820Sjeff * - Redistributions in binary form must reproduce the above 19219820Sjeff * copyright notice, this list of conditions and the following 20219820Sjeff * disclaimer in the documentation and/or other materials 21219820Sjeff * provided with the distribution. 22219820Sjeff * 23219820Sjeff * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24219820Sjeff * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25219820Sjeff * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26219820Sjeff * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 27219820Sjeff * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 28219820Sjeff * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 29219820Sjeff * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30219820Sjeff * SOFTWARE. 31219820Sjeff */ 32219820Sjeff 33219820Sjeff#ifndef MLX4_DRIVER_H 34219820Sjeff#define MLX4_DRIVER_H 35219820Sjeff 36219820Sjeff#include <linux/device.h> 37219820Sjeff 38219820Sjeffstruct mlx4_dev; 39219820Sjeff 40219820Sjeffenum mlx4_dev_event { 41219820Sjeff MLX4_DEV_EVENT_CATASTROPHIC_ERROR, 42219820Sjeff MLX4_DEV_EVENT_PORT_UP, 43219820Sjeff MLX4_DEV_EVENT_PORT_DOWN, 44219820Sjeff MLX4_DEV_EVENT_PORT_REINIT, 45219820Sjeff}; 46219820Sjeff 47219820Sjeffenum mlx4_query_reply { 48219820Sjeff MLX4_QUERY_NOT_MINE = -1, 49219820Sjeff MLX4_QUERY_MINE_NOPORT = 0 50219820Sjeff}; 51219820Sjeff 52219820Sjeffenum mlx4_prot { 53219820Sjeff MLX4_PROT_IB, 54219820Sjeff MLX4_PROT_EN, 55219820Sjeff}; 56219820Sjeff 57219820Sjeffenum mlx4_mcast_prot { 58219820Sjeff MLX4_MCAST_PROT_IB = 0, 59219820Sjeff MLX4_MCAST_PROT_EN = 1, 60219820Sjeff}; 61219820Sjeff 62219820Sjeffstruct mlx4_interface { 63219820Sjeff void * (*add) (struct mlx4_dev *dev); 64219820Sjeff void (*remove)(struct mlx4_dev *dev, void *context); 65219820Sjeff void (*event) (struct mlx4_dev *dev, void *context, 66219820Sjeff enum mlx4_dev_event event, int port); 67219820Sjeff void * (*get_prot_dev) (struct mlx4_dev *dev, void *context, u8 port); 68219820Sjeff enum mlx4_prot protocol; 69219820Sjeff 70219820Sjeff enum mlx4_query_reply (*query) (void *context, void *); 71219820Sjeff struct list_head list; 72219820Sjeff}; 73219820Sjeff 74219820Sjeffint mlx4_register_interface(struct mlx4_interface *intf); 75219820Sjeffvoid mlx4_unregister_interface(struct mlx4_interface *intf); 76219820Sjeffvoid *mlx4_get_prot_dev(struct mlx4_dev *dev, enum mlx4_prot proto, int port); 77219820Sjeff 78219820Sjeffstruct mlx4_dev *mlx4_query_interface(void *, int *port); 79219820Sjeffvoid mlx4_set_iboe_counter(struct mlx4_dev *dev, int index, u8 port); 80219820Sjeffint mlx4_get_iboe_counter(struct mlx4_dev *dev, u8 port); 81219820Sjeff 82219820Sjeff#endif /* MLX4_DRIVER_H */ 83