Print this page
    
3014 Intel X540 Support (fix lint)
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/uts/common/io/ixgbe/ixgbe_osdep.h
          +++ new/usr/src/uts/common/io/ixgbe/ixgbe_osdep.h
   1    1  /*
   2    2   * CDDL HEADER START
   3    3   *
   4    4   * The contents of this file are subject to the terms of the
   5    5   * Common Development and Distribution License (the "License").
   6    6   * You may not use this file except in compliance with the License.
   7    7   *
   8    8   * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9    9   * or http://www.opensolaris.org/os/licensing.
  10   10   * See the License for the specific language governing permissions
  11   11   * and limitations under the License.
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright(c) 2007-2010 Intel Corporation. All rights reserved.
  24   24   */
  25   25  
  26   26  /*
  27   27   * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  28   28   */
  29   29  /*
  30   30   * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  31   31   */
  32   32  
  33   33  #ifndef _IXGBE_OSDEP_H
  34   34  #define _IXGBE_OSDEP_H
  35   35  
  36   36  #ifdef __cplusplus
  37   37  extern "C" {
  38   38  #endif
  39   39  
  40   40  #include <sys/types.h>
  41   41  #include <sys/byteorder.h>
  42   42  #include <sys/conf.h>
  43   43  #include <sys/debug.h>
  44   44  #include <sys/stropts.h>
  45   45  #include <sys/stream.h>
  46   46  #include <sys/strlog.h>
  47   47  #include <sys/kmem.h>
  48   48  #include <sys/stat.h>
  49   49  #include <sys/kstat.h>
  50   50  #include <sys/modctl.h>
  51   51  #include <sys/errno.h>
  52   52  #include <sys/ddi.h>
  53   53  #include <sys/dditypes.h>
  54   54  #include <sys/sunddi.h>
  55   55  #include <sys/pci.h>
  56   56  #include <sys/atomic.h>
  57   57  #include <sys/note.h>
  58   58  #include "ixgbe_debug.h"
  59   59  
  60   60  /* Cheesy hack for EWARN() */
  61   61  #define EWARN(H, W, S) cmn_err(CE_NOTE, W)
  62   62  
  63   63  /* function declarations */
  64   64  struct ixgbe_hw;
  65   65  uint16_t ixgbe_read_pci_cfg(struct ixgbe_hw *, uint32_t);
  66   66  void ixgbe_write_pci_cfg(struct ixgbe_hw *, uint32_t, uint32_t);
  67   67  
  68   68  #define usec_delay(x)           drv_usecwait(x)
  69   69  #define msec_delay(x)           drv_usecwait(x * 1000)
  70   70  
  71   71  #define OS_DEP(hw)              ((struct ixgbe_osdep *)((hw)->back))
  72   72  
  73   73  #define false           B_FALSE
  74   74  #define true            B_TRUE
  75   75  #define FALSE           B_FALSE
  76   76  #define TRUE            B_TRUE
  77   77  
  78   78  #define IXGBE_READ_PCIE_WORD    ixgbe_read_pci_cfg
  79   79  #define IXGBE_WRITE_PCIE_WORD   ixgbe_write_pci_cfg
  80   80  #define CMD_MEM_WRT_INVALIDATE  0x0010  /* BIT_4 */
  81   81  #define PCI_COMMAND_REGISTER    0x04
  82   82  #define PCI_EX_CONF_CAP         0xE0
  83   83  #define SPEED_10GB              10000
  84   84  #define SPEED_1GB               1000
  85   85  #define SPEED_100               100
  86   86  #define FULL_DUPLEX             2
  87   87  
  88   88  #define IXGBE_WRITE_FLUSH(a)    (void) IXGBE_READ_REG(a, IXGBE_STATUS)
  89   89  
  90   90  #define IXGBE_WRITE_REG(a, reg, value)  \
  91   91          ddi_put32((OS_DEP(a))->reg_handle, \
  92   92              (uint32_t *)((uintptr_t)(a)->hw_addr + reg), (value))
  93   93  
  94   94  #define IXGBE_WRITE_REG_ARRAY(a, reg, index, value)     \
  95   95          IXGBE_WRITE_REG(a, ((reg) + ((index) << 2)), (value))
  96   96  
  97   97  #define IXGBE_READ_REG(a, reg)  \
  98   98          ddi_get32((OS_DEP(a))->reg_handle, \
  99   99              (uint32_t *)((uintptr_t)(a)->hw_addr + reg))
 100  100  
 101  101  #define IXGBE_READ_REG_ARRAY(a, reg, index)     \
 102  102          IXGBE_READ_REG(a, ((reg) + ((index) << 2)))
 103  103  
  
    | 
      ↓ open down ↓ | 
    103 lines elided | 
    
      ↑ open up ↑ | 
  
 104  104  #define msec_delay_irq  msec_delay
 105  105  #define IXGBE_HTONL     htonl
 106  106  #define IXGBE_NTOHL     ntohl
 107  107  #define IXGBE_NTOHS     ntohs
 108  108  
 109  109  #ifdef _BIG_ENDIAN
 110  110  #define IXGBE_CPU_TO_LE32       BSWAP_32 
 111  111  #define IXGBE_LE32_TO_CPUS      BSWAP_32
 112  112  #else
 113  113  #define IXGBE_CPU_TO_LE32(x)    (x)
      114 +#if lint
      115 +/* Use lint-happy operation... */
      116 +#define IXGBE_LE32_TO_CPUS(x)
      117 +#else
 114  118  #define IXGBE_LE32_TO_CPUS(x)   (x) 
      119 +#endif /* lint */
 115  120  #endif  /* _BIG_ENDIAN */
 116  121  
 117  122  #define UNREFERENCED_PARAMETER(x)               _NOTE(ARGUNUSED(x))
 118  123  #define UNREFERENCED_1PARAMETER(_p)             UNREFERENCED_PARAMETER(_p)
 119  124  #define UNREFERENCED_2PARAMETER(_p, _q)         _NOTE(ARGUNUSED(_p, _q))
 120  125  #define UNREFERENCED_3PARAMETER(_p, _q, _r)     _NOTE(ARGUNUSED(_p, _q, _r))
 121  126  #define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) _NOTE(ARGUNUSED(_p, _q,_r, _s))
 122  127  
 123  128  
 124  129  
 125  130  typedef int8_t          s8;
 126  131  typedef int16_t         s16;
 127  132  typedef int32_t         s32;
 128  133  typedef int64_t         s64;
 129  134  typedef uint8_t         u8;
 130  135  typedef uint16_t        u16;
 131  136  typedef uint32_t        u32;
 132  137  typedef uint64_t        u64;
 133  138  typedef boolean_t       bool;
 134  139  
 135  140  struct ixgbe_osdep {
 136  141          ddi_acc_handle_t reg_handle;
 137  142          ddi_acc_handle_t cfg_handle;
 138  143          struct ixgbe *ixgbe;
 139  144  };
 140  145  
 141  146  #ifdef __cplusplus
 142  147  }
 143  148  #endif
 144  149  
 145  150  #endif  /* _IXGBE_OSDEP_H */
  
    | 
      ↓ open down ↓ | 
    21 lines elided | 
    
      ↑ open up ↑ | 
  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX