Print this page
5007142 Add ntohll and htonll to sys/byteorder.h
6717509 Need to use bswap/bswapq for byte swap of 64-bit integer on x32/x64
PSARC 2008/474

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/iscsi/iscsitgtd/t10_spc.h
          +++ new/usr/src/cmd/iscsi/iscsitgtd/t10_spc.h
↓ open down ↓ 19 lines elided ↑ open up ↑
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27   27  #ifndef _T10_SPC_H
  28   28  #define _T10_SPC_H
  29   29  
  30      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  31      -
  32   30  #ifdef __cplusplus
  33   31  extern "C" {
  34   32  #endif
  35   33  
  36   34  /*
  37   35   * []------------------------------------------------------------------[]
  38   36   * | SPC-3                                                              |
  39   37   * []------------------------------------------------------------------[]
  40   38   */
  41   39  
  42   40  /*
  43   41   * FIXED_SENSE_ADDL_INFO_LEN is the length of INFORMATION field
  44   42   * in fixed format sense data
  45   43   */
  46   44  #define FIXED_SENSE_ADDL_INFO_LEN 0xFFFFFFFF
  47   45  #define INFORMATION_SENSE_DESCR sizeof (struct scsi_information_sense_descr)
  48   46  
       47 +#include <sys/types.h>
       48 +#include <netinet/in.h>
  49   49  #include <sys/scsi/generic/inquiry.h>
  50   50  #include <sys/scsi/generic/mode.h>
  51   51  
  52   52  /*
  53   53   * SPC Command Functions
  54   54   */
  55   55  void spc_tur(struct t10_cmd *cmd, uint8_t *cdb, size_t cdb_len);
  56   56  void spc_request_sense(struct t10_cmd *cmd, uint8_t *cdb, size_t cdb_len);
  57   57  void spc_unsupported(struct t10_cmd *cmd, uint8_t *cdb, size_t cdb_len);
  58   58  void spc_inquiry(t10_cmd_t *cmd, uint8_t *cdb, size_t cdb_len);
↓ open down ↓ 18 lines elided ↑ open up ↑
  77   77  Boolean_t spc_decode_lu_addr(uint8_t *buf, int len, uint32_t *val);
  78   78  Boolean_t spc_encode_lu_addr(uint8_t *buf, int select_field, uint32_t lun);
  79   79  
  80   80  /*
  81   81   * SPC flags to use when setting various sense code flags
  82   82   */
  83   83  #define SPC_SENSE_EOM   0x01
  84   84  #define SPC_SENSE_FM    0x02
  85   85  #define SPC_SENSE_ILI   0x04
  86   86  
  87      -#ifdef _BIG_ENDIAN
  88      -#define htonll(x)   (x)
  89      -#define ntohll(x)   (x)
  90      -#else
  91      -#define htonll(x)   ((((unsigned long long)htonl(x & 0xffffffff)) << 32) + \
  92      -                    htonl(x >> 32))
  93      -#define ntohll(x)   ((((unsigned long long)ntohl(x)) << 32) + ntohl(x >> 32))
  94      -#endif
  95      -
  96   87  /*
  97   88   * []------------------------------------------------------------------[]
  98   89   * | SPC-3, revision 21c -- ASC/ASCQ values                             |
  99   90   * | The full tables can be found in Appendix D (numerical order) or    |
 100   91   * | section 4.5.6 (alphabetical order). There are close to fifteen     |
 101   92   * | pages of values which will not be included here. Only those used   |
 102   93   * | by the code.                                                       |
 103   94   * []------------------------------------------------------------------[]
 104   95   */
 105   96  #define SPC_ASC_FM_DETECTED     0x00 /* file-mark detected */
↓ open down ↓ 364 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX