⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qla1280.h

📁 linux和2410结合开发 用他可以生成2410所需的zImage文件
💻 H
📖 第 1 页 / 共 5 页
字号:
/************************************************************************* *                  QLOGIC LINUX SOFTWARE * * QLogic ISP1x80/1x160 device driver for Linux 2.3.x (redhat 6.x). * * COPYRIGHT (C) 1996-2000 QLOGIC CORPORATION     * * This program is free software; you can redistribute it and/or modify * it under the terms of the Qlogic's Linux Software License. * * This program is WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistribution's or source code must retain the above copyright *    notice, this list of conditions, and the following disclaimer, *    without modification, immediately at the beginning of the file. * 2. The name of the author may not be used to endorse or promote products *    derived from this software without specific prior written permission. * *****************************************************************************/ /*************************************************************************************			QLOGIC CORPORATION SOFTWARE           "GNU" GENERAL PUBLIC LICENSE    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION                 AND MODIFICATIONThis GNU General Public License ("License") applies solely to QLogic Linux Software ("Software") and may be distributed under the terms of this License.   1. You may copy and distribute verbatim copies of the Software'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 anywarranty; and give any other recipients of the Software a copy of this License alongwith the Software. You may charge a fee for the physical act of transferring a copy, and you may at youroption offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Software or any portion of it, thus forminga work based on the Software, and copy and distribute such modifications or work underthe 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 youchanged the files and the date of any change. * b) You must cause any work that you distribute or publish that in whole or in partcontains or is derived from the Software or any part thereof, to be licensed as awhole at no charge to all third parties under the terms of this License. * c) If the modified Software normally reads commands interactively when run, youmust 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 thatusers may redistribute the Software under these conditions, and telling the user how toview a copy of this License. (Exception:if the Software itself is interactive but does not normally print such an announcement, your work based on the Software is not requiredto print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections ofthat work are not derived from the Software, and can be reasonably considered independentand separate works in themselves, then this License, and its terms, do not apply to thosesections when you distribute them as separate works. But when you distribute the samesections as part of a whole which is a work based on the Software, the distribution of thewhole must be on the terms of this License, whose permissions for other licensees extendto the entire whole, and thus to each and every part regardless of who wrote it. 3. You may copy and distribute the Software (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 thatyou also do one of the following: * a) Accompany it with the complete corresponding machine-readable source code, which mustbe distributed under the terms of Sections 1 and 2 above on a medium customarily used forsoftware interchange; or, * b) Accompany it with a written offer, valid for at least three years, to give any thirdparty, 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 underthe 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 distributionand only if you received the Software 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 modificationsto 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 usedto control compilation and installation of 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 sameplace 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 Software except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Software is void, and will automatically terminate your rights under thisLicense. However, parties who have received copies, or rights, from you under this Licensewill not have their licenses terminated so long as such parties remain in full compliance. 5. This license grants you world wide, royalty free non-exclusive rights to modify or distribute the Software or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Software(or any work based on the Software), you indicate your acceptance of this License to doso, and all its terms and conditions for copying, distributing or modifying the Softwareor works based on it. 6. Each time you redistribute the Software (or any work based on the Software), the recipient automatically receives a license from the original licensor to copy, distributeor modify the Software subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You arenot 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 forany other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of thisLicense, 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 theSoftware at all.    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 wholeis intended to apply in other circumstances. NO WARRANTY11. THE SOFTWARE IS PROVIDED WITHOUT A WARRANTY OF ANY KIND. THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "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 SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE 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 SOFTWARE 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 SOFTWARE (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 SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARES), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS *************************************************************************************/  #ifndef _IO_HBA_QLA1280_H           /* wrapper symbol for kernel use */#define _IO_HBA_QLA1280_H           /* subject to change without notice */#if defined(__cplusplus)extern "C" {#endif#include <linux/version.h>/* * Enable define statement to ignore Data Underrun Errors, * remove define statement to enable detection. *//* #define  DATA_UNDERRUN_ERROR_DISABLE *//* * Driver debug definitions. *//* #define QL_DEBUG_LEVEL_1 */       /* Output register accesses to COM2. *//* #define QL_DEBUG_LEVEL_2 */           /* Output error msgs to COM2. *//* #define QL_DEBUG_LEVEL_3 */          /* Output function trace msgs to COM2. *//* #define QL_DEBUG_LEVEL_4 */       /* Output NVRAM trace msgs to COM2. *//* #define QL_DEBUG_LEVEL_5 */         /* Output ring trace msgs to COM2. *//* #define QL_DEBUG_LEVEL_6 */      /* Output WATCHDOG timer trace to COM2. *//* #define QL_DEBUG_LEVEL_7 */      /* Output RISC load trace msgs to COM2. */#define QL_DEBUG_CONSOLE              /* Output to console instead of COM2. */#ifndef TRUE#  define TRUE 1#endif#ifndef FALSE#  define FALSE 0#endif#ifndef KERNEL_VERSION#  define KERNEL_VERSION(x,y,z) (((x)<<16)+((y)<<8)+(z))#endif#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,1,92)#  if defined(__sparc_v9__) || defined(__powerpc__)#    error "PPC and Sparc platforms are only support under 2.1.92 and above"#  endif#endif/*  * Locking */#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,0)#  include <linux/spinlock.h>#  include <linux/smp.h>#  define cpuid smp_processor_id()#  if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95)#    define DRIVER_LOCK_INIT \       spin_lock_init(&ha->spin_lock);#    define DRIVER_LOCK \       if(!ha->cpu_lock_count[cpuid]) { \         spin_lock_irqsave(&ha->spin_lock, cpu_flags); \         ha->cpu_lock_count[cpuid]++; \       } else { \         ha->cpu_lock_count[cpuid]++; \       }#    define DRIVER_UNLOCK \       if(--ha->cpu_lock_count[cpuid] == 0) \         spin_unlock_irqrestore(&ha->spin_lock, cpu_flags);#  else#    define DRIVER_LOCK_INIT#    define DRIVER_LOCK#    define DRIVER_UNLOCK#  endif #else#  define cpuid 0#  define DRIVER_LOCK_INIT#  define DRIVER_LOCK \       save_flags(cpu_flags); \       cli();#  define DRIVER_UNLOCK \       restore_flags(cpu_flags);#  define le32_to_cpu(x) (x)#  define cpu_to_le32(x) (x)#endif/* * Data bit definitions. */#define BIT_0   0x1#define BIT_1   0x2#define BIT_2   0x4#define BIT_3   0x8#define BIT_4   0x10#define BIT_5   0x20#define BIT_6   0x40#define BIT_7   0x80#define BIT_8   0x100#define BIT_9   0x200#define BIT_10  0x400#define BIT_11  0x800#define BIT_12  0x1000#define BIT_13  0x2000#define BIT_14  0x4000#define BIT_15  0x8000#define BIT_16  0x10000#define BIT_17  0x20000#define BIT_18  0x40000#define BIT_19  0x80000#define BIT_20  0x100000#define BIT_21  0x200000#define BIT_22  0x400000#define BIT_23  0x800000#define BIT_24  0x1000000#define BIT_25  0x2000000#define BIT_26  0x4000000#define BIT_27  0x8000000#define BIT_28  0x10000000#define BIT_29  0x20000000#define BIT_30  0x40000000#define BIT_31  0x80000000/* * Common size type definitions */#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0)typedef unsigned char  uint8_t; typedef unsigned short uint16_t; typedef unsigned long  uint32_t; typedef char  int8_t; typedef short int16_t; typedef long  int32_t; #endif/* *  Local Macro Definitions. */#if defined(QL_DEBUG_LEVEL_1) || defined(QL_DEBUG_LEVEL_2) || \    defined(QL_DEBUG_LEVEL_3) || defined(QL_DEBUG_LEVEL_4) || \    defined(QL_DEBUG_LEVEL_5) || defined(QL_DEBUG_LEVEL_6) || \    defined(QL_DEBUG_LEVEL_7)    #define QL_DEBUG_ROUTINES#endif/* * I/O port macros*/#define LINUX_IOPORTS                     /* Linux in/out routines are define*/                                          /* differently from other OSs      *//* #define MEMORY_MAPPED_IO */            /* Enable memory mapped I/O */#undef MEMORY_MAPPED_IO            /* Disable memory mapped I/O */#ifdef QL_DEBUG_LEVEL_1#define RD_REG_BYTE(addr)         qla1280_getbyte((uint8_t *)addr)#define RD_REG_WORD(addr)         qla1280_getword((uint16_t *)addr)#define RD_REG_DWORD(addr)        qla1280_getdword((uint32_t *)addr)#define WRT_REG_BYTE(addr, data)  qla1280_putbyte((uint8_t *)addr, data)#define WRT_REG_WORD(addr, data)  qla1280_putword((uint16_t *)addr, data)#define WRT_REG_DWORD(addr, data) qla1280_putdword((uint32_t *)addr, data)#else  /* QL_DEBUG_LEVEL_1 */#ifdef MEMORY_MAPPED_IO       #define RD_REG_BYTE(addr)         readb((unsigned long) (addr)       #define RD_REG_WORD(addr)         readw((unsigned long) (addr)       #define RD_REG_DWORD(addr)        readl((unsigned long) (addr)       #define WRT_REG_BYTE(addr, data)  writeb((data), (unsigned long) (addr))       #define WRT_REG_WORD(addr, data)  writew((data), (unsigned long) (addr))

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -