Commit 7040e556 authored by DanielC's avatar DanielC Committed by Greg Kroah-Hartman

staging: add Silicom Bypass driver

The Silicom Bypass Network Interface Cards (NICs) are network cards with
paired ports (2 or 4).  The pairs either act as a "wire" allowing the
network packets to pass or insert the device in between the two ports.
When paired with the on-board hardware watchdog or other failsafe, they
provide high availability for the network in the face of software
outages or maintenance.
Signed-off-by: default avatarDaniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 960cf811
......@@ -136,4 +136,6 @@ source "drivers/staging/omap-thermal/Kconfig"
source "drivers/staging/ramster/Kconfig"
source "drivers/staging/silicom/Kconfig"
endif # STAGING
......@@ -60,3 +60,4 @@ obj-$(CONFIG_WIMAX_GDM72XX) += gdm72xx/
obj-$(CONFIG_CSR_WIFI) += csr/
obj-$(CONFIG_OMAP_BANDGAP) += omap-thermal/
obj-$(CONFIG_ZCACHE2) += ramster/
obj-$(CONFIG_NET_VENDOR_SILICOM) += silicom/
#
# Silicom device configuration
#
config NET_VENDOR_SILICOM
bool "Silicom devices"
default y
depends on (SSB_POSSIBLE && HAS_DMA) || PCI
---help---
If you have a network card (Ethernet) belonging to this class,
say Y.
Note that the answer to this question does not directly affect
the kernel: saying N will just case the configurator to skip all
the questions regarding Silicom chipsets. If you say Y, you will be asked
for your specific chipset/driver in the following questions.
if NET_VENDOR_SILICOM
config SBYPASS
tristate "Silicom BypassCTL library support"
---help---
If you have a network (Ethernet) controller of this type, say Y
To compile this driver as a module, choose M here. The module
will be called bypass.
config BPCTL
tristate "Silicom BypassCTL net support"
depends on PCI
select SBYPASS
select NET_CORE
select MII
---help---
If you have a network (Ethernet) controller of this type, say Y
or M and read the Ethernet-HOWTO, available from
<http://www.tldp.org/docs.html#howto>.
To compile this driver as a module, choose M here. The module
will be called bpctl_mod.
endif # NET_VENDOR_SILICOM
#
# Makefile for the Bypass network device drivers.
#
obj-$(CONFIG_BPCTL) += bpctl_mod.o
obj-$(CONFIG_SBYPASS) += bypasslib/
bpctl_mod-objs := bp_mod.o bp_proc.o
Theory of Operation:
The Silicom Bypass Network Interface Cards (NICs) are network cards with paired ports (2 or 4).
The pairs either act as a "wire" allowing the network packets to pass or insert the device in
between the two ports. When paired with the on-board hardware watchdog or other failsafe,
they provide high availability for the network in the face of software outages or maintenance.
The software requirements are for a kernel level driver that interfaces with the bypass and watchdog,
as well as for control software. User control can be either the provided standalone executable
(/bin/bpctl) or the API exposed by the Silicom library.
TODO:
- checkpatch.pl cleanups
- locking audit
- single module with all functionality
- userland
/******************************************************************************/
/* */
/* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2000 - 2004 Broadcom */
/* Corporation. */
/* All rights reserved. */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation, located in the file LICENSE. */
/* */
/* History: */
/* 02/25/00 Hav Khauv Initial version. */
/******************************************************************************/
#ifndef BITS_H
#define BITS_H
/******************************************************************************/
/* Bit Mask definitions */
/******************************************************************************/
#define BIT_NONE 0x00
#define BIT_0 0x01
#define BIT_1 0x02
#define BIT_2 0x04
#define BIT_3 0x08
#define BIT_4 0x10
#define BIT_5 0x20
#define BIT_6 0x40
#define BIT_7 0x80
#define BIT_8 0x0100
#define BIT_9 0x0200
#define BIT_10 0x0400
#define BIT_11 0x0800
#define BIT_12 0x1000
#define BIT_13 0x2000
#define BIT_14 0x4000
#define BIT_15 0x8000
#define BIT_16 0x010000
#define BIT_17 0x020000
#define BIT_18 0x040000
#define BIT_19 0x080000
#define BIT_20 0x100000
#define BIT_21 0x200000
#define BIT_22 0x400000
#define BIT_23 0x800000
#define BIT_24 0x01000000
#define BIT_25 0x02000000
#define BIT_26 0x04000000
#define BIT_27 0x08000000
#define BIT_28 0x10000000
#define BIT_29 0x20000000
#define BIT_30 0x40000000
#define BIT_31 0x80000000
#endif /* BITS_H */
/******************************************************************************/
/* */
/* Silicom Bypass Control Utility, Copyright (c) 2005-2007 Silicom */
/* All rights reserved. */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation, located in the file LICENSE. */
/* */
/* */
/******************************************************************************/
#ifndef BP_IOCTL_H
#define BP_IOCTL_H
#define BP_CAP 0x01 //BIT_0
#define BP_STATUS_CAP 0x02 //BIT_1
#define BP_STATUS_CHANGE_CAP 0x04 //BIT_2
#define SW_CTL_CAP 0x08 //BIT_3
#define BP_DIS_CAP 0x10 //BIT_4
#define BP_DIS_STATUS_CAP 0x20 //BIT_5
#define STD_NIC_CAP 0x40 //BIT_6
#define BP_PWOFF_ON_CAP 0x80 //BIT_7
#define BP_PWOFF_OFF_CAP 0x0100 //BIT_8
#define BP_PWOFF_CTL_CAP 0x0200 //BIT_9
#define BP_PWUP_ON_CAP 0x0400 //BIT_10
#define BP_PWUP_OFF_CAP 0x0800 //BIT_11
#define BP_PWUP_CTL_CAP 0x1000 //BIT_12
#define WD_CTL_CAP 0x2000 //BIT_13
#define WD_STATUS_CAP 0x4000 //BIT_14
#define WD_TIMEOUT_CAP 0x8000 //BIT_15
#define TX_CTL_CAP 0x10000 //BIT_16
#define TX_STATUS_CAP 0x20000 //BIT_17
#define TAP_CAP 0x40000 //BIT_18
#define TAP_STATUS_CAP 0x80000 //BIT_19
#define TAP_STATUS_CHANGE_CAP 0x100000 //BIT_20
#define TAP_DIS_CAP 0x200000 //BIT_21
#define TAP_DIS_STATUS_CAP 0x400000 //BIT_22
#define TAP_PWUP_ON_CAP 0x800000 //BIT_23
#define TAP_PWUP_OFF_CAP 0x1000000 //BIT 24
#define TAP_PWUP_CTL_CAP 0x2000000 //BIT 25
#define NIC_CAP_NEG 0x4000000 //BIT 26
#define TPL_CAP 0x8000000 //BIT 27
#define DISC_CAP 0x10000000 //BIT 28
#define DISC_DIS_CAP 0x20000000 //BIT 29
#define DISC_PWUP_CTL_CAP 0x40000000 //BIT 30
#define TPL2_CAP_EX 0x01
#define DISC_PORT_CAP_EX 0x02
#define WD_MIN_TIME_MASK(val) (val & 0xf)
#define WD_STEP_COUNT_MASK(val) ((val & 0xf) << 5)
#define WDT_STEP_TIME 0x10 //BIT_4
#define WD_MIN_TIME_GET(desc) (desc & 0xf)
#define WD_STEP_COUNT_GET(desc) (desc>>5) & 0xf
typedef enum {
IF_SCAN,
GET_DEV_NUM,
IS_BYPASS,
GET_BYPASS_SLAVE,
GET_BYPASS_CAPS,
GET_WD_SET_CAPS,
SET_BYPASS,
GET_BYPASS,
GET_BYPASS_CHANGE,
SET_BYPASS_WD,
GET_BYPASS_WD,
GET_WD_EXPIRE_TIME,
RESET_BYPASS_WD_TIMER,
SET_DIS_BYPASS,
GET_DIS_BYPASS,
SET_BYPASS_PWOFF,
GET_BYPASS_PWOFF,
SET_BYPASS_PWUP,
GET_BYPASS_PWUP,
SET_STD_NIC,
GET_STD_NIC,
SET_TX,
GET_TX,
SET_TAP,
GET_TAP,
GET_TAP_CHANGE,
SET_DIS_TAP,
GET_DIS_TAP,
SET_TAP_PWUP,
GET_TAP_PWUP,
SET_WD_EXP_MODE,
GET_WD_EXP_MODE,
SET_WD_AUTORESET,
GET_WD_AUTORESET,
SET_TPL,
GET_TPL,
SET_DISC,
GET_DISC,
GET_DISC_CHANGE,
SET_DIS_DISC,
GET_DIS_DISC,
SET_DISC_PWUP,
GET_DISC_PWUP,
GET_BYPASS_INFO = 100,
GET_BP_WAIT_AT_PWUP,
SET_BP_WAIT_AT_PWUP,
GET_BP_HW_RESET,
SET_BP_HW_RESET,
SET_DISC_PORT,
GET_DISC_PORT,
SET_DISC_PORT_PWUP,
GET_DISC_PORT_PWUP,
SET_BP_FORCE_LINK,
GET_BP_FORCE_LINK,
#ifdef BP_SELF_TEST
SET_BP_SELF_TEST = 200,
GET_BP_SELF_TEST,
#endif
} CMND_TYPE_SD;
/*
* The major device number. We can't rely on dynamic
* registration any more, because ioctls need to know
* it.
*/
#define MAGIC_NUM 'J'
/* for passing single values */
struct bpctl_cmd {
int status;
int data[8];
int in_param[8];
int out_param[8];
};
#define IOCTL_TX_MSG(cmd) _IOWR(MAGIC_NUM, cmd, struct bpctl_cmd)
#define DEVICE_NODE "/dev/bpctl0"
#define DEVICE_NAME "bpctl"
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/******************************************************************************/
/* */
/* Bypass Control utility, Copyright (c) 2005 Silicom */
/* All rights reserved. */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation, located in the file LICENSE. */
/* */
/* */
/******************************************************************************/
#ifndef BYPASS_H
#define BYPASS_H
/* Bypass related */
#define SYNC_CMD_VAL 2 /* 10b */
#define SYNC_CMD_LEN 2
#define WR_CMD_VAL 2 /* 10b */
#define WR_CMD_LEN 2
#define RD_CMD_VAL 1 /* 10b */
#define RD_CMD_LEN 2
#define ADDR_CMD_LEN 4
#define WR_DATA_LEN 8
#define RD_DATA_LEN 8
#define PIC_SIGN_REG_ADDR 0x7
#define PIC_SIGN_VALUE 0xcd
#define STATUS_REG_ADDR 0
#define WDT_EN_MASK 0x01 //BIT_0
#define CMND_EN_MASK 0x02 //BIT_1
#define DIS_BYPASS_CAP_MASK 0x04 //BIT_2 /* Bypass Cap is disable*/
#define DFLT_PWRON_MASK 0x08 //BIT_3
#define BYPASS_OFF_MASK 0x10 //BIT_4
#define BYPASS_FLAG_MASK 0x20 //BIT_5
#define STD_NIC_MASK (DIS_BYPASS_CAP_MASK | BYPASS_OFF_MASK | DFLT_PWRON_MASK)
#define WD_EXP_FLAG_MASK 0x40 //BIT_6
#define DFLT_PWROFF_MASK 0x80 //BIT_7
#define STD_NIC_PWOFF_MASK (DIS_BYPASS_CAP_MASK | BYPASS_OFF_MASK | DFLT_PWRON_MASK | DFLT_PWROFF_MASK)
#define PRODUCT_CAP_REG_ADDR 0x5
#define BYPASS_SUPPORT_MASK 0x01 //BIT_0
#define TAP_SUPPORT_MASK 0x02 //BIT_1
#define NORMAL_UNSUPPORT_MASK 0x04 /*BIT_2 */
#define DISC_SUPPORT_MASK 0x08 //BIT_3
#define TPL2_SUPPORT_MASK 0x10 //BIT_4
#define DISC_PORT_SUPPORT_MASK 0x20 //BIT_5
#define STATUS_TAP_REG_ADDR 0x6
#define WDTE_TAP_BPN_MASK 0x01 //BIT_1 /* 1 when wdt expired -> TAP, 0 - Bypass */
#define DIS_TAP_CAP_MASK 0x04 //BIT_2 /* TAP Cap is disable*/
#define DFLT_PWRON_TAP_MASK 0x08 //BIT_3
#define TAP_OFF_MASK 0x10 //BIT_4
#define TAP_FLAG_MASK 0x20 //BIT_5
#define TX_DISA_MASK 0x40
#define TX_DISB_MASK 0x80
#define STD_NIC_TAP_MASK (DIS_TAP_CAP_MASK | TAP_OFF_MASK | DFLT_PWRON_TAP_MASK)
#define STATUS_DISC_REG_ADDR 13
#define WDTE_DISC_BPN_MASK 0x01 //BIT_0 /* 1 when wdt expired -> TAP, 0 - Bypass */
#define STD_NIC_ON_MASK 0x02 //BIT_1
#define DIS_DISC_CAP_MASK 0x04 //BIT_2 /* TAP Cap is disable*/
#define DFLT_PWRON_DISC_MASK 0x08 //BIT_3
#define DISC_OFF_MASK 0x10 //BIT_4
#define DISC_FLAG_MASK 0x20 //BIT_5
#define TPL2_FLAG_MASK 0x40 //BIT_6
#define STD_NIC_DISC_MASK DIS_DISC_CAP_MASK
#define CONT_CONFIG_REG_ADDR 12
#define EN_HW_RESET_MASK 0x2 /* BIT_1 */
#define WAIT_AT_PWUP_MASK 0x1 /* BIT_0 */
#define VER_REG_ADDR 0x1
#define BP_FW_VER_A0 0xa0
#define BP_FW_VER_A1 0xa1
#define INT_VER_MASK 0xf0
#define EXT_VER_MASK 0xf
/* */
#define PXG2BPI_VER 0x0
#define PXG2TBPI_VER 0x1
#define PXE2TBPI_VER 0x2
#define PXG4BPFI_VER 0x4
#define BP_FW_EXT_VER7 0x6
#define BP_FW_EXT_VER8 0x8
#define BP_FW_EXT_VER9 0x9
#define OLD_IF_VER -1
#define CMND_REG_ADDR 10 /* 1010b */
#define WDT_REG_ADDR 4
#define TMRL_REG_ADDR 2
#define TMRH_REG_ADDR 3
/* NEW_FW */
#define WDT_INTERVAL 1 //5 //8
#define WDT_CMND_INTERVAL 200 //50
#define CMND_INTERVAL 200 //100 /* usec */
#define PULSE_TIME 100
/* OLD_FW */
#define INIT_CMND_INTERVAL 40
#define PULSE_INTERVAL 5
#define WDT_TIME_CNT 3
/* Intel Commands */
#define CMND_OFF_INT 0xf
#define PWROFF_BYPASS_ON_INT 0x5
#define BYPASS_ON_INT 0x6
#define DIS_BYPASS_CAP_INT 0x4
#define RESET_WDT_INT 0x1
/* Intel timing */
#define BYPASS_DELAY_INT 4 /* msec */
#define CMND_INTERVAL_INT 2 /* msec */
/* Silicom Commands */
#define CMND_ON 0x4
#define CMND_OFF 0x2
#define BYPASS_ON 0xa
#define BYPASS_OFF 0x8
#define PORT_LINK_EN 0xe
#define PORT_LINK_DIS 0xc
#define WDT_ON 0x10 /* 0x1f (11111) - max */
#define TIMEOUT_UNIT 100
#define TIMEOUT_MAX_STEP 15
#define WDT_TIMEOUT_MIN 100 /* msec */
#define WDT_TIMEOUT_MAX 3276800 /* msec */
#define WDT_AUTO_MIN_INT 500
#define WDT_TIMEOUT_DEF WDT_TIMEOUT_MIN
#define WDT_OFF 0x6
#define WDT_RELOAD 0x9
#define RESET_CONT 0x20
#define DIS_BYPASS_CAP 0x22
#define EN_BYPASS_CAP 0x24
#define BYPASS_STATE_PWRON 0x26
#define NORMAL_STATE_PWRON 0x28
#define BYPASS_STATE_PWROFF 0x27
#define NORMAL_STATE_PWROFF 0x29
#define TAP_ON 0xb
#define TAP_OFF 0x9
#define TAP_STATE_PWRON 0x2a
#define DIS_TAP_CAP 0x2c
#define EN_TAP_CAP 0x2e
#define STD_NIC_OFF 0x86
#define STD_NIC_ON 0x84
#define DISC_ON 0x85
#define DISC_OFF 0x8a
#define DISC_STATE_PWRON 0x87
#define DIS_DISC_CAP 0x88
#define EN_DISC_CAP 0x89
#define TPL2_ON 0x8c
#define TPL2_OFF 0x8b
#define BP_WAIT_AT_PWUP_EN 0x80
#define BP_WAIT_AT_PWUP_DIS 0x81
#define BP_HW_RESET_EN 0x82
#define BP_HW_RESET_DIS 0x83
#define TX_DISA 0x8d
#define TX_DISB 0x8e
#define TX_ENA 0xA0
#define TX_ENB 0xA1
#define TX_DISA_PWRUP 0xA2
#define TX_DISB_PWRUP 0xA3
#define TX_ENA_PWRUP 0xA4
#define TX_ENB_PWRUP 0xA5
#define BYPASS_CAP_DELAY 21 /* msec */
#define DFLT_PWRON_DELAY 10 /* msec */
#define LATCH_DELAY 13 /* msec */
#define EEPROM_WR_DELAY 8 /* msec */
#define BP_LINK_MON_DELAY 4 /* sec */
#define BP_FW_EXT_VER0 0xa0
#define BP_FW_EXT_VER1 0xa1
#define BP_FW_EXT_VER2 0xb1
#define BP_OK 0
#define BP_NOT_CAP -1
#define WDT_STATUS_EXP -2
#define WDT_STATUS_UNKNOWN -1
#define WDT_STATUS_EN 1
#define WDT_STATUS_DIS 0
#ifdef BP_SELF_TEST
#define ETH_P_BPTEST 0xabba
#define BPTEST_DATA_LEN 60
#endif
#endif /* BYPASS_H */
#
# Makefile for the Bypass network device drivers.
#
obj-$(CONFIG_SBYPASS) += bypass.o
/******************************************************************************/
/* */
/* bypass library, Copyright (c) 2004-2006 Silicom, Ltd */
/* Corporation. */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation, located in the file LICENSE. */
/* */
/* */
/* */
/******************************************************************************/
#ifndef BP_IOCTL_H
#define BP_IOCTL_H
#define BP_CAP 0x01 //BIT_0
#define BP_STATUS_CAP 0x02 //BIT_1
#define BP_STATUS_CHANGE_CAP 0x04 //BIT_2
#define SW_CTL_CAP 0x08 //BIT_3
#define BP_DIS_CAP 0x10 //BIT_4
#define BP_DIS_STATUS_CAP 0x20 //BIT_5
#define STD_NIC_CAP 0x40 //BIT_6
#define BP_PWOFF_ON_CAP 0x80 //BIT_7
#define BP_PWOFF_OFF_CAP 0x0100 //BIT_8
#define BP_PWOFF_CTL_CAP 0x0200 //BIT_9
#define BP_PWUP_ON_CAP 0x0400 //BIT_10
#define BP_PWUP_OFF_CAP 0x0800 //BIT_11
#define BP_PWUP_CTL_CAP 0x1000 //BIT_12
#define WD_CTL_CAP 0x2000 //BIT_13
#define WD_STATUS_CAP 0x4000 //BIT_14
#define WD_TIMEOUT_CAP 0x8000 //BIT_15
#define TX_CTL_CAP 0x10000 //BIT_16
#define TX_STATUS_CAP 0x20000 //BIT_17
#define TAP_CAP 0x40000 //BIT_18
#define TAP_STATUS_CAP 0x80000 //BIT_19
#define TAP_STATUS_CHANGE_CAP 0x100000 //BIT_20
#define TAP_DIS_CAP 0x200000 //BIT_21
#define TAP_DIS_STATUS_CAP 0x400000 //BIT_22
#define TAP_PWUP_ON_CAP 0x800000 //BIT_23
#define TAP_PWUP_OFF_CAP 0x1000000 //BIT 24
#define TAP_PWUP_CTL_CAP 0x2000000 //BIT 25
#define NIC_CAP_NEG 0x4000000 //BIT 26
#define TPL_CAP 0x8000000 //BIT 27
#define DISC_CAP 0x10000000 //BIT 28
#define DISC_DIS_CAP 0x20000000 //BIT 29
#define DISC_PWUP_CTL_CAP 0x40000000 //BIT 30
#define WD_MIN_TIME_MASK(val) (val & 0xf)
#define WD_STEP_COUNT_MASK(val) ((val & 0xf) << 5)
#define WDT_STEP_TIME 0x10 //BIT_4
#define WD_MIN_TIME_GET(desc) (desc & 0xf)
#define WD_STEP_COUNT_GET(desc) (desc>>5) & 0xf
typedef enum {
IS_BYPASS = 1,
GET_BYPASS_SLAVE,
GET_BYPASS_CAPS,
GET_WD_SET_CAPS,
SET_BYPASS,
GET_BYPASS,
GET_BYPASS_CHANGE,
SET_BYPASS_WD,
GET_BYPASS_WD,
GET_WD_EXPIRE_TIME,
RESET_BYPASS_WD_TIMER,
SET_DIS_BYPASS,
GET_DIS_BYPASS,
SET_BYPASS_PWOFF,
GET_BYPASS_PWOFF,
SET_BYPASS_PWUP,
GET_BYPASS_PWUP,
SET_STD_NIC,
GET_STD_NIC,
SET_TX,
GET_TX,
SET_TAP,
GET_TAP,
GET_TAP_CHANGE,
SET_DIS_TAP,
GET_DIS_TAP,
SET_TAP_PWUP,
GET_TAP_PWUP,
SET_WD_EXP_MODE,
GET_WD_EXP_MODE,
SET_WD_AUTORESET,
GET_WD_AUTORESET,
SET_TPL,
GET_TPL,
SET_DISC,
GET_DISC,
GET_DISC_CHANGE,
SET_DIS_DISC,
GET_DIS_DISC,
SET_DISC_PWUP,
GET_DISC_PWUP,
GET_BYPASS_INFO = 100,
GET_BP_WAIT_AT_PWUP,
SET_BP_WAIT_AT_PWUP,
GET_BP_HW_RESET,
SET_BP_HW_RESET,
} CMND_TYPE;
typedef enum {
IF_SCAN_SD,
GET_DEV_NUM_SD,
IS_BYPASS_SD,
GET_BYPASS_SLAVE_SD,
GET_BYPASS_CAPS_SD,
GET_WD_SET_CAPS_SD,
SET_BYPASS_SD,
GET_BYPASS_SD,
GET_BYPASS_CHANGE_SD,
SET_BYPASS_WD_SD,
GET_BYPASS_WD_SD,
GET_WD_EXPIRE_TIME_SD,
RESET_BYPASS_WD_TIMER_SD,
SET_DIS_BYPASS_SD,
GET_DIS_BYPASS_SD,
SET_BYPASS_PWOFF_SD,
GET_BYPASS_PWOFF_SD,
SET_BYPASS_PWUP_SD,
GET_BYPASS_PWUP_SD,
SET_STD_NIC_SD,
GET_STD_NIC_SD,
SET_TX_SD,
GET_TX_SD,
SET_TAP_SD,
GET_TAP_SD,
GET_TAP_CHANGE_SD,
SET_DIS_TAP_SD,
GET_DIS_TAP_SD,
SET_TAP_PWUP_SD,
GET_TAP_PWUP_SD,
SET_WD_EXP_MODE_SD,
GET_WD_EXP_MODE_SD,
SET_WD_AUTORESET_SD,
GET_WD_AUTORESET_SD,
SET_TPL_SD,
GET_TPL_SD,
SET_DISC_SD,
GET_DISC_SD,
GET_DISC_CHANGE_SD,
SET_DIS_DISC_SD,
GET_DIS_DISC_SD,
SET_DISC_PWUP_SD,
GET_DISC_PWUP_SD,
GET_BYPASS_INFO_SD = 100,
GET_BP_WAIT_AT_PWUP_SD,
SET_BP_WAIT_AT_PWUP_SD,
GET_BP_HW_RESET_SD,
SET_BP_HW_RESET_SD,
} CMND_TYPE_SD;
#define SIOCGIFBYPASS SIOCDEVPRIVATE+10
struct bp_info {
char prod_name[14];
unsigned char fw_ver;
};
/* for passing single values */
struct if_bypass {
char if_name[IFNAMSIZ];
int cmd;
int data;
};
struct if_bypass_info {
char if_name[IFNAMSIZ];
char cmd;
struct bp_info bp_info;
};
/*
* The major device number. We can't rely on dynamic
* registration any more, because ioctls need to know
* it.
*/
#define MAGIC_NUM 'J'
/* for passing single values */
struct bpctl_cmd {
int status;
int data[8];
int in_param[8];
int out_param[8];
};
#define IOCTL_TX_MSG(cmd) _IOWR(MAGIC_NUM, cmd, struct bpctl_cmd)
#define DEVICE_NODE "/dev/bpctl0"
#define DEVICE_NAME "bpctl"
#endif
/******************************************************************************/
/* */
/* bypass library, Copyright (c) 2004 Silicom, Ltd */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation, located in the file LICENSE. */
/* */
/* */
/* bplib.h */
/* */
/******************************************************************************/
#ifndef BYPASS_H
#define BYPASS_H
#include "bp_ioctl.h"
#include "libbp_sd.h"
#define IF_NAME "eth"
#define SILICOM_VID 0x1374
#define SILICOM_BP_PID_MIN 0x24
#define SILICOM_BP_PID_MAX 0x5f
#define INTEL_PEG4BPII_PID 0x10a0
#define INTEL_PEG4BPFII_PID 0x10a1
#define PEGII_IF_SERIES(vid, pid) \
((vid==0x8086)&& \
((pid==INTEL_PEG4BPII_PID)|| \
(pid==INTEL_PEG4BPFII_PID)))
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
#define pci_get_class pci_find_class
#define pci_get_device pci_find_device
#endif
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,10))
#define EXPORT_SYMBOL_NOVERS EXPORT_SYMBOL
#endif
#ifdef BP_VENDOR_SUPPORT
char *bp_desc_array[] =
{ "e1000bp", "e1000bpe", "slcm5700", "bnx2xbp", "ixgbp", "ixgbpe", NULL };
#endif
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment