Print this page
    
XXXX Intel X540 support
    
      
        | 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   *
  
    | 
      ↓ open down ↓ | 
    18 lines elided | 
    
      ↑ open up ↑ | 
  
  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 +/*
       30 + * Copyright (c) 2012, Joyent, Inc. All rights reserved.
       31 + */
  29   32  
  30   33  #ifndef _IXGBE_OSDEP_H
  31   34  #define _IXGBE_OSDEP_H
  32   35  
  33   36  #ifdef __cplusplus
  34   37  extern "C" {
  35   38  #endif
  36   39  
  37   40  #include <sys/types.h>
  38   41  #include <sys/byteorder.h>
  39   42  #include <sys/conf.h>
  40   43  #include <sys/debug.h>
  41   44  #include <sys/stropts.h>
  42   45  #include <sys/stream.h>
  43   46  #include <sys/strlog.h>
  44   47  #include <sys/kmem.h>
  45   48  #include <sys/stat.h>
  46   49  #include <sys/kstat.h>
  
    | 
      ↓ open down ↓ | 
    8 lines elided | 
    
      ↑ open up ↑ | 
  
  47   50  #include <sys/modctl.h>
  48   51  #include <sys/errno.h>
  49   52  #include <sys/ddi.h>
  50   53  #include <sys/dditypes.h>
  51   54  #include <sys/sunddi.h>
  52   55  #include <sys/pci.h>
  53   56  #include <sys/atomic.h>
  54   57  #include <sys/note.h>
  55   58  #include "ixgbe_debug.h"
  56   59  
       60 +/* Cheesy hack for EWARN() */
       61 +#define EWARN(H, W, S) printf(W)
       62 +
  57   63  /* function declarations */
  58   64  struct ixgbe_hw;
  59   65  uint16_t ixgbe_read_pci_cfg(struct ixgbe_hw *, uint32_t);
  60   66  void ixgbe_write_pci_cfg(struct ixgbe_hw *, uint32_t, uint32_t);
  61   67  
  62   68  #define usec_delay(x)           drv_usecwait(x)
  63   69  #define msec_delay(x)           drv_usecwait(x * 1000)
  64   70  
  65   71  #define OS_DEP(hw)              ((struct ixgbe_osdep *)((hw)->back))
  66   72  
  67   73  #define false           B_FALSE
  68   74  #define true            B_TRUE
  69   75  #define FALSE           B_FALSE
  70   76  #define TRUE            B_TRUE
  71   77  
  72   78  #define IXGBE_READ_PCIE_WORD    ixgbe_read_pci_cfg
  73   79  #define IXGBE_WRITE_PCIE_WORD   ixgbe_write_pci_cfg
  74   80  #define CMD_MEM_WRT_INVALIDATE  0x0010  /* BIT_4 */
  75   81  #define PCI_COMMAND_REGISTER    0x04
  76   82  #define PCI_EX_CONF_CAP         0xE0
  77   83  #define SPEED_10GB              10000
  78   84  #define SPEED_1GB               1000
  79   85  #define SPEED_100               100
  80   86  #define FULL_DUPLEX             2
  81   87  
  82   88  #define IXGBE_WRITE_FLUSH(a)    (void) IXGBE_READ_REG(a, IXGBE_STATUS)
  83   89  
  84   90  #define IXGBE_WRITE_REG(a, reg, value)  \
  85   91          ddi_put32((OS_DEP(a))->reg_handle, \
  86   92              (uint32_t *)((uintptr_t)(a)->hw_addr + reg), (value))
  87   93  
  88   94  #define IXGBE_WRITE_REG_ARRAY(a, reg, index, value)     \
  89   95          IXGBE_WRITE_REG(a, ((reg) + ((index) << 2)), (value))
  90   96  
  91   97  #define IXGBE_READ_REG(a, reg)  \
  92   98          ddi_get32((OS_DEP(a))->reg_handle, \
  
    | 
      ↓ open down ↓ | 
    26 lines elided | 
    
      ↑ open up ↑ | 
  
  93   99              (uint32_t *)((uintptr_t)(a)->hw_addr + reg))
  94  100  
  95  101  #define IXGBE_READ_REG_ARRAY(a, reg, index)     \
  96  102          IXGBE_READ_REG(a, ((reg) + ((index) << 2)))
  97  103  
  98  104  #define msec_delay_irq  msec_delay
  99  105  #define IXGBE_HTONL     htonl
 100  106  #define IXGBE_NTOHL     ntohl
 101  107  #define IXGBE_NTOHS     ntohs
 102  108  
 103      -#define UNREFERENCED_PARAMETER(x)       _NOTE(ARGUNUSED(x))
      109 +#ifdef _BIG_ENDIAN
      110 +#define IXGBE_CPU_TO_LE32       BSWAP_32 
      111 +#define IXGBE_LE32_TO_CPUS      BSWAP_32
      112 +#else
      113 +#define IXGBE_CPU_TO_LE32(x)    (x)
      114 +#define IXGBE_LE32_TO_CPUS(x)   (x) 
      115 +#endif  /* _BIG_ENDIAN */
 104  116  
      117 +#define UNREFERENCED_PARAMETER(x)               _NOTE(ARGUNUSED(x))
      118 +#define UNREFERENCED_1PARAMETER(_p)             UNREFERENCED_PARAMETER(_p)
      119 +#define UNREFERENCED_2PARAMETER(_p, _q)         _NOTE(ARGUNUSED(_p, _q))
      120 +#define UNREFERENCED_3PARAMETER(_p, _q, _r)     _NOTE(ARGUNUSED(_p, _q, _r))
      121 +#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) _NOTE(ARGUNUSED(_p, _q,_r, _s))
      122 +
      123 +
      124 +
 105  125  typedef int8_t          s8;
 106  126  typedef int16_t         s16;
 107  127  typedef int32_t         s32;
 108  128  typedef int64_t         s64;
 109  129  typedef uint8_t         u8;
 110  130  typedef uint16_t        u16;
 111  131  typedef uint32_t        u32;
 112  132  typedef uint64_t        u64;
 113  133  typedef boolean_t       bool;
 114  134  
 115  135  struct ixgbe_osdep {
 116  136          ddi_acc_handle_t reg_handle;
 117  137          ddi_acc_handle_t cfg_handle;
 118  138          struct ixgbe *ixgbe;
 119  139  };
 120  140  
 121  141  #ifdef __cplusplus
 122  142  }
 123  143  #endif
 124  144  
 125  145  #endif  /* _IXGBE_OSDEP_H */
  
    | 
      ↓ open down ↓ | 
    11 lines elided | 
    
      ↑ open up ↑ | 
  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX