Upstream release 5.0.0.50
This commit is contained in:
commit
fd37f9f9d6
318
Makefile
Normal file
318
Makefile
Normal file
|
@ -0,0 +1,318 @@
|
|||
|
||||
MOD_VER=5.0.50
|
||||
|
||||
MOD_VER=5.0.40.29-rb
|
||||
INSTALL_MOD_PATH=/opt/rb
|
||||
|
||||
# core driver files
|
||||
CFILES = bp_mod.c
|
||||
HFILES = bp_mod.h
|
||||
|
||||
PRDPATH_UTIL=/bin
|
||||
TARGET_UTIL=bpctl_util
|
||||
OBJS = bp_util.o
|
||||
|
||||
ifeq (,$(BUILD_KERNEL))
|
||||
BUILD_KERNEL=$(shell uname -r)
|
||||
endif
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Environment tests
|
||||
|
||||
# Kernel Search Path
|
||||
# All the places we look for kernel source
|
||||
KSP := /lib/modules/$(BUILD_KERNEL)/build \
|
||||
/lib/modules/$(BUILD_KERNEL)/source \
|
||||
/usr/src/linux-$(BUILD_KERNEL) \
|
||||
/usr/src/linux-$($(BUILD_KERNEL) | sed 's/-.*//') \
|
||||
/usr/src/kernel-headers-$(BUILD_KERNEL) \
|
||||
/usr/src/kernel-source-$(BUILD_KERNEL) \
|
||||
/usr/src/linux-$($(BUILD_KERNEL) | sed 's/\([0-9]*\.[0-9]*\)\..*/\1/') \
|
||||
/usr/src/linux
|
||||
|
||||
# prune the list down to only values that exist
|
||||
# and have an include/linux sub-directory
|
||||
test_dir = $(shell [ -e $(dir)/include/linux ] && echo $(dir))
|
||||
KSP := $(foreach dir, $(KSP), $(test_dir))
|
||||
|
||||
# we will use this first valid entry in the search path
|
||||
ifeq (,$(KSRC))
|
||||
KSRC := $(firstword $(KSP))
|
||||
endif
|
||||
|
||||
ifeq (,$(KSRC))
|
||||
$(warning *** Kernel header files not in any of the expected locations.)
|
||||
$(warning *** Install the appropriate kernel development package, e.g.)
|
||||
$(error kernel-devel, for building kernel modules and try again)
|
||||
else
|
||||
ifeq (/lib/modules/$(BUILD_KERNEL)/source, $(KSRC))
|
||||
KOBJ := /lib/modules/$(BUILD_KERNEL)/build
|
||||
else
|
||||
KOBJ := $(KSRC)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Version file Search Path
|
||||
VSP := $(KOBJ)/include/generated/utsrelease.h \
|
||||
$(KOBJ)/include/linux/utsrelease.h \
|
||||
$(KOBJ)/include/linux/version.h \
|
||||
/boot/vmlinuz.version.h
|
||||
|
||||
# Config file Search Path
|
||||
CSP := $(KOBJ)/include/generated/autoconf.h \
|
||||
$(KOBJ)/include/linux/autoconf.h \
|
||||
/boot/vmlinuz.autoconf.h
|
||||
|
||||
# prune the lists down to only files that exist
|
||||
test_file = $(shell [ -f $(file) ] && echo $(file))
|
||||
VSP := $(foreach file, $(VSP), $(test_file))
|
||||
CSP := $(foreach file, $(CSP), $(test_file))
|
||||
|
||||
# and use the first valid entry in the Search Paths
|
||||
ifeq (,$(VERSION_FILE))
|
||||
VERSION_FILE := $(firstword $(VSP))
|
||||
endif
|
||||
ifeq (,$(CONFIG_FILE))
|
||||
CONFIG_FILE := $(firstword $(CSP))
|
||||
endif
|
||||
|
||||
ifeq (,$(wildcard $(VERSION_FILE)))
|
||||
$(error Linux kernel source not configured - missing version header file)
|
||||
endif
|
||||
|
||||
ifeq (,$(wildcard $(CONFIG_FILE)))
|
||||
$(error Linux kernel source not configured - missing autoconf.h)
|
||||
endif
|
||||
|
||||
# pick a compiler
|
||||
ifneq (,$(findstring egcs-2.91.66, $(shell cat /proc/version)))
|
||||
CC := kgcc gcc cc
|
||||
else
|
||||
CC := gcc cc
|
||||
endif
|
||||
test_cc = $(shell $(cc) --version > /dev/null 2>&1 && echo $(cc))
|
||||
CC := $(foreach cc, $(CC), $(test_cc))
|
||||
CC := $(firstword $(CC))
|
||||
ifeq (,$(CC))
|
||||
$(error Compiler not found)
|
||||
endif
|
||||
|
||||
# we need to know what platform the driver is being built on
|
||||
# some additional features are only built on Intel platforms
|
||||
ARCH := $(shell uname -m | sed 's/i.86/i386/')
|
||||
ifeq ($(ARCH),alpha)
|
||||
EXTRA_CFLAGS += -ffixed-8 -mno-fp-regs
|
||||
endif
|
||||
ifeq ($(ARCH),x86_64)
|
||||
EXTRA_CFLAGS += -mcmodel=kernel -mno-red-zone
|
||||
endif
|
||||
ifeq ($(ARCH),ppc)
|
||||
EXTRA_CFLAGS += -msoft-float
|
||||
endif
|
||||
ifeq ($(ARCH),ppc64)
|
||||
EXTRA_CFLAGS += -m64 -msoft-float
|
||||
LDFLAGS += -melf64ppc
|
||||
endif
|
||||
|
||||
EXTRA_CFLAGS += -DVER_STR_SET="\"$(MOD_VER)\""
|
||||
EXTRA_CFLAGS += -DBP_READ_REG
|
||||
EXTRA_CFLAGS += -DPMC_FIX_FLAG
|
||||
EXTRA_CFLAGS += -DBP_SYNC_FLAG
|
||||
EXTRA_CFLAGS += -DBP_10G
|
||||
|
||||
|
||||
#EXTRA_CFLAGS += -DBP_SELF_TEST
|
||||
#EXTRA_CFLAGS += -DBP_LINK_FAIL_NOTIFIER
|
||||
EXTRA_CFLAGS += -DBP_PROC_SUPPORT
|
||||
#EXTRA_CFLAGS += -DBP_DBI_FLAG
|
||||
# extra flags for module builds
|
||||
EXTRA_CFLAGS += -DDRIVER_$(shell echo $(DRIVER_NAME) | tr '[a-z]' '[A-Z]')
|
||||
EXTRA_CFLAGS += -DDRIVER_NAME=$(DRIVER_NAME)
|
||||
EXTRA_CFLAGS += -DDRIVER_NAME_CAPS=$(shell echo $(DRIVER_NAME) | tr '[a-z]' '[A-Z]')
|
||||
# standard flags for module builds
|
||||
EXTRA_CFLAGS += -DLINUX -D__KERNEL__ -DMODULE -O2 -pipe -Wall
|
||||
EXTRA_CFLAGS += -I$(KSRC)/include -I.
|
||||
EXTRA_CFLAGS += $(shell [ -f $(KSRC)/include/linux/modversions.h ] && \
|
||||
echo "-DMODVERSIONS -DEXPORT_SYMTAB \
|
||||
-include $(KSRC)/include/linux/modversions.h")
|
||||
|
||||
EXTRA_CFLAGS += $(CFLAGS_EXTRA)
|
||||
|
||||
RHC := $(KSRC)/include/linux/rhconfig.h
|
||||
ifneq (,$(wildcard $(RHC)))
|
||||
# 7.3 typo in rhconfig.h
|
||||
ifneq (,$(shell $(CC) $(CFLAGS) -E -dM $(RHC) | grep __module__bigmem))
|
||||
EXTRA_CFLAGS += -D__module_bigmem
|
||||
endif
|
||||
endif
|
||||
|
||||
# get the kernel version - we use this to find the correct install path
|
||||
KVER := $(shell $(CC) $(EXTRA_CFLAGS) -E -dM $(VERSION_FILE) | grep UTS_RELEASE | \
|
||||
awk '{ print $$3 }' | sed 's/\"//g')
|
||||
|
||||
# assume source symlink is the same as build, otherwise adjust KOBJ
|
||||
ifneq (,$(wildcard /lib/modules/$(KVER)/build))
|
||||
ifneq ($(KSRC),$(shell readlink /lib/modules/$(KVER)/build))
|
||||
KOBJ=/lib/modules/$(KVER)/build
|
||||
endif
|
||||
endif
|
||||
|
||||
KVER_CODE := $(shell $(CC) $(EXTRA_CFLAGS) -E -dM $(VSP) 2>/dev/null |\
|
||||
grep -m 1 LINUX_VERSION_CODE | awk '{ print $$3 }' | sed 's/\"//g')
|
||||
|
||||
# abort the build on kernels older than 2.4.0
|
||||
ifneq (1,$(shell [ $(KVER_CODE) -ge 132096 ] && echo 1 || echo 0))
|
||||
$(error *** Aborting the build. \
|
||||
*** This driver is not supported on kernel versions older than 2.4.0)
|
||||
endif
|
||||
|
||||
|
||||
|
||||
# set the install path
|
||||
INSTDIR := /lib/modules/$(KVER)/kernel/drivers/net/$(DRIVER_NAME)
|
||||
|
||||
# look for SMP in config.h
|
||||
SMP := $(shell $(CC) $(EXTRA_CFLAGS) -E -dM $(CONFIG_FILE) | \
|
||||
grep -w CONFIG_SMP | awk '{ print $$3 }')
|
||||
ifneq ($(SMP),1)
|
||||
SMP := 0
|
||||
endif
|
||||
|
||||
ifneq ($(SMP),$(shell uname -a | grep SMP > /dev/null 2>&1 && echo 1 || echo 0))
|
||||
$(warning ***)
|
||||
ifeq ($(SMP),1)
|
||||
$(warning *** Warning: kernel source configuration (SMP))
|
||||
$(warning *** does not match running kernel (UP))
|
||||
else
|
||||
$(warning *** Warning: kernel source configuration (UP))
|
||||
$(warning *** does not match running kernel (SMP))
|
||||
endif
|
||||
$(warning *** Continuing with build,)
|
||||
$(warning *** resulting driver may not be what you want)
|
||||
$(warning ***)
|
||||
endif
|
||||
|
||||
ifeq ($(SMP),1)
|
||||
EXTRA_CFLAGS += -D__SMP__
|
||||
endif
|
||||
|
||||
###########################################################################
|
||||
# Kernel Version Specific rules
|
||||
|
||||
ifeq (1,$(shell [ $(KVER_CODE) -ge 132352 ] && echo 1 || echo 0))
|
||||
|
||||
# Makefile for 2.5.x and newer kernel
|
||||
TARGET = bpctl_mod.ko
|
||||
|
||||
# man page
|
||||
MANSECTION = 7
|
||||
MANFILE = $(TARGET:.ko=.$(MANSECTION))
|
||||
|
||||
ifneq ($(PATCHLEVEL),)
|
||||
EXTRA_CFLAGS += $(CFLAGS_EXTRA)
|
||||
obj-m += bpctl_mod.o
|
||||
bpctl_mod-objs := $(CFILES:.c=.o)
|
||||
else
|
||||
default: $(TARGET_UTIL)
|
||||
ifeq ($(KOBJ),$(KSRC))
|
||||
$(MAKE) -C $(KSRC) SUBDIRS=$(shell pwd) modules
|
||||
else
|
||||
$(MAKE) -C $(KSRC) O=$(KOBJ) SUBDIRS=$(shell pwd) modules
|
||||
endif
|
||||
endif
|
||||
|
||||
else # ifeq (1,$(shell [ $(KVER_CODE) -ge 132352 ] && echo 1 || echo 0))
|
||||
|
||||
# Makefile for 2.4.x kernel
|
||||
TARGET = bpctl_mod.o
|
||||
|
||||
# man page
|
||||
MANSECTION = 7
|
||||
MANFILE = $(TARGET:.o=.$(MANSECTION))
|
||||
|
||||
# Get rid of compile warnings in kernel header files from SuSE
|
||||
ifneq (,$(wildcard /etc/SuSE-release))
|
||||
EXTRA_CFLAGS += -Wno-sign-compare -fno-strict-aliasing
|
||||
endif
|
||||
|
||||
# Get rid of compile warnings in kernel header files from fedora
|
||||
ifneq (,$(wildcard /etc/fedora-release))
|
||||
EXTRA_CFLAGS += -fno-strict-aliasing
|
||||
endif
|
||||
CFLAGS += $(EXTRA_CFLAGS)
|
||||
|
||||
.SILENT: $(TARGET)
|
||||
$(TARGET): $(filter-out $(TARGET), $(CFILES:.c=.o))
|
||||
$(LD) $(LDFLAGS) -r $^ -o $@
|
||||
echo; echo
|
||||
echo "**************************************************"
|
||||
echo "** $(TARGET) built for $(KVER)"
|
||||
echo -n "** SMP "
|
||||
if [ "$(SMP)" = "1" ]; \
|
||||
then echo "Enabled"; else echo "Disabled"; fi
|
||||
echo "**************************************************"
|
||||
echo
|
||||
|
||||
$(CFILES:.c=.o): $(HFILES) Makefile
|
||||
default:
|
||||
$(MAKE)
|
||||
|
||||
endif # ifeq (1,$(shell [ $(KVER_CODE) -ge 132352 ] && echo 1 || echo 0))
|
||||
|
||||
|
||||
# depmod version for rpm builds
|
||||
DEPVER := $(shell /sbin/depmod -V 2>/dev/null | \
|
||||
awk 'BEGIN {FS="."} NR==1 {print $$2}')
|
||||
|
||||
###########################################################################
|
||||
# Build rules
|
||||
|
||||
install: default
|
||||
# remove all old versions of the driver
|
||||
find $(INSTALL_MOD_PATH)/lib/modules/$(KVER) -name $(TARGET) -exec rm -f {} \; || true
|
||||
find $(INSTALL_MOD_PATH)/lib/modules/$(KVER) -name $(TARGET).gz -exec rm -f {} \; || true
|
||||
install -D -m 777 $(TARGET) $(INSTALL_MOD_PATH)$(INSTDIR)/$(TARGET)
|
||||
ifeq (,$(INSTALL_MOD_PATH))
|
||||
/sbin/depmod -a || true
|
||||
else
|
||||
ifeq ($(DEPVER),1 )
|
||||
/sbin/depmod -r $(INSTALL_MOD_PATH) -a || true
|
||||
else
|
||||
/sbin/depmod -b $(INSTALL_MOD_PATH) -a -n $(KVERSION) > /dev/null || true
|
||||
endif
|
||||
endif
|
||||
mkdir -p $(INSTALL_MOD_PATH)$(PRDPATH_UTIL)
|
||||
install $(TARGET_UTIL) $(INSTALL_MOD_PATH)$(PRDPATH_UTIL)
|
||||
install bpctl_start $(INSTALL_MOD_PATH)$(PRDPATH_UTIL)
|
||||
install bpctl_stop $(INSTALL_MOD_PATH)$(PRDPATH_UTIL)
|
||||
|
||||
$(TARGET_UTIL): $(OBJS)
|
||||
$(OBJS): bp_util.c
|
||||
$(CC) $(CFLAGS) -c bp_util.c -DBP_DBI_FLAG -DPMC_FIX_FLAG -DVER_STR_SET="\"$(MOD_VER)\""
|
||||
|
||||
$(CC) $(OBJS) -o $(TARGET_UTIL)
|
||||
uninstall:
|
||||
if [ -e $(INSTDIR)/$(TARGET) ] ; then \
|
||||
rm -f $(INSTDIR)/$(TARGET) ; \
|
||||
fi
|
||||
/sbin/depmod -a
|
||||
if [ -e $(INSTALL_MOD_PATH)$(PRDPATH_UTIL)/$(TARGET_UTIL) ] ; then \
|
||||
rm -f $(INSTALL_MOD_PATH)$(PRDPATH_UTIL)/$(TARGET_UTIL) ; \
|
||||
fi
|
||||
if [ -e $(INSTALL_MOD_PATH)$(PRDPATH_UTIL)/bpctl_start ] ; then \
|
||||
rm -f $(INSTALL_MOD_PATH)$(PRDPATH_UTIL)/bpctl_start ; \
|
||||
fi
|
||||
if [ -e $(INSTALL_MOD_PATH)$(PRDPATH_UTIL)/bpctl_stop ] ; then \
|
||||
rm -f $(INSTALL_MOD_PATH)$(PRDPATH_UTIL)/bpctl_stop ; \
|
||||
fi
|
||||
.PHONY: clean install
|
||||
|
||||
clean:
|
||||
ifeq ($(KOBJ),$(KSRC))
|
||||
$(MAKE) -C $(KSRC) SUBDIRS=$(shell pwd) clean
|
||||
else
|
||||
$(MAKE) -C $(KSRC) O=$(KOBJ) SUBDIRS=$(shell pwd) clean
|
||||
endif
|
||||
rm -rf $(TARGET) $(TARGET:.ko=.o) $(TARGET:.ko=.mod.c) $(TARGET:.ko=.mod.o) $(CFILES:.c=.o) .*cmd .tmp_versions $(OBJS) $(TARGET_UTIL) Module.symvers Modules.symvers modules.order Module.markers
|
||||
|
48
bits.h
Normal file
48
bits.h
Normal file
|
@ -0,0 +1,48 @@
|
|||
|
||||
#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 */
|
||||
|
5490
bnx2x_reg.h
Normal file
5490
bnx2x_reg.h
Normal file
File diff suppressed because it is too large
Load diff
171
bp_ioctl.h
Normal file
171
bp_ioctl.h
Normal file
|
@ -0,0 +1,171 @@
|
|||
/**************************************************************************
|
||||
|
||||
Copyright (c) 2005-2013, Silicom
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. 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.
|
||||
|
||||
3. Neither the name of the Silicom nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#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
|
||||
|
||||
|
878
bp_mod.h
Normal file
878
bp_mod.h
Normal file
|
@ -0,0 +1,878 @@
|
|||
/**************************************************************************
|
||||
|
||||
Copyright (c) 2005-2013, Silicom
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. 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.
|
||||
|
||||
3. Neither the name of the Silicom nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef BP_MOD_H
|
||||
#define BP_MOD_H
|
||||
#include "bits.h"
|
||||
|
||||
#ifndef KERNEL_VERSION
|
||||
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
|
||||
#endif
|
||||
|
||||
|
||||
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) )
|
||||
#define msleep(x) do { if(in_interrupt()) { \
|
||||
/* Don't mdelay in interrupt context! */ \
|
||||
BUG(); \
|
||||
} else { \
|
||||
set_current_state(TASK_UNINTERRUPTIBLE); \
|
||||
schedule_timeout((x * HZ)/1000 + 2); \
|
||||
} } while(0)
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,10))
|
||||
#define EXPORT_SYMBOL_NOVERS EXPORT_SYMBOL
|
||||
#endif
|
||||
|
||||
|
||||
#define usec_delay(x) udelay(x)
|
||||
#ifndef msec_delay_bp
|
||||
#define msec_delay_bp(x) do { \
|
||||
int i; \
|
||||
if(1) { \
|
||||
for(i = 0; i < 1000; i++) \
|
||||
{ \
|
||||
udelay(x) ; \
|
||||
} \
|
||||
} else { \
|
||||
msleep(x); \
|
||||
} } while(0)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef jiffies_to_msecs
|
||||
#define jiffies_to_msecs(x) _kc_jiffies_to_msecs(x)
|
||||
static inline unsigned int jiffies_to_msecs(const unsigned long j)
|
||||
{
|
||||
#if HZ <= 1000 && !(1000 % HZ)
|
||||
return(1000 / HZ) * j;
|
||||
#elif HZ > 1000 && !(HZ % 1000)
|
||||
return(j + (HZ / 1000) - 1)/(HZ / 1000);
|
||||
#else
|
||||
return(j * 1000) / HZ;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
|
||||
|
||||
#define pci_get_class pci_find_class
|
||||
#define pci_get_subsys pci_find_subsys
|
||||
#define pci_get_device pci_find_device
|
||||
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,4))
|
||||
#define MODULE_VERSION(_version)
|
||||
#endif
|
||||
|
||||
|
||||
#define SILICOM_VID 0x1374
|
||||
#define SILICOM_SVID 0x1374
|
||||
|
||||
#define SILICOM_PXG2BPFI_SSID 0x0026
|
||||
#define SILICOM_PXG2BPFILX_SSID 0x0027
|
||||
#define SILICOM_PXGBPI_SSID 0x0028
|
||||
#define SILICOM_PXGBPIG_SSID 0x0029
|
||||
#define SILICOM_PXG2TBFI_SSID 0x002a
|
||||
#define SILICOM_PXG4BPI_SSID 0x002c
|
||||
#define SILICOM_PXG4BPFI_SSID 0x002d
|
||||
#define SILICOM_PXG4BPFILX_SSID 0x002e
|
||||
#define SILICOM_PXG2BPFIL_SSID 0x002F
|
||||
#define SILICOM_PXG2BPFILLX_SSID 0x0030
|
||||
#define SILICOM_PEG4BPI_SSID 0x0031
|
||||
#define SILICOM_PEG2BPI_SSID 0x0037
|
||||
#define SILICOM_PEG4BPIN_SSID 0x0038
|
||||
#define SILICOM_PEG2BPFI_SSID 0x0039
|
||||
#define SILICOM_PEG2BPFILX_SSID 0x003A
|
||||
#define SILICOM_PMCXG2BPFI_SSID 0x003B
|
||||
#define NOKIA_PMCXG2BPFIN_SSID 0x0510
|
||||
#define NOKIA_PMCXG2BPIN_SSID 0x0513
|
||||
#define NOKIA_PMCXG4BPIN_SSID 0x0514
|
||||
#define NOKIA_PMCXG2BPFIN_SVID 0x13B8
|
||||
#define NOKIA_PMCXG2BPIN2_SSID 0x0515
|
||||
#define NOKIA_PMCXG4BPIN2_SSID 0x0516
|
||||
#define SILICOM_PMCX2BPI_SSID 0x041
|
||||
#define SILICOM_PMCX4BPI_SSID 0x042
|
||||
#define SILICOM_PXG2BISC1_SSID 0x003d
|
||||
#define SILICOM_PEG2TBFI_SSID 0x003E
|
||||
#define SILICOM_PXG2TBI_SSID 0x003f
|
||||
#define SILICOM_PXG4BPFID_SSID 0x0043
|
||||
#define SILICOM_PEG4BPFI_SSID 0x0040
|
||||
#define SILICOM_PEG4BPIPT_SSID 0x0044
|
||||
#define SILICOM_PXG6BPI_SSID 0x0045
|
||||
#define SILICOM_PEG4BPIL_SSID 0x0046
|
||||
#define SILICOM_PEG2BPI5_SSID 0x0052
|
||||
#define SILICOM_PEG6BPI_SSID 0x0053
|
||||
#define SILICOM_PEG4BPFI5_SSID 0x0050
|
||||
#define SILICOM_PEG4BPFI5LX_SSID 0x0051
|
||||
#define SILICOM_PEG2BISC6_SSID 0x54
|
||||
|
||||
#define SILICOM_PEG6BPIFC_SSID 0x55
|
||||
|
||||
|
||||
|
||||
#define SILICOM_PEG2BPFI5_SSID 0x0056
|
||||
#define SILICOM_PEG2BPFI5LX_SSID 0x0057
|
||||
|
||||
|
||||
#define SILICOM_PXEG4BPFI_SSID 0x0058
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define SILICOM_PEG2BPFID_SSID 0x0047
|
||||
#define SILICOM_PEG2BPFIDLX_SSID 0x004C
|
||||
#define SILICOM_MEG2BPFILN_SSID 0x0048
|
||||
#define SILICOM_MEG2BPFINX_SSID 0x0049
|
||||
#define SILICOM_PEG4BPFILX_SSID 0x004A
|
||||
#define SILICOM_MHIO8AD_SSID 0x004F
|
||||
|
||||
#define SILICOM_MEG2BPFILXLN_SSID 0x004b
|
||||
#define SILICOM_PEG2BPIX1_SSID 0x004d
|
||||
#define SILICOM_MEG2BPFILXNX_SSID 0x004e
|
||||
|
||||
|
||||
#define SILICOM_PE10G2BPISR_SSID 0x0102
|
||||
#define SILICOM_PE10G2BPILR_SSID 0x0103
|
||||
#define SILICOM_PE10G2BPICX4_SSID 0x0101
|
||||
|
||||
#define SILICOM_XE10G2BPILR_SSID 0x0163
|
||||
#define SILICOM_XE10G2BPISR_SSID 0x0162
|
||||
#define SILICOM_XE10G2BPICX4_SSID 0x0161
|
||||
#define SILICOM_XE10G2BPIT_SSID 0x0160
|
||||
|
||||
#define SILICOM_PE10GDBISR_SSID 0x0181
|
||||
#define SILICOM_PE10GDBILR_SSID 0x0182
|
||||
|
||||
|
||||
|
||||
|
||||
#define SILICOM_PE210G2DBi9SR_SSID 0x0188
|
||||
#define SILICOM_PE210G2DBi9SRRB_SSID 0x0188
|
||||
#define SILICOM_PE210G2DBi9LR_SSID 0x0189
|
||||
#define SILICOM_PE210G2DBi9LRRB_SSID 0x0189
|
||||
#define SILICOM_PE310G4DBi940SR_SSID 0x018C
|
||||
|
||||
#define SILICOM_PE310G4DBi9T_SSID 0x18e
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define SILICOM_PE310G4BPi9T_SSID 0x130
|
||||
#define SILICOM_PE310G4BPi9SR_SSID 0x132
|
||||
#define SILICOM_PE310G4BPi9LR_SSID 0x133
|
||||
|
||||
|
||||
#define SILICOM_M6E310G4BPi9SR_SSID 0x0492
|
||||
#define SILICOM_M6E310G4BPi9LR_SSID 0x0493
|
||||
|
||||
|
||||
|
||||
|
||||
#define NOKIA_XE10G2BPIXR_SVID 0x13B8
|
||||
#define NOKIA_XE10G2BPIXR_SSID 0x051C
|
||||
|
||||
|
||||
#define INTEL_PEG4BPII_PID 0x10A0
|
||||
#define INTEL_PEG4BPFII_PID 0x10A1
|
||||
#define INTEL_PEG4BPII_SSID 0x11A0
|
||||
#define INTEL_PEG4BPFII_SSID 0x11A1
|
||||
|
||||
#define INTEL_PEG4BPIIO_SSID 0x10A0
|
||||
#define INTEL_PEG4BPIIO_PID 0x105e
|
||||
|
||||
|
||||
#define BROADCOM_VID 0x14e4
|
||||
#define BROADCOM_PE10G2_PID 0x164e
|
||||
|
||||
#define SILICOM_PE10G2BPTCX4_SSID 0x0141
|
||||
#define SILICOM_PE10G2BPTSR_SSID 0x0142
|
||||
#define SILICOM_PE10G2BPTLR_SSID 0x0143
|
||||
#define SILICOM_PE10G2BPTT_SSID 0x0140
|
||||
|
||||
|
||||
#define SILICOM_PEG4BPI6_SSID 0x0320
|
||||
#define SILICOM_PEG4BPFI6_SSID 0x0321
|
||||
#define SILICOM_PEG4BPFI6LX_SSID 0x0322
|
||||
#define SILICOM_PEG4BPFI6ZX_SSID 0x0323
|
||||
|
||||
|
||||
#define SILICOM_PEG2BPI6_SSID 0x0300
|
||||
#define SILICOM_PEG2BPFI6_SSID 0x0301
|
||||
#define SILICOM_PEG2BPFI6LX_SSID 0x0302
|
||||
#define SILICOM_PEG2BPFI6ZX_SSID 0x0303
|
||||
#define SILICOM_PEG2BPFI6FLXM_SSID 0x0304
|
||||
|
||||
#define SILICOM_PEG2DBI6_SSID 0x0308
|
||||
#define SILICOM_PEG2DBFI6_SSID 0x0309
|
||||
#define SILICOM_PEG2DBFI6LX_SSID 0x030A
|
||||
#define SILICOM_PEG2DBFI6ZX_SSID 0x030B
|
||||
|
||||
|
||||
#define SILICOM_MEG2BPI6_SSID 0x0310
|
||||
#define SILICOM_XEG2BPI6_SSID 0x0318
|
||||
#define SILICOM_PEG4BPI6FC_SSID 0x0328
|
||||
#define SILICOM_PEG4BPFI6FC_SSID 0x0329
|
||||
#define SILICOM_PEG4BPFI6FCLX_SSID 0x032A
|
||||
#define SILICOM_PEG4BPFI6FCZX_SSID 0x032B
|
||||
|
||||
#define SILICOM_PEG6BPI6_SSID 0x0340
|
||||
#define SILICOM_PE2G6BPI6_SSID 0x0341
|
||||
|
||||
#define SILICOM_PEG2BPI6SC6_SSID 0x0360
|
||||
|
||||
#define SILICOM_MEG2BPI6_SSID 0x0310
|
||||
#define SILICOM_XEG2BPI6_SSID 0x0318
|
||||
#define SILICOM_MEG4BPI6_SSID 0x0330
|
||||
|
||||
|
||||
#define SILICOM_PE2G4BPi80L_SSID 0x0380
|
||||
|
||||
#define SILICOM_M6E2G8BPi80A_SSID 0x0474
|
||||
|
||||
#define SILICOM_PE2G4BPi35_SSID 0x03d8
|
||||
|
||||
#define SILICOM_PE2G4BPFi80_SSID 0x0381
|
||||
#define SILICOM_PE2G4BPFi80LX_SSID 0x0382
|
||||
#define SILICOM_PE2G4BPFi80ZX_SSID 0x0383
|
||||
|
||||
#define SILICOM_PE2G4BPi80_SSID 0x0388
|
||||
|
||||
#define SILICOM_PE2G2BPi80_SSID 0x0390
|
||||
#define SILICOM_PE2G2BPFi80_SSID 0x0391
|
||||
#define SILICOM_PE2G2BPFi80LX_SSID 0x0392
|
||||
#define SILICOM_PE2G2BPFi80ZX_SSID 0x0393
|
||||
|
||||
#define SILICOM_PE2G4BPi35L_SSID 0x03D0
|
||||
#define SILICOM_PE2G4BPFi35_SSID 0x03D1
|
||||
#define SILICOM_PE2G4BPFi35LX_SSID 0x03D2
|
||||
#define SILICOM_PE2G4BPFi35ZX_SSID 0x03D3
|
||||
|
||||
#define SILICOM_M1E2G4BPi35_SSID 0x04D0
|
||||
#define SILICOM_M1E2G4BPFi35_SSID 0x04D1
|
||||
#define SILICOM_M1E2G4BPFi35LX_SSID 0x04D2
|
||||
#define SILICOM_M1E2G4BPFi35ZX_SSID 0x04D3
|
||||
|
||||
#define SILICOM_M1E2G4BPi35JP_SSID 0x1800
|
||||
#define SILICOM_M1E2G4BPi35JP1_SSID 0x1801
|
||||
|
||||
|
||||
|
||||
#define SILICOM_PE2G2BPi35_SSID 0x03c0
|
||||
#define SILICOM_PAC1200BPi35_SSID 0x03cc
|
||||
#define SILICOM_PE2G2BPFi35_SSID 0x03C1
|
||||
#define SILICOM_PE2G2BPFi35LX_SSID 0x03C2
|
||||
#define SILICOM_PE2G2BPFi35ZX_SSID 0x03C3
|
||||
|
||||
|
||||
|
||||
#define SILICOM_PE2G6BPi35_SSID 0x03E0
|
||||
#define SILICOM_PE2G6BPi35CX_SSID 0x0AA0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define INTEL_PE210G2SPI9_SSID 0x00C
|
||||
|
||||
#define SILICOM_M1EG2BPI6_SSID 0x400
|
||||
|
||||
#define SILICOM_M1EG2BPFI6_SSID 0x0401
|
||||
#define SILICOM_M1EG2BPFI6LX_SSID 0x0402
|
||||
#define SILICOM_M1EG2BPFI6ZX_SSID 0x0403
|
||||
|
||||
#define SILICOM_M1EG4BPI6_SSID 0x0420
|
||||
|
||||
#define SILICOM_M1EG4BPFI6_SSID 0x0421
|
||||
#define SILICOM_M1EG4BPFI6LX_SSID 0x0422
|
||||
#define SILICOM_M1EG4BPFI6ZX_SSID 0x0423
|
||||
|
||||
#define SILICOM_M1EG6BPI6_SSID 0x0440
|
||||
|
||||
#define SILICOM_M1E2G4BPi80_SSID 0x0460
|
||||
#define SILICOM_M1E2G4BPFi80_SSID 0x0461
|
||||
#define SILICOM_M1E2G4BPFi80LX_SSID 0x0462
|
||||
#define SILICOM_M1E2G4BPFi80ZX_SSID 0x0463
|
||||
|
||||
#define SILICOM_M6E2G8BPi80_SSID 0x0470
|
||||
#define SILICOM_PE210G2BPi40_SSID 0x01a0
|
||||
#define SILICOM_M1E210G2BPI40T_SSID 0x0480
|
||||
|
||||
#define PEG540_IF_SERIES(pid) \
|
||||
((pid==SILICOM_PE210G2BPi40_SSID) || \
|
||||
(pid==SILICOM_M1E210G2BPI40T_SSID))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define OLD_IF_SERIES(pid) \
|
||||
((pid==SILICOM_PXG2BPFI_SSID)|| \
|
||||
(pid==SILICOM_PXG2BPFILX_SSID))
|
||||
|
||||
#define P2BPFI_IF_SERIES(pid) \
|
||||
((pid==SILICOM_PXG2BPFI_SSID)|| \
|
||||
(pid==SILICOM_PXG2BPFILX_SSID)|| \
|
||||
(pid==SILICOM_PEG2BPFI_SSID)|| \
|
||||
(pid==SILICOM_PEG2BPFID_SSID)|| \
|
||||
(pid==SILICOM_PEG2BPFIDLX_SSID)|| \
|
||||
(pid==SILICOM_MEG2BPFILN_SSID)|| \
|
||||
(pid==SILICOM_MEG2BPFINX_SSID)|| \
|
||||
(pid==SILICOM_PEG4BPFILX_SSID)|| \
|
||||
(pid==SILICOM_PEG4BPFI_SSID)|| \
|
||||
(pid==SILICOM_PXEG4BPFI_SSID)|| \
|
||||
(pid==SILICOM_PXG4BPFID_SSID)|| \
|
||||
(pid==SILICOM_PEG2TBFI_SSID)|| \
|
||||
(pid==SILICOM_PE10G2BPISR_SSID)|| \
|
||||
(pid==SILICOM_PE10G2BPILR_SSID)|| \
|
||||
(pid==SILICOM_PEG2BPFILX_SSID)|| \
|
||||
(pid==SILICOM_PMCXG2BPFI_SSID) || \
|
||||
(pid==SILICOM_MHIO8AD_SSID) || \
|
||||
(pid==SILICOM_PEG4BPFI5LX_SSID) || \
|
||||
(pid==SILICOM_PEG4BPFI5_SSID) || \
|
||||
(pid==SILICOM_PEG4BPFI6FC_SSID) || \
|
||||
(pid==SILICOM_PEG4BPFI6FCLX_SSID) || \
|
||||
(pid==SILICOM_PEG4BPFI6FCZX_SSID) || \
|
||||
(pid==NOKIA_PMCXG2BPFIN_SSID)|| \
|
||||
(pid==SILICOM_MEG2BPFILXLN_SSID)|| \
|
||||
(pid==SILICOM_MEG2BPFILXNX_SSID)|| \
|
||||
(pid==SILICOM_XE10G2BPIT_SSID)|| \
|
||||
(pid==SILICOM_XE10G2BPICX4_SSID)|| \
|
||||
(pid==SILICOM_XE10G2BPISR_SSID)|| \
|
||||
(pid==NOKIA_XE10G2BPIXR_SSID)|| \
|
||||
(pid==SILICOM_PE10GDBISR_SSID)|| \
|
||||
(pid==SILICOM_PE10GDBILR_SSID)|| \
|
||||
(pid==SILICOM_XE10G2BPILR_SSID))
|
||||
|
||||
|
||||
#define INTEL_IF_SERIES(pid) \
|
||||
((pid==INTEL_PEG4BPII_SSID)|| \
|
||||
(pid==INTEL_PEG4BPIIO_SSID)|| \
|
||||
(pid==INTEL_PEG4BPFII_SSID))
|
||||
|
||||
#define NOKIA_SERIES(pid) \
|
||||
((pid==NOKIA_PMCXG2BPIN_SSID)|| \
|
||||
(pid==NOKIA_PMCXG4BPIN_SSID)|| \
|
||||
(pid==SILICOM_PMCX4BPI_SSID)|| \
|
||||
(pid==NOKIA_PMCXG2BPFIN_SSID)|| \
|
||||
(pid==SILICOM_PMCXG2BPFI_SSID)|| \
|
||||
(pid==NOKIA_PMCXG2BPIN2_SSID)|| \
|
||||
(pid==NOKIA_PMCXG4BPIN2_SSID)|| \
|
||||
(pid==SILICOM_PMCX2BPI_SSID))
|
||||
|
||||
#define DISCF_IF_SERIES(pid) \
|
||||
(pid==SILICOM_PEG2TBFI_SSID)
|
||||
|
||||
#define PEGF_IF_SERIES(pid) \
|
||||
((pid==SILICOM_PEG2BPFI_SSID)|| \
|
||||
(pid==SILICOM_PEG2BPFID_SSID)|| \
|
||||
(pid==SILICOM_PEG2BPFIDLX_SSID)|| \
|
||||
(pid==SILICOM_PEG2BPFILX_SSID)|| \
|
||||
(pid==SILICOM_PEG4BPFI_SSID)|| \
|
||||
(pid==SILICOM_PXEG4BPFI_SSID)|| \
|
||||
(pid==SILICOM_MEG2BPFILN_SSID)|| \
|
||||
(pid==SILICOM_MEG2BPFINX_SSID)|| \
|
||||
(pid==SILICOM_PEG4BPFILX_SSID)|| \
|
||||
(pid==SILICOM_PEG2TBFI_SSID)|| \
|
||||
(pid==SILICOM_MEG2BPFILXLN_SSID)|| \
|
||||
(pid==SILICOM_MEG2BPFILXNX_SSID))
|
||||
|
||||
|
||||
#define TPL_IF_SERIES(pid) \
|
||||
((pid==SILICOM_PXG2BPFIL_SSID)|| \
|
||||
(pid==SILICOM_PXG2BPFILLX_SSID)|| \
|
||||
(pid==SILICOM_PXG2TBFI_SSID)|| \
|
||||
(pid==SILICOM_PXG4BPFID_SSID)|| \
|
||||
(pid==SILICOM_PXG4BPFI_SSID))
|
||||
|
||||
|
||||
#define BP10G_IF_SERIES(pid) \
|
||||
((pid==SILICOM_PE10G2BPISR_SSID)|| \
|
||||
(pid==SILICOM_PE10G2BPICX4_SSID)|| \
|
||||
(pid==SILICOM_PE10G2BPILR_SSID)|| \
|
||||
(pid==SILICOM_XE10G2BPIT_SSID)|| \
|
||||
(pid==SILICOM_XE10G2BPICX4_SSID)|| \
|
||||
(pid==SILICOM_XE10G2BPISR_SSID)|| \
|
||||
(pid==NOKIA_XE10G2BPIXR_SSID)|| \
|
||||
(pid==SILICOM_PE10GDBISR_SSID)|| \
|
||||
(pid==SILICOM_PE10GDBILR_SSID)|| \
|
||||
(pid==SILICOM_XE10G2BPILR_SSID))
|
||||
|
||||
#define BP10GB_IF_SERIES(pid) \
|
||||
((pid==SILICOM_PE10G2BPTCX4_SSID)|| \
|
||||
(pid==SILICOM_PE10G2BPTSR_SSID)|| \
|
||||
(pid==SILICOM_PE10G2BPTLR_SSID)|| \
|
||||
(pid==SILICOM_PE10G2BPTT_SSID))
|
||||
|
||||
|
||||
|
||||
#define BP10G_CX4_SERIES(pid) \
|
||||
(pid==SILICOM_PE10G2BPICX4_SSID)
|
||||
|
||||
#define BP10GB_CX4_SERIES(pid) \
|
||||
(pid==SILICOM_PE10G2BPTCX4_SSID)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define SILICOM_M2EG2BPFI6_SSID 0x0501
|
||||
#define SILICOM_M2EG2BPFI6LX_SSID 0x0502
|
||||
#define SILICOM_M2EG2BPFI6ZX_SSID 0x0503
|
||||
#define SILICOM_M2EG4BPI6_SSID 0x0520
|
||||
|
||||
#define SILICOM_M2EG4BPFI6_SSID 0x0521
|
||||
#define SILICOM_M2EG4BPFI6LX_SSID 0x0522
|
||||
#define SILICOM_M2EG4BPFI6ZX_SSID 0x0523
|
||||
|
||||
#define SILICOM_M2EG6BPI6_SSID 0x0540
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define SILICOM_M1E10G2BPI9CX4_SSID 0x481
|
||||
#define SILICOM_M1E10G2BPI9SR_SSID 0x482
|
||||
#define SILICOM_M1E10G2BPI9LR_SSID 0x483
|
||||
//#define SILICOM_M1E10G2BPI9T_SSID 0x480
|
||||
|
||||
#define SILICOM_M2E10G2BPI9CX4_SSID 0x581
|
||||
#define SILICOM_M2E10G2BPI9SR_SSID 0x582
|
||||
#define SILICOM_M2E10G2BPI9LR_SSID 0x583
|
||||
#define SILICOM_M2E10G2BPI9T_SSID 0x580
|
||||
|
||||
|
||||
#define SILICOM_PE210G2BPI9CX4_SSID 0x121
|
||||
#define SILICOM_PE210G2BPI9SR_SSID 0x122
|
||||
#define SILICOM_PE210G2BPI9LR_SSID 0x123
|
||||
#define SILICOM_PE210G2BPI9T_SSID 0x120
|
||||
|
||||
#define DBI_IF_SERIES(pid) \
|
||||
((pid==SILICOM_PE10GDBISR_SSID)|| \
|
||||
(pid==SILICOM_PE10GDBILR_SSID)|| \
|
||||
(pid==SILICOM_XE10G2BPILR_SSID)|| \
|
||||
(pid==SILICOM_PE210G2DBi9LR_SSID))
|
||||
|
||||
|
||||
#define PEGF5_IF_SERIES(pid) \
|
||||
((pid==SILICOM_PEG2BPFI5_SSID)|| \
|
||||
(pid==SILICOM_PEG2BPFI5LX_SSID)|| \
|
||||
(pid==SILICOM_PEG4BPFI6_SSID)|| \
|
||||
(pid==SILICOM_PE2G6BPI6_SSID)|| \
|
||||
(pid==SILICOM_PEG4BPFI6LX_SSID)|| \
|
||||
(pid==SILICOM_PEG4BPFI6ZX_SSID)|| \
|
||||
(pid==SILICOM_PEG2BPFI6_SSID)|| \
|
||||
(pid==SILICOM_PEG2BPFI6LX_SSID)|| \
|
||||
(pid==SILICOM_PEG2BPFI6ZX_SSID)|| \
|
||||
(pid==SILICOM_PEG2BPFI6FLXM_SSID)|| \
|
||||
(pid==SILICOM_PEG2DBFI6_SSID)|| \
|
||||
(pid==SILICOM_PEG2DBFI6LX_SSID)|| \
|
||||
(pid==SILICOM_PEG2DBFI6ZX_SSID)|| \
|
||||
(pid==SILICOM_PEG4BPI6FC_SSID)|| \
|
||||
(pid==SILICOM_PEG4BPFI6FCLX_SSID)|| \
|
||||
(pid==SILICOM_PEG4BPI6FC_SSID)|| \
|
||||
(pid==SILICOM_M1EG2BPFI6_SSID)|| \
|
||||
(pid==SILICOM_M1EG2BPFI6LX_SSID)|| \
|
||||
(pid==SILICOM_M1EG2BPFI6ZX_SSID)|| \
|
||||
(pid==SILICOM_M1EG4BPFI6_SSID)|| \
|
||||
(pid==SILICOM_M1EG4BPFI6LX_SSID)|| \
|
||||
(pid==SILICOM_M1EG4BPFI6ZX_SSID)|| \
|
||||
(pid==SILICOM_M2EG2BPFI6_SSID)|| \
|
||||
(pid==SILICOM_M2EG2BPFI6LX_SSID)|| \
|
||||
(pid==SILICOM_M2EG2BPFI6ZX_SSID)|| \
|
||||
(pid==SILICOM_M2EG4BPFI6_SSID)|| \
|
||||
(pid==SILICOM_M2EG4BPFI6LX_SSID)|| \
|
||||
(pid==SILICOM_M2EG4BPFI6ZX_SSID)|| \
|
||||
(pid==SILICOM_PEG4BPFI6FCZX_SSID))
|
||||
|
||||
|
||||
|
||||
|
||||
#define PEG5_IF_SERIES(pid) \
|
||||
((pid==SILICOM_PEG4BPI6_SSID)|| \
|
||||
(pid==SILICOM_PEG2BPI6_SSID)|| \
|
||||
(pid==SILICOM_PEG2BPI6SC6_SSID)|| \
|
||||
(pid==SILICOM_PEG4BPI6FC_SSID)|| \
|
||||
(pid==SILICOM_PEG6BPI6_SSID)|| \
|
||||
(pid==SILICOM_MEG2BPI6_SSID)|| \
|
||||
(pid==SILICOM_XEG2BPI6_SSID)|| \
|
||||
(pid==SILICOM_MEG4BPI6_SSID)|| \
|
||||
(pid==SILICOM_M1EG2BPI6_SSID)|| \
|
||||
(pid==SILICOM_M1EG4BPI6_SSID)|| \
|
||||
(pid==SILICOM_M1EG6BPI6_SSID)|| \
|
||||
(pid==SILICOM_PEG6BPI_SSID)|| \
|
||||
(pid==SILICOM_PEG4BPIL_SSID)|| \
|
||||
(pid==SILICOM_PEG2BISC6_SSID)|| \
|
||||
(pid==SILICOM_PEG2BPI5_SSID))
|
||||
|
||||
|
||||
#define PEG80_IF_SERIES(pid) \
|
||||
((pid==SILICOM_M1E2G4BPi80_SSID)|| \
|
||||
(pid==SILICOM_M6E2G8BPi80_SSID)|| \
|
||||
(pid==SILICOM_PE2G4BPi80L_SSID)|| \
|
||||
(pid==SILICOM_M6E2G8BPi80A_SSID)|| \
|
||||
(pid==SILICOM_PE2G2BPi35_SSID)|| \
|
||||
(pid==SILICOM_PAC1200BPi35_SSID)|| \
|
||||
(pid==SILICOM_PE2G4BPi35_SSID)|| \
|
||||
(pid==SILICOM_PE2G4BPi35L_SSID)|| \
|
||||
(pid==SILICOM_M1E2G4BPi35_SSID)|| \
|
||||
(pid==SILICOM_M1E2G4BPi35JP_SSID)|| \
|
||||
(pid==SILICOM_M1E2G4BPi35JP1_SSID)|| \
|
||||
(pid==SILICOM_PE2G6BPi35_SSID)|| \
|
||||
(pid==SILICOM_PE2G2BPi80_SSID)|| \
|
||||
(pid==SILICOM_PE2G4BPi80_SSID)|| \
|
||||
(pid==SILICOM_PE2G4BPFi80_SSID)|| \
|
||||
(pid==SILICOM_PE2G4BPFi80LX_SSID)|| \
|
||||
(pid==SILICOM_PE2G4BPFi80ZX_SSID)|| \
|
||||
(pid==SILICOM_PE2G4BPFi80ZX_SSID)|| \
|
||||
(pid==SILICOM_PE2G2BPFi80_SSID)|| \
|
||||
(pid==SILICOM_PE2G2BPFi80LX_SSID)|| \
|
||||
(pid==SILICOM_PE2G2BPFi80ZX_SSID)|| \
|
||||
(pid==SILICOM_PE2G2BPFi35_SSID)|| \
|
||||
(pid==SILICOM_PE2G2BPFi35LX_SSID)|| \
|
||||
(pid==SILICOM_PE2G2BPFi35ZX_SSID)|| \
|
||||
(pid==SILICOM_M1E2G4BPFi35_SSID)|| \
|
||||
(pid==SILICOM_M1E2G4BPFi35LX_SSID)|| \
|
||||
(pid==SILICOM_M1E2G4BPFi35ZX_SSID)|| \
|
||||
(pid==SILICOM_PE2G4BPFi35_SSID)|| \
|
||||
(pid==SILICOM_PE2G4BPFi35LX_SSID)|| \
|
||||
(pid==SILICOM_PE2G4BPFi35ZX_SSID))
|
||||
|
||||
|
||||
#define PEGF80_IF_SERIES(pid) \
|
||||
((pid==SILICOM_PE2G4BPFi80_SSID)|| \
|
||||
(pid==SILICOM_PE2G4BPFi80LX_SSID)|| \
|
||||
(pid==SILICOM_PE2G4BPFi80ZX_SSID)|| \
|
||||
(pid==SILICOM_PE2G4BPFi80ZX_SSID)|| \
|
||||
(pid==SILICOM_M1E2G4BPFi80_SSID)|| \
|
||||
(pid==SILICOM_M1E2G4BPFi80LX_SSID)|| \
|
||||
(pid==SILICOM_M1E2G4BPFi80ZX_SSID)|| \
|
||||
(pid==SILICOM_PE2G2BPFi80_SSID)|| \
|
||||
(pid==SILICOM_PE2G2BPFi80LX_SSID)|| \
|
||||
(pid==SILICOM_PE2G2BPFi80ZX_SSID)|| \
|
||||
(pid==SILICOM_PE2G2BPFi35_SSID)|| \
|
||||
(pid==SILICOM_PE2G2BPFi35LX_SSID)|| \
|
||||
(pid==SILICOM_PE2G2BPFi35ZX_SSID)|| \
|
||||
(pid==SILICOM_M1E2G4BPFi35_SSID)|| \
|
||||
(pid==SILICOM_M1E2G4BPFi35LX_SSID)|| \
|
||||
(pid==SILICOM_M1E2G4BPFi35ZX_SSID)|| \
|
||||
(pid==SILICOM_PE2G4BPFi35_SSID)|| \
|
||||
(pid==SILICOM_PE2G4BPFi35LX_SSID)|| \
|
||||
(pid==SILICOM_PE2G4BPFi35ZX_SSID))
|
||||
|
||||
|
||||
#define BP10G9_IF_SERIES(pid) \
|
||||
((pid==INTEL_PE210G2SPI9_SSID)|| \
|
||||
(pid==SILICOM_M1E10G2BPI9CX4_SSID)|| \
|
||||
(pid==SILICOM_M1E10G2BPI9SR_SSID)|| \
|
||||
(pid==SILICOM_M1E10G2BPI9LR_SSID)|| \
|
||||
(pid==SILICOM_M2E10G2BPI9CX4_SSID)|| \
|
||||
(pid==SILICOM_M2E10G2BPI9SR_SSID)|| \
|
||||
(pid==SILICOM_M2E10G2BPI9LR_SSID)|| \
|
||||
(pid==SILICOM_M2E10G2BPI9T_SSID)|| \
|
||||
(pid==SILICOM_PE210G2BPI9CX4_SSID)|| \
|
||||
(pid==SILICOM_PE210G2BPI9SR_SSID)|| \
|
||||
(pid==SILICOM_PE210G2BPI9LR_SSID)|| \
|
||||
(pid==SILICOM_PE210G2DBi9SR_SSID)|| \
|
||||
(pid==SILICOM_PE210G2DBi9SRRB_SSID)|| \
|
||||
(pid==SILICOM_PE210G2DBi9LR_SSID)|| \
|
||||
(pid==SILICOM_PE210G2DBi9LRRB_SSID)|| \
|
||||
(pid==SILICOM_PE310G4DBi940SR_SSID)|| \
|
||||
(pid==SILICOM_PE310G4DBi9T_SSID)|| \
|
||||
(pid==SILICOM_PE310G4BPi9T_SSID)|| \
|
||||
(pid==SILICOM_PE310G4BPi9SR_SSID)|| \
|
||||
(pid==SILICOM_M6E310G4BPi9SR_SSID)|| \
|
||||
(pid==SILICOM_M6E310G4BPi9LR_SSID)|| \
|
||||
(pid==SILICOM_PE310G4BPi9LR_SSID)|| \
|
||||
(pid==SILICOM_PE210G2BPI9T_SSID))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************************************/
|
||||
/* 1G INTERFACE ****************************************/
|
||||
/*******************************************************/
|
||||
|
||||
/* Intel Registers */
|
||||
#define BPCTLI_CTRL 0x00000
|
||||
#define BPCTLI_CTRL_SWDPIO0 0x00400000
|
||||
#define BPCTLI_CTRL_SWDPIN0 0x00040000
|
||||
|
||||
|
||||
#define BPCTLI_CTRL_EXT 0x00018 /* Extended Device Control - RW */
|
||||
#define BPCTLI_STATUS 0x00008 /* Device Status - RO */
|
||||
|
||||
|
||||
/* HW related */
|
||||
#define BPCTLI_CTRL_EXT_SDP6_DATA 0x00000040 /* Value of SW Defineable Pin 6 */
|
||||
#define BPCTLI_CTRL_EXT_SDP7_DATA 0x00000080 /* Value of SW Defineable Pin 7 */
|
||||
#define BPCTLI_CTRL_SDP0_DATA 0x00040000 /* SWDPIN 0 value */
|
||||
#define BPCTLI_CTRL_EXT_SDP6_DIR 0x00000400 /* Direction of SDP6 0=in 1=out */
|
||||
#define BPCTLI_CTRL_EXT_SDP7_DIR 0x00000800 /* Direction of SDP7 0=in 1=out */
|
||||
#define BPCTLI_CTRL_SDP0_DIR 0x00400000 /* SDP0 Input or output */
|
||||
#define BPCTLI_CTRL_SWDPIN1 0x00080000
|
||||
#define BPCTLI_CTRL_SDP1_DIR 0x00800000
|
||||
|
||||
#define BPCTLI_STATUS_LU 0x00000002 /* Link up.0=no,1=link */
|
||||
|
||||
|
||||
#define BPCTLI_CTRL_SDP0_SHIFT 18
|
||||
#define BPCTLI_CTRL_EXT_SDP6_SHIFT 6
|
||||
|
||||
#define BPCTLI_STATUS_TBIMODE 0x00000020
|
||||
#define BPCTLI_CTRL_EXT_LINK_MODE_PCIE_SERDES 0x00C00000
|
||||
#define BPCTLI_CTRL_EXT_LINK_MODE_MASK 0x00C00000
|
||||
|
||||
|
||||
|
||||
#define BPCTLI_CTRL_EXT_MCLK_DIR BPCTLI_CTRL_EXT_SDP7_DIR
|
||||
#define BPCTLI_CTRL_EXT_MCLK_DATA BPCTLI_CTRL_EXT_SDP7_DATA
|
||||
#define BPCTLI_CTRL_EXT_MDIO_DIR BPCTLI_CTRL_EXT_SDP6_DIR
|
||||
#define BPCTLI_CTRL_EXT_MDIO_DATA BPCTLI_CTRL_EXT_SDP6_DATA
|
||||
|
||||
#define BPCTLI_CTRL_EXT_MCLK_DIR5 BPCTLI_CTRL_SDP1_DIR
|
||||
#define BPCTLI_CTRL_EXT_MCLK_DATA5 BPCTLI_CTRL_SWDPIN1
|
||||
#define BPCTLI_CTRL_EXT_MCLK_DIR80 BPCTLI_CTRL_EXT_SDP6_DIR
|
||||
#define BPCTLI_CTRL_EXT_MCLK_DATA80 BPCTLI_CTRL_EXT_SDP6_DATA
|
||||
#define BPCTLI_CTRL_EXT_MDIO_DIR5 BPCTLI_CTRL_SWDPIO0
|
||||
#define BPCTLI_CTRL_EXT_MDIO_DATA5 BPCTLI_CTRL_SWDPIN0
|
||||
#define BPCTLI_CTRL_EXT_MDIO_DIR80 BPCTLI_CTRL_SWDPIO0
|
||||
#define BPCTLI_CTRL_EXT_MDIO_DATA80 BPCTLI_CTRL_SWDPIN0
|
||||
|
||||
|
||||
|
||||
#define BPCTL_WRITE_REG(a, reg, value) \
|
||||
(writel((value), (void *)(((a)->mem_map) + BPCTLI_##reg)))
|
||||
|
||||
#define BPCTL_READ_REG(a, reg) ( \
|
||||
readl((void *)((a)->mem_map) + BPCTLI_##reg))
|
||||
|
||||
|
||||
#define BPCTL_WRITE_FLUSH(a) BPCTL_READ_REG(a, STATUS)
|
||||
|
||||
#define BPCTL_BP_WRITE_REG(a, reg, value) ({ \
|
||||
BPCTL_WRITE_REG(a, reg, value); \
|
||||
BPCTL_WRITE_FLUSH(a);})
|
||||
|
||||
/**************************************************************/
|
||||
/************** 82575 Interface********************************/
|
||||
/**************************************************************/
|
||||
|
||||
#define BPCTLI_MII_CR_POWER_DOWN 0x0800
|
||||
#define BPCTLI_PHY_CONTROL 0x00 /* Control Register */
|
||||
#define BPCTLI_MDIC 0x00020 /* MDI Control - RW */
|
||||
#define BPCTLI_IGP01E1000_PHY_PAGE_SELECT 0x1F /* Page Select */
|
||||
#define BPCTLI_MAX_PHY_REG_ADDRESS 0x1F /* 5 bit address bus (0-0x1F) */
|
||||
|
||||
#define BPCTLI_MDIC_DATA_MASK 0x0000FFFF
|
||||
#define BPCTLI_MDIC_REG_MASK 0x001F0000
|
||||
#define BPCTLI_MDIC_REG_SHIFT 16
|
||||
#define BPCTLI_MDIC_PHY_MASK 0x03E00000
|
||||
#define BPCTLI_MDIC_PHY_SHIFT 21
|
||||
#define BPCTLI_MDIC_OP_WRITE 0x04000000
|
||||
#define BPCTLI_MDIC_OP_READ 0x08000000
|
||||
#define BPCTLI_MDIC_READY 0x10000000
|
||||
#define BPCTLI_MDIC_INT_EN 0x20000000
|
||||
#define BPCTLI_MDIC_ERROR 0x40000000
|
||||
|
||||
|
||||
#define BPCTLI_SWFW_PHY0_SM 0x02
|
||||
#define BPCTLI_SWFW_PHY1_SM 0x04
|
||||
|
||||
#define BPCTLI_SW_FW_SYNC 0x05B5C /* Software-Firmware Synchronization - RW */
|
||||
|
||||
#define BPCTLI_SWSM 0x05B50 /* SW Semaphore */
|
||||
#define BPCTLI_FWSM 0x05B54 /* FW Semaphore */
|
||||
|
||||
#define BPCTLI_SWSM_SMBI 0x00000001 /* Driver Semaphore bit */
|
||||
#define BPCTLI_SWSM_SWESMBI 0x00000002 /* FW Semaphore bit */
|
||||
#define BPCTLI_MAX_PHY_MULTI_PAGE_REG 0xF
|
||||
#define BPCTLI_GEN_POLL_TIMEOUT 640
|
||||
|
||||
/********************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
/********************************************************/
|
||||
/* 10G INTERFACE ****************************************/
|
||||
/********************************************************/
|
||||
|
||||
#define BP10G_I2CCTL 0x28
|
||||
|
||||
/* I2CCTL Bit Masks */
|
||||
#define BP10G_I2C_CLK_IN 0x00000001
|
||||
#define BP10G_I2C_CLK_OUT 0x00000002
|
||||
#define BP10G_I2C_DATA_IN 0x00000004
|
||||
#define BP10G_I2C_DATA_OUT 0x00000008
|
||||
|
||||
|
||||
#define BP10G_ESDP 0x20
|
||||
|
||||
#define BP10G_SDP0_DIR 0x100
|
||||
#define BP10G_SDP1_DIR 0x200
|
||||
#define BP10G_SDP3_DIR 0x800
|
||||
#define BP10G_SDP4_DIR BIT_12
|
||||
#define BP10G_SDP5_DIR 0x2000
|
||||
#define BP10G_SDP0_DATA 0x001
|
||||
#define BP10G_SDP1_DATA 0x002
|
||||
#define BP10G_SDP3_DATA 0x008
|
||||
#define BP10G_SDP4_DATA 0x010
|
||||
#define BP10G_SDP5_DATA 0x020
|
||||
|
||||
#define BP10G_SDP2_DIR 0x400
|
||||
#define BP10G_SDP2_DATA 0x4
|
||||
|
||||
|
||||
#define BP10G_EODSDP 0x28
|
||||
|
||||
#define BP10G_SDP6_DATA_IN 0x001
|
||||
#define BP10G_SDP6_DATA_OUT 0x002
|
||||
|
||||
#define BP10G_SDP7_DATA_IN 0x004
|
||||
#define BP10G_SDP7_DATA_OUT 0x008
|
||||
|
||||
#define BP10G_MCLK_DATA_OUT BP10G_SDP7_DATA_OUT
|
||||
#define BP10G_MDIO_DATA_OUT BP10G_SDP6_DATA_OUT
|
||||
#define BP10G_MDIO_DATA_IN BP10G_SDP6_DATA_IN
|
||||
|
||||
#define BP10G_MDIO_DATA /*BP10G_SDP5_DATA*/ BP10G_SDP3_DATA
|
||||
#define BP10G_MDIO_DIR /*BP10G_SDP5_DIR*/ BP10G_SDP3_DATA
|
||||
|
||||
/*#define BP10G_MCLK_DATA_OUT9 BP10G_I2C_CLK_OUT
|
||||
#define BP10G_MDIO_DATA_OUT9 BP10G_I2C_DATA_OUT*/
|
||||
|
||||
|
||||
/*#define BP10G_MCLK_DATA_OUT9*/ /*BP10G_I2C_DATA_OUT*/
|
||||
#define BP10G_MDIO_DATA_OUT9 BP10G_I2C_DATA_OUT /*BP10G_I2C_CLK_OUT*/
|
||||
|
||||
/* VIA EOSDP ! */
|
||||
#define BP10G_MCLK_DATA_OUT9 BP10G_SDP4_DATA
|
||||
#define BP10G_MCLK_DIR_OUT9 BP10G_SDP4_DIR
|
||||
|
||||
|
||||
/*#define BP10G_MDIO_DATA_IN9 BP10G_I2C_DATA_IN*/
|
||||
|
||||
#define BP10G_MDIO_DATA_IN9 BP10G_I2C_DATA_IN /*BP10G_I2C_CLK_IN*/
|
||||
|
||||
#define BP540_MDIO_DATA /*BP10G_SDP5_DATA*/ BP10G_SDP0_DATA
|
||||
#define BP540_MDIO_DIR /*BP10G_SDP5_DIR*/ BP10G_SDP0_DIR
|
||||
#define BP540_MCLK_DATA BP10G_SDP2_DATA
|
||||
#define BP540_MCLK_DIR BP10G_SDP2_DIR
|
||||
|
||||
|
||||
|
||||
#define BP10G_WRITE_REG(a, reg, value) \
|
||||
(writel((value), (void *)(((a)->mem_map) + BP10G_##reg)))
|
||||
|
||||
#define BP10G_READ_REG(a, reg) ( \
|
||||
readl((void *)((a)->mem_map) + BP10G_##reg))
|
||||
|
||||
/*****BROADCOM*******************************************/
|
||||
|
||||
#define BP10GB_MISC_REG_GPIO 0xa490
|
||||
#define BP10GB_GPIO3_P0 BIT_3
|
||||
#define BP10GB_GPIO3_P1 BIT_7
|
||||
|
||||
#define BP10GB_GPIO3_SET_P0 BIT_11
|
||||
#define BP10GB_GPIO3_CLR_P0 BIT_19
|
||||
#define BP10GB_GPIO3_OE_P0 BIT_27
|
||||
|
||||
#define BP10GB_GPIO3_SET_P1 BIT_15
|
||||
#define BP10GB_GPIO3_CLR_P1 BIT_23
|
||||
#define BP10GB_GPIO3_OE_P1 BIT_31
|
||||
|
||||
#define BP10GB_GPIO0_P1 0x10
|
||||
#define BP10GB_GPIO0_P0 0x1
|
||||
#define BP10GB_GPIO0_CLR_P0 0x10000
|
||||
#define BP10GB_GPIO0_CLR_P1 0x100000
|
||||
#define BP10GB_GPIO0_SET_P0 0x100
|
||||
#define BP10GB_GPIO0_SET_P1 0x1000
|
||||
|
||||
|
||||
|
||||
#define BP10GB_GPIO0_OE_P1 0x10000000
|
||||
#define BP10GB_GPIO0_OE_P0 0x1000000
|
||||
|
||||
#define BP10GB_MISC_REG_SPIO 0xa4fc
|
||||
#define BP10GB_GPIO4_OE BIT_28
|
||||
#define BP10GB_GPIO5_OE BIT_29
|
||||
#define BP10GB_GPIO4_CLR BIT_20
|
||||
#define BP10GB_GPIO5_CLR BIT_21
|
||||
#define BP10GB_GPIO4_SET BIT_12
|
||||
#define BP10GB_GPIO5_SET BIT_13
|
||||
#define BP10GB_GPIO4 BIT_4
|
||||
#define BP10GB_GPIO5 BIT_5
|
||||
|
||||
|
||||
|
||||
#define BP10GB_MCLK_DIR BP10GB_GPIO5_OE
|
||||
#define BP10GB_MDIO_DIR BP10GB_GPIO4_OE
|
||||
|
||||
#define BP10GB_MCLK_DATA BP10GB_GPIO5
|
||||
#define BP10GB_MDIO_DATA BP10GB_GPIO4
|
||||
|
||||
#define BP10GB_MCLK_SET BP10GB_GPIO5_SET
|
||||
#define BP10GB_MDIO_SET BP10GB_GPIO4_SET
|
||||
|
||||
#define BP10GB_MCLK_CLR BP10GB_GPIO5_CLR
|
||||
#define BP10GB_MDIO_CLR BP10GB_GPIO4_CLR
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define BP10GB_WRITE_REG(a, reg, value) \
|
||||
(writel((value), (void *)(((a)->mem_map) + BP10GB_##reg)))
|
||||
|
||||
#define BP10GB_READ_REG(a, reg) ( \
|
||||
readl((void *)((a)->mem_map) + BP10GB_##reg))
|
||||
|
||||
|
||||
|
||||
#endif
|
328
bp_msg.h
Normal file
328
bp_msg.h
Normal file
|
@ -0,0 +1,328 @@
|
|||
/**************************************************************************
|
||||
|
||||
Copyright (c) 2005-2013, Silicom
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. 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.
|
||||
|
||||
3. Neither the name of the Silicom nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _BP_MSG_H
|
||||
#define _BP_MSG_H
|
||||
|
||||
#define HELP_ENTRY "help"
|
||||
#define INFO_ENTRY "info"
|
||||
|
||||
#define IS_BYPASS_ENTRY "is_bypass"
|
||||
#define GET_BYPASS_SLAVE_ENTRY "get_bypass_slave"
|
||||
#define GET_BYPASS_CAPS_ENTRY "get_bypass_caps"
|
||||
#define GET_WD_SET_CAPS_ENTRY "get_wd_set_caps"
|
||||
#define SET_BYPASS_ENTRY "set_bypass"
|
||||
#define GET_BYPASS_ENTRY "get_bypass"
|
||||
#define GET_BYPASS_CHANGE_ENTRY "get_bypass_change"
|
||||
#define SET_DIS_BYPASS_ENTRY "set_dis_bypass"
|
||||
#define GET_DIS_BYPASS_ENTRY "get_dis_bypass"
|
||||
#define SET_BYPASS_PWOFF_ENTRY "set_bypass_pwoff"
|
||||
#define GET_BYPASS_PWOFF_ENTRY "get_bypass_pwoff"
|
||||
#define SET_BYPASS_PWUP_ENTRY "set_bypass_pwup"
|
||||
#define GET_BYPASS_PWUP_ENTRY "get_bypass_pwup"
|
||||
#define SET_STD_NIC_ENTRY "set_std_nic"
|
||||
#define GET_STD_NIC_ENTRY "get_std_nic"
|
||||
#define SET_BYPASS_WD_ENTRY "set_bypass_wd"
|
||||
#define GET_BYPASS_WD_ENTRY "get_bypass_wd"
|
||||
#define GET_WD_EXPIRE_TIME_ENTRY "get_wd_time_expire"
|
||||
#define RESET_BYPASS_WD_TIMER_ENTRY "reset_bypass_wd"
|
||||
#define SET_TX_ENTRY "set_tx"
|
||||
#define GET_TX_ENTRY "get_tx"
|
||||
#define BYPASS_ENABLE "on"
|
||||
#define BYPASS_DISABLE "off"
|
||||
#define TAP_MODE "tap"
|
||||
#define BYPASS_MODE "bypass"
|
||||
#define DISC_MODE "disc"
|
||||
#define SET_TAP_ENTRY "set_tap"
|
||||
#define GET_TAP_ENTRY "get_tap"
|
||||
#define SET_FORCE_LINK_ENTRY "set_force_link_on"
|
||||
#define GET_FORCE_LINK_ENTRY "get_force_link_on"
|
||||
|
||||
|
||||
#define SET_HW_RESET_ENTRY "set_hw_reset"
|
||||
#define GET_HW_RESET_ENTRY "get_hw_reset"
|
||||
|
||||
#define SET_WAIT_AT_PWUP_ENTRY "set_wait_at_pwup"
|
||||
#define GET_WAIT_AT_PWUP_ENTRY "get_wait_at_pwup"
|
||||
|
||||
|
||||
#define GET_TAP_CHANGE_ENTRY "get_tap_change"
|
||||
#define SET_DIS_TAP_ENTRY "set_dis_tap"
|
||||
#define GET_DIS_TAP_ENTRY "get_dis_tap"
|
||||
#define SET_TAP_PWUP_ENTRY "set_tap_pwup"
|
||||
#define GET_TAP_PWUP_ENTRY "get_tap_pwup"
|
||||
#define SET_DISC_ENTRY "set_disc"
|
||||
#define GET_DISC_ENTRY "get_disc"
|
||||
#define GET_DISC_CHANGE_ENTRY "get_disc_change"
|
||||
#define SET_DIS_DISC_ENTRY "set_dis_disc"
|
||||
#define GET_DIS_DISC_ENTRY "get_dis_disc"
|
||||
#define SET_DISC_PWUP_ENTRY "set_disc_pwup"
|
||||
#define GET_DISC_PWUP_ENTRY "get_disc_pwup"
|
||||
#define SET_WD_EXP_MODE_ENTRY "set_wd_exp_mode"
|
||||
#define GET_WD_EXP_MODE_ENTRY "get_wd_exp_mode"
|
||||
#define SET_WD_AUTORESET_ENTRY "set_wd_autoreset"
|
||||
#define GET_WD_AUTORESET_ENTRY "get_wd_autoreset"
|
||||
#define GET_BYPASS_INFO_ENTRY "get_bypass_info"
|
||||
|
||||
#ifdef BP_SELF_TEST
|
||||
#define SET_BP_SELF_TEST_ENTRY "set_bst"
|
||||
#define GET_BP_SELF_TEST_ENTRY "get_bst"
|
||||
#endif
|
||||
|
||||
#define IF_NAME "eth"
|
||||
|
||||
/********MESSAGES*************/
|
||||
#define NO_BPT_DEV_MSG "No Bypass/TAP control devices were found\n"
|
||||
#define NOT_SUPP_MSG "The interface is not capable of the operation.\n"
|
||||
#define NOT_SUPP_BP_MSG "The interface doesn't support Bypass.\n"
|
||||
#define NOT_SUPP_BPT_MSG "The interface doesn't support Bypass/TAP.\n"
|
||||
#define SLAVE_IF_MSG "The interface is a slave interface.\n"
|
||||
#define MASTER_IF_MSG "The interface is a control interface.\n"
|
||||
#define NOT_SUPP_BPT_SLAVE_MSG "The interface is a slave interface or doesn't support Bypass/TAP.\n"
|
||||
#define NOT_SUPP_BP_SLAVE_MSG "The interface is a slave interface or doesn't support Bypass.\n"
|
||||
#define NOT_SUPP_BP_SLAVE_UN_MSG "The interface is a slave interface or doesn't support Bypass or Bypass state is unknown.\n"
|
||||
#define NOT_SUPP_TAP_SLAVE_MSG "The interface is a slave interface or doesn't support TAP.\n"
|
||||
#define NOT_SUPP_SLAVE_MSG "The interface is a slave interface or doesn't support this feature.\n"
|
||||
#define BP_PAIR_MSG "%s is a slave port.\n"
|
||||
#define SUCCESS_MSG "completed successfully.\n"
|
||||
#define BP_MODE_MSG "The interface is in the Bypass mode.\n"
|
||||
#define NON_BP_MODE_MSG "The interface is in the non-Bypass mode.\n"
|
||||
#define TAP_MODE_MSG "The interface is in the TAP mode.\n"
|
||||
#define DISC_MODE_MSG "The interface is in the Disconnect mode.\n"
|
||||
#define DISC_PORT_MODE_MSG "The interface is in the Disconnect Port mode.\n"
|
||||
|
||||
#define NON_TAP_MODE_MSG "The interface is in the non-TAP mode.\n"
|
||||
#define NON_DISC_MODE_MSG "The interface is in the non-Disconnect mode.\n"
|
||||
#define NON_DISC_PORT_MODE_MSG "The interface is in the non-Disconnect Port mode.\n"
|
||||
#define NORMAL_MODE_MSG "The interface is in the Normal mode.\n"
|
||||
#define TAP_BP_MODE_EN_MSG "Bypass/TAP mode is enabled.\n"
|
||||
#define NORMAL_MODE_LAST_MSG "There was no change to bypass/tap/disc from last read of the status.\n"
|
||||
#define NON_BYPASS_MODE_LAST_MSG "There was no change to bypass from last read of the status.\n"
|
||||
#define NON_TAP_MODE_LAST_MSG "There was no change to tap from last read of the status.\n"
|
||||
#define NON_DISC_MODE_LAST_MSG "There was no change to disconnect from last read of the status.\n"
|
||||
|
||||
#define TAP_MODE_LAST_MSG "There was a change to TAP state or it's now in TAP state.\n"
|
||||
//#define NON_TAP_MODE_LAST_MSG "There was a change to non-TAP state or it's now in non-TAP state.\n"
|
||||
|
||||
#define DISC_MODE_LAST_MSG "There was a change to Disconnect state or it's now in Disconnect state.\n"
|
||||
//#define NON_DISC_MODE_LAST_MSG "There was a change to non-Disconnect state or it's now in non-Disconnect state.\n"
|
||||
#define BP_MODE_LAST_MSG "There was a change to Bypass state or it's now in Bypass state.\n"
|
||||
#define BP_MODE_EN_MSG "Bypass mode is enabled.\n"
|
||||
#define BP_MODE_DIS_MSG "Bypass mode is disabled.\n"
|
||||
#define TAP_MODE_EN_MSG "TAP mode is enabled.\n"
|
||||
#define TAP_MODE_DIS_MSG "TAP mode is disabled.\n"
|
||||
#define DISC_MODE_EN_MSG "Disconnect mode is enabled.\n"
|
||||
#define DISC_MODE_DIS_MSG "Disconnect mode is disabled.\n"
|
||||
#define BP_DIS_PWOFF_MSG "The interface is in the non-Bypass mode at power off state.\n"
|
||||
#define BP_EN_PWOFF_MSG "The interface is in the Bypass mode at power off state.\n"
|
||||
#define BP_DIS_PWUP_MSG "The interface is in the non-Bypass mode at power up state.\n"
|
||||
#define BP_EN_PWUP_MSG "The interface is in the Bypass mode at power up state.\n"
|
||||
#define TAP_EN_PWUP_MSG "The interface is in the TAP mode at power up state.\n"
|
||||
#define TAP_DIS_PWUP_MSG "The interface is in the non-TAP mode at power up state.\n"
|
||||
#define DISC_EN_PWUP_MSG "The interface is in the Disconnect mode at power up state.\n"
|
||||
#define DISC_DIS_PWUP_MSG "The interface is in the non-Disconnect mode at power up state.\n"
|
||||
#define DISC_PORT_EN_PWUP_MSG "The interface is in the Disconnect Port mode at power up state.\n"
|
||||
#define DISC_PORT_DIS_PWUP_MSG "The interface is in the non-Disconnect Port mode at power up state.\n"
|
||||
|
||||
#define WDT_STATE_MSG "WDT is enabled with %d ms timeout value.\n"
|
||||
#define WD_DIS_MSG "WDT is disabled.\n"
|
||||
#define NOT_WD_DIS_MSG "WDT is disabled or WDT state is unknown.\n"
|
||||
#define WD_STATE_EXT_MSG "WDT is enabled with %d ms timeout value.\n"
|
||||
#define WD_TIME_LEFT_MSG "WDT is enabled; %d ms time left till WDT expired.\n"
|
||||
#define WD_STATE_UNKNOWN_MSG "WDT state is unknown.\n"
|
||||
#define NOT_NET_DEV_MSG "%s does not appear to be a Silicom Bypass device. Must be "IF_NAME"<if_num>.\n"
|
||||
#define NOT_WDT_SLAVE_MSG "The interface is a slave interface or WDT state is unknown.\n"
|
||||
#define WDT_EXP_MSG "WDT has expired.\n"
|
||||
#define STD_NIC_MODE_MSG "The interface is in Standard NIC mode.\n"
|
||||
#define NON_STD_NIC_MODE_MSG "The interface is not in Standard NIC mode.\n"
|
||||
#define TX_EN_MSG "Transmit is enable.\n"
|
||||
#define TX_DIS_MSG "Transmit is disable.\n"
|
||||
#define TPL_EN_MSG "TPL is enable.\n"
|
||||
#define TPL_DIS_MSG "TPL is disable.\n"
|
||||
#define TAP_WD_EXP_MODE_MSG "When WDT timeout occurs, the interface will be in the TAP mode.\n"
|
||||
#define BYPASS_WD_EXP_MODE_MSG "When WDT timeout occurs, the interface will be in the Bypass mode.\n"
|
||||
#define BP_WAIT_AT_PWUP_EN_MSG "wait_at_pwup is enable.\n"
|
||||
#define BP_WAIT_AT_PWUP_DIS_MSG "wait_at_pwup is disable.\n"
|
||||
#define BP_HW_RESET_EN_MSG "hw_reset is enable.\n"
|
||||
#define BP_HW_RESET_DIS_MSG "hw_reset is disable.\n"
|
||||
#define FORCE_LINK_EN_MSG "Force link is enable.\n"
|
||||
#define FORCE_LINK_DIS_MSG "Force link is disable.\n"
|
||||
|
||||
#define DISC_WD_EXP_MODE_MSG "When WDT timeout occurs, the interface will be in the Disconnect mode.\n"
|
||||
#define NOT_DEV_MSG "No such device.\n"
|
||||
#define GET_BPSLAVE_FAIL_MSG "Get Bypass slave failed.\n"
|
||||
#define SET_BP_FAIL_MSG "Set Bypass failed.\n"
|
||||
#define GET_BP_FAIL_MSG "Get Bypass failed.\n"
|
||||
#define GET_BP_CHANGE_FAIL_MSG "Get Bypass change failed.\n"
|
||||
#define SET_DIS_BP_FAIL_MSG "Set disable Bypass failed.\n"
|
||||
#define GET_DIS_BP_FAIL_MSG "Get disable Bypass failed.\n"
|
||||
#define SET_BP_PWOFF_FAIL_MSG "Set Bypass/Normal mode on Power Off failed.\n"
|
||||
#define GET_BP_PWOFF_FAIL_MSG "Get Bypass/Normal mode on Power Off failed.\n"
|
||||
#define SET_BP_PWUP_FAIL_MSG "Set Bypass/Normal mode on Power Up failed.\n"
|
||||
#define GET_BP_PWUP_FAIL_MSG "Get Bypass/Normal mode on Power Up failed.\n"
|
||||
#define SET_BP_WD_FAIL_MSG "Set Bypass WD failed.\n"
|
||||
#define GET_BP_WD_FAIL_MSG "Get Bypass WD failed.\n"
|
||||
#define RESET_BP_WD_FAIL_MSG "Reset Bypass WD failed\n"
|
||||
#define SET_STD_NIC_FAIL_MSG "Set Standard NIC mode failed\n"
|
||||
#define GET_TAP_PWUP_FAIL_MSG "Get TAP mode on power up failed\n"
|
||||
#define GET_TAP_FAIL_MSG "Get TAP mode failed\n"
|
||||
#define GET_TAP_CHANGE_FAIL_MSG "Get TAP change failed.\n"
|
||||
#define GET_DIS_TAP_FAIL_MSG "Get disable TAP failed.\n"
|
||||
|
||||
#define GET_DISC_PWUP_FAIL_MSG "Get Disconnect mode on power up failed\n"
|
||||
#define GET_DISC_FAIL_MSG "Get Disconnect mode failed\n"
|
||||
|
||||
#define GET_DISC_PORT_PWUP_FAIL_MSG "Get Disconnect Port mode on power up failed\n"
|
||||
#define GET_DISC_PORT_FAIL_MSG "Get Disconnect Port mode failed\n"
|
||||
|
||||
#define GET_DISC_CHANGE_FAIL_MSG "Get Disconnect change failed.\n"
|
||||
#define GET_DIS_DISC_FAIL_MSG "Get disable Disconnect failed.\n"
|
||||
|
||||
#define WD_AUTORESET_STATE_MSG "WDT autoreset is enabled with %d ms period.\n"
|
||||
#define WD_AUTORESET_DIS_MSG "WDT autoreset is disabled.\n"
|
||||
|
||||
#ifdef BP_SELF_TEST
|
||||
#define BP_SELF_TEST_MSG "Bypass Self Test is enabled with %d ms period.\n"
|
||||
#define BP_SELF_TEST_DIS_MSG "Bypass Self Test is disabled.\n"
|
||||
#endif
|
||||
|
||||
|
||||
#define NOT_SUPP_TXCTL_MSG "The interface doesn't support TX Control feature.\n"
|
||||
#define NOT_SUPP_TXCTL_SLAVE_MSG "The interface is a slave interface.\n"
|
||||
#define NO_TXCTL_DEV_MSG "No TX control devices were found\n"
|
||||
#define TXCTL_FAIL_MSG "Set Transmit mode failed.\n"
|
||||
#define TXCTL_OK_MSG "Set Transmit mode completed successfully.\n"
|
||||
#define GET_DEV_NUM_FAIL_MSG "Get TX Control devices number failed\n"
|
||||
#define GET_TXCTL_FAIL_MSG "Get Transmit mode failed.\n"
|
||||
|
||||
#define NO_BPCTL_DEV_MSG "No Bypass-SD/TAP-SD control devices were found\n"
|
||||
#define NOT_SUPP_BPCTL_MSG "The interface is not Bypass-SD/TAP-SD device.\n"
|
||||
#define NO_BP_DEV_MSG "No Bypass-SD control devices were found\n"
|
||||
|
||||
|
||||
|
||||
|
||||
#define BP_CAP_MSG "\nBP_CAP The interface is Bypass/TAP capable in general.\n"
|
||||
#define BP_STATUS_CAP_MSG "\nBP_STATUS_CAP The interface can report of the current Bypass mode.\n"
|
||||
#define BP_STATUS_CHANGE_CAP_MSG "\nBP_STATUS_CHANGE_CAP The interface can report on a change to bypass mode\n" \
|
||||
" from the last time the mode was defined\n"
|
||||
#define SW_CTL_CAP_MSG "\nSW_CTL_CAP The interface is Software controlled capable for\n" \
|
||||
" bypass/non bypass/TAP/non TAP modes.\n"
|
||||
#define BP_DIS_CAP_MSG "\nBP_DIS_CAP The interface is capable of disabling the Bypass mode\n" \
|
||||
" at all times. This mode will retain its mode even\n" \
|
||||
" during power loss and also after power recovery. This\n" \
|
||||
" will overcome on any bypass operation due to watchdog\n" \
|
||||
" timeout or set bypass command.\n"
|
||||
#define BP_DIS_STATUS_CAP_MSG "\nBP_DIS_STATUS_CAP The interface can report of the current DIS_BP_CAP.\n"
|
||||
#define STD_NIC_CAP_MSG "\nSTD_NIC_CAP The interface is capable to be configured to operate\n" \
|
||||
" as standard, non Bypass, NIC interface (have direct\n" \
|
||||
" connection to interfaces at all power modes).\n"
|
||||
#define BP_PWOFF_ON_CAP_MSG "\nBP_PWOFF_ON_CAP The interface can be in Bypass mode at power off state.\n"
|
||||
#define BP_PWOFF_OFF_CAP_MSG "\nBP_PWOFF_OFF_CAP The interface can disconnect the Bypass mode at\n" \
|
||||
" power off state without effecting all the other\n" \
|
||||
" states of operation.\n"
|
||||
#define BP_PWOFF_CTL_CAP_MSG "\nBP_PWOFF_CTL_CAP The behavior of the Bypass mode at Power-off state\n" \
|
||||
" can be controlled by software without effecting any\n" \
|
||||
" other state.\n"
|
||||
#define BP_PWUP_ON_CAP_MSG "\nBP_PWUP_ON_CAP The interface can be in Bypass mode when power is\n" \
|
||||
" turned on (until the system take control of the\n" \
|
||||
" bypass functionality).\n"
|
||||
#define BP_PWUP_OFF_CAP_MSG "\nBP_PWUP_OFF_CAP The interface can disconnect from Bypass mode when\n" \
|
||||
" power is turned on (until the system take control\n" \
|
||||
" of the bypass functionality).\n"
|
||||
#define BP_PWUP_CTL_CAP_MSG "\nBP_PWUP_CTL_CAP The behavior of the Bypass mode at Power-up can be\n" \
|
||||
" controlled by software\n"
|
||||
#define WD_CTL_CAP_MSG "\nWD_CTL_CAP The interface has watchdog capabilities to turn to\n" \
|
||||
" Bypass mode when not reset for defined period of time.\n"
|
||||
#define WD_STATUS_CAP_MSG "\nWD_STATUS_CAP The interface can report on the watchdog status\n" \
|
||||
" (active/inactive)\n"
|
||||
#define WD_TIMEOUT_CAP_MSG "\nWD_TIMEOUT_CAP The interface can report the time left till watchdog\n" \
|
||||
" triggers to Bypass mode.\n"
|
||||
|
||||
#define WD_MIN_TIME_MSG "\nWD_MIN_TIME = %d The interface WD minimal time period (ms).\n\n"
|
||||
#define WD_STEP_TIME_MSG "\nWD_STEP_TIME = %d The steps of the WD timer in\n" \
|
||||
" 0 - for linear steps (WD_MIN_TIME * X)\n" \
|
||||
" 1 - for multiply by 2 from previous step (WD_MIN_TIME * 2^X).\n"
|
||||
#define WD_STEP_COUNT_MSG "\nWD_STEP_COUNT_MSG = %d Number of bits available for defining the number of WDT steps.\n" \
|
||||
" From that the number of steps the WDT will have is 2^Y\n" \
|
||||
" (Y number of bits available for defining the value).\n\n"
|
||||
|
||||
#define TX_CTL_CAP_MSG "\nTX_CTL_CAP The interface is capable to control PHY transmitter on and off.\n"
|
||||
#define TX_STATUS_CAP_MSG "\nTX_STATUS_CAP The interface can report the status of the PHY transmitter.\n"
|
||||
#define TAP_CAP_MSG "\nTAP_CAP The interface is TAP capable in general.\n"
|
||||
#define TAP_STATUS_CAP_MSG "\nTAP_STATUS_CAP The interface can report of the current TAP mode.\n"
|
||||
#define TAP_STATUS_CHANGE_CAP_MSG "\nTAP_STATUS_CHANGE_CAP The interface can report on a change to TAP mode\n" \
|
||||
" from the last time the mode was defined\n"
|
||||
#define TAP_DIS_CAP_MSG "\nTAP_DIS_CAP The interface is capable of disabling the TAP mode\n" \
|
||||
" at all times. This mode will retain its mode even\n" \
|
||||
" during power loss and also after power recovery. This\n" \
|
||||
" will overcome on any TAP operation due to watchdog\n" \
|
||||
" timeout or set TAP command.\n"
|
||||
#define TAP_DIS_STATUS_CAP_MSG "\nTAP_DIS_STATUS_CAP The interface can report of the current DIS_TAP_CAP.\n"
|
||||
#define TAP_PWUP_ON_CAP_MSG "\nTAP_PWUP_ON_CAP The interface can be in TAP mode when power is\n" \
|
||||
" turned on (until the system take control of the\n" \
|
||||
" TAP functionality).\n"
|
||||
#define TAP_PWUP_OFF_CAP_MSG "\nTAP_PWUP_OFF_CAP The interface can disconnect from TAP mode when\n" \
|
||||
" power is turned on (until the system take control\n" \
|
||||
" of the TAP functionality).\n"
|
||||
#define TAP_PWUP_CTL_CAP_MSG "\nTAP_PWUP_CTL_CAP The behavior of the TAP mode at Power-up can be\n" \
|
||||
" controlled by software\n"
|
||||
#define NIC_CAP_NEG_MSG "\nNIC_CAP_NEG The interface is NIC capable in general - \n" \
|
||||
" negative polarity (0 - NIC capable)\n"
|
||||
|
||||
#define TPL_CAP_MSG "\nTPL_CAP The interface is TPL capable in general.\n"
|
||||
#define DISC_CAP_MSG "\nDISC_CAP The interface is Disconnect capable in general.\n"
|
||||
#define DISC_STATUS_CAP_MSG "\nDISC_STATUS_CAP The interface can report of the current Disconnect mode.\n"
|
||||
#if 0
|
||||
#define DISC_STATUS_CHANGE_CAP_MSG "\nDISC_STATUS_CHANGE_CAP The interface can report on a change to Disconnect \n" \
|
||||
" mode from the last time the mode was defined\n"
|
||||
#endif
|
||||
#define DISC_DIS_CAP_MSG "\nDISC_DIS_CAP The interface is capable of disabling the Disconnect mode\n" \
|
||||
" at all times. This mode will retain its mode even\n" \
|
||||
" during power loss and also after power recovery. This\n" \
|
||||
" will overcome on any Disconnect operation due to watchdog\n" \
|
||||
" timeout or set Disconnect command.\n"
|
||||
#if 0
|
||||
#define DISC_DIS_STATUS_CAP_MSG "\nDISC_DIS_STATUS_CAP The interface can report of the current DIS_DISC_CAP.\n"
|
||||
#define DISC_PWUP_ON_CAP_MSG "\nDISC_PWUP_ON_CAP The interface can be in Disconnect mode when power is\n" \
|
||||
" turned on (until the system take control of the\n" \
|
||||
" Disconnect functionality).\n"
|
||||
#define DISC_PWUP_OFF_CAP_MSG "\nDISC_PWUP_OFF_CAP The interface can disconnect from Disconnect mode when\n" \
|
||||
" power is turned on (until the system take control\n" \
|
||||
" of the Disconnect functionality).\n"
|
||||
#endif
|
||||
#define DISC_PWUP_CTL_CAP_MSG "\nDISC_PWUP_CTL_CAP The behavior of the Disconnect mode at Power-up can be\n" \
|
||||
" controlled by software\n"
|
||||
|
||||
|
||||
#endif
|
1513
bp_proc.c
Normal file
1513
bp_proc.c
Normal file
|
@ -0,0 +1,1513 @@
|
|||
/**************************************************************************
|
||||
|
||||
Copyright (c) 2005-2013, Silicom
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. 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.
|
||||
|
||||
3. Neither the name of the Silicom nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include "bp_mod.h"
|
||||
|
||||
#define BP_PROC_DIR "bypass"
|
||||
|
||||
#ifdef BYPASS_SUPPORT
|
||||
|
||||
#define GPIO6_SET_ENTRY_SD "gpio6_set"
|
||||
#define GPIO6_CLEAR_ENTRY_SD "gpio6_clear"
|
||||
|
||||
#define GPIO7_SET_ENTRY_SD "gpio7_set"
|
||||
#define GPIO7_CLEAR_ENTRY_SD "gpio7_clear"
|
||||
|
||||
#define PULSE_SET_ENTRY_SD "pulse_set"
|
||||
#define ZERO_SET_ENTRY_SD "zero_set"
|
||||
#define PULSE_GET1_ENTRY_SD "pulse_get1"
|
||||
#define PULSE_GET2_ENTRY_SD "pulse_get2"
|
||||
|
||||
#define CMND_ON_ENTRY_SD "cmnd_on"
|
||||
#define CMND_OFF_ENTRY_SD "cmnd_off"
|
||||
#define RESET_CONT_ENTRY_SD "reset_cont"
|
||||
|
||||
/*COMMANDS*/
|
||||
#define BYPASS_INFO_ENTRY_SD "bypass_info"
|
||||
|
||||
#define BYPASS_SLAVE_ENTRY_SD "bypass_slave"
|
||||
#define BYPASS_CAPS_ENTRY_SD "bypass_caps"
|
||||
#define WD_SET_CAPS_ENTRY_SD "wd_set_caps"
|
||||
#define BYPASS_ENTRY_SD "bypass"
|
||||
#define BYPASS_CHANGE_ENTRY_SD "bypass_change"
|
||||
#define BYPASS_WD_ENTRY_SD "bypass_wd"
|
||||
#define WD_EXPIRE_TIME_ENTRY_SD "wd_expire_time"
|
||||
#define RESET_BYPASS_WD_ENTRY_SD "reset_bypass_wd"
|
||||
#define DIS_BYPASS_ENTRY_SD "dis_bypass"
|
||||
#define BYPASS_PWUP_ENTRY_SD "bypass_pwup"
|
||||
#define BYPASS_PWOFF_ENTRY_SD "bypass_pwoff"
|
||||
#define STD_NIC_ENTRY_SD "std_nic"
|
||||
#define STD_NIC_ENTRY_SD "std_nic"
|
||||
#define TAP_ENTRY_SD "tap"
|
||||
#define TAP_CHANGE_ENTRY_SD "tap_change"
|
||||
#define DIS_TAP_ENTRY_SD "dis_tap"
|
||||
#define TAP_PWUP_ENTRY_SD "tap_pwup"
|
||||
#define TWO_PORT_LINK_ENTRY_SD "two_port_link"
|
||||
#define WD_EXP_MODE_ENTRY_SD "wd_exp_mode"
|
||||
#define WD_AUTORESET_ENTRY_SD "wd_autoreset"
|
||||
#define TPL_ENTRY_SD "tpl"
|
||||
#define WAIT_AT_PWUP_ENTRY_SD "wait_at_pwup"
|
||||
#define HW_RESET_ENTRY_SD "hw_reset"
|
||||
#define DISC_ENTRY_SD "disc"
|
||||
#define DISC_CHANGE_ENTRY_SD "disc_change"
|
||||
#define DIS_DISC_ENTRY_SD "dis_disc"
|
||||
#define DISC_PWUP_ENTRY_SD "disc_pwup"
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //bypass_support
|
||||
|
||||
|
||||
static struct proc_dir_entry *bp_procfs_dir;
|
||||
|
||||
static struct proc_dir_entry *
|
||||
proc_getdir(char *name, struct proc_dir_entry *proc_dir) {
|
||||
struct proc_dir_entry *pde = proc_dir;
|
||||
#ifdef CONFIG_LOCK_KERNEL
|
||||
lock_kernel();
|
||||
#endif
|
||||
for (pde=pde->subdir; pde; pde = pde->next) {
|
||||
if (pde->namelen && (strcmp(name, pde->name) == 0)) {
|
||||
/* directory exists */
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (pde == (struct proc_dir_entry *) 0) {
|
||||
/* create the directory */
|
||||
#if (LINUX_VERSION_CODE > 0x20300)
|
||||
pde = proc_mkdir(name, proc_dir);
|
||||
#else
|
||||
pde = create_proc_entry(name, S_IFDIR, proc_dir);
|
||||
#endif
|
||||
if (pde == (struct proc_dir_entry *) 0) {
|
||||
#ifdef CONFIG_LOCK_KERNEL
|
||||
unlock_kernel();
|
||||
#endif
|
||||
return(pde);
|
||||
}
|
||||
}
|
||||
#ifdef CONFIG_LOCK_KERNEL
|
||||
unlock_kernel();
|
||||
#endif
|
||||
return(pde);
|
||||
}
|
||||
|
||||
int
|
||||
bp_proc_create(void)
|
||||
{
|
||||
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) )
|
||||
bp_procfs_dir = proc_getdir(BP_PROC_DIR, proc_net);
|
||||
#else
|
||||
bp_procfs_dir = proc_getdir(BP_PROC_DIR, init_net.proc_net);
|
||||
#endif
|
||||
|
||||
if (bp_procfs_dir == (struct proc_dir_entry *) 0) {
|
||||
printk(KERN_DEBUG "Could not create procfs nicinfo directory %s\n", BP_PROC_DIR);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef BYPASS_SUPPORT
|
||||
|
||||
|
||||
int
|
||||
bypass_proc_create_entry_sd(struct pfs_unit *pfs_unit_curr,
|
||||
char* proc_name,
|
||||
write_proc_t *write_proc,
|
||||
read_proc_t *read_proc,
|
||||
struct proc_dir_entry *parent_pfs,
|
||||
void *data
|
||||
)
|
||||
{
|
||||
strcpy(pfs_unit_curr->proc_name,proc_name);
|
||||
pfs_unit_curr->proc_entry= create_proc_entry(pfs_unit_curr->proc_name,
|
||||
S_IFREG|S_IRUSR|S_IWUSR|
|
||||
S_IRGRP|S_IWGRP|
|
||||
S_IROTH|S_IWOTH, parent_pfs);
|
||||
if (pfs_unit_curr->proc_entry == 0) {
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
pfs_unit_curr->proc_entry->read_proc = read_proc;
|
||||
pfs_unit_curr->proc_entry->write_proc = write_proc;
|
||||
pfs_unit_curr->proc_entry->data = data;
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
get_bypass_info_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
int len=0;
|
||||
|
||||
len += sprintf(page, "Name\t\t\t%s\n", pbp_device_block->bp_name);
|
||||
len += sprintf(page+len, "Firmware version\t0x%x\n", pbp_device_block->bp_fw_ver);
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
get_bypass_slave_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
struct pci_dev *pci_slave_dev=pbp_device_block->bp_slave;
|
||||
struct net_device *net_slave_dev;
|
||||
int len=0;
|
||||
|
||||
if (is_bypass_fn(pbp_device_block)) {
|
||||
net_slave_dev=pci_get_drvdata(pci_slave_dev);
|
||||
if (net_slave_dev)
|
||||
len = sprintf(page, "%s\n", net_slave_dev->name);
|
||||
else
|
||||
len=sprintf(page, "fail\n");
|
||||
} else
|
||||
len=sprintf(page, "fail\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
int
|
||||
get_bypass_caps_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_bypass_caps_fn (pbp_device_block);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "-1\n");
|
||||
else
|
||||
len=sprintf(page, "0x%x\n", ret);
|
||||
*eof = 1;
|
||||
return len;
|
||||
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
get_wd_set_caps_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_wd_set_caps_fn (pbp_device_block);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "-1\n");
|
||||
else
|
||||
len=sprintf(page, "0x%x\n", ret);
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
set_bypass_pfs(struct file *file, const char *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
|
||||
char kbuf[256];
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int bypass_param=0, length=0;
|
||||
|
||||
if (count>(sizeof(kbuf)-1))
|
||||
return -1;
|
||||
|
||||
if (copy_from_user(&kbuf,buffer,count)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
kbuf[count]='\0';
|
||||
length=strlen(kbuf);
|
||||
if (kbuf[length-1]=='\n')
|
||||
kbuf[--length]='\0';
|
||||
|
||||
|
||||
if (strcmp(kbuf,"on")==0)
|
||||
bypass_param=1;
|
||||
else if (strcmp(kbuf,"off")==0)
|
||||
bypass_param=0;
|
||||
|
||||
|
||||
set_bypass_fn (pbp_device_block, bypass_param);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
int
|
||||
set_tap_pfs(struct file *file, const char *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
|
||||
char kbuf[256];
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int tap_param=0, length=0;
|
||||
|
||||
if (count>(sizeof(kbuf)-1))
|
||||
return -1;
|
||||
|
||||
if (copy_from_user(&kbuf,buffer,count)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
kbuf[count]='\0';
|
||||
length=strlen(kbuf);
|
||||
if (kbuf[length-1]=='\n')
|
||||
kbuf[--length]='\0';
|
||||
|
||||
if (strcmp(kbuf,"on")==0)
|
||||
tap_param=1;
|
||||
else if (strcmp(kbuf,"off")==0)
|
||||
tap_param=0;
|
||||
|
||||
set_tap_fn(pbp_device_block, tap_param);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
int
|
||||
set_disc_pfs(struct file *file, const char *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
|
||||
char kbuf[256];
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int tap_param=0, length=0;
|
||||
|
||||
if (count>(sizeof(kbuf)-1))
|
||||
return -1;
|
||||
|
||||
if (copy_from_user(&kbuf,buffer,count)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
kbuf[count]='\0';
|
||||
length=strlen(kbuf);
|
||||
if (kbuf[length-1]=='\n')
|
||||
kbuf[--length]='\0';
|
||||
|
||||
if (strcmp(kbuf,"on")==0)
|
||||
tap_param=1;
|
||||
else if (strcmp(kbuf,"off")==0)
|
||||
tap_param=0;
|
||||
|
||||
set_disc_fn(pbp_device_block, tap_param);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
get_bypass_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_bypass_fn (pbp_device_block);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "fail\n");
|
||||
else if (ret==1)
|
||||
len=sprintf(page, "on\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "off\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
int
|
||||
get_tap_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_tap_fn (pbp_device_block);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "fail\n");
|
||||
else if (ret==1)
|
||||
len=sprintf(page, "on\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "off\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
get_disc_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_disc_fn (pbp_device_block);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "fail\n");
|
||||
else if (ret==1)
|
||||
len=sprintf(page, "on\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "off\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
int
|
||||
get_bypass_change_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_bypass_change_fn (pbp_device_block);
|
||||
if (ret==1)
|
||||
len=sprintf(page, "on\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "off\n");
|
||||
else len=sprintf(page, "fail\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
get_tap_change_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_tap_change_fn (pbp_device_block);
|
||||
if (ret==1)
|
||||
len=sprintf(page, "on\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "off\n");
|
||||
else len=sprintf(page, "fail\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
int
|
||||
get_disc_change_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_disc_change_fn (pbp_device_block);
|
||||
if (ret==1)
|
||||
len=sprintf(page, "on\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "off\n");
|
||||
else len=sprintf(page, "fail\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
set_bypass_wd_pfs(struct file *file, const char *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
|
||||
char kbuf[256];
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
unsigned int timeout=0;
|
||||
char *timeout_ptr=kbuf;
|
||||
|
||||
|
||||
if (copy_from_user(&kbuf,buffer,count)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
timeout_ptr=kbuf;
|
||||
timeout=atoi(&timeout_ptr);
|
||||
|
||||
set_bypass_wd_fn(pbp_device_block, timeout) ;
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
int
|
||||
get_bypass_wd_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0, timeout=0;
|
||||
|
||||
ret=get_bypass_wd_fn (pbp_device_block, &timeout);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "fail\n");
|
||||
else if (timeout==-1)
|
||||
len=sprintf(page, "unknown\n");
|
||||
else if (timeout==0)
|
||||
len=sprintf(page, "disable\n");
|
||||
else
|
||||
len=sprintf(page, "%d\n", timeout);
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
get_wd_expire_time_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0, timeout=0;
|
||||
|
||||
ret=get_wd_expire_time_fn (pbp_device_block, &timeout);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "fail\n");
|
||||
else if (timeout==-1)
|
||||
len=sprintf(page, "expire\n");
|
||||
else if (timeout==0)
|
||||
len=sprintf(page, "disable\n");
|
||||
|
||||
else
|
||||
len=sprintf(page, "%d\n", timeout);
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
int
|
||||
get_tpl_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_tpl_fn (pbp_device_block);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "fail\n");
|
||||
else if (ret==1)
|
||||
len=sprintf(page, "on\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "off\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
#ifdef PMC_FIX_FLAG
|
||||
int
|
||||
get_wait_at_pwup_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_bp_wait_at_pwup_fn (pbp_device_block);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "fail\n");
|
||||
else if (ret==1)
|
||||
len=sprintf(page, "on\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "off\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
int
|
||||
get_hw_reset_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_bp_hw_reset_fn (pbp_device_block);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "fail\n");
|
||||
else if (ret==1)
|
||||
len=sprintf(page, "on\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "off\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
#endif /*PMC_WAIT_FLAG*/
|
||||
|
||||
|
||||
int
|
||||
reset_bypass_wd_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=reset_bypass_wd_timer_fn (pbp_device_block);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "fail\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "disable\n");
|
||||
else if (ret==1)
|
||||
len=sprintf(page, "success\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
int
|
||||
set_dis_bypass_pfs(struct file *file, const char *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
|
||||
char kbuf[256];
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int bypass_param=0, length=0;
|
||||
|
||||
if (copy_from_user(&kbuf,buffer,count)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
kbuf[count]='\0';
|
||||
length=strlen(kbuf);
|
||||
if (kbuf[length-1]=='\n')
|
||||
kbuf[--length]='\0';
|
||||
|
||||
|
||||
if (strcmp(kbuf,"on")==0)
|
||||
bypass_param=1;
|
||||
else if (strcmp(kbuf,"off")==0)
|
||||
bypass_param=0;
|
||||
|
||||
set_dis_bypass_fn (pbp_device_block, bypass_param);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
int
|
||||
set_dis_tap_pfs(struct file *file, const char *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
|
||||
char kbuf[256];
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int tap_param=0, length=0;
|
||||
|
||||
if (copy_from_user(&kbuf,buffer,count)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
kbuf[count]='\0';
|
||||
length=strlen(kbuf);
|
||||
if (kbuf[length-1]=='\n')
|
||||
kbuf[--length]='\0';
|
||||
|
||||
|
||||
if (strcmp(kbuf,"on")==0)
|
||||
tap_param=1;
|
||||
else if (strcmp(kbuf,"off")==0)
|
||||
tap_param=0;
|
||||
|
||||
set_dis_tap_fn (pbp_device_block, tap_param);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
int
|
||||
set_dis_disc_pfs(struct file *file, const char *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
|
||||
char kbuf[256];
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int tap_param=0, length=0;
|
||||
|
||||
if (copy_from_user(&kbuf,buffer,count)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
kbuf[count]='\0';
|
||||
length=strlen(kbuf);
|
||||
if (kbuf[length-1]=='\n')
|
||||
kbuf[--length]='\0';
|
||||
|
||||
|
||||
if (strcmp(kbuf,"on")==0)
|
||||
tap_param=1;
|
||||
else if (strcmp(kbuf,"off")==0)
|
||||
tap_param=0;
|
||||
|
||||
set_dis_disc_fn (pbp_device_block, tap_param);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
get_dis_bypass_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_dis_bypass_fn (pbp_device_block);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "fail\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "off\n");
|
||||
else
|
||||
len=sprintf(page, "on\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
int
|
||||
get_dis_tap_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_dis_tap_fn (pbp_device_block);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "fail\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "off\n");
|
||||
else
|
||||
len=sprintf(page, "on\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
int
|
||||
get_dis_disc_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_dis_disc_fn (pbp_device_block);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "fail\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "off\n");
|
||||
else
|
||||
len=sprintf(page, "on\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
set_bypass_pwup_pfs(struct file *file, const char *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
|
||||
char kbuf[256];
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int bypass_param=0, length=0;
|
||||
|
||||
if (copy_from_user(&kbuf,buffer,count)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
kbuf[count]='\0';
|
||||
length=strlen(kbuf);
|
||||
if (kbuf[length-1]=='\n')
|
||||
kbuf[--length]='\0';
|
||||
|
||||
if (strcmp(kbuf,"on")==0)
|
||||
bypass_param=1;
|
||||
else if (strcmp(kbuf,"off")==0)
|
||||
bypass_param=0;
|
||||
|
||||
set_bypass_pwup_fn (pbp_device_block, bypass_param);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
int
|
||||
set_bypass_pwoff_pfs(struct file *file, const char *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
|
||||
char kbuf[256];
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int bypass_param=0, length=0;
|
||||
|
||||
if (copy_from_user(&kbuf,buffer,count)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
kbuf[count]='\0';
|
||||
length=strlen(kbuf);
|
||||
if (kbuf[length-1]=='\n')
|
||||
kbuf[--length]='\0';
|
||||
|
||||
if (strcmp(kbuf,"on")==0)
|
||||
bypass_param=1;
|
||||
else if (strcmp(kbuf,"off")==0)
|
||||
bypass_param=0;
|
||||
|
||||
set_bypass_pwoff_fn (pbp_device_block, bypass_param);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
set_tap_pwup_pfs(struct file *file, const char *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
|
||||
char kbuf[256];
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int tap_param=0, length=0;
|
||||
|
||||
if (copy_from_user(&kbuf,buffer,count)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
kbuf[count]='\0';
|
||||
length=strlen(kbuf);
|
||||
if (kbuf[length-1]=='\n')
|
||||
kbuf[--length]='\0';
|
||||
|
||||
if (strcmp(kbuf,"on")==0)
|
||||
tap_param=1;
|
||||
else if (strcmp(kbuf,"off")==0)
|
||||
tap_param=0;
|
||||
|
||||
set_tap_pwup_fn (pbp_device_block, tap_param);
|
||||
|
||||
return count;
|
||||
}
|
||||
int
|
||||
set_disc_pwup_pfs(struct file *file, const char *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
|
||||
char kbuf[256];
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int tap_param=0, length=0;
|
||||
|
||||
if (copy_from_user(&kbuf,buffer,count)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
kbuf[count]='\0';
|
||||
length=strlen(kbuf);
|
||||
if (kbuf[length-1]=='\n')
|
||||
kbuf[--length]='\0';
|
||||
|
||||
if (strcmp(kbuf,"on")==0)
|
||||
tap_param=1;
|
||||
else if (strcmp(kbuf,"off")==0)
|
||||
tap_param=0;
|
||||
|
||||
set_disc_pwup_fn (pbp_device_block, tap_param);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
get_bypass_pwup_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_bypass_pwup_fn (pbp_device_block);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "fail\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "off\n");
|
||||
else
|
||||
len=sprintf(page, "on\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
int
|
||||
get_bypass_pwoff_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_bypass_pwoff_fn (pbp_device_block);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "fail\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "off\n");
|
||||
else
|
||||
len=sprintf(page, "on\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
get_tap_pwup_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_tap_pwup_fn (pbp_device_block);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "fail\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "off\n");
|
||||
else
|
||||
len=sprintf(page, "on\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
int
|
||||
get_disc_pwup_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_disc_pwup_fn (pbp_device_block);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "fail\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "off\n");
|
||||
else
|
||||
len=sprintf(page, "on\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
set_std_nic_pfs(struct file *file, const char *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
|
||||
char kbuf[256];
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int bypass_param=0, length=0;
|
||||
|
||||
if (copy_from_user(&kbuf,buffer,count)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
kbuf[count]='\0';
|
||||
length=strlen(kbuf);
|
||||
if (kbuf[length-1]=='\n')
|
||||
kbuf[--length]='\0';
|
||||
|
||||
|
||||
if (strcmp(kbuf,"on")==0)
|
||||
bypass_param=1;
|
||||
else if (strcmp(kbuf,"off")==0)
|
||||
bypass_param=0;
|
||||
|
||||
set_std_nic_fn (pbp_device_block, bypass_param);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
get_std_nic_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_std_nic_fn (pbp_device_block);
|
||||
if (ret==BP_NOT_CAP)
|
||||
len=sprintf(page, "fail\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "off\n");
|
||||
else
|
||||
len=sprintf(page, "on\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
int
|
||||
get_wd_exp_mode_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_wd_exp_mode_fn (pbp_device_block);
|
||||
if (ret==1)
|
||||
len=sprintf(page, "tap\n");
|
||||
else if (ret==0)
|
||||
len=sprintf(page, "bypass\n");
|
||||
else if (ret==2)
|
||||
len=sprintf(page, "disc\n");
|
||||
|
||||
else len=sprintf(page, "fail\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
int
|
||||
set_wd_exp_mode_pfs(struct file *file, const char *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
|
||||
char kbuf[256];
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int bypass_param=0, length=0;
|
||||
|
||||
if (count>(sizeof(kbuf)-1))
|
||||
return -1;
|
||||
|
||||
if (copy_from_user(&kbuf,buffer,count)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
kbuf[count]='\0';
|
||||
length=strlen(kbuf);
|
||||
if (kbuf[length-1]=='\n')
|
||||
kbuf[--length]='\0';
|
||||
|
||||
|
||||
if (strcmp(kbuf,"tap")==0)
|
||||
bypass_param=1;
|
||||
else if (strcmp(kbuf,"bypass")==0)
|
||||
bypass_param=0;
|
||||
else if (strcmp(kbuf,"disc")==0)
|
||||
bypass_param=2;
|
||||
|
||||
set_wd_exp_mode_fn(pbp_device_block, bypass_param);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
get_wd_autoreset_pfs (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int len=0, ret=0;
|
||||
|
||||
ret=get_wd_autoreset_fn (pbp_device_block);
|
||||
if (ret>=0)
|
||||
len=sprintf(page, "%d\n",ret);
|
||||
else len=sprintf(page, "fail\n");
|
||||
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
set_wd_autoreset_pfs(struct file *file, const char *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
char kbuf[256];
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
u32 timeout=0;
|
||||
char *timeout_ptr=kbuf;
|
||||
|
||||
|
||||
if (copy_from_user(&kbuf,buffer,count)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
timeout_ptr=kbuf;
|
||||
timeout=atoi(&timeout_ptr);
|
||||
|
||||
set_wd_autoreset_fn(pbp_device_block, timeout) ;
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
int
|
||||
set_tpl_pfs(struct file *file, const char *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
|
||||
char kbuf[256];
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int tpl_param=0, length=0;
|
||||
|
||||
if (count>(sizeof(kbuf)-1))
|
||||
return -1;
|
||||
|
||||
if (copy_from_user(&kbuf,buffer,count)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
kbuf[count]='\0';
|
||||
length=strlen(kbuf);
|
||||
if (kbuf[length-1]=='\n')
|
||||
kbuf[--length]='\0';
|
||||
|
||||
if (strcmp(kbuf,"on")==0)
|
||||
tpl_param=1;
|
||||
else if (strcmp(kbuf,"off")==0)
|
||||
tpl_param=0;
|
||||
|
||||
set_tpl_fn(pbp_device_block, tpl_param);
|
||||
|
||||
return count;
|
||||
}
|
||||
#ifdef PMC_FIX_FLAG
|
||||
int
|
||||
set_wait_at_pwup_pfs(struct file *file, const char *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
|
||||
char kbuf[256];
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int tpl_param=0, length=0;
|
||||
|
||||
if (count>(sizeof(kbuf)-1))
|
||||
return -1;
|
||||
|
||||
if (copy_from_user(&kbuf,buffer,count)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
kbuf[count]='\0';
|
||||
length=strlen(kbuf);
|
||||
if (kbuf[length-1]=='\n')
|
||||
kbuf[--length]='\0';
|
||||
|
||||
if (strcmp(kbuf,"on")==0)
|
||||
tpl_param=1;
|
||||
else if (strcmp(kbuf,"off")==0)
|
||||
tpl_param=0;
|
||||
|
||||
set_bp_wait_at_pwup_fn(pbp_device_block, tpl_param);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
int
|
||||
set_hw_reset_pfs(struct file *file, const char *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
|
||||
char kbuf[256];
|
||||
bpctl_dev_t * pbp_device_block= (bpctl_dev_t *) data;
|
||||
|
||||
int tpl_param=0, length=0;
|
||||
|
||||
if (count>(sizeof(kbuf)-1))
|
||||
return -1;
|
||||
|
||||
if (copy_from_user(&kbuf,buffer,count)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
kbuf[count]='\0';
|
||||
length=strlen(kbuf);
|
||||
if (kbuf[length-1]=='\n')
|
||||
kbuf[--length]='\0';
|
||||
|
||||
if (strcmp(kbuf,"on")==0)
|
||||
tpl_param=1;
|
||||
else if (strcmp(kbuf,"off")==0)
|
||||
tpl_param=0;
|
||||
|
||||
set_bp_hw_reset_fn(pbp_device_block, tpl_param);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
#endif /*PMC_FIX_FLAG*/
|
||||
|
||||
|
||||
int
|
||||
bypass_proc_create_dev_sd(bpctl_dev_t * pbp_device_block){
|
||||
struct bypass_pfs_sd *current_pfs = &(pbp_device_block->bypass_pfs_set);
|
||||
static struct proc_dir_entry *procfs_dir=NULL;
|
||||
int ret=0;
|
||||
|
||||
|
||||
sprintf(current_pfs->dir_name,"bypass_%s",dev->name);
|
||||
|
||||
if (!bp_procfs_dir)
|
||||
return -1;
|
||||
|
||||
/* create device proc dir */
|
||||
procfs_dir = proc_getdir(current_pfs->dir_name,bp_procfs_dir);
|
||||
if (procfs_dir == 0) {
|
||||
printk(KERN_DEBUG "Could not create procfs directory %s\n",
|
||||
current_pfs->dir_name);
|
||||
return -1;
|
||||
}
|
||||
current_pfs->bypass_entry= procfs_dir;
|
||||
|
||||
if (bypass_proc_create_entry(&(current_pfs->bypass_info),
|
||||
BYPASS_INFO_ENTRY_SD,
|
||||
NULL, /* write */
|
||||
get_bypass_info_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
|
||||
if (pbp_device_block->bp_caps & SW_CTL_CAP) {
|
||||
|
||||
|
||||
/* Create set param proc's */
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->bypass_slave),
|
||||
BYPASS_SLAVE_ENTRY_SD,
|
||||
NULL, /* write */
|
||||
get_bypass_slave_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
|
||||
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->bypass_caps),
|
||||
BYPASS_CAPS_ENTRY_SD,
|
||||
NULL, /* write */
|
||||
get_bypass_caps_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->wd_set_caps),
|
||||
WD_SET_CAPS_ENTRY_SD,
|
||||
NULL, /* write */
|
||||
get_wd_set_caps_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->bypass_wd),
|
||||
BYPASS_WD_ENTRY_SD,
|
||||
set_bypass_wd_pfs, /* write */
|
||||
get_bypass_wd_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
|
||||
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->wd_expire_time),
|
||||
WD_EXPIRE_TIME_ENTRY_SD,
|
||||
NULL, /* write */
|
||||
get_wd_expire_time_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->reset_bypass_wd),
|
||||
RESET_BYPASS_WD_ENTRY_SD,
|
||||
NULL, /* write */
|
||||
reset_bypass_wd_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->std_nic),
|
||||
STD_NIC_ENTRY_SD,
|
||||
set_std_nic_pfs, /* write */
|
||||
get_std_nic_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
|
||||
|
||||
if (pbp_device_block->bp_caps & BP_CAP) {
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->bypass),
|
||||
BYPASS_ENTRY_SD,
|
||||
set_bypass_pfs, /* write */
|
||||
get_bypass_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->dis_bypass),
|
||||
DIS_BYPASS_ENTRY_SD,
|
||||
set_dis_bypass_pfs, /* write */
|
||||
get_dis_bypass_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->bypass_pwup),
|
||||
BYPASS_PWUP_ENTRY_SD,
|
||||
set_bypass_pwup_pfs, /* write */
|
||||
get_bypass_pwup_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->bypass_pwoff),
|
||||
BYPASS_PWOFF_ENTRY_SD,
|
||||
set_bypass_pwoff_pfs, /* write */
|
||||
get_bypass_pwoff_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
|
||||
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->bypass_change),
|
||||
BYPASS_CHANGE_ENTRY_SD,
|
||||
NULL, /* write */
|
||||
get_bypass_change_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
}
|
||||
|
||||
if (pbp_device_block->bp_caps & TAP_CAP) {
|
||||
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->tap),
|
||||
TAP_ENTRY_SD,
|
||||
set_tap_pfs, /* write */
|
||||
get_tap_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->dis_tap),
|
||||
DIS_TAP_ENTRY_SD,
|
||||
set_dis_tap_pfs, /* write */
|
||||
get_dis_tap_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->tap_pwup),
|
||||
TAP_PWUP_ENTRY_SD,
|
||||
set_tap_pwup_pfs, /* write */
|
||||
get_tap_pwup_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->tap_change),
|
||||
TAP_CHANGE_ENTRY_SD,
|
||||
NULL, /* write */
|
||||
get_tap_change_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
}
|
||||
if (pbp_device_block->bp_caps & DISC_CAP) {
|
||||
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->tap),
|
||||
DISC_ENTRY_SD,
|
||||
set_disc_pfs, /* write */
|
||||
get_disc_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
#if 1
|
||||
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->dis_tap),
|
||||
DIS_DISC_ENTRY_SD,
|
||||
set_dis_disc_pfs, /* write */
|
||||
get_dis_disc_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
#endif
|
||||
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->tap_pwup),
|
||||
DISC_PWUP_ENTRY_SD,
|
||||
set_disc_pwup_pfs, /* write */
|
||||
get_disc_pwup_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->tap_change),
|
||||
DISC_CHANGE_ENTRY_SD,
|
||||
NULL, /* write */
|
||||
get_disc_change_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
}
|
||||
|
||||
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->wd_exp_mode),
|
||||
WD_EXP_MODE_ENTRY_SD,
|
||||
set_wd_exp_mode_pfs, /* write */
|
||||
get_wd_exp_mode_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->wd_autoreset),
|
||||
WD_AUTORESET_ENTRY_SD,
|
||||
set_wd_autoreset_pfs, /* write */
|
||||
get_wd_autoreset_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->tpl),
|
||||
TPL_ENTRY_SD,
|
||||
set_tpl_pfs, /* write */
|
||||
get_tpl_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
#ifdef PMC_FIX_FLAG
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->tpl),
|
||||
WAIT_AT_PWUP_ENTRY_SD,
|
||||
set_wait_at_pwup_pfs, /* write */
|
||||
get_wait_at_pwup_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
if (bypass_proc_create_entry_sd(&(current_pfs->tpl),
|
||||
HW_RESET_ENTRY_SD,
|
||||
set_hw_reset_pfs, /* write */
|
||||
get_hw_reset_pfs, /* read */
|
||||
procfs_dir,
|
||||
pbp_device_block))
|
||||
ret= -1;
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
if (ret<0)
|
||||
printk(KERN_DEBUG "Create proc entry failed\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
bypass_proc_remove_dev_sd(bpctl_dev_t * pbp_device_block){
|
||||
|
||||
struct bypass_pfs_sd *current_pfs = &pbp_device_block->bypass_pfs_set;
|
||||
struct proc_dir_entry *pde = current_pfs->bypass_entry, *pde_curr=NULL;
|
||||
char name[256];
|
||||
|
||||
|
||||
for (pde=pde->subdir; pde; ) {
|
||||
strcpy(name,pde->name);
|
||||
pde_curr=pde;
|
||||
pde=pde->next;
|
||||
remove_proc_entry(name,current_pfs->bypass_entry);
|
||||
}
|
||||
if (!pde)
|
||||
remove_proc_entry(current_pfs->dir_name,bp_procfs_dir);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
194
bp_util.h
Normal file
194
bp_util.h
Normal file
|
@ -0,0 +1,194 @@
|
|||
/**************************************************************************
|
||||
|
||||
Copyright (c) 2005-2013, Silicom
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. 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.
|
||||
|
||||
3. Neither the name of the Silicom nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef BPCTL_UTIL_H
|
||||
#define BPCTL_UTIL_H
|
||||
|
||||
#include "bp_msg.h"
|
||||
|
||||
|
||||
#define APP_NAME "Bypass-SD Control utility"
|
||||
#define COPYRT_MSG "Copyright Silicom Ltd."
|
||||
#define PROG_NAME "bpctl_util"
|
||||
#define UTIL_VER VER_STR_SET
|
||||
|
||||
|
||||
#define OK 1
|
||||
#define ERROR 0
|
||||
|
||||
#define HELP_ENTRY "help"
|
||||
#define INFO_ENTRY "info"
|
||||
#define IF_SCAN_ENTRY "if_scan"
|
||||
|
||||
#define SET_TX_ENTRY "set_tx"
|
||||
#define GET_TX_ENTRY "get_tx"
|
||||
#define SET_TPL_ENTRY "set_tpl"
|
||||
#define GET_TPL_ENTRY "get_tpl"
|
||||
#define GET_DEV_NUM_ENTRY "get_dev_num"
|
||||
|
||||
#define IS_BYPASS_ENTRY "is_bypass"
|
||||
#define GET_BYPASS_SLAVE_ENTRY "get_bypass_slave"
|
||||
#define GET_BYPASS_CAPS_ENTRY "get_bypass_caps"
|
||||
#define GET_WD_SET_CAPS_ENTRY "get_wd_set_caps"
|
||||
#define SET_BYPASS_ENTRY "set_bypass"
|
||||
#define GET_BYPASS_ENTRY "get_bypass"
|
||||
#define GET_BYPASS_CHANGE_ENTRY "get_bypass_change"
|
||||
#define SET_DIS_BYPASS_ENTRY "set_dis_bypass"
|
||||
#define GET_DIS_BYPASS_ENTRY "get_dis_bypass"
|
||||
#define SET_BYPASS_PWOFF_ENTRY "set_bypass_pwoff"
|
||||
#define GET_BYPASS_PWOFF_ENTRY "get_bypass_pwoff"
|
||||
#define SET_BYPASS_PWUP_ENTRY "set_bypass_pwup"
|
||||
#define GET_BYPASS_PWUP_ENTRY "get_bypass_pwup"
|
||||
#define SET_STD_NIC_ENTRY "set_std_nic"
|
||||
#define GET_STD_NIC_ENTRY "get_std_nic"
|
||||
#define SET_BYPASS_WD_ENTRY "set_bypass_wd"
|
||||
#define GET_BYPASS_WD_ENTRY "get_bypass_wd"
|
||||
#define GET_WD_EXPIRE_TIME_ENTRY "get_wd_time_expire"
|
||||
#define RESET_BYPASS_WD_TIMER_ENTRY "reset_bypass_wd"
|
||||
#define SET_TX_ENTRY "set_tx"
|
||||
#define GET_TX_ENTRY "get_tx"
|
||||
#define BYPASS_ENABLE "on"
|
||||
#define BYPASS_DISABLE "off"
|
||||
#define TAP_MODE "tap"
|
||||
#define BYPASS_MODE "bypass"
|
||||
#define SET_TAP_ENTRY "set_tap"
|
||||
#define GET_TAP_ENTRY "get_tap"
|
||||
#define GET_TAP_CHANGE_ENTRY "get_tap_change"
|
||||
#define SET_DIS_TAP_ENTRY "set_dis_tap"
|
||||
#define GET_DIS_TAP_ENTRY "get_dis_tap"
|
||||
#define SET_TAP_PWUP_ENTRY "set_tap_pwup"
|
||||
#define GET_TAP_PWUP_ENTRY "get_tap_pwup"
|
||||
#define SET_WD_EXP_MODE_ENTRY "set_wd_exp_mode"
|
||||
#define GET_WD_EXP_MODE_ENTRY "get_wd_exp_mode"
|
||||
#define SET_FORCE_LINK_ENTRY "set_force_link_on"
|
||||
#define GET_FORCE_LINK_ENTRY "get_force_link_on"
|
||||
|
||||
#define SET_BP_WAIT_AT_PWUP_ENTRY "set_wait_at_pwup"
|
||||
#define GET_BP_WAIT_AT_PWUP_ENTRY "get_wait_at_pwup"
|
||||
#define SET_BP_HW_RESET_ENTRY "set_hw_reset"
|
||||
#define GET_BP_HW_RESET_ENTRY "get_hw_reset"
|
||||
|
||||
#define SET_DISC_PORT_ENTRY "set_disc_port"
|
||||
#define GET_DISC_PORT_ENTRY "get_disc_port"
|
||||
#define SET_DISC_PORT_PWUP_ENTRY "set_disc_port_pwup"
|
||||
#define GET_DISC_PORT_PWUP_ENTRY "get_disc_port_pwup"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define BYPASS_ENABLE "on"
|
||||
#define BYPASS_DISABLE "off"
|
||||
#define IF_NAME "eth"
|
||||
#define ALL_NAME "all "
|
||||
|
||||
|
||||
#define IF_NAME "eth"
|
||||
|
||||
struct bp_cap {
|
||||
int flag;
|
||||
char *desc;
|
||||
} bp_cap, *pbp_cap;
|
||||
|
||||
|
||||
|
||||
struct bp_cap bp_cap_array[]={
|
||||
{BP_CAP , BP_CAP_MSG},
|
||||
{BP_STATUS_CAP , BP_STATUS_CAP_MSG},
|
||||
{BP_STATUS_CHANGE_CAP , BP_STATUS_CHANGE_CAP_MSG},
|
||||
{SW_CTL_CAP , SW_CTL_CAP_MSG},
|
||||
{BP_DIS_CAP , BP_DIS_CAP_MSG},
|
||||
{BP_DIS_STATUS_CAP , BP_DIS_STATUS_CAP_MSG},
|
||||
{STD_NIC_CAP , STD_NIC_CAP_MSG},
|
||||
{BP_PWOFF_ON_CAP , BP_PWOFF_ON_CAP_MSG},
|
||||
{BP_PWOFF_OFF_CAP , BP_PWOFF_OFF_CAP_MSG},
|
||||
{BP_PWOFF_CTL_CAP , BP_PWOFF_CTL_CAP_MSG},
|
||||
{BP_PWUP_ON_CAP , BP_PWUP_ON_CAP_MSG},
|
||||
{BP_PWUP_OFF_CAP , BP_PWUP_OFF_CAP_MSG},
|
||||
{BP_PWUP_CTL_CAP , BP_PWUP_CTL_CAP_MSG},
|
||||
{WD_CTL_CAP , WD_CTL_CAP_MSG},
|
||||
{WD_STATUS_CAP , WD_STATUS_CAP_MSG},
|
||||
{WD_TIMEOUT_CAP , WD_TIMEOUT_CAP_MSG},
|
||||
{TX_CTL_CAP , TX_CTL_CAP_MSG},
|
||||
{TX_STATUS_CAP , TX_STATUS_CAP_MSG},
|
||||
{TAP_CAP , TAP_CAP_MSG},
|
||||
{TAP_STATUS_CAP , TAP_STATUS_CAP_MSG},
|
||||
{TAP_STATUS_CHANGE_CAP , TAP_STATUS_CHANGE_CAP_MSG},
|
||||
{TAP_DIS_CAP , TAP_DIS_CAP_MSG},
|
||||
{TAP_DIS_STATUS_CAP , TAP_DIS_STATUS_CAP_MSG},
|
||||
{TAP_PWUP_ON_CAP , TAP_PWUP_ON_CAP_MSG},
|
||||
{TAP_PWUP_OFF_CAP , TAP_PWUP_OFF_CAP_MSG},
|
||||
{TAP_PWUP_CTL_CAP , TAP_PWUP_CTL_CAP_MSG},
|
||||
{NIC_CAP_NEG , NIC_CAP_NEG_MSG},
|
||||
{TPL_CAP , TPL_CAP_MSG},
|
||||
{DISC_CAP , DISC_CAP_MSG},
|
||||
{DISC_DIS_CAP , DISC_DIS_CAP_MSG},
|
||||
{DISC_PWUP_CTL_CAP , DISC_PWUP_CTL_CAP_MSG},
|
||||
|
||||
{0,NULL}
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
23
bpctl_start
Normal file
23
bpctl_start
Normal file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
drv_name="bpctl_mod"
|
||||
dev_node="bpctl"
|
||||
if grep '^staff:' /etc/group > /dev/null; then
|
||||
group="staff"
|
||||
else
|
||||
group="wheel"
|
||||
fi
|
||||
|
||||
# remove old device node
|
||||
rm -f /dev/${dev_node}?
|
||||
|
||||
# load the driver
|
||||
modprobe ${drv_name}
|
||||
|
||||
# extract major number for device
|
||||
major=`cat /proc/devices | awk "\\$2==\"$dev_node\" {print \\$1}"`
|
||||
|
||||
# make new node
|
||||
mknod /dev/${dev_node}0 c $major 0
|
||||
ln -sf /dev/${dev_node}0 /dev/${dev_node}
|
||||
chgrp $group /dev/${dev_node}0
|
||||
chmod 644 /dev/${dev_node}0
|
7
bpctl_stop
Normal file
7
bpctl_stop
Normal file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
/sbin/rmmod bpctl_mod $* || exit 1
|
||||
|
||||
rm -f /dev/bpctl0 /dev/bpctl
|
||||
|
||||
exit 0
|
237
bypass.h
Normal file
237
bypass.h
Normal file
|
@ -0,0 +1,237 @@
|
|||
/**************************************************************************
|
||||
|
||||
Copyright (c) 2005-2013, Silicom
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. 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.
|
||||
|
||||
3. Neither the name of the Silicom nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#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*/
|
||||
|
||||
|
585
libbp_sd.h
Normal file
585
libbp_sd.h
Normal file
|
@ -0,0 +1,585 @@
|
|||
/**************************************************************************
|
||||
|
||||
Copyright (c) 2005-2013, Silicom
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. 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.
|
||||
|
||||
3. Neither the name of the Silicom nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#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 WD_MIN_TIME_GET(desc) (desc & 0xf)
|
||||
#define WD_STEP_COUNT_GET(desc) (desc>>5) & 0xf
|
||||
#define WDT_STEP_TIME 0x10
|
||||
|
||||
|
||||
struct bp_info {
|
||||
char prod_name[14];
|
||||
unsigned char fw_ver;
|
||||
};
|
||||
|
||||
/**
|
||||
* is_bypass - check if device is a Bypass controlling device
|
||||
* @if_index: network device index
|
||||
*
|
||||
* Output:
|
||||
* 1 - if device is bypass controlling device,
|
||||
* 0 - if device is bypass slave device
|
||||
* -1 - device not support Bypass
|
||||
**/
|
||||
int is_bypass_sd(int if_index);
|
||||
|
||||
/**
|
||||
* get_bypass_slave - get second port participate in the Bypass pair
|
||||
* @if_index: network device index
|
||||
*
|
||||
* Output:
|
||||
* network device index of the slave device
|
||||
* -1 - on failure (device not support Bypass or it's a slave device)
|
||||
**/
|
||||
int get_bypass_slave_sd(int if_index);
|
||||
|
||||
/**
|
||||
* get_bypass_caps - get second port participate in the Bypass pair
|
||||
* @if_index: network device index
|
||||
*
|
||||
* Output:
|
||||
* flags word on success;flag word is a 32-bit mask word with each bit defines different
|
||||
* capability as described bellow.
|
||||
* Value of 1 for supporting this feature. 0 for not supporting this feature.
|
||||
* -1 - on failure (if the device is not capable of the operation or not a Bypass device)
|
||||
* Bit feature description
|
||||
*
|
||||
* 0 BP_CAP The interface is Bypass capable in general
|
||||
*
|
||||
* 1 BP_STATUS_CAP The interface can report of the current Bypass mode
|
||||
*
|
||||
* 2 BP_STATUS_CHANGE_CAP The interface can report on a change to bypass mode from
|
||||
* the last time the mode was defined
|
||||
*
|
||||
* 3 SW_CTL_CAP The interface is Software controlled capable for bypass/non bypass modes.
|
||||
*
|
||||
* 4 BP_DIS_CAP The interface is capable of disabling the Bypass mode at all times.
|
||||
* This mode will retain its mode even during power loss and also after
|
||||
* power recovery. This will overcome on any bypass operation due to
|
||||
* watchdog timeout or set bypass command.
|
||||
*
|
||||
* 5 BP_DIS_STATUS_CAP The interface can report of the current DIS_BP_CAP
|
||||
*
|
||||
* 6 STD_NIC_CAP The interface is capable to be configured to operate as standard, non Bypass,
|
||||
* NIC interface (have direct connection to interfaces at all power modes)
|
||||
*
|
||||
* 7 BP_PWOFF_NO_CAP The interface can be in Bypass mode at power off state
|
||||
*
|
||||
* 8 BP_PWOFF_OFF_CAP The interface can disconnect the Bypass mode at power off state without
|
||||
* effecting all the other states of operation
|
||||
*
|
||||
* 9 BP_PWOFF_CTL_CAP The behavior of the Bypass mode at Power-off state can be controlled by
|
||||
* software without effecting any other state
|
||||
*
|
||||
*10 BP_PWUP_ON_CAP The interface can be in Bypass mode when power is turned on
|
||||
* (until the system take control of the bypass functionality)
|
||||
*
|
||||
*11 BP_PWUP_OFF_CAP The interface can disconnect from Bypass mode when power is turned on
|
||||
* (until the system take control of the bypass functionality)
|
||||
*
|
||||
*12 BP_PWUP_CTL_CAP The behavior of the Bypass mode at Power-up can be controlled by software
|
||||
*
|
||||
*13 WD_CTL_CAP The interface has watchdog capabilities to turn to Bypass mode when not reset
|
||||
* for defined period of time.
|
||||
*
|
||||
*14 WD_STATUS_CAP The interface can report on the watchdog status (Active/inactive)
|
||||
*
|
||||
*15 WD_TIMEOUT_CAP The interface can report the time left till watchdog triggers to Bypass mode.
|
||||
*
|
||||
*16-31 RESERVED
|
||||
*
|
||||
* **/
|
||||
int get_bypass_caps_sd(int if_index);
|
||||
|
||||
/**
|
||||
* get_wd_set_caps - Obtain watchdog timer setting capabilities
|
||||
* @if_index: network device index
|
||||
*
|
||||
* Output:
|
||||
*
|
||||
* Set of numbers defining the various parameters of the watchdog capable
|
||||
* to be set to as described bellow.
|
||||
* -1 - on failure (device not support Bypass or it's a slave device)
|
||||
*
|
||||
* Bit feature description
|
||||
*
|
||||
* 0-3 WD_MIN_TIME The interface WD minimal time period in 100mS units
|
||||
*
|
||||
* 4 WD_STEP_TIME The steps of the WD timer in
|
||||
* 0 - for linear steps (WD_MIN_TIME * X)
|
||||
* 1 - for multiply by 2 from previous step (WD_MIN_TIME * 2^X)
|
||||
*
|
||||
* 5-8 WD_STEP_COUNT Number of steps the WD timer supports in 2^X
|
||||
* (X bit available for defining the value)
|
||||
*
|
||||
*
|
||||
*
|
||||
**/
|
||||
int get_wd_set_caps_sd(int if_index);
|
||||
|
||||
/**
|
||||
* set_bypass - set Bypass state
|
||||
* @if_index: network device index of the controlling device
|
||||
* @bypass_mode: bypass mode (1=on, 0=off)
|
||||
* Output:
|
||||
* 0 - on success
|
||||
* -1 - on failure (device not support Bypass or it's a slave device)
|
||||
**/
|
||||
int set_bypass_sd(int if_index, int bypass_mode);
|
||||
|
||||
/**
|
||||
* get_bypass - Get Bypass mode state
|
||||
* @if_index: network device index of the controlling device
|
||||
* Output:
|
||||
* 0/1 - (off/on) on success
|
||||
* -1 - on failure (device not support Bypass or it's a slave device)
|
||||
**/
|
||||
int get_bypass_sd(int if_index);
|
||||
|
||||
/**
|
||||
* get_bypass_change - Get change of Bypass mode state from last status check
|
||||
* @if_index: network device index of the controlling device
|
||||
* Output:
|
||||
* 0/1 - (off/on) on success
|
||||
* -1 - on failure (device not support Bypass or it's a slave device)
|
||||
**/
|
||||
int get_bypass_change_sd(int if_index);
|
||||
|
||||
/**
|
||||
* set_dis_bypass - Set Disable Bypass mode
|
||||
* @if_index: network device index of the controlling device
|
||||
* @dis_bypass: disable bypass(1=dis, 0=en)
|
||||
* Output:
|
||||
* 0 - on success
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support Bypass
|
||||
* or it's a slave device)
|
||||
**/
|
||||
int set_dis_bypass_sd(int if_index, int dis_bypass);
|
||||
|
||||
/**
|
||||
* get_dis_bypass - Get Disable Bypass mode state
|
||||
* @if_index: network device index of the controlling device
|
||||
* Output:
|
||||
* 0/1 - on success (normal Bypass mode/ Disable bypass)
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support Bypass
|
||||
* or it's a slave device)
|
||||
**/
|
||||
int get_dis_bypass_sd(int if_index);
|
||||
|
||||
/**
|
||||
* set_bypass_pwoff - Set Bypass mode at power-off state
|
||||
* @if_index: network device index of the controlling device
|
||||
* @bypass_mode: bypass mode setting at power off state (1=BP en, 0=BP Dis)
|
||||
* Output:
|
||||
* 0 - on success
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support Bypass
|
||||
* or it's a slave device)
|
||||
**/
|
||||
int set_bypass_pwoff_sd(int if_index, int bypass_mode);
|
||||
|
||||
|
||||
/**
|
||||
* get_bypass_pwoff - Get Bypass mode state at power-off state
|
||||
* @if_index: network device index of the controlling device
|
||||
* Output:
|
||||
* 0/1 - on success (Disable bypass at power off state / normal Bypass mode)
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support Bypass
|
||||
* or it's a slave device)
|
||||
**/
|
||||
int get_bypass_pwoff_sd(int if_index);
|
||||
|
||||
/**
|
||||
* set_bypass_pwup - Set Bypass mode at power-up state
|
||||
* @if_index: network device index of the controlling device
|
||||
* @bypass_mode: bypass mode setting at power up state (1=BP en, 0=BP Dis)
|
||||
* Output:
|
||||
* 0 - on success
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support Bypass
|
||||
* or it's a slave device)
|
||||
**/
|
||||
int set_bypass_pwup_sd(int if_index, int bypass_mode);
|
||||
|
||||
/**
|
||||
* get_bypass_pwup - Get Bypass mode state at power-up state
|
||||
* @if_index: network device index of the controlling device
|
||||
* Output:
|
||||
* 0/1 - on success (Disable bypass at power up state / normal Bypass mode)
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support Bypass
|
||||
* or it's a slave device)
|
||||
**/
|
||||
int get_bypass_pwup_sd(int if_index);
|
||||
|
||||
/**
|
||||
* set_bypass_wd - Set watchdog state
|
||||
* @if_index: network device index of the controlling device
|
||||
* @ms_timeout: requested timeout (in ms units), 0 for disabling the watchdog timer
|
||||
* @ms_timeout_set(output): requested timeout (in ms units),
|
||||
* that the adapter supports and will be used by the watchdog
|
||||
* Output:
|
||||
* 0 - on success
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support Bypass
|
||||
* or it's a slave device)
|
||||
**/
|
||||
int set_bypass_wd_sd(int if_index, int ms_timeout, int *ms_timeout_set);
|
||||
|
||||
/**
|
||||
* get_bypass_wd - Get watchdog state
|
||||
* @if_index: network device index of the controlling device
|
||||
* @ms_timeout (output): WDT timeout (in ms units),
|
||||
* -1 for unknown wdt status
|
||||
* 0 if WDT is disabled
|
||||
* Output:
|
||||
* 0 - on success
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support Bypass
|
||||
* or it's a slave device)
|
||||
**/
|
||||
int get_bypass_wd_sd(int if_index, int *ms_timeout_set);
|
||||
|
||||
/**
|
||||
* get_wd_expire_time - Get watchdog expire
|
||||
* @if_index: network device index of the controlling device
|
||||
* @ms_time_left (output): time left till watchdog time expire,
|
||||
* -1 if WDT has expired
|
||||
* 0 if WDT is disabled
|
||||
* Output:
|
||||
* 0 - on success
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support Bypass
|
||||
* or it's a slave device or unknown wdt status)
|
||||
**/
|
||||
int get_wd_expire_time_sd(int if_index, int *ms_time_left);
|
||||
|
||||
/**
|
||||
* reset_bypass_wd_timer - Reset watchdog timer
|
||||
* @if_index: network device index of the controlling device
|
||||
*
|
||||
* Output:
|
||||
* 1 - on success
|
||||
* 0 - watchdog is not configured
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support Bypass
|
||||
* or it's a slave device or unknown wdt status)
|
||||
**/
|
||||
int reset_bypass_wd_timer_sd(int if_index);
|
||||
|
||||
/**
|
||||
* set_std_nic - Standard NIC mode of operation
|
||||
* @if_index: network device index of the controlling device
|
||||
* @nic_mode: 0/1 (Default Bypass mode / Standard NIC mode)
|
||||
*
|
||||
* Output:
|
||||
* 0 - on success
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support Bypass
|
||||
* or it's a slave device)
|
||||
**/
|
||||
int set_std_nic_sd(int if_index, int nic_mode);
|
||||
|
||||
/**
|
||||
* get_std_nic - Get Standard NIC mode setting
|
||||
* @if_index: network device index of the controlling device
|
||||
*
|
||||
* Output:
|
||||
* 0/1 (Default Bypass mode / Standard NIC mode) on success
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support Bypass
|
||||
* or it's a slave device)
|
||||
**/
|
||||
int get_std_nic_sd(int if_index);
|
||||
|
||||
/**
|
||||
* set_tx - set transmitter enable/disable
|
||||
* @if_index: network device index of the controlling device
|
||||
* @tx_state: 0/1 (Transmit Disable / Transmit Enable)
|
||||
*
|
||||
* Output:
|
||||
* 0 - on success
|
||||
* -1 - on failure (device is not capable of the operation )
|
||||
**/
|
||||
int set_tx_sd(int if_index, int tx_state);
|
||||
|
||||
/**
|
||||
* get_tx - get transmitter state (disable / enable)
|
||||
* @if_index: network device index of the controlling device
|
||||
*
|
||||
* Output:
|
||||
* 0/1 (ransmit Disable / Transmit Enable) on success
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support Bypass)
|
||||
**/
|
||||
int get_tx_sd(int if_index);
|
||||
|
||||
|
||||
/**
|
||||
* set_tpl - set TPL enable/disable
|
||||
* @if_index: network device index of the controlling device
|
||||
* @tx_state: 0/1 (TPL Disable / TPL Enable)
|
||||
*
|
||||
* Output:
|
||||
* 0 - on success
|
||||
* -1 - on failure (device is not capable of the operation )
|
||||
**/
|
||||
int set_tpl_sd(int if_index, int tpl_state);
|
||||
|
||||
/**
|
||||
* get_tpl - get TPL state (disable / enable)
|
||||
* @if_index: network device index of the controlling device
|
||||
*
|
||||
* Output:
|
||||
* 0/1 (TPL Disable / TPL Enable) on success
|
||||
* -1 - on failure (device is not capable of the operation)
|
||||
**/
|
||||
int get_tpl_sd(int if_index);
|
||||
|
||||
|
||||
int get_bp_hw_reset_sd(int if_index);
|
||||
|
||||
int set_bp_hw_reset_sd(int if_index, int status);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* set_tap - set TAP state
|
||||
* @if_index: network device index of the controlling device
|
||||
* @tap_mode: 1 tap mode , 0 normal nic mode
|
||||
* Output:
|
||||
* 0 - on success
|
||||
* -1 - on failure (device not support TAP or it's a slave device)
|
||||
**/
|
||||
int set_tap_sd(int if_index, int tap_mode);
|
||||
|
||||
/**
|
||||
* get_tap - Get TAP mode state
|
||||
* @if_index: network device index of the controlling device
|
||||
* Output:
|
||||
* 0/1 - (off/on) on success
|
||||
* -1 - on failure (device not support TAP or it's a slave device)
|
||||
**/
|
||||
int get_tap_sd(int if_index);
|
||||
|
||||
/**
|
||||
* get_tap_change - Get change of TAP mode state from last status check
|
||||
* @if_index: network device index of the controlling device
|
||||
* Output:
|
||||
* 0/1 - (off/on) on success
|
||||
* -1 - on failure (device not support TAP or it's a slave device)
|
||||
**/
|
||||
int get_tap_change_sd(int if_index);
|
||||
|
||||
/**
|
||||
* set_dis_tap - Set Disable TAP mode
|
||||
* @if_index: network device index of the controlling device
|
||||
* @dis_tap: disable tap(1=dis, 0=en)
|
||||
* Output:
|
||||
* 0 - on success
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support TAP
|
||||
* or it's a slave device)
|
||||
**/
|
||||
int set_dis_tap_sd(int if_index, int dis_tap);
|
||||
|
||||
/**
|
||||
* get_dis_tap - Get Disable TAP mode state
|
||||
* @if_index: network device index of the controlling device
|
||||
* Output:
|
||||
* 0/1 - on success (normal TAP mode/ Disable TAP)
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support TAP
|
||||
* or it's a slave device)
|
||||
**/
|
||||
int get_dis_tap_sd(int if_index);
|
||||
|
||||
/**
|
||||
* set_tap_pwup - Set TAP mode at power-up state
|
||||
* @if_index: network device index of the controlling device
|
||||
* @bypass_mode: tap mode setting at power up state (1=TAP en, 0=TAP Dis)
|
||||
* Output:
|
||||
* 0 - on success
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support TAP
|
||||
* or it's a slave device)
|
||||
**/
|
||||
int set_tap_pwup_sd(int if_index, int tap_mode);
|
||||
|
||||
/**
|
||||
* get_tap_pwup - Get TAP mode state at power-up state
|
||||
* @if_index: network device index of the controlling device
|
||||
* Output:
|
||||
* 0/1 - on success (Disable TAP at power up state / normal TAP mode)
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support TAP
|
||||
* or it's a slave device)
|
||||
**/
|
||||
int get_tap_pwup_sd(int if_index);
|
||||
|
||||
/**
|
||||
* set_wd_exp_mode - Set adapter state when WDT expired.
|
||||
* @if_index: network device index of the controlling device
|
||||
* @bypass_mode: adapter mode (1=tap mode, 0=bypass mode)
|
||||
* Output:
|
||||
* 0 - on success
|
||||
* -1 - on failure (device not support Bypass or it's a slave device)
|
||||
**/
|
||||
int set_wd_exp_mode_sd(int if_index, int bypass_mode);
|
||||
|
||||
/**
|
||||
* get_wd_exp_mode - Get adapter state when WDT expired.
|
||||
* @if_index: network device index of the controlling device
|
||||
* Output:
|
||||
* 0/1 - (bypass/tap) on success
|
||||
* -1 - on failure (device not support Bypass or it's a slave device)
|
||||
**/
|
||||
int get_wd_exp_mode_sd(int if_index);
|
||||
|
||||
/**
|
||||
* set_wd_autoreset - reset WDT periodically.
|
||||
* @if_index: network device index of the controlling device
|
||||
* @bypass_mode: adapter mode (1=tap mode, 0=bypass mode)
|
||||
* Output:
|
||||
* 1 - on success
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support Bypass
|
||||
* or it's a slave device or unknown wdt status)
|
||||
**/
|
||||
int set_wd_autoreset_sd(int if_index, int time);
|
||||
|
||||
/**
|
||||
* set_wd_autoreset - reset WDT periodically.
|
||||
* @if_index: network device index of the controlling device
|
||||
* @bypass_mode: adapter mode (1=tap mode, 0=bypass mode)
|
||||
* Output:
|
||||
* 1 - on success
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support Bypass
|
||||
* or it's a slave device or unknown wdt status)
|
||||
**/
|
||||
int get_wd_autoreset_sd(int if_index);
|
||||
/**
|
||||
* set_disc - set DISC state
|
||||
* @if_index: network device index of the controlling device
|
||||
* @tap_mode: 1 DISC mode , 0 normal nic mode
|
||||
* Output:
|
||||
* 0 - on success
|
||||
* -1 - on failure (device not support disconnect or it's a slave device)
|
||||
**/
|
||||
int set_bp_disc_sd(int if_index, int disc_mode);
|
||||
|
||||
/**
|
||||
* get_disc - Get disc mode state
|
||||
* @if_index: network device index of the controlling device
|
||||
* Output:
|
||||
* 0/1 - (off/on) on success
|
||||
* -1 - on failure (device not support disconnect or it's a slave device)
|
||||
**/
|
||||
int get_bp_disc_sd(int if_index);
|
||||
|
||||
/**
|
||||
* get_disc_change - Get change of DISC mode state from last status check
|
||||
* @if_index: network device index of the controlling device
|
||||
* Output:
|
||||
* 0/1 - (off/on) on success
|
||||
* -1 - on failure (device not support disconnect or it's a slave device)
|
||||
**/
|
||||
int get_bp_disc_change_sd(int if_index);
|
||||
|
||||
/**
|
||||
* set_dis_disc - Set Disable DISC mode
|
||||
* @if_index: network device index of the controlling device
|
||||
* @dis_disc: disable disconnect(1=dis, 0=en)
|
||||
* Output:
|
||||
* 0 - on success
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support DISC
|
||||
* or it's a slave device)
|
||||
**/
|
||||
int set_bp_dis_disc_sd(int if_index, int dis_disc);
|
||||
|
||||
/**
|
||||
* get_dis_disc - Get Disable DISC mode state
|
||||
* @if_index: network device index of the controlling device
|
||||
* Output:
|
||||
* 0/1 - on success (normal DISC mode/ Disable DISC)
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support TAP
|
||||
* or it's a slave device)
|
||||
**/
|
||||
int get_bp_dis_disc_sd(int if_index);
|
||||
|
||||
/**
|
||||
* set_disc_pwup - Set DISC mode at power-up state
|
||||
* @if_index: network device index of the controlling device
|
||||
* @disc_mode: DISC mode setting at power up state (1= en, 0= Dis)
|
||||
* Output:
|
||||
* 0 - on success
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support DISC
|
||||
* or it's a slave device)
|
||||
**/
|
||||
int set_bp_disc_pwup_sd(int if_index, int disc_mode);
|
||||
|
||||
/**
|
||||
* get_disc_pwup - Get DISC mode state at power-up state
|
||||
* @if_index: network device index of the controlling device
|
||||
* Output:
|
||||
* 0/1 - on success (Disable DISC at power up state / normal DISC mode)
|
||||
* -1 - on failure (device is not capable of the operation ordevice not support DISC
|
||||
* or it's a slave device)
|
||||
**/
|
||||
int get_bp_disc_pwup_sd(int if_index);
|
||||
|
||||
|
||||
|
||||
int get_bypass_info_sd(int if_index, struct bp_info *bp_info);
|
||||
int bp_if_scan_sd(void);
|
||||
/*int get_dev_num_sd(void);*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
290
license
Normal file
290
license
Normal file
|
@ -0,0 +1,290 @@
|
|||
|
||||
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
283
readme.txt
Normal file
283
readme.txt
Normal file
|
@ -0,0 +1,283 @@
|
|||
Silicom Linux Bypass-SD Control Utility
|
||||
|
||||
1. Compiling, installing and loading the software.
|
||||
|
||||
Compiling and installing the software in the system directory:
|
||||
# make install
|
||||
|
||||
2. Software loading:
|
||||
# bpctl_start
|
||||
|
||||
3. Using the software.
|
||||
|
||||
3.1 Utility.
|
||||
|
||||
Usage: bpctl_util <if_index|bus:slot.function> <command> [parameters]
|
||||
bpctl_util <info|help>
|
||||
<if_index> - interface name, for example, eth0, or all for all Bypass-SD/TAP-SD Control devices
|
||||
<command> - bypass control command (see Commands List).
|
||||
[parameters] - set_bypass_wd command:
|
||||
WDT timeout interval, msec (0 for disabling WDT).
|
||||
set_bypass/set_bypass_pwoff/set_bypass_pwup/set_dis_bypass commands:
|
||||
on/off for enable/disable Bypass
|
||||
set_std_nic command:
|
||||
on/off for enable/disable Standard NIC mode
|
||||
set_tx command:
|
||||
on/off for enable/disable transmit
|
||||
set_tpl command:
|
||||
on/off for enable/disable TPL
|
||||
set_hw_reset command:
|
||||
on/off for enable/disable hw_reset
|
||||
set_tap/set_tap_pwup/set_dis_tap commands:
|
||||
on/off for enable/disable TAP
|
||||
set_disc/set_disc_pwup/set_dis_disc commands:
|
||||
on/off for enable/disable Disc
|
||||
set_wd_exp_mode command:
|
||||
bypass/tap/disc for bypass/tap/disc mode
|
||||
set_wd_autoreset command:
|
||||
WDT autoreset interval, msec (0 for disabling WDT autoreset).
|
||||
if_scan - refresh the list of network interfaces.
|
||||
info - print Program Information.
|
||||
help - print this message.
|
||||
Commands List:
|
||||
is_bypass - check if device is a Bypass/TAP controlling device
|
||||
get_bypass_slave - get the second port participate in the Bypass/TAP pair
|
||||
get_bypass_caps - obtain Bypass/TAP capabilities information
|
||||
get_wd_set_caps - obtain watchdog timer settings capabilities
|
||||
get_bypass_info - get bypass/TAP info
|
||||
set_bypass - set Bypass mode state
|
||||
get_bypass - get Bypass mode state
|
||||
get_bypass_change - get change of Bypass mode state from last status check
|
||||
set_dis_bypass - set Disable Bypass mode
|
||||
get_dis_bypass - get Disable Bypass mode state
|
||||
set_bypass_pwoff - set Bypass mode at power-off state
|
||||
get_bypass_pwoff - get Bypass mode at power-off state
|
||||
set_bypass_pwup - set Bypass mode at power-up state
|
||||
get_bypass_pwup - get Bypass mode at power-up state
|
||||
set_std_nic - set Standard NIC mode of operation
|
||||
get_std_nic - get Standard NIC mode settings
|
||||
set_bypass_wd - set watchdog state
|
||||
get_bypass_wd - get watchdog state
|
||||
get_wd_time_expire - get watchdog expired time
|
||||
reset_bypass_wd - reset watchdog timer
|
||||
set_tx - set transmit enable / disable
|
||||
get_tx - get transmitter state (enabled / disabled)
|
||||
set_tpl - set TPL enable / disable
|
||||
get_tpl - get TPL state (enabled / disabled)
|
||||
set_hw_reset - set hw_reset enable / disable
|
||||
get_hw_reset - get hw_reset (enabled / disabled)
|
||||
set_tap - set TAP mode state
|
||||
get_tap - get TAP mode state
|
||||
get_tap_change - get change of TAP mode state from last status check
|
||||
set_dis_tap - set Disable TAP mode
|
||||
get_dis_tap - get Disable TAP mode state
|
||||
set_tap_pwup - set TAP mode at power-up state
|
||||
get_tap_pwup - get TAP mode at power-up state
|
||||
set_disc - set Disc mode state
|
||||
get_disc - get Disc mode state
|
||||
get_disc_change - get change of Disc mode state from last status check
|
||||
set_dis_disc - set Disable Disc mode
|
||||
get_dis_disc - get Disable Disc mode state
|
||||
set_disc_pwup - set Disc mode at power-up state
|
||||
get_disc_pwup - get Disc mode at power-up state
|
||||
set_wd_exp_mode - set adapter state when WDT expired
|
||||
get_wd_exp_mode - get adapter state when WDT expired
|
||||
set_wd_autoreset - set WDT autoreset mode
|
||||
get_wd_autoreset - get WDT autoreset mode
|
||||
|
||||
Example: bpctl_util eth0 set_bypass_wd 5000
|
||||
bpctl_util all set_bypass on
|
||||
bpctl_util eth0 set_wd_exp_mode tap
|
||||
bpctl_util 0b:00.0 get_bypass_info
|
||||
|
||||
|
||||
3.2 PROC interface.
|
||||
|
||||
Interaction with bypass functionality is done also through Linux proc interface.
|
||||
After Ethernet driver installation, bypass control commands can be found at folder:
|
||||
|
||||
/proc/net/bypass/bypass_eth#
|
||||
|
||||
|
||||
All the commands are listed below.
|
||||
|
||||
bypass_slave
|
||||
Get the second port participate of the Bypass pair:
|
||||
cat bypass_slave
|
||||
|
||||
bypass_caps
|
||||
Obtain Bypass capabilities information:
|
||||
cat bypass_caps
|
||||
|
||||
wd_set_caps
|
||||
Obtain watchdog timer setting capabilities:
|
||||
cat wd_set_caps
|
||||
|
||||
bypass
|
||||
Set or get Bypass state.
|
||||
Disable Bypass:
|
||||
echo "off" > bypass
|
||||
Enable Bypass:
|
||||
echo "on" > bypass
|
||||
Get Bypass state:
|
||||
cat bypass
|
||||
|
||||
bypass_change
|
||||
Get change of Bypass state from last status check:
|
||||
cat bypass_change
|
||||
|
||||
bypass_wd
|
||||
Set watchdog state.
|
||||
For enable & activate WDT feature please retype:
|
||||
echo "<wdt_timeout(msec)>" > bypass_wd
|
||||
Get watchdog state:
|
||||
cat bypass_wd
|
||||
|
||||
reset_bypass_wd
|
||||
Reset watchdog timer:
|
||||
cat reset_bypass_wd
|
||||
|
||||
wd_expire_time
|
||||
Get watchdog expired time:
|
||||
cat wd_expire_time
|
||||
|
||||
dis_bypass
|
||||
Set or get Disable Bypass mode.
|
||||
Set Disable Bypass mode off:
|
||||
echo "off" > dis_bypass
|
||||
Set Disable Bypass mode on:
|
||||
echo "on" > dis_bypass
|
||||
Get Disable Bypass mode state:
|
||||
cat dis_bypass
|
||||
|
||||
bypass_pwup
|
||||
Set or get Bypass state on power up.
|
||||
Set Enable Bypass on power up:
|
||||
echo "on" > bypass_pwup
|
||||
Set Disable Bypass on power up:
|
||||
echo "off" > bypass_pwup
|
||||
Get Bypass state on power up:
|
||||
cat bypass_pwup
|
||||
|
||||
bypass_pwoff
|
||||
Set or get Bypass state on power off.
|
||||
Set Enable Bypass on power off:
|
||||
echo "on" > bypass_pwoff
|
||||
Set Disable Bypass on power off:
|
||||
echo "off" > bypass_pwoff
|
||||
Get Bypass state on power off:
|
||||
cat bypass_pwoff
|
||||
|
||||
std_nic
|
||||
Set or get Standard NIC mode.
|
||||
Set Standard NIC mode on:
|
||||
echo "on" > std_nic
|
||||
Set Standard NIC mode off:
|
||||
echo "off" > std_nic
|
||||
Get Standard NIC mode:
|
||||
cat std_nic
|
||||
|
||||
tap
|
||||
Set or get TAP state.
|
||||
Disable TAP:
|
||||
echo "off" > tap
|
||||
Enable TAP:
|
||||
echo "on" > tap
|
||||
Get TAP state:
|
||||
cat tap
|
||||
|
||||
tap_change
|
||||
Get change of TAP state from last tap_change status check:
|
||||
cat tap_change
|
||||
|
||||
dis_tap
|
||||
Set or get Disable TAP mode.
|
||||
Set Disable TAP mode off:
|
||||
echo "off" > dis_tap
|
||||
Set Disable TAP mode on:
|
||||
echo "on" > dis_tap
|
||||
Get Disable TAP mode state:
|
||||
cat dis_tap
|
||||
|
||||
tap_pwup
|
||||
Set or get TAP state on power up.
|
||||
Set Enable TAP on power up:
|
||||
echo "on" > tap_pwup
|
||||
Set Disable TAP on power up:
|
||||
echo "off" > tap_pwup
|
||||
Get TAP state on power up:
|
||||
cat tap_pwup
|
||||
|
||||
wd_exp_mode
|
||||
Set or get adapter state when WDT expired.
|
||||
Set TAP when WDT expired:
|
||||
echo "tap" > wd_exp_mode
|
||||
Set Bypass when WDT expired:
|
||||
echo "bypass" > wd_exp_mode
|
||||
Set Disconnect when WDT expired:
|
||||
echo "disc" > wd_exp_mode
|
||||
|
||||
Get adapter state when WDT expired:
|
||||
cat wd_exp_mode
|
||||
|
||||
wd_autoreset
|
||||
Set or get WDT autoreset mode.
|
||||
For setting WDT autoreset mode please retype:
|
||||
echo "<rst_period(msec)>" > wd_autoreset
|
||||
Get WDT autoreset mode state:
|
||||
cat wd_autoreset
|
||||
|
||||
tpl
|
||||
Set or get TPL state.
|
||||
Disable TPL:
|
||||
echo "off" > tpl
|
||||
Enable TPL:
|
||||
echo "on" > tpl
|
||||
Get TPL state:
|
||||
cat tpl
|
||||
|
||||
disc
|
||||
Set or get Disconnect state.
|
||||
Disable Disconnect:
|
||||
echo "off" > disc
|
||||
Enable Disconnect:
|
||||
echo "on" > disc
|
||||
Get Disconnect state:
|
||||
cat disc
|
||||
|
||||
dis_disc
|
||||
Set or get Disable Disconnect mode.
|
||||
Set Disable Disconnect mode off:
|
||||
echo "off" > dis_disc
|
||||
Set Disable Disconnect mode on:
|
||||
echo "on" > dis_disc
|
||||
Get Disable Disconnect mode state:
|
||||
cat dis_disc
|
||||
|
||||
|
||||
disc_pwup
|
||||
Set or get Disconnect state on power up.
|
||||
Set Enable Disconnect on power up:
|
||||
echo "on" > disc_pwup
|
||||
Set Disable Disconnect on power up:
|
||||
echo "off" > disc_pwup
|
||||
Get Disconnect state on power up:
|
||||
cat disc_pwup
|
||||
|
||||
disc_change
|
||||
Get change of Disconnect state from last disc_change status check:
|
||||
cat disc_change
|
||||
|
||||
bypass_info
|
||||
Get detailed info about Bypass device.
|
||||
cat bypass_info
|
||||
|
||||
|
||||
4. Software unloading.
|
||||
|
||||
# bpctl_stop
|
||||
|
||||
5. Uninstall.
|
||||
|
||||
# make uninstall
|
||||
|
449
release.txt
Normal file
449
release.txt
Normal file
|
@ -0,0 +1,449 @@
|
|||
Release Notes
|
||||
Silicom Linux Bypass-SD Control Utility
|
||||
Version 5.0.49
|
||||
17/03/2013
|
||||
v5.0.50
|
||||
- Fixed bypass_caps for sc fiber group.
|
||||
|
||||
v5.0.49
|
||||
- Added
|
||||
M1E2G4BPi35JP,
|
||||
M1E2G4BPi35JP1,
|
||||
PE310G4DBi9T
|
||||
- Changed to BSD license
|
||||
|
||||
v5.0.48
|
||||
- Added
|
||||
M1E2G4BPi35,
|
||||
M1E2G4BPFi35,
|
||||
M1E2G4BPFi35LX,
|
||||
M1E2G4BPFi35ZX,
|
||||
|
||||
v5.0.47
|
||||
- Fixed PEG2BI5SC6 support.
|
||||
|
||||
|
||||
v5.0.46
|
||||
- Fixed bypass_caps for fiber5 group.
|
||||
|
||||
|
||||
v5.0.44
|
||||
- Fixed event notifier.
|
||||
|
||||
v5.0.43
|
||||
- Removed support for M1E10G2BPI9T
|
||||
|
||||
v5.0.42
|
||||
- Added support for M1E210G2BPi40-T
|
||||
|
||||
v5.0.41
|
||||
- Added support for PEG4BPFI6CS.
|
||||
|
||||
v5.0.40.39.1
|
||||
- Some changes for PE2G6BPI6CS & PE2G6BPi35CX.
|
||||
|
||||
v5.0.40.39
|
||||
- Added support for PE2G6BPI6-SD.
|
||||
- Fixed compilation warnings.
|
||||
- Fixed version printout.
|
||||
|
||||
v5.0.40.38
|
||||
- Added support for PE2G6BPI6CS-SD.
|
||||
|
||||
v5.0.40.36
|
||||
- if_scan_init changes.
|
||||
|
||||
v5.0.40.35
|
||||
- Added missed device id for i80, i35, 98, 99 series.
|
||||
|
||||
|
||||
v5.0.40.34
|
||||
- Added support for M6E310G4BPi9SR, M6E310G4BPi9LR.
|
||||
|
||||
v5.0.40.33
|
||||
- Set_tx fixes.
|
||||
|
||||
v5.0.40.32
|
||||
- Added PAC1200BPi35, PE210G2BPI40.
|
||||
- Fixed set_tx for DBI6.
|
||||
|
||||
|
||||
v5.0.40.29
|
||||
- Added device ID for some 99..
|
||||
|
||||
v5.0.40.28
|
||||
- Added PE310G4BPi9T
|
||||
PE310G4BPi9SR
|
||||
PE310G4BPi9LR
|
||||
|
||||
v5.0.40.27
|
||||
- Added PE2G6BPi35
|
||||
|
||||
v5.0.40.26
|
||||
- Some fixes in if_scan_init
|
||||
(problem with bridge).
|
||||
|
||||
|
||||
v5.0.40.25.7
|
||||
- Fixed compilation flags.
|
||||
- Added support for
|
||||
PE2G6BPFi35, PE2G6BPFi35CX.
|
||||
|
||||
|
||||
v5.0.40.25.4
|
||||
- Removed default compilation of DBI-specific command
|
||||
- Removed DBI-specific command for DBI9
|
||||
|
||||
v5.0.40.25.3
|
||||
- Issue with RH6 + proc
|
||||
(crash with load/unload network driver)
|
||||
|
||||
v5.0.40.25.2
|
||||
- Fixed EXTRA_CFLAGS entries.
|
||||
- Removed DBI9-RB cards
|
||||
(the same ID'S as for non-RB)
|
||||
|
||||
|
||||
v5.0.40.25.1
|
||||
- Added DBIspecific commands.
|
||||
|
||||
|
||||
v5.0.40.25
|
||||
- Added support for
|
||||
|
||||
PE2G2BPFi35,
|
||||
PE2G2BPFi35LX,
|
||||
PE2G2BPFi35ZX,
|
||||
PE2G4BPFi35,
|
||||
PE2G4BPFi35LX,
|
||||
PE2G4BPFi35ZX,
|
||||
PE2G2BPi35,
|
||||
PE2G4BPi35L,
|
||||
PE2G4BPi35,
|
||||
M6E2G8BPi80A.
|
||||
|
||||
|
||||
v5.0.40.24
|
||||
- Added support for kernel 3.0.
|
||||
|
||||
v5.0.40.23
|
||||
- Added support for
|
||||
PE210G2DBi9SR,
|
||||
PE210G2DBi9SRRB,
|
||||
PE210G2DBi9LR,
|
||||
PE210G2DBi9LRRB,
|
||||
PE310G4DBi940SR.
|
||||
|
||||
v5.0.40.22
|
||||
- Fixed if_scan_init.
|
||||
|
||||
v5.0.40.21
|
||||
- Removed kernel lock.
|
||||
|
||||
v5.0.40.20
|
||||
- Removed unnecessary printout
|
||||
|
||||
v5.0.40.19
|
||||
- Added PROC interface
|
||||
- Added refreshing network interface list on NETDEV event.
|
||||
|
||||
|
||||
v5.0.40.18
|
||||
- Changes in if_scan_init
|
||||
|
||||
|
||||
v5.0.40.17
|
||||
- Added support for PE2G2BPi80-series adapters.
|
||||
- Added if_scan (refresh network interface list) command.
|
||||
|
||||
v5.0.40.16
|
||||
- Changes in get_dev_idx (compatibility with 3.xx.xx Intel drivers).
|
||||
|
||||
|
||||
v5.0.40.15
|
||||
- Changes in lock (get_bypass_caps).
|
||||
|
||||
|
||||
v5.0.40.14
|
||||
- Changes in lock.
|
||||
- Changed in get_expired_time.
|
||||
|
||||
v5.0.40.11
|
||||
- Fixed TX_CTL for i80.
|
||||
|
||||
|
||||
v5.0.40.10
|
||||
- Added support for M6E2G8BPi80.
|
||||
|
||||
v5.0.40.8
|
||||
- Added support for 2.6.36.
|
||||
|
||||
v5.0.40.7
|
||||
- Added support for hw TX_CTL (copper i80)...
|
||||
|
||||
v5.0.40.6
|
||||
- Fixed get_status for i80 series.
|
||||
|
||||
|
||||
v5.0.40.5
|
||||
- Changed CLK to port 1 for Intel 82599.
|
||||
|
||||
v5.0.40.2
|
||||
- Changed interface for Intel 82599.
|
||||
|
||||
v5.0.40.1
|
||||
- BP_LINK_FAIL compilation switch is ON by default.
|
||||
|
||||
v5.0.40
|
||||
- Added Bypass Link Fail notifier.
|
||||
Under BP_LINK_FAIL compilation switch.
|
||||
Prints bypass/disc (if ON) and WDT expired status on Link Down event.
|
||||
|
||||
v5.0.39.9
|
||||
- Fixed get_bypass_slave for i80
|
||||
- Changed M1E2 names to MxE2.
|
||||
|
||||
v5.0.39.8
|
||||
-Added support for M1E2G4BPFi80-SD
|
||||
M1E2G4BPFi80-LX-SD
|
||||
M1E2G4BPFi80-ZX-SD
|
||||
|
||||
|
||||
v5.0.39.6
|
||||
- Added support for M1E2G4BPi80.
|
||||
|
||||
v5.0.39.5
|
||||
- Added support for PEG2BPFI6FLXM.
|
||||
|
||||
v5.0.39.4
|
||||
- Added support for user-space driver.
|
||||
|
||||
v5.0.38.4
|
||||
- Changed 82599 handling.
|
||||
- Updated MxE-series name.
|
||||
|
||||
v5.0.38.3
|
||||
- Fixed adapter name for PEG2BI5SC6.
|
||||
|
||||
v5.0.38.2
|
||||
- Added support tx_on/off for 82575 copper.
|
||||
- Added supprt for following adapters:
|
||||
M1E10G2BPI9CX4,
|
||||
M1E10G2BPI9SR,
|
||||
M1E10G2BPI9LR,
|
||||
M1E10G2BPI9T,
|
||||
PE210G2BPI9CX4,
|
||||
PE210G2BPI9SR,
|
||||
PE210G2BPI9LR,
|
||||
PE210G2BPI9T,
|
||||
M2EG2BPFI6,
|
||||
M2EG2BPFI6LX,
|
||||
M2EG2BPFI6ZX,
|
||||
M2EG4BPI6,
|
||||
M2EG4BPFI6,
|
||||
M2EG4BPFI6LX,
|
||||
M2EG4BPFI6ZX,
|
||||
M2EG6BPI6,
|
||||
PEG2DBI6,
|
||||
PEG2DBFI6,
|
||||
PEG2DBFI6LX,
|
||||
PEG2DBFI6ZX,
|
||||
MEG2BPI6,
|
||||
XEG2BPI6.
|
||||
|
||||
v5.0.37
|
||||
- Added support for 2.6.32.
|
||||
|
||||
v5.0.36
|
||||
- Added support for M1EG2BPi6-SD, M1EG2BPFi6-SD, M1EG2BPFi6-LX-SD
|
||||
M1EG2BPFi6-ZX-SD, M1EG4BPi6-SD, M1EG4BPFi6-SD, M1EG4BPFi6-LX-SD
|
||||
M1EG4BPFi6-ZX-SD, M1E2G6BPi6-SD.
|
||||
|
||||
v5.0.34d
|
||||
- Added support for 82599 Bypass..
|
||||
|
||||
v5.0.33
|
||||
- Changes in HW handling for 82575/6 fiber.
|
||||
|
||||
v5.0.32
|
||||
- Added support for PE10G2DBILR.
|
||||
|
||||
v5.0.31
|
||||
- Added support for PXEG4BPFI.
|
||||
|
||||
v5.0.30
|
||||
- Added support for PEG2BPFI5, PEG2BPFI5LX.
|
||||
|
||||
v5.0.29
|
||||
- Added support get/set_hw_reset.
|
||||
|
||||
v5.0.28
|
||||
- Fixed memory leak problem in wd_reset_timer.
|
||||
|
||||
v5.0.27
|
||||
- Added support for PEG4BPFI6, PEG4BPFI6LX,
|
||||
PEG4BPFI6ZX, PEG2BPI6, PEG2BPFI6, PEG2BPFI6LX, PEG2BPFI6ZX,
|
||||
PEG4BPI6FC, PEG4BPFI6FC, PEG4BPFI6FCLX, PEG4BPFI6FCZX,
|
||||
PEG6BPI6, MEG2BPI6, XEG2BPI6, MEG4BPI6.
|
||||
|
||||
v5.0.26.1
|
||||
- Added support for PEG4BPI6.
|
||||
|
||||
v5.0.26
|
||||
- Added support for PE10G2BPTLR, PE10G2BPTSR.
|
||||
|
||||
v5.0.25.3
|
||||
- Added support for PE10G2BPTCX4.
|
||||
- PEG6BPI changed to PEG6BPI5.
|
||||
- PE10GDBISR changed to PE10G2DBISR.
|
||||
|
||||
|
||||
v5.0.24
|
||||
- Added support for PEG6BPIFC,
|
||||
- PEG2BPID changed to PEG2BPI5
|
||||
|
||||
v5.0.23
|
||||
- Fixed issue (from 5.0.20 ver) with PEG4BPII0 and 82571 based
|
||||
adapters recognizing.
|
||||
|
||||
v5.0.22
|
||||
- Added support for PEG2BISC6.
|
||||
|
||||
v5.0.21
|
||||
- Added support for XE10G2BPIXR, PE10GDBISR.
|
||||
|
||||
v5.0.20
|
||||
- Added support for PEG4BPIIO.
|
||||
- Fixed bpctl_stop problem (with different
|
||||
PCI device sequence).
|
||||
|
||||
|
||||
v5.0.19
|
||||
- Added support for PEG4BPFI5LX, MEG2BPFILXLN, PEG2BPIX1,
|
||||
MEG2BPFILXNX, XE10G2BPIT, XE10G2BPICX4, XE10G2BPISR,
|
||||
XE10G2BPILR.
|
||||
- Fixed PEG4BPFI5 PID.
|
||||
|
||||
v5.0.18.5
|
||||
- Fixed media type settings (82575 problem).
|
||||
|
||||
v5.0.18.4
|
||||
- Added support for PEG2BPID, PEG4BPFI5, PEG6BPI.
|
||||
|
||||
v5.0.18.3
|
||||
- Fixed CFLAGS problem.
|
||||
|
||||
v5.0.18.1
|
||||
- Added support for 2.6.24.
|
||||
|
||||
v5.0.17
|
||||
- Fixed ID's for MHIO8AD.
|
||||
|
||||
v5.0.16
|
||||
- Added support for PE10G2BPICX4, MHIO8AD.
|
||||
|
||||
v5.0.15
|
||||
- Added support for PEG2BPFIDLX.
|
||||
|
||||
v5.0.14.2
|
||||
- Added support for PE10G2BPISR/LR.
|
||||
|
||||
v5.0.7
|
||||
- Added support for MEG2BPFILN, MEG2BPFINX,
|
||||
PEG4BPFILX.
|
||||
|
||||
v5.0.6
|
||||
- Added support for PEG2BPFID.
|
||||
- Added support for PEG4BPIL.
|
||||
- Fixed get_disc command.
|
||||
- Added support for 2.6.23 kernel.
|
||||
|
||||
v5.0.5
|
||||
- Added support for GET_BST/SET_BST commands.
|
||||
- Fixed get_master_port function.
|
||||
|
||||
|
||||
v5.0.2
|
||||
- Added support for GET/SET_TPL commands and TPL_CAP
|
||||
Note: SET_TX is not supported when TPL is enabled
|
||||
- Getting bypass/tap status w/o serial access
|
||||
- Changed GET_BYPASS_CHANGE/GET_TAP_CHANGE commands
|
||||
- Added support for WAIT_AT_PWUP, HW_RESET commands (with PMC_FIX_FLAG)
|
||||
- Added spin_lock_irqsave (with BP_SYNC_FLAG)
|
||||
- Added support for PXG2TBI, PXG4BPFID, PEG4BPFI, PEG4BPIPT,
|
||||
PXG6BPI, PEG4BPIL, PMCX2BPIN2, PMCX4BPIN2, PMCX2BPI.
|
||||
|
||||
v4.0.1
|
||||
- Added support for PEG2TBFI.
|
||||
- Added support for Disconnect commands.
|
||||
|
||||
v3.0.14.1
|
||||
- Changed output message for get/set_wd_autoreset command.
|
||||
|
||||
v3.0.14
|
||||
- Added support for PXG2BISC1 adapter.
|
||||
- Fixed PMC adapters output product name.
|
||||
|
||||
v3.0.13.2
|
||||
- Fixed specific compilation problem for Nokia kernel
|
||||
|
||||
v3.0.13.1
|
||||
- Added support for PEG4BPII, PEG4BPFII.
|
||||
- Added support for PXG4BPFILX.
|
||||
- Added write flush.
|
||||
|
||||
v3.0.10
|
||||
- Added support for kernel 2.6.18.
|
||||
|
||||
v3.0.9
|
||||
- Fixed get_dev_idx function.
|
||||
|
||||
v3.0.8
|
||||
- Adapters names were changed (from PEG4BPI to PEXG4BPI, from PEG4BPIN to PEG4BPI).
|
||||
- Fixed get_tap_all command (bpctl_util).
|
||||
- Fixed get_bypass_info command.
|
||||
- Fixed TX_CTL_CAP (bpctl_mod).
|
||||
- Fixed output messages (bpctl_util), modinfo (bpctl_mod).
|
||||
|
||||
v3.0.6
|
||||
- Added support for SET/GET_BYPASS_PWROFF commands.
|
||||
|
||||
v3.0.3
|
||||
- Added support for GET_BYPASS_INFO command (for Bypass Kernel Level Library).
|
||||
- Added support for 2.4.x kernels (intermodule communication).
|
||||
- Added support for A7 firmware version (timing, bypass_pwoff command).
|
||||
- Fixed get_wd_set_caps command.
|
||||
- Fixed get_bypass_caps command (bpctl_util).
|
||||
|
||||
v3.0.1
|
||||
- Added support for Bypass Kernel Level Library.
|
||||
|
||||
v2.0.2
|
||||
- Fixed get_wd_expired_time command.
|
||||
- Added support for bypass_info command.
|
||||
- Added support for A6 firmware version (timing).
|
||||
- Added support for PMCXG2BPFI, PMCXG2BPFIN.
|
||||
|
||||
v2.0.1
|
||||
- Fixed get_wd_expired_time command.
|
||||
- Access from several process is permitted for now.
|
||||
|
||||
v2.0.0
|
||||
- Added support for PEG2BPI, PEG4BPIN, PEG2BPFI.
|
||||
- Added support for SET/GET_WD_AUTORESET command.
|
||||
|
||||
v1.0.6
|
||||
- Added support for PEG4BPI.
|
||||
|
||||
v1.0.5
|
||||
- Added support for kernel 2.6.10.
|
||||
- Added support for PXG2BPFILLX.
|
||||
- Fixed set_dis_bypass command.
|
||||
|
||||
v1.0.4
|
||||
- First release of the utility.
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in a new issue