Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2)  *  linux/drivers/message/fusion/mptlan.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *      IP Over Fibre Channel device driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *      For use with LSI Fibre Channel PCI chip/adapters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *      running LSI Fusion MPT (Message Passing Technology) firmware.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *  Copyright (c) 2000-2008 LSI Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *  (mailto:DL-MPTFusionLinux@lsi.com)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)     This program is free software; you can redistribute it and/or modify
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)     it under the terms of the GNU General Public License as published by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15)     the Free Software Foundation; version 2 of the License.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)     This program is distributed in the hope that it will be useful,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)     but WITHOUT ANY WARRANTY; without even the implied warranty of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)     GNU General Public License for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)     NO WARRANTY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)     THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)     CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)     LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)     MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)     solely responsible for determining the appropriateness of using and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)     distributing the Program and assumes all risks associated with its
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)     exercise of rights under this Agreement, including but not limited to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)     the risks and costs of program errors, damage to or loss of data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31)     programs or equipment, and unavailability or interruption of operations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33)     DISCLAIMER OF LIABILITY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)     NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35)     DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)     DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37)     ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38)     TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39)     USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40)     HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)     You should have received a copy of the GNU General Public License
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)     along with this program; if not, write to the Free Software
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) /* mptlan.h */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) #ifndef LINUX_MPTLAN_H_INCLUDED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) #define LINUX_MPTLAN_H_INCLUDED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) /*****************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) #if !defined(__GENKSYMS__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) #include <linux/netdevice.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) #include <linux/errno.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) // #include <linux/etherdevice.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) #include <linux/fcdevice.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) // #include <linux/fddidevice.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) #include <linux/skbuff.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) #include <linux/if_arp.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) #include <linux/printk.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) #include <linux/spinlock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) #include <linux/workqueue.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) #include <linux/delay.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) #include <linux/uaccess.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) #include <asm/io.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76)     /* Override mptbase.h by pre-defining these! */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) #define MODULEAUTHOR	"LSI Corporation"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) #include "mptbase.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) /*****************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) #define LANAME		"Fusion MPT LAN driver"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) #define LANVER		MPT_LINUX_VERSION_COMMON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) #ifdef MODULE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) MODULE_AUTHOR(MODULEAUTHOR);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) MODULE_DESCRIPTION(LANAME);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) /*****************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) #define MPT_LAN_MAX_BUCKETS_OUT 256
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) #define MPT_LAN_BUCKET_THRESH	18 /* 9 buckets in one message */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) #define MPT_LAN_BUCKETS_REMAIN_MISMATCH_THRESH 10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) #define MPT_LAN_RX_COPYBREAK	200
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) #define MPT_LAN_TX_TIMEOUT	(1*HZ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) #define MPT_TX_MAX_OUT_LIM      127
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) #define MPT_LAN_MIN_MTU		96		/* RFC2625 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) #define MPT_LAN_MAX_MTU		65280		/* RFC2625 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) #define MPT_LAN_MTU             13312		/* Max perf range + lower mem
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 						   usage than 16128 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) #define MPT_LAN_NAA_RFC2625     0x1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) #define MPT_LAN_NAA_QLOGIC      0x2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) /* MPT LAN Reset and Suspend Resource Flags Defines */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) #define MPT_LAN_RESOURCE_FLAG_RETURN_POSTED_BUCKETS    0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) #define MPT_LAN_RESOURCE_FLAG_RETURN_PEND_TRANSMITS    0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) /*****************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) #ifdef MPT_LAN_IO_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) #define dioprintk(x)  printk x
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) #define dioprintk(x)  no_printk x
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) #ifdef MPT_LAN_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) #define dlprintk(x)  printk x
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) #define dlprintk(x)  no_printk x
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) #define NETDEV_TO_LANPRIV_PTR(d)	((struct mpt_lan_priv *)netdev_priv(d))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) #define NETDEV_PTR_TO_IOC_NAME_s(d)	(NETDEV_TO_LANPRIV_PTR(d)->mpt_dev->name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) #define IOC_AND_NETDEV_NAMES_s_s(d)	NETDEV_PTR_TO_IOC_NAME_s(d), (d)->name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) /*****************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)