1/*-
2 * Copyright (c) 2002-2007 Neterion, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 *    notice, this list of conditions and the following disclaimer in the
12 *    documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD$
27 */
28
29#ifndef XGE_CMN_H
30#include "xge_cmn.h"
31#endif
32
33#define XGE_QUERY_STATS       1
34#define XGE_QUERY_PCICONF     2
35#define XGE_QUERY_DEVSTATS    3
36#define XGE_QUERY_DEVCONF     4
37#define XGE_READ_VERSION      5
38#define XGE_QUERY_SWSTATS     6
39#define XGE_QUERY_DRIVERSTATS 7
40#define XGE_SET_BUFFER_MODE_1 8
41#define XGE_SET_BUFFER_MODE_2 9
42#define XGE_SET_BUFFER_MODE_5 10
43#define XGE_QUERY_BUFFER_MODE 11
44
45
46/* Function declerations */
47int xge_get_pciconf(void);
48int xge_get_devconf(void);
49int xge_get_hwstats(void);
50int xge_get_registers(void);
51int xge_get_devstats(void);
52int xge_get_swstats(void);
53int xge_get_drvstats(void);
54int xge_get_register(char *);
55int xge_set_register(char *,char *);
56int xge_get_drv_version(void);
57int xge_get_buffer_mode(void);
58int xge_change_buffer_mode(char *);
59void xge_print_hwstats(void *,unsigned short);
60void xge_print_pciconf(void *);
61void xge_print_devconf(void *);
62void xge_print_registers(void *);
63void xge_print_register(u64,u64);
64void xge_print_devstats(void *);
65void xge_print_swstats(void *);
66void xge_print_drvstats(void *);
67void xge_print_drv_version(char *);
68
69extern xge_pci_bar0_t         regInfo[];
70extern xge_pci_config_t       pciconfInfo[];
71extern xge_stats_hw_info_t    statsInfo[];
72extern xge_device_config_t    devconfInfo[];
73extern xge_stats_intr_info_t  intrInfo[];
74extern xge_stats_tcode_info_t tcodeInfo[];
75extern xge_stats_driver_info_t driverInfo[];
76
77struct ifreq   ifreqp;
78int    sockfd, indexer, buffer_size = 0;
79
80