Linux Audio

Check our new training course

Loading...
  1/*
  2 * Copyright (c) 2006, 2007, 2008, 2009, 2010 QLogic Corporation.
  3 * All rights reserved.
  4 * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
  5 *
  6 * This software is available to you under a choice of one of two
  7 * licenses.  You may choose to be licensed under the terms of the GNU
  8 * General Public License (GPL) Version 2, available from the file
  9 * COPYING in the main directory of this source tree, or the
 10 * OpenIB.org BSD license below:
 11 *
 12 *     Redistribution and use in source and binary forms, with or
 13 *     without modification, are permitted provided that the following
 14 *     conditions are met:
 15 *
 16 *      - Redistributions of source code must retain the above
 17 *        copyright notice, this list of conditions and the following
 18 *        disclaimer.
 19 *
 20 *      - Redistributions in binary form must reproduce the above
 21 *        copyright notice, this list of conditions and the following
 22 *        disclaimer in the documentation and/or other materials
 23 *        provided with the distribution.
 24 *
 25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 32 * SOFTWARE.
 33 */
 34
 35#if !defined(IB_PMA_H)
 36#define IB_PMA_H
 37
 38#include <rdma/ib_mad.h>
 39
 40/*
 41 * PMA class portinfo capability mask bits
 42 */
 43#define IB_PMA_CLASS_CAP_ALLPORTSELECT  cpu_to_be16(1 << 8)
 44#define IB_PMA_CLASS_CAP_EXT_WIDTH      cpu_to_be16(1 << 9)
 45#define IB_PMA_CLASS_CAP_XMIT_WAIT      cpu_to_be16(1 << 12)
 46
 47#define IB_PMA_CLASS_PORT_INFO          cpu_to_be16(0x0001)
 48#define IB_PMA_PORT_SAMPLES_CONTROL     cpu_to_be16(0x0010)
 49#define IB_PMA_PORT_SAMPLES_RESULT      cpu_to_be16(0x0011)
 50#define IB_PMA_PORT_COUNTERS            cpu_to_be16(0x0012)
 51#define IB_PMA_PORT_COUNTERS_EXT        cpu_to_be16(0x001D)
 52#define IB_PMA_PORT_SAMPLES_RESULT_EXT  cpu_to_be16(0x001E)
 53
 54struct ib_pma_mad {
 55	struct ib_mad_hdr mad_hdr;
 56	u8 reserved[40];
 57	u8 data[192];
 58} __packed;
 59
 60struct ib_pma_portsamplescontrol {
 61	u8 opcode;
 62	u8 port_select;
 63	u8 tick;
 64	u8 counter_width;		/* resv: 7:3, counter width: 2:0 */
 65	__be32 counter_mask0_9;		/* 2, 10 3-bit fields */
 66	__be16 counter_mask10_14;	/* 1, 5 3-bit fields */
 67	u8 sample_mechanisms;
 68	u8 sample_status;		/* only lower 2 bits */
 69	__be64 option_mask;
 70	__be64 vendor_mask;
 71	__be32 sample_start;
 72	__be32 sample_interval;
 73	__be16 tag;
 74	__be16 counter_select[15];
 75	__be32 reserved1;
 76	__be64 samples_only_option_mask;
 77	__be32 reserved2[28];
 78};
 79
 80struct ib_pma_portsamplesresult {
 81	__be16 tag;
 82	__be16 sample_status;   /* only lower 2 bits */
 83	__be32 counter[15];
 84};
 85
 86struct ib_pma_portsamplesresult_ext {
 87	__be16 tag;
 88	__be16 sample_status;   /* only lower 2 bits */
 89	__be32 extended_width;  /* only upper 2 bits */
 90	__be64 counter[15];
 91};
 92
 93struct ib_pma_portcounters {
 94	u8 reserved;
 95	u8 port_select;
 96	__be16 counter_select;
 97	__be16 symbol_error_counter;
 98	u8 link_error_recovery_counter;
 99	u8 link_downed_counter;
100	__be16 port_rcv_errors;
101	__be16 port_rcv_remphys_errors;
102	__be16 port_rcv_switch_relay_errors;
103	__be16 port_xmit_discards;
104	u8 port_xmit_constraint_errors;
105	u8 port_rcv_constraint_errors;
106	u8 reserved1;
107	u8 link_overrun_errors; /* LocalLink: 7:4, BufferOverrun: 3:0 */
108	__be16 reserved2;
109	__be16 vl15_dropped;
110	__be32 port_xmit_data;
111	__be32 port_rcv_data;
112	__be32 port_xmit_packets;
113	__be32 port_rcv_packets;
114	__be32 port_xmit_wait;
115} __packed;
116
117
118#define IB_PMA_SEL_SYMBOL_ERROR                 cpu_to_be16(0x0001)
119#define IB_PMA_SEL_LINK_ERROR_RECOVERY          cpu_to_be16(0x0002)
120#define IB_PMA_SEL_LINK_DOWNED                  cpu_to_be16(0x0004)
121#define IB_PMA_SEL_PORT_RCV_ERRORS              cpu_to_be16(0x0008)
122#define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS      cpu_to_be16(0x0010)
123#define IB_PMA_SEL_PORT_XMIT_DISCARDS           cpu_to_be16(0x0040)
124#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS  cpu_to_be16(0x0200)
125#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS    cpu_to_be16(0x0400)
126#define IB_PMA_SEL_PORT_VL15_DROPPED            cpu_to_be16(0x0800)
127#define IB_PMA_SEL_PORT_XMIT_DATA               cpu_to_be16(0x1000)
128#define IB_PMA_SEL_PORT_RCV_DATA                cpu_to_be16(0x2000)
129#define IB_PMA_SEL_PORT_XMIT_PACKETS            cpu_to_be16(0x4000)
130#define IB_PMA_SEL_PORT_RCV_PACKETS             cpu_to_be16(0x8000)
131
132struct ib_pma_portcounters_ext {
133	u8 reserved;
134	u8 port_select;
135	__be16 counter_select;
136	__be32 reserved1;
137	__be64 port_xmit_data;
138	__be64 port_rcv_data;
139	__be64 port_xmit_packets;
140	__be64 port_rcv_packets;
141	__be64 port_unicast_xmit_packets;
142	__be64 port_unicast_rcv_packets;
143	__be64 port_multicast_xmit_packets;
144	__be64 port_multicast_rcv_packets;
145} __packed;
146
147#define IB_PMA_SELX_PORT_XMIT_DATA              cpu_to_be16(0x0001)
148#define IB_PMA_SELX_PORT_RCV_DATA               cpu_to_be16(0x0002)
149#define IB_PMA_SELX_PORT_XMIT_PACKETS           cpu_to_be16(0x0004)
150#define IB_PMA_SELX_PORT_RCV_PACKETS            cpu_to_be16(0x0008)
151#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS       cpu_to_be16(0x0010)
152#define IB_PMA_SELX_PORT_UNI_RCV_PACKETS        cpu_to_be16(0x0020)
153#define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS     cpu_to_be16(0x0040)
154#define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS      cpu_to_be16(0x0080)
155
156#endif /* IB_PMA_H */
  1/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
  2/*
  3 * Copyright (c) 2006, 2007, 2008, 2009, 2010 QLogic Corporation.
  4 * All rights reserved.
  5 * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
  6 */
  7
  8#ifndef IB_PMA_H
  9#define IB_PMA_H
 10
 11#include <rdma/ib_mad.h>
 12
 13/*
 14 * PMA class portinfo capability mask bits
 15 */
 16#define IB_PMA_CLASS_CAP_ALLPORTSELECT  cpu_to_be16(1 << 8)
 17#define IB_PMA_CLASS_CAP_EXT_WIDTH      cpu_to_be16(1 << 9)
 18#define IB_PMA_CLASS_CAP_EXT_WIDTH_NOIETF cpu_to_be16(1 << 10)
 19#define IB_PMA_CLASS_CAP_XMIT_WAIT      cpu_to_be16(1 << 12)
 20
 21#define IB_PMA_CLASS_PORT_INFO          cpu_to_be16(0x0001)
 22#define IB_PMA_PORT_SAMPLES_CONTROL     cpu_to_be16(0x0010)
 23#define IB_PMA_PORT_SAMPLES_RESULT      cpu_to_be16(0x0011)
 24#define IB_PMA_PORT_COUNTERS            cpu_to_be16(0x0012)
 25#define IB_PMA_PORT_COUNTERS_EXT        cpu_to_be16(0x001D)
 26#define IB_PMA_PORT_SAMPLES_RESULT_EXT  cpu_to_be16(0x001E)
 27
 28struct ib_pma_mad {
 29	struct ib_mad_hdr mad_hdr;
 30	u8 reserved[40];
 31	u8 data[192];
 32} __packed;
 33
 34struct ib_pma_portsamplescontrol {
 35	u8 opcode;
 36	u8 port_select;
 37	u8 tick;
 38	u8 counter_width;		/* resv: 7:3, counter width: 2:0 */
 39	__be32 counter_mask0_9;		/* 2, 10 3-bit fields */
 40	__be16 counter_mask10_14;	/* 1, 5 3-bit fields */
 41	u8 sample_mechanisms;
 42	u8 sample_status;		/* only lower 2 bits */
 43	__be64 option_mask;
 44	__be64 vendor_mask;
 45	__be32 sample_start;
 46	__be32 sample_interval;
 47	__be16 tag;
 48	__be16 counter_select[15];
 49	__be32 reserved1;
 50	__be64 samples_only_option_mask;
 51	__be32 reserved2[28];
 52};
 53
 54struct ib_pma_portsamplesresult {
 55	__be16 tag;
 56	__be16 sample_status;   /* only lower 2 bits */
 57	__be32 counter[15];
 58};
 59
 60struct ib_pma_portsamplesresult_ext {
 61	__be16 tag;
 62	__be16 sample_status;   /* only lower 2 bits */
 63	__be32 extended_width;  /* only upper 2 bits */
 64	__be64 counter[15];
 65};
 66
 67struct ib_pma_portcounters {
 68	u8 reserved;
 69	u8 port_select;
 70	__be16 counter_select;
 71	__be16 symbol_error_counter;
 72	u8 link_error_recovery_counter;
 73	u8 link_downed_counter;
 74	__be16 port_rcv_errors;
 75	__be16 port_rcv_remphys_errors;
 76	__be16 port_rcv_switch_relay_errors;
 77	__be16 port_xmit_discards;
 78	u8 port_xmit_constraint_errors;
 79	u8 port_rcv_constraint_errors;
 80	u8 reserved1;
 81	u8 link_overrun_errors; /* LocalLink: 7:4, BufferOverrun: 3:0 */
 82	__be16 reserved2;
 83	__be16 vl15_dropped;
 84	__be32 port_xmit_data;
 85	__be32 port_rcv_data;
 86	__be32 port_xmit_packets;
 87	__be32 port_rcv_packets;
 88	__be32 port_xmit_wait;
 89} __packed;
 90
 91
 92#define IB_PMA_SEL_SYMBOL_ERROR                 cpu_to_be16(0x0001)
 93#define IB_PMA_SEL_LINK_ERROR_RECOVERY          cpu_to_be16(0x0002)
 94#define IB_PMA_SEL_LINK_DOWNED                  cpu_to_be16(0x0004)
 95#define IB_PMA_SEL_PORT_RCV_ERRORS              cpu_to_be16(0x0008)
 96#define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS      cpu_to_be16(0x0010)
 97#define IB_PMA_SEL_PORT_XMIT_DISCARDS           cpu_to_be16(0x0040)
 98#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS  cpu_to_be16(0x0200)
 99#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS    cpu_to_be16(0x0400)
100#define IB_PMA_SEL_PORT_VL15_DROPPED            cpu_to_be16(0x0800)
101#define IB_PMA_SEL_PORT_XMIT_DATA               cpu_to_be16(0x1000)
102#define IB_PMA_SEL_PORT_RCV_DATA                cpu_to_be16(0x2000)
103#define IB_PMA_SEL_PORT_XMIT_PACKETS            cpu_to_be16(0x4000)
104#define IB_PMA_SEL_PORT_RCV_PACKETS             cpu_to_be16(0x8000)
105
106struct ib_pma_portcounters_ext {
107	u8 reserved;
108	u8 port_select;
109	__be16 counter_select;
110	__be32 reserved1;
111	__be64 port_xmit_data;
112	__be64 port_rcv_data;
113	__be64 port_xmit_packets;
114	__be64 port_rcv_packets;
115	__be64 port_unicast_xmit_packets;
116	__be64 port_unicast_rcv_packets;
117	__be64 port_multicast_xmit_packets;
118	__be64 port_multicast_rcv_packets;
119} __packed;
120
121#define IB_PMA_SELX_PORT_XMIT_DATA              cpu_to_be16(0x0001)
122#define IB_PMA_SELX_PORT_RCV_DATA               cpu_to_be16(0x0002)
123#define IB_PMA_SELX_PORT_XMIT_PACKETS           cpu_to_be16(0x0004)
124#define IB_PMA_SELX_PORT_RCV_PACKETS            cpu_to_be16(0x0008)
125#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS       cpu_to_be16(0x0010)
126#define IB_PMA_SELX_PORT_UNI_RCV_PACKETS        cpu_to_be16(0x0020)
127#define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS     cpu_to_be16(0x0040)
128#define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS      cpu_to_be16(0x0080)
129
130#endif /* IB_PMA_H */