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

📄 xp_osi.c

📁 IBM source for pallas/vulcan/vesta
💻 C
📖 第 1 页 / 共 3 页
字号:
/*----------------------------------------------------------------------------+|       This source code has been made available to you by IBM on an AS-IS|       basis.  Anyone receiving this source is licensed under IBM|       copyrights to use it in any way he or she deems fit, including|       copying it, modifying it, compiling it, and redistributing it either|       with or without modifications.  No license under IBM patents or|       patent applications is to be implied by the copyright license.||       Any user of this software should understand that IBM cannot provide|       technical support for this software and will not be responsible for|       any consequences resulting from the use of this software.||       Any person who transfers this source code or any derivative work|       must include the IBM copyright notice, this paragraph, and the|       preceding two paragraphs in the transferred software.||       COPYRIGHT   I B M   CORPORATION 1998|       LICENSED MATERIAL  -  PROGRAM PROPERTY OF I B M+----------------------------------------------------------------------------*//*----------------------------------------------------------------------------+||   Author    :  Ian Govett|   Component :  xp|   File      :  xp.c|   Purpose   :  Initialization functions|   Changes   :||   Date       By   Comments|   ---------  ---  -------------------------------------------------------|   15-Jan-98       Created|   04-May-01       Updated for Pallas|   30-Sep-01  LGH  Combined codes of 3 devices, ported to Linux+----------------------------------------------------------------------------*//*----------------------------------------------------------------------------+|                   Hardware and Software initialization+----------------------------------------------------------------------------*//*----------------------------------------------------------------------------+||   The following functions provide initialization routines for both the|   transport demux driver, and the hardware.  xp0_init() is called to|   initialize the driver and transport hardware.  The calling program must|   supply the amount of memory reserved for the transport demux queues.|   The space may be allocated on the heap (using malloc) or allocated via|   a predetermined memory map.  The queue address must be aligned on a|   16 MByte boundary if the pre-assigned address is used (queue_mode=0).||   The error codes for all transport demux errors are mapped to a text|   description using the xp0_get_error_msg() function.|+----------------------------------------------------------------------------*/#include <linux/config.h>#include <linux/version.h>#ifdef MODVERSIONS#include <linux/modversions.h>#endif#define  __NO_VERSION__#include <linux/module.h>#include <linux/kernel.h>#include <linux/types.h>#include "hw/hardware.h"#include "xp_osi_global.h"#include "xp_atom_reg.h"/*----------------------------------------------------------------------------+|  Static Variables+----------------------------------------------------------------------------*/static ULONG ulSavedCtlReg;/*----------------------------------------------------------------------------+|  Configuration Values+----------------------------------------------------------------------------*/static XP_CONFIG_VALUES  xp0_configv;static XP_CONFIG_VALUES  xp0_configv_reset = {                                            /* CONFIG REGISTER 1 VALUES      */      0,                                    /*    denbl                      */      0,                                    /*    vpu                        */      0,                                    /*    apu                        */      0,                                    /*    tstoe                      */      0,                                    /*    tsclkp                     */      0,                                    /*    tsdp                       */      0,                                    /*    tssp                       */      0,                                    /*    tsep                       */      0,                                    /*    tsvp                       */      0,                                    /*    tssm                       */      0,                                    /*    syncd                      */      0,                                    /*    bbmode                     */      2,                                    /*    syncl                      */                                            /* CONFIG REGISTER 2 VALUES      */      0,                                    /*    ved                        */      0,                                    /*    acpm                       */      0,                                    /*    vcpm                       */      1,                                    /*    mwe                        */      1,                                    /*    salign                     */      0,                                    /*    atsed                      */      0,                                    /*    atbd                       */      0,                                    /*    accd                       */      0,                                    /*    vtsed                      */      0,                                    /*    vtbd                       */      0,                                    /*    vccd                       */                                            /* CONFIG REGISTER 3 VALUES      */#ifndef __DRV_FOR_VESTA__      XP_CONFIG3_INSEL_CI0,                 /*    insel                      */#else      0,#endif                                            /* CONTROL REGISTER 1 VALUES     */      0,                                    /*    sbe                        */      0,                                    /*    pbe                        */      1,                                    /*    senbl                      */      0,                                    /*    sdop                       */                                            /* PACKET BUF LEVEL REG VALUES   */      0x8,                                  /*    qpthres                    */      0x4,                                  /*    apthres                    */      0x8                                   /*    vpthres                    */};static XP_CONFIG_VALUES  xp1_configv;static XP_CONFIG_VALUES  xp1_configv_reset = {                                            /* CONFIG REGISTER 1 VALUES      */      0,                                    /*    resv                       */      0,                                    /*    resv                       */      0,                                    /*    resv                       */      0,                                    /*    resv                       */      0,                                    /*    tsclkp                     */      0,                                    /*    tsdp                       */      0,                                    /*    tssp                       */      0,                                    /*    tsep                       */      0,                                    /*    tsvp                       */      0,                                    /*    tssm                       */      0,                                    /*    syncd                      */      0,                                    /*    bbmode                     */      2,                                    /*    syncl                      */                                            /* CONFIG REGISTER 2 VALUES      */      0,                                    /*    resv                       */      0,                                    /*    resv                       */      0,                                    /*    resv                       */      1,                                    /*    mwe                        */      1,                                    /*    salign                     */      0,                                    /*    resv                       */      0,                                    /*    resv                       */      0,                                    /*    resv                       */      0,                                    /*    resv                       */      0,                                    /*    resv                       */      0,                                    /*    resv                       */                                            /* CONFIG REGISTER 3 VALUES      */#ifndef __DRV_FOR_VESTA__      XP_CONFIG3_INSEL_CI0,                 /*    insel                      */#else      0,#endif                                            /* CONTROL REGISTER 1 VALUES     */      0,                                    /*    sbe                        */      0,                                    /*    pbe                        */      1,                                    /*    senbl                      */      0,                                    /*    sdop                       */                                            /* PACKET BUF LEVEL REG VALUES   */      0x0,                                  /*    resv                       */      0x0,                                  /*    resv                       */      0x0                                   /*    resv                       */};static XP_CONFIG_VALUES  xp2_configv;static XP_CONFIG_VALUES  xp2_configv_reset = {                                            /* CONFIG REGISTER 1 VALUES      */      0,                                    /*    resv                       */      0,                                    /*    resv                       */      0,                                    /*    resv                       */      0,                                    /*    resv                       */      0,                                    /*    tsclkp                     */      0,                                    /*    tsdp                       */      0,                                    /*    tssp                       */      0,                                    /*    tsep                       */      0,                                    /*    tsvp                       */      0,                                    /*    tssm                       */      0,                                    /*    syncd                      */      0,                                    /*    bbmode                     */      2,                                    /*    syncl                      */                                            /* CONFIG REGISTER 2 VALUES      */      0,                                    /*    resv                       */      0,                                    /*    resv                       */      0,                                    /*    resv                       */      1,                                    /*    mwe                        */      1,                                    /*    salign                     */      0,                                    /*    resv                       */      0,                                    /*    resv                       */      0,                                    /*    resv                       */      0,                                    /*    resv                       */      0,                                    /*    resv                       */      0,                                    /*    resv                       */                                            /* CONFIG REGISTER 3 VALUES      */#ifndef __DRV_FOR_VESTA__      XP_CONFIG3_INSEL_CI0,                 /*    insel                      */#else      0,#endif                                            /* CONTROL REGISTER 1 VALUES     */      0,                                    /*    sbe                        */      0,                                    /*    pbe                        */      1,                                    /*    senbl                      */      0,                                    /*    sdop                       */                                            /* PACKET BUF LEVEL REG VALUES   */      0x0,                                  /*    resv                       */      0x0,                                  /*    resv                       */      0x0                                   /*    resv                       */};/*----------------------------------------------------------------------------+| XXXX   XX   XX   XXXXXX  XXXXXXX  XXXXXX   XX   XX     XX    XXXX|  XX    XXX  XX   X XX X   XX   X   XX  XX  XXX  XX    XXXX    XX|  XX    XXXX XX     XX     XX X     XX  XX  XXXX XX   XX  XX   XX|  XX    XX XXXX     XX     XXXX     XXXXX   XX XXXX   XX  XX   XX|  XX    XX  XXX     XX     XX X     XX XX   XX  XXX   XXXXXX   XX|  XX    XX   XX     XX     XX   X   XX  XX  XX   XX   XX  XX   XX  XX| XXXX   XX   XX    XXXX   XXXXXXX  XXX  XX  XX   XX   XX  XX  XXXXXXX+----------------------------------------------------------------------------*//*----------------------------------------------------------------------------+|  trans_get_configure+----------------------------------------------------------------------------*/static void trans_get_configure(GLOBAL_RESOURCES *pGlobal){    XP_CONFIG1_REG     config1;    XP_CONFIG2_REG     config2;#ifndef __DRV_FOR_VESTA__    XP_CONFIG3_REG     config3;#endif    XP_CONTROL1_REG    control1;    XP_PBUFLVL_REG     pbuflvl;    XP_CONFIG_VALUES   *pXpConfigv = NULL;    UINT32             flag;    /*-----------------------------------------------------------------------+    |  Get Configuration Values for specified Transport    +------------------------------------------------------------------------*/    switch(pGlobal->uDeviceIndex)    {      case 0:          pXpConfigv = &xp0_configv;          break;      case 1:

⌨️ 快捷键说明

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